Here is the syntax for Elf in abbreviated form. Terms form the join of the three levels in the LF calculus, which are not distinguished syntactically. The comment approximates the meaning in LF.
sigentry ::= id : term. query ::= term. term ::= type % Type | term1 -> term2 % A -> B | term1 <- term2 % B -> A | {id : term1} term2 % \Pi x:A. K or \Pi x:A. B | [id : term1] term2 % \lambda x:A. B or \lambda x:A. M | term1 term2 % A M or M N | term : term % explicit cast | _ % hole, to be filled by term reconstruction | {id} term % same as {id:_} term | [id] term % same as [id:_] term
In the order of binding strength we disambiguate as follows:
For example, the following are parsed identically:
d : a <- b <- {x} c x -> p x. d : ({x} c x -> p x) -> b -> a. d : ((a <- b) <- ({x:_} ((c x) -> (p x)))).