
In the definitions above, bolded symbols on the left of the equality signs
are called recursion constants. It is crucial that in higher-order rational terms,
all arguments to recursion constants are bound variables and not other kinds
of terms. We call this restriction the prepattern restriction as it is similar to
Miller’s pattern restriction [24] except that we allow repetition of arguments. The
prepattern restriction marks the key difference between the higher-order rational
term R2and the infinitary term up. The term up is not rational because the
argument to up is succ x, which is not a bound variable.
3.2 Syntax
We build subsequent developments on canonical LF [19], a formulation of the
LF type theory where terms are always in their canonical form. Canonical forms
do not contain β-redexes and are fully η-expanded with respect to their typ-
ing, supporting bijective correspondences between object logic derivations and
the terms of the framework. One drawback of this presentation is that canon-
ical terms are not closed under syntactic substitutions, and the technique of
hereditary substitution addresses this problem [29].
The syntax of the theory follows the grammar shown in Fig. 2. We use the
standard notion of spines. For example, a term x M1M2M3will be written as
x·(M1;M2;M3)where xis the head and M1;M2;M3is the spine. To express
rational terms, we add recursive definitions of the form r:A=Mto the sig-
nature, where Mmust be contractive (judgment Mcontra) in that the head of
Mmust be a constant or a variable. Recursive definitions look like notational
definitions [26], but their semantics are very different. Recursive definitions are
interpreted recursively in that the definition Mmay mention the recursion con-
stant r, and other recursion constants including those defined later in the sig-
nature, while notational definitions in LF [26] cannot be recursive. Recursion
constants are treated specially as a syntactic entity that is different from vari-
ables or constructors (nonrecursive constants). To ensure the conservativity over
LF, we further require all definitions in Σto be linearly ordered. That is, only
in the body of a recursive definition can we “forward reference”, and we can only
forward reference other recursion constants. All other declarations must strictly
refer to names that have been defined previously. We write λx and Mto mean a
sequence of λ-abstractions and a sequence of terms respectively. We write x, y, z
for variables, c, d for term constants (also called constructors), afor type family
constants, and r, r0, r00 for recursion constants.
To enforce the prepattern restriction, we use a technical device called prepat-
tern Π-abstractions, and associated notion of prepattern variables and prepattern
spines. Prepattern Π-abstractions are written as Πx ˆ: A2. A1, and xwill be a
prepattern variable (written xˆ: A2) in A1. Moreover, in A1, if yis a variable
of a prepattern type Πw ˆ: A2.B, then the prepattern application of yto xwill
be realized as the head yfollowed by a prepattern spine ([x]), written y·([x]).
The semantics is that prepattern variables may only be substituted by other
prepattern variables, while ordinary variables can be substituted by arbitrary
terms (which include other prepattern variables). In a well-typed signature, if
5