src/HOL/Main.thy
author kleing
Sun, 06 Apr 2003 21:16:50 +0200
changeset 13901 af38553e61ee
parent 13755 a9bb54a3cfb7
child 14049 ef1da11a64b9
permissions -rw-r--r--
use 2 processors on sunbroy1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10519
ade64af4c57c hide many names from Datatype_Universe.
nipkow
parents: 10386
diff changeset
     1
(*  Title:      HOL/Main.thy
ade64af4c57c hide many names from Datatype_Universe.
nipkow
parents: 10386
diff changeset
     2
    ID:         $Id$
12024
b3661262541e moved String into Main;
wenzelm
parents: 11533
diff changeset
     3
    Author:     Stefan Berghofer, Tobias Nipkow and Markus Wenzel, TU Muenchen
b3661262541e moved String into Main;
wenzelm
parents: 11533
diff changeset
     4
    License:    GPL (GNU GENERAL PUBLIC LICENSE)
10519
ade64af4c57c hide many names from Datatype_Universe.
nipkow
parents: 10386
diff changeset
     5
*)
9619
6125cc9efc18 fixed deps;
wenzelm
parents: 9447
diff changeset
     6
12024
b3661262541e moved String into Main;
wenzelm
parents: 11533
diff changeset
     7
header {* Main HOL *}
b3661262541e moved String into Main;
wenzelm
parents: 11533
diff changeset
     8
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents: 13367
diff changeset
     9
theory Main = Map + Hilbert_Choice + Extraction:
9650
6f0b89f2a1f9 Main now new-style theory; added Main.ML for compatibility;
wenzelm
parents: 9619
diff changeset
    10
12024
b3661262541e moved String into Main;
wenzelm
parents: 11533
diff changeset
    11
text {*
b3661262541e moved String into Main;
wenzelm
parents: 11533
diff changeset
    12
  Theory @{text Main} includes everything.  Note that theory @{text
b3661262541e moved String into Main;
wenzelm
parents: 11533
diff changeset
    13
  PreList} already includes most HOL theories.
b3661262541e moved String into Main;
wenzelm
parents: 11533
diff changeset
    14
*}
b3661262541e moved String into Main;
wenzelm
parents: 11533
diff changeset
    15
b3661262541e moved String into Main;
wenzelm
parents: 11533
diff changeset
    16
subsection {* Configuration of the code generator *}
11533
0c0d2332e8f0 Added code generator setup.
berghofe
parents: 11483
diff changeset
    17
0c0d2332e8f0 Added code generator setup.
berghofe
parents: 11483
diff changeset
    18
types_code
0c0d2332e8f0 Added code generator setup.
berghofe
parents: 11483
diff changeset
    19
  "bool"  ("bool")
12439
e90a4f5a27f0 Tuned code generator setup.
berghofe
parents: 12024
diff changeset
    20
  "*"     ("(_ */ _)")
e90a4f5a27f0 Tuned code generator setup.
berghofe
parents: 12024
diff changeset
    21
  "list"  ("_ list")
11533
0c0d2332e8f0 Added code generator setup.
berghofe
parents: 11483
diff changeset
    22
0c0d2332e8f0 Added code generator setup.
berghofe
parents: 11483
diff changeset
    23
consts_code
0c0d2332e8f0 Added code generator setup.
berghofe
parents: 11483
diff changeset
    24
  "op ="    ("(_ =/ _)")
0c0d2332e8f0 Added code generator setup.
berghofe
parents: 11483
diff changeset
    25
0c0d2332e8f0 Added code generator setup.
berghofe
parents: 11483
diff changeset
    26
  "True"    ("true")
0c0d2332e8f0 Added code generator setup.
berghofe
parents: 11483
diff changeset
    27
  "False"   ("false")
0c0d2332e8f0 Added code generator setup.
berghofe
parents: 11483
diff changeset
    28
  "Not"     ("not")
0c0d2332e8f0 Added code generator setup.
berghofe
parents: 11483
diff changeset
    29
  "op |"    ("(_ orelse/ _)")
0c0d2332e8f0 Added code generator setup.
berghofe
parents: 11483
diff changeset
    30
  "op &"    ("(_ andalso/ _)")
0c0d2332e8f0 Added code generator setup.
berghofe
parents: 11483
diff changeset
    31
  "If"      ("(if _/ then _/ else _)")
0c0d2332e8f0 Added code generator setup.
berghofe
parents: 11483
diff changeset
    32
0c0d2332e8f0 Added code generator setup.
berghofe
parents: 11483
diff changeset
    33
  "Pair"    ("(_,/ _)")
0c0d2332e8f0 Added code generator setup.
berghofe
parents: 11483
diff changeset
    34
  "fst"     ("fst")
0c0d2332e8f0 Added code generator setup.
berghofe
parents: 11483
diff changeset
    35
  "snd"     ("snd")
0c0d2332e8f0 Added code generator setup.
berghofe
parents: 11483
diff changeset
    36
0c0d2332e8f0 Added code generator setup.
berghofe
parents: 11483
diff changeset
    37
  "Nil"     ("[]")
0c0d2332e8f0 Added code generator setup.
berghofe
parents: 11483
diff changeset
    38
  "Cons"    ("(_ ::/ _)")
12439
e90a4f5a27f0 Tuned code generator setup.
berghofe
parents: 12024
diff changeset
    39
13093
ab0335307905 code generator: wfrec combinator is now implemented by ML function wf_rec.
berghofe
parents: 12554
diff changeset
    40
  "wfrec"   ("wf'_rec?")
ab0335307905 code generator: wfrec combinator is now implemented by ML function wf_rec.
berghofe
parents: 12554
diff changeset
    41
13755
a9bb54a3cfb7 Added mk_int and mk_list.
berghofe
parents: 13403
diff changeset
    42
ML {*
a9bb54a3cfb7 Added mk_int and mk_list.
berghofe
parents: 13403
diff changeset
    43
fun wf_rec f x = f (wf_rec f) x;
a9bb54a3cfb7 Added mk_int and mk_list.
berghofe
parents: 13403
diff changeset
    44
a9bb54a3cfb7 Added mk_int and mk_list.
berghofe
parents: 13403
diff changeset
    45
val term_of_list = HOLogic.mk_list;
a9bb54a3cfb7 Added mk_int and mk_list.
berghofe
parents: 13403
diff changeset
    46
val term_of_int = HOLogic.mk_int;
a9bb54a3cfb7 Added mk_int and mk_list.
berghofe
parents: 13403
diff changeset
    47
*}
13093
ab0335307905 code generator: wfrec combinator is now implemented by ML function wf_rec.
berghofe
parents: 12554
diff changeset
    48
12554
671b4d632c34 Declared characteristic equations for < on nat for code generation.
berghofe
parents: 12439
diff changeset
    49
lemma [code]: "((n::nat) < 0) = False" by simp
671b4d632c34 Declared characteristic equations for < on nat for code generation.
berghofe
parents: 12439
diff changeset
    50
declare less_Suc_eq [code]
671b4d632c34 Declared characteristic equations for < on nat for code generation.
berghofe
parents: 12439
diff changeset
    51
9650
6f0b89f2a1f9 Main now new-style theory; added Main.ML for compatibility;
wenzelm
parents: 9619
diff changeset
    52
end