src/HOL/HOL.thy
author paulson
Mon, 16 Aug 1999 18:43:13 +0200
changeset 7220 da6f387ca482
parent 7203 36990a7c7c72
child 7238 36e58620ffc8
permissions -rw-r--r--
restored a high precedence to unary minus
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
     1
(*  Title:      HOL/HOL.thy
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
     2
    ID:         $Id$
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
     3
    Author:     Tobias Nipkow
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
     4
    Copyright   1993  University of Cambridge
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
     5
2260
b59781f2b809 added symbols syntax;
wenzelm
parents: 1674
diff changeset
     6
Higher-Order Logic.
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
     7
*)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
     8
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
     9
HOL = CPure +
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    10
2260
b59781f2b809 added symbols syntax;
wenzelm
parents: 1674
diff changeset
    11
b59781f2b809 added symbols syntax;
wenzelm
parents: 1674
diff changeset
    12
(** Core syntax **)
b59781f2b809 added symbols syntax;
wenzelm
parents: 1674
diff changeset
    13
3947
eb707467f8c5 adapted to qualified names;
wenzelm
parents: 3842
diff changeset
    14
global
eb707467f8c5 adapted to qualified names;
wenzelm
parents: 3842
diff changeset
    15
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    16
classes
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    17
  term < logic
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    18
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    19
default
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    20
  term
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    21
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    22
types
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    23
  bool
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    24
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    25
arities
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    26
  fun :: (term, term) term
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    27
  bool :: term
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    28
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    29
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    30
consts
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    31
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    32
  (* Constants *)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    33
1370
7361ac9b024d removed quotes from types in consts and syntax sections
clasohm
parents: 1273
diff changeset
    34
  Trueprop      :: bool => prop                     ("(_)" 5)
2720
3490ef519a56 Renamed constant "not" to "Not"
paulson
parents: 2552
diff changeset
    35
  Not           :: bool => bool                     ("~ _" [40] 40)
1370
7361ac9b024d removed quotes from types in consts and syntax sections
clasohm
parents: 1273
diff changeset
    36
  True, False   :: bool
7361ac9b024d removed quotes from types in consts and syntax sections
clasohm
parents: 1273
diff changeset
    37
  If            :: [bool, 'a, 'a] => 'a   ("(if (_)/ then (_)/ else (_))" 10)
3947
eb707467f8c5 adapted to qualified names;
wenzelm
parents: 3842
diff changeset
    38
  arbitrary     :: 'a
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    39
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    40
  (* Binders *)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    41
