- script_entry: [
- [ theorem = theorem_cmd;
- proof = OPT [
- proof_cmd; tacticals = LIST1 tactical0; qed = qed_cmd ->
- (tacticals, qed)
- ] ->
- let (loc', flavour, name', typ, body_verbatim) = theorem in
- let name'' =
- match proof with
- | None | Some (_, (_, None)) -> None
- | Some (_, (_, Some name)) -> Some name
+ inductive_spec: [ [
+ fst_name = IDENT; params = LIST0 [
+ PAREN "("; names = LIST1 IDENT SEP SYMBOL ","; SYMBOL ":";
+ typ = term; PAREN ")" -> (names, typ) ];
+ SYMBOL ":"; fst_typ = term; SYMBOL <:unicode<def>>; OPT SYMBOL "|";
+ fst_constructors = LIST0 constructor SEP SYMBOL "|";
+ tl = OPT [ "with";
+ types = LIST1 [
+ name = IDENT; SYMBOL ":"; typ = term; SYMBOL <:unicode<def>>;
+ OPT SYMBOL "|"; constructors = LIST0 constructor SEP SYMBOL "|" ->
+ (name, true, typ, constructors) ] SEP "with" -> types
+ ] ->
+ let params =
+ List.fold_right
+ (fun (names, typ) acc ->
+ (List.map (fun name -> (name, typ)) names) @ acc)
+ params []
+ in
+ let fst_ind_type = (fst_name, true, fst_typ, fst_constructors) in
+ let tl_ind_types = match tl with None -> [] | Some types -> types in
+ let ind_types = fst_ind_type :: tl_ind_types in
+ (params, ind_types)
+ ] ];
+
+ macro: [[
+ [ IDENT "abort" ] -> TacticAst.Abort loc
+ | [ IDENT "quit" ] -> TacticAst.Quit loc
+ | [ IDENT "print" ]; name = QSTRING -> TacticAst.Print (loc, name)
+ | [ IDENT "undo" ]; steps = OPT NUM ->
+ TacticAst.Undo (loc, int_opt steps)
+ | [ IDENT "redo" ]; steps = OPT NUM ->
+ TacticAst.Redo (loc, int_opt steps)
+ | [ IDENT "check" ]; t = term ->
+ TacticAst.Check (loc, t)
+ | [ IDENT "print" ]; name = QSTRING -> TacticAst.Print (loc, name)
+ ]];
+
+ alias_spec: [
+ [ IDENT "id"; id = QSTRING; SYMBOL "="; uri = QSTRING ->
+ let alpha = "[a-zA-Z]" in
+ let num = "[0-9]+" in
+ let ident_cont = "\\("^alpha^"\\|"^num^"\\|_\\|\\\\\\)" in
+ let ident = "\\("^alpha^ident_cont^"*\\|_"^ident_cont^"+\\)" in
+ let rex = Str.regexp ("^"^ident^"$") in
+ if Str.string_match rex id 0 then
+ let rex = Str.regexp
+ ("^\\(cic:/\\|theory:/\\)"^ident^
+ "\\(/"^ident^"+\\)*\\(\\."^ident^"\\)+"^
+ "\\(#xpointer("^ num^"\\(/"^num^"\\)+)\\)?$")