1
(************************************************************************)
2
(* v * The Coq Proof Assistant / The Coq Development Team *)
3
(* <O___,, * CNRS-Ecole Polytechnique-INRIA Futurs-Universite Paris Sud *)
4
(* \VV/ **************************************************************)
5
(* // * This file is distributed under the terms of the *)
6
(* * GNU Lesser General Public License Version 2.1 *)
7
(************************************************************************)
9
(*i camlp4deps: "parsing/grammar.cma" i*)
11
(* $Id: g_ground.ml4 10346 2007-12-05 21:11:19Z aspiwack $ *)
25
(* declaring search depth as a global option *)
27
let ground_depth=ref 3
32
optname="Firstorder Depth";
33
optkey=SecondaryTable("Firstorder","Depth");
34
optread=(fun ()->Some !ground_depth);
38
| Some i->ground_depth:=(max i 0))}
40
declare_int_option gdopt
42
let congruence_depth=ref 100
47
optname="Congruence Depth";
48
optkey=SecondaryTable("Congruence","Depth");
49
optread=(fun ()->Some !congruence_depth);
52
None->congruence_depth:=0
53
| Some i->congruence_depth:=(max i 0))}
55
declare_int_option gdopt
57
let default_solver=(Tacinterp.interp <:tactic<auto with *>>)
59
let fail_solver=tclFAIL 0 (Pp.str "GTauto failed")
62
Ids of global_reference list
63
| Bases of Auto.hint_db_name list
66
let gen_ground_tac flag taco ext gl=
73
| None-> default_solver in
76
Void -> (fun gl -> empty_seq !ground_depth)
77
| Ids l-> create_with_ref_list l !ground_depth
78
| Bases l-> create_with_auto_hints l !ground_depth in
79
let result=ground_tac solver startseq gl in
81
with e ->qflag:=backup;raise e
83
(* special for compatibility with Intuition
85
let constant str = Coqlib.gen_constant "User" ["Init";"Logic"] str
87
let defined_connectives=lazy
88
[[],EvalConstRef (destConst (constant "not"));
89
[],EvalConstRef (destConst (constant "iff"))]
91
let normalize_evaluables=
94
None->unfold_in_concl (Lazy.force defined_connectives)
96
unfold_in_hyp (Lazy.force defined_connectives)
97
(Tacexpr.InHypType id)) *)
99
TACTIC EXTEND firstorder
100
[ "firstorder" tactic_opt(t) "using" ne_reference_list(l) ] ->
101
[ gen_ground_tac true (Option.map eval_tactic t) (Ids l) ]
102
| [ "firstorder" tactic_opt(t) "with" ne_preident_list(l) ] ->
103
[ gen_ground_tac true (Option.map eval_tactic t) (Bases l) ]
104
| [ "firstorder" tactic_opt(t) ] ->
105
[ gen_ground_tac true (Option.map eval_tactic t) Void ]
108
TACTIC EXTEND gintuition
109
[ "gintuition" tactic_opt(t) ] ->
110
[ gen_ground_tac false (Option.map eval_tactic t) Void ]
114
let default_declarative_automation gls =
116
(tclORELSE (Auto.h_trivial [] None)
117
(Cctac.congruence_tac !congruence_depth []))
121
(Cctac.congruence_tac !congruence_depth [])))
127
Decl_proof_instr.register_automation_tac default_declarative_automation