| author | wenzelm |
| Wed, 14 Sep 2005 23:14:58 +0200 | |
| changeset 17395 | a05e20f6a31a |
| parent 17386 | b110730a24fd |
| child 17421 | 0382f6877b98 |
| permissions | -rw-r--r-- |
| 10519 | 1 |
(* Title: HOL/Main.thy |
2 |
ID: $Id$ |
|
| 14350 | 3 |
Author: Stefan Berghofer, Tobias Nipkow, Tjark Weber, Markus Wenzel (TU Muenchen) |
| 10519 | 4 |
*) |
| 9619 | 5 |
|
| 12024 | 6 |
header {* Main HOL *}
|
7 |
||
| 15131 | 8 |
theory Main |
| 17386 | 9 |
imports Commutative_Ring Refute Reconstruction |
| 15151 | 10 |
|
| 15131 | 11 |
begin |
|
9650
6f0b89f2a1f9
Main now new-style theory; added Main.ML for compatibility;
wenzelm
parents:
9619
diff
changeset
|
12 |
|
| 12024 | 13 |
text {*
|
14 |
Theory @{text Main} includes everything. Note that theory @{text
|
|
15 |
PreList} already includes most HOL theories. |
|
16 |
*} |
|
17 |
||
|
17395
a05e20f6a31a
hide the rather generic names used in theory Commutative_Ring;
wenzelm
parents:
17386
diff
changeset
|
18 |
|
|
a05e20f6a31a
hide the rather generic names used in theory Commutative_Ring;
wenzelm
parents:
17386
diff
changeset
|
19 |
subsection {* Misc *}
|
|
a05e20f6a31a
hide the rather generic names used in theory Commutative_Ring;
wenzelm
parents:
17386
diff
changeset
|
20 |
|
|
a05e20f6a31a
hide the rather generic names used in theory Commutative_Ring;
wenzelm
parents:
17386
diff
changeset
|
21 |
text {* Hide the rather generic names used in theory @{text Commutative_Ring}. *}
|
|
a05e20f6a31a
hide the rather generic names used in theory Commutative_Ring;
wenzelm
parents:
17386
diff
changeset
|
22 |
|
|
a05e20f6a31a
hide the rather generic names used in theory Commutative_Ring;
wenzelm
parents:
17386
diff
changeset
|
23 |
hide (open) const |
|
a05e20f6a31a
hide the rather generic names used in theory Commutative_Ring;
wenzelm
parents:
17386
diff
changeset
|
24 |
Pc Pinj PX |
|
a05e20f6a31a
hide the rather generic names used in theory Commutative_Ring;
wenzelm
parents:
17386
diff
changeset
|
25 |
Pol Add Sub Mul Pow Neg |
|
a05e20f6a31a
hide the rather generic names used in theory Commutative_Ring;
wenzelm
parents:
17386
diff
changeset
|
26 |
add mul neg sqr pow sub |
|
a05e20f6a31a
hide the rather generic names used in theory Commutative_Ring;
wenzelm
parents:
17386
diff
changeset
|
27 |
norm |
|
a05e20f6a31a
hide the rather generic names used in theory Commutative_Ring;
wenzelm
parents:
17386
diff
changeset
|
28 |
|
|
a05e20f6a31a
hide the rather generic names used in theory Commutative_Ring;
wenzelm
parents:
17386
diff
changeset
|
29 |
|
| 12024 | 30 |
subsection {* Configuration of the code generator *}
|
| 11533 | 31 |
|
32 |
types_code |
|
33 |
"bool" ("bool")
|
|
|
16770
1f1b1fae30e4
Auxiliary functions to be used in generated code are now defined using "attach".
berghofe
parents:
16635
diff
changeset
|
34 |
attach (term_of) {*
|
|
1f1b1fae30e4
Auxiliary functions to be used in generated code are now defined using "attach".
berghofe
parents:
16635
diff
changeset
|
35 |
fun term_of_bool b = if b then HOLogic.true_const else HOLogic.false_const; |
|
1f1b1fae30e4
Auxiliary functions to be used in generated code are now defined using "attach".
berghofe
parents:
16635
diff
changeset
|
36 |
*} |
|
1f1b1fae30e4
Auxiliary functions to be used in generated code are now defined using "attach".
berghofe
parents:
16635
diff
changeset
|
37 |
attach (test) {*
|
|
1f1b1fae30e4
Auxiliary functions to be used in generated code are now defined using "attach".
berghofe
parents:
16635
diff
changeset
|
38 |
fun gen_bool i = one_of [false, true]; |
|
1f1b1fae30e4
Auxiliary functions to be used in generated code are now defined using "attach".
berghofe
parents:
16635
diff
changeset
|
39 |
*} |
| 11533 | 40 |
|
41 |
consts_code |
|
42 |
"True" ("true")
|
|
43 |
"False" ("false")
|
|
44 |
"Not" ("not")
|
|
45 |
"op |" ("(_ orelse/ _)")
|
|
46 |
"op &" ("(_ andalso/ _)")
|
|
| 16587 | 47 |
"HOL.If" ("(if _/ then _/ else _)")
|
| 11533 | 48 |
|
|
16770
1f1b1fae30e4
Auxiliary functions to be used in generated code are now defined using "attach".
berghofe
parents:
16635
diff
changeset
|
49 |
"wfrec" ("\<module>wf'_rec?")
|
|
1f1b1fae30e4
Auxiliary functions to be used in generated code are now defined using "attach".
berghofe
parents:
16635
diff
changeset
|
50 |
attach {*
|
|
1f1b1fae30e4
Auxiliary functions to be used in generated code are now defined using "attach".
berghofe
parents:
16635
diff
changeset
|
51 |
fun wf_rec f x = f (wf_rec f) x; |
|
1f1b1fae30e4
Auxiliary functions to be used in generated code are now defined using "attach".
berghofe
parents:
16635
diff
changeset
|
52 |
*} |
|
13093
ab0335307905
code generator: wfrec combinator is now implemented by ML function wf_rec.
berghofe
parents:
12554
diff
changeset
|
53 |
|
|
14102
8af7334af4b3
- Installed specific code generator for equality enforcing that
berghofe
parents:
14049
diff
changeset
|
54 |
quickcheck_params [default_type = int] |
|
8af7334af4b3
- Installed specific code generator for equality enforcing that
berghofe
parents:
14049
diff
changeset
|
55 |
|
| 13755 | 56 |
ML {*
|
| 16635 | 57 |
local |
58 |
||
59 |
fun eq_codegen thy defs gr dep thyname b t = |
|
|
14102
8af7334af4b3
- Installed specific code generator for equality enforcing that
berghofe
parents:
14049
diff
changeset
|
60 |
(case strip_comb t of |
| 15531 | 61 |
(Const ("op =", Type (_, [Type ("fun", _), _])), _) => NONE
|
|
14102
8af7334af4b3
- Installed specific code generator for equality enforcing that
berghofe
parents:
14049
diff
changeset
|
62 |
| (Const ("op =", _), [t, u]) =>
|
|
8af7334af4b3
- Installed specific code generator for equality enforcing that
berghofe
parents:
14049
diff
changeset
|
63 |
let |
| 16635 | 64 |
val (gr', pt) = Codegen.invoke_codegen thy defs dep thyname false (gr, t); |
65 |
val (gr'', pu) = Codegen.invoke_codegen thy defs dep thyname false (gr', u) |
|
|
14102
8af7334af4b3
- Installed specific code generator for equality enforcing that
berghofe
parents:
14049
diff
changeset
|
66 |
in |
| 15531 | 67 |
SOME (gr'', Codegen.parens |
|
14102
8af7334af4b3
- Installed specific code generator for equality enforcing that
berghofe
parents:
14049
diff
changeset
|
68 |
(Pretty.block [pt, Pretty.str " =", Pretty.brk 1, pu])) |
|
8af7334af4b3
- Installed specific code generator for equality enforcing that
berghofe
parents:
14049
diff
changeset
|
69 |
end |
| 15531 | 70 |
| (t as Const ("op =", _), ts) => SOME (Codegen.invoke_codegen
|
| 16635 | 71 |
thy defs dep thyname b (gr, Codegen.eta_expand t ts 2)) |
72 |
| _ => NONE); |
|
73 |
||
74 |
in |
|
75 |
||
76 |
val eq_codegen_setup = [Codegen.add_codegen "eq_codegen" eq_codegen]; |
|
77 |
||
78 |
end; |
|
| 13755 | 79 |
*} |
|
13093
ab0335307905
code generator: wfrec combinator is now implemented by ML function wf_rec.
berghofe
parents:
12554
diff
changeset
|
80 |
|
|
14102
8af7334af4b3
- Installed specific code generator for equality enforcing that
berghofe
parents:
14049
diff
changeset
|
81 |
setup eq_codegen_setup |
|
8af7334af4b3
- Installed specific code generator for equality enforcing that
berghofe
parents:
14049
diff
changeset
|
82 |
|
| 16635 | 83 |
lemmas [code] = imp_conv_disj |
|
12554
671b4d632c34
Declared characteristic equations for < on nat for code generation.
berghofe
parents:
12439
diff
changeset
|
84 |
|
|
17395
a05e20f6a31a
hide the rather generic names used in theory Commutative_Ring;
wenzelm
parents:
17386
diff
changeset
|
85 |
|
| 14350 | 86 |
subsection {* Configuration of the 'refute' command *}
|
87 |
||
88 |
text {*
|
|
| 14458 | 89 |
The following are fairly reasonable default values. For an |
90 |
explanation of these parameters, see 'HOL/Refute.thy'. |
|
| 14350 | 91 |
*} |
92 |
||
|
15584
3478bb4f93ff
refute_params: default value itself=1 added (for type classes)
webertj
parents:
15531
diff
changeset
|
93 |
refute_params ["itself"=1, |
|
3478bb4f93ff
refute_params: default value itself=1 added (for type classes)
webertj
parents:
15531
diff
changeset
|
94 |
minsize=1, |
| 14350 | 95 |
maxsize=8, |
| 14806 | 96 |
maxvars=10000, |
97 |
maxtime=60, |
|
98 |
satsolver="auto"] |
|
| 14350 | 99 |
|
|
9650
6f0b89f2a1f9
Main now new-style theory; added Main.ML for compatibility;
wenzelm
parents:
9619
diff
changeset
|
100 |
end |