src/HOL/HOL.thy
changeset 2260 b59781f2b809
parent 1674 33aff4d854e4
child 2368 d394336997cf
equal deleted inserted replaced
2259:e6d738f2b9a9 2260:b59781f2b809
     1 (*  Title:      HOL/HOL.thy
     1 (*  Title:      HOL/HOL.thy
     2     ID:         $Id$
     2     ID:         $Id$
     3     Author:     Tobias Nipkow
     3     Author:     Tobias Nipkow
     4     Copyright   1993  University of Cambridge
     4     Copyright   1993  University of Cambridge
     5 
     5 
     6 Higher-Order Logic
     6 Higher-Order Logic.
     7 *)
     7 *)
     8 
     8 
     9 HOL = CPure +
     9 HOL = CPure +
       
    10 
       
    11 
       
    12 (** Core syntax **)
    10 
    13 
    11 classes
    14 classes
    12   term < logic
    15   term < logic
    13 
       
    14 axclass
       
    15   plus < term
       
    16 
       
    17 axclass
       
    18   minus < term
       
    19 
       
    20 axclass
       
    21   times < term
       
    22 
    16 
    23 default
    17 default
    24   term
    18   term
    25 
    19 
    26 types
    20 types
    55   "="           :: ['a, 'a] => bool                 (infixl 50)
    49   "="           :: ['a, 'a] => bool                 (infixl 50)
    56   "&"           :: [bool, bool] => bool             (infixr 35)
    50   "&"           :: [bool, bool] => bool             (infixr 35)
    57   "|"           :: [bool, bool] => bool             (infixr 30)
    51   "|"           :: [bool, bool] => bool             (infixr 30)
    58   "-->"         :: [bool, bool] => bool             (infixr 25)
    52   "-->"         :: [bool, bool] => bool             (infixr 25)
    59 
    53 
    60   (* Overloaded Constants *)
    54 
    61 
    55 (* Overloaded Constants *)
       
    56 
       
    57 axclass
       
    58   plus < term
       
    59 
       
    60 axclass
       
    61   minus < term
       
    62 
       
    63 axclass
       
    64   times < term
       
    65 
       
    66 consts
    62   "+"           :: ['a::plus, 'a] => 'a             (infixl 65)
    67   "+"           :: ['a::plus, 'a] => 'a             (infixl 65)
    63   "-"           :: ['a::minus, 'a] => 'a            (infixl 65)
    68   "-"           :: ['a::minus, 'a] => 'a            (infixl 65)
    64   "*"           :: ['a::times, 'a] => 'a            (infixl 70)
    69   "*"           :: ['a::times, 'a] => 'a            (infixl 70)
    65 
    70 
    66 
    71 
       
    72 
       
    73 (** Additional concrete syntax **)
       
    74 
    67 types
    75 types
    68   letbinds  letbind
    76   letbinds  letbind
    69   case_syn  cases_syn
    77   case_syn  cases_syn
    70 
    78 
    71 syntax
    79 syntax
    72 
    80 
    73   "~="          :: ['a, 'a] => bool                 (infixl 50)
    81   "~="          :: ['a, 'a] => bool                 (infixl 50)
    74 
    82 
    75   "@Eps"        :: [pttrn,bool] => 'a               ("(3@ _./ _)" 10)
    83   "@Eps"        :: [pttrn, bool] => 'a              ("(3@ _./ _)" 10)
    76 
    84 
    77   (* Alternative Quantifiers *)
    85   (* Alternative Quantifiers *)
    78 
    86 
    79   "*All"        :: [idts, bool] => bool             ("(3ALL _./ _)" 10)
    87   "*All"        :: [idts, bool] => bool             ("(3ALL _./ _)" 10)
    80   "*Ex"         :: [idts, bool] => bool             ("(3EX _./ _)" 10)
    88   "*Ex"         :: [idts, bool] => bool             ("(3EX _./ _)" 10)
    94   ""            :: case_syn => cases_syn            ("_")
   102   ""            :: case_syn => cases_syn            ("_")
    95   "@case2"      :: [case_syn, cases_syn] => cases_syn   ("_/ | _")
   103   "@case2"      :: [case_syn, cases_syn] => cases_syn   ("_/ | _")
    96 
   104 
    97 translations
   105 translations
    98   "x ~= y"      == "~ (x = y)"
   106   "x ~= y"      == "~ (x = y)"
    99   "@ x.b"       == "Eps(%x.b)"
   107   "@ x.b"       == "Eps (%x. b)"
   100   "ALL xs. P"   => "! xs. P"
   108   "ALL xs. P"   => "! xs. P"
   101   "EX xs. P"    => "? xs. P"
   109   "EX xs. P"    => "? xs. P"
   102   "EX! xs. P"   => "?! xs. P"
   110   "EX! xs. P"   => "?! xs. P"
   103   "_Let (_binds b bs) e"  == "_Let b (_Let bs e)"
   111   "_Let (_binds b bs) e"  == "_Let b (_Let bs e)"
   104   "let x = a in e"        == "Let a (%x. e)"
   112   "let x = a in e"        == "Let a (%x. e)"
       
   113 
       
   114 
       
   115 syntax (symbols)
       
   116   not           :: bool => bool                     ("\\<not> _" [40] 40)
       
   117   "op &"        :: [bool, bool] => bool             (infixr "\\<and>" 35)
       
   118   "op |"        :: [bool, bool] => bool             (infixr "\\<or>" 30)
       
   119   "op -->"      :: [bool, bool] => bool             (infixr "\\<midarrow>\\<rightarrow>" 25)
       
   120   "op o"        :: ['b => 'c, 'a => 'b, 'a] => 'c   (infixl "\\<circ>" 55)
       
   121   "op ~="       :: ['a, 'a] => bool                 (infixl "\\<noteq>" 50)
       
   122   "@Eps"        :: [pttrn, bool] => 'a              ("(3\\<epsilon>_./ _)" 10)
       
   123   "! "          :: [idts, bool] => bool             ("(3\\<forall>_./ _)" 10)
       
   124   "? "          :: [idts, bool] => bool             ("(3\\<exists>_./ _)" 10)
       
   125   "?! "         :: [idts, bool] => bool             ("(3\\<exists>!_./ _)" 10)
       
   126   "*All"        :: [idts, bool] => bool             ("(3\\<forall>_./ _)" 10)
       
   127   "*Ex"         :: [idts, bool] => bool             ("(3\\<exists>_./ _)" 10)
       
   128   "*Ex1"        :: [idts, bool] => bool             ("(3\\<exists>!_./ _)" 10)
       
   129   "@case1"      :: ['a, 'b] => case_syn             ("(2_ \\<mapsto>/ _)" 10)
       
   130 
       
   131 
       
   132 
       
   133 (** Rules and definitions **)
   105 
   134 
   106 rules
   135 rules
   107 
   136 
   108   eq_reflection "(x=y) ==> (x==y)"
   137   eq_reflection "(x=y) ==> (x==y)"
   109 
   138 
   145 (* start 8bit 1 *)
   174 (* start 8bit 1 *)
   146 (* end 8bit 1 *)
   175 (* end 8bit 1 *)
   147 
   176 
   148 end
   177 end
   149 
   178 
       
   179 
   150 ML
   180 ML
   151 
   181 
   152 (** Choice between the HOL and Isabelle style of quantifiers **)
   182 (** Choice between the HOL and Isabelle style of quantifiers **)
   153 
   183 
   154 val HOL_quantifiers = ref true;
   184 val HOL_quantifiers = ref true;
   166 val print_ast_translation =
   196 val print_ast_translation =
   167   map alt_ast_tr' [("! ", "*All"), ("? ", "*Ex"), ("?! ", "*Ex1")];
   197   map alt_ast_tr' [("! ", "*All"), ("? ", "*Ex"), ("?! ", "*Ex1")];
   168 
   198 
   169 (* start 8bit 2 *)
   199 (* start 8bit 2 *)
   170 (* end 8bit 2 *)
   200 (* end 8bit 2 *)
   171 
       
   172 
       
   173