| OCR Text |
Show 125 generating code for clauses; there is, to date, no published description of the system. 5.4 Re ular Trees : Re resentation and lm lementation_ In this section we present details of the representation and implemen-tation of regular trees as used in the prototype implementation of TFEL. All the algorithms discussed below have been implemented in RLISP as part of a regular tree manipulation system. Regular trees enjoy two different representations in the type-inference system: as expressions - the form in which a user would actually express types, and as leaf linear systems - which are suited to algorithms for solving inequations and computing the cartesian closure of regular trees. We also present examples of the effect of the inclusion and cartesian closure algorithm. Regular tree expressions are mapped to $-expressions with the following abstract syntax: RT ::= v(X} -- a variable I c(X} -- a constant I [FNAP, c(X}, RT] -- a constructor applied to another RT I [TUPLE,[r1, ••• ,rn]] -- a tuple of regular trees I [PLUS,R1 ,R2] -- sum of regular trees I [FIX,v(X},R1] -- fix-point I [ARRAY,R1] -- arbitrary-size tuples over R1 Leaf-linear systems are represented as: |