b = binder_low; (vars, typ) = binder_vars; SYMBOL "."; body = term ->
let binder = mk_binder_ast b typ vars body in
return_term loc binder
+ | b = binder_high; (vars, typ) = binder_vars; SYMBOL "."; body = term ->
+ let binder = mk_binder_ast b typ vars body in
+ return_term loc binder
+ | t1 = term; SYMBOL <:unicode<to>> (* → *); t2 = term ->
+ return_term loc (CicAst.Binder (`Pi, (Cic.Anonymous, Some t1), t2))
]
| "logic_add" LEFTA [ (* nothing here by default *) ]
| "logic_mult" LEFTA [ (* nothing here by default *) ]
in
CicAst.Appl (aux t1 @ [t2])
]
- | "binder" RIGHTA
- [
- b = binder_high; (vars, typ) = binder_vars; SYMBOL "."; body = term ->
- let binder = mk_binder_ast b typ vars body in
- return_term loc binder
- | t1 = term; SYMBOL <:unicode<to>> (* → *); t2 = term ->
- return_term loc (CicAst.Binder (`Pi, (Cic.Anonymous, Some t1), t2))
- ]
| "simple" NONA
[ sort = sort -> CicAst.Sort sort
| n = substituted_name -> return_term loc n
Input Should be parsed as Derived constraint
on precedence
--------------------------------------------------------------------------------
-\lambda x.x y ((\lambda x.x) y) lambda > apply
+\lambda x.x y \lambda x.(x y) lambda > apply
S x = y (= (S x) y) apply > infix operators
\forall x.x=x (\forall x.(= x x)) infix operators > binders
\lambda x.x \to x \lambda. (x \to x) \to > \lambda
Precedence total order:
- \to > lambda > apply > infix operators > binders
+ apply > infix operators > to > binders
where binders are all binders except lambda (i.e. \forall, \pi, \exists)
should respond with:
- (\lambda x.x y)
+ \lambda x.(x y)
(eq (S x) y)
\forall x.(eq x x)
\lambda x.(x \to x)