function
[] -> Gramext.action (fun (loc: Ast.location) -> action vl loc)
| NoBinding :: tl -> Gramext.action (fun _ -> aux vl tl)
- (* LUCA: DEFCON 5 BEGIN *)
+ (* LUCA: DEFCON 4 BEGIN *)
| Binding (name, Env.TermType) :: tl ->
Gramext.action
(fun (v:Ast.term) ->
aux ((name, (Env.ListType t, Env.ListValue v)) :: vl) tl)
| Env _ :: tl ->
Gramext.action (fun (v:CicNotationEnv.t) -> aux (v @ vl) tl)
- (* LUCA: DEFCON 5 END *)
+ (* LUCA: DEFCON 4 END *)
in
aux [] (List.rev bindings)
(fun term body -> Ast.Binder (binder, (term, ty), body))
terms body (* terms are names: either Ident or FreshVar *)
+let fold_exists terms ty body =
+ List.fold_right
+ (fun term body ->
+ let lambda = Ast.Binder (`Lambda, (term, ty), body) in
+ Ast.Appl [ Ast.Symbol ("exists", 0); lambda ])
+ terms body
+
let fold_binder binder pt_names body =
List.fold_right
(fun (names, ty) body -> fold_cluster binder names ty body)
];
binder: [
[ SYMBOL <:unicode<Pi>> (* Π *) -> `Pi
- | SYMBOL <:unicode<exists>> (* ∃ *) -> `Exists
+(* | SYMBOL <:unicode<exists>> |+ ∃ +| -> `Exists *)
| SYMBOL <:unicode<forall>> (* ∀ *) -> `Forall
| SYMBOL <:unicode<lambda>> (* λ *) -> `Lambda
]
| blob = UNPARSED_META ->
let meta = !parse_level2_meta_ref (Stream.of_string blob) in
match meta with
- | Ast.Variable (Ast.FreshVar _) -> meta
+ | Ast.Variable (Ast.FreshVar _)
+ | Ast.Variable (Ast.IdentVar _) -> meta
| Ast.Variable (Ast.TermVar "_") -> Ast.Ident ("_", None)
| _ -> failwith "Invalid index name."
]
[
[ b = binder; (vars, typ) = binder_vars; SYMBOL "."; body = term ->
return_term loc (fold_cluster b vars typ body)
+ | SYMBOL <:unicode<exists>> (* ∃ *);
+ (vars, typ) = binder_vars; SYMBOL "."; body = term ->
+ return_term loc (fold_exists vars typ body)
]
];
term: LEVEL "70L" (* apply *)