Now that the concepts of relations and composition are clear in my mind, I need to invent a simple textual notation to represent these things. * application * and, or, not Is it necessary to have a functional form for relations, to do and, or, not without infinite regression? An application is the combination of a relation and a name-map to create a new relation. This is similar to function application in e.g. lisp, C, or relation application in prolog. In these languages, an application specifies the external names, but relies on position to imply the internal names: def fib(Fn, n): ... fib(f, num) This is not necessarily a good way to work, because it imposes an artificial order on the parameters. Here is an alternative: fib(Fn:f, n:num) In this case, the name-map is specified explicitly. Perhaps the best way to specify this is: fib Fn n f num There should be flexibility to bind an external name to multiple internal names, or vice versa: fib Fn n n f num number or fib Fn n a a This provides a simple self-join functionality. Is that a good idea? How about a using a table for the whole composition? e.g.: pythag a b c * i1 i2 o * i1 i2 o * i1 i2 o + i1 i2 o This is actually not too bad for a notation... We can turn it sideways, to save some space, assuming that there would be more variables than component relations. pythag * * * + a i1 i2 b i1 i2 c i1 i2 o i1 o i2 o o Another approach actually describes the composition as a number of relations: ext --- a b c rel inst ------------- * sqr a * sqr b * sqr c + add inst int ext ------------------- sqr a i1 a sqr a i2 a sqr a o A sqr b i1 b sqr b i2 b sqr b o B sqr c i1 c sqr c i2 c sqr c o C add i1 A add i2 B add o C This looks a bit ugly to a person, but represents the situation exactly. If we do an "undrool" on the last relation, it might be easier to read. inst int ext ------------------- sqr a i1 a i2 o A sqr b i1 b i2 o B sqr c i1 c i2 o C add i1 A i2 B o C Still not really happy...! How about a more conventional syntax? pythag a b c and * o:A i1:a i2:a * o:B i1:b i2:b * o:C i1:c i2:c + o:C i1:a i2:b or perhaps scrap the named args idea and use position instead: pythag c a b and * A a a * B b b * C c c + C A B That's actually clearer. Could use both alternatives like python. So - what's to be done next? I could write a python program to read the pythonesque syntax and output the relational syntax. Where am I going with all this? I want the graphical syntax, but can't do that on my iPAQ at the moment, until I learn pygtk/glade properly. How about reimplementing my tsv tools in python and bash, and with column names everywhere? Yeah, that would be useful.