1370
7361ac9b024d removed quotes from types in consts and syntax sections
clasohm
parents: 1273
diff changeset
    42
  Eps           :: ('a => bool) => 'a
7361ac9b024d removed quotes from types in consts and syntax sections
clasohm
parents: 1273
diff changeset
    43
  All           :: ('a => bool) => bool             (binder "! " 10)
7361ac9b024d removed quotes from types in consts and syntax sections
clasohm
parents: 1273
diff changeset
    44
  Ex            :: ('a => bool) => bool             (binder "? " 10)
7361ac9b024d removed quotes from types in consts and syntax sections
clasohm
parents: 1273
diff changeset
    45
  Ex1           :: ('a => bool) => bool             (binder "?! " 10)
7361ac9b024d removed quotes from types in consts and syntax sections
clasohm
parents: 1273
diff changeset
    46
  Let           :: ['a, 'a => 'b] => 'b
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    47
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    48
  (* Infixes *)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    49
1370
7361ac9b024d removed quotes from types in consts and syntax sections
clasohm
parents: 1273
diff changeset
    50
  "="           :: ['a, 'a] => bool                 (infixl 50)
7361ac9b024d removed quotes from types in consts and syntax sections
clasohm
parents: 1273
diff changeset
    51
  "&"           :: [bool, bool] => bool             (infixr 35)
7361ac9b024d removed quotes from types in consts and syntax sections
clasohm
parents: 1273
diff changeset
    52
  "|"           :: [bool, bool] => bool             (infixr 30)
7361ac9b024d removed quotes from types in consts and syntax sections
clasohm
parents: 1273
diff changeset
    53
  "-->"         :: [bool, bool] => bool             (infixr 25)
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    54
2260
b59781f2b809 added symbols syntax;
wenzelm
parents: 1674
diff changeset
    55
b59781f2b809 added symbols syntax;
wenzelm
parents: 1674
diff changeset
    56
(* Overloaded Constants *)
b59781f2b809 added symbols syntax;
wenzelm
parents: 1674
diff changeset
    57
b59781f2b809 added symbols syntax;
wenzelm
parents: 1674
diff changeset
    58
axclass
b59781f2b809 added symbols syntax;
wenzelm
parents: 1674
diff changeset
    59
  plus < term
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    60
2260
b59781f2b809 added symbols syntax;
wenzelm
parents: 1674
diff changeset
    61
axclass
b59781f2b809 added symbols syntax;
wenzelm
parents: 1674
diff changeset
    62
  minus < term
b59781f2b809 added symbols syntax;
wenzelm
parents: 1674
diff changeset
    63
b59781f2b809 added symbols syntax;
wenzelm
parents: 1674
diff changeset
    64
axclass
b59781f2b809 added symbols syntax;
wenzelm
parents: 1674
diff changeset
    65
  times < term
b59781f2b809 added symbols syntax;
wenzelm
parents: 1674
diff changeset
    66
3370
5c5fdce3a4e4 Overloading of "^" requires new type class "power", with types "nat" and
paulson
parents: 3320
diff changeset
    67
axclass
5c5fdce3a4e4 Overloading of "^" requires new type class "power", with types "nat" and
paulson
parents: 3320
diff changeset
    68
  power < term
5c5fdce3a4e4 Overloading of "^" requires new type class "power", with types "nat" and
paulson
parents: 3320
diff changeset
    69
2260
b59781f2b809 added symbols syntax;
wenzelm
parents: 1674
diff changeset
    70
consts
3370
5c5fdce3a4e4 Overloading of "^" requires new type class "power", with types "nat" and
paulson
parents: 3320
diff changeset
    71
  "+"           :: ['a::plus, 'a]  => 'a            (infixl 65)
1370
7361ac9b024d removed quotes from types in consts and syntax sections
clasohm
parents: 1273
diff changeset
    72
  "-"           :: ['a::minus, 'a] => 'a            (infixl 65)
7220
da6f387ca482 restored a high precedence to unary minus
paulson
parents: 7203
diff changeset
    73
  uminus        :: ['a::minus] => 'a                ("- _" [81] 80)
1370
7361ac9b024d removed quotes from types in consts and syntax sections
clasohm
parents: 1273
diff changeset
    74
  "*"           :: ['a::times, 'a] => 'a            (infixl 70)
3370
5c5fdce3a4e4 Overloading of "^" requires new type class "power", with types "nat" and
paulson
parents: 3320
diff changeset
    75
  (*See Nat.thy for "^"*)
2260
b59781f2b809 added symbols syntax;
wenzelm
parents: 1674
diff changeset
    76
3820
46b255e140dc fixed infix syntax;
wenzelm
parents: 3370
diff changeset
    77
2260
b59781f2b809 added symbols syntax;
wenzelm
parents: 1674
diff changeset
    78
(** Additional concrete syntax **)
b59781f2b809 added symbols syntax;
wenzelm
parents: 1674
diff changeset
    79
4868
843a9f5b3c3d nonterminals;
wenzelm
parents: 4793
diff changeset
    80
nonterminals
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    81
  letbinds  letbind
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    82
  case_syn  cases_syn
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    83
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    84
syntax
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    85
1370
7361ac9b024d removed quotes from types in consts and syntax sections
clasohm
parents: 1273
diff changeset
    86
  "~="          :: ['a, 'a] => bool                 (infixl 50)
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    87
2368
d394336997cf fixed pris of binder syntax;
wenzelm
parents: 2260
diff changeset
    88
  "@Eps"        :: [pttrn, bool] => 'a              ("(3@ _./ _)" [0, 10] 10)
1068
e0f2dffab506 HOL.thy:
nipkow
parents: 973
diff changeset
    89
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    90
  (* Alternative Quantifiers *)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    91
2368
d394336997cf fixed pris of binder syntax;
wenzelm
parents: 2260
diff changeset
    92
  "*All"        :: [idts, bool] => bool             ("(3ALL _./ _)" [0, 10] 10)
d394336997cf fixed pris of binder syntax;
wenzelm
parents: 2260
diff changeset
    93
  "*Ex"         :: [idts, bool] => bool             ("(3EX _./ _)" [0, 10] 10)
d394336997cf fixed pris of binder syntax;
wenzelm
parents: 2260
diff changeset
    94
  "*Ex1"        :: [idts, bool] => bool             ("(3EX! _./ _)" [0, 10] 10)
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    95
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    96
  (* Let expressions *)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    97
1370
7361ac9b024d removed quotes from types in consts and syntax sections
clasohm
parents: 1273
diff changeset
    98
  "_bind"       :: [pttrn, 'a] => letbind           ("(2_ =/ _)" 10)
7361ac9b024d removed quotes from types in consts and syntax sections
clasohm
parents: 1273
diff changeset
    99
  ""            :: letbind => letbinds              ("_")
7361ac9b024d removed quotes from types in consts and syntax sections
clasohm
parents: 1273
diff changeset
   100
  "_binds"      :: [letbind, letbinds] => letbinds  ("_;/ _")
7361ac9b024d removed quotes from types in consts and syntax sections
clasohm
parents: 1273
diff changeset
   101
  "_Let"        :: [letbinds, 'a] => 'a             ("(let (_)/ in (_))" 10)
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   102
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   103
  (* Case expressions *)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   104
1370
7361ac9b024d removed quotes from types in consts and syntax sections
clasohm
parents: 1273
diff changeset
   105
  "@case"       :: ['a, cases_syn] => 'b            ("(case _ of/ _)" 10)
7361ac9b024d removed quotes from types in consts and syntax sections
clasohm
parents: 1273
diff changeset
   106
  "@case1"      :: ['a, 'b] => case_syn             ("(2_ =>/ _)" 10)
7361ac9b024d removed quotes from types in consts and syntax sections
clasohm
parents: 1273
diff changeset
   107
  ""            :: case_syn => cases_syn            ("_")
7361ac9b024d removed quotes from types in consts and syntax sections
clasohm
parents: 1273
diff changeset
   108
  "@case2"      :: [case_syn, cases_syn] => cases_syn   ("_/ | _")
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   109
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   110
translations
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   111
  "x ~= y"      == "~ (x = y)"
3842
b55686a7b22c fixed dots;
wenzelm
parents: 3820
diff changeset
   112
  "@ x. b"      == "Eps (%x. b)"
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   113
  "ALL xs. P"   => "! xs. P"
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   114
  "EX xs. P"    => "? xs. P"
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   115
  "EX! xs. P"   => "?! xs. P"
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   116
  "_Let (_binds b bs) e"  == "_Let b (_Let bs e)"
1114
c8dfb56a7e95 Prod is now a parent of Lfp.
nipkow
parents: 1068
diff changeset
   117
  "let x = a in e"        == "Let a (%x. e)"
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   118
3820
46b255e140dc fixed infix syntax;
wenzelm
parents: 3370
diff changeset
   119
syntax ("" output)
46b255e140dc fixed infix syntax;
wenzelm
parents: 3370
diff changeset
   120
  "op ="        :: ['a, 'a] => bool                 ("(_ =/ _)" [51, 51] 50)
46b255e140dc fixed infix syntax;
wenzelm
parents: 3370
diff changeset
   121
  "op ~="       :: ['a, 'a] => bool                 ("(_ ~=/ _)" [51, 51] 50)
2260
b59781f2b809 added symbols syntax;
wenzelm
parents: 1674
diff changeset
   122
b59781f2b809 added symbols syntax;
wenzelm
parents: 1674
diff changeset
   123
syntax (symbols)
2762
2ade3a141934 fixed Not syntax;
wenzelm
parents: 2720
diff changeset
   124
  Not           :: bool => bool                     ("\\<not> _" [40] 40)
2260
b59781f2b809 added symbols syntax;
wenzelm
parents: 1674
diff changeset
   125
  "op &"        :: [bool, bool] => bool             (infixr "\\<and>" 35)
b59781f2b809 added symbols syntax;
wenzelm
parents: 1674
diff changeset
   126
  "op |"        :: [bool, bool] => bool             (infixr "\\<or>" 30)
b59781f2b809 added symbols syntax;
wenzelm
parents: 1674
diff changeset
   127
  "op -->"      :: [bool, bool] => bool             (infixr "\\<midarrow>\\<rightarrow>" 25)
b59781f2b809 added symbols syntax;
wenzelm
parents: 1674
diff changeset
   128
  "op o"        :: ['b => 'c, 'a => 'b, 'a] => 'c   (infixl "\\<circ>" 55)
b59781f2b809 added symbols syntax;
wenzelm
parents: 1674
diff changeset
   129
  "op ~="       :: ['a, 'a] => bool                 (infixl "\\<noteq>" 50)
2368
d394336997cf fixed pris of binder syntax;
wenzelm
parents: 2260
diff changeset
   130
  "@Eps"        :: [pttrn, bool] => 'a              ("(3\\<epsilon>_./ _)" [0, 10] 10)
d394336997cf fixed pris of binder syntax;
wenzelm
parents: 2260
diff changeset
   131
  "! "          :: [idts, bool] => bool             ("(3\\<forall>_./ _)" [0, 10] 10)
d394336997cf fixed pris of binder syntax;
wenzelm
parents: 2260
diff changeset
   132
  "? "          :: [idts, bool] => bool             ("(3\\<exists>_./ _)" [0, 10] 10)
d394336997cf fixed pris of binder syntax;
wenzelm
parents: 2260
diff changeset
   133
  "?! "         :: [idts, bool] => bool             ("(3\\<exists>!_./ _)" [0, 10] 10)
2552
470bc495373e changed case symbol to \<Rightarrow>;
wenzelm
parents: 2393
diff changeset
   134
  "@case1"      :: ['a, 'b] => case_syn             ("(2_ \\<Rightarrow>/ _)" 10)
3068
b7562e452816 deactivated new symbols (not yet printable on xterm, emacs);
wenzelm
parents: 3066
diff changeset
   135
(*"@case2"      :: [case_syn, cases_syn] => cases_syn   ("_/ \\<orelse> _")*)
2372
a2999e19703b fixed alternative quantifier symbol syntax;
wenzelm
parents: 2368
diff changeset
   136
3820
46b255e140dc fixed infix syntax;
wenzelm
parents: 3370
diff changeset
   137
syntax (symbols output)
46b255e140dc fixed infix syntax;
wenzelm
parents: 3370
diff changeset
   138
  "op ~="       :: ['a, 'a] => bool                 ("(_ \\<noteq>/ _)" [51, 51] 50)
46b255e140dc fixed infix syntax;
wenzelm
parents: 3370
diff changeset
   139
  "*All"        :: [idts, bool] => bool             ("(3\\<forall>_./ _)" [0, 10] 10)
46b255e140dc fixed infix syntax;
wenzelm
parents: 3370
diff changeset
   140
  "*Ex"         :: [idts, bool] => bool             ("(3\\<exists>_./ _)" [0, 10] 10)
46b255e140dc fixed infix syntax;
wenzelm
parents: 3370
diff changeset
   141
  "*Ex1"        :: [idts, bool] => bool             ("(3\\<exists>!_./ _)" [0, 10] 10)
46b255e140dc fixed infix syntax;
wenzelm
parents: 3370
diff changeset
   142
6027
9dd06eeda95c added new print_mode "xsymbols" for extended symbol support
oheimb
parents: 5786
diff changeset
   143
syntax (xsymbols)
9dd06eeda95c added new print_mode "xsymbols" for extended symbol support
oheimb
parents: 5786
diff changeset
   144
  "op -->"      :: [bool, bool] => bool             (infixr "\\<longrightarrow>" 25)
2260
b59781f2b809 added symbols syntax;
wenzelm
parents: 1674
diff changeset
   145
6340
7d5cbd5819a0 HTML output;
wenzelm
parents: 6289
diff changeset
   146
syntax (HTML output)
7d5cbd5819a0 HTML output;
wenzelm
parents: 6289
diff changeset
   147
  Not           :: bool => bool                     ("\\<not> _" [40] 40)
7d5cbd5819a0 HTML output;
wenzelm
parents: 6289
diff changeset
   148
7d5cbd5819a0 HTML output;
wenzelm
parents: 6289
diff changeset
   149
2260
b59781f2b809 added symbols syntax;
wenzelm
parents: 1674
diff changeset
   150
(** Rules and definitions **)
b59781f2b809 added symbols syntax;
wenzelm
parents: 1674
diff changeset
   151
3947
eb707467f8c5 adapted to qualified names;
wenzelm
parents: 3842
diff changeset
   152
local
eb707467f8c5 adapted to qualified names;
wenzelm
parents: 3842
diff changeset
   153
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   154
rules
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   155
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   156
  eq_reflection "(x=y) ==> (x==y)"
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   157
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   158
  (* Basic Rules *)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   159
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   160
  refl          "t = (t::'a)"
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   161
  subst         "[| s = t; P(s) |] ==> P(t::'a)"
6289
062aa156a300 added a commment on the "ext" rule
paulson
parents: 6027
diff changeset
   162
062aa156a300 added a commment on the "ext" rule
paulson
parents: 6027
diff changeset
   163
  (*Extensionality is built into the meta-logic, and this rule expresses
062aa156a300 added a commment on the "ext" rule
paulson
parents: 6027
diff changeset
   164
    a related property.  It is an eta-expanded version of the traditional
062aa156a300 added a commment on the "ext" rule
paulson
parents: 6027
diff changeset
   165
    rule, and similar to the ABS rule of HOL.*)
3842
b55686a7b22c fixed dots;
wenzelm
parents: 3820
diff changeset
   166
  ext           "(!!x::'a. (f x ::'b) = g x) ==> (%x. f x) = (%x. g x)"
6289
062aa156a300 added a commment on the "ext" rule
paulson
parents: 6027
diff changeset
   167
3842
b55686a7b22c fixed dots;
wenzelm
parents: 3820
diff changeset
   168
  selectI       "P (x::'a) ==> P (@x. P x)"
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   169
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   170
  impI          "(P ==> Q) ==> P-->Q"
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   171
  mp            "[| P-->Q;  P |] ==> Q"
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   172
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   173
defs
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   174
3842
b55686a7b22c fixed dots;
wenzelm
parents: 3820
diff changeset
   175
  True_def      "True      == ((%x::bool. x) = (%x. x))"
b55686a7b22c fixed dots;
wenzelm
parents: 3820
diff changeset
   176
  All_def       "All(P)    == (P = (%x. True))"
b55686a7b22c fixed dots;
wenzelm
parents: 3820
diff changeset
   177
  Ex_def        "Ex(P)     == P(@x. P(x))"
b55686a7b22c fixed dots;
wenzelm
parents: 3820
diff changeset
   178
  False_def     "False     == (!P. P)"
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   179
  not_def       "~ P       == P-->False"
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   180
  and_def       "P & Q     == !R. (P-->Q-->R) --> R"
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   181
  or_def        "P | Q     == !R. (P-->R) --> (Q-->R) --> R"
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   182
  Ex1_def       "Ex1(P)    == ? x. P(x) & (! y. P(y) --> y=x)"
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   183
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   184
rules
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   185
  (* Axioms *)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   186
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   187
  iff           "(P-->Q) --> (Q-->P) --> (P=Q)"
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   188
  True_or_False "(P=True) | (P=False)"
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   189
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   190
defs
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4868
diff changeset
   191
  (*misc definitions*)
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   192
  Let_def       "Let s f == f(s)"
973
f57fb576520f Modified If_def to avoid ambiguity.
nipkow
parents: 965
diff changeset
   193
  if_def        "If P x y == @z::'a. (P=True --> z=x) & (P=False --> z=y)"
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4868
diff changeset
   194
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4868
diff changeset
   195
  (*arbitrary is completely unspecified, but is made to appear as a
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4868
diff changeset
   196
    definition syntactically*)
4371
8755cdbbf6b3 improved arbitrary_def: we now really don't know nothing about it!
wenzelm
parents: 4083
diff changeset
   197
  arbitrary_def "False ==> arbitrary == (@x. False)"
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   198
3320
3a5e4930fb77 Added `arbitrary'
nipkow
parents: 3248
diff changeset
   199
4868
843a9f5b3c3d nonterminals;
wenzelm
parents: 4793
diff changeset
   200
843a9f5b3c3d nonterminals;
wenzelm
parents: 4793
diff changeset
   201
(** initial HOL theory setup **)
843a9f5b3c3d nonterminals;
wenzelm
parents: 4793
diff changeset
   202
843a9f5b3c3d nonterminals;
wenzelm
parents: 4793
diff changeset
   203
setup Simplifier.setup
843a9f5b3c3d nonterminals;
wenzelm
parents: 4793
diff changeset
   204
setup ClasetThyData.setup
843a9f5b3c3d nonterminals;
wenzelm
parents: 4793
diff changeset
   205
843a9f5b3c3d nonterminals;
wenzelm
parents: 4793
diff changeset
   206
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   207
end
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   208
2260
b59781f2b809 added symbols syntax;
wenzelm
parents: 1674
diff changeset
   209
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   210
ML
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   211
4793
03fd006fb97b replaced thy_data by thy_setup;
wenzelm
parents: 4371
diff changeset
   212
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   213
(** Choice between the HOL and Isabelle style of quantifiers **)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   214
7203
36990a7c7c72 * set HOL_quantifiers by default, i.e. quantifiers are printed as
nipkow
parents: 7127
diff changeset
   215
val HOL_quantifiers = ref true;
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   216
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   217
fun alt_ast_tr' (name, alt_name) =
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   218
  let
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   219
    fun ast_tr' (*name*) args =
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   220
      if ! HOL_quantifiers then raise Match
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   221
      else Syntax.mk_appl (Syntax.Constant alt_name) args;
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   222
  in
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   223
    (name, ast_tr')
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   224
  end;
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   225
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   226
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   227
val print_ast_translation =
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   228
  map alt_ast_tr' [("! ", "*All"), ("? ", "*Ex"), ("?! ", "*Ex1")];