| NRepeat of loc * ntactic
| NBlock of loc * ntactic list
(* Declarative langauge *)
+ (* Not the best idea to use a string directly, an abstract type for identifiers would be better *)
| Assume of loc * string * nterm (* loc, identifier, term *)
+ | Suppose of loc * nterm *string * nterm option
type nmacro =
| NCheck of loc * nterm
"(" ^ String.concat " " (List.map (pp_ntactic status ~map_unicode_to_tex) l)^ ")"
| NRepeat (_,t) -> "nrepeat " ^ pp_ntactic status ~map_unicode_to_tex t
| Assume (_, ident, term) -> "assume" ^ ident ^ ":" ^ NotationPp.pp_term status term
+ | Suppose (_,term,ident,term1) -> "suppose" ^ NotationPp.pp_term status term ^ "(" ^ ident ^ ")" ^ (match
+ term1 with None -> "" | Some t -> " that is equivalent to " ^ NotationPp.pp_term status t)
;;
let pp_nmacro status = function
|GrafiteAst.NRepeat (_,tac) ->
NTactics.repeat_tac (f f (text, prefix_len, tac))
|GrafiteAst.Assume (_,id,t) -> Declarative.assume id t
+ |GrafiteAst.Suppose (_,t,id,t1) -> Declarative.suppose t id t1
in
aux aux tac (* trick for non uniform recursion call *)
;;
| SYMBOL "#"; SYMBOL "_" -> G.NTactic(loc,[ G.NIntro (loc,"_")])
| SYMBOL "*" -> G.NTactic(loc,[ G.NCase1 (loc,"_")])
| SYMBOL "*"; "as"; n=IDENT -> G.NTactic(loc,[ G.NCase1 (loc,n)])
- | IDENT "assume"; id = IDENT; SYMBOL ":"; t = tactic_term -> G.NTactic (loc,[G.Assume (loc,id,t)])
+ | IDENT "assume" ; id = IDENT; SYMBOL ":"; t = tactic_term -> G.NTactic (loc,[G.Assume (loc,id,t)])
+ | IDENT "suppose" ; t = tactic_term ; LPAREN ; id = IDENT ; RPAREN ; t1 = OPT [IDENT "that"; IDENT
+ "is"; IDENT "equivalent"; "to"; t' = tactic_term -> t'] -> G.NTactic (loc,[G.Suppose (loc,t,id,t1)])
]
];
auto_fixed_param: [
let assume name ty =
exact_tac ("",0,(Ast.Binder (`Lambda,(Ast.Ident (name,None),Some ty),Ast.Implicit `JustOne)))
+
+let suppose t id t1 =
+ let t1 = match t1 with None -> t | Some t1 -> t1 in
+ exact_tac ("",0,(Ast.Binder (`Lambda,(Ast.Ident (id,None),Some t1),Ast.Implicit `JustOne)))
*)
val assume : string -> NotationPt.term -> 's NTacStatus.tactic
+val suppose : NotationPt.term -> string -> NotationPt.term option -> 's NTacStatus.tactic
<keyword>lapply</keyword>
<keyword>destruct</keyword>
<keyword>assume</keyword>
+ <keyword>suppose</keyword>
+ <keyword>that</keyword>
+ <keyword>is</keyword>
+ <keyword>equivalent</keyword>
+ <keyword>to</keyword>
<!-- commands -->
<keyword>alias</keyword>