| ExistsElim of loc * 'term * 'ident * 'term * 'ident * 'term
| AndElim of loc * 'term * 'ident * 'term * 'ident * 'term
| RewritingStep of
- loc * 'term option * 'term * 'term option * Cic.name option
+ loc * 'term option * 'term *
+ [ `Term of 'term | `Auto of (string * string) list ] * Cic.name option
type search_kind = [ `Locate | `Hint | `Match | `Elim ]
| Thesisbecomes (_, term) -> "the thesis becomes " ^ term_pp term
| ExistsElim (_, term0, ident, term, ident1, term1) -> "by " ^ term_pp term0 ^ "let " ^ ident ^ ":" ^ term_pp term ^ "such that " ^ term_pp term1 ^ "(" ^ ident1 ^ ")"
| AndElim (_, term, ident1, term1, ident2, term2) -> "by " ^ term_pp term ^ "we have " ^ term_pp term1 ^ " (" ^ ident1 ^ ") " ^ "and " ^ term_pp term2 ^ " (" ^ ident2 ^ ")"
- | RewritingStep (_, term, term1, term2, cont) -> (match term with None -> " " | Some term -> "obtain " ^ term_pp term) ^ "=" ^ term_pp term1 ^ (match term2 with None -> "_" | Some term2 -> term_pp term2) ^ (match cont with None -> " done" | Some Cic.Anonymous -> "" | Some (Cic.Name id) -> " we proved " ^ id)
+ | RewritingStep (_, term, term1, term2, cont) -> (match term with None -> " " | Some term -> "obtain " ^ term_pp term) ^ "=" ^ term_pp term1 ^ (match term2 with `Auto params -> "_" ^ String.concat " " (List.map (fun (k,v) -> if v <> "" then k ^ "=" ^ v else k) params) | `Term term2 -> term_pp term2) ^ (match cont with None -> " done" | Some Cic.Anonymous -> "" | Some (Cic.Name id) -> " we proved " ^ id)
| Case (_, id, args) ->
"case" ^ id ^
String.concat " "
let metasenv,cic'= disambiguate_term context metasenv term2 in
let metasenv,cic'' =
match term3 with
- None -> metasenv,None
- | Some t ->
+ `Auto _ as t -> metasenv,t
+ | `Term t ->
let metasenv,t = disambiguate_term context metasenv t in
- metasenv,Some t in
+ metasenv,`Term t in
metasenv,GrafiteAst.RewritingStep (loc, cic, cic', cic'', cont)
GrafiteAst.ApplyS (loc, t, params)
| IDENT "assumption" ->
GrafiteAst.Assumption loc
- | IDENT "auto"; params =
- LIST0 [ i = IDENT -> i,"" | i = IDENT ; SYMBOL "="; v = [ v = int ->
- string_of_int v | v = IDENT -> v ] -> i,v ] ->
+ | IDENT "auto"; params = auto_params ->
GrafiteAst.Auto (loc,params)
| IDENT "clear"; ids = LIST1 IDENT ->
GrafiteAst.Clear (loc, ids)
| IDENT "case" ; id = IDENT ; params=LIST0[LPAREN ; i=IDENT ;
SYMBOL":" ; t=tactic_term ; RPAREN -> i,t] ->
GrafiteAst.Case(loc,id,params)
- | IDENT "obtain" ; termine=tactic_term ; SYMBOL "=" ; t1=tactic_term ; IDENT "by" ; t2=[ t=tactic_term -> Some t | SYMBOL "_" -> None ] ; cont=rewriting_step_continuation ->
+ | IDENT "obtain" ; termine=tactic_term ; SYMBOL "=" ; t1=tactic_term ; IDENT "by" ; t2=[ t=tactic_term -> `Term t | SYMBOL "_" ; params = auto_params -> `Auto params ] ; cont=rewriting_step_continuation ->
GrafiteAst.RewritingStep(loc, Some termine, t1, t2, cont)
- | SYMBOL "=" ; t1=tactic_term ; IDENT "by" ; t2=[ t=tactic_term -> Some t | SYMBOL "_" -> None ] ; cont=rewriting_step_continuation ->
+ | SYMBOL "=" ; t1=tactic_term ; IDENT "by" ; t2=[ t=tactic_term -> `Term t | SYMBOL "_" ; params = auto_params -> `Auto params ] ;
+ cont=rewriting_step_continuation ->
GrafiteAst.RewritingStep(loc, None, t1, t2, cont)
]
+];
+ auto_params: [
+ [ params =
+ LIST0 [ i = IDENT -> i,"" | i = IDENT ; SYMBOL "="; v = [ v = int ->
+ string_of_int v | v = IDENT -> v ] -> i,v ] ->
+ params
+ ]
];
by_continuation: [
[ IDENT "we" ; IDENT "proved" ; ty = tactic_term ; LPAREN ; id = IDENT ; RPAREN ; t1 = OPT [IDENT "that" ; IDENT "is" ; IDENT "equivalent" ; "to" ; t2 = tactic_term -> t2] -> BYC_weproved (ty,Some id,t1)
CicTypeChecker.type_of_aux' metasenv context rhs CicUniv.empty_ugraph in
let just =
match just with
- None ->
- Tactics.auto ~dbd ~params:["paramodulation","1"; "timeout","3"] ~universe
- | Some just -> Tactics.apply just
+ `Auto params ->
+ let params =
+ if not (List.exists (fun (k,_) -> k = "paramodulation") params) then
+ ("paramodulation","1")::params
+ else params in
+ let params =
+ if not (List.exists (fun (k,_) -> k = "timeout") params) then
+ ("timeout","3")::params
+ else params
+ in
+ Tactics.auto ~dbd ~params ~universe
+ | `Term just -> Tactics.apply just
in
match lhs with
None ->
val rewritingstep :
dbd:HMysql.dbd -> universe:Universe.universe -> Cic.term option -> Cic.term ->
- Cic.term option -> Cic.name option -> ProofEngineTypes.tactic
+ [ `Term of Cic.term | `Auto of (string * string) list ] -> Cic.name option -> ProofEngineTypes.tactic