Re: [Toss-devel] Speagram and typed terms in Toss
Status: Beta
Brought to you by:
lukaszkaiser
|
From: Lukasz S. <luk...@gm...> - 2012-06-06 23:10:28
|
*Translation* A term "f(t1,...,tn):ty" is translated as the sum of translations of "t1", ..., "tn", plus a tuple f(e0,e1,...,en) (of relation "f"), where elements e1 upto en were introduced to represent terms "t1"..."tn" and e0 is introduced to represent f(t1,...,tn), plus translation of "ty", plus a tuple isa(e0,et) of relation "isa" (representing both "of type" and "subtype") where et was introduced to represent "ty". So, a list "Cons" would be a triple, not a pair as currently in examples/Parsing.toss. We might also have a "projection" operation that takes all tuples containing elements connected via "isa" to a given element (given type), and contracting the hypergraph into a structure without those elements, thus generating a clean structure, where for example the above "Cons" would be a pair (binary) connecting directly the elements in the structure. |