# Algebra for computer science and function nesting

The fundamental mathematical basis of computer science is that code and data are the same things. A sequence of bits can represent real numbers, integers, vectors, groups, matrices, video , audio, or programs, algorithms or even proofs. When we try to describe these systems mathematically, then it should not be surprising when we encounter a value that is also a map and a map with an image that consists of more maps.  For example, in a UNIX/MULTICS type file system if the file system is represented by a map F:Paths → Data, the data for a directory could also be considered to be or to represent a map. If F(home/snowden/passwords) is block of text, then F(home/snowden) is or encodes a map from strings to some information about where to find the file. In the original UNIX file systems F(home/snowden) is a map from strings to inode numbers. So (F(home/snowden))(passwords) is the inode number of the file that contains the passwords. UNIX style tree structured file systems are generally embedded in simpler file systems that map inode numbers to file contents S:Inode → Data. So the resolution of file names to data involves something like this

F(home/snowden/passwords) =  S(S(S((S(root)(home)))(snowden))(passwords)))

In more detail:

i1 = S(root)(home); i2 = S(i1)(snowden);  i3 = S(i2)(password);

data = S(i3).

This kind of construct is familiar to programmers, but seems weird in math even though it’s well defined and not all that deep.

Advertisements