-
Notifications
You must be signed in to change notification settings - Fork 3
/
IsaHipster.thy
147 lines (115 loc) · 3.72 KB
/
IsaHipster.thy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
theory IsaHipster
imports Main "$ISABELLE_HOME/src/HOL/TPTP/ATP_Problem_Import"
keywords "hipster" "hipster_cond" "cohipster" :: thy_decl
begin
ML\<open>
structure Hipster_Setup =
struct
(* Set these to your path to the Hipster directory *)
val basepath =
case getenv "HIPSTER_HOME" of
"" => let val _ = Output.warning ("Hipster: Environment variable $HIPSTER_HOME not set."^
"\n Using current directory.")
in "./" end
| hip_home => hip_home
val filepath = basepath^"GenCode/";
(* Set these to your path to Haskell executables for HipSpec/QuickSpec/Hipspecifyer *)
val haskell_path =
case getenv "HASKELL_HOME" of
"" => let val _ = Output.warning ("Hipster: Environment variable $HASKELL_HOME not set."^
"\n Using current directory.")
in "./" end
| haskell_home => haskell_home;
val max_term_size = "5";
val tipSpec_cmd = haskell_path ^ "tip-spec -s " ^ max_term_size;
val tipTransl_cmd = haskell_path ^ "tip --hipster ";
val tipGHC_cmd = haskell_path ^ "tip-ghc ";
end
structure Hipster_Rules = Named_Thms
(val name = @{binding "thy_expl"}
val description = "Theorems discovered by theory exploration");
(* A flag which tells Hipster that it should disregard equations
which *only* feature functions defined in another theory, i.e. a library. *)
val thy_interesting = Attrib.setup_config_bool @{binding thy_interesting} (K true)
\<close>
setup \<open>Hipster_Rules.setup\<close>
ML_file "MiscData.ML"
ML_file "HipsterUtils.ML"
ML_file "InductionData.ML"
ML_file "LemmaData.ML"
ML_file "CTacs/CTac.ML"
ML_file "SledgehammerTacs.ML"
ML_file "HipTacOps.ML"
ML_file "ThyExplData.ML"
ML_file "IndTacs.ML"
ML_file "RecIndTacs.ML"
ML_file "RecIndLemmaSpecTacs.ML"
ML_file "CTacs/InductCTac.ML"
ML_file "CoIndTacs.ML"
ML_file "CoinductionData.ML"
ML_file "CTacs/CoinductCTac.ML"
ML_file "TacticData.ML"
ML_file "HipsterExplore.ML"
ML_file "ExplLemmaTac.ML"
ML_file "HipsterIsar.ML"
method_setup hipster_induct_simp = \<open>
Scan.lift (Scan.succeed
(fn ctxt => SIMPLE_METHOD
(Ind_Tacs.induct_simp_tac ctxt)))
\<close>
method_setup hipster_induct_simp_metis = \<open>
Attrib.thms >> (fn thms => fn ctxt =>
SIMPLE_METHOD
(Ind_Tacs.induct_simp_metis ctxt thms))
\<close>
method_setup hipster_induct_sledgehammer = \<open>
Scan.lift (Scan.succeed
(fn ctxt => SIMPLE_METHOD
(Ind_Tacs.induct_sledgehammer_tac ctxt)))
\<close>
method_setup hipster_recind_simp = \<open>
Scan.lift (Scan.succeed
(fn ctxt => SIMPLE_METHOD
((Rec_Ind_Tacs.recinduct_simp ctxt))))
\<close>
method_setup hipster_recind = \<open>
Scan.lift (Scan.succeed
(fn ctxt => SIMPLE_METHOD
((Rec_Ind_Tacs.recinduct_simp_or_sledgehammer ctxt))))
\<close>
method_setup recind_lemmaspec = \<open>
Scan.lift (Scan.succeed
(fn ctxt => SIMPLE_METHOD
((Rec_Ind_Lemma_Spec_Tacs.koen_induct ctxt))))
\<close>
(* Use simp and or sledgehammer, then prints out Isar snippet using standard Isabelle tactics. *)
method_setup hipster_induct = \<open>
Scan.lift (Scan.succeed
(fn ctxt => SIMPLE_METHOD
(Induct_CTac.hipster_induct ctxt)))
\<close>
method_setup hipster_coinduct_sledgehammer = \<open>
Scan.lift (Scan.succeed
(fn ctxt => SIMPLE_METHOD
(Coind_Tacs.coinduct_and_sledgehammer ctxt)))
\<close>
method_setup lemma_explore = \<open>
Scan.lift (Scan.succeed
(fn ctxt => SIMPLE_METHOD
(Expl_Lemma_Tac.expl_goal_tac ctxt)))
\<close>
(*
ML{*
Method.setup;
*}
method_setup hipster_goal = {*
*}*)
(*
(* Default value for tactics is induct_simp_metis.
Use setup command to change to other hard/routine tactics.
*)
setup{*
Tactic_Data.set_induct_simp_metis;
*}
*)
end