src/HOL/HOL.thy
changeset 21524 7843e2fd14a9
parent 21504 9c97af4a1567
child 21547 9c9fdf4c2949
equal deleted inserted replaced
21523:a267ecd51f90 21524:7843e2fd14a9
   113      let val (x,t) = atomic_abs_tr' abs
   113      let val (x,t) = atomic_abs_tr' abs
   114      in Syntax.const "_The" $ x $ t end)]
   114      in Syntax.const "_The" $ x $ t end)]
   115 *}
   115 *}
   116 
   116 
   117 syntax (xsymbols)
   117 syntax (xsymbols)
   118   "ALL "        :: "[idts, bool] => bool"                ("(3\<forall>_./ _)" [0, 10] 10)
       
   119   "EX "         :: "[idts, bool] => bool"                ("(3\<exists>_./ _)" [0, 10] 10)
       
   120   "EX! "        :: "[idts, bool] => bool"                ("(3\<exists>!_./ _)" [0, 10] 10)
       
   121   "_case1"      :: "['a, 'b] => case_syn"                ("(2_ \<Rightarrow>/ _)" 10)
   118   "_case1"      :: "['a, 'b] => case_syn"                ("(2_ \<Rightarrow>/ _)" 10)
   122 (*"_case2"      :: "[case_syn, cases_syn] => cases_syn"  ("_/ \<orelse> _")*)
   119 
   123 
   120 notation (xsymbols)
   124 syntax (HTML output)
   121   All  (binder "\<forall>" 10) and
   125   "ALL "        :: "[idts, bool] => bool"                ("(3\<forall>_./ _)" [0, 10] 10)
   122   Ex  (binder "\<exists>" 10) and
   126   "EX "         :: "[idts, bool] => bool"                ("(3\<exists>_./ _)" [0, 10] 10)
   123   Ex1  (binder "\<exists>!" 10)
   127   "EX! "        :: "[idts, bool] => bool"                ("(3\<exists>!_./ _)" [0, 10] 10)
   124 
   128 
   125 notation (HTML output)
   129 syntax (HOL)
   126   All  (binder "\<forall>" 10) and
   130   "ALL "        :: "[idts, bool] => bool"                ("(3! _./ _)" [0, 10] 10)
   127   Ex  (binder "\<exists>" 10) and
   131   "EX "         :: "[idts, bool] => bool"                ("(3? _./ _)" [0, 10] 10)
   128   Ex1  (binder "\<exists>!" 10)
   132   "EX! "        :: "[idts, bool] => bool"                ("(3?! _./ _)" [0, 10] 10)
   129 
       
   130 notation (HOL)
       
   131   All  (binder "! " 10) and
       
   132   Ex  (binder "? " 10) and
       
   133   Ex1  (binder "?! " 10)
   133 
   134 
   134 
   135 
   135 subsubsection {* Axioms and basic definitions *}
   136 subsubsection {* Axioms and basic definitions *}
   136 
   137 
   137 axioms
   138 axioms
   177 
   178 
   178 
   179 
   179 subsubsection {* Generic algebraic operations *}
   180 subsubsection {* Generic algebraic operations *}
   180 
   181 
   181 class zero =
   182 class zero =
   182   fixes zero :: "'a"                       ("\<^loc>0")
   183   fixes zero :: "'a"  ("\<^loc>0")
   183 
   184 
   184 class one =
   185 class one =
   185   fixes one  :: "'a"                       ("\<^loc>1")
   186   fixes one  :: "'a"  ("\<^loc>1")
   186 
   187 
   187 hide (open) const zero one
   188 hide (open) const zero one
   188 
   189 
   189 class plus =
   190 class plus =
   190   fixes plus :: "'a \<Rightarrow> 'a \<Rightarrow> 'a"   (infixl "\<^loc>+" 65)
   191   fixes plus :: "'a \<Rightarrow> 'a \<Rightarrow> 'a"  (infixl "\<^loc>+" 65)
   191 
   192 
   192 class minus =
   193 class minus =
   193   fixes uminus :: "'a \<Rightarrow> 'a" 
   194   fixes uminus :: "'a \<Rightarrow> 'a" 
   194   fixes minus  :: "'a \<Rightarrow> 'a \<Rightarrow> 'a" (infixl "\<^loc>-" 65)
   195     and minus :: "'a \<Rightarrow> 'a \<Rightarrow> 'a"  (infixl "\<^loc>-" 65)
   195   fixes abs    :: "'a \<Rightarrow> 'a"
   196     and abs :: "'a \<Rightarrow> 'a"
   196 
   197 
   197 class times =
   198 class times =
   198   fixes times :: "'a \<Rightarrow> 'a \<Rightarrow> 'a"  (infixl "\<^loc>*" 70)
   199   fixes times :: "'a \<Rightarrow> 'a \<Rightarrow> 'a"  (infixl "\<^loc>*" 70)
   199 
   200 
   200 class inverse = 
   201 class inverse = 
   201   fixes inverse :: "'a \<Rightarrow> 'a"
   202   fixes inverse :: "'a \<Rightarrow> 'a"
   202   fixes divide :: "'a \<Rightarrow> 'a \<Rightarrow> 'a" (infixl "\<^loc>'/" 70)
   203     and divide :: "'a \<Rightarrow> 'a \<Rightarrow> 'a"  (infixl "\<^loc>'/" 70)
       
   204 
       
   205 notation
       
   206   uminus  ("- _" [81] 80)
       
   207 
       
   208 notation (xsymbols)
       
   209   abs  ("\<bar>_\<bar>")
       
   210 notation (HTML output)
       
   211   abs  ("\<bar>_\<bar>")
   203 
   212 
   204 syntax
   213 syntax
   205   "_index1"  :: index    ("\<^sub>1")
   214   "_index1"  :: index    ("\<^sub>1")
   206 translations
   215 translations
   207   (index) "\<^sub>1" => (index) "\<^bsub>\<struct>\<^esub>"
   216   (index) "\<^sub>1" => (index) "\<^bsub>\<struct>\<^esub>"
   212   fun tr' c = (c, fn show_sorts => fn T => fn ts =>
   221   fun tr' c = (c, fn show_sorts => fn T => fn ts =>
   213     if T = dummyT orelse not (! show_types) andalso can Term.dest_Type T then raise Match
   222     if T = dummyT orelse not (! show_types) andalso can Term.dest_Type T then raise Match
   214     else Syntax.const Syntax.constrainC $ Syntax.const c $ Syntax.term_of_typ show_sorts T);
   223     else Syntax.const Syntax.constrainC $ Syntax.const c $ Syntax.term_of_typ show_sorts T);
   215 in map (tr' o Sign.const_syntax_name thy) ["HOL.one", "HOL.zero"] end;
   224 in map (tr' o Sign.const_syntax_name thy) ["HOL.one", "HOL.zero"] end;
   216 *} -- {* show types that are presumably too general *}
   225 *} -- {* show types that are presumably too general *}
   217 
       
   218 notation
       
   219   uminus  ("- _" [81] 80)
       
   220 
       
   221 notation (xsymbols)
       
   222   abs  ("\<bar>_\<bar>")
       
   223 notation (HTML output)
       
   224   abs  ("\<bar>_\<bar>")
       
   225 
   226 
   226 
   227 
   227 subsection {* Fundamental rules *}
   228 subsection {* Fundamental rules *}
   228 
   229 
   229 subsubsection {* Equality *}
   230 subsubsection {* Equality *}