replaced a couple of constsdefs by definitions (also some old primrecs by modern ones)
authorhaftmann
Mon Mar 01 13:40:23 2010 +0100 (2010-03-01)
changeset 35416d8d7d1b785af
parent 35342 4dc65845eab3
child 35417 47ee18b6ae32
replaced a couple of constsdefs by definitions (also some old primrecs by modern ones)
doc-src/TutorialI/Advanced/Partial.thy
doc-src/TutorialI/CTL/CTL.thy
doc-src/TutorialI/Misc/Option2.thy
doc-src/TutorialI/Overview/LNCS/FP1.thy
doc-src/TutorialI/Overview/LNCS/Ordinal.thy
doc-src/TutorialI/Protocol/Message.thy
doc-src/TutorialI/Rules/Primes.thy
doc-src/TutorialI/Sets/Examples.thy
doc-src/ZF/If.thy
doc-src/ZF/ZF_examples.thy
src/FOL/IFOL.thy
src/FOL/ex/If.thy
src/FOLP/ex/If.thy
src/HOL/Algebra/AbelCoset.thy
src/HOL/Algebra/Bij.thy
src/HOL/Algebra/Coset.thy
src/HOL/Algebra/Divisibility.thy
src/HOL/Algebra/FiniteProduct.thy
src/HOL/Algebra/Group.thy
src/HOL/Algebra/IntRing.thy
src/HOL/Algebra/Ring.thy
src/HOL/Auth/CertifiedEmail.thy
src/HOL/Auth/Guard/Extensions.thy
src/HOL/Auth/Guard/Guard.thy
src/HOL/Auth/Guard/GuardK.thy
src/HOL/Auth/Guard/Guard_Public.thy
src/HOL/Auth/Guard/Guard_Shared.thy
src/HOL/Auth/Guard/Guard_Yahalom.thy
src/HOL/Auth/Guard/P1.thy
src/HOL/Auth/Guard/P2.thy
src/HOL/Auth/Guard/Proto.thy
src/HOL/Auth/KerberosIV.thy
src/HOL/Auth/KerberosIV_Gets.thy
src/HOL/Auth/KerberosV.thy
src/HOL/Auth/Message.thy
src/HOL/Auth/Smartcard/ShoupRubin.thy
src/HOL/Auth/Smartcard/ShoupRubinBella.thy
src/HOL/Auth/Smartcard/Smartcard.thy
src/HOL/Auth/TLS.thy
src/HOL/Auth/Yahalom.thy
src/HOL/Auth/ZhouGollmann.thy
src/HOL/Bali/AxCompl.thy
src/HOL/Bali/AxExample.thy
src/HOL/Bali/AxSem.thy
src/HOL/Bali/Basis.thy
src/HOL/Bali/Conform.thy
src/HOL/Bali/Decl.thy
src/HOL/Bali/DeclConcepts.thy
src/HOL/Bali/DefiniteAssignment.thy
src/HOL/Bali/Eval.thy
src/HOL/Bali/Example.thy
src/HOL/Bali/State.thy
src/HOL/Bali/Table.thy
src/HOL/Bali/Term.thy
src/HOL/Bali/Trans.thy
src/HOL/Bali/Type.thy
src/HOL/Bali/TypeRel.thy
src/HOL/Bali/TypeSafe.thy
src/HOL/Bali/WellForm.thy
src/HOL/Bali/WellType.thy
src/HOL/Decision_Procs/Cooper.thy
src/HOL/Decision_Procs/Ferrack.thy
src/HOL/Decision_Procs/MIR.thy
src/HOL/Decision_Procs/Parametric_Ferrante_Rackoff.thy
src/HOL/Decision_Procs/Reflected_Multivariate_Polynomial.thy
src/HOL/Finite_Set.thy
src/HOL/Fun.thy
src/HOL/HOL.thy
src/HOL/Hilbert_Choice.thy
src/HOL/Hoare/Arith2.thy
src/HOL/Hoare/Heap.thy
src/HOL/Hoare/Hoare_Logic.thy
src/HOL/Hoare/Hoare_Logic_Abort.thy
src/HOL/Hoare/Pointer_Examples.thy
src/HOL/Hoare/Pointers0.thy
src/HOL/Hoare/SepLogHeap.thy
src/HOL/Hoare/Separation.thy
src/HOL/Hoare_Parallel/Gar_Coll.thy
src/HOL/Hoare_Parallel/Graph.thy
src/HOL/Hoare_Parallel/Mul_Gar_Coll.thy
src/HOL/Hoare_Parallel/OG_Hoare.thy
src/HOL/Hoare_Parallel/OG_Tactics.thy
src/HOL/Hoare_Parallel/OG_Tran.thy
src/HOL/Hoare_Parallel/RG_Hoare.thy
src/HOL/Hoare_Parallel/RG_Tran.thy
src/HOL/IOA/Solve.thy
src/HOL/Import/HOL/HOL4Base.thy
src/HOL/Import/HOL/HOL4Prob.thy
src/HOL/Import/HOL/HOL4Real.thy
src/HOL/Import/HOL/HOL4Vec.thy
src/HOL/Import/HOL/HOL4Word32.thy
src/HOL/Import/HOL4Compat.thy
src/HOL/Import/HOLLight/HOLLight.thy
src/HOL/Import/HOLLightCompat.thy
src/HOL/Isar_Examples/Expr_Compiler.thy
src/HOL/Isar_Examples/Hoare.thy
src/HOL/Isar_Examples/Mutilated_Checkerboard.thy
src/HOL/Matrix/ComputeNumeral.thy
src/HOL/Matrix/Matrix.thy
src/HOL/Matrix/SparseMatrix.thy
src/HOL/Metis_Examples/BigO.thy
src/HOL/Metis_Examples/Message.thy
src/HOL/Metis_Examples/Tarski.thy
src/HOL/MicroJava/BV/Altern.thy
src/HOL/MicroJava/BV/BVExample.thy
src/HOL/MicroJava/BV/BVSpec.thy
src/HOL/MicroJava/BV/Correct.thy
src/HOL/MicroJava/BV/Effect.thy
src/HOL/MicroJava/BV/JType.thy
src/HOL/MicroJava/BV/JVM.thy
src/HOL/MicroJava/BV/JVMType.thy
src/HOL/MicroJava/BV/LBVJVM.thy
src/HOL/MicroJava/BV/Typing_Framework_JVM.thy
src/HOL/MicroJava/Comp/CorrComp.thy
src/HOL/MicroJava/Comp/CorrCompTp.thy
src/HOL/MicroJava/Comp/DefsComp.thy
src/HOL/MicroJava/Comp/Index.thy
src/HOL/MicroJava/Comp/TranslComp.thy
src/HOL/MicroJava/Comp/TranslCompTp.thy
src/HOL/MicroJava/Comp/TypeInf.thy
src/HOL/MicroJava/DFA/Err.thy
src/HOL/MicroJava/DFA/Kildall.thy
src/HOL/MicroJava/DFA/LBVComplete.thy
src/HOL/MicroJava/DFA/LBVSpec.thy
src/HOL/MicroJava/DFA/Listn.thy
src/HOL/MicroJava/DFA/Opt.thy
src/HOL/MicroJava/DFA/Product.thy
src/HOL/MicroJava/DFA/Semilat.thy
src/HOL/MicroJava/DFA/SemilatAlg.thy
src/HOL/MicroJava/DFA/Typing_Framework.thy
src/HOL/MicroJava/DFA/Typing_Framework_err.thy
src/HOL/MicroJava/J/Conform.thy
src/HOL/MicroJava/J/Decl.thy
src/HOL/MicroJava/J/Eval.thy
src/HOL/MicroJava/J/Exceptions.thy
src/HOL/MicroJava/J/JBasis.thy
src/HOL/MicroJava/J/JListExample.thy
src/HOL/MicroJava/J/State.thy
src/HOL/MicroJava/J/SystemClasses.thy
src/HOL/MicroJava/J/TypeRel.thy
src/HOL/MicroJava/J/WellForm.thy
src/HOL/MicroJava/J/WellType.thy
src/HOL/MicroJava/JVM/JVMDefensive.thy
src/HOL/MicroJava/JVM/JVMExceptions.thy
src/HOL/MicroJava/JVM/JVMExec.thy
src/HOL/MicroJava/JVM/JVMListExample.thy
src/HOL/MicroJava/JVM/JVMState.thy
src/HOL/Modelcheck/CTL.thy
src/HOL/Modelcheck/EindhovenExample.thy
src/HOL/Modelcheck/MuCalculus.thy
src/HOL/Modelcheck/MuckeExample1.thy
src/HOL/Modelcheck/MuckeExample2.thy
src/HOL/NanoJava/Decl.thy
src/HOL/NanoJava/Equivalence.thy
src/HOL/NanoJava/State.thy
src/HOL/NanoJava/TypeRel.thy
src/HOL/Nat.thy
src/HOL/Nitpick_Examples/Refute_Nits.thy
src/HOL/Nominal/Examples/Class.thy
src/HOL/Nominal/Examples/Fsub.thy
src/HOL/Nominal/Examples/LocalWeakening.thy
src/HOL/Nominal/Examples/SN.thy
src/HOL/Nominal/Nominal.thy
src/HOL/Number_Theory/MiscAlgebra.thy
src/HOL/Number_Theory/Residues.thy
src/HOL/Number_Theory/UniqueFactorization.thy
src/HOL/Recdef.thy
src/HOL/SET_Protocol/Message_SET.thy
src/HOL/SET_Protocol/Public_SET.thy
src/HOL/Set.thy
src/HOL/Statespace/StateFun.thy
src/HOL/UNITY/Comp.thy
src/HOL/UNITY/Comp/AllocImpl.thy
src/HOL/UNITY/Comp/Counter.thy
src/HOL/UNITY/Comp/Counterc.thy
src/HOL/UNITY/Comp/Priority.thy
src/HOL/UNITY/Comp/PriorityAux.thy
src/HOL/UNITY/Comp/Progress.thy
src/HOL/UNITY/Comp/TimerArray.thy
src/HOL/UNITY/Constrains.thy
src/HOL/UNITY/FP.thy
src/HOL/UNITY/Follows.thy
src/HOL/UNITY/Guar.thy
src/HOL/UNITY/Lift_prog.thy
src/HOL/UNITY/ListOrder.thy
src/HOL/UNITY/PPROD.thy
src/HOL/UNITY/ProgressSets.thy
src/HOL/UNITY/Project.thy
src/HOL/UNITY/Rename.thy
src/HOL/UNITY/Simple/Channel.thy
src/HOL/UNITY/Simple/Common.thy
src/HOL/UNITY/Simple/NSP_Bad.thy
src/HOL/UNITY/Simple/Reach.thy
src/HOL/UNITY/Simple/Reachability.thy
src/HOL/UNITY/Simple/Token.thy
src/HOL/UNITY/SubstAx.thy
src/HOL/UNITY/Transformers.thy
src/HOL/UNITY/UNITY.thy
src/HOL/UNITY/WFair.thy
src/HOL/Word/WordDefinition.thy
src/HOL/Word/WordGenLib.thy
src/HOL/ZF/Games.thy
src/HOL/ZF/HOLZF.thy
src/HOL/ZF/LProd.thy
src/HOL/ZF/MainZF.thy
src/HOL/ZF/Zet.thy
src/HOL/ex/Refute_Examples.thy
src/HOL/ex/Sudoku.thy
src/Sequents/LK0.thy
src/ZF/Sum.thy
     1.1 --- a/doc-src/TutorialI/Advanced/Partial.thy	Wed Feb 24 11:55:52 2010 +0100
     1.2 +++ b/doc-src/TutorialI/Advanced/Partial.thy	Mon Mar 01 13:40:23 2010 +0100
     1.3 @@ -34,7 +34,7 @@
     1.4  preconditions:
     1.5  *}
     1.6  
     1.7 -constdefs subtract :: "nat \<Rightarrow> nat \<Rightarrow> nat"
     1.8 +definition subtract :: "nat \<Rightarrow> nat \<Rightarrow> nat" where
     1.9  "n \<le> m \<Longrightarrow> subtract m n \<equiv> m - n"
    1.10  
    1.11  text{*
    1.12 @@ -85,7 +85,7 @@
    1.13  Phrased differently, the relation
    1.14  *}
    1.15  
    1.16 -constdefs step1 :: "('a \<Rightarrow> 'a) \<Rightarrow> ('a \<times> 'a)set"
    1.17 +definition step1 :: "('a \<Rightarrow> 'a) \<Rightarrow> ('a \<times> 'a)set" where
    1.18    "step1 f \<equiv> {(y,x). y = f x \<and> y \<noteq> x}"
    1.19  
    1.20  text{*\noindent
    1.21 @@ -160,7 +160,7 @@
    1.22  consider the following definition of function @{const find}:
    1.23  *}
    1.24  
    1.25 -constdefs find2 :: "('a \<Rightarrow> 'a) \<Rightarrow> 'a \<Rightarrow> 'a"
    1.26 +definition find2 :: "('a \<Rightarrow> 'a) \<Rightarrow> 'a \<Rightarrow> 'a" where
    1.27    "find2 f x \<equiv>
    1.28     fst(while (\<lambda>(x,x'). x' \<noteq> x) (\<lambda>(x,x'). (x',f x')) (x,f x))"
    1.29  
     2.1 --- a/doc-src/TutorialI/CTL/CTL.thy	Wed Feb 24 11:55:52 2010 +0100
     2.2 +++ b/doc-src/TutorialI/CTL/CTL.thy	Mon Mar 01 13:40:23 2010 +0100
     2.3 @@ -365,8 +365,7 @@
     2.4  *}
     2.5  
     2.6  (*<*)
     2.7 -constdefs
     2.8 - eufix :: "state set \<Rightarrow> state set \<Rightarrow> state set \<Rightarrow> state set"
     2.9 +definition eufix :: "state set \<Rightarrow> state set \<Rightarrow> state set \<Rightarrow> state set" where
    2.10  "eufix A B T \<equiv> B \<union> A \<inter> (M\<inverse> `` T)"
    2.11  
    2.12  lemma "lfp(eufix A B) \<subseteq> eusem A B"
    2.13 @@ -397,8 +396,7 @@
    2.14  done
    2.15  
    2.16  (*
    2.17 -constdefs
    2.18 - eusem :: "state set \<Rightarrow> state set \<Rightarrow> state set"
    2.19 +definition eusem :: "state set \<Rightarrow> state set \<Rightarrow> state set" where
    2.20  "eusem A B \<equiv> {s. \<exists>p\<in>Paths s. \<exists>j. p j \<in> B \<and> (\<forall>i < j. p i \<in> A)}"
    2.21  
    2.22  axioms
    2.23 @@ -414,8 +412,7 @@
    2.24  apply(blast intro: M_total[THEN someI_ex])
    2.25  done
    2.26  
    2.27 -constdefs
    2.28 - pcons :: "state \<Rightarrow> (nat \<Rightarrow> state) \<Rightarrow> (nat \<Rightarrow> state)"
    2.29 +definition pcons :: "state \<Rightarrow> (nat \<Rightarrow> state) \<Rightarrow> (nat \<Rightarrow> state)" where
    2.30  "pcons s p == \<lambda>i. case i of 0 \<Rightarrow> s | Suc j \<Rightarrow> p j"
    2.31  
    2.32  lemma pcons_PathI: "[| (s,t) : M; p \<in> Paths t |] ==> pcons s p \<in> Paths s";
     3.1 --- a/doc-src/TutorialI/Misc/Option2.thy	Wed Feb 24 11:55:52 2010 +0100
     3.2 +++ b/doc-src/TutorialI/Misc/Option2.thy	Mon Mar 01 13:40:23 2010 +0100
     3.3 @@ -24,8 +24,7 @@
     3.4  *}
     3.5  (*<*)
     3.6  (*
     3.7 -constdefs
     3.8 - infplus :: "nat option \<Rightarrow> nat option \<Rightarrow> nat option"
     3.9 +definition infplus :: "nat option \<Rightarrow> nat option \<Rightarrow> nat option" where
    3.10  "infplus x y \<equiv> case x of None \<Rightarrow> None
    3.11                 | Some m \<Rightarrow> (case y of None \<Rightarrow> None | Some n \<Rightarrow> Some(m+n))"
    3.12  
     4.1 --- a/doc-src/TutorialI/Overview/LNCS/FP1.thy	Wed Feb 24 11:55:52 2010 +0100
     4.2 +++ b/doc-src/TutorialI/Overview/LNCS/FP1.thy	Mon Mar 01 13:40:23 2010 +0100
     4.3 @@ -62,7 +62,7 @@
     4.4  consts xor :: "bool \<Rightarrow> bool \<Rightarrow> bool"
     4.5  defs xor_def: "xor x y \<equiv> x \<and> \<not>y \<or> \<not>x \<and> y"
     4.6  
     4.7 -constdefs nand :: "bool \<Rightarrow> bool \<Rightarrow> bool"
     4.8 +definition nand :: "bool \<Rightarrow> bool \<Rightarrow> bool" where
     4.9           "nand x y \<equiv> \<not>(x \<and> y)"
    4.10  
    4.11  lemma "\<not> xor x x"
     5.1 --- a/doc-src/TutorialI/Overview/LNCS/Ordinal.thy	Wed Feb 24 11:55:52 2010 +0100
     5.2 +++ b/doc-src/TutorialI/Overview/LNCS/Ordinal.thy	Mon Mar 01 13:40:23 2010 +0100
     5.3 @@ -9,8 +9,7 @@
     5.4    "pred (Succ a) n = Some a"
     5.5    "pred (Limit f) n = Some (f n)"
     5.6  
     5.7 -constdefs
     5.8 -  OpLim :: "(nat \<Rightarrow> (ordinal \<Rightarrow> ordinal)) \<Rightarrow> (ordinal \<Rightarrow> ordinal)"
     5.9 +definition OpLim :: "(nat \<Rightarrow> (ordinal \<Rightarrow> ordinal)) \<Rightarrow> (ordinal \<Rightarrow> ordinal)" where
    5.10    "OpLim F a \<equiv> Limit (\<lambda>n. F n a)"
    5.11    OpItw :: "(ordinal \<Rightarrow> ordinal) \<Rightarrow> (ordinal \<Rightarrow> ordinal)"    ("\<Squnion>")
    5.12    "\<Squnion>f \<equiv> OpLim (power f)"
    5.13 @@ -29,8 +28,7 @@
    5.14    "\<nabla>f (Succ a) = f (Succ (\<nabla>f a))"
    5.15    "\<nabla>f (Limit h) = Limit (\<lambda>n. \<nabla>f (h n))"
    5.16  
    5.17 -constdefs
    5.18 -  deriv :: "(ordinal \<Rightarrow> ordinal) \<Rightarrow> (ordinal \<Rightarrow> ordinal)"
    5.19 +definition deriv :: "(ordinal \<Rightarrow> ordinal) \<Rightarrow> (ordinal \<Rightarrow> ordinal)" where
    5.20    "deriv f \<equiv> \<nabla>(\<Squnion>f)"
    5.21  
    5.22  consts
    5.23 @@ -40,8 +38,7 @@
    5.24    "veblen (Succ a) = \<nabla>(OpLim (power (veblen a)))"
    5.25    "veblen (Limit f) = \<nabla>(OpLim (\<lambda>n. veblen (f n)))"
    5.26  
    5.27 -constdefs
    5.28 -  veb :: "ordinal \<Rightarrow> ordinal"
    5.29 +definition veb :: "ordinal \<Rightarrow> ordinal" where
    5.30    "veb a \<equiv> veblen a Zero"
    5.31    epsilon0 :: ordinal    ("\<epsilon>\<^sub>0")
    5.32    "\<epsilon>\<^sub>0 \<equiv> veb Zero"
     6.1 --- a/doc-src/TutorialI/Protocol/Message.thy	Wed Feb 24 11:55:52 2010 +0100
     6.2 +++ b/doc-src/TutorialI/Protocol/Message.thy	Mon Mar 01 13:40:23 2010 +0100
     6.3 @@ -46,8 +46,7 @@
     6.4  text{*The inverse of a symmetric key is itself; that of a public key
     6.5        is the private key and vice versa*}
     6.6  
     6.7 -constdefs
     6.8 -  symKeys :: "key set"
     6.9 +definition symKeys :: "key set" where
    6.10    "symKeys == {K. invKey K = K}"
    6.11  (*>*)
    6.12  
    6.13 @@ -92,8 +91,7 @@
    6.14    "{|x, y|}"      == "CONST MPair x y"
    6.15  
    6.16  
    6.17 -constdefs
    6.18 -  keysFor :: "msg set => key set"
    6.19 +definition keysFor :: "msg set => key set" where
    6.20      --{*Keys useful to decrypt elements of a message set*}
    6.21    "keysFor H == invKey ` {K. \<exists>X. Crypt K X \<in> H}"
    6.22  
     7.1 --- a/doc-src/TutorialI/Rules/Primes.thy	Wed Feb 24 11:55:52 2010 +0100
     7.2 +++ b/doc-src/TutorialI/Rules/Primes.thy	Mon Mar 01 13:40:23 2010 +0100
     7.3 @@ -99,8 +99,7 @@
     7.4  
     7.5  (**** The material below was omitted from the book ****)
     7.6  
     7.7 -constdefs
     7.8 -  is_gcd  :: "[nat,nat,nat] \<Rightarrow> bool"        (*gcd as a relation*)
     7.9 +definition is_gcd :: "[nat,nat,nat] \<Rightarrow> bool" where        (*gcd as a relation*)
    7.10      "is_gcd p m n == p dvd m  \<and>  p dvd n  \<and>
    7.11                       (ALL d. d dvd m \<and> d dvd n \<longrightarrow> d dvd p)"
    7.12  
     8.1 --- a/doc-src/TutorialI/Sets/Examples.thy	Wed Feb 24 11:55:52 2010 +0100
     8.2 +++ b/doc-src/TutorialI/Sets/Examples.thy	Mon Mar 01 13:40:23 2010 +0100
     8.3 @@ -156,8 +156,7 @@
     8.4  lemma "{x. P x \<longrightarrow> Q x} = -{x. P x} \<union> {x. Q x}"
     8.5  by blast
     8.6  
     8.7 -constdefs
     8.8 -  prime   :: "nat set"
     8.9 +definition prime :: "nat set" where
    8.10      "prime == {p. 1<p & (ALL m. m dvd p --> m=1 | m=p)}"
    8.11  
    8.12  lemma "{p*q | p q. p\<in>prime \<and> q\<in>prime} = 
     9.1 --- a/doc-src/ZF/If.thy	Wed Feb 24 11:55:52 2010 +0100
     9.2 +++ b/doc-src/ZF/If.thy	Mon Mar 01 13:40:23 2010 +0100
     9.3 @@ -8,8 +8,7 @@
     9.4  
     9.5  theory If imports FOL begin
     9.6  
     9.7 -constdefs
     9.8 -  "if" :: "[o,o,o]=>o"
     9.9 +definition "if" :: "[o,o,o]=>o" where
    9.10    "if(P,Q,R) == P&Q | ~P&R"
    9.11  
    9.12  lemma ifI:
    10.1 --- a/doc-src/ZF/ZF_examples.thy	Wed Feb 24 11:55:52 2010 +0100
    10.2 +++ b/doc-src/ZF/ZF_examples.thy	Mon Mar 01 13:40:23 2010 +0100
    10.3 @@ -64,7 +64,7 @@
    10.4       "t \<in> bt(A) ==> \<forall>k \<in> nat. n_nodes_aux(t)`k = n_nodes(t) #+ k"
    10.5    by (induct_tac t, simp_all) 
    10.6  
    10.7 -constdefs  n_nodes_tail :: "i => i"
    10.8 +definition n_nodes_tail :: "i => i" where
    10.9     "n_nodes_tail(t) == n_nodes_aux(t) ` 0"
   10.10  
   10.11  lemma "t \<in> bt(A) ==> n_nodes_tail(t) = n_nodes(t)"
    11.1 --- a/src/FOL/IFOL.thy	Wed Feb 24 11:55:52 2010 +0100
    11.2 +++ b/src/FOL/IFOL.thy	Mon Mar 01 13:40:23 2010 +0100
    11.3 @@ -760,8 +760,7 @@
    11.4  
    11.5  nonterminals letbinds letbind
    11.6  
    11.7 -constdefs
    11.8 -  Let :: "['a::{}, 'a => 'b] => ('b::{})"
    11.9 +definition Let :: "['a::{}, 'a => 'b] => ('b::{})" where
   11.10      "Let(s, f) == f(s)"
   11.11  
   11.12  syntax
    12.1 --- a/src/FOL/ex/If.thy	Wed Feb 24 11:55:52 2010 +0100
    12.2 +++ b/src/FOL/ex/If.thy	Mon Mar 01 13:40:23 2010 +0100
    12.3 @@ -7,8 +7,7 @@
    12.4  
    12.5  theory If imports FOL begin
    12.6  
    12.7 -constdefs
    12.8 -  "if" :: "[o,o,o]=>o"
    12.9 +definition "if" :: "[o,o,o]=>o" where
   12.10    "if(P,Q,R) == P&Q | ~P&R"
   12.11  
   12.12  lemma ifI:
    13.1 --- a/src/FOLP/ex/If.thy	Wed Feb 24 11:55:52 2010 +0100
    13.2 +++ b/src/FOLP/ex/If.thy	Mon Mar 01 13:40:23 2010 +0100
    13.3 @@ -4,8 +4,7 @@
    13.4  imports FOLP
    13.5  begin
    13.6  
    13.7 -constdefs
    13.8 -  "if" :: "[o,o,o]=>o"
    13.9 +definition "if" :: "[o,o,o]=>o" where
   13.10    "if(P,Q,R) == P&Q | ~P&R"
   13.11  
   13.12  lemma ifI:
    14.1 --- a/src/HOL/Algebra/AbelCoset.thy	Wed Feb 24 11:55:52 2010 +0100
    14.2 +++ b/src/HOL/Algebra/AbelCoset.thy	Mon Mar 01 13:40:23 2010 +0100
    14.3 @@ -38,15 +38,12 @@
    14.4                    ("racong\<index> _")
    14.5     "a_r_congruent G \<equiv> r_congruent \<lparr>carrier = carrier G, mult = add G, one = zero G\<rparr>"
    14.6  
    14.7 -constdefs
    14.8 -  A_FactGroup :: "[('a,'b) ring_scheme, 'a set] \<Rightarrow> ('a set) monoid"
    14.9 -     (infixl "A'_Mod" 65)
   14.10 +definition A_FactGroup :: "[('a,'b) ring_scheme, 'a set] \<Rightarrow> ('a set) monoid" (infixl "A'_Mod" 65) where
   14.11      --{*Actually defined for groups rather than monoids*}
   14.12    "A_FactGroup G H \<equiv> FactGroup \<lparr>carrier = carrier G, mult = add G, one = zero G\<rparr> H"
   14.13  
   14.14 -constdefs
   14.15 -  a_kernel :: "('a, 'm) ring_scheme \<Rightarrow> ('b, 'n) ring_scheme \<Rightarrow> 
   14.16 -             ('a \<Rightarrow> 'b) \<Rightarrow> 'a set" 
   14.17 +definition a_kernel :: "('a, 'm) ring_scheme \<Rightarrow> ('b, 'n) ring_scheme \<Rightarrow> 
   14.18 +             ('a \<Rightarrow> 'b) \<Rightarrow> 'a set" where 
   14.19      --{*the kernel of a homomorphism (additive)*}
   14.20    "a_kernel G H h \<equiv> kernel \<lparr>carrier = carrier G, mult = add G, one = zero G\<rparr>
   14.21                                \<lparr>carrier = carrier H, mult = add H, one = zero H\<rparr> h"
    15.1 --- a/src/HOL/Algebra/Bij.thy	Wed Feb 24 11:55:52 2010 +0100
    15.2 +++ b/src/HOL/Algebra/Bij.thy	Mon Mar 01 13:40:23 2010 +0100
    15.3 @@ -1,5 +1,4 @@
    15.4  (*  Title:      HOL/Algebra/Bij.thy
    15.5 -    ID:         $Id$
    15.6      Author:     Florian Kammueller, with new proofs by L C Paulson
    15.7  *)
    15.8  
    15.9 @@ -8,12 +7,11 @@
   15.10  
   15.11  section {* Bijections of a Set, Permutation and Automorphism Groups *}
   15.12  
   15.13 -constdefs
   15.14 -  Bij :: "'a set \<Rightarrow> ('a \<Rightarrow> 'a) set"
   15.15 +definition Bij :: "'a set \<Rightarrow> ('a \<Rightarrow> 'a) set" where
   15.16      --{*Only extensional functions, since otherwise we get too many.*}
   15.17    "Bij S \<equiv> extensional S \<inter> {f. bij_betw f S S}"
   15.18  
   15.19 -  BijGroup :: "'a set \<Rightarrow> ('a \<Rightarrow> 'a) monoid"
   15.20 +definition BijGroup :: "'a set \<Rightarrow> ('a \<Rightarrow> 'a) monoid" where
   15.21    "BijGroup S \<equiv>
   15.22      \<lparr>carrier = Bij S,
   15.23       mult = \<lambda>g \<in> Bij S. \<lambda>f \<in> Bij S. compose S g f,
   15.24 @@ -71,11 +69,10 @@
   15.25  done
   15.26  
   15.27  
   15.28 -constdefs
   15.29 -  auto :: "('a, 'b) monoid_scheme \<Rightarrow> ('a \<Rightarrow> 'a) set"
   15.30 +definition auto :: "('a, 'b) monoid_scheme \<Rightarrow> ('a \<Rightarrow> 'a) set" where
   15.31    "auto G \<equiv> hom G G \<inter> Bij (carrier G)"
   15.32  
   15.33 -  AutoGroup :: "('a, 'c) monoid_scheme \<Rightarrow> ('a \<Rightarrow> 'a) monoid"
   15.34 +definition AutoGroup :: "('a, 'c) monoid_scheme \<Rightarrow> ('a \<Rightarrow> 'a) monoid" where
   15.35    "AutoGroup G \<equiv> BijGroup (carrier G) \<lparr>carrier := auto G\<rparr>"
   15.36  
   15.37  lemma (in group) id_in_auto: "(\<lambda>x \<in> carrier G. x) \<in> auto G"
    16.1 --- a/src/HOL/Algebra/Coset.thy	Wed Feb 24 11:55:52 2010 +0100
    16.2 +++ b/src/HOL/Algebra/Coset.thy	Mon Mar 01 13:40:23 2010 +0100
    16.3 @@ -751,8 +751,7 @@
    16.4  
    16.5  subsection {*Order of a Group and Lagrange's Theorem*}
    16.6  
    16.7 -constdefs
    16.8 -  order :: "('a, 'b) monoid_scheme \<Rightarrow> nat"
    16.9 +definition order :: "('a, 'b) monoid_scheme \<Rightarrow> nat" where
   16.10    "order S \<equiv> card (carrier S)"
   16.11  
   16.12  lemma (in group) rcosets_part_G:
   16.13 @@ -822,9 +821,7 @@
   16.14  
   16.15  subsection {*Quotient Groups: Factorization of a Group*}
   16.16  
   16.17 -constdefs
   16.18 -  FactGroup :: "[('a,'b) monoid_scheme, 'a set] \<Rightarrow> ('a set) monoid"
   16.19 -     (infixl "Mod" 65)
   16.20 +definition FactGroup :: "[('a,'b) monoid_scheme, 'a set] \<Rightarrow> ('a set) monoid" (infixl "Mod" 65) where
   16.21      --{*Actually defined for groups rather than monoids*}
   16.22    "FactGroup G H \<equiv>
   16.23      \<lparr>carrier = rcosets\<^bsub>G\<^esub> H, mult = set_mult G, one = H\<rparr>"
   16.24 @@ -890,9 +887,8 @@
   16.25  text{*The quotient by the kernel of a homomorphism is isomorphic to the 
   16.26    range of that homomorphism.*}
   16.27  
   16.28 -constdefs
   16.29 -  kernel :: "('a, 'm) monoid_scheme \<Rightarrow> ('b, 'n) monoid_scheme \<Rightarrow> 
   16.30 -             ('a \<Rightarrow> 'b) \<Rightarrow> 'a set" 
   16.31 +definition kernel :: "('a, 'm) monoid_scheme \<Rightarrow> ('b, 'n) monoid_scheme \<Rightarrow> 
   16.32 +             ('a \<Rightarrow> 'b) \<Rightarrow> 'a set" where 
   16.33      --{*the kernel of a homomorphism*}
   16.34    "kernel G H h \<equiv> {x. x \<in> carrier G & h x = \<one>\<^bsub>H\<^esub>}"
   16.35  
    17.1 --- a/src/HOL/Algebra/Divisibility.thy	Wed Feb 24 11:55:52 2010 +0100
    17.2 +++ b/src/HOL/Algebra/Divisibility.thy	Mon Mar 01 13:40:23 2010 +0100
    17.3 @@ -3630,8 +3630,7 @@
    17.4  
    17.5  text {* Number of factors for wellfoundedness *}
    17.6  
    17.7 -constdefs
    17.8 -  factorcount :: "_ \<Rightarrow> 'a \<Rightarrow> nat"
    17.9 +definition factorcount :: "_ \<Rightarrow> 'a \<Rightarrow> nat" where
   17.10    "factorcount G a == THE c. (ALL as. set as \<subseteq> carrier G \<and> 
   17.11                                        wfactors G as a \<longrightarrow> c = length as)"
   17.12  
    18.1 --- a/src/HOL/Algebra/FiniteProduct.thy	Wed Feb 24 11:55:52 2010 +0100
    18.2 +++ b/src/HOL/Algebra/FiniteProduct.thy	Mon Mar 01 13:40:23 2010 +0100
    18.3 @@ -26,8 +26,7 @@
    18.4  
    18.5  inductive_cases empty_foldSetDE [elim!]: "({}, x) \<in> foldSetD D f e"
    18.6  
    18.7 -constdefs
    18.8 -  foldD :: "['a set, 'b => 'a => 'a, 'a, 'b set] => 'a"
    18.9 +definition foldD :: "['a set, 'b => 'a => 'a, 'a, 'b set] => 'a" where
   18.10    "foldD D f e A == THE x. (A, x) \<in> foldSetD D f e"
   18.11  
   18.12  lemma foldSetD_closed:
    19.1 --- a/src/HOL/Algebra/Group.thy	Wed Feb 24 11:55:52 2010 +0100
    19.2 +++ b/src/HOL/Algebra/Group.thy	Mon Mar 01 13:40:23 2010 +0100
    19.3 @@ -478,8 +478,7 @@
    19.4  
    19.5  subsection {* Direct Products *}
    19.6  
    19.7 -constdefs
    19.8 -  DirProd :: "_ \<Rightarrow> _ \<Rightarrow> ('a \<times> 'b) monoid"  (infixr "\<times>\<times>" 80)
    19.9 +definition DirProd :: "_ \<Rightarrow> _ \<Rightarrow> ('a \<times> 'b) monoid" (infixr "\<times>\<times>" 80) where
   19.10    "G \<times>\<times> H \<equiv> \<lparr>carrier = carrier G \<times> carrier H,
   19.11                  mult = (\<lambda>(g, h) (g', h'). (g \<otimes>\<^bsub>G\<^esub> g', h \<otimes>\<^bsub>H\<^esub> h')),
   19.12                  one = (\<one>\<^bsub>G\<^esub>, \<one>\<^bsub>H\<^esub>)\<rparr>"
   19.13 @@ -545,8 +544,7 @@
   19.14    "[|h \<in> hom G H; i \<in> hom H I|] ==> compose (carrier G) i h \<in> hom G I"
   19.15  by (fastsimp simp add: hom_def compose_def)
   19.16  
   19.17 -constdefs
   19.18 -  iso :: "_ => _ => ('a => 'b) set"  (infixr "\<cong>" 60)
   19.19 +definition iso :: "_ => _ => ('a => 'b) set" (infixr "\<cong>" 60) where
   19.20    "G \<cong> H == {h. h \<in> hom G H & bij_betw h (carrier G) (carrier H)}"
   19.21  
   19.22  lemma iso_refl: "(%x. x) \<in> G \<cong> G"
    20.1 --- a/src/HOL/Algebra/IntRing.thy	Wed Feb 24 11:55:52 2010 +0100
    20.2 +++ b/src/HOL/Algebra/IntRing.thy	Mon Mar 01 13:40:23 2010 +0100
    20.3 @@ -22,8 +22,7 @@
    20.4  
    20.5  subsection {* @{text "\<Z>"}: The Set of Integers as Algebraic Structure *}
    20.6  
    20.7 -constdefs
    20.8 -  int_ring :: "int ring" ("\<Z>")
    20.9 +definition int_ring :: "int ring" ("\<Z>") where
   20.10    "int_ring \<equiv> \<lparr>carrier = UNIV, mult = op *, one = 1, zero = 0, add = op +\<rparr>"
   20.11  
   20.12  lemma int_Zcarr [intro!, simp]:
   20.13 @@ -324,8 +323,7 @@
   20.14  
   20.15  subsection {* Ideals and the Modulus *}
   20.16  
   20.17 -constdefs
   20.18 -   ZMod :: "int => int => int set"
   20.19 +definition ZMod :: "int => int => int set" where
   20.20    "ZMod k r == (Idl\<^bsub>\<Z>\<^esub> {k}) +>\<^bsub>\<Z>\<^esub> r"
   20.21  
   20.22  lemmas ZMod_defs =
   20.23 @@ -407,8 +405,7 @@
   20.24  
   20.25  subsection {* Factorization *}
   20.26  
   20.27 -constdefs
   20.28 -  ZFact :: "int \<Rightarrow> int set ring"
   20.29 +definition ZFact :: "int \<Rightarrow> int set ring" where
   20.30    "ZFact k == \<Z> Quot (Idl\<^bsub>\<Z>\<^esub> {k})"
   20.31  
   20.32  lemmas ZFact_defs = ZFact_def FactRing_def
    21.1 --- a/src/HOL/Algebra/Ring.thy	Wed Feb 24 11:55:52 2010 +0100
    21.2 +++ b/src/HOL/Algebra/Ring.thy	Mon Mar 01 13:40:23 2010 +0100
    21.3 @@ -198,8 +198,7 @@
    21.4    This definition makes it easy to lift lemmas from @{term finprod}.
    21.5  *}
    21.6  
    21.7 -constdefs
    21.8 -  finsum :: "[('b, 'm) ring_scheme, 'a => 'b, 'a set] => 'b"
    21.9 +definition finsum :: "[('b, 'm) ring_scheme, 'a => 'b, 'a set] => 'b" where
   21.10    "finsum G f A == finprod (| carrier = carrier G,
   21.11       mult = add G, one = zero G |) f A"
   21.12  
    22.1 --- a/src/HOL/Auth/CertifiedEmail.thy	Wed Feb 24 11:55:52 2010 +0100
    22.2 +++ b/src/HOL/Auth/CertifiedEmail.thy	Mon Mar 01 13:40:23 2010 +0100
    22.3 @@ -25,8 +25,7 @@
    22.4    BothAuth :: nat
    22.5  
    22.6  text{*We formalize a fixed way of computing responses.  Could be better.*}
    22.7 -constdefs
    22.8 -  "response"    :: "agent => agent => nat => msg"
    22.9 +definition "response" :: "agent => agent => nat => msg" where
   22.10     "response S R q == Hash {|Agent S, Key (shrK R), Nonce q|}"
   22.11  
   22.12  
    23.1 --- a/src/HOL/Auth/Guard/Extensions.thy	Wed Feb 24 11:55:52 2010 +0100
    23.2 +++ b/src/HOL/Auth/Guard/Extensions.thy	Mon Mar 01 13:40:23 2010 +0100
    23.3 @@ -61,7 +61,7 @@
    23.4  
    23.5  subsubsection{*messages that are pairs*}
    23.6  
    23.7 -constdefs is_MPair :: "msg => bool"
    23.8 +definition is_MPair :: "msg => bool" where
    23.9  "is_MPair X == EX Y Z. X = {|Y,Z|}"
   23.10  
   23.11  declare is_MPair_def [simp]
   23.12 @@ -96,7 +96,7 @@
   23.13  
   23.14  declare is_MPair_def [simp del]
   23.15  
   23.16 -constdefs has_no_pair :: "msg set => bool"
   23.17 +definition has_no_pair :: "msg set => bool" where
   23.18  "has_no_pair H == ALL X Y. {|X,Y|} ~:H"
   23.19  
   23.20  declare has_no_pair_def [simp]
   23.21 @@ -117,7 +117,7 @@
   23.22  
   23.23  subsubsection{*lemmas on keysFor*}
   23.24  
   23.25 -constdefs usekeys :: "msg set => key set"
   23.26 +definition usekeys :: "msg set => key set" where
   23.27  "usekeys G == {K. EX Y. Crypt K Y:G}"
   23.28  
   23.29  lemma finite_keysFor [intro]: "finite G ==> finite (keysFor G)"
   23.30 @@ -237,7 +237,7 @@
   23.31  
   23.32  subsubsection{*sets of keys*}
   23.33  
   23.34 -constdefs keyset :: "msg set => bool"
   23.35 +definition keyset :: "msg set => bool" where
   23.36  "keyset G == ALL X. X:G --> (EX K. X = Key K)"
   23.37  
   23.38  lemma keyset_in [dest]: "[| keyset G; X:G |] ==> EX K. X = Key K"
   23.39 @@ -257,7 +257,7 @@
   23.40  
   23.41  subsubsection{*keys a priori necessary for decrypting the messages of G*}
   23.42  
   23.43 -constdefs keysfor :: "msg set => msg set"
   23.44 +definition keysfor :: "msg set => msg set" where
   23.45  "keysfor G == Key ` keysFor (parts G)"
   23.46  
   23.47  lemma keyset_keysfor [iff]: "keyset (keysfor G)"
   23.48 @@ -295,7 +295,7 @@
   23.49  
   23.50  subsubsection{*general protocol properties*}
   23.51  
   23.52 -constdefs is_Says :: "event => bool"
   23.53 +definition is_Says :: "event => bool" where
   23.54  "is_Says ev == (EX A B X. ev = Says A B X)"
   23.55  
   23.56  lemma is_Says_Says [iff]: "is_Says (Says A B X)"
   23.57 @@ -303,7 +303,7 @@
   23.58  
   23.59  (* one could also require that Gets occurs after Says
   23.60  but this is sufficient for our purpose *)
   23.61 -constdefs Gets_correct :: "event list set => bool"
   23.62 +definition Gets_correct :: "event list set => bool" where
   23.63  "Gets_correct p == ALL evs B X. evs:p --> Gets B X:set evs
   23.64  --> (EX A. Says A B X:set evs)"
   23.65  
   23.66 @@ -312,7 +312,7 @@
   23.67  apply (simp add: Gets_correct_def)
   23.68  by (drule_tac x="Gets B X # evs" in spec, auto)
   23.69  
   23.70 -constdefs one_step :: "event list set => bool"
   23.71 +definition one_step :: "event list set => bool" where
   23.72  "one_step p == ALL evs ev. ev#evs:p --> evs:p"
   23.73  
   23.74  lemma one_step_Cons [dest]: "[| one_step p; ev#evs:p |] ==> evs:p"
   23.75 @@ -324,7 +324,7 @@
   23.76  lemma trunc: "[| evs @ evs':p; one_step p |] ==> evs':p"
   23.77  by (induct evs, auto)
   23.78  
   23.79 -constdefs has_only_Says :: "event list set => bool"
   23.80 +definition has_only_Says :: "event list set => bool" where
   23.81  "has_only_Says p == ALL evs ev. evs:p --> ev:set evs
   23.82  --> (EX A B X. ev = Says A B X)"
   23.83  
   23.84 @@ -450,7 +450,7 @@
   23.85        if A=A' then insert X (knows_max' A evs) else knows_max' A evs
   23.86    ))"
   23.87  
   23.88 -constdefs knows_max :: "agent => event list => msg set"
   23.89 +definition knows_max :: "agent => event list => msg set" where
   23.90  "knows_max A evs == knows_max' A evs Un initState A"
   23.91  
   23.92  abbreviation
   23.93 @@ -512,7 +512,7 @@
   23.94      | Notes A X => parts {X} Un used' evs
   23.95    )"
   23.96  
   23.97 -constdefs init :: "msg set"
   23.98 +definition init :: "msg set" where
   23.99  "init == used []"
  23.100  
  23.101  lemma used_decomp: "used evs = init Un used' evs"
    24.1 --- a/src/HOL/Auth/Guard/Guard.thy	Wed Feb 24 11:55:52 2010 +0100
    24.2 +++ b/src/HOL/Auth/Guard/Guard.thy	Mon Mar 01 13:40:23 2010 +0100
    24.3 @@ -76,7 +76,7 @@
    24.4  
    24.5  subsection{*guarded sets*}
    24.6  
    24.7 -constdefs Guard :: "nat => key set => msg set => bool"
    24.8 +definition Guard :: "nat => key set => msg set => bool" where
    24.9  "Guard n Ks H == ALL X. X:H --> X:guard n Ks"
   24.10  
   24.11  subsection{*basic facts about @{term Guard}*}
   24.12 @@ -241,7 +241,7 @@
   24.13  
   24.14  subsection{*list corresponding to "decrypt"*}
   24.15  
   24.16 -constdefs decrypt' :: "msg list => key => msg => msg list"
   24.17 +definition decrypt' :: "msg list => key => msg => msg list" where
   24.18  "decrypt' l K Y == Y # remove l (Crypt K Y)"
   24.19  
   24.20  declare decrypt'_def [simp]
    25.1 --- a/src/HOL/Auth/Guard/GuardK.thy	Wed Feb 24 11:55:52 2010 +0100
    25.2 +++ b/src/HOL/Auth/Guard/GuardK.thy	Mon Mar 01 13:40:23 2010 +0100
    25.3 @@ -85,7 +85,7 @@
    25.4  
    25.5  subsection{*guarded sets*}
    25.6  
    25.7 -constdefs GuardK :: "nat => key set => msg set => bool"
    25.8 +definition GuardK :: "nat => key set => msg set => bool" where
    25.9  "GuardK n Ks H == ALL X. X:H --> X:guardK n Ks"
   25.10  
   25.11  subsection{*basic facts about @{term GuardK}*}
   25.12 @@ -239,7 +239,7 @@
   25.13  
   25.14  subsection{*list corresponding to "decrypt"*}
   25.15  
   25.16 -constdefs decrypt' :: "msg list => key => msg => msg list"
   25.17 +definition decrypt' :: "msg list => key => msg => msg list" where
   25.18  "decrypt' l K Y == Y # remove l (Crypt K Y)"
   25.19  
   25.20  declare decrypt'_def [simp]
    26.1 --- a/src/HOL/Auth/Guard/Guard_Public.thy	Wed Feb 24 11:55:52 2010 +0100
    26.2 +++ b/src/HOL/Auth/Guard/Guard_Public.thy	Mon Mar 01 13:40:23 2010 +0100
    26.3 @@ -19,7 +19,7 @@
    26.4  
    26.5  subsubsection{*signature*}
    26.6  
    26.7 -constdefs sign :: "agent => msg => msg"
    26.8 +definition sign :: "agent => msg => msg" where
    26.9  "sign A X == {|Agent A, X, Crypt (priK A) (Hash X)|}"
   26.10  
   26.11  lemma sign_inj [iff]: "(sign A X = sign A' X') = (A=A' & X=X')"
   26.12 @@ -27,7 +27,7 @@
   26.13  
   26.14  subsubsection{*agent associated to a key*}
   26.15  
   26.16 -constdefs agt :: "key => agent"
   26.17 +definition agt :: "key => agent" where
   26.18  "agt K == @A. K = priK A | K = pubK A"
   26.19  
   26.20  lemma agt_priK [simp]: "agt (priK A) = A"
   26.21 @@ -57,7 +57,7 @@
   26.22  
   26.23  subsubsection{*sets of private keys*}
   26.24  
   26.25 -constdefs priK_set :: "key set => bool"
   26.26 +definition priK_set :: "key set => bool" where
   26.27  "priK_set Ks == ALL K. K:Ks --> (EX A. K = priK A)"
   26.28  
   26.29  lemma in_priK_set: "[| priK_set Ks; K:Ks |] ==> EX A. K = priK A"
   26.30 @@ -71,7 +71,7 @@
   26.31  
   26.32  subsubsection{*sets of good keys*}
   26.33  
   26.34 -constdefs good :: "key set => bool"
   26.35 +definition good :: "key set => bool" where
   26.36  "good Ks == ALL K. K:Ks --> agt K ~:bad"
   26.37  
   26.38  lemma in_good: "[| good Ks; K:Ks |] ==> agt K ~:bad"
   26.39 @@ -99,7 +99,7 @@
   26.40  
   26.41  subsubsection{*function giving a new nonce*}
   26.42  
   26.43 -constdefs new :: "event list => nat"
   26.44 +definition new :: "event list => nat" where
   26.45  "new evs == Suc (greatest evs)"
   26.46  
   26.47  lemma new_isnt_used [iff]: "Nonce (new evs) ~:used evs"
   26.48 @@ -151,7 +151,7 @@
   26.49  
   26.50  subsubsection{*regular protocols*}
   26.51  
   26.52 -constdefs regular :: "event list set => bool"
   26.53 +definition regular :: "event list set => bool" where
   26.54  "regular p == ALL evs A. evs:p --> (Key (priK A):parts (spies evs)) = (A:bad)"
   26.55  
   26.56  lemma priK_parts_iff_bad [simp]: "[| evs:p; regular p |] ==>
    27.1 --- a/src/HOL/Auth/Guard/Guard_Shared.thy	Wed Feb 24 11:55:52 2010 +0100
    27.2 +++ b/src/HOL/Auth/Guard/Guard_Shared.thy	Mon Mar 01 13:40:23 2010 +0100
    27.3 @@ -25,7 +25,7 @@
    27.4  
    27.5  subsubsection{*agent associated to a key*}
    27.6  
    27.7 -constdefs agt :: "key => agent"
    27.8 +definition agt :: "key => agent" where
    27.9  "agt K == @A. K = shrK A"
   27.10  
   27.11  lemma agt_shrK [simp]: "agt (shrK A) = A"
   27.12 @@ -52,7 +52,7 @@
   27.13  
   27.14  subsubsection{*sets of symmetric keys*}
   27.15  
   27.16 -constdefs shrK_set :: "key set => bool"
   27.17 +definition shrK_set :: "key set => bool" where
   27.18  "shrK_set Ks == ALL K. K:Ks --> (EX A. K = shrK A)"
   27.19  
   27.20  lemma in_shrK_set: "[| shrK_set Ks; K:Ks |] ==> EX A. K = shrK A"
   27.21 @@ -66,7 +66,7 @@
   27.22  
   27.23  subsubsection{*sets of good keys*}
   27.24  
   27.25 -constdefs good :: "key set => bool"
   27.26 +definition good :: "key set => bool" where
   27.27  "good Ks == ALL K. K:Ks --> agt K ~:bad"
   27.28  
   27.29  lemma in_good: "[| good Ks; K:Ks |] ==> agt K ~:bad"
   27.30 @@ -154,7 +154,7 @@
   27.31  
   27.32  subsubsection{*regular protocols*}
   27.33  
   27.34 -constdefs regular :: "event list set => bool"
   27.35 +definition regular :: "event list set => bool" where
   27.36  "regular p == ALL evs A. evs:p --> (Key (shrK A):parts (spies evs)) = (A:bad)"
   27.37  
   27.38  lemma shrK_parts_iff_bad [simp]: "[| evs:p; regular p |] ==>
    28.1 --- a/src/HOL/Auth/Guard/Guard_Yahalom.thy	Wed Feb 24 11:55:52 2010 +0100
    28.2 +++ b/src/HOL/Auth/Guard/Guard_Yahalom.thy	Mon Mar 01 13:40:23 2010 +0100
    28.3 @@ -198,7 +198,7 @@
    28.4  
    28.5  subsection{*guardedness of NB*}
    28.6  
    28.7 -constdefs ya_keys :: "agent => agent => nat => nat => event list => key set"
    28.8 +definition ya_keys :: "agent => agent => nat => nat => event list => key set" where
    28.9  "ya_keys A B NA NB evs == {shrK A,shrK B} Un {K. ya3 A B NA NB K:set evs}"
   28.10  
   28.11  lemma Guard_NB [rule_format]: "[| evs:ya; A ~:bad; B ~:bad |] ==>
    29.1 --- a/src/HOL/Auth/Guard/P1.thy	Wed Feb 24 11:55:52 2010 +0100
    29.2 +++ b/src/HOL/Auth/Guard/P1.thy	Mon Mar 01 13:40:23 2010 +0100
    29.3 @@ -39,7 +39,7 @@
    29.4  subsubsection{*offer chaining:
    29.5  B chains his offer for A with the head offer of L for sending it to C*}
    29.6  
    29.7 -constdefs chain :: "agent => nat => agent => msg => agent => msg"
    29.8 +definition chain :: "agent => nat => agent => msg => agent => msg" where
    29.9  "chain B ofr A L C ==
   29.10  let m1= Crypt (pubK A) (Nonce ofr) in
   29.11  let m2= Hash {|head L, Agent C|} in
   29.12 @@ -86,7 +86,7 @@
   29.13  
   29.14  subsubsection{*anchor of the offer list*}
   29.15  
   29.16 -constdefs anchor :: "agent => nat => agent => msg"
   29.17 +definition anchor :: "agent => nat => agent => msg" where
   29.18  "anchor A n B == chain A n A (cons nil nil) B"
   29.19  
   29.20  lemma anchor_inj [iff]: "(anchor A n B = anchor A' n' B')
   29.21 @@ -107,7 +107,7 @@
   29.22  
   29.23  subsubsection{*request event*}
   29.24  
   29.25 -constdefs reqm :: "agent => nat => nat => msg => agent => msg"
   29.26 +definition reqm :: "agent => nat => nat => msg => agent => msg" where
   29.27  "reqm A r n I B == {|Agent A, Number r, cons (Agent A) (cons (Agent B) I),
   29.28  cons (anchor A n B) nil|}"
   29.29  
   29.30 @@ -118,7 +118,7 @@
   29.31  lemma Nonce_in_reqm [iff]: "Nonce n:parts {reqm A r n I B}"
   29.32  by (auto simp: reqm_def)
   29.33  
   29.34 -constdefs req :: "agent => nat => nat => msg => agent => event"
   29.35 +definition req :: "agent => nat => nat => msg => agent => event" where
   29.36  "req A r n I B == Says A B (reqm A r n I B)"
   29.37  
   29.38  lemma req_inj [iff]: "(req A r n I B = req A' r' n' I' B')
   29.39 @@ -127,8 +127,8 @@
   29.40  
   29.41  subsubsection{*propose event*}
   29.42  
   29.43 -constdefs prom :: "agent => nat => agent => nat => msg => msg =>
   29.44 -msg => agent => msg"
   29.45 +definition prom :: "agent => nat => agent => nat => msg => msg =>
   29.46 +msg => agent => msg" where
   29.47  "prom B ofr A r I L J C == {|Agent A, Number r,
   29.48  app (J, del (Agent B, I)), cons (chain B ofr A L C) L|}"
   29.49  
   29.50 @@ -140,8 +140,8 @@
   29.51  lemma Nonce_in_prom [iff]: "Nonce ofr:parts {prom B ofr A r I L J C}"
   29.52  by (auto simp: prom_def)
   29.53  
   29.54 -constdefs pro :: "agent => nat => agent => nat => msg => msg =>
   29.55 -msg => agent => event"
   29.56 +definition pro :: "agent => nat => agent => nat => msg => msg =>
   29.57 +msg => agent => event" where
   29.58  "pro B ofr A r I L J C == Says B C (prom B ofr A r I L J C)"
   29.59  
   29.60  lemma pro_inj [dest]: "pro B ofr A r I L J C = pro B' ofr' A' r' I' L' J' C'
   29.61 @@ -198,7 +198,7 @@
   29.62  
   29.63  subsubsection{*offers of an offer list*}
   29.64  
   29.65 -constdefs offer_nonces :: "msg => msg set"
   29.66 +definition offer_nonces :: "msg => msg set" where
   29.67  "offer_nonces L == {X. X:parts {L} & (EX n. X = Nonce n)}"
   29.68  
   29.69  subsubsection{*the originator can get the offers*}
   29.70 @@ -252,7 +252,7 @@
   29.71  pro C (Suc ofr) A r I' L nil D
   29.72  # trace (B,Suc ofr,A,r,I'',tail L,K))"
   29.73  
   29.74 -constdefs trace' :: "agent => nat => nat => msg => agent => nat => event list"
   29.75 +definition trace' :: "agent => nat => nat => msg => agent => nat => event list" where
   29.76  "trace' A r n I B ofr == (
   29.77  let AI = cons (Agent A) I in
   29.78  let L = offer_list (A,n,B,AI,ofr) in
    30.1 --- a/src/HOL/Auth/Guard/P2.thy	Wed Feb 24 11:55:52 2010 +0100
    30.2 +++ b/src/HOL/Auth/Guard/P2.thy	Mon Mar 01 13:40:23 2010 +0100
    30.3 @@ -26,7 +26,7 @@
    30.4  subsubsection{*offer chaining:
    30.5  B chains his offer for A with the head offer of L for sending it to C*}
    30.6  
    30.7 -constdefs chain :: "agent => nat => agent => msg => agent => msg"
    30.8 +definition chain :: "agent => nat => agent => msg => agent => msg" where
    30.9  "chain B ofr A L C ==
   30.10  let m1= sign B (Nonce ofr) in
   30.11  let m2= Hash {|head L, Agent C|} in
   30.12 @@ -73,7 +73,7 @@
   30.13  
   30.14  subsubsection{*anchor of the offer list*}
   30.15  
   30.16 -constdefs anchor :: "agent => nat => agent => msg"
   30.17 +definition anchor :: "agent => nat => agent => msg" where
   30.18  "anchor A n B == chain A n A (cons nil nil) B"
   30.19  
   30.20  lemma anchor_inj [iff]:
   30.21 @@ -88,7 +88,7 @@
   30.22  
   30.23  subsubsection{*request event*}
   30.24  
   30.25 -constdefs reqm :: "agent => nat => nat => msg => agent => msg"
   30.26 +definition reqm :: "agent => nat => nat => msg => agent => msg" where
   30.27  "reqm A r n I B == {|Agent A, Number r, cons (Agent A) (cons (Agent B) I),
   30.28  cons (anchor A n B) nil|}"
   30.29  
   30.30 @@ -99,7 +99,7 @@
   30.31  lemma Nonce_in_reqm [iff]: "Nonce n:parts {reqm A r n I B}"
   30.32  by (auto simp: reqm_def)
   30.33  
   30.34 -constdefs req :: "agent => nat => nat => msg => agent => event"
   30.35 +definition req :: "agent => nat => nat => msg => agent => event" where
   30.36  "req A r n I B == Says A B (reqm A r n I B)"
   30.37  
   30.38  lemma req_inj [iff]: "(req A r n I B = req A' r' n' I' B')
   30.39 @@ -108,8 +108,8 @@
   30.40  
   30.41  subsubsection{*propose event*}
   30.42  
   30.43 -constdefs prom :: "agent => nat => agent => nat => msg => msg =>
   30.44 -msg => agent => msg"
   30.45 +definition prom :: "agent => nat => agent => nat => msg => msg =>
   30.46 +msg => agent => msg" where
   30.47  "prom B ofr A r I L J C == {|Agent A, Number r,
   30.48  app (J, del (Agent B, I)), cons (chain B ofr A L C) L|}"
   30.49  
   30.50 @@ -120,8 +120,8 @@
   30.51  lemma Nonce_in_prom [iff]: "Nonce ofr:parts {prom B ofr A r I L J C}"
   30.52  by (auto simp: prom_def)
   30.53  
   30.54 -constdefs pro :: "agent => nat => agent => nat => msg => msg =>
   30.55 -                  msg => agent => event"
   30.56 +definition pro :: "agent => nat => agent => nat => msg => msg =>
   30.57 +                  msg => agent => event" where
   30.58  "pro B ofr A r I L J C == Says B C (prom B ofr A r I L J C)"
   30.59  
   30.60  lemma pro_inj [dest]: "pro B ofr A r I L J C = pro B' ofr' A' r' I' L' J' C'
    31.1 --- a/src/HOL/Auth/Guard/Proto.thy	Wed Feb 24 11:55:52 2010 +0100
    31.2 +++ b/src/HOL/Auth/Guard/Proto.thy	Mon Mar 01 13:40:23 2010 +0100
    31.3 @@ -23,7 +23,7 @@
    31.4  
    31.5  types proto = "rule set"
    31.6  
    31.7 -constdefs wdef :: "proto => bool"
    31.8 +definition wdef :: "proto => bool" where
    31.9  "wdef p == ALL R k. R:p --> Number k:parts {msg' R}
   31.10  --> Number k:parts (msg`(fst R))"
   31.11  
   31.12 @@ -35,19 +35,17 @@
   31.13    nb    :: "nat => msg"
   31.14    key   :: "key => key"
   31.15  
   31.16 -consts apm :: "subs => msg => msg"
   31.17 -
   31.18 -primrec
   31.19 -"apm s (Agent A) = Agent (agent s A)"
   31.20 -"apm s (Nonce n) = Nonce (nonce s n)"
   31.21 -"apm s (Number n) = nb s n"
   31.22 -"apm s (Key K) = Key (key s K)"
   31.23 -"apm s (Hash X) = Hash (apm s X)"
   31.24 -"apm s (Crypt K X) = (
   31.25 +primrec apm :: "subs => msg => msg" where
   31.26 +  "apm s (Agent A) = Agent (agent s A)"
   31.27 +| "apm s (Nonce n) = Nonce (nonce s n)"
   31.28 +| "apm s (Number n) = nb s n"
   31.29 +| "apm s (Key K) = Key (key s K)"
   31.30 +| "apm s (Hash X) = Hash (apm s X)"
   31.31 +| "apm s (Crypt K X) = (
   31.32  if (EX A. K = pubK A) then Crypt (pubK (agent s (agt K))) (apm s X)
   31.33  else if (EX A. K = priK A) then Crypt (priK (agent s (agt K))) (apm s X)
   31.34  else Crypt (key s K) (apm s X))"
   31.35 -"apm s {|X,Y|} = {|apm s X, apm s Y|}"
   31.36 +| "apm s {|X,Y|} = {|apm s X, apm s Y|}"
   31.37  
   31.38  lemma apm_parts: "X:parts {Y} ==> apm s X:parts {apm s Y}"
   31.39  apply (erule parts.induct, simp_all, blast)
   31.40 @@ -69,12 +67,10 @@
   31.41  apply (drule_tac Y="msg x" and s=s in apm_parts, simp)
   31.42  by (blast dest: parts_parts)
   31.43  
   31.44 -consts ap :: "subs => event => event"
   31.45 -
   31.46 -primrec
   31.47 -"ap s (Says A B X) = Says (agent s A) (agent s B) (apm s X)"
   31.48 -"ap s (Gets A X) = Gets (agent s A) (apm s X)"
   31.49 -"ap s (Notes A X) = Notes (agent s A) (apm s X)"
   31.50 +primrec ap :: "subs => event => event" where
   31.51 +  "ap s (Says A B X) = Says (agent s A) (agent s B) (apm s X)"
   31.52 +| "ap s (Gets A X) = Gets (agent s A) (apm s X)"
   31.53 +| "ap s (Notes A X) = Notes (agent s A) (apm s X)"
   31.54  
   31.55  abbreviation
   31.56    ap' :: "subs => rule => event" where
   31.57 @@ -94,7 +90,7 @@
   31.58  
   31.59  subsection{*nonces generated by a rule*}
   31.60  
   31.61 -constdefs newn :: "rule => nat set"
   31.62 +definition newn :: "rule => nat set" where
   31.63  "newn R == {n. Nonce n:parts {msg (snd R)} & Nonce n ~:parts (msg`(fst R))}"
   31.64  
   31.65  lemma newn_parts: "n:newn R ==> Nonce (nonce s n):parts {apm' s R}"
   31.66 @@ -102,7 +98,7 @@
   31.67  
   31.68  subsection{*traces generated by a protocol*}
   31.69  
   31.70 -constdefs ok :: "event list => rule => subs => bool"
   31.71 +definition ok :: "event list => rule => subs => bool" where
   31.72  "ok evs R s == ((ALL x. x:fst R --> ap s x:set evs)
   31.73  & (ALL n. n:newn R --> Nonce (nonce s n) ~:used evs))"
   31.74  
   31.75 @@ -124,7 +120,7 @@
   31.76  apply (unfold one_step_def, clarify)
   31.77  by (ind_cases "ev # evs:tr p" for ev evs, auto)
   31.78  
   31.79 -constdefs has_only_Says' :: "proto => bool"
   31.80 +definition has_only_Says' :: "proto => bool" where
   31.81  "has_only_Says' p == ALL R. R:p --> is_Says (snd R)"
   31.82  
   31.83  lemma has_only_Says'D: "[| R:p; has_only_Says' p |]
   31.84 @@ -165,8 +161,8 @@
   31.85  
   31.86  subsection{*introduction of a fresh guarded nonce*}
   31.87  
   31.88 -constdefs fresh :: "proto => rule => subs => nat => key set => event list
   31.89 -=> bool"
   31.90 +definition fresh :: "proto => rule => subs => nat => key set => event list
   31.91 +=> bool" where
   31.92  "fresh p R s n Ks evs == (EX evs1 evs2. evs = evs2 @ ap' s R # evs1
   31.93  & Nonce n ~:used evs1 & R:p & ok evs1 R s & Nonce n:parts {apm' s R}
   31.94  & apm' s R:guard n Ks)"
   31.95 @@ -226,7 +222,7 @@
   31.96  
   31.97  subsection{*safe keys*}
   31.98  
   31.99 -constdefs safe :: "key set => msg set => bool"
  31.100 +definition safe :: "key set => msg set => bool" where
  31.101  "safe Ks G == ALL K. K:Ks --> Key K ~:analz G"
  31.102  
  31.103  lemma safeD [dest]: "[| safe Ks G; K:Ks |] ==> Key K ~:analz G"
  31.104 @@ -240,7 +236,7 @@
  31.105  
  31.106  subsection{*guardedness preservation*}
  31.107  
  31.108 -constdefs preserv :: "proto => keyfun => nat => key set => bool"
  31.109 +definition preserv :: "proto => keyfun => nat => key set => bool" where
  31.110  "preserv p keys n Ks == (ALL evs R' s' R s. evs:tr p -->
  31.111  Guard n Ks (spies evs) --> safe Ks (spies evs) --> fresh p R' s' n Ks evs -->
  31.112  keys R' s' n evs <= Ks --> R:p --> ok evs R s --> apm' s R:guard n Ks)"
  31.113 @@ -257,7 +253,7 @@
  31.114  
  31.115  subsection{*monotonic keyfun*}
  31.116  
  31.117 -constdefs monoton :: "proto => keyfun => bool"
  31.118 +definition monoton :: "proto => keyfun => bool" where
  31.119  "monoton p keys == ALL R' s' n ev evs. ev # evs:tr p -->
  31.120  keys R' s' n evs <= keys R' s' n (ev # evs)"
  31.121  
  31.122 @@ -323,7 +319,7 @@
  31.123  
  31.124  subsection{*unicity*}
  31.125  
  31.126 -constdefs uniq :: "proto => secfun => bool"
  31.127 +definition uniq :: "proto => secfun => bool" where
  31.128  "uniq p secret == ALL evs R R' n n' Ks s s'. R:p --> R':p -->
  31.129  n:newn R --> n':newn R' --> nonce s n = nonce s' n' -->
  31.130  Nonce (nonce s n):parts {apm' s R} --> Nonce (nonce s n):parts {apm' s' R'} -->
  31.131 @@ -340,13 +336,13 @@
  31.132  secret R n s Ks = secret R' n' s' Ks"
  31.133  by (unfold uniq_def, blast)
  31.134  
  31.135 -constdefs ord :: "proto => (rule => rule => bool) => bool"
  31.136 +definition ord :: "proto => (rule => rule => bool) => bool" where
  31.137  "ord p inff == ALL R R'. R:p --> R':p --> ~ inff R R' --> inff R' R"
  31.138  
  31.139  lemma ordD: "[| ord p inff; ~ inff R R'; R:p; R':p |] ==> inff R' R"
  31.140  by (unfold ord_def, blast)
  31.141  
  31.142 -constdefs uniq' :: "proto => (rule => rule => bool) => secfun => bool"
  31.143 +definition uniq' :: "proto => (rule => rule => bool) => secfun => bool" where
  31.144  "uniq' p inff secret == ALL evs R R' n n' Ks s s'. R:p --> R':p -->
  31.145  inff R R' --> n:newn R --> n':newn R' --> nonce s n = nonce s' n' -->
  31.146  Nonce (nonce s n):parts {apm' s R} --> Nonce (nonce s n):parts {apm' s' R'} -->
  31.147 @@ -372,13 +368,12 @@
  31.148  
  31.149  subsection{*Needham-Schroeder-Lowe*}
  31.150  
  31.151 -constdefs
  31.152 -a :: agent "a == Friend 0"
  31.153 -b :: agent "b == Friend 1"
  31.154 -a' :: agent "a' == Friend 2"
  31.155 -b' :: agent "b' == Friend 3"
  31.156 -Na :: nat "Na == 0"
  31.157 -Nb :: nat "Nb == 1"
  31.158 +definition a :: agent where "a == Friend 0"
  31.159 +definition b :: agent where "b == Friend 1"
  31.160 +definition a' :: agent where "a' == Friend 2"
  31.161 +definition b' :: agent where "b' == Friend 3"
  31.162 +definition Na :: nat where "Na == 0"
  31.163 +definition Nb :: nat where "Nb == 1"
  31.164  
  31.165  abbreviation
  31.166    ns1 :: rule where
  31.167 @@ -408,19 +403,19 @@
  31.168    ns3b :: event where
  31.169    "ns3b == Says b' a (Crypt (pubK a) {|Nonce Na, Nonce Nb, Agent b|})"
  31.170  
  31.171 -constdefs keys :: "keyfun"
  31.172 +definition keys :: "keyfun" where
  31.173  "keys R' s' n evs == {priK' s' a, priK' s' b}"
  31.174  
  31.175  lemma "monoton ns keys"
  31.176  by (simp add: keys_def monoton_def)
  31.177  
  31.178 -constdefs secret :: "secfun"
  31.179 +definition secret :: "secfun" where
  31.180  "secret R n s Ks ==
  31.181  (if R=ns1 then apm s (Crypt (pubK b) {|Nonce Na, Agent a|})
  31.182  else if R=ns2 then apm s (Crypt (pubK a) {|Nonce Na, Nonce Nb, Agent b|})
  31.183  else Number 0)"
  31.184  
  31.185 -constdefs inf :: "rule => rule => bool"
  31.186 +definition inf :: "rule => rule => bool" where
  31.187  "inf R R' == (R=ns1 | (R=ns2 & R'~=ns1) | (R=ns3 & R'=ns3))"
  31.188  
  31.189  lemma inf_is_ord [iff]: "ord ns inf"
    32.1 --- a/src/HOL/Auth/KerberosIV.thy	Wed Feb 24 11:55:52 2010 +0100
    32.2 +++ b/src/HOL/Auth/KerberosIV.thy	Mon Mar 01 13:40:23 2010 +0100
    32.3 @@ -101,8 +101,7 @@
    32.4  
    32.5  
    32.6  (* Predicate formalising the association between authKeys and servKeys *)
    32.7 -constdefs
    32.8 -  AKcryptSK :: "[key, key, event list] => bool"
    32.9 +definition AKcryptSK :: "[key, key, event list] => bool" where
   32.10    "AKcryptSK authK servK evs ==
   32.11       \<exists>A B Ts.
   32.12         Says Tgs A (Crypt authK
    33.1 --- a/src/HOL/Auth/KerberosIV_Gets.thy	Wed Feb 24 11:55:52 2010 +0100
    33.2 +++ b/src/HOL/Auth/KerberosIV_Gets.thy	Mon Mar 01 13:40:23 2010 +0100
    33.3 @@ -89,8 +89,7 @@
    33.4  
    33.5  
    33.6  (* Predicate formalising the association between authKeys and servKeys *)
    33.7 -constdefs
    33.8 -  AKcryptSK :: "[key, key, event list] => bool"
    33.9 +definition AKcryptSK :: "[key, key, event list] => bool" where
   33.10    "AKcryptSK authK servK evs ==
   33.11       \<exists>A B Ts.
   33.12         Says Tgs A (Crypt authK
    34.1 --- a/src/HOL/Auth/KerberosV.thy	Wed Feb 24 11:55:52 2010 +0100
    34.2 +++ b/src/HOL/Auth/KerberosV.thy	Mon Mar 01 13:40:23 2010 +0100
    34.3 @@ -92,8 +92,7 @@
    34.4  
    34.5  
    34.6  (* Predicate formalising the association between authKeys and servKeys *)
    34.7 -constdefs
    34.8 -  AKcryptSK :: "[key, key, event list] => bool"
    34.9 +definition AKcryptSK :: "[key, key, event list] => bool" where
   34.10    "AKcryptSK authK servK evs ==
   34.11       \<exists>A B tt.
   34.12         Says Tgs A \<lbrace>Crypt authK \<lbrace>Key servK, Agent B, tt\<rbrace>,
    35.1 --- a/src/HOL/Auth/Message.thy	Wed Feb 24 11:55:52 2010 +0100
    35.2 +++ b/src/HOL/Auth/Message.thy	Mon Mar 01 13:40:23 2010 +0100
    35.3 @@ -32,8 +32,7 @@
    35.4  text{*The inverse of a symmetric key is itself; that of a public key
    35.5        is the private key and vice versa*}
    35.6  
    35.7 -constdefs
    35.8 -  symKeys :: "key set"
    35.9 +definition symKeys :: "key set" where
   35.10    "symKeys == {K. invKey K = K}"
   35.11  
   35.12  datatype  --{*We allow any number of friendly agents*}
   35.13 @@ -61,12 +60,11 @@
   35.14    "{|x, y|}"      == "CONST MPair x y"
   35.15  
   35.16  
   35.17 -constdefs
   35.18 -  HPair :: "[msg,msg] => msg"                       ("(4Hash[_] /_)" [0, 1000])
   35.19 +definition HPair :: "[msg,msg] => msg" ("(4Hash[_] /_)" [0, 1000]) where
   35.20      --{*Message Y paired with a MAC computed with the help of X*}
   35.21      "Hash[X] Y == {| Hash{|X,Y|}, Y|}"
   35.22  
   35.23 -  keysFor :: "msg set => key set"
   35.24 +definition keysFor :: "msg set => key set" where
   35.25      --{*Keys useful to decrypt elements of a message set*}
   35.26    "keysFor H == invKey ` {K. \<exists>X. Crypt K X \<in> H}"
   35.27  
    36.1 --- a/src/HOL/Auth/Smartcard/ShoupRubin.thy	Wed Feb 24 11:55:52 2010 +0100
    36.2 +++ b/src/HOL/Auth/Smartcard/ShoupRubin.thy	Mon Mar 01 13:40:23 2010 +0100
    36.3 @@ -1,5 +1,4 @@
    36.4 -(*  ID:         $Id$
    36.5 -    Author:     Giampaolo Bella, Catania University
    36.6 +(*  Author:     Giampaolo Bella, Catania University
    36.7  *)
    36.8  
    36.9  header{*Original Shoup-Rubin protocol*}
   36.10 @@ -29,9 +28,7 @@
   36.11      between each agent and his smartcard*)
   36.12     shouprubin_assumes_securemeans [iff]: "evs \<in> sr \<Longrightarrow> secureM"
   36.13  
   36.14 -constdefs
   36.15 -
   36.16 -  Unique :: "[event, event list] => bool" ("Unique _ on _")
   36.17 +definition Unique :: "[event, event list] => bool" ("Unique _ on _") where
   36.18     "Unique ev on evs == 
   36.19        ev \<notin> set (tl (dropWhile (% z. z \<noteq> ev) evs))"
   36.20  
    37.1 --- a/src/HOL/Auth/Smartcard/ShoupRubinBella.thy	Wed Feb 24 11:55:52 2010 +0100
    37.2 +++ b/src/HOL/Auth/Smartcard/ShoupRubinBella.thy	Mon Mar 01 13:40:23 2010 +0100
    37.3 @@ -1,5 +1,4 @@
    37.4 -(*  ID:         $Id$
    37.5 -    Author:     Giampaolo Bella, Catania University
    37.6 +(*  Author:     Giampaolo Bella, Catania University
    37.7  *)
    37.8  
    37.9  header{*Bella's modification of the Shoup-Rubin protocol*}
   37.10 @@ -35,9 +34,7 @@
   37.11      between each agent and his smartcard*)
   37.12     shouprubin_assumes_securemeans [iff]: "evs \<in> srb \<Longrightarrow> secureM"
   37.13  
   37.14 -constdefs
   37.15 -
   37.16 -  Unique :: "[event, event list] => bool" ("Unique _ on _")
   37.17 +definition Unique :: "[event, event list] => bool" ("Unique _ on _") where
   37.18     "Unique ev on evs == 
   37.19        ev \<notin> set (tl (dropWhile (% z. z \<noteq> ev) evs))"
   37.20  
    38.1 --- a/src/HOL/Auth/Smartcard/Smartcard.thy	Wed Feb 24 11:55:52 2010 +0100
    38.2 +++ b/src/HOL/Auth/Smartcard/Smartcard.thy	Mon Mar 01 13:40:23 2010 +0100
    38.3 @@ -43,15 +43,11 @@
    38.4    shrK_disj_pin [iff]:  "shrK P \<noteq> pin Q"
    38.5    crdK_disj_pin [iff]:   "crdK C \<noteq> pin P"
    38.6  
    38.7 -constdefs
    38.8 -  legalUse :: "card => bool" ("legalUse (_)")
    38.9 +definition legalUse :: "card => bool" ("legalUse (_)") where
   38.10    "legalUse C == C \<notin> stolen"
   38.11  
   38.12 -consts  
   38.13 -  illegalUse :: "card  => bool"
   38.14 -primrec
   38.15 -  illegalUse_def: 
   38.16 -  "illegalUse (Card A) = ( (Card A \<in> stolen \<and> A \<in> bad)  \<or>  Card A \<in> cloned )"
   38.17 +primrec illegalUse :: "card  => bool" where
   38.18 +  illegalUse_def: "illegalUse (Card A) = ( (Card A \<in> stolen \<and> A \<in> bad)  \<or>  Card A \<in> cloned )"
   38.19  
   38.20  
   38.21  text{*initState must be defined with care*}
    39.1 --- a/src/HOL/Auth/TLS.thy	Wed Feb 24 11:55:52 2010 +0100
    39.2 +++ b/src/HOL/Auth/TLS.thy	Mon Mar 01 13:40:23 2010 +0100
    39.3 @@ -43,8 +43,7 @@
    39.4  
    39.5  theory TLS imports Public Nat_Int_Bij begin
    39.6  
    39.7 -constdefs
    39.8 -  certificate      :: "[agent,key] => msg"
    39.9 +definition certificate :: "[agent,key] => msg" where
   39.10      "certificate A KA == Crypt (priSK Server) {|Agent A, Key KA|}"
   39.11  
   39.12  text{*TLS apparently does not require separate keypairs for encryption and
    40.1 --- a/src/HOL/Auth/Yahalom.thy	Wed Feb 24 11:55:52 2010 +0100
    40.2 +++ b/src/HOL/Auth/Yahalom.thy	Mon Mar 01 13:40:23 2010 +0100
    40.3 @@ -74,8 +74,7 @@
    40.4            ==> Notes Spy {|Nonce NA, Nonce NB, Key K|} # evso \<in> yahalom"
    40.5  
    40.6  
    40.7 -constdefs 
    40.8 -  KeyWithNonce :: "[key, nat, event list] => bool"
    40.9 +definition KeyWithNonce :: "[key, nat, event list] => bool" where
   40.10    "KeyWithNonce K NB evs ==
   40.11       \<exists>A B na X. 
   40.12         Says Server A {|Crypt (shrK A) {|Agent B, Key K, na, Nonce NB|}, X|} 
    41.1 --- a/src/HOL/Auth/ZhouGollmann.thy	Wed Feb 24 11:55:52 2010 +0100
    41.2 +++ b/src/HOL/Auth/ZhouGollmann.thy	Mon Mar 01 13:40:23 2010 +0100
    41.3 @@ -21,8 +21,7 @@
    41.4  abbreviation f_con :: nat where "f_con == 4"
    41.5  
    41.6  
    41.7 -constdefs
    41.8 -  broken :: "agent set"    
    41.9 +definition broken :: "agent set" where    
   41.10      --{*the compromised honest agents; TTP is included as it's not allowed to
   41.11          use the protocol*}
   41.12     "broken == bad - {Spy}"
    42.1 --- a/src/HOL/Bali/AxCompl.thy	Wed Feb 24 11:55:52 2010 +0100
    42.2 +++ b/src/HOL/Bali/AxCompl.thy	Mon Mar 01 13:40:23 2010 +0100
    42.3 @@ -20,9 +20,7 @@
    42.4             
    42.5  section "set of not yet initialzed classes"
    42.6  
    42.7 -constdefs
    42.8 -
    42.9 -  nyinitcls :: "prog \<Rightarrow> state \<Rightarrow> qtname set"
   42.10 +definition nyinitcls :: "prog \<Rightarrow> state \<Rightarrow> qtname set" where
   42.11   "nyinitcls G s \<equiv> {C. is_class G C \<and> \<not> initd C s}"
   42.12  
   42.13  lemma nyinitcls_subset_class: "nyinitcls G s \<subseteq> {C. is_class G C}"
   42.14 @@ -115,8 +113,7 @@
   42.15  
   42.16  section "init-le"
   42.17  
   42.18 -constdefs
   42.19 -  init_le :: "prog \<Rightarrow> nat \<Rightarrow> state \<Rightarrow> bool"            ("_\<turnstile>init\<le>_"  [51,51] 50)
   42.20 +definition init_le :: "prog \<Rightarrow> nat \<Rightarrow> state \<Rightarrow> bool" ("_\<turnstile>init\<le>_"  [51,51] 50) where
   42.21   "G\<turnstile>init\<le>n \<equiv> \<lambda>s. card (nyinitcls G s) \<le> n"
   42.22    
   42.23  lemma init_le_def2 [simp]: "(G\<turnstile>init\<le>n) s = (card (nyinitcls G s)\<le>n)"
   42.24 @@ -135,9 +132,7 @@
   42.25  
   42.26  section "Most General Triples and Formulas"
   42.27  
   42.28 -constdefs
   42.29 -
   42.30 -  remember_init_state :: "state assn"                ("\<doteq>")
   42.31 +definition remember_init_state :: "state assn" ("\<doteq>") where
   42.32    "\<doteq> \<equiv> \<lambda>Y s Z. s = Z"
   42.33  
   42.34  lemma remember_init_state_def2 [simp]: "\<doteq> Y = op ="
   42.35 @@ -579,8 +574,7 @@
   42.36  unroll the loop in iterated evaluations of the expression and evaluations of
   42.37  the loop body. *}
   42.38  
   42.39 -constdefs
   42.40 - unroll:: "prog \<Rightarrow> label \<Rightarrow> expr \<Rightarrow> stmt \<Rightarrow> (state \<times>  state) set"
   42.41 +definition unroll :: "prog \<Rightarrow> label \<Rightarrow> expr \<Rightarrow> stmt \<Rightarrow> (state \<times>  state) set" where
   42.42  
   42.43   "unroll G l e c \<equiv> {(s,t). \<exists> v s1 s2.
   42.44                               G\<turnstile>s \<midarrow>e-\<succ>v\<rightarrow> s1 \<and> the_Bool v \<and> normal s1 \<and>
    43.1 --- a/src/HOL/Bali/AxExample.thy	Wed Feb 24 11:55:52 2010 +0100
    43.2 +++ b/src/HOL/Bali/AxExample.thy	Mon Mar 01 13:40:23 2010 +0100
    43.3 @@ -8,8 +8,7 @@
    43.4  imports AxSem Example
    43.5  begin
    43.6  
    43.7 -constdefs
    43.8 -  arr_inv :: "st \<Rightarrow> bool"
    43.9 +definition arr_inv :: "st \<Rightarrow> bool" where
   43.10   "arr_inv \<equiv> \<lambda>s. \<exists>obj a T el. globs s (Stat Base) = Some obj \<and>
   43.11                                values obj (Inl (arr, Base)) = Some (Addr a) \<and>
   43.12                                heap s a = Some \<lparr>tag=Arr T 2,values=el\<rparr>"
    44.1 --- a/src/HOL/Bali/AxSem.thy	Wed Feb 24 11:55:52 2010 +0100
    44.2 +++ b/src/HOL/Bali/AxSem.thy	Mon Mar 01 13:40:23 2010 +0100
    44.3 @@ -63,8 +63,7 @@
    44.4        "res"    <= (type) "AxSem.res"
    44.5        "a assn" <= (type) "vals \<Rightarrow> state \<Rightarrow> a \<Rightarrow> bool"
    44.6  
    44.7 -constdefs
    44.8 -  assn_imp   :: "'a assn \<Rightarrow> 'a assn \<Rightarrow> bool"             (infixr "\<Rightarrow>" 25)
    44.9 +definition assn_imp :: "'a assn \<Rightarrow> 'a assn \<Rightarrow> bool" (infixr "\<Rightarrow>" 25) where
   44.10   "P \<Rightarrow> Q \<equiv> \<forall>Y s Z. P Y s Z \<longrightarrow> Q Y s Z"
   44.11    
   44.12  lemma assn_imp_def2 [iff]: "(P \<Rightarrow> Q) = (\<forall>Y s Z. P Y s Z \<longrightarrow> Q Y s Z)"
   44.13 @@ -77,8 +76,7 @@
   44.14  
   44.15  subsection "peek-and"
   44.16  
   44.17 -constdefs
   44.18 -  peek_and   :: "'a assn \<Rightarrow> (state \<Rightarrow>  bool) \<Rightarrow> 'a assn" (infixl "\<and>." 13)
   44.19 +definition peek_and :: "'a assn \<Rightarrow> (state \<Rightarrow>  bool) \<Rightarrow> 'a assn" (infixl "\<and>." 13) where
   44.20   "P \<and>. p \<equiv> \<lambda>Y s Z. P Y s Z \<and> p s"
   44.21  
   44.22  lemma peek_and_def2 [simp]: "peek_and P p Y s = (\<lambda>Z. (P Y s Z \<and> p s))"
   44.23 @@ -117,8 +115,7 @@
   44.24  
   44.25  subsection "assn-supd"
   44.26  
   44.27 -constdefs
   44.28 -  assn_supd  :: "'a assn \<Rightarrow> (state \<Rightarrow> state) \<Rightarrow> 'a assn" (infixl ";." 13)
   44.29 +definition assn_supd :: "'a assn \<Rightarrow> (state \<Rightarrow> state) \<Rightarrow> 'a assn" (infixl ";." 13) where
   44.30   "P ;. f \<equiv> \<lambda>Y s' Z. \<exists>s. P Y s Z \<and> s' = f s"
   44.31  
   44.32  lemma assn_supd_def2 [simp]: "assn_supd P f Y s' Z = (\<exists>s. P Y s Z \<and> s' = f s)"
   44.33 @@ -128,8 +125,7 @@
   44.34  
   44.35  subsection "supd-assn"
   44.36  
   44.37 -constdefs
   44.38 -  supd_assn  :: "(state \<Rightarrow> state) \<Rightarrow> 'a assn \<Rightarrow> 'a assn" (infixr ".;" 13)
   44.39 +definition supd_assn :: "(state \<Rightarrow> state) \<Rightarrow> 'a assn \<Rightarrow> 'a assn" (infixr ".;" 13) where
   44.40   "f .; P \<equiv> \<lambda>Y s. P Y (f s)"
   44.41  
   44.42  
   44.43 @@ -148,8 +144,7 @@
   44.44  
   44.45  subsection "subst-res"
   44.46  
   44.47 -constdefs
   44.48 -  subst_res   :: "'a assn \<Rightarrow> res \<Rightarrow> 'a assn"              ("_\<leftarrow>_"  [60,61] 60)
   44.49 +definition subst_res :: "'a assn \<Rightarrow> res \<Rightarrow> 'a assn" ("_\<leftarrow>_"  [60,61] 60) where
   44.50   "P\<leftarrow>w \<equiv> \<lambda>Y. P w"
   44.51  
   44.52  lemma subst_res_def2 [simp]: "(P\<leftarrow>w) Y = P w"
   44.53 @@ -184,8 +179,7 @@
   44.54  
   44.55  subsection "subst-Bool"
   44.56  
   44.57 -constdefs
   44.58 -  subst_Bool  :: "'a assn \<Rightarrow> bool \<Rightarrow> 'a assn"             ("_\<leftarrow>=_" [60,61] 60)
   44.59 +definition subst_Bool :: "'a assn \<Rightarrow> bool \<Rightarrow> 'a assn" ("_\<leftarrow>=_" [60,61] 60) where
   44.60   "P\<leftarrow>=b \<equiv> \<lambda>Y s Z. \<exists>v. P (Val v) s Z \<and> (normal s \<longrightarrow> the_Bool v=b)"
   44.61  
   44.62  lemma subst_Bool_def2 [simp]: 
   44.63 @@ -200,8 +194,7 @@
   44.64  
   44.65  subsection "peek-res"
   44.66  
   44.67 -constdefs
   44.68 -  peek_res    :: "(res \<Rightarrow> 'a assn) \<Rightarrow> 'a assn"
   44.69 +definition peek_res :: "(res \<Rightarrow> 'a assn) \<Rightarrow> 'a assn" where
   44.70   "peek_res Pf \<equiv> \<lambda>Y. Pf Y Y"
   44.71  
   44.72  syntax
   44.73 @@ -229,8 +222,7 @@
   44.74  
   44.75  subsection "ign-res"
   44.76  
   44.77 -constdefs
   44.78 -  ign_res    ::  "        'a assn \<Rightarrow> 'a assn"            ("_\<down>" [1000] 1000)
   44.79 +definition ign_res :: "        'a assn \<Rightarrow> 'a assn" ("_\<down>" [1000] 1000) where
   44.80    "P\<down>        \<equiv> \<lambda>Y s Z. \<exists>Y. P Y s Z"
   44.81  
   44.82  lemma ign_res_def2 [simp]: "P\<down> Y s Z = (\<exists>Y. P Y s Z)"
   44.83 @@ -261,8 +253,7 @@
   44.84  
   44.85  subsection "peek-st"
   44.86  
   44.87 -constdefs
   44.88 -  peek_st    :: "(st \<Rightarrow> 'a assn) \<Rightarrow> 'a assn"
   44.89 +definition peek_st :: "(st \<Rightarrow> 'a assn) \<Rightarrow> 'a assn" where
   44.90   "peek_st P \<equiv> \<lambda>Y s. P (store s) Y s"
   44.91  
   44.92  syntax
   44.93 @@ -306,8 +297,7 @@
   44.94  
   44.95  subsection "ign-res-eq"
   44.96  
   44.97 -constdefs
   44.98 -  ign_res_eq :: "'a assn \<Rightarrow> res \<Rightarrow> 'a assn"               ("_\<down>=_"  [60,61] 60)
   44.99 +definition ign_res_eq :: "'a assn \<Rightarrow> res \<Rightarrow> 'a assn" ("_\<down>=_"  [60,61] 60) where
  44.100   "P\<down>=w       \<equiv> \<lambda>Y:. P\<down> \<and>. (\<lambda>s. Y=w)"
  44.101  
  44.102  lemma ign_res_eq_def2 [simp]: "(P\<down>=w) Y s Z = ((\<exists>Y. P Y s Z) \<and> Y=w)"
  44.103 @@ -337,8 +327,7 @@
  44.104  
  44.105  subsection "RefVar"
  44.106  
  44.107 -constdefs
  44.108 -  RefVar    :: "(state \<Rightarrow> vvar \<times> state) \<Rightarrow> 'a assn \<Rightarrow> 'a assn"(infixr "..;" 13)
  44.109 +definition RefVar :: "(state \<Rightarrow> vvar \<times> state) \<Rightarrow> 'a assn \<Rightarrow> 'a assn" (infixr "..;" 13) where
  44.110   "vf ..; P \<equiv> \<lambda>Y s. let (v,s') = vf s in P (Var v) s'"
  44.111   
  44.112  lemma RefVar_def2 [simp]: "(vf ..; P) Y s =  
  44.113 @@ -349,12 +338,11 @@
  44.114  
  44.115  subsection "allocation"
  44.116  
  44.117 -constdefs
  44.118 -  Alloc      :: "prog \<Rightarrow> obj_tag \<Rightarrow> 'a assn \<Rightarrow> 'a assn"
  44.119 +definition Alloc :: "prog \<Rightarrow> obj_tag \<Rightarrow> 'a assn \<Rightarrow> 'a assn" where
  44.120   "Alloc G otag P \<equiv> \<lambda>Y s Z.
  44.121                     \<forall>s' a. G\<turnstile>s \<midarrow>halloc otag\<succ>a\<rightarrow> s'\<longrightarrow> P (Val (Addr a)) s' Z"
  44.122  
  44.123 -  SXAlloc     :: "prog \<Rightarrow> 'a assn \<Rightarrow> 'a assn"
  44.124 +definition SXAlloc     :: "prog \<Rightarrow> 'a assn \<Rightarrow> 'a assn" where
  44.125   "SXAlloc G P \<equiv> \<lambda>Y s Z. \<forall>s'. G\<turnstile>s \<midarrow>sxalloc\<rightarrow> s' \<longrightarrow> P Y s' Z"
  44.126  
  44.127  
  44.128 @@ -372,8 +360,7 @@
  44.129  
  44.130  section "validity"
  44.131  
  44.132 -constdefs
  44.133 -  type_ok  :: "prog \<Rightarrow> term \<Rightarrow> state \<Rightarrow> bool"
  44.134 +definition type_ok :: "prog \<Rightarrow> term \<Rightarrow> state \<Rightarrow> bool" where
  44.135   "type_ok G t s \<equiv> 
  44.136      \<exists>L T C A. (normal s \<longrightarrow> \<lparr>prg=G,cls=C,lcl=L\<rparr>\<turnstile>t\<Colon>T \<and> 
  44.137                              \<lparr>prg=G,cls=C,lcl=L\<rparr>\<turnstile>dom (locals (store s))\<guillemotright>t\<guillemotright>A )
  44.138 @@ -419,10 +406,8 @@
  44.139  apply auto
  44.140  done
  44.141  
  44.142 -constdefs
  44.143 -  mtriples  :: "('c \<Rightarrow> 'sig \<Rightarrow> 'a assn) \<Rightarrow> ('c \<Rightarrow> 'sig \<Rightarrow> expr) \<Rightarrow> 
  44.144 -                ('c \<Rightarrow> 'sig \<Rightarrow> 'a assn) \<Rightarrow> ('c \<times>  'sig) set \<Rightarrow> 'a triples"
  44.145 -                                     ("{{(1_)}/ _-\<succ>/ {(1_)} | _}"[3,65,3,65]75)
  44.146 +definition mtriples :: "('c \<Rightarrow> 'sig \<Rightarrow> 'a assn) \<Rightarrow> ('c \<Rightarrow> 'sig \<Rightarrow> expr) \<Rightarrow> 
  44.147 +                ('c \<Rightarrow> 'sig \<Rightarrow> 'a assn) \<Rightarrow> ('c \<times>  'sig) set \<Rightarrow> 'a triples" ("{{(1_)}/ _-\<succ>/ {(1_)} | _}"[3,65,3,65]75) where
  44.148   "{{P} tf-\<succ> {Q} | ms} \<equiv> (\<lambda>(C,sig). {Normal(P C sig)} tf C sig-\<succ> {Q C sig})`ms"
  44.149    
  44.150  consts
  44.151 @@ -641,8 +626,7 @@
  44.152  axioms 
  44.153  *)
  44.154  
  44.155 -constdefs
  44.156 - adapt_pre :: "'a assn \<Rightarrow> 'a assn \<Rightarrow> 'a assn \<Rightarrow> 'a assn"
  44.157 +definition adapt_pre :: "'a assn \<Rightarrow> 'a assn \<Rightarrow> 'a assn \<Rightarrow> 'a assn" where
  44.158  "adapt_pre P Q Q'\<equiv>\<lambda>Y s Z. \<forall>Y' s'. \<exists>Z'. P Y s Z' \<and> (Q Y' s' Z' \<longrightarrow> Q' Y' s' Z)"
  44.159  
  44.160  
    45.1 --- a/src/HOL/Bali/Basis.thy	Wed Feb 24 11:55:52 2010 +0100
    45.2 +++ b/src/HOL/Bali/Basis.thy	Mon Mar 01 13:40:23 2010 +0100
    45.3 @@ -237,8 +237,7 @@
    45.4  
    45.5  text{* Deemed too special for theory Map. *}
    45.6  
    45.7 -constdefs
    45.8 -  chg_map :: "('b => 'b) => 'a => ('a ~=> 'b) => ('a ~=> 'b)"
    45.9 +definition chg_map :: "('b => 'b) => 'a => ('a ~=> 'b) => ('a ~=> 'b)" where
   45.10   "chg_map f a m == case m a of None => m | Some b => m(a|->f b)"
   45.11  
   45.12  lemma chg_map_new[simp]: "m a = None   ==> chg_map f a m = m"
   45.13 @@ -253,8 +252,7 @@
   45.14  
   45.15  section "unique association lists"
   45.16  
   45.17 -constdefs
   45.18 -  unique   :: "('a \<times> 'b) list \<Rightarrow> bool"
   45.19 +definition unique :: "('a \<times> 'b) list \<Rightarrow> bool" where
   45.20   "unique \<equiv> distinct \<circ> map fst"
   45.21  
   45.22  lemma uniqueD [rule_format (no_asm)]: 
    46.1 --- a/src/HOL/Bali/Conform.thy	Wed Feb 24 11:55:52 2010 +0100
    46.2 +++ b/src/HOL/Bali/Conform.thy	Mon Mar 01 13:40:23 2010 +0100
    46.3 @@ -22,9 +22,7 @@
    46.4  section "extension of global store"
    46.5  
    46.6  
    46.7 -constdefs
    46.8 -
    46.9 -  gext    :: "st \<Rightarrow> st \<Rightarrow> bool"                ("_\<le>|_"       [71,71]   70)
   46.10 +definition gext :: "st \<Rightarrow> st \<Rightarrow> bool" ("_\<le>|_"       [71,71]   70) where
   46.11     "s\<le>|s' \<equiv> \<forall>r. \<forall>obj\<in>globs s r: \<exists>obj'\<in>globs s' r: tag obj'= tag obj"
   46.12  
   46.13  text {* For the the proof of type soundness we will need the 
   46.14 @@ -98,9 +96,7 @@
   46.15  
   46.16  section "value conformance"
   46.17  
   46.18 -constdefs
   46.19 -
   46.20 -  conf  :: "prog \<Rightarrow> st \<Rightarrow> val \<Rightarrow> ty \<Rightarrow> bool"    ("_,_\<turnstile>_\<Colon>\<preceq>_"   [71,71,71,71] 70)
   46.21 +definition conf :: "prog \<Rightarrow> st \<Rightarrow> val \<Rightarrow> ty \<Rightarrow> bool" ("_,_\<turnstile>_\<Colon>\<preceq>_"   [71,71,71,71] 70) where
   46.22             "G,s\<turnstile>v\<Colon>\<preceq>T \<equiv> \<exists>T'\<in>typeof (\<lambda>a. Option.map obj_ty (heap s a)) v:G\<turnstile>T'\<preceq>T"
   46.23  
   46.24  lemma conf_cong [simp]: "G,set_locals l s\<turnstile>v\<Colon>\<preceq>T = G,s\<turnstile>v\<Colon>\<preceq>T"
   46.25 @@ -181,10 +177,7 @@
   46.26  
   46.27  section "value list conformance"
   46.28  
   46.29 -constdefs
   46.30 -
   46.31 -  lconf :: "prog \<Rightarrow> st \<Rightarrow> ('a, val) table \<Rightarrow> ('a, ty) table \<Rightarrow> bool"
   46.32 -                                                ("_,_\<turnstile>_[\<Colon>\<preceq>]_" [71,71,71,71] 70)
   46.33 +definition lconf :: "prog \<Rightarrow> st \<Rightarrow> ('a, val) table \<Rightarrow> ('a, ty) table \<Rightarrow> bool" ("_,_\<turnstile>_[\<Colon>\<preceq>]_" [71,71,71,71] 70) where
   46.34             "G,s\<turnstile>vs[\<Colon>\<preceq>]Ts \<equiv> \<forall>n. \<forall>T\<in>Ts n: \<exists>v\<in>vs n: G,s\<turnstile>v\<Colon>\<preceq>T"
   46.35  
   46.36  lemma lconfD: "\<lbrakk>G,s\<turnstile>vs[\<Colon>\<preceq>]Ts; Ts n = Some T\<rbrakk> \<Longrightarrow> G,s\<turnstile>(the (vs n))\<Colon>\<preceq>T"
   46.37 @@ -267,10 +260,7 @@
   46.38  *}
   46.39  
   46.40    
   46.41 -constdefs
   46.42 -
   46.43 -  wlconf :: "prog \<Rightarrow> st \<Rightarrow> ('a, val) table \<Rightarrow> ('a, ty) table \<Rightarrow> bool"
   46.44 -                                          ("_,_\<turnstile>_[\<sim>\<Colon>\<preceq>]_" [71,71,71,71] 70)
   46.45 +definition wlconf :: "prog \<Rightarrow> st \<Rightarrow> ('a, val) table \<Rightarrow> ('a, ty) table \<Rightarrow> bool" ("_,_\<turnstile>_[\<sim>\<Colon>\<preceq>]_" [71,71,71,71] 70) where
   46.46             "G,s\<turnstile>vs[\<sim>\<Colon>\<preceq>]Ts \<equiv> \<forall>n. \<forall>T\<in>Ts n: \<forall> v\<in>vs n: G,s\<turnstile>v\<Colon>\<preceq>T"
   46.47  
   46.48  lemma wlconfD: "\<lbrakk>G,s\<turnstile>vs[\<sim>\<Colon>\<preceq>]Ts; Ts n = Some T; vs n = Some v\<rbrakk> \<Longrightarrow> G,s\<turnstile>v\<Colon>\<preceq>T"
   46.49 @@ -348,9 +338,7 @@
   46.50  
   46.51  section "object conformance"
   46.52  
   46.53 -constdefs
   46.54 -
   46.55 -  oconf :: "prog \<Rightarrow> st \<Rightarrow> obj \<Rightarrow> oref \<Rightarrow> bool"  ("_,_\<turnstile>_\<Colon>\<preceq>\<surd>_"  [71,71,71,71] 70)
   46.56 +definition oconf :: "prog \<Rightarrow> st \<Rightarrow> obj \<Rightarrow> oref \<Rightarrow> bool" ("_,_\<turnstile>_\<Colon>\<preceq>\<surd>_"  [71,71,71,71] 70) where
   46.57             "G,s\<turnstile>obj\<Colon>\<preceq>\<surd>r \<equiv> G,s\<turnstile>values obj[\<Colon>\<preceq>]var_tys G (tag obj) r \<and> 
   46.58                             (case r of 
   46.59                                Heap a \<Rightarrow> is_type G (obj_ty obj) 
   46.60 @@ -385,9 +373,7 @@
   46.61  
   46.62  section "state conformance"
   46.63  
   46.64 -constdefs
   46.65 -
   46.66 -  conforms :: "state \<Rightarrow> env' \<Rightarrow> bool"          (     "_\<Colon>\<preceq>_"   [71,71]      70)
   46.67 +definition conforms :: "state \<Rightarrow> env' \<Rightarrow> bool"   ("_\<Colon>\<preceq>_"   [71,71]      70)  where
   46.68     "xs\<Colon>\<preceq>E \<equiv> let (G, L) = E; s = snd xs; l = locals s in
   46.69      (\<forall>r. \<forall>obj\<in>globs s r:           G,s\<turnstile>obj   \<Colon>\<preceq>\<surd>r) \<and>
   46.70                  \<spacespace>                   G,s\<turnstile>l    [\<sim>\<Colon>\<preceq>]L\<spacespace> \<and>
    47.1 --- a/src/HOL/Bali/Decl.thy	Wed Feb 24 11:55:52 2010 +0100
    47.2 +++ b/src/HOL/Bali/Decl.thy	Mon Mar 01 13:40:23 2010 +0100
    47.3 @@ -206,8 +206,7 @@
    47.4    "mdecl" <= (type) "sig \<times> methd"
    47.5  
    47.6  
    47.7 -constdefs 
    47.8 -  mhead::"methd \<Rightarrow> mhead"
    47.9 +definition mhead :: "methd \<Rightarrow> mhead" where
   47.10    "mhead m \<equiv> \<lparr>access=access m, static=static m, pars=pars m, resT=resT m\<rparr>"
   47.11  
   47.12  lemma access_mhead [simp]:"access (mhead m) = access m"
   47.13 @@ -275,7 +274,7 @@
   47.14  lemma memberid_pair_simp1: "memberid p  = memberid (snd p)"
   47.15  by (simp add: pair_memberid_def)
   47.16  
   47.17 -constdefs is_field :: "qtname \<times> memberdecl \<Rightarrow> bool"
   47.18 +definition is_field :: "qtname \<times> memberdecl \<Rightarrow> bool" where
   47.19  "is_field m \<equiv> \<exists> declC f. m=(declC,fdecl f)"
   47.20    
   47.21  lemma is_fieldD: "is_field m \<Longrightarrow> \<exists> declC f. m=(declC,fdecl f)"
   47.22 @@ -284,7 +283,7 @@
   47.23  lemma is_fieldI: "is_field (C,fdecl f)"
   47.24  by (simp add: is_field_def)
   47.25  
   47.26 -constdefs is_method :: "qtname \<times> memberdecl \<Rightarrow> bool"
   47.27 +definition is_method :: "qtname \<times> memberdecl \<Rightarrow> bool" where
   47.28  "is_method membr \<equiv> \<exists> declC m. membr=(declC,mdecl m)"
   47.29    
   47.30  lemma is_methodD: "is_method membr \<Longrightarrow> \<exists> declC m. membr=(declC,mdecl m)"
   47.31 @@ -315,8 +314,7 @@
   47.32                        isuperIfs::qtname list,\<dots>::'a\<rparr>"
   47.33    "idecl" <= (type) "qtname \<times> iface"
   47.34  
   47.35 -constdefs
   47.36 -  ibody :: "iface \<Rightarrow> ibody"
   47.37 +definition ibody :: "iface \<Rightarrow> ibody" where
   47.38    "ibody i \<equiv> \<lparr>access=access i,imethods=imethods i\<rparr>"
   47.39  
   47.40  lemma access_ibody [simp]: "(access (ibody i)) = access i"
   47.41 @@ -351,8 +349,7 @@
   47.42                        super::qtname,superIfs::qtname list,\<dots>::'a\<rparr>"
   47.43    "cdecl" <= (type) "qtname \<times> class"
   47.44  
   47.45 -constdefs
   47.46 -  cbody :: "class \<Rightarrow> cbody"
   47.47 +definition cbody :: "class \<Rightarrow> cbody" where
   47.48    "cbody c \<equiv> \<lparr>access=access c, cfields=cfields c,methods=methods c,init=init c\<rparr>"
   47.49  
   47.50  lemma access_cbody [simp]:"access (cbody c) = access c"
   47.51 @@ -394,7 +391,7 @@
   47.52  lemma SXcptC_inject [simp]: "(SXcptC xn = SXcptC xm) = (xn = xm)"
   47.53  by (simp add: SXcptC_def)
   47.54  
   47.55 -constdefs standard_classes :: "cdecl list"
   47.56 +definition standard_classes :: "cdecl list" where
   47.57           "standard_classes \<equiv> [ObjectC, SXcptC Throwable,
   47.58                  SXcptC NullPointer, SXcptC OutOfMemory, SXcptC ClassCast,
   47.59                  SXcptC NegArrSize , SXcptC IndOutBound, SXcptC ArrStore]"
   47.60 @@ -470,7 +467,7 @@
   47.61    where "G|-C <:C D == (C,D) \<in>(subcls1 G)^+"
   47.62  
   47.63  notation (xsymbols)
   47.64 -  subcls1_syntax  ("_\<turnstile>_\<prec>\<^sub>C\<^sub>1_"  [71,71,71] 70) and
   47.65 +  subcls1_syntax  ("_\<turnstile>_\<prec>\<^sub>C1_"  [71,71,71] 70) and
   47.66    subclseq_syntax  ("_\<turnstile>_\<preceq>\<^sub>C _"  [71,71,71] 70) and
   47.67    subcls_syntax  ("_\<turnstile>_\<prec>\<^sub>C _"  [71,71,71] 70)
   47.68  
   47.69 @@ -510,7 +507,7 @@
   47.70  "\<lbrakk>G\<turnstile>C \<prec>\<^sub>C D\<rbrakk> \<Longrightarrow> \<exists> c. class G C = Some c"
   47.71  by (auto simp add: subcls1_def dest: tranclD)
   47.72  
   47.73 -lemma no_subcls1_Object:"G\<turnstile>Object\<prec>\<^sub>C\<^sub>1 D \<Longrightarrow> P"
   47.74 +lemma no_subcls1_Object:"G\<turnstile>Object\<prec>\<^sub>C1 D \<Longrightarrow> P"
   47.75  by (auto simp add: subcls1_def)
   47.76  
   47.77  lemma no_subcls_Object: "G\<turnstile>Object\<prec>\<^sub>C D \<Longrightarrow> P"
   47.78 @@ -520,14 +517,13 @@
   47.79  
   47.80  section "well-structured programs"
   47.81  
   47.82 -constdefs
   47.83 -  ws_idecl :: "prog \<Rightarrow> qtname \<Rightarrow> qtname list \<Rightarrow> bool"
   47.84 +definition ws_idecl :: "prog \<Rightarrow> qtname \<Rightarrow> qtname list \<Rightarrow> bool" where
   47.85   "ws_idecl G I si \<equiv> \<forall>J\<in>set si.  is_iface G J   \<and> (J,I)\<notin>(subint1 G)^+"
   47.86    
   47.87 -  ws_cdecl :: "prog \<Rightarrow> qtname \<Rightarrow> qtname \<Rightarrow> bool"
   47.88 +definition ws_cdecl :: "prog \<Rightarrow> qtname \<Rightarrow> qtname \<Rightarrow> bool" where
   47.89   "ws_cdecl G C sc \<equiv> C\<noteq>Object \<longrightarrow> is_class G sc \<and> (sc,C)\<notin>(subcls1 G)^+"
   47.90    
   47.91 -  ws_prog  :: "prog \<Rightarrow> bool"
   47.92 +definition ws_prog  :: "prog \<Rightarrow> bool" where
   47.93   "ws_prog G \<equiv> (\<forall>(I,i)\<in>set (ifaces  G). ws_idecl G I (isuperIfs i)) \<and> 
   47.94                (\<forall>(C,c)\<in>set (classes G). ws_cdecl G C (super c))"
   47.95  
   47.96 @@ -680,7 +676,7 @@
   47.97    then have "is_class G C \<Longrightarrow> P C"  
   47.98    proof (induct rule: subcls1_induct)
   47.99      fix C
  47.100 -    assume   hyp:"\<forall> S. G\<turnstile>C \<prec>\<^sub>C\<^sub>1 S \<longrightarrow> is_class G S \<longrightarrow> P S"
  47.101 +    assume   hyp:"\<forall> S. G\<turnstile>C \<prec>\<^sub>C1 S \<longrightarrow> is_class G S \<longrightarrow> P S"
  47.102         and iscls:"is_class G C"
  47.103      show "P C"
  47.104      proof (cases "C=Object")
  47.105 @@ -715,7 +711,7 @@
  47.106    then have "\<And> c. class G C = Some c\<Longrightarrow> P C c"  
  47.107    proof (induct rule: subcls1_induct)
  47.108      fix C c
  47.109 -    assume   hyp:"\<forall> S. G\<turnstile>C \<prec>\<^sub>C\<^sub>1 S \<longrightarrow> (\<forall> s. class G S = Some s \<longrightarrow> P S s)"
  47.110 +    assume   hyp:"\<forall> S. G\<turnstile>C \<prec>\<^sub>C1 S \<longrightarrow> (\<forall> s. class G S = Some s \<longrightarrow> P S s)"
  47.111         and iscls:"class G C = Some c"
  47.112      show "P C c"
  47.113      proof (cases "C=Object")
  47.114 @@ -725,7 +721,7 @@
  47.115        with ws iscls obtain sc where
  47.116          sc: "class G (super c) = Some sc"
  47.117          by (auto dest: ws_prog_cdeclD)
  47.118 -      from iscls False have "G\<turnstile>C \<prec>\<^sub>C\<^sub>1 (super c)" by (rule subcls1I)
  47.119 +      from iscls False have "G\<turnstile>C \<prec>\<^sub>C1 (super c)" by (rule subcls1I)
  47.120        with False ws step hyp iscls sc
  47.121        show "P C c" 
  47.122          by (auto)  
  47.123 @@ -808,8 +804,7 @@
  47.124  apply simp
  47.125  done
  47.126  
  47.127 -constdefs
  47.128 -imethds:: "prog \<Rightarrow> qtname \<Rightarrow> (sig,qtname \<times> mhead) tables"
  47.129 +definition imethds :: "prog \<Rightarrow> qtname \<Rightarrow> (sig,qtname \<times> mhead) tables" where
  47.130    --{* methods of an interface, with overriding and inheritance, cf. 9.2 *}
  47.131  "imethds G I 
  47.132    \<equiv> iface_rec (G,I)  
    48.1 --- a/src/HOL/Bali/DeclConcepts.thy	Wed Feb 24 11:55:52 2010 +0100
    48.2 +++ b/src/HOL/Bali/DeclConcepts.thy	Mon Mar 01 13:40:23 2010 +0100
    48.3 @@ -8,8 +8,7 @@
    48.4  
    48.5  section "access control (cf. 6.6), overriding and hiding (cf. 8.4.6.1)"
    48.6  
    48.7 -constdefs
    48.8 -is_public :: "prog \<Rightarrow> qtname \<Rightarrow> bool"
    48.9 +definition is_public :: "prog \<Rightarrow> qtname \<Rightarrow> bool" where
   48.10  "is_public G qn \<equiv> (case class G qn of
   48.11                       None       \<Rightarrow> (case iface G qn of
   48.12                                        None       \<Rightarrow> False
   48.13 @@ -38,14 +37,16 @@
   48.14  
   48.15  declare accessible_in_RefT_simp [simp del]
   48.16  
   48.17 -constdefs
   48.18 -  is_acc_class :: "prog \<Rightarrow> pname \<Rightarrow> qtname \<Rightarrow> bool"
   48.19 +definition is_acc_class :: "prog \<Rightarrow> pname \<Rightarrow> qtname \<Rightarrow> bool" where
   48.20      "is_acc_class G P C \<equiv> is_class G C \<and> G\<turnstile>(Class C) accessible_in P"
   48.21 -  is_acc_iface :: "prog \<Rightarrow> pname \<Rightarrow> qtname \<Rightarrow> bool"
   48.22 +
   48.23 +definition is_acc_iface :: "prog \<Rightarrow> pname \<Rightarrow> qtname \<Rightarrow> bool" where
   48.24      "is_acc_iface G P I \<equiv> is_iface G I \<and> G\<turnstile>(Iface I) accessible_in P"
   48.25 -  is_acc_type  :: "prog \<Rightarrow> pname \<Rightarrow> ty     \<Rightarrow> bool"
   48.26 +
   48.27 +definition is_acc_type  :: "prog \<Rightarrow> pname \<Rightarrow> ty     \<Rightarrow> bool" where
   48.28      "is_acc_type  G P T \<equiv> is_type G T  \<and> G\<turnstile>T accessible_in P"
   48.29 -  is_acc_reftype  :: "prog \<Rightarrow> pname \<Rightarrow> ref_ty \<Rightarrow> bool"
   48.30 +
   48.31 +definition is_acc_reftype  :: "prog \<Rightarrow> pname \<Rightarrow> ref_ty \<Rightarrow> bool" where
   48.32    "is_acc_reftype  G P T \<equiv> isrtype G T  \<and> G\<turnstile>T accessible_in' P"
   48.33  
   48.34  lemma is_acc_classD:
   48.35 @@ -336,8 +337,7 @@
   48.36  text {* Convert a qualified method declaration (qualified with its declaring 
   48.37  class) to a qualified member declaration:  @{text methdMembr}  *}
   48.38  
   48.39 -constdefs
   48.40 -methdMembr :: "(qtname \<times> mdecl) \<Rightarrow> (qtname \<times> memberdecl)"
   48.41 +definition methdMembr :: "(qtname \<times> mdecl) \<Rightarrow> (qtname \<times> memberdecl)" where
   48.42   "methdMembr m \<equiv> (fst m,mdecl (snd m))"
   48.43  
   48.44  lemma methdMembr_simp[simp]: "methdMembr (c,m) = (c,mdecl m)"
   48.45 @@ -355,8 +355,7 @@
   48.46  text {* Convert a qualified method (qualified with its declaring 
   48.47  class) to a qualified member declaration:  @{text method}  *}
   48.48  
   48.49 -constdefs
   48.50 -method :: "sig \<Rightarrow> (qtname \<times> methd) \<Rightarrow> (qtname \<times> memberdecl)" 
   48.51 +definition method :: "sig \<Rightarrow> (qtname \<times> methd) \<Rightarrow> (qtname \<times> memberdecl)" where 
   48.52  "method sig m \<equiv> (declclass m, mdecl (sig, mthd m))"
   48.53  
   48.54  lemma method_simp[simp]: "method sig (C,m) = (C,mdecl (sig,m))"
   48.55 @@ -377,8 +376,7 @@
   48.56  lemma memberid_method_simp[simp]:  "memberid (method sig m) = mid sig"
   48.57    by (simp add: method_def) 
   48.58  
   48.59 -constdefs
   48.60 -fieldm :: "vname \<Rightarrow> (qtname \<times> field) \<Rightarrow> (qtname \<times> memberdecl)" 
   48.61 +definition fieldm :: "vname \<Rightarrow> (qtname \<times> field) \<Rightarrow> (qtname \<times> memberdecl)" where 
   48.62  "fieldm n f \<equiv> (declclass f, fdecl (n, fld f))"
   48.63  
   48.64  lemma fieldm_simp[simp]: "fieldm n (C,f) = (C,fdecl (n,f))"
   48.65 @@ -402,7 +400,7 @@
   48.66  text {* Select the signature out of a qualified method declaration:
   48.67   @{text msig} *}
   48.68  
   48.69 -constdefs msig:: "(qtname \<times> mdecl) \<Rightarrow> sig"
   48.70 +definition msig :: "(qtname \<times> mdecl) \<Rightarrow> sig" where
   48.71  "msig m \<equiv> fst (snd m)"
   48.72  
   48.73  lemma msig_simp[simp]: "msig (c,(s,m)) = s"
   48.74 @@ -411,7 +409,7 @@
   48.75  text {* Convert a qualified method (qualified with its declaring 
   48.76  class) to a qualified method declaration:  @{text qmdecl}  *}
   48.77  
   48.78 -constdefs qmdecl :: "sig \<Rightarrow> (qtname \<times> methd) \<Rightarrow> (qtname \<times> mdecl)"
   48.79 +definition qmdecl :: "sig \<Rightarrow> (qtname \<times> methd) \<Rightarrow> (qtname \<times> mdecl)" where
   48.80  "qmdecl sig m \<equiv> (declclass m, (sig,mthd m))"
   48.81  
   48.82  lemma qmdecl_simp[simp]: "qmdecl sig (C,m) = (C,(sig,m))"
   48.83 @@ -504,10 +502,8 @@
   48.84        it is not accessible for inheritance at all.
   48.85  \end{itemize}
   48.86  *}
   48.87 -constdefs
   48.88 -inheritable_in:: 
   48.89 - "prog \<Rightarrow> (qtname \<times> memberdecl) \<Rightarrow> pname \<Rightarrow> bool"
   48.90 -                  ("_ \<turnstile> _ inheritable'_in _" [61,61,61] 60)
   48.91 +definition inheritable_in :: "prog \<Rightarrow> (qtname \<times> memberdecl) \<Rightarrow> pname \<Rightarrow> bool" ("_ \<turnstile> _ inheritable'_in _" [61,61,61] 60) where
   48.92 +                  
   48.93  "G\<turnstile>membr inheritable_in pack 
   48.94    \<equiv> (case (accmodi membr) of
   48.95         Private   \<Rightarrow> False
   48.96 @@ -529,25 +525,21 @@
   48.97  
   48.98  subsubsection "declared-in/undeclared-in"
   48.99  
  48.100 -constdefs cdeclaredmethd:: "prog \<Rightarrow> qtname \<Rightarrow> (sig,methd) table"
  48.101 +definition cdeclaredmethd :: "prog \<Rightarrow> qtname \<Rightarrow> (sig,methd) table" where
  48.102  "cdeclaredmethd G C 
  48.103    \<equiv> (case class G C of
  48.104         None \<Rightarrow> \<lambda> sig. None
  48.105       | Some c \<Rightarrow> table_of (methods c)
  48.106      )"
  48.107  
  48.108 -constdefs
  48.109 -cdeclaredfield:: "prog \<Rightarrow> qtname \<Rightarrow> (vname,field) table"
  48.110 +definition cdeclaredfield :: "prog \<Rightarrow> qtname \<Rightarrow> (vname,field) table" where
  48.111  "cdeclaredfield G C 
  48.112    \<equiv> (case class G C of
  48.113         None \<Rightarrow> \<lambda> sig. None
  48.114       | Some c \<Rightarrow> table_of (cfields c)
  48.115      )"
  48.116  
  48.117 -
  48.118 -constdefs
  48.119 -declared_in:: "prog  \<Rightarrow> memberdecl \<Rightarrow> qtname \<Rightarrow> bool"
  48.120 -                                 ("_\<turnstile> _ declared'_in _" [61,61,61] 60)
  48.121 +definition declared_in :: "prog  \<Rightarrow> memberdecl \<Rightarrow> qtname \<Rightarrow> bool" ("_\<turnstile> _ declared'_in _" [61,61,61] 60) where
  48.122  "G\<turnstile>m declared_in C \<equiv> (case m of
  48.123                          fdecl (fn,f ) \<Rightarrow> cdeclaredfield G C fn  = Some f
  48.124                        | mdecl (sig,m) \<Rightarrow> cdeclaredmethd G C sig = Some m)"
  48.125 @@ -567,10 +559,7 @@
  48.126  by (cases m) 
  48.127     (auto simp add: declared_in_def cdeclaredmethd_def cdeclaredfield_def)
  48.128  
  48.129 -constdefs
  48.130 -undeclared_in:: "prog  \<Rightarrow> memberid \<Rightarrow> qtname \<Rightarrow> bool"
  48.131 -                                 ("_\<turnstile> _ undeclared'_in _" [61,61,61] 60)
  48.132 -
  48.133 +definition undeclared_in :: "prog  \<Rightarrow> memberid \<Rightarrow> qtname \<Rightarrow> bool" ("_\<turnstile> _ undeclared'_in _" [61,61,61] 60) where
  48.134  "G\<turnstile>m undeclared_in C \<equiv> (case m of
  48.135                              fid fn  \<Rightarrow> cdeclaredfield G C fn  = None
  48.136                            | mid sig \<Rightarrow> cdeclaredmethd G C sig = None)"
  48.137 @@ -591,7 +580,7 @@
  48.138  
  48.139    Immediate: "\<lbrakk>G\<turnstile>mbr m declared_in C;declclass m = C\<rbrakk> \<Longrightarrow> G\<turnstile>m member_of C"
  48.140  | Inherited: "\<lbrakk>G\<turnstile>m inheritable_in (pid C); G\<turnstile>memberid m undeclared_in C; 
  48.141 -               G\<turnstile>C \<prec>\<^sub>C\<^sub>1 S; G\<turnstile>(Class S) accessible_in (pid C);G\<turnstile>m member_of S 
  48.142 +               G\<turnstile>C \<prec>\<^sub>C1 S; G\<turnstile>(Class S) accessible_in (pid C);G\<turnstile>m member_of S 
  48.143                \<rbrakk> \<Longrightarrow> G\<turnstile>m member_of C"
  48.144  text {* Note that in the case of an inherited member only the members of the
  48.145  direct superclass are concerned. If a member of a superclass of the direct
  48.146 @@ -617,19 +606,16 @@
  48.147                             ("_ \<turnstile>Field _  _ member'_of _" [61,61,61] 60)
  48.148   where "G\<turnstile>Field n f member_of C == G\<turnstile>fieldm n f member_of C"
  48.149  
  48.150 -constdefs
  48.151 -inherits:: "prog \<Rightarrow> qtname \<Rightarrow> (qtname \<times> memberdecl) \<Rightarrow> bool"
  48.152 -                           ("_ \<turnstile> _ inherits _" [61,61,61] 60)
  48.153 +definition inherits :: "prog \<Rightarrow> qtname \<Rightarrow> (qtname \<times> memberdecl) \<Rightarrow> bool" ("_ \<turnstile> _ inherits _" [61,61,61] 60) where
  48.154  "G\<turnstile>C inherits m 
  48.155    \<equiv> G\<turnstile>m inheritable_in (pid C) \<and> G\<turnstile>memberid m undeclared_in C \<and> 
  48.156 -    (\<exists> S. G\<turnstile>C \<prec>\<^sub>C\<^sub>1 S \<and> G\<turnstile>(Class S) accessible_in (pid C) \<and> G\<turnstile>m member_of S)"
  48.157 +    (\<exists> S. G\<turnstile>C \<prec>\<^sub>C1 S \<and> G\<turnstile>(Class S) accessible_in (pid C) \<and> G\<turnstile>m member_of S)"
  48.158  
  48.159  lemma inherits_member: "G\<turnstile>C inherits m \<Longrightarrow> G\<turnstile>m member_of C"
  48.160  by (auto simp add: inherits_def intro: members.Inherited)
  48.161  
  48.162  
  48.163 -constdefs member_in::"prog \<Rightarrow> (qtname \<times> memberdecl) \<Rightarrow> qtname \<Rightarrow> bool"
  48.164 -                           ("_ \<turnstile> _ member'_in _" [61,61,61] 60)
  48.165 +definition member_in :: "prog \<Rightarrow> (qtname \<times> memberdecl) \<Rightarrow> qtname \<Rightarrow> bool" ("_ \<turnstile> _ member'_in _" [61,61,61] 60) where
  48.166  "G\<turnstile>m member_in C \<equiv> \<exists> provC. G\<turnstile> C \<preceq>\<^sub>C provC \<and> G \<turnstile> m member_of provC"
  48.167  text {* A member is in a class if it is member of the class or a superclass.
  48.168  If a member is in a class we can select this member. This additional notion
  48.169 @@ -676,7 +662,7 @@
  48.170             G\<turnstile>Method new declared_in (declclass new);  
  48.171             G\<turnstile>Method old declared_in (declclass old); 
  48.172             G\<turnstile>Method old inheritable_in pid (declclass new);
  48.173 -           G\<turnstile>(declclass new) \<prec>\<^sub>C\<^sub>1 superNew;
  48.174 +           G\<turnstile>(declclass new) \<prec>\<^sub>C1 superNew;
  48.175             G \<turnstile>Method old member_of superNew
  48.176             \<rbrakk> \<Longrightarrow> G\<turnstile>new overrides\<^sub>S old"
  48.177  
  48.178 @@ -716,9 +702,7 @@
  48.179  
  48.180  subsubsection "Hiding"
  48.181  
  48.182 -constdefs hides::
  48.183 -"prog \<Rightarrow> (qtname \<times> mdecl) \<Rightarrow> (qtname \<times> mdecl) \<Rightarrow> bool" 
  48.184 -                                ("_\<turnstile> _ hides _" [61,61,61] 60)
  48.185 +definition hides :: "prog \<Rightarrow> (qtname \<times> mdecl) \<Rightarrow> (qtname \<times> mdecl) \<Rightarrow> bool" ("_\<turnstile> _ hides _" [61,61,61] 60) where 
  48.186  "G\<turnstile>new hides old
  48.187    \<equiv> is_static new \<and> msig new = msig old \<and>
  48.188      G\<turnstile>(declclass new) \<prec>\<^sub>C (declclass old) \<and>
  48.189 @@ -777,11 +761,7 @@
  48.190  by (auto simp add: hides_def)
  48.191  
  48.192  subsubsection "permits access" 
  48.193 -constdefs 
  48.194 -permits_acc:: 
  48.195 - "prog \<Rightarrow> (qtname \<times> memberdecl) \<Rightarrow> qtname \<Rightarrow> qtname \<Rightarrow> bool"
  48.196 -                   ("_ \<turnstile> _ in _ permits'_acc'_from _" [61,61,61,61] 60)
  48.197 -
  48.198 +definition permits_acc :: "prog \<Rightarrow> (qtname \<times> memberdecl) \<Rightarrow> qtname \<Rightarrow> qtname \<Rightarrow> bool" ("_ \<turnstile> _ in _ permits'_acc'_from _" [61,61,61,61] 60) where
  48.199  "G\<turnstile>membr in cls permits_acc_from accclass 
  48.200    \<equiv> (case (accmodi membr) of
  48.201         Private   \<Rightarrow> (declclass membr = accclass)
  48.202 @@ -980,7 +960,7 @@
  48.203    next
  48.204      case (Inherited n C S)
  48.205      assume undecl: "G\<turnstile> memberid n undeclared_in C"
  48.206 -    assume  super: "G\<turnstile>C\<prec>\<^sub>C\<^sub>1S"
  48.207 +    assume  super: "G\<turnstile>C\<prec>\<^sub>C1S"
  48.208      assume    hyp: "\<lbrakk>G \<turnstile> m member_of S; memberid n = memberid m\<rbrakk> \<Longrightarrow> n = m"
  48.209      assume   eqid: "memberid n = memberid m"
  48.210      assume "G \<turnstile> m member_of C"
  48.211 @@ -1011,7 +991,7 @@
  48.212         (auto simp add: declared_in_def cdeclaredmethd_def cdeclaredfield_def)
  48.213  next
  48.214    case (Inherited m C S)  
  48.215 -  assume "G\<turnstile>C\<prec>\<^sub>C\<^sub>1S" and "is_class G S"
  48.216 +  assume "G\<turnstile>C\<prec>\<^sub>C1S" and "is_class G S"
  48.217    then show "is_class G C"
  48.218      by - (rule subcls_is_class2,auto)
  48.219  qed
  48.220 @@ -1043,7 +1023,7 @@
  48.221          intro: rtrancl_trans)
  48.222  
  48.223  lemma stat_override_declclasses_relation: 
  48.224 -"\<lbrakk>G\<turnstile>(declclass new) \<prec>\<^sub>C\<^sub>1 superNew; G \<turnstile>Method old member_of superNew \<rbrakk>
  48.225 +"\<lbrakk>G\<turnstile>(declclass new) \<prec>\<^sub>C1 superNew; G \<turnstile>Method old member_of superNew \<rbrakk>
  48.226  \<Longrightarrow> G\<turnstile>(declclass new) \<prec>\<^sub>C (declclass old)"
  48.227  apply (rule trancl_rtrancl_trancl)
  48.228  apply (erule r_into_trancl)
  48.229 @@ -1257,7 +1237,7 @@
  48.230              "G\<turnstile> memberid m undeclared_in D"  
  48.231              "G \<turnstile> Class S accessible_in pid D" 
  48.232              "G \<turnstile> m member_of S"
  48.233 -    assume super: "G\<turnstile>D\<prec>\<^sub>C\<^sub>1S"
  48.234 +    assume super: "G\<turnstile>D\<prec>\<^sub>C1S"
  48.235      assume hyp: "\<lbrakk>G\<turnstile>S\<preceq>\<^sub>C C; G\<turnstile>C\<preceq>\<^sub>C declclass m\<rbrakk> \<Longrightarrow> G \<turnstile> m member_of C"
  48.236      assume subclseq_C_m: "G\<turnstile>C\<preceq>\<^sub>C declclass m"
  48.237      assume "G\<turnstile>D\<preceq>\<^sub>C C"
  48.238 @@ -1399,24 +1379,21 @@
  48.239  translations 
  48.240    "fspec" <= (type) "vname \<times> qtname" 
  48.241  
  48.242 -constdefs
  48.243 -imethds:: "prog \<Rightarrow> qtname \<Rightarrow> (sig,qtname \<times> mhead) tables"
  48.244 +definition imethds :: "prog \<Rightarrow> qtname \<Rightarrow> (sig,qtname \<times> mhead) tables" where
  48.245  "imethds G I 
  48.246    \<equiv> iface_rec (G,I)  
  48.247                (\<lambda>I i ts. (Un_tables ts) \<oplus>\<oplus> 
  48.248                          (Option.set \<circ> table_of (map (\<lambda>(s,m). (s,I,m)) (imethods i))))"
  48.249  text {* methods of an interface, with overriding and inheritance, cf. 9.2 *}
  48.250  
  48.251 -constdefs
  48.252 -accimethds:: "prog \<Rightarrow> pname \<Rightarrow> qtname \<Rightarrow> (sig,qtname \<times> mhead) tables"
  48.253 +definition accimethds :: "prog \<Rightarrow> pname \<Rightarrow> qtname \<Rightarrow> (sig,qtname \<times> mhead) tables" where
  48.254  "accimethds G pack I
  48.255    \<equiv> if G\<turnstile>Iface I accessible_in pack 
  48.256         then imethds G I
  48.257         else \<lambda> k. {}"
  48.258  text {* only returns imethds if the interface is accessible *}
  48.259  
  48.260 -constdefs
  48.261 -methd:: "prog \<Rightarrow> qtname  \<Rightarrow> (sig,qtname \<times> methd) table"
  48.262 +definition methd :: "prog \<Rightarrow> qtname  \<Rightarrow> (sig,qtname \<times> methd) table" where
  48.263  
  48.264  "methd G C 
  48.265   \<equiv> class_rec (G,C) empty
  48.266 @@ -1431,8 +1408,7 @@
  48.267       Every new method with the same signature coalesces the
  48.268       method of a superclass. *}
  48.269  
  48.270 -constdefs                      
  48.271 -accmethd:: "prog \<Rightarrow> qtname \<Rightarrow> qtname  \<Rightarrow> (sig,qtname \<times> methd) table"
  48.272 +definition accmethd :: "prog \<Rightarrow> qtname \<Rightarrow> qtname  \<Rightarrow> (sig,qtname \<times> methd) table" where
  48.273  "accmethd G S C 
  48.274   \<equiv> filter_tab (\<lambda>sig m. G\<turnstile>method sig m of C accessible_from S) 
  48.275                (methd G C)"
  48.276 @@ -1446,8 +1422,7 @@
  48.277      So we must test accessibility of method @{term m} of class @{term C} 
  48.278      (not @{term "declclass m"}) *}
  48.279  
  48.280 -constdefs 
  48.281 -dynmethd:: "prog  \<Rightarrow> qtname \<Rightarrow> qtname \<Rightarrow> (sig,qtname \<times> methd) table"
  48.282 +definition dynmethd :: "prog  \<Rightarrow> qtname \<Rightarrow> qtname \<Rightarrow> (sig,qtname \<times> methd) table" where
  48.283  "dynmethd G statC dynC  
  48.284    \<equiv> \<lambda> sig. 
  48.285       (if G\<turnstile>dynC \<preceq>\<^sub>C statC
  48.286 @@ -1473,8 +1448,7 @@
  48.287          filters the new methods (to get only those methods which actually
  48.288          override the methods of the static class) *}
  48.289  
  48.290 -constdefs 
  48.291 -dynimethd:: "prog \<Rightarrow> qtname \<Rightarrow> qtname \<Rightarrow> (sig,qtname \<times> methd) table"
  48.292 +definition dynimethd :: "prog \<Rightarrow> qtname \<Rightarrow> qtname \<Rightarrow> (sig,qtname \<times> methd) table" where
  48.293  "dynimethd G I dynC 
  48.294    \<equiv> \<lambda> sig. if imethds G I sig \<noteq> {}
  48.295                 then methd G dynC sig
  48.296 @@ -1493,8 +1467,7 @@
  48.297     down to the actual dynamic class.
  48.298   *}
  48.299  
  48.300 -constdefs
  48.301 -dynlookup::"prog  \<Rightarrow> ref_ty \<Rightarrow> qtname \<Rightarrow> (sig,qtname \<times> methd) table"
  48.302 +definition dynlookup :: "prog  \<Rightarrow> ref_ty \<Rightarrow> qtname \<Rightarrow> (sig,qtname \<times> methd) table" where
  48.303  "dynlookup G statT dynC
  48.304    \<equiv> (case statT of
  48.305         NullT        \<Rightarrow> empty
  48.306 @@ -1506,8 +1479,7 @@
  48.307      In a wellformd context statT will not be NullT and in case
  48.308      statT is an array type, dynC=Object *}
  48.309  
  48.310 -constdefs
  48.311 -fields:: "prog \<Rightarrow> qtname \<Rightarrow> ((vname \<times> qtname) \<times> field) list"
  48.312 +definition fields :: "prog \<Rightarrow> qtname \<Rightarrow> ((vname \<times> qtname) \<times> field) list" where
  48.313  "fields G C 
  48.314    \<equiv> class_rec (G,C) [] (\<lambda>C c ts. map (\<lambda>(n,t). ((n,C),t)) (cfields c) @ ts)"
  48.315  text {* @{term "fields G C"} 
  48.316 @@ -1515,8 +1487,7 @@
  48.317       (private, inherited and hidden ones) not only the accessible ones
  48.318       (an instance of a object allocates all these fields *}
  48.319  
  48.320 -constdefs
  48.321 -accfield:: "prog \<Rightarrow> qtname \<Rightarrow> qtname \<Rightarrow> (vname, qtname  \<times>  field) table"
  48.322 +definition accfield :: "prog \<Rightarrow> qtname \<Rightarrow> qtname \<Rightarrow> (vname, qtname  \<times>  field) table" where
  48.323  "accfield G S C
  48.324    \<equiv> let field_tab = table_of((map (\<lambda>((n,d),f).(n,(d,f)))) (fields G C))
  48.325      in filter_tab (\<lambda>n (declC,f). G\<turnstile> (declC,fdecl (n,f)) of C accessible_from S)
  48.326 @@ -1531,12 +1502,10 @@
  48.327     inheritance, too. So we must test accessibility of field @{term f} of class 
  48.328     @{term C} (not @{term "declclass f"}) *} 
  48.329  
  48.330 -constdefs
  48.331 -
  48.332 -  is_methd :: "prog \<Rightarrow> qtname  \<Rightarrow> sig \<Rightarrow> bool"
  48.333 +definition is_methd :: "prog \<Rightarrow> qtname  \<Rightarrow> sig \<Rightarrow> bool" where
  48.334   "is_methd G \<equiv> \<lambda>C sig. is_class G C \<and> methd G C sig \<noteq> None"
  48.335  
  48.336 -constdefs efname:: "((vname \<times> qtname) \<times> field) \<Rightarrow> (vname \<times> qtname)"
  48.337 +definition efname :: "((vname \<times> qtname) \<times> field) \<Rightarrow> (vname \<times> qtname)" where
  48.338  "efname \<equiv> fst"
  48.339  
  48.340  lemma efname_simp[simp]:"efname (n,f) = n"
  48.341 @@ -2300,8 +2269,7 @@
  48.342  
  48.343  section "calculation of the superclasses of a class"
  48.344  
  48.345 -constdefs 
  48.346 - superclasses:: "prog \<Rightarrow> qtname \<Rightarrow> qtname set"
  48.347 +definition superclasses :: "prog \<Rightarrow> qtname \<Rightarrow> qtname set" where
  48.348   "superclasses G C \<equiv> class_rec (G,C) {} 
  48.349                         (\<lambda> C c superclss. (if C=Object 
  48.350                                              then {} 
    49.1 --- a/src/HOL/Bali/DefiniteAssignment.thy	Wed Feb 24 11:55:52 2010 +0100
    49.2 +++ b/src/HOL/Bali/DefiniteAssignment.thy	Mon Mar 01 13:40:23 2010 +0100
    49.3 @@ -74,7 +74,7 @@
    49.4  "jumpNestingOkS jmps (FinA a c) = False"
    49.5  
    49.6  
    49.7 -constdefs jumpNestingOk :: "jump set \<Rightarrow> term \<Rightarrow> bool"
    49.8 +definition jumpNestingOk :: "jump set \<Rightarrow> term \<Rightarrow> bool" where
    49.9  "jumpNestingOk jmps t \<equiv> (case t of
   49.10                        In1 se \<Rightarrow> (case se of
   49.11                                     Inl e \<Rightarrow> True
   49.12 @@ -156,7 +156,7 @@
   49.13  "assignsEs     [] = {}"
   49.14  "assignsEs (e#es) = assignsE e \<union> assignsEs es"
   49.15  
   49.16 -constdefs assigns:: "term \<Rightarrow> lname set"
   49.17 +definition assigns :: "term \<Rightarrow> lname set" where
   49.18  "assigns t \<equiv> (case t of
   49.19                  In1 se \<Rightarrow> (case se of
   49.20                               Inl e \<Rightarrow> assignsE e
   49.21 @@ -429,20 +429,14 @@
   49.22  
   49.23  subsection {* Lifting set operations to range of tables (map to a set) *}
   49.24  
   49.25 -constdefs 
   49.26 - union_ts:: "('a,'b) tables \<Rightarrow> ('a,'b) tables \<Rightarrow> ('a,'b) tables"
   49.27 -                    ("_ \<Rightarrow>\<union> _" [67,67] 65)
   49.28 +definition union_ts :: "('a,'b) tables \<Rightarrow> ('a,'b) tables \<Rightarrow> ('a,'b) tables" ("_ \<Rightarrow>\<union> _" [67,67] 65) where
   49.29   "A \<Rightarrow>\<union> B \<equiv> \<lambda> k. A k \<union> B k"
   49.30  
   49.31 -constdefs
   49.32 - intersect_ts:: "('a,'b) tables \<Rightarrow> ('a,'b) tables \<Rightarrow> ('a,'b) tables"
   49.33 -                    ("_ \<Rightarrow>\<inter>  _" [72,72] 71)
   49.34 +definition intersect_ts :: "('a,'b) tables \<Rightarrow> ('a,'b) tables \<Rightarrow> ('a,'b) tables" ("_ \<Rightarrow>\<inter>  _" [72,72] 71) where
   49.35   "A \<Rightarrow>\<inter>  B \<equiv> \<lambda> k. A k \<inter> B k"
   49.36  
   49.37 -constdefs
   49.38 - all_union_ts:: "('a,'b) tables \<Rightarrow> 'b set \<Rightarrow> ('a,'b) tables" 
   49.39 -                                                     (infixl "\<Rightarrow>\<union>\<^sub>\<forall>" 40)
   49.40 -"A \<Rightarrow>\<union>\<^sub>\<forall> B \<equiv> \<lambda> k. A k \<union> B"
   49.41 +definition all_union_ts :: "('a,'b) tables \<Rightarrow> 'b set \<Rightarrow> ('a,'b) tables" (infixl "\<Rightarrow>\<union>\<^sub>\<forall>" 40) where 
   49.42 + "A \<Rightarrow>\<union>\<^sub>\<forall> B \<equiv> \<lambda> k. A k \<union> B"
   49.43    
   49.44  subsubsection {* Binary union of tables *}
   49.45  
   49.46 @@ -513,15 +507,15 @@
   49.47           brk :: "breakass" --{* Definetly assigned variables for 
   49.48                                  abrupt completion with a break *}
   49.49  
   49.50 -constdefs rmlab :: "'a \<Rightarrow> ('a,'b) tables \<Rightarrow> ('a,'b) tables"
   49.51 +definition rmlab :: "'a \<Rightarrow> ('a,'b) tables \<Rightarrow> ('a,'b) tables" where
   49.52  "rmlab k A \<equiv> \<lambda> x. if x=k then UNIV else A x"
   49.53   
   49.54  (*
   49.55 -constdefs setbrk :: "breakass \<Rightarrow> assigned \<Rightarrow> breakass set"
   49.56 +definition setbrk :: "breakass \<Rightarrow> assigned \<Rightarrow> breakass set" where
   49.57  "setbrk b A \<equiv> {b} \<union> {a| a. a\<in> brk A \<and> lab a \<noteq> lab b}"
   49.58  *)
   49.59  
   49.60 -constdefs range_inter_ts :: "('a,'b) tables \<Rightarrow> 'b set" ("\<Rightarrow>\<Inter>_" 80)
   49.61 +definition range_inter_ts :: "('a,'b) tables \<Rightarrow> 'b set" ("\<Rightarrow>\<Inter>_" 80) where 
   49.62   "\<Rightarrow>\<Inter>A \<equiv> {x |x. \<forall> k. x \<in> A k}"
   49.63  
   49.64  text {*
    50.1 --- a/src/HOL/Bali/Eval.thy	Wed Feb 24 11:55:52 2010 +0100
    50.2 +++ b/src/HOL/Bali/Eval.thy	Mon Mar 01 13:40:23 2010 +0100
    50.3 @@ -140,8 +140,7 @@
    50.4    lst_inj_vals  ("\<lfloor>_\<rfloor>\<^sub>l" 1000)
    50.5    where "\<lfloor>es\<rfloor>\<^sub>l == In3 es"
    50.6  
    50.7 -constdefs
    50.8 -  undefined3 :: "('al + 'ar, 'b, 'c) sum3 \<Rightarrow> vals"
    50.9 +definition undefined3 :: "('al + 'ar, 'b, 'c) sum3 \<Rightarrow> vals" where
   50.10   "undefined3 \<equiv> sum3_case (In1 \<circ> sum_case (\<lambda>x. undefined) (\<lambda>x. Unit))
   50.11                       (\<lambda>x. In2 undefined) (\<lambda>x. In3 undefined)"
   50.12  
   50.13 @@ -160,8 +159,7 @@
   50.14  
   50.15  section "exception throwing and catching"
   50.16  
   50.17 -constdefs
   50.18 -  throw :: "val \<Rightarrow> abopt \<Rightarrow> abopt"
   50.19 +definition throw :: "val \<Rightarrow> abopt \<Rightarrow> abopt" where
   50.20   "throw a' x \<equiv> abrupt_if True (Some (Xcpt (Loc (the_Addr a')))) (np a' x)"
   50.21  
   50.22  lemma throw_def2: 
   50.23 @@ -170,8 +168,7 @@
   50.24  apply (simp (no_asm))
   50.25  done
   50.26  
   50.27 -constdefs
   50.28 -  fits    :: "prog \<Rightarrow> st \<Rightarrow> val \<Rightarrow> ty \<Rightarrow> bool" ("_,_\<turnstile>_ fits _"[61,61,61,61]60)
   50.29 +definition fits :: "prog \<Rightarrow> st \<Rightarrow> val \<Rightarrow> ty \<Rightarrow> bool" ("_,_\<turnstile>_ fits _"[61,61,61,61]60) where
   50.30   "G,s\<turnstile>a' fits T  \<equiv> (\<exists>rt. T=RefT rt) \<longrightarrow> a'=Null \<or> G\<turnstile>obj_ty(lookup_obj s a')\<preceq>T"
   50.31  
   50.32  lemma fits_Null [simp]: "G,s\<turnstile>Null fits T"
   50.33 @@ -195,8 +192,7 @@
   50.34  apply iprover
   50.35  done
   50.36  
   50.37 -constdefs
   50.38 -  catch ::"prog \<Rightarrow> state \<Rightarrow> qtname \<Rightarrow> bool"      ("_,_\<turnstile>catch _"[61,61,61]60)
   50.39 +definition catch :: "prog \<Rightarrow> state \<Rightarrow> qtname \<Rightarrow> bool" ("_,_\<turnstile>catch _"[61,61,61]60) where
   50.40   "G,s\<turnstile>catch C\<equiv>\<exists>xc. abrupt s=Some (Xcpt xc) \<and> 
   50.41                      G,store s\<turnstile>Addr (the_Loc xc) fits Class C"
   50.42  
   50.43 @@ -221,8 +217,7 @@
   50.44  apply (simp (no_asm))
   50.45  done
   50.46  
   50.47 -constdefs
   50.48 -  new_xcpt_var :: "vname \<Rightarrow> state \<Rightarrow> state"
   50.49 +definition new_xcpt_var :: "vname \<Rightarrow> state \<Rightarrow> state" where
   50.50   "new_xcpt_var vn \<equiv> 
   50.51       \<lambda>(x,s). Norm (lupd(VName vn\<mapsto>Addr (the_Loc (the_Xcpt (the x)))) s)"
   50.52  
   50.53 @@ -237,9 +232,7 @@
   50.54  
   50.55  section "misc"
   50.56  
   50.57 -constdefs
   50.58 -
   50.59 -  assign     :: "('a \<Rightarrow> state \<Rightarrow> state) \<Rightarrow> 'a \<Rightarrow> state \<Rightarrow> state"
   50.60 +definition assign :: "('a \<Rightarrow> state \<Rightarrow> state) \<Rightarrow> 'a \<Rightarrow> state \<Rightarrow> state" where
   50.61   "assign f v \<equiv> \<lambda>(x,s). let (x',s') = (if x = None then f v else id) (x,s)
   50.62                     in  (x',if x' = None then s' else s)"
   50.63  
   50.64 @@ -300,9 +293,7 @@
   50.65  done
   50.66  *)
   50.67  
   50.68 -constdefs
   50.69 -
   50.70 -  init_comp_ty :: "ty \<Rightarrow> stmt"
   50.71 +definition init_comp_ty :: "ty \<Rightarrow> stmt" where
   50.72   "init_comp_ty T \<equiv> if (\<exists>C. T = Class C) then Init (the_Class T) else Skip"
   50.73  
   50.74  lemma init_comp_ty_PrimT [simp]: "init_comp_ty (PrimT pt) = Skip"
   50.75 @@ -310,9 +301,7 @@
   50.76  apply (simp (no_asm))
   50.77  done
   50.78  
   50.79 -constdefs
   50.80 -
   50.81 - invocation_class  :: "inv_mode \<Rightarrow> st \<Rightarrow> val \<Rightarrow> ref_ty \<Rightarrow> qtname"
   50.82 +definition invocation_class :: "inv_mode \<Rightarrow> st \<Rightarrow> val \<Rightarrow> ref_ty \<Rightarrow> qtname" where
   50.83   "invocation_class m s a' statT 
   50.84      \<equiv> (case m of
   50.85           Static \<Rightarrow> if (\<exists> statC. statT = ClassT statC) 
   50.86 @@ -321,7 +310,7 @@
   50.87         | SuperM \<Rightarrow> the_Class (RefT statT)
   50.88         | IntVir \<Rightarrow> obj_class (lookup_obj s a'))"
   50.89  
   50.90 -invocation_declclass::"prog \<Rightarrow> inv_mode \<Rightarrow> st \<Rightarrow> val \<Rightarrow> ref_ty \<Rightarrow> sig \<Rightarrow> qtname"
   50.91 +definition invocation_declclass::"prog \<Rightarrow> inv_mode \<Rightarrow> st \<Rightarrow> val \<Rightarrow> ref_ty \<Rightarrow> sig \<Rightarrow> qtname" where
   50.92  "invocation_declclass G m s a' statT sig 
   50.93     \<equiv> declclass (the (dynlookup G statT 
   50.94                                  (invocation_class m s a' statT)
   50.95 @@ -341,9 +330,8 @@
   50.96                                              else Object)"
   50.97  by (simp add: invocation_class_def)
   50.98  
   50.99 -constdefs
  50.100 -  init_lvars :: "prog \<Rightarrow> qtname \<Rightarrow> sig \<Rightarrow> inv_mode \<Rightarrow> val \<Rightarrow> val list \<Rightarrow>
  50.101 -                   state \<Rightarrow> state"
  50.102 +definition init_lvars :: "prog \<Rightarrow> qtname \<Rightarrow> sig \<Rightarrow> inv_mode \<Rightarrow> val \<Rightarrow> val list \<Rightarrow>
  50.103 +                   state \<Rightarrow> state" where
  50.104   "init_lvars G C sig mode a' pvs 
  50.105     \<equiv> \<lambda> (x,s). 
  50.106        let m = mthd (the (methd G C sig));
  50.107 @@ -376,8 +364,7 @@
  50.108  apply (simp (no_asm) add: Let_def)
  50.109  done
  50.110  
  50.111 -constdefs
  50.112 -  body :: "prog \<Rightarrow> qtname \<Rightarrow> sig \<Rightarrow> expr"
  50.113 +definition body :: "prog \<Rightarrow> qtname \<Rightarrow> sig \<Rightarrow> expr" where
  50.114   "body G C sig \<equiv> let m = the (methd G C sig) 
  50.115                   in Body (declclass m) (stmt (mbody (mthd m)))"
  50.116  
  50.117 @@ -390,12 +377,10 @@
  50.118  
  50.119  section "variables"
  50.120  
  50.121 -constdefs
  50.122 -
  50.123 -  lvar :: "lname \<Rightarrow> st \<Rightarrow> vvar"
  50.124 +definition lvar :: "lname \<Rightarrow> st \<Rightarrow> vvar" where
  50.125   "lvar vn s \<equiv> (the (locals s vn), \<lambda>v. supd (lupd(vn\<mapsto>v)))"
  50.126  
  50.127 -  fvar :: "qtname \<Rightarrow> bool \<Rightarrow> vname \<Rightarrow> val \<Rightarrow> state \<Rightarrow> vvar \<times> state"
  50.128 +definition fvar :: "qtname \<Rightarrow> bool \<Rightarrow> vname \<Rightarrow> val \<Rightarrow> state \<Rightarrow> vvar \<times> state" where
  50.129   "fvar C stat fn a' s 
  50.130      \<equiv> let (oref,xf) = if stat then (Stat C,id)
  50.131                                else (Heap (the_Addr a'),np a');
  50.132 @@ -403,7 +388,7 @@
  50.133                    f = (\<lambda>v. supd (upd_gobj oref n v)) 
  50.134        in ((the (values (the (globs (store s) oref)) n),f),abupd xf s)"
  50.135  
  50.136 -  avar :: "prog \<Rightarrow> val \<Rightarrow> val \<Rightarrow> state \<Rightarrow> vvar \<times> state"
  50.137 +definition avar :: "prog \<Rightarrow> val \<Rightarrow> val \<Rightarrow> state \<Rightarrow> vvar \<times> state" where
  50.138   "avar G i' a' s 
  50.139      \<equiv> let   oref = Heap (the_Addr a'); 
  50.140                 i = the_Intg i'; 
  50.141 @@ -446,9 +431,7 @@
  50.142  apply (simp (no_asm) add: Let_def split_beta)
  50.143  done
  50.144  
  50.145 -constdefs
  50.146 -check_field_access::
  50.147 -"prog \<Rightarrow> qtname \<Rightarrow> qtname \<Rightarrow> vname \<Rightarrow> bool \<Rightarrow> val \<Rightarrow> state \<Rightarrow> state"
  50.148 +definition check_field_access :: "prog \<Rightarrow> qtname \<Rightarrow> qtname \<Rightarrow> vname \<Rightarrow> bool \<Rightarrow> val \<Rightarrow> state \<Rightarrow> state" where
  50.149  "check_field_access G accC statDeclC fn stat a' s
  50.150   \<equiv> let oref = if stat then Stat statDeclC
  50.151                        else Heap (the_Addr a');
  50.152 @@ -461,9 +444,7 @@
  50.153                    AccessViolation)
  50.154          s"
  50.155  
  50.156 -constdefs
  50.157 -check_method_access:: 
  50.158 -  "prog \<Rightarrow> qtname \<Rightarrow> ref_ty \<Rightarrow> inv_mode \<Rightarrow>  sig \<Rightarrow> val \<Rightarrow> state \<Rightarrow> state"
  50.159 +definition check_method_access :: "prog \<Rightarrow> qtname \<Rightarrow> ref_ty \<Rightarrow> inv_mode \<Rightarrow>  sig \<Rightarrow> val \<Rightarrow> state \<Rightarrow> state" where
  50.160  "check_method_access G accC statT mode sig  a' s
  50.161   \<equiv> let invC = invocation_class mode (store s) a' statT;
  50.162         dynM = the (dynlookup G statT invC sig)
    51.1 --- a/src/HOL/Bali/Example.thy	Wed Feb 24 11:55:52 2010 +0100
    51.2 +++ b/src/HOL/Bali/Example.thy	Mon Mar 01 13:40:23 2010 +0100
    51.3 @@ -153,23 +153,18 @@
    51.4    
    51.5    foo    :: mname
    51.6  
    51.7 -constdefs
    51.8 -  
    51.9 -  foo_sig   :: sig
   51.10 - "foo_sig   \<equiv> \<lparr>name=foo,parTs=[Class Base]\<rparr>"
   51.11 +definition foo_sig :: sig
   51.12 + where "foo_sig   \<equiv> \<lparr>name=foo,parTs=[Class Base]\<rparr>"
   51.13    
   51.14 -  foo_mhead :: mhead
   51.15 - "foo_mhead \<equiv> \<lparr>access=Public,static=False,pars=[z],resT=Class Base\<rparr>"
   51.16 +definition foo_mhead :: mhead
   51.17 + where "foo_mhead \<equiv> \<lparr>access=Public,static=False,pars=[z],resT=Class Base\<rparr>"
   51.18  
   51.19 -constdefs
   51.20 -  
   51.21 -  Base_foo :: mdecl
   51.22 - "Base_foo \<equiv> (foo_sig, \<lparr>access=Public,static=False,pars=[z],resT=Class Base,
   51.23 +definition Base_foo :: mdecl
   51.24 + where "Base_foo \<equiv> (foo_sig, \<lparr>access=Public,static=False,pars=[z],resT=Class Base,
   51.25                          mbody=\<lparr>lcls=[],stmt=Return (!!z)\<rparr>\<rparr>)"
   51.26  
   51.27 -constdefs
   51.28 -  Ext_foo  :: mdecl
   51.29 - "Ext_foo  \<equiv> (foo_sig, 
   51.30 +definition Ext_foo :: mdecl
   51.31 + where "Ext_foo  \<equiv> (foo_sig, 
   51.32                \<lparr>access=Public,static=False,pars=[z],resT=Class Ext,
   51.33                 mbody=\<lparr>lcls=[]
   51.34                       ,stmt=Expr({Ext,Ext,False}Cast (Class Ext) (!!z)..vee := 
   51.35 @@ -177,12 +172,10 @@
   51.36                                  Return (Lit Null)\<rparr>
   51.37                \<rparr>)"
   51.38  
   51.39 -constdefs
   51.40 -  
   51.41 -arr_viewed_from :: "qtname \<Rightarrow> qtname \<Rightarrow> var"
   51.42 +definition arr_viewed_from :: "qtname \<Rightarrow> qtname \<Rightarrow> var" where
   51.43  "arr_viewed_from accC C \<equiv> {accC,Base,True}StatRef (ClassT C)..arr"
   51.44  
   51.45 -BaseCl :: "class"
   51.46 +definition BaseCl :: "class" where
   51.47  "BaseCl \<equiv> \<lparr>access=Public,
   51.48             cfields=[(arr, \<lparr>access=Public,static=True ,type=PrimT Boolean.[]\<rparr>),
   51.49                      (vee, \<lparr>access=Public,static=False,type=Iface HasFoo    \<rparr>)],
   51.50 @@ -192,7 +185,7 @@
   51.51             super=Object,
   51.52             superIfs=[HasFoo]\<rparr>"
   51.53    
   51.54 -ExtCl  :: "class"
   51.55 +definition ExtCl  :: "class" where
   51.56  "ExtCl  \<equiv> \<lparr>access=Public,
   51.57             cfields=[(vee, \<lparr>access=Public,static=False,type= PrimT Integer\<rparr>)], 
   51.58             methods=[Ext_foo],
   51.59 @@ -200,7 +193,7 @@
   51.60             super=Base,
   51.61             superIfs=[]\<rparr>"
   51.62  
   51.63 -MainCl :: "class"
   51.64 +definition MainCl :: "class" where
   51.65  "MainCl \<equiv> \<lparr>access=Public,
   51.66             cfields=[], 
   51.67             methods=[], 
   51.68 @@ -209,16 +202,14 @@
   51.69             superIfs=[]\<rparr>"
   51.70  (* The "main" method is modeled seperately (see tprg) *)
   51.71  
   51.72 -constdefs
   51.73 -  
   51.74 -  HasFooInt :: iface
   51.75 - "HasFooInt \<equiv> \<lparr>access=Public,imethods=[(foo_sig, foo_mhead)],isuperIfs=[]\<rparr>"
   51.76 +definition HasFooInt :: iface
   51.77 + where "HasFooInt \<equiv> \<lparr>access=Public,imethods=[(foo_sig, foo_mhead)],isuperIfs=[]\<rparr>"
   51.78  
   51.79 -  Ifaces ::"idecl list"
   51.80 - "Ifaces \<equiv> [(HasFoo,HasFooInt)]"
   51.81 +definition Ifaces ::"idecl list"
   51.82 + where "Ifaces \<equiv> [(HasFoo,HasFooInt)]"
   51.83  
   51.84 - "Classes" ::"cdecl list"
   51.85 - "Classes \<equiv> [(Base,BaseCl),(Ext,ExtCl),(Main,MainCl)]@standard_classes"
   51.86 +definition "Classes" ::"cdecl list"
   51.87 + where "Classes \<equiv> [(Base,BaseCl),(Ext,ExtCl),(Main,MainCl)]@standard_classes"
   51.88  
   51.89  lemmas table_classes_defs = 
   51.90       Classes_def standard_classes_def ObjectC_def SXcptC_def
   51.91 @@ -273,8 +264,7 @@
   51.92    tprg :: prog where
   51.93    "tprg == \<lparr>ifaces=Ifaces,classes=Classes\<rparr>"
   51.94  
   51.95 -constdefs
   51.96 -  test    :: "(ty)list \<Rightarrow> stmt"
   51.97 +definition test :: "(ty)list \<Rightarrow> stmt" where
   51.98   "test pTs \<equiv> e:==NewC Ext;; 
   51.99             \<spacespace> Try Expr({Main,ClassT Base,IntVir}!!e\<cdot>foo({pTs}[Lit Null]))
  51.100             \<spacespace> Catch((SXcpt NullPointer) z)
    52.1 --- a/src/HOL/Bali/State.thy	Wed Feb 24 11:55:52 2010 +0100
    52.2 +++ b/src/HOL/Bali/State.thy	Mon Mar 01 13:40:23 2010 +0100
    52.3 @@ -38,9 +38,7 @@
    52.4    "obj"   <= (type) "\<lparr>tag::obj_tag, values::vn \<Rightarrow> val option\<rparr>"
    52.5    "obj"   <= (type) "\<lparr>tag::obj_tag, values::vn \<Rightarrow> val option,\<dots>::'a\<rparr>"
    52.6  
    52.7 -constdefs
    52.8 -  
    52.9 -  the_Arr :: "obj option \<Rightarrow> ty \<times> int \<times> (vn, val) table"
   52.10 +definition the_Arr :: "obj option \<Rightarrow> ty \<times> int \<times> (vn, val) table" where
   52.11   "the_Arr obj \<equiv> SOME (T,k,t). obj = Some \<lparr>tag=Arr T k,values=t\<rparr>"
   52.12  
   52.13  lemma the_Arr_Arr [simp]: "the_Arr (Some \<lparr>tag=Arr T k,values=cs\<rparr>) = (T,k,cs)"
   52.14 @@ -52,9 +50,7 @@
   52.15  apply (auto simp add: the_Arr_def)
   52.16  done
   52.17  
   52.18 -constdefs
   52.19 -
   52.20 -  upd_obj       :: "vn \<Rightarrow> val \<Rightarrow> obj \<Rightarrow> obj" 
   52.21 +definition upd_obj :: "vn \<Rightarrow> val \<Rightarrow> obj \<Rightarrow> obj" where 
   52.22   "upd_obj n v \<equiv> \<lambda> obj . obj \<lparr>values:=(values obj)(n\<mapsto>v)\<rparr>"
   52.23  
   52.24  lemma upd_obj_def2 [simp]: 
   52.25 @@ -62,8 +58,7 @@
   52.26  apply (auto simp: upd_obj_def)
   52.27  done
   52.28  
   52.29 -constdefs
   52.30 -  obj_ty        :: "obj \<Rightarrow> ty"
   52.31 +definition obj_ty :: "obj \<Rightarrow> ty" where
   52.32   "obj_ty obj    \<equiv> case tag obj of 
   52.33                      CInst C \<Rightarrow> Class C 
   52.34                    | Arr T k \<Rightarrow> T.[]"
   52.35 @@ -102,9 +97,7 @@
   52.36  apply (auto split add: obj_tag.split_asm)
   52.37  done
   52.38  
   52.39 -constdefs
   52.40 -
   52.41 -  obj_class :: "obj \<Rightarrow> qtname"
   52.42 +definition obj_class :: "obj \<Rightarrow> qtname" where
   52.43   "obj_class obj \<equiv> case tag obj of 
   52.44                      CInst C \<Rightarrow> C 
   52.45                    | Arr T k \<Rightarrow> Object"
   52.46 @@ -143,9 +136,7 @@
   52.47    "Stat" => "CONST Inr"
   52.48    "oref" <= (type) "loc + qtname"
   52.49  
   52.50 -constdefs
   52.51 -  fields_table::
   52.52 -    "prog \<Rightarrow> qtname \<Rightarrow> (fspec \<Rightarrow> field \<Rightarrow> bool)  \<Rightarrow> (fspec, ty) table"
   52.53 +definition fields_table :: "prog \<Rightarrow> qtname \<Rightarrow> (fspec \<Rightarrow> field \<Rightarrow> bool)  \<Rightarrow> (fspec, ty) table" where
   52.54   "fields_table G C P 
   52.55      \<equiv> Option.map type \<circ> table_of (filter (split P) (DeclConcepts.fields G C))"
   52.56  
   52.57 @@ -182,14 +173,13 @@
   52.58  apply simp
   52.59  done
   52.60  
   52.61 -constdefs
   52.62 -  in_bounds :: "int \<Rightarrow> int \<Rightarrow> bool"            ("(_/ in'_bounds _)" [50, 51] 50)
   52.63 +definition in_bounds :: "int \<Rightarrow> int \<Rightarrow> bool" ("(_/ in'_bounds _)" [50, 51] 50) where
   52.64   "i in_bounds k \<equiv> 0 \<le> i \<and> i < k"
   52.65  
   52.66 -  arr_comps :: "'a \<Rightarrow> int \<Rightarrow> int \<Rightarrow> 'a option"
   52.67 +definition arr_comps :: "'a \<Rightarrow> int \<Rightarrow> int \<Rightarrow> 'a option" where
   52.68   "arr_comps T k \<equiv> \<lambda>i. if i in_bounds k then Some T else None"
   52.69    
   52.70 -  var_tys       :: "prog \<Rightarrow> obj_tag \<Rightarrow> oref \<Rightarrow> (vn, ty) table"
   52.71 +definition var_tys       :: "prog \<Rightarrow> obj_tag \<Rightarrow> oref \<Rightarrow> (vn, ty) table" where
   52.72  "var_tys G oi r 
   52.73    \<equiv> case r of 
   52.74        Heap a \<Rightarrow> (case oi of 
   52.75 @@ -232,15 +222,13 @@
   52.76  
   52.77  subsection "access"
   52.78  
   52.79 -constdefs
   52.80 -
   52.81 -  globs  :: "st \<Rightarrow> globs"
   52.82 +definition globs :: "st \<Rightarrow> globs" where
   52.83   "globs  \<equiv> st_case (\<lambda>g l. g)"
   52.84    
   52.85 -  locals :: "st \<Rightarrow> locals"
   52.86 +definition locals :: "st \<Rightarrow> locals" where
   52.87   "locals \<equiv> st_case (\<lambda>g l. l)"
   52.88  
   52.89 -  heap   :: "st \<Rightarrow> heap"
   52.90 +definition heap   :: "st \<Rightarrow> heap" where
   52.91   "heap s \<equiv> globs s \<circ> Heap"
   52.92  
   52.93  
   52.94 @@ -262,8 +250,7 @@
   52.95  
   52.96  subsection "memory allocation"
   52.97  
   52.98 -constdefs
   52.99 -  new_Addr     :: "heap \<Rightarrow> loc option"
  52.100 +definition new_Addr :: "heap \<Rightarrow> loc option" where
  52.101   "new_Addr h   \<equiv> if (\<forall>a. h a \<noteq> None) then None else Some (SOME a. h a = None)"
  52.102  
  52.103  lemma new_AddrD: "new_Addr h = Some a \<Longrightarrow> h a = None"
  52.104 @@ -303,20 +290,19 @@
  52.105  
  52.106  subsection "update"
  52.107  
  52.108 -constdefs
  52.109 -  gupd       :: "oref  \<Rightarrow> obj \<Rightarrow> st \<Rightarrow> st"        ("gupd'(_\<mapsto>_')"[10,10]1000)
  52.110 +definition gupd :: "oref  \<Rightarrow> obj \<Rightarrow> st \<Rightarrow> st" ("gupd'(_\<mapsto>_')"[10,10]1000) where
  52.111   "gupd r obj  \<equiv> st_case (\<lambda>g l. st (g(r\<mapsto>obj)) l)"
  52.112  
  52.113 -  lupd       :: "lname \<Rightarrow> val \<Rightarrow> st \<Rightarrow> st"        ("lupd'(_\<mapsto>_')"[10,10]1000)
  52.114 +definition lupd       :: "lname \<Rightarrow> val \<Rightarrow> st \<Rightarrow> st" ("lupd'(_\<mapsto>_')"[10,10]1000) where
  52.115   "lupd vn v   \<equiv> st_case (\<lambda>g l. st g (l(vn\<mapsto>v)))"
  52.116  
  52.117 -  upd_gobj   :: "oref \<Rightarrow> vn \<Rightarrow> val \<Rightarrow> st \<Rightarrow> st"
  52.118 +definition upd_gobj   :: "oref \<Rightarrow> vn \<Rightarrow> val \<Rightarrow> st \<Rightarrow> st" where
  52.119   "upd_gobj r n v \<equiv> st_case (\<lambda>g l. st (chg_map (upd_obj n v) r g) l)"
  52.120  
  52.121 -  set_locals  :: "locals \<Rightarrow> st \<Rightarrow> st"
  52.122 +definition set_locals  :: "locals \<Rightarrow> st \<Rightarrow> st" where
  52.123   "set_locals l \<equiv> st_case (\<lambda>g l'. st g l)"
  52.124  
  52.125 -  init_obj    :: "prog \<Rightarrow> obj_tag \<Rightarrow> oref \<Rightarrow> st \<Rightarrow> st"
  52.126 +definition init_obj    :: "prog \<Rightarrow> obj_tag \<Rightarrow> oref \<Rightarrow> st \<Rightarrow> st" where
  52.127   "init_obj G oi r \<equiv> gupd(r\<mapsto>\<lparr>tag=oi, values=init_vals (var_tys G oi r)\<rparr>)"
  52.128  
  52.129  abbreviation
  52.130 @@ -476,8 +462,7 @@
  52.131  
  52.132          
  52.133  
  52.134 -constdefs
  52.135 -  abrupt_if    :: "bool \<Rightarrow> abopt \<Rightarrow> abopt \<Rightarrow> abopt"
  52.136 +definition abrupt_if :: "bool \<Rightarrow> abopt \<Rightarrow> abopt \<Rightarrow> abopt" where
  52.137   "abrupt_if c x' x \<equiv> if c \<and> (x = None) then x' else x"
  52.138  
  52.139  lemma abrupt_if_True_None [simp]: "abrupt_if True x None = x"
  52.140 @@ -557,8 +542,7 @@
  52.141  apply auto
  52.142  done
  52.143  
  52.144 -constdefs
  52.145 -   absorb :: "jump \<Rightarrow> abopt \<Rightarrow> abopt"
  52.146 +definition absorb :: "jump \<Rightarrow> abopt \<Rightarrow> abopt" where
  52.147    "absorb j a \<equiv> if a=Some (Jump j) then None else a"
  52.148  
  52.149  lemma absorb_SomeD [dest!]: "absorb j a = Some x \<Longrightarrow> a = Some x"
  52.150 @@ -611,9 +595,7 @@
  52.151  apply clarsimp
  52.152  done
  52.153  
  52.154 -constdefs
  52.155 -
  52.156 -  normal     :: "state \<Rightarrow> bool"
  52.157 +definition normal :: "state \<Rightarrow> bool" where
  52.158   "normal \<equiv> \<lambda>s. abrupt s = None"
  52.159  
  52.160  lemma normal_def2 [simp]: "normal s = (abrupt s = None)"
  52.161 @@ -621,8 +603,7 @@
  52.162  apply (simp (no_asm))
  52.163  done
  52.164  
  52.165 -constdefs
  52.166 -  heap_free :: "nat \<Rightarrow> state \<Rightarrow> bool"
  52.167 +definition heap_free :: "nat \<Rightarrow> state \<Rightarrow> bool" where
  52.168   "heap_free n \<equiv> \<lambda>s. atleast_free (heap (store s)) n"
  52.169  
  52.170  lemma heap_free_def2 [simp]: "heap_free n s = atleast_free (heap (store s)) n"
  52.171 @@ -632,12 +613,10 @@
  52.172  
  52.173  subsection "update"
  52.174  
  52.175 -constdefs
  52.176 - 
  52.177 -  abupd     :: "(abopt \<Rightarrow> abopt) \<Rightarrow> state \<Rightarrow> state"
  52.178 +definition abupd :: "(abopt \<Rightarrow> abopt) \<Rightarrow> state \<Rightarrow> state" where
  52.179   "abupd f \<equiv> prod_fun f id"
  52.180  
  52.181 -  supd     :: "(st \<Rightarrow> st) \<Rightarrow> state \<Rightarrow> state" 
  52.182 +definition supd     :: "(st \<Rightarrow> st) \<Rightarrow> state \<Rightarrow> state" where
  52.183   "supd \<equiv> prod_fun id"
  52.184    
  52.185  lemma abupd_def2 [simp]: "abupd f (x,s) = (f x,s)"
  52.186 @@ -692,12 +671,10 @@
  52.187  
  52.188  section "initialisation test"
  52.189  
  52.190 -constdefs
  52.191 -
  52.192 -  inited   :: "qtname \<Rightarrow> globs \<Rightarrow> bool"
  52.193 +definition inited :: "qtname \<Rightarrow> globs \<Rightarrow> bool" where
  52.194   "inited C g \<equiv> g (Stat C) \<noteq> None"
  52.195  
  52.196 -  initd    :: "qtname \<Rightarrow> state \<Rightarrow> bool"
  52.197 +definition initd    :: "qtname \<Rightarrow> state \<Rightarrow> bool" where
  52.198   "initd C \<equiv> inited C \<circ> globs \<circ> store"
  52.199  
  52.200  lemma not_inited_empty [simp]: "\<not>inited C empty"
  52.201 @@ -731,7 +708,7 @@
  52.202  done
  52.203  
  52.204  section {* @{text error_free} *}
  52.205 -constdefs error_free:: "state \<Rightarrow> bool"
  52.206 +definition error_free :: "state \<Rightarrow> bool" where
  52.207  "error_free s \<equiv> \<not> (\<exists> err. abrupt s = Some (Error err))"
  52.208  
  52.209  lemma error_free_Norm [simp,intro]: "error_free (Norm s)"
    53.1 --- a/src/HOL/Bali/Table.thy	Wed Feb 24 11:55:52 2010 +0100
    53.2 +++ b/src/HOL/Bali/Table.thy	Mon Mar 01 13:40:23 2010 +0100
    53.3 @@ -53,9 +53,7 @@
    53.4  by (simp add: map_add_def)
    53.5  
    53.6  section {* Conditional Override *}
    53.7 -constdefs
    53.8 -cond_override:: 
    53.9 -  "('b \<Rightarrow>'b \<Rightarrow> bool) \<Rightarrow> ('a, 'b)table \<Rightarrow> ('a, 'b)table \<Rightarrow> ('a, 'b) table"
   53.10 +definition cond_override :: "('b \<Rightarrow>'b \<Rightarrow> bool) \<Rightarrow> ('a, 'b)table \<Rightarrow> ('a, 'b)table \<Rightarrow> ('a, 'b) table" where
   53.11  
   53.12  --{* when merging tables old and new, only override an entry of table old when  
   53.13     the condition cond holds *}
   53.14 @@ -100,8 +98,7 @@
   53.15  
   53.16  section {* Filter on Tables *}
   53.17  
   53.18 -constdefs
   53.19 -filter_tab:: "('a \<Rightarrow> 'b \<Rightarrow> bool) \<Rightarrow> ('a, 'b) table \<Rightarrow> ('a, 'b) table"
   53.20 +definition filter_tab :: "('a \<Rightarrow> 'b \<Rightarrow> bool) \<Rightarrow> ('a, 'b) table \<Rightarrow> ('a, 'b) table" where
   53.21  "filter_tab c t \<equiv> \<lambda> k. (case t k of 
   53.22                             None   \<Rightarrow> None
   53.23                           | Some x \<Rightarrow> if c k x then Some x else None)"
    54.1 --- a/src/HOL/Bali/Term.thy	Wed Feb 24 11:55:52 2010 +0100
    54.2 +++ b/src/HOL/Bali/Term.thy	Mon Mar 01 13:40:23 2010 +0100
    54.3 @@ -261,9 +261,7 @@
    54.4    StatRef :: "ref_ty \<Rightarrow> expr"
    54.5    where "StatRef rt == Cast (RefT rt) (Lit Null)"
    54.6    
    54.7 -constdefs
    54.8 -
    54.9 -  is_stmt :: "term \<Rightarrow> bool"
   54.10 +definition is_stmt :: "term \<Rightarrow> bool" where
   54.11   "is_stmt t \<equiv> \<exists>c. t=In1r c"
   54.12  
   54.13  ML {* bind_thms ("is_stmt_rews", sum3_instantiate @{context} @{thm is_stmt_def}) *}
   54.14 @@ -467,7 +465,7 @@
   54.15  "eval_binop CondAnd v1 v2 = Bool ((the_Bool v1) \<and> (the_Bool v2))"
   54.16  "eval_binop CondOr  v1 v2 = Bool ((the_Bool v1) \<or> (the_Bool v2))"
   54.17  
   54.18 -constdefs need_second_arg :: "binop \<Rightarrow> val \<Rightarrow> bool"
   54.19 +definition need_second_arg :: "binop \<Rightarrow> val \<Rightarrow> bool" where
   54.20  "need_second_arg binop v1 \<equiv> \<not> ((binop=CondAnd \<and>  \<not> the_Bool v1) \<or>
   54.21                                 (binop=CondOr  \<and> the_Bool v1))"
   54.22  text {* @{term CondAnd} and @{term CondOr} only evalulate the second argument
    55.1 --- a/src/HOL/Bali/Trans.thy	Wed Feb 24 11:55:52 2010 +0100
    55.2 +++ b/src/HOL/Bali/Trans.thy	Mon Mar 01 13:40:23 2010 +0100
    55.3 @@ -9,7 +9,7 @@
    55.4  
    55.5  theory Trans imports Evaln begin
    55.6  
    55.7 -constdefs groundVar:: "var \<Rightarrow> bool"
    55.8 +definition groundVar :: "var \<Rightarrow> bool" where
    55.9  "groundVar v \<equiv> (case v of
   55.10                     LVar ln \<Rightarrow> True
   55.11                   | {accC,statDeclC,stat}e..fn \<Rightarrow> \<exists> a. e=Lit a
   55.12 @@ -34,7 +34,7 @@
   55.13      done
   55.14  qed
   55.15  
   55.16 -constdefs groundExprs:: "expr list \<Rightarrow> bool"
   55.17 +definition groundExprs :: "expr list \<Rightarrow> bool" where
   55.18  "groundExprs es \<equiv> list_all (\<lambda> e. \<exists> v. e=Lit v) es"
   55.19    
   55.20  consts the_val:: "expr \<Rightarrow> val"
    56.1 --- a/src/HOL/Bali/Type.thy	Wed Feb 24 11:55:52 2010 +0100
    56.2 +++ b/src/HOL/Bali/Type.thy	Mon Mar 01 13:40:23 2010 +0100
    56.3 @@ -41,8 +41,7 @@
    56.4  abbreviation Array :: "ty \<Rightarrow> ty"  ("_.[]" [90] 90)
    56.5    where "T.[] == RefT (ArrayT T)"
    56.6  
    56.7 -constdefs
    56.8 -  the_Class :: "ty \<Rightarrow> qtname"
    56.9 +definition the_Class :: "ty \<Rightarrow> qtname" where
   56.10   "the_Class T \<equiv> SOME C. T = Class C" (** primrec not possible here **)
   56.11   
   56.12  lemma the_Class_eq [simp]: "the_Class (Class C)= C"
    57.1 --- a/src/HOL/Bali/TypeRel.thy	Wed Feb 24 11:55:52 2010 +0100
    57.2 +++ b/src/HOL/Bali/TypeRel.thy	Mon Mar 01 13:40:23 2010 +0100
    57.3 @@ -65,7 +65,7 @@
    57.4  done
    57.5  
    57.6  lemma subcls1I1:
    57.7 - "\<lbrakk>class G C = Some c; C \<noteq> Object;D=super c\<rbrakk> \<Longrightarrow> G\<turnstile>C\<prec>\<^sub>C\<^sub>1 D"
    57.8 + "\<lbrakk>class G C = Some c; C \<noteq> Object;D=super c\<rbrakk> \<Longrightarrow> G\<turnstile>C\<prec>\<^sub>C1 D"
    57.9  apply (auto dest: subcls1I)
   57.10  done
   57.11  
   57.12 @@ -126,7 +126,7 @@
   57.13  done
   57.14  
   57.15  lemma single_inheritance: 
   57.16 -"\<lbrakk>G\<turnstile>A \<prec>\<^sub>C\<^sub>1 B; G\<turnstile>A \<prec>\<^sub>C\<^sub>1 C\<rbrakk> \<Longrightarrow> B = C"
   57.17 +"\<lbrakk>G\<turnstile>A \<prec>\<^sub>C1 B; G\<turnstile>A \<prec>\<^sub>C1 C\<rbrakk> \<Longrightarrow> B = C"
   57.18  by (auto simp add: subcls1_def)
   57.19    
   57.20  lemma subcls_compareable:
   57.21 @@ -134,11 +134,11 @@
   57.22   \<rbrakk> \<Longrightarrow> G\<turnstile>X \<preceq>\<^sub>C Y \<or> G\<turnstile>Y \<preceq>\<^sub>C X"
   57.23  by (rule triangle_lemma)  (auto intro: single_inheritance) 
   57.24  
   57.25 -lemma subcls1_irrefl: "\<lbrakk>G\<turnstile>C \<prec>\<^sub>C\<^sub>1 D; ws_prog G \<rbrakk>
   57.26 +lemma subcls1_irrefl: "\<lbrakk>G\<turnstile>C \<prec>\<^sub>C1 D; ws_prog G \<rbrakk>
   57.27   \<Longrightarrow> C \<noteq> D"
   57.28  proof 
   57.29    assume ws: "ws_prog G" and
   57.30 -    subcls1: "G\<turnstile>C \<prec>\<^sub>C\<^sub>1 D" and
   57.31 +    subcls1: "G\<turnstile>C \<prec>\<^sub>C1 D" and
   57.32       eq_C_D: "C=D"
   57.33    from subcls1 obtain c 
   57.34      where
   57.35 @@ -167,7 +167,7 @@
   57.36    then show ?thesis
   57.37    proof (induct rule: converse_trancl_induct)
   57.38      fix C
   57.39 -    assume subcls1_C_D: "G\<turnstile>C \<prec>\<^sub>C\<^sub>1 D"
   57.40 +    assume subcls1_C_D: "G\<turnstile>C \<prec>\<^sub>C1 D"
   57.41      then obtain c  where
   57.42          "C\<noteq>Object" and
   57.43          "class G C = Some c" and
   57.44 @@ -178,7 +178,7 @@
   57.45        by (auto dest: ws_prog_cdeclD)
   57.46    next
   57.47      fix C Z
   57.48 -    assume subcls1_C_Z: "G\<turnstile>C \<prec>\<^sub>C\<^sub>1 Z" and
   57.49 +    assume subcls1_C_Z: "G\<turnstile>C \<prec>\<^sub>C1 Z" and
   57.50              subcls_Z_D: "G\<turnstile>Z \<prec>\<^sub>C D" and
   57.51             nsubcls_D_Z: "\<not> G\<turnstile>D \<prec>\<^sub>C Z"
   57.52      show "\<not> G\<turnstile>D \<prec>\<^sub>C C"
   57.53 @@ -213,13 +213,13 @@
   57.54    then show ?thesis
   57.55    proof (induct rule: converse_trancl_induct)
   57.56      fix C
   57.57 -    assume "G\<turnstile>C \<prec>\<^sub>C\<^sub>1 D"
   57.58 +    assume "G\<turnstile>C \<prec>\<^sub>C1 D"
   57.59      with ws 
   57.60      show "C\<noteq>D" 
   57.61        by (blast dest: subcls1_irrefl)
   57.62    next
   57.63      fix C Z
   57.64 -    assume subcls1_C_Z: "G\<turnstile>C \<prec>\<^sub>C\<^sub>1 Z" and
   57.65 +    assume subcls1_C_Z: "G\<turnstile>C \<prec>\<^sub>C1 Z" and
   57.66              subcls_Z_D: "G\<turnstile>Z \<prec>\<^sub>C D" and
   57.67                 neq_Z_D: "Z \<noteq> D"
   57.68      show "C\<noteq>D"
   57.69 @@ -298,7 +298,7 @@
   57.70    assume       clsC: "class G C = Some c"
   57.71    assume subcls_C_C: "G\<turnstile>C \<prec>\<^sub>C D"
   57.72    then obtain S where 
   57.73 -                  "G\<turnstile>C \<prec>\<^sub>C\<^sub>1 S" and
   57.74 +                  "G\<turnstile>C \<prec>\<^sub>C1 S" and
   57.75      subclseq_S_D: "G\<turnstile>S \<preceq>\<^sub>C D"
   57.76      by (blast dest: tranclD)
   57.77    with clsC 
   57.78 @@ -341,9 +341,9 @@
   57.79  where
   57.80    direct:         "G\<turnstile>C\<leadsto>1J     \<spacespace>\<spacespace>     \<Longrightarrow> G\<turnstile>C\<leadsto>J"
   57.81  | subint:        "\<lbrakk>G\<turnstile>C\<leadsto>1I; G\<turnstile>I\<preceq>I J\<rbrakk>  \<Longrightarrow> G\<turnstile>C\<leadsto>J"
   57.82 -| subcls1:       "\<lbrakk>G\<turnstile>C\<prec>\<^sub>C\<^sub>1D; G\<turnstile>D\<leadsto>J \<rbrakk>  \<Longrightarrow> G\<turnstile>C\<leadsto>J"
   57.83 +| subcls1:       "\<lbrakk>G\<turnstile>C\<prec>\<^sub>C1D; G\<turnstile>D\<leadsto>J \<rbrakk>  \<Longrightarrow> G\<turnstile>C\<leadsto>J"
   57.84  
   57.85 -lemma implmtD: "G\<turnstile>C\<leadsto>J \<Longrightarrow> (\<exists>I. G\<turnstile>C\<leadsto>1I \<and> G\<turnstile>I\<preceq>I J) \<or> (\<exists>D. G\<turnstile>C\<prec>\<^sub>C\<^sub>1D \<and> G\<turnstile>D\<leadsto>J)" 
   57.86 +lemma implmtD: "G\<turnstile>C\<leadsto>J \<Longrightarrow> (\<exists>I. G\<turnstile>C\<leadsto>1I \<and> G\<turnstile>I\<preceq>I J) \<or> (\<exists>D. G\<turnstile>C\<prec>\<^sub>C1D \<and> G\<turnstile>D\<leadsto>J)" 
   57.87  apply (erule implmt.induct)
   57.88  apply fast+
   57.89  done
   57.90 @@ -568,8 +568,7 @@
   57.91  apply (fast dest: widen_Class_Class widen_Class_Iface)
   57.92  done
   57.93  
   57.94 -constdefs
   57.95 -  widens :: "prog \<Rightarrow> [ty list, ty list] \<Rightarrow> bool" ("_\<turnstile>_[\<preceq>]_" [71,71,71] 70)
   57.96 +definition widens :: "prog \<Rightarrow> [ty list, ty list] \<Rightarrow> bool" ("_\<turnstile>_[\<preceq>]_" [71,71,71] 70) where
   57.97   "G\<turnstile>Ts[\<preceq>]Ts' \<equiv> list_all2 (\<lambda>T T'. G\<turnstile>T\<preceq>T') Ts Ts'"
   57.98  
   57.99  lemma widens_Nil [simp]: "G\<turnstile>[][\<preceq>][]"
    58.1 --- a/src/HOL/Bali/TypeSafe.thy	Wed Feb 24 11:55:52 2010 +0100
    58.2 +++ b/src/HOL/Bali/TypeSafe.thy	Mon Mar 01 13:40:23 2010 +0100
    58.3 @@ -95,17 +95,13 @@
    58.4  
    58.5  section "result conformance"
    58.6  
    58.7 -constdefs
    58.8 -  assign_conforms :: "st \<Rightarrow> (val \<Rightarrow> state \<Rightarrow> state) \<Rightarrow> ty \<Rightarrow> env' \<Rightarrow> bool"
    58.9 -          ("_\<le>|_\<preceq>_\<Colon>\<preceq>_"                                        [71,71,71,71] 70)
   58.10 +definition assign_conforms :: "st \<Rightarrow> (val \<Rightarrow> state \<Rightarrow> state) \<Rightarrow> ty \<Rightarrow> env' \<Rightarrow> bool" ("_\<le>|_\<preceq>_\<Colon>\<preceq>_" [71,71,71,71] 70) where
   58.11  "s\<le>|f\<preceq>T\<Colon>\<preceq>E \<equiv>
   58.12   (\<forall>s' w. Norm s'\<Colon>\<preceq>E \<longrightarrow> fst E,s'\<turnstile>w\<Colon>\<preceq>T \<longrightarrow> s\<le>|s' \<longrightarrow> assign f w (Norm s')\<Colon>\<preceq>E) \<and>
   58.13   (\<forall>s' w. error_free s' \<longrightarrow> (error_free (assign f w s')))"      
   58.14  
   58.15  
   58.16 -constdefs
   58.17 -  rconf :: "prog \<Rightarrow> lenv \<Rightarrow> st \<Rightarrow> term \<Rightarrow> vals \<Rightarrow> tys \<Rightarrow> bool"
   58.18 -          ("_,_,_\<turnstile>_\<succ>_\<Colon>\<preceq>_"                               [71,71,71,71,71,71] 70)
   58.19 +definition rconf :: "prog \<Rightarrow> lenv \<Rightarrow> st \<Rightarrow> term \<Rightarrow> vals \<Rightarrow> tys \<Rightarrow> bool" ("_,_,_\<turnstile>_\<succ>_\<Colon>\<preceq>_" [71,71,71,71,71,71] 70) where
   58.20    "G,L,s\<turnstile>t\<succ>v\<Colon>\<preceq>T 
   58.21      \<equiv> case T of
   58.22          Inl T  \<Rightarrow> if (\<exists> var. t=In2 var)
   58.23 @@ -330,11 +326,8 @@
   58.24  
   58.25  declare fun_upd_apply [simp del]
   58.26  
   58.27 -
   58.28 -constdefs
   58.29 -  DynT_prop::"[prog,inv_mode,qtname,ref_ty] \<Rightarrow> bool" 
   58.30 -                                              ("_\<turnstile>_\<rightarrow>_\<preceq>_"[71,71,71,71]70)
   58.31 - "G\<turnstile>mode\<rightarrow>D\<preceq>t \<equiv> mode = IntVir \<longrightarrow> is_class G D \<and> 
   58.32 +definition DynT_prop :: "[prog,inv_mode,qtname,ref_ty] \<Rightarrow> bool" ("_\<turnstile>_\<rightarrow>_\<preceq>_"[71,71,71,71]70) where
   58.33 +  "G\<turnstile>mode\<rightarrow>D\<preceq>t \<equiv> mode = IntVir \<longrightarrow> is_class G D \<and> 
   58.34                       (if (\<exists>T. t=ArrayT T) then D=Object else G\<turnstile>Class D\<preceq>RefT t)"
   58.35  
   58.36  lemma DynT_propI: 
    59.1 --- a/src/HOL/Bali/WellForm.thy	Wed Feb 24 11:55:52 2010 +0100
    59.2 +++ b/src/HOL/Bali/WellForm.thy	Mon Mar 01 13:40:23 2010 +0100
    59.3 @@ -31,8 +31,7 @@
    59.4  text  {* well-formed field declaration (common part for classes and interfaces),
    59.5          cf. 8.3 and (9.3) *}
    59.6  
    59.7 -constdefs
    59.8 -  wf_fdecl :: "prog \<Rightarrow> pname \<Rightarrow> fdecl \<Rightarrow> bool"
    59.9 +definition wf_fdecl :: "prog \<Rightarrow> pname \<Rightarrow> fdecl \<Rightarrow> bool" where
   59.10   "wf_fdecl G P \<equiv> \<lambda>(fn,f). is_acc_type G P (type f)"
   59.11  
   59.12  lemma wf_fdecl_def2: "\<And>fd. wf_fdecl G P fd = is_acc_type G P (type (snd fd))"
   59.13 @@ -55,8 +54,7 @@
   59.14  \item the parameter names are unique
   59.15  \end{itemize} 
   59.16  *}
   59.17 -constdefs
   59.18 -  wf_mhead :: "prog \<Rightarrow> pname \<Rightarrow> sig \<Rightarrow> mhead \<Rightarrow> bool"
   59.19 +definition wf_mhead :: "prog \<Rightarrow> pname \<Rightarrow> sig \<Rightarrow> mhead \<Rightarrow> bool" where
   59.20   "wf_mhead G P \<equiv> \<lambda> sig mh. length (parTs sig) = length (pars mh) \<and>
   59.21                              \<spacespace> ( \<forall>T\<in>set (parTs sig). is_acc_type G P T) \<and> 
   59.22                              is_acc_type G P (resTy mh) \<and>
   59.23 @@ -78,7 +76,7 @@
   59.24  \end{itemize}
   59.25  *}
   59.26  
   59.27 -constdefs callee_lcl:: "qtname \<Rightarrow> sig \<Rightarrow> methd \<Rightarrow> lenv"
   59.28 +definition callee_lcl :: "qtname \<Rightarrow> sig \<Rightarrow> methd \<Rightarrow> lenv" where
   59.29  "callee_lcl C sig m 
   59.30   \<equiv> \<lambda> k. (case k of
   59.31              EName e 
   59.32 @@ -88,12 +86,11 @@
   59.33                  | Res \<Rightarrow> Some (resTy m))
   59.34            | This \<Rightarrow> if is_static m then None else Some (Class C))"
   59.35  
   59.36 -constdefs parameters :: "methd \<Rightarrow> lname set"
   59.37 +definition parameters :: "methd \<Rightarrow> lname set" where
   59.38  "parameters m \<equiv>  set (map (EName \<circ> VNam) (pars m)) 
   59.39                    \<union> (if (static m) then {} else {This})"
   59.40  
   59.41 -constdefs
   59.42 -  wf_mdecl :: "prog \<Rightarrow> qtname \<Rightarrow> mdecl \<Rightarrow> bool"
   59.43 +definition wf_mdecl :: "prog \<Rightarrow> qtname \<Rightarrow> mdecl \<Rightarrow> bool" where
   59.44   "wf_mdecl G C \<equiv> 
   59.45        \<lambda>(sig,m).
   59.46            wf_mhead G (pid C) sig (mhead m) \<and> 
   59.47 @@ -219,8 +216,7 @@
   59.48        superinterfaces widens to each of the corresponding result types
   59.49  \end{itemize}
   59.50  *}
   59.51 -constdefs
   59.52 -  wf_idecl :: "prog  \<Rightarrow> idecl \<Rightarrow> bool"
   59.53 +definition wf_idecl :: "prog  \<Rightarrow> idecl \<Rightarrow> bool" where
   59.54   "wf_idecl G \<equiv> 
   59.55      \<lambda>(I,i). 
   59.56          ws_idecl G I (isuperIfs i) \<and> 
   59.57 @@ -321,8 +317,7 @@
   59.58  \end{itemize}
   59.59  *}
   59.60  (* to Table *)
   59.61 -constdefs entails:: "('a,'b) table \<Rightarrow> ('b \<Rightarrow> bool) \<Rightarrow> bool"
   59.62 -                                 ("_ entails _" 20)
   59.63 +definition entails :: "('a,'b) table \<Rightarrow> ('b \<Rightarrow> bool) \<Rightarrow> bool" ("_ entails _" 20) where
   59.64  "t entails P \<equiv> \<forall>k. \<forall> x \<in> t k: P x"
   59.65  
   59.66  lemma entailsD:
   59.67 @@ -332,8 +327,7 @@
   59.68  lemma empty_entails[simp]: "empty entails P"
   59.69  by (simp add: entails_def)
   59.70  
   59.71 -constdefs
   59.72 - wf_cdecl :: "prog \<Rightarrow> cdecl \<Rightarrow> bool"
   59.73 +definition wf_cdecl :: "prog \<Rightarrow> cdecl \<Rightarrow> bool" where
   59.74  "wf_cdecl G \<equiv> 
   59.75     \<lambda>(C,c).
   59.76        \<not>is_iface G C \<and>
   59.77 @@ -361,8 +355,7 @@
   59.78              ))"
   59.79  
   59.80  (*
   59.81 -constdefs
   59.82 - wf_cdecl :: "prog \<Rightarrow> cdecl \<Rightarrow> bool"
   59.83 +definition wf_cdecl :: "prog \<Rightarrow> cdecl \<Rightarrow> bool" where
   59.84  "wf_cdecl G \<equiv> 
   59.85     \<lambda>(C,c).
   59.86        \<not>is_iface G C \<and>
   59.87 @@ -518,8 +511,7 @@
   59.88  \item all defined classes are wellformed
   59.89  \end{itemize}
   59.90  *}
   59.91 -constdefs
   59.92 -  wf_prog  :: "prog \<Rightarrow> bool"
   59.93 +definition wf_prog :: "prog \<Rightarrow> bool" where
   59.94   "wf_prog G \<equiv> let is = ifaces G; cs = classes G in
   59.95                   ObjectC \<in> set cs \<and> 
   59.96                  (\<forall> m\<in>set Object_mdecls. accmodi m \<noteq> Package) \<and>
   59.97 @@ -919,7 +911,7 @@
   59.98       inheritable: "G \<turnstile>Method old inheritable_in pid C" and
   59.99           subclsC: "G\<turnstile>C\<prec>\<^sub>C declclass old"
  59.100      from cls_C neq_C_Obj  
  59.101 -    have super: "G\<turnstile>C \<prec>\<^sub>C\<^sub>1 super c" 
  59.102 +    have super: "G\<turnstile>C \<prec>\<^sub>C1 super c" 
  59.103        by (rule subcls1I)
  59.104      from wf cls_C neq_C_Obj
  59.105      have accessible_super: "G\<turnstile>(Class (super c)) accessible_in (pid C)" 
  59.106 @@ -1385,7 +1377,7 @@
  59.107        moreover note wf False cls_C  
  59.108        ultimately have "G\<turnstile>super c \<preceq>\<^sub>C declclass m"  
  59.109          by (auto intro: Hyp [rule_format])
  59.110 -      moreover from cls_C False have  "G\<turnstile>C \<prec>\<^sub>C\<^sub>1 super c" by (rule subcls1I)
  59.111 +      moreover from cls_C False have  "G\<turnstile>C \<prec>\<^sub>C1 super c" by (rule subcls1I)
  59.112        ultimately show ?thesis by - (rule rtrancl_into_rtrancl2)
  59.113      next
  59.114        case Some
  59.115 @@ -1539,7 +1531,7 @@
  59.116      by (auto intro: method_declared_inI)
  59.117    note trancl_rtrancl_tranc = trancl_rtrancl_trancl [trans] (* ### in Basis *)
  59.118    from clsC neq_C_Obj
  59.119 -  have subcls1_C_super: "G\<turnstile>C \<prec>\<^sub>C\<^sub>1 super c"
  59.120 +  have subcls1_C_super: "G\<turnstile>C \<prec>\<^sub>C1 super c"
  59.121      by (rule subcls1I)
  59.122    then have "G\<turnstile>C \<prec>\<^sub>C super c" ..
  59.123    also from old wf is_cls_super
  59.124 @@ -1609,7 +1601,7 @@
  59.125        by (auto dest: ws_prog_cdeclD)
  59.126      from clsC wf neq_C_Obj 
  59.127      have superAccessible: "G\<turnstile>(Class (super c)) accessible_in (pid C)" and
  59.128 -         subcls1_C_super: "G\<turnstile>C \<prec>\<^sub>C\<^sub>1 super c"
  59.129 +         subcls1_C_super: "G\<turnstile>C \<prec>\<^sub>C1 super c"
  59.130        by (auto dest: wf_prog_cdecl wf_cdecl_supD is_acc_classD
  59.131                intro: subcls1I)
  59.132      show "\<exists>new. ?Constraint C new old"
    60.1 --- a/src/HOL/Bali/WellType.thy	Wed Feb 24 11:55:52 2010 +0100
    60.2 +++ b/src/HOL/Bali/WellType.thy	Mon Mar 01 13:40:23 2010 +0100
    60.3 @@ -53,11 +53,10 @@
    60.4    emhead = "ref_ty \<times> mhead"
    60.5  
    60.6  --{* Some mnemotic selectors for emhead *}
    60.7 -constdefs 
    60.8 -  "declrefT" :: "emhead \<Rightarrow> ref_ty"
    60.9 +definition "declrefT" :: "emhead \<Rightarrow> ref_ty" where
   60.10    "declrefT \<equiv> fst"
   60.11  
   60.12 -  "mhd"     :: "emhead \<Rightarrow> mhead"
   60.13 +definition "mhd"     :: "emhead \<Rightarrow> mhead" where
   60.14    "mhd \<equiv> snd"
   60.15  
   60.16  lemma declrefT_simp[simp]:"declrefT (r,m) = r"
   60.17 @@ -138,11 +137,10 @@
   60.18  done
   60.19  
   60.20  
   60.21 -constdefs
   60.22 -  empty_dt :: "dyn_ty"
   60.23 +definition empty_dt :: "dyn_ty" where
   60.24   "empty_dt \<equiv> \<lambda>a. None"
   60.25  
   60.26 -  invmode :: "('a::type)member_scheme \<Rightarrow> expr \<Rightarrow> inv_mode"
   60.27 +definition invmode :: "('a::type)member_scheme \<Rightarrow> expr \<Rightarrow> inv_mode" where
   60.28  "invmode m e \<equiv> if is_static m 
   60.29                    then Static 
   60.30                    else if e=Super then SuperM else IntVir"
    61.1 --- a/src/HOL/Decision_Procs/Cooper.thy	Wed Feb 24 11:55:52 2010 +0100
    61.2 +++ b/src/HOL/Decision_Procs/Cooper.thy	Mon Mar 01 13:40:23 2010 +0100
    61.3 @@ -293,10 +293,10 @@
    61.4  by (induct p, simp_all)
    61.5  
    61.6  
    61.7 -constdefs djf:: "('a \<Rightarrow> fm) \<Rightarrow> 'a \<Rightarrow> fm \<Rightarrow> fm"
    61.8 +definition djf :: "('a \<Rightarrow> fm) \<Rightarrow> 'a \<Rightarrow> fm \<Rightarrow> fm" where
    61.9    "djf f p q \<equiv> (if q=T then T else if q=F then f p else 
   61.10    (let fp = f p in case fp of T \<Rightarrow> T | F \<Rightarrow> q | _ \<Rightarrow> Or (f p) q))"
   61.11 -constdefs evaldjf:: "('a \<Rightarrow> fm) \<Rightarrow> 'a list \<Rightarrow> fm"
   61.12 +definition evaldjf :: "('a \<Rightarrow> fm) \<Rightarrow> 'a list \<Rightarrow> fm" where
   61.13    "evaldjf f ps \<equiv> foldr (djf f) ps F"
   61.14  
   61.15  lemma djf_Or: "Ifm bbs bs (djf f p q) = Ifm bbs bs (Or (f p) q)"
   61.16 @@ -340,7 +340,7 @@
   61.17    thus ?thesis by (simp only: list_all_iff)
   61.18  qed
   61.19  
   61.20 -constdefs DJ :: "(fm \<Rightarrow> fm) \<Rightarrow> fm \<Rightarrow> fm"
   61.21 +definition DJ :: "(fm \<Rightarrow> fm) \<Rightarrow> fm \<Rightarrow> fm" where
   61.22    "DJ f p \<equiv> evaldjf f (disjuncts p)"
   61.23  
   61.24  lemma DJ: assumes fdj: "\<forall> p q. f (Or p q) = Or (f p) (f q)"
   61.25 @@ -395,7 +395,7 @@
   61.26    "lex_ns ([], ms) = True"
   61.27    "lex_ns (ns, []) = False"
   61.28    "lex_ns (n#ns, m#ms) = (n<m \<or> ((n = m) \<and> lex_ns (ns,ms))) "
   61.29 -constdefs lex_bnd :: "num \<Rightarrow> num \<Rightarrow> bool"
   61.30 +definition lex_bnd :: "num \<Rightarrow> num \<Rightarrow> bool" where
   61.31    "lex_bnd t s \<equiv> lex_ns (bnds t, bnds s)"
   61.32  
   61.33  consts
   61.34 @@ -455,10 +455,10 @@
   61.35  lemma nummul_nb: "\<And> i. numbound0 t \<Longrightarrow> numbound0 (nummul i t)"
   61.36  by (induct t rule: nummul.induct, auto simp add: numadd_nb)
   61.37  
   61.38 -constdefs numneg :: "num \<Rightarrow> num"
   61.39 +definition numneg :: "num \<Rightarrow> num" where
   61.40    "numneg t \<equiv> nummul (- 1) t"
   61.41  
   61.42 -constdefs numsub :: "num \<Rightarrow> num \<Rightarrow> num"
   61.43 +definition numsub :: "num \<Rightarrow> num \<Rightarrow> num" where
   61.44    "numsub s t \<equiv> (if s = t then C 0 else numadd (s, numneg t))"
   61.45  
   61.46  lemma numneg: "Inum bs (numneg t) = Inum bs (Neg t)"
   61.47 @@ -505,7 +505,7 @@
   61.48  lemma not_bn: "bound0 p \<Longrightarrow> bound0 (not p)"
   61.49  by (cases p, auto)
   61.50  
   61.51 -constdefs conj :: "fm \<Rightarrow> fm \<Rightarrow> fm"
   61.52 +definition conj :: "fm \<Rightarrow> fm \<Rightarrow> fm" where
   61.53    "conj p q \<equiv> (if (p = F \<or> q=F) then F else if p=T then q else if q=T then p else And p q)"
   61.54  lemma conj: "Ifm bbs bs (conj p q) = Ifm bbs bs (And p q)"
   61.55  by (cases "p=F \<or> q=F",simp_all add: conj_def) (cases p,simp_all)
   61.56 @@ -515,7 +515,7 @@
   61.57  lemma conj_nb: "\<lbrakk>bound0 p ; bound0 q\<rbrakk> \<Longrightarrow> bound0 (conj p q)"
   61.58  using conj_def by auto 
   61.59  
   61.60 -constdefs disj :: "fm \<Rightarrow> fm \<Rightarrow> fm"
   61.61 +definition disj :: "fm \<Rightarrow> fm \<Rightarrow> fm" where
   61.62    "disj p q \<equiv> (if (p = T \<or> q=T) then T else if p=F then q else if q=F then p else Or p q)"
   61.63  
   61.64  lemma disj: "Ifm bbs bs (disj p q) = Ifm bbs bs (Or p q)"
   61.65 @@ -525,7 +525,7 @@
   61.66  lemma disj_nb: "\<lbrakk>bound0 p ; bound0 q\<rbrakk> \<Longrightarrow> bound0 (disj p q)"
   61.67  using disj_def by auto 
   61.68  
   61.69 -constdefs   imp :: "fm \<Rightarrow> fm \<Rightarrow> fm"
   61.70 +definition imp :: "fm \<Rightarrow> fm \<Rightarrow> fm" where
   61.71    "imp p q \<equiv> (if (p = F \<or> q=T) then T else if p=T then q else if q=F then not p else Imp p q)"
   61.72  lemma imp: "Ifm bbs bs (imp p q) = Ifm bbs bs (Imp p q)"
   61.73  by (cases "p=F \<or> q=T",simp_all add: imp_def,cases p) (simp_all add: not)
   61.74 @@ -534,7 +534,7 @@
   61.75  lemma imp_nb: "\<lbrakk>bound0 p ; bound0 q\<rbrakk> \<Longrightarrow> bound0 (imp p q)"
   61.76  using imp_def by (cases "p=F \<or> q=T",simp_all add: imp_def,cases p) simp_all
   61.77  
   61.78 -constdefs   iff :: "fm \<Rightarrow> fm \<Rightarrow> fm"
   61.79 +definition iff :: "fm \<Rightarrow> fm \<Rightarrow> fm" where
   61.80    "iff p q \<equiv> (if (p = q) then T else if (p = not q \<or> not p = q) then F else 
   61.81         if p=F then not q else if q=F then not p else if p=T then q else if q=T then p else 
   61.82    Iff p q)"
   61.83 @@ -1749,7 +1749,7 @@
   61.84    shows "(\<exists> x. Ifm bbs (x#bs) p) = ((\<exists> j\<in> {1 .. d}. Ifm bbs (j#bs) (minusinf p)) \<or> (\<exists> j\<in> {1.. d}. \<exists> b\<in> (Inum (i#bs)) ` set (\<beta> p). Ifm bbs ((b+j)#bs) p))"
   61.85    using cp_thm[OF lp up dd dp,where i="i"] by auto
   61.86  
   61.87 -constdefs unit:: "fm \<Rightarrow> fm \<times> num list \<times> int"
   61.88 +definition unit :: "fm \<Rightarrow> fm \<times> num list \<times> int" where
   61.89    "unit p \<equiv> (let p' = zlfm p ; l = \<zeta> p' ; q = And (Dvd l (CN 0 1 (C 0))) (a\<beta> p' l); d = \<delta> q;
   61.90               B = remdups (map simpnum (\<beta> q)) ; a = remdups (map simpnum (\<alpha> q))
   61.91               in if length B \<le> length a then (q,B,d) else (mirror q, a,d))"
   61.92 @@ -1814,7 +1814,7 @@
   61.93  qed
   61.94      (* Cooper's Algorithm *)
   61.95  
   61.96 -constdefs cooper :: "fm \<Rightarrow> fm"
   61.97 +definition cooper :: "fm \<Rightarrow> fm" where
   61.98    "cooper p \<equiv> 
   61.99    (let (q,B,d) = unit p; js = iupt 1 d;
  61.100         mq = simpfm (minusinf q);
    62.1 --- a/src/HOL/Decision_Procs/Ferrack.thy	Wed Feb 24 11:55:52 2010 +0100
    62.2 +++ b/src/HOL/Decision_Procs/Ferrack.thy	Mon Mar 01 13:40:23 2010 +0100
    62.3 @@ -169,26 +169,26 @@
    62.4  lemma not[simp]: "Ifm bs (not p) = Ifm bs (NOT p)"
    62.5  by (cases p) auto
    62.6  
    62.7 -constdefs conj :: "fm \<Rightarrow> fm \<Rightarrow> fm"
    62.8 +definition conj :: "fm \<Rightarrow> fm \<Rightarrow> fm" where
    62.9    "conj p q \<equiv> (if (p = F \<or> q=F) then F else if p=T then q else if q=T then p else 
   62.10     if p = q then p else And p q)"
   62.11  lemma conj[simp]: "Ifm bs (conj p q) = Ifm bs (And p q)"
   62.12  by (cases "p=F \<or> q=F",simp_all add: conj_def) (cases p,simp_all)
   62.13  
   62.14 -constdefs disj :: "fm \<Rightarrow> fm \<Rightarrow> fm"
   62.15 +definition disj :: "fm \<Rightarrow> fm \<Rightarrow> fm" where
   62.16    "disj p q \<equiv> (if (p = T \<or> q=T) then T else if p=F then q else if q=F then p 
   62.17         else if p=q then p else Or p q)"
   62.18  
   62.19  lemma disj[simp]: "Ifm bs (disj p q) = Ifm bs (Or p q)"
   62.20  by (cases "p=T \<or> q=T",simp_all add: disj_def) (cases p,simp_all)
   62.21  
   62.22 -constdefs  imp :: "fm \<Rightarrow> fm \<Rightarrow> fm"
   62.23 +definition imp :: "fm \<Rightarrow> fm \<Rightarrow> fm" where
   62.24    "imp p q \<equiv> (if (p = F \<or> q=T \<or> p=q) then T else if p=T then q else if q=F then not p 
   62.25      else Imp p q)"
   62.26  lemma imp[simp]: "Ifm bs (imp p q) = Ifm bs (Imp p q)"
   62.27  by (cases "p=F \<or> q=T",simp_all add: imp_def) 
   62.28  
   62.29 -constdefs   iff :: "fm \<Rightarrow> fm \<Rightarrow> fm"
   62.30 +definition iff :: "fm \<Rightarrow> fm \<Rightarrow> fm" where
   62.31    "iff p q \<equiv> (if (p = q) then T else if (p = NOT q \<or> NOT p = q) then F else 
   62.32         if p=F then not q else if q=F then not p else if p=T then q else if q=T then p else 
   62.33    Iff p q)"
   62.34 @@ -369,10 +369,10 @@
   62.35  lemma bound0_qf: "bound0 p \<Longrightarrow> qfree p"
   62.36  by (induct p, simp_all)
   62.37  
   62.38 -constdefs djf:: "('a \<Rightarrow> fm) \<Rightarrow> 'a \<Rightarrow> fm \<Rightarrow> fm"
   62.39 +definition djf :: "('a \<Rightarrow> fm) \<Rightarrow> 'a \<Rightarrow> fm \<Rightarrow> fm" where
   62.40    "djf f p q \<equiv> (if q=T then T else if q=F then f p else 
   62.41    (let fp = f p in case fp of T \<Rightarrow> T | F \<Rightarrow> q | _ \<Rightarrow> Or (f p) q))"
   62.42 -constdefs evaldjf:: "('a \<Rightarrow> fm) \<Rightarrow> 'a list \<Rightarrow> fm"
   62.43 +definition evaldjf :: "('a \<Rightarrow> fm) \<Rightarrow> 'a list \<Rightarrow> fm" where
   62.44    "evaldjf f ps \<equiv> foldr (djf f) ps F"
   62.45  
   62.46  lemma djf_Or: "Ifm bs (djf f p q) = Ifm bs (Or (f p) q)"
   62.47 @@ -423,7 +423,7 @@
   62.48    thus ?thesis by (simp only: list_all_iff)
   62.49  qed
   62.50  
   62.51 -constdefs DJ :: "(fm \<Rightarrow> fm) \<Rightarrow> fm \<Rightarrow> fm"
   62.52 +definition DJ :: "(fm \<Rightarrow> fm) \<Rightarrow> fm \<Rightarrow> fm" where
   62.53    "DJ f p \<equiv> evaldjf f (disjuncts p)"
   62.54  
   62.55  lemma DJ: assumes fdj: "\<forall> p q. Ifm bs (f (Or p q)) = Ifm bs (Or (f p) (f q))"
   62.56 @@ -653,10 +653,10 @@
   62.57  lemma nummul_nb[simp]: "\<And> i. numbound0 t \<Longrightarrow> numbound0 (nummul t i)"
   62.58  by (induct t rule: nummul.induct, auto )
   62.59  
   62.60 -constdefs numneg :: "num \<Rightarrow> num"
   62.61 +definition numneg :: "num \<Rightarrow> num" where
   62.62    "numneg t \<equiv> nummul t (- 1)"
   62.63  
   62.64 -constdefs numsub :: "num \<Rightarrow> num \<Rightarrow> num"
   62.65 +definition numsub :: "num \<Rightarrow> num \<Rightarrow> num" where
   62.66    "numsub s t \<equiv> (if s = t then C 0 else numadd (s,numneg t))"
   62.67  
   62.68  lemma numneg[simp]: "Inum bs (numneg t) = Inum bs (Neg t)"
   62.69 @@ -724,7 +724,7 @@
   62.70    from maxcoeff_nz[OF nz th] show ?thesis .
   62.71  qed
   62.72  
   62.73 -constdefs simp_num_pair:: "(num \<times> int) \<Rightarrow> num \<times> int"
   62.74 +definition simp_num_pair :: "(num \<times> int) \<Rightarrow> num \<times> int" where
   62.75    "simp_num_pair \<equiv> (\<lambda> (t,n). (if n = 0 then (C 0, 0) else
   62.76     (let t' = simpnum t ; g = numgcd t' in 
   62.77        if g > 1 then (let g' = gcd n g in 
   62.78 @@ -1779,7 +1779,7 @@
   62.79  
   62.80  
   62.81      (* Implement the right hand side of Ferrante and Rackoff's Theorem. *)
   62.82 -constdefs ferrack:: "fm \<Rightarrow> fm"
   62.83 +definition ferrack :: "fm \<Rightarrow> fm" where
   62.84    "ferrack p \<equiv> (let p' = rlfm (simpfm p); mp = minusinf p'; pp = plusinf p'
   62.85                  in if (mp = T \<or> pp = T) then T else 
   62.86                     (let U = remdps(map simp_num_pair 
    63.1 --- a/src/HOL/Decision_Procs/MIR.thy	Wed Feb 24 11:55:52 2010 +0100
    63.2 +++ b/src/HOL/Decision_Procs/MIR.thy	Mon Mar 01 13:40:23 2010 +0100
    63.3 @@ -566,7 +566,7 @@
    63.4    thus ?thesis by (simp only: list_all_iff)
    63.5  qed
    63.6  
    63.7 -constdefs DJ :: "(fm \<Rightarrow> fm) \<Rightarrow> fm \<Rightarrow> fm"
    63.8 +definition DJ :: "(fm \<Rightarrow> fm) \<Rightarrow> fm \<Rightarrow> fm" where
    63.9    "DJ f p \<equiv> evaldjf f (disjuncts p)"
   63.10  
   63.11  lemma DJ: assumes fdj: "\<forall> p q. f (Or p q) = Or (f p) (f q)"
   63.12 @@ -623,7 +623,7 @@
   63.13    "lex_ns ([], ms) = True"
   63.14    "lex_ns (ns, []) = False"
   63.15    "lex_ns (n#ns, m#ms) = (n<m \<or> ((n = m) \<and> lex_ns (ns,ms))) "
   63.16 -constdefs lex_bnd :: "num \<Rightarrow> num \<Rightarrow> bool"
   63.17 +definition lex_bnd :: "num \<Rightarrow> num \<Rightarrow> bool" where
   63.18    "lex_bnd t s \<equiv> lex_ns (bnds t, bnds s)"
   63.19  
   63.20  consts 
   63.21 @@ -873,10 +873,10 @@
   63.22  lemma nummul_nb[simp]: "\<And> i. numbound0 t \<Longrightarrow> numbound0 (nummul t i)"
   63.23  by (induct t rule: nummul.induct, auto)
   63.24  
   63.25 -constdefs numneg :: "num \<Rightarrow> num"
   63.26 +definition numneg :: "num \<Rightarrow> num" where
   63.27    "numneg t \<equiv> nummul t (- 1)"
   63.28  
   63.29 -constdefs numsub :: "num \<Rightarrow> num \<Rightarrow> num"
   63.30 +definition numsub :: "num \<Rightarrow> num \<Rightarrow> num" where
   63.31    "numsub s t \<equiv> (if s = t then C 0 else numadd (s,numneg t))"
   63.32  
   63.33  lemma numneg[simp]: "Inum bs (numneg t) = Inum bs (Neg t)"
   63.34 @@ -1038,7 +1038,7 @@
   63.35    from maxcoeff_nz[OF nz th] show ?thesis .
   63.36  qed
   63.37  
   63.38 -constdefs simp_num_pair:: "(num \<times> int) \<Rightarrow> num \<times> int"
   63.39 +definition simp_num_pair :: "(num \<times> int) \<Rightarrow> num \<times> int" where
   63.40    "simp_num_pair \<equiv> (\<lambda> (t,n). (if n = 0 then (C 0, 0) else
   63.41     (let t' = simpnum t ; g = numgcd t' in 
   63.42        if g > 1 then (let g' = gcd n g in 
   63.43 @@ -1137,7 +1137,7 @@
   63.44  lemma not_nb[simp]: "bound0 p \<Longrightarrow> bound0 (not p)"
   63.45  by (induct p, auto)
   63.46  
   63.47 -constdefs conj :: "fm \<Rightarrow> fm \<Rightarrow> fm"
   63.48 +definition conj :: "fm \<Rightarrow> fm \<Rightarrow> fm" where
   63.49    "conj p q \<equiv> (if (p = F \<or> q=F) then F else if p=T then q else if q=T then p else 
   63.50     if p = q then p else And p q)"
   63.51  lemma conj[simp]: "Ifm bs (conj p q) = Ifm bs (And p q)"
   63.52 @@ -1148,7 +1148,7 @@
   63.53  lemma conj_nb[simp]: "\<lbrakk>bound0 p ; bound0 q\<rbrakk> \<Longrightarrow> bound0 (conj p q)"
   63.54  using conj_def by auto 
   63.55  
   63.56 -constdefs disj :: "fm \<Rightarrow> fm \<Rightarrow> fm"
   63.57 +definition disj :: "fm \<Rightarrow> fm \<Rightarrow> fm" where
   63.58    "disj p q \<equiv> (if (p = T \<or> q=T) then T else if p=F then q else if q=F then p 
   63.59         else if p=q then p else Or p q)"
   63.60  
   63.61 @@ -1159,7 +1159,7 @@
   63.62  lemma disj_nb[simp]: "\<lbrakk>bound0 p ; bound0 q\<rbrakk> \<Longrightarrow> bound0 (disj p q)"
   63.63  using disj_def by auto 
   63.64  
   63.65 -constdefs   imp :: "fm \<Rightarrow> fm \<Rightarrow> fm"
   63.66 +definition imp :: "fm \<Rightarrow> fm \<Rightarrow> fm" where
   63.67    "imp p q \<equiv> (if (p = F \<or> q=T \<or> p=q) then T else if p=T then q else if q=F then not p 
   63.68      else Imp p q)"
   63.69  lemma imp[simp]: "Ifm bs (imp p q) = Ifm bs (Imp p q)"
   63.70 @@ -1169,7 +1169,7 @@
   63.71  lemma imp_nb[simp]: "\<lbrakk>bound0 p ; bound0 q\<rbrakk> \<Longrightarrow> bound0 (imp p q)"
   63.72  using imp_def by (cases "p=F \<or> q=T \<or> p=q",simp_all add: imp_def) 
   63.73  
   63.74 -constdefs   iff :: "fm \<Rightarrow> fm \<Rightarrow> fm"
   63.75 +definition iff :: "fm \<Rightarrow> fm \<Rightarrow> fm" where
   63.76    "iff p q \<equiv> (if (p = q) then T else if (p = not q \<or> not p = q) then F else 
   63.77         if p=F then not q else if q=F then not p else if p=T then q else if q=T then p else 
   63.78    Iff p q)"
   63.79 @@ -1216,7 +1216,7 @@
   63.80    thus "real d rdvd real c * t" using d rdvd_mult[OF gnz, where n="d div g" and x="real (c div g) * t"] real_of_int_div[OF gnz gd] real_of_int_div[OF gnz gc] by simp
   63.81  qed
   63.82  
   63.83 -constdefs simpdvd:: "int \<Rightarrow> num \<Rightarrow> (int \<times> num)"
   63.84 +definition simpdvd :: "int \<Rightarrow> num \<Rightarrow> (int \<times> num)" where
   63.85    "simpdvd d t \<equiv> 
   63.86     (let g = numgcd t in 
   63.87        if g > 1 then (let g' = gcd d g in 
   63.88 @@ -1479,7 +1479,7 @@
   63.89  
   63.90    (* Generic quantifier elimination *)
   63.91  
   63.92 -constdefs list_conj :: "fm list \<Rightarrow> fm"
   63.93 +definition list_conj :: "fm list \<Rightarrow> fm" where
   63.94    "list_conj ps \<equiv> foldr conj ps T"
   63.95  lemma list_conj: "Ifm bs (list_conj ps) = (\<forall>p\<in> set ps. Ifm bs p)"
   63.96    by (induct ps, auto simp add: list_conj_def)
   63.97 @@ -1487,7 +1487,7 @@
   63.98    by (induct ps, auto simp add: list_conj_def)
   63.99  lemma list_conj_nb: " \<forall>p\<in> set ps. bound0 p \<Longrightarrow> bound0 (list_conj ps)"
  63.100    by (induct ps, auto simp add: list_conj_def)
  63.101 -constdefs CJNB:: "(fm \<Rightarrow> fm) \<Rightarrow> fm \<Rightarrow> fm"
  63.102 +definition CJNB :: "(fm \<Rightarrow> fm) \<Rightarrow> fm \<Rightarrow> fm" where
  63.103    "CJNB f p \<equiv> (let cjs = conjuncts p ; (yes,no) = List.partition bound0 cjs
  63.104                     in conj (decr (list_conj yes)) (f (list_conj no)))"
  63.105  
  63.106 @@ -2954,7 +2954,7 @@
  63.107                                              else (NDvd (i*k) (CN 0 c (Mul k e))))"
  63.108    "a\<rho> p = (\<lambda> k. p)"
  63.109  
  63.110 -constdefs \<sigma> :: "fm \<Rightarrow> int \<Rightarrow> num \<Rightarrow> fm"
  63.111 +definition \<sigma> :: "fm \<Rightarrow> int \<Rightarrow> num \<Rightarrow> fm" where
  63.112    "\<sigma> p k t \<equiv> And (Dvd k t) (\<sigma>\<rho> p (t,k))"
  63.113  
  63.114  lemma \<sigma>\<rho>:
  63.115 @@ -3517,7 +3517,7 @@
  63.116    "isrlfm (Ge  (CN 0 c e)) = (c>0 \<and> numbound0 e)"
  63.117    "isrlfm p = (isatom p \<and> (bound0 p))"
  63.118  
  63.119 -constdefs fp :: "fm \<Rightarrow> int \<Rightarrow> num \<Rightarrow> int \<Rightarrow> fm"
  63.120 +definition fp :: "fm \<Rightarrow> int \<Rightarrow> num \<Rightarrow> int \<Rightarrow> fm" where
  63.121    "fp p n s j \<equiv> (if n > 0 then 
  63.122              (And p (And (Ge (CN 0 n (Sub s (Add (Floor s) (C j)))))
  63.123                          (Lt (CN 0 n (Sub s (Add (Floor s) (C (j+1))))))))
  63.124 @@ -3836,7 +3836,7 @@
  63.125  
  63.126      (* Linearize a formula where Bound 0 ranges over [0,1) *)
  63.127  
  63.128 -constdefs rsplit :: "(int \<Rightarrow> num \<Rightarrow> fm) \<Rightarrow> num \<Rightarrow> fm"
  63.129 +definition rsplit :: "(int \<Rightarrow> num \<Rightarrow> fm) \<Rightarrow> num \<Rightarrow> fm" where
  63.130    "rsplit f a \<equiv> foldr disj (map (\<lambda> (\<phi>, n, s). conj \<phi> (f n s)) (rsplit0 a)) F"
  63.131  
  63.132  lemma foldr_disj_map: "Ifm bs (foldr disj (map f xs) F) = (\<exists> x \<in> set xs. Ifm bs (f x))"
  63.133 @@ -5103,7 +5103,7 @@
  63.134  
  63.135      (* Implement the right hand sides of Cooper's theorem and Ferrante and Rackoff. *)
  63.136  
  63.137 -constdefs ferrack01:: "fm \<Rightarrow> fm"
  63.138 +definition ferrack01 :: "fm \<Rightarrow> fm" where
  63.139    "ferrack01 p \<equiv> (let p' = rlfm(And (And (Ge(CN 0 1 (C 0))) (Lt (CN 0 1 (C (- 1))))) p);
  63.140                      U = remdups(map simp_num_pair 
  63.141                       (map (\<lambda> ((t,n),(s,m)). (Add (Mul m t) (Mul n s) , 2*n*m))
  63.142 @@ -5350,7 +5350,7 @@
  63.143    shows "(\<exists> (x::int). Ifm (real x#bs) p) = ((\<exists> j\<in> {1 .. d}. Ifm (real j#bs) (minusinf p)) \<or> (\<exists> j\<in> {1.. d}. \<exists> b\<in> (Inum (real i#bs)) ` set (\<beta> p). Ifm ((b+real j)#bs) p))"
  63.144    using cp_thm[OF lp up dd dp] by auto
  63.145  
  63.146 -constdefs unit:: "fm \<Rightarrow> fm \<times> num list \<times> int"
  63.147 +definition unit :: "fm \<Rightarrow> fm \<times> num list \<times> int" where
  63.148    "unit p \<equiv> (let p' = zlfm p ; l = \<zeta> p' ; q = And (Dvd l (CN 0 1 (C 0))) (a\<beta> p' l); d = \<delta> q;
  63.149               B = remdups (map simpnum (\<beta> q)) ; a = remdups (map simpnum (\<alpha> q))
  63.150               in if length B \<le> length a then (q,B,d) else (mirror q, a,d))"
  63.151 @@ -5417,7 +5417,7 @@
  63.152  qed
  63.153      (* Cooper's Algorithm *)
  63.154  
  63.155 -constdefs cooper :: "fm \<Rightarrow> fm"
  63.156 +definition cooper :: "fm \<Rightarrow> fm" where
  63.157    "cooper p \<equiv> 
  63.158    (let (q,B,d) = unit p; js = iupt (1,d);
  63.159         mq = simpfm (minusinf q);
  63.160 @@ -5561,7 +5561,7 @@
  63.161    shows "(\<exists> (x::int). Ifm (real x#bs) p) = ((\<exists> j\<in> {1 .. \<delta> p}. Ifm (real j#bs) (minusinf p)) \<or> (\<exists> (e,c) \<in> R. \<exists> j\<in> {1.. c*(\<delta> p)}. Ifm (a#bs) (\<sigma> p c (Add e (C j)))))"
  63.162    using rl_thm[OF lp] \<rho>_cong[OF iszlfm_gen[OF lp, rule_format, where y="a"] R] by simp 
  63.163  
  63.164 -constdefs chooset:: "fm \<Rightarrow> fm \<times> ((num\<times>int) list) \<times> int"
  63.165 +definition chooset :: "fm \<Rightarrow> fm \<times> ((num\<times>int) list) \<times> int" where
  63.166    "chooset p \<equiv> (let q = zlfm p ; d = \<delta> q;
  63.167               B = remdups (map (\<lambda> (t,k). (simpnum t,k)) (\<rho> q)) ; 
  63.168               a = remdups (map (\<lambda> (t,k). (simpnum t,k)) (\<alpha>\<rho> q))
  63.169 @@ -5621,7 +5621,7 @@
  63.170    ultimately show ?thes by blast
  63.171  qed
  63.172  
  63.173 -constdefs stage:: "fm \<Rightarrow> int \<Rightarrow> (num \<times> int) \<Rightarrow> fm"
  63.174 +definition stage :: "fm \<Rightarrow> int \<Rightarrow> (num \<times> int) \<Rightarrow> fm" where
  63.175    "stage p d \<equiv> (\<lambda> (e,c). evaldjf (\<lambda> j. simpfm (\<sigma> p c (Add e (C j)))) (iupt (1,c*d)))"
  63.176  lemma stage:
  63.177    shows "Ifm bs (stage p d (e,c)) = (\<exists> j\<in>{1 .. c*d}. Ifm bs (\<sigma> p c (Add e (C j))))"
  63.178 @@ -5641,7 +5641,7 @@
  63.179    from evaldjf_bound0[OF th] show ?thesis by (unfold stage_def split_def) simp
  63.180  qed
  63.181  
  63.182 -constdefs redlove:: "fm \<Rightarrow> fm"
  63.183 +definition redlove :: "fm \<Rightarrow> fm" where
  63.184    "redlove p \<equiv> 
  63.185    (let (q,B,d) = chooset p;
  63.186         mq = simpfm (minusinf q);
    64.1 --- a/src/HOL/Decision_Procs/Parametric_Ferrante_Rackoff.thy	Wed Feb 24 11:55:52 2010 +0100
    64.2 +++ b/src/HOL/Decision_Procs/Parametric_Ferrante_Rackoff.thy	Mon Mar 01 13:40:23 2010 +0100
    64.3 @@ -273,10 +273,10 @@
    64.4    assumes "SORT_CONSTRAINT('a::{ring_char_0,division_by_zero, field})"
    64.5    shows "allpolys isnpoly t \<Longrightarrow> isnpoly c \<Longrightarrow> allpolys isnpoly (tmmul t c)" by (induct t rule: tmmul.induct, simp_all add: Let_def polymul_norm)
    64.6  
    64.7 -constdefs tmneg :: "tm \<Rightarrow> tm"
    64.8 +definition tmneg :: "tm \<Rightarrow> tm" where
    64.9    "tmneg t \<equiv> tmmul t (C (- 1,1))"
   64.10  
   64.11 -constdefs tmsub :: "tm \<Rightarrow> tm \<Rightarrow> tm"
   64.12 +definition tmsub :: "tm \<Rightarrow> tm \<Rightarrow> tm" where
   64.13    "tmsub s t \<equiv> (if s = t then CP 0\<^sub>p else tmadd (s,tmneg t))"
   64.14  
   64.15  lemma tmneg[simp]: "Itm vs bs (tmneg t) = Itm vs bs (Neg t)"
   64.16 @@ -477,26 +477,26 @@
   64.17  lemma not[simp]: "Ifm vs bs (not p) = Ifm vs bs (NOT p)"
   64.18  by (induct p rule: not.induct) auto
   64.19  
   64.20 -constdefs conj :: "fm \<Rightarrow> fm \<Rightarrow> fm"
   64.21 +definition conj :: "fm \<Rightarrow> fm \<Rightarrow> fm" where
   64.22    "conj p q \<equiv> (if (p = F \<or> q=F) then F else if p=T then q else if q=T then p else 
   64.23     if p = q then p else And p q)"
   64.24  lemma conj[simp]: "Ifm vs bs (conj p q) = Ifm vs bs (And p q)"
   64.25  by (cases "p=F \<or> q=F",simp_all add: conj_def) (cases p,simp_all)
   64.26  
   64.27 -constdefs disj :: "fm \<Rightarrow> fm \<Rightarrow> fm"
   64.28 +definition disj :: "fm \<Rightarrow> fm \<Rightarrow> fm" where
   64.29    "disj p q \<equiv> (if (p = T \<or> q=T) then T else if p=F then q else if q=F then p 
   64.30         else if p=q then p else Or p q)"
   64.31  
   64.32  lemma disj[simp]: "Ifm vs bs (disj p q) = Ifm vs bs (Or p q)"
   64.33  by (cases "p=T \<or> q=T",simp_all add: disj_def) (cases p,simp_all)
   64.34  
   64.35 -constdefs  imp :: "fm \<Rightarrow> fm \<Rightarrow> fm"
   64.36 +definition imp :: "fm \<Rightarrow> fm \<Rightarrow> fm" where
   64.37    "imp p q \<equiv> (if (p = F \<or> q=T \<or> p=q) then T else if p=T then q else if q=F then not p 
   64.38      else Imp p q)"
   64.39  lemma imp[simp]: "Ifm vs bs (imp p q) = Ifm vs bs (Imp p q)"
   64.40  by (cases "p=F \<or> q=T",simp_all add: imp_def) 
   64.41  
   64.42 -constdefs   iff :: "fm \<Rightarrow> fm \<Rightarrow> fm"
   64.43 +definition iff :: "fm \<Rightarrow> fm \<Rightarrow> fm" where
   64.44    "iff p q \<equiv> (if (p = q) then T else if (p = NOT q \<or> NOT p = q) then F else 
   64.45         if p=F then not q else if q=F then not p else if p=T then q else if q=T then p else 
   64.46    Iff p q)"
   64.47 @@ -776,10 +776,10 @@
   64.48  lemma bound0_qf: "bound0 p \<Longrightarrow> qfree p"
   64.49  by (induct p, simp_all)
   64.50  
   64.51 -constdefs djf:: "('a \<Rightarrow> fm) \<Rightarrow> 'a \<Rightarrow> fm \<Rightarrow> fm"
   64.52 +definition djf :: "('a \<Rightarrow> fm) \<Rightarrow> 'a \<Rightarrow> fm \<Rightarrow> fm" where
   64.53    "djf f p q \<equiv> (if q=T then T else if q=F then f p else 
   64.54    (let fp = f p in case fp of T \<Rightarrow> T | F \<Rightarrow> q | _ \<Rightarrow> Or (f p) q))"
   64.55 -constdefs evaldjf:: "('a \<Rightarrow> fm) \<Rightarrow> 'a list \<Rightarrow> fm"
   64.56 +definition evaldjf :: "('a \<Rightarrow> fm) \<Rightarrow> 'a list \<Rightarrow> fm" where
   64.57    "evaldjf f ps \<equiv> foldr (djf f) ps F"
   64.58  
   64.59  lemma djf_Or: "Ifm vs bs (djf f p q) = Ifm vs bs (Or (f p) q)"
   64.60 @@ -823,7 +823,7 @@
   64.61    thus ?thesis by (simp only: list_all_iff)
   64.62  qed
   64.63  
   64.64 -constdefs DJ :: "(fm \<Rightarrow> fm) \<Rightarrow> fm \<Rightarrow> fm"
   64.65 +definition DJ :: "(fm \<Rightarrow> fm) \<Rightarrow> fm \<Rightarrow> fm" where
   64.66    "DJ f p \<equiv> evaldjf f (disjuncts p)"
   64.67  
   64.68  lemma DJ: assumes fdj: "\<forall> p q. Ifm vs bs (f (Or p q)) = Ifm vs bs (Or (f p) (f q))"
   64.69 @@ -869,10 +869,10 @@
   64.70    "conjuncts T = []"
   64.71    "conjuncts p = [p]"
   64.72  
   64.73 -constdefs list_conj :: "fm list \<Rightarrow> fm"
   64.74 +definition list_conj :: "fm list \<Rightarrow> fm" where
   64.75    "list_conj ps \<equiv> foldr conj ps T"
   64.76  
   64.77 -constdefs CJNB:: "(fm \<Rightarrow> fm) \<Rightarrow> fm \<Rightarrow> fm"
   64.78 +definition CJNB :: "(fm \<Rightarrow> fm) \<Rightarrow> fm \<Rightarrow> fm" where
   64.79    "CJNB f p \<equiv> (let cjs = conjuncts p ; (yes,no) = partition bound0 cjs
   64.80                     in conj (decr0 (list_conj yes)) (f (list_conj no)))"
   64.81  
   64.82 @@ -1158,7 +1158,7 @@
   64.83    "conjs p = [p]"
   64.84  lemma conjs_ci: "(\<forall> q \<in> set (conjs p). Ifm vs bs q) = Ifm vs bs p"
   64.85  by (induct p rule: conjs.induct, auto)
   64.86 -constdefs list_disj :: "fm list \<Rightarrow> fm"
   64.87 +definition list_disj :: "fm list \<Rightarrow> fm" where
   64.88    "list_disj ps \<equiv> foldr disj ps F"
   64.89  
   64.90  lemma list_conj: "Ifm vs bs (list_conj ps) = (\<forall>p\<in> set ps. Ifm vs bs p)"
    65.1 --- a/src/HOL/Decision_Procs/Reflected_Multivariate_Polynomial.thy	Wed Feb 24 11:55:52 2010 +0100
    65.2 +++ b/src/HOL/Decision_Procs/Reflected_Multivariate_Polynomial.thy	Mon Mar 01 13:40:23 2010 +0100
    65.3 @@ -188,12 +188,12 @@
    65.4  | "poly_cmul y (CN c n p) = CN (poly_cmul y c) n (poly_cmul y p)"
    65.5  | "poly_cmul y p = C y *\<^sub>p p"
    65.6  
    65.7 -constdefs monic:: "poly \<Rightarrow> (poly \<times> bool)"
    65.8 +definition monic :: "poly \<Rightarrow> (poly \<times> bool)" where
    65.9    "monic p \<equiv> (let h = headconst p in if h = 0\<^sub>N then (p,False) else ((C (Ninv h)) *\<^sub>p p, 0>\<^sub>N h))"
   65.10  
   65.11  subsection{* Pseudo-division *}
   65.12  
   65.13 -constdefs shift1:: "poly \<Rightarrow> poly"
   65.14 +definition shift1 :: "poly \<Rightarrow> poly" where
   65.15    "shift1 p \<equiv> CN 0\<^sub>p 0 p"
   65.16  consts funpow :: "nat \<Rightarrow> ('a \<Rightarrow> 'a) \<Rightarrow> 'a \<Rightarrow> 'a"
   65.17  
   65.18 @@ -212,7 +212,7 @@
   65.19    by pat_completeness auto
   65.20  
   65.21  
   65.22 -constdefs polydivide:: "poly \<Rightarrow> poly \<Rightarrow> (nat \<times> poly)"
   65.23 +definition polydivide :: "poly \<Rightarrow> poly \<Rightarrow> (nat \<times> poly)" where
   65.24    "polydivide s p \<equiv> polydivide_aux (head p,degree p,p,0, s)"
   65.25  
   65.26  fun poly_deriv_aux :: "nat \<Rightarrow> poly \<Rightarrow> poly" where
   65.27 @@ -262,7 +262,7 @@
   65.28  lemma isnpolyh_mono: "\<lbrakk>n' \<le> n ; isnpolyh p n\<rbrakk> \<Longrightarrow> isnpolyh p n'"
   65.29  by (induct p rule: isnpolyh.induct, auto)
   65.30  
   65.31 -constdefs isnpoly:: "poly \<Rightarrow> bool"
   65.32 +definition isnpoly :: "poly \<Rightarrow> bool" where
   65.33    "isnpoly p \<equiv> isnpolyh p 0"
   65.34  
   65.35  text{* polyadd preserves normal forms *}
    66.1 --- a/src/HOL/Finite_Set.thy	Wed Feb 24 11:55:52 2010 +0100
    66.2 +++ b/src/HOL/Finite_Set.thy	Mon Mar 01 13:40:23 2010 +0100
    66.3 @@ -2528,8 +2528,7 @@
    66.4    fold1Set_insertI [intro]:
    66.5     "\<lbrakk> fold_graph f a A x; a \<notin> A \<rbrakk> \<Longrightarrow> fold1Set f (insert a A) x"
    66.6  
    66.7 -constdefs
    66.8 -  fold1 :: "('a => 'a => 'a) => 'a set => 'a"
    66.9 +definition fold1 :: "('a => 'a => 'a) => 'a set => 'a" where
   66.10    "fold1 f A == THE x. fold1Set f A x"
   66.11  
   66.12  lemma fold1Set_nonempty:
    67.1 --- a/src/HOL/Fun.thy	Wed Feb 24 11:55:52 2010 +0100
    67.2 +++ b/src/HOL/Fun.thy	Mon Mar 01 13:40:23 2010 +0100
    67.3 @@ -119,8 +119,9 @@
    67.4  
    67.5  subsection {* Injectivity and Surjectivity *}
    67.6  
    67.7 -constdefs
    67.8 -  inj_on :: "['a => 'b, 'a set] => bool"  -- "injective"
    67.9 +definition
   67.10 +  inj_on :: "['a => 'b, 'a set] => bool" where
   67.11 +  -- "injective"
   67.12    "inj_on f A == ! x:A. ! y:A. f(x)=f(y) --> x=y"
   67.13  
   67.14  text{*A common special case: functions injective over the entire domain type.*}
   67.15 @@ -132,11 +133,14 @@
   67.16    bij_betw :: "('a => 'b) => 'a set => 'b set => bool" where -- "bijective"
   67.17    [code del]: "bij_betw f A B \<longleftrightarrow> inj_on f A & f ` A = B"
   67.18  
   67.19 -constdefs
   67.20 -  surj :: "('a => 'b) => bool"                   (*surjective*)
   67.21 +definition
   67.22 +  surj :: "('a => 'b) => bool" where
   67.23 +  -- "surjective"
   67.24    "surj f == ! y. ? x. y=f(x)"
   67.25  
   67.26 -  bij :: "('a => 'b) => bool"                    (*bijective*)
   67.27 +definition
   67.28 +  bij :: "('a => 'b) => bool" where
   67.29 +  -- "bijective"
   67.30    "bij f == inj f & surj f"
   67.31  
   67.32  lemma injI:
   67.33 @@ -377,8 +381,8 @@
   67.34  
   67.35  subsection{*Function Updating*}
   67.36  
   67.37 -constdefs
   67.38 -  fun_upd :: "('a => 'b) => 'a => 'b => ('a => 'b)"
   67.39 +definition
   67.40 +  fun_upd :: "('a => 'b) => 'a => 'b => ('a => 'b)" where
   67.41    "fun_upd f a b == % x. if x=a then b else f x"
   67.42  
   67.43  nonterminals
    68.1 --- a/src/HOL/HOL.thy	Wed Feb 24 11:55:52 2010 +0100
    68.2 +++ b/src/HOL/HOL.thy	Mon Mar 01 13:40:23 2010 +0100
    68.3 @@ -1118,8 +1118,7 @@
    68.4    its premise.
    68.5  *}
    68.6  
    68.7 -constdefs
    68.8 -  simp_implies :: "[prop, prop] => prop"  (infixr "=simp=>" 1)
    68.9 +definition simp_implies :: "[prop, prop] => prop"  (infixr "=simp=>" 1) where
   68.10    [code del]: "simp_implies \<equiv> op ==>"
   68.11  
   68.12  lemma simp_impliesI:
   68.13 @@ -1392,13 +1391,23 @@
   68.14  )
   68.15  *}
   68.16  
   68.17 -constdefs
   68.18 -  induct_forall where "induct_forall P == \<forall>x. P x"
   68.19 -  induct_implies where "induct_implies A B == A \<longrightarrow> B"
   68.20 -  induct_equal where "induct_equal x y == x = y"
   68.21 -  induct_conj where "induct_conj A B == A \<and> B"
   68.22 -  induct_true where "induct_true == True"
   68.23 -  induct_false where "induct_false == False"
   68.24 +definition induct_forall where
   68.25 +  "induct_forall P == \<forall>x. P x"
   68.26 +
   68.27 +definition induct_implies where
   68.28 +  "induct_implies A B == A \<longrightarrow> B"
   68.29 +
   68.30 +definition induct_equal where
   68.31 +  "induct_equal x y == x = y"
   68.32 +
   68.33 +definition induct_conj where
   68.34 +  "induct_conj A B == A \<and> B"
   68.35 +
   68.36 +definition induct_true where
   68.37 +  "induct_true == True"
   68.38 +
   68.39 +definition induct_false where
   68.40 +  "induct_false == False"
   68.41  
   68.42  lemma induct_forall_eq: "(!!x. P x) == Trueprop (induct_forall (\<lambda>x. P x))"
   68.43    by (unfold atomize_all induct_forall_def)
    69.1 --- a/src/HOL/Hilbert_Choice.thy	Wed Feb 24 11:55:52 2010 +0100
    69.2 +++ b/src/HOL/Hilbert_Choice.thy	Mon Mar 01 13:40:23 2010 +0100
    69.3 @@ -307,8 +307,8 @@
    69.4  
    69.5  subsection {* Least value operator *}
    69.6  
    69.7 -constdefs
    69.8 -  LeastM :: "['a => 'b::ord, 'a => bool] => 'a"
    69.9 +definition
   69.10 +  LeastM :: "['a => 'b::ord, 'a => bool] => 'a" where
   69.11    "LeastM m P == SOME x. P x & (\<forall>y. P y --> m x <= m y)"
   69.12  
   69.13  syntax
   69.14 @@ -360,11 +360,12 @@
   69.15  
   69.16  subsection {* Greatest value operator *}
   69.17  
   69.18 -constdefs
   69.19 -  GreatestM :: "['a => 'b::ord, 'a => bool] => 'a"
   69.20 +definition
   69.21 +  GreatestM :: "['a => 'b::ord, 'a => bool] => 'a" where
   69.22    "GreatestM m P == SOME x. P x & (\<forall>y. P y --> m y <= m x)"
   69.23  
   69.24 -  Greatest :: "('a::ord => bool) => 'a"    (binder "GREATEST " 10)
   69.25 +definition
   69.26 +  Greatest :: "('a::ord => bool) => 'a" (binder "GREATEST " 10) where
   69.27    "Greatest == GreatestM (%x. x)"
   69.28  
   69.29  syntax
    70.1 --- a/src/HOL/Hoare/Arith2.thy	Wed Feb 24 11:55:52 2010 +0100
    70.2 +++ b/src/HOL/Hoare/Arith2.thy	Mon Mar 01 13:40:23 2010 +0100
    70.3 @@ -1,5 +1,4 @@
    70.4  (*  Title:      HOL/Hoare/Arith2.thy
    70.5 -    ID:         $Id$
    70.6      Author:     Norbert Galm
    70.7      Copyright   1995 TUM
    70.8  
    70.9 @@ -10,11 +9,10 @@
   70.10  imports Main
   70.11  begin
   70.12  
   70.13 -constdefs
   70.14 -  "cd"    :: "[nat, nat, nat] => bool"
   70.15 +definition "cd" :: "[nat, nat, nat] => bool" where
   70.16    "cd x m n  == x dvd m & x dvd n"
   70.17  
   70.18 -  gcd     :: "[nat, nat] => nat"
   70.19 +definition gcd     :: "[nat, nat] => nat" where
   70.20    "gcd m n     == @x.(cd x m n) & (!y.(cd y m n) --> y<=x)"
   70.21  
   70.22  consts fac     :: "nat => nat"
    71.1 --- a/src/HOL/Hoare/Heap.thy	Wed Feb 24 11:55:52 2010 +0100
    71.2 +++ b/src/HOL/Hoare/Heap.thy	Mon Mar 01 13:40:23 2010 +0100
    71.3 @@ -1,5 +1,4 @@
    71.4  (*  Title:      HOL/Hoare/Heap.thy
    71.5 -    ID:         $Id$
    71.6      Author:     Tobias Nipkow
    71.7      Copyright   2002 TUM
    71.8  
    71.9 @@ -19,19 +18,17 @@
   71.10  lemma not_Ref_eq [iff]: "(ALL y. x ~= Ref y) = (x = Null)"
   71.11    by (induct x) auto
   71.12  
   71.13 -consts addr :: "'a ref \<Rightarrow> 'a"
   71.14 -primrec "addr(Ref a) = a"
   71.15 +primrec addr :: "'a ref \<Rightarrow> 'a" where
   71.16 +  "addr (Ref a) = a"
   71.17  
   71.18  
   71.19  section "The heap"
   71.20  
   71.21  subsection "Paths in the heap"
   71.22  
   71.23 -consts
   71.24 - Path :: "('a \<Rightarrow> 'a ref) \<Rightarrow> 'a ref \<Rightarrow> 'a list \<Rightarrow> 'a ref \<Rightarrow> bool"
   71.25 -primrec
   71.26 -"Path h x [] y = (x = y)"
   71.27 -"Path h x (a#as) y = (x = Ref a \<and> Path h (h a) as y)"
   71.28 +primrec Path :: "('a \<Rightarrow> 'a ref) \<Rightarrow> 'a ref \<Rightarrow> 'a list \<Rightarrow> 'a ref \<Rightarrow> bool" where
   71.29 +  "Path h x [] y \<longleftrightarrow> x = y"
   71.30 +| "Path h x (a#as) y \<longleftrightarrow> x = Ref a \<and> Path h (h a) as y"
   71.31  
   71.32  lemma [iff]: "Path h Null xs y = (xs = [] \<and> y = Null)"
   71.33  apply(case_tac xs)
   71.34 @@ -60,8 +57,7 @@
   71.35  
   71.36  subsection "Non-repeating paths"
   71.37  
   71.38 -constdefs
   71.39 -  distPath :: "('a \<Rightarrow> 'a ref) \<Rightarrow> 'a ref \<Rightarrow> 'a list \<Rightarrow> 'a ref \<Rightarrow> bool"
   71.40 +definition distPath :: "('a \<Rightarrow> 'a ref) \<Rightarrow> 'a ref \<Rightarrow> 'a list \<Rightarrow> 'a ref \<Rightarrow> bool" where
   71.41    "distPath h x as y   \<equiv>   Path h x as y  \<and>  distinct as"
   71.42  
   71.43  text{* The term @{term"distPath h x as y"} expresses the fact that a
   71.44 @@ -86,8 +82,7 @@
   71.45  
   71.46  subsubsection "Relational abstraction"
   71.47  
   71.48 -constdefs
   71.49 - List :: "('a \<Rightarrow> 'a ref) \<Rightarrow> 'a ref \<Rightarrow> 'a list \<Rightarrow> bool"
   71.50 +definition List :: "('a \<Rightarrow> 'a ref) \<Rightarrow> 'a ref \<Rightarrow> 'a list \<Rightarrow> bool" where
   71.51  "List h x as == Path h x as Null"
   71.52  
   71.53  lemma [simp]: "List h x [] = (x = Null)"
   71.54 @@ -138,10 +133,10 @@
   71.55  
   71.56  subsection "Functional abstraction"
   71.57  
   71.58 -constdefs
   71.59 - islist :: "('a \<Rightarrow> 'a ref) \<Rightarrow> 'a ref \<Rightarrow> bool"
   71.60 +definition islist :: "('a \<Rightarrow> 'a ref) \<Rightarrow> 'a ref \<Rightarrow> bool" where
   71.61  "islist h p == \<exists>as. List h p as"
   71.62 - list :: "('a \<Rightarrow> 'a ref) \<Rightarrow> 'a ref \<Rightarrow> 'a list"
   71.63 +
   71.64 +definition list :: "('a \<Rightarrow> 'a ref) \<Rightarrow> 'a ref \<Rightarrow> 'a list" where
   71.65  "list h p == SOME as. List h p as"
   71.66  
   71.67  lemma List_conv_islist_list: "List h p as = (islist h p \<and> as = list h p)"
    72.1 --- a/src/HOL/Hoare/Hoare_Logic.thy	Wed Feb 24 11:55:52 2010 +0100
    72.2 +++ b/src/HOL/Hoare/Hoare_Logic.thy	Mon Mar 01 13:40:23 2010 +0100
    72.3 @@ -40,7 +40,7 @@
    72.4                                        (s ~: b --> Sem c2 s s'))"
    72.5  "Sem(While b x c) s s' = (? n. iter n b (Sem c) s s')"
    72.6  
    72.7 -constdefs Valid :: "'a bexp \<Rightarrow> 'a com \<Rightarrow> 'a bexp \<Rightarrow> bool"
    72.8 +definition Valid :: "'a bexp \<Rightarrow> 'a com \<Rightarrow> 'a bexp \<Rightarrow> bool" where
    72.9    "Valid p c q == !s s'. Sem c s s' --> s : p --> s' : q"
   72.10  
   72.11  
    73.1 --- a/src/HOL/Hoare/Hoare_Logic_Abort.thy	Wed Feb 24 11:55:52 2010 +0100
    73.2 +++ b/src/HOL/Hoare/Hoare_Logic_Abort.thy	Mon Mar 01 13:40:23 2010 +0100
    73.3 @@ -42,7 +42,7 @@
    73.4  "Sem(While b x c) s s' =
    73.5   (if s = None then s' = None else \<exists>n. iter n b (Sem c) s s')"
    73.6  
    73.7 -constdefs Valid :: "'a bexp \<Rightarrow> 'a com \<Rightarrow> 'a bexp \<Rightarrow> bool"
    73.8 +definition Valid :: "'a bexp \<Rightarrow> 'a com \<Rightarrow> 'a bexp \<Rightarrow> bool" where
    73.9    "Valid p c q == \<forall>s s'. Sem c s s' \<longrightarrow> s : Some ` p \<longrightarrow> s' : Some ` q"
   73.10  
   73.11  
    74.1 --- a/src/HOL/Hoare/Pointer_Examples.thy	Wed Feb 24 11:55:52 2010 +0100
    74.2 +++ b/src/HOL/Hoare/Pointer_Examples.thy	Mon Mar 01 13:40:23 2010 +0100
    74.3 @@ -216,10 +216,10 @@
    74.4  
    74.5  text"This is still a bit rough, especially the proof."
    74.6  
    74.7 -constdefs
    74.8 - cor :: "bool \<Rightarrow> bool \<Rightarrow> bool"
    74.9 +definition cor :: "bool \<Rightarrow> bool \<Rightarrow> bool" where
   74.10  "cor P Q == if P then True else Q"
   74.11 - cand :: "bool \<Rightarrow> bool \<Rightarrow> bool"
   74.12 +
   74.13 +definition cand :: "bool \<Rightarrow> bool \<Rightarrow> bool" where
   74.14  "cand P Q == if P then Q else False"
   74.15  
   74.16  consts merge :: "'a list * 'a list * ('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> 'a list"
   74.17 @@ -481,7 +481,7 @@
   74.18  
   74.19  subsection "Storage allocation"
   74.20  
   74.21 -constdefs new :: "'a set \<Rightarrow> 'a"
   74.22 +definition new :: "'a set \<Rightarrow> 'a" where
   74.23  "new A == SOME a. a \<notin> A"
   74.24  
   74.25  
    75.1 --- a/src/HOL/Hoare/Pointers0.thy	Wed Feb 24 11:55:52 2010 +0100
    75.2 +++ b/src/HOL/Hoare/Pointers0.thy	Mon Mar 01 13:40:23 2010 +0100
    75.3 @@ -73,8 +73,7 @@
    75.4  
    75.5  subsubsection "Relational abstraction"
    75.6  
    75.7 -constdefs
    75.8 - List :: "('a::ref \<Rightarrow> 'a) \<Rightarrow> 'a \<Rightarrow> 'a list \<Rightarrow> bool"
    75.9 +definition List :: "('a::ref \<Rightarrow> 'a) \<Rightarrow> 'a \<Rightarrow> 'a list \<Rightarrow> bool" where
   75.10  "List h x as == Path h x as Null"
   75.11  
   75.12  lemma [simp]: "List h x [] = (x = Null)"
   75.13 @@ -122,10 +121,10 @@
   75.14  
   75.15  subsection "Functional abstraction"
   75.16  
   75.17 -constdefs
   75.18 - islist :: "('a::ref \<Rightarrow> 'a) \<Rightarrow> 'a \<Rightarrow> bool"
   75.19 +definition islist :: "('a::ref \<Rightarrow> 'a) \<Rightarrow> 'a \<Rightarrow> bool" where
   75.20  "islist h p == \<exists>as. List h p as"
   75.21 - list :: "('a::ref \<Rightarrow> 'a) \<Rightarrow> 'a \<Rightarrow> 'a list"
   75.22 +
   75.23 +definition list :: "('a::ref \<Rightarrow> 'a) \<Rightarrow> 'a \<Rightarrow> 'a list" where
   75.24  "list h p == SOME as. List h p as"
   75.25  
   75.26  lemma List_conv_islist_list: "List h p as = (islist h p \<and> as = list h p)"
   75.27 @@ -407,7 +406,7 @@
   75.28  
   75.29  subsection "Storage allocation"
   75.30  
   75.31 -constdefs new :: "'a set \<Rightarrow> 'a::ref"
   75.32 +definition new :: "'a set \<Rightarrow> 'a::ref" where
   75.33  "new A == SOME a. a \<notin> A & a \<noteq> Null"
   75.34  
   75.35  
    76.1 --- a/src/HOL/Hoare/SepLogHeap.thy	Wed Feb 24 11:55:52 2010 +0100
    76.2 +++ b/src/HOL/Hoare/SepLogHeap.thy	Mon Mar 01 13:40:23 2010 +0100
    76.3 @@ -41,8 +41,7 @@
    76.4  
    76.5  subsection "Lists on the heap"
    76.6  
    76.7 -constdefs
    76.8 - List :: "heap \<Rightarrow> nat \<Rightarrow> nat list \<Rightarrow> bool"
    76.9 +definition List :: "heap \<Rightarrow> nat \<Rightarrow> nat list \<Rightarrow> bool" where
   76.10  "List h x as == Path h x as 0"
   76.11  
   76.12  lemma [simp]: "List h x [] = (x = 0)"
    77.1 --- a/src/HOL/Hoare/Separation.thy	Wed Feb 24 11:55:52 2010 +0100
    77.2 +++ b/src/HOL/Hoare/Separation.thy	Mon Mar 01 13:40:23 2010 +0100
    77.3 @@ -16,20 +16,19 @@
    77.4  
    77.5  text{* The semantic definition of a few connectives: *}
    77.6  
    77.7 -constdefs
    77.8 - ortho:: "heap \<Rightarrow> heap \<Rightarrow> bool" (infix "\<bottom>" 55)
    77.9 +definition ortho :: "heap \<Rightarrow> heap \<Rightarrow> bool" (infix "\<bottom>" 55) where
   77.10  "h1 \<bottom> h2 == dom h1 \<inter> dom h2 = {}"
   77.11  
   77.12 - is_empty :: "heap \<Rightarrow> bool"
   77.13 +definition is_empty :: "heap \<Rightarrow> bool" where
   77.14  "is_empty h == h = empty"
   77.15  
   77.16 - singl:: "heap \<Rightarrow> nat \<Rightarrow> nat \<Rightarrow> bool"
   77.17 +definition singl:: "heap \<Rightarrow> nat \<Rightarrow> nat \<Rightarrow> bool" where
   77.18  "singl h x y == dom h = {x} & h x = Some y"
   77.19  
   77.20 - star:: "(heap \<Rightarrow> bool) \<Rightarrow> (heap \<Rightarrow> bool) \<Rightarrow> (heap \<Rightarrow> bool)"
   77.21 +definition star:: "(heap \<Rightarrow> bool) \<Rightarrow> (heap \<Rightarrow> bool) \<Rightarrow> (heap \<Rightarrow> bool)" where
   77.22  "star P Q == \<lambda>h. \<exists>h1 h2. h = h1++h2 \<and> h1 \<bottom> h2 \<and> P h1 \<and> Q h2"
   77.23  
   77.24 - wand:: "(heap \<Rightarrow> bool) \<Rightarrow> (heap \<Rightarrow> bool) \<Rightarrow> (heap \<Rightarrow> bool)"
   77.25 +definition wand:: "(heap \<Rightarrow> bool) \<Rightarrow> (heap \<Rightarrow> bool) \<Rightarrow> (heap \<Rightarrow> bool)" where
   77.26  "wand P Q == \<lambda>h. \<forall>h'. h' \<bottom> h \<and> P h' \<longrightarrow> Q(h++h')"
   77.27  
   77.28  text{*This is what assertions look like without any syntactic sugar: *}
    78.1 --- a/src/HOL/Hoare_Parallel/Gar_Coll.thy	Wed Feb 24 11:55:52 2010 +0100
    78.2 +++ b/src/HOL/Hoare_Parallel/Gar_Coll.thy	Mon Mar 01 13:40:23 2010 +0100
    78.3 @@ -31,8 +31,7 @@
    78.4  under which the selected edge @{text "R"} and node @{text "T"} are
    78.5  valid: *}
    78.6  
    78.7 -constdefs
    78.8 -  Mut_init :: "gar_coll_state \<Rightarrow> bool"
    78.9 +definition Mut_init :: "gar_coll_state \<Rightarrow> bool" where
   78.10    "Mut_init \<equiv> \<guillemotleft> T \<in> Reach \<acute>E \<and> R < length \<acute>E \<and> T < length \<acute>M \<guillemotright>"
   78.11  
   78.12  text {* \noindent For the mutator we
   78.13 @@ -40,14 +39,13 @@
   78.14  @{text "\<acute>z"} is set to false if the mutator has already redirected an
   78.15  edge but has not yet colored the new target.   *}
   78.16  
   78.17 -constdefs
   78.18 -  Redirect_Edge :: "gar_coll_state ann_com"
   78.19 +definition Redirect_Edge :: "gar_coll_state ann_com" where
   78.20    "Redirect_Edge \<equiv> .{\<acute>Mut_init \<and> \<acute>z}. \<langle>\<acute>E:=\<acute>E[R:=(fst(\<acute>E!R), T)],, \<acute>z:= (\<not>\<acute>z)\<rangle>"
   78.21  
   78.22 -  Color_Target :: "gar_coll_state ann_com"
   78.23 +definition Color_Target :: "gar_coll_state ann_com" where
   78.24    "Color_Target \<equiv> .{\<acute>Mut_init \<and> \<not>\<acute>z}. \<langle>\<acute>M:=\<acute>M[T:=Black],, \<acute>z:= (\<not>\<acute>z)\<rangle>"
   78.25  
   78.26 -  Mutator :: "gar_coll_state ann_com"
   78.27 +definition Mutator :: "gar_coll_state ann_com" where
   78.28    "Mutator \<equiv>
   78.29    .{\<acute>Mut_init \<and> \<acute>z}. 
   78.30    WHILE True INV .{\<acute>Mut_init \<and> \<acute>z}. 
   78.31 @@ -88,22 +86,20 @@
   78.32  
   78.33  consts  M_init :: nodes
   78.34  
   78.35 -constdefs
   78.36 -  Proper_M_init :: "gar_coll_state \<Rightarrow> bool"
   78.37 +definition Proper_M_init :: "gar_coll_state \<Rightarrow> bool" where
   78.38    "Proper_M_init \<equiv>  \<guillemotleft> Blacks M_init=Roots \<and> length M_init=length \<acute>M \<guillemotright>"
   78.39   
   78.40 -  Proper :: "gar_coll_state \<Rightarrow> bool"
   78.41 +definition Proper :: "gar_coll_state \<Rightarrow> bool" where
   78.42    "Proper \<equiv> \<guillemotleft> Proper_Roots \<acute>M \<and> Proper_Edges(\<acute>M, \<acute>E) \<and> \<acute>Proper_M_init \<guillemotright>"
   78.43  
   78.44 -  Safe :: "gar_coll_state \<Rightarrow> bool"
   78.45 +definition Safe :: "gar_coll_state \<Rightarrow> bool" where
   78.46    "Safe \<equiv> \<guillemotleft> Reach \<acute>E \<subseteq> Blacks \<acute>M \<guillemotright>"
   78.47  
   78.48  lemmas collector_defs = Proper_M_init_def Proper_def Safe_def
   78.49  
   78.50  subsubsection {* Blackening the roots *}
   78.51  
   78.52 -constdefs
   78.53 -  Blacken_Roots :: " gar_coll_state ann_com"
   78.54 +definition Blacken_Roots :: " gar_coll_state ann_com" where
   78.55    "Blacken_Roots \<equiv> 
   78.56    .{\<acute>Proper}.
   78.57    \<acute>ind:=0;;
   78.58 @@ -133,13 +129,11 @@
   78.59  
   78.60  subsubsection {* Propagating black *}
   78.61  
   78.62 -constdefs
   78.63 -  PBInv :: "gar_coll_state \<Rightarrow> nat \<Rightarrow> bool"
   78.64 +definition PBInv :: "gar_coll_state \<Rightarrow> nat \<Rightarrow> bool" where
   78.65    "PBInv \<equiv> \<guillemotleft> \<lambda>ind. \<acute>obc < Blacks \<acute>M \<or> (\<forall>i <ind. \<not>BtoW (\<acute>E!i, \<acute>M) \<or>
   78.66     (\<not>\<acute>z \<and> i=R \<and> (snd(\<acute>E!R)) = T \<and> (\<exists>r. ind \<le> r \<and> r < length \<acute>E \<and> BtoW(\<acute>E!r,\<acute>M))))\<guillemotright>"
   78.67  
   78.68 -constdefs  
   78.69 -  Propagate_Black_aux :: "gar_coll_state ann_com"
   78.70 +definition Propagate_Black_aux :: "gar_coll_state ann_com" where
   78.71    "Propagate_Black_aux \<equiv>
   78.72    .{\<acute>Proper \<and> Roots\<subseteq>Blacks \<acute>M \<and> \<acute>obc\<subseteq>Blacks \<acute>M \<and> \<acute>bc\<subseteq>Blacks \<acute>M}.
   78.73    \<acute>ind:=0;;
   78.74 @@ -214,14 +208,12 @@
   78.75  
   78.76  subsubsection {* Refining propagating black *}
   78.77  
   78.78 -constdefs
   78.79 -  Auxk :: "gar_coll_state \<Rightarrow> bool"
   78.80 +definition Auxk :: "gar_coll_state \<Rightarrow> bool" where
   78.81    "Auxk \<equiv> \<guillemotleft>\<acute>k<length \<acute>M \<and> (\<acute>M!\<acute>k\<noteq>Black \<or> \<not>BtoW(\<acute>E!\<acute>ind, \<acute>M) \<or> 
   78.82            \<acute>obc<Blacks \<acute>M \<or> (\<not>\<acute>z \<and> \<acute>ind=R \<and> snd(\<acute>E!R)=T  
   78.83            \<and> (\<exists>r. \<acute>ind<r \<and> r<length \<acute>E \<and> BtoW(\<acute>E!r, \<acute>M))))\<guillemotright>"
   78.84  
   78.85 -constdefs  
   78.86 -  Propagate_Black :: " gar_coll_state ann_com"
   78.87 +definition Propagate_Black :: " gar_coll_state ann_com" where
   78.88    "Propagate_Black \<equiv>
   78.89    .{\<acute>Proper \<and> Roots\<subseteq>Blacks \<acute>M \<and> \<acute>obc\<subseteq>Blacks \<acute>M \<and> \<acute>bc\<subseteq>Blacks \<acute>M}.
   78.90    \<acute>ind:=0;;
   78.91 @@ -328,12 +320,10 @@
   78.92  
   78.93  subsubsection {* Counting black nodes *}
   78.94  
   78.95 -constdefs
   78.96 -  CountInv :: "gar_coll_state \<Rightarrow> nat \<Rightarrow> bool"
   78.97 +definition CountInv :: "gar_coll_state \<Rightarrow> nat \<Rightarrow> bool" where
   78.98    "CountInv \<equiv> \<guillemotleft> \<lambda>ind. {i. i<ind \<and> \<acute>Ma!i=Black}\<subseteq>\<acute>bc \<guillemotright>"
   78.99  
  78.100 -constdefs
  78.101 -  Count :: " gar_coll_state ann_com"
  78.102 +definition Count :: " gar_coll_state ann_com" where
  78.103    "Count \<equiv>
  78.104    .{\<acute>Proper \<and> Roots\<subseteq>Blacks \<acute>M 
  78.105      \<and> \<acute>obc\<subseteq>Blacks \<acute>Ma \<and> Blacks \<acute>Ma\<subseteq>Blacks \<acute>M \<and> \<acute>bc\<subseteq>Blacks \<acute>M 
  78.106 @@ -398,12 +388,10 @@
  78.107    Append_to_free2: "i \<notin> Reach e 
  78.108       \<Longrightarrow> n \<in> Reach (Append_to_free(i, e)) = ( n = i \<or> n \<in> Reach e)"
  78.109  
  78.110 -constdefs
  78.111 -  AppendInv :: "gar_coll_state \<Rightarrow> nat \<Rightarrow> bool"
  78.112 +definition AppendInv :: "gar_coll_state \<Rightarrow> nat \<Rightarrow> bool" where
  78.113    "AppendInv \<equiv> \<guillemotleft>\<lambda>ind. \<forall>i<length \<acute>M. ind\<le>i \<longrightarrow> i\<in>Reach \<acute>E \<longrightarrow> \<acute>M!i=Black\<guillemotright>"
  78.114  
  78.115 -constdefs
  78.116 -  Append :: " gar_coll_state ann_com"
  78.117 +definition Append :: " gar_coll_state ann_com" where
  78.118     "Append \<equiv>
  78.119    .{\<acute>Proper \<and> Roots\<subseteq>Blacks \<acute>M \<and> \<acute>Safe}.
  78.120    \<acute>ind:=0;;
  78.121 @@ -444,8 +432,7 @@
  78.122  
  78.123  subsubsection {* Correctness of the Collector *}
  78.124  
  78.125 -constdefs 
  78.126 -  Collector :: " gar_coll_state ann_com"
  78.127 +definition Collector :: " gar_coll_state ann_com" where
  78.128    "Collector \<equiv>
  78.129  .{\<acute>Proper}.  
  78.130   WHILE True INV .{\<acute>Proper}. 
    79.1 --- a/src/HOL/Hoare_Parallel/Graph.thy	Wed Feb 24 11:55:52 2010 +0100
    79.2 +++ b/src/HOL/Hoare_Parallel/Graph.thy	Mon Mar 01 13:40:23 2010 +0100
    79.3 @@ -13,20 +13,19 @@
    79.4  
    79.5  consts Roots :: "nat set"
    79.6  
    79.7 -constdefs
    79.8 -  Proper_Roots :: "nodes \<Rightarrow> bool"
    79.9 +definition Proper_Roots :: "nodes \<Rightarrow> bool" where
   79.10    "Proper_Roots M \<equiv> Roots\<noteq>{} \<and> Roots \<subseteq> {i. i<length M}"
   79.11  
   79.12 -  Proper_Edges :: "(nodes \<times> edges) \<Rightarrow> bool"
   79.13 +definition Proper_Edges :: "(nodes \<times> edges) \<Rightarrow> bool" where
   79.14    "Proper_Edges \<equiv> (\<lambda>(M,E). \<forall>i<length E. fst(E!i)<length M \<and> snd(E!i)<length M)"
   79.15  
   79.16 -  BtoW :: "(edge \<times> nodes) \<Rightarrow> bool"
   79.17 +definition BtoW :: "(edge \<times> nodes) \<Rightarrow> bool" where
   79.18    "BtoW \<equiv> (\<lambda>(e,M). (M!fst e)=Black \<and> (M!snd e)\<noteq>Black)"
   79.19  
   79.20 -  Blacks :: "nodes \<Rightarrow> nat set"
   79.21 +definition Blacks :: "nodes \<Rightarrow> nat set" where
   79.22    "Blacks M \<equiv> {i. i<length M \<and> M!i=Black}"
   79.23  
   79.24 -  Reach :: "edges \<Rightarrow> nat set"
   79.25 +definition Reach :: "edges \<Rightarrow> nat set" where
   79.26    "Reach E \<equiv> {x. (\<exists>path. 1<length path \<and> path!(length path - 1)\<in>Roots \<and> x=path!0
   79.27                \<and> (\<forall>i<length path - 1. (\<exists>j<length E. E!j=(path!(i+1), path!i))))
   79.28                \<or> x\<in>Roots}"
    80.1 --- a/src/HOL/Hoare_Parallel/Mul_Gar_Coll.thy	Wed Feb 24 11:55:52 2010 +0100
    80.2 +++ b/src/HOL/Hoare_Parallel/Mul_Gar_Coll.thy	Mon Mar 01 13:40:23 2010 +0100
    80.3 @@ -26,24 +26,23 @@
    80.4  
    80.5  subsection {* The Mutators *}
    80.6  
    80.7 -constdefs 
    80.8 -  Mul_mut_init :: "mul_gar_coll_state \<Rightarrow> nat \<Rightarrow> bool"
    80.9 +definition Mul_mut_init :: "mul_gar_coll_state \<Rightarrow> nat \<Rightarrow> bool" where
   80.10    "Mul_mut_init \<equiv> \<guillemotleft> \<lambda>n. n=length \<acute>Muts \<and> (\<forall>i<n. R (\<acute>Muts!i)<length \<acute>E 
   80.11                            \<and> T (\<acute>Muts!i)<length \<acute>M) \<guillemotright>"
   80.12  
   80.13 -  Mul_Redirect_Edge  :: "nat \<Rightarrow> nat \<Rightarrow> mul_gar_coll_state ann_com"
   80.14 +definition Mul_Redirect_Edge  :: "nat \<Rightarrow> nat \<Rightarrow> mul_gar_coll_state ann_com" where
   80.15    "Mul_Redirect_Edge j n \<equiv>
   80.16    .{\<acute>Mul_mut_init n \<and> Z (\<acute>Muts!j)}.
   80.17    \<langle>IF T(\<acute>Muts!j) \<in> Reach \<acute>E THEN  
   80.18    \<acute>E:= \<acute>E[R (\<acute>Muts!j):= (fst (\<acute>E!R(\<acute>Muts!j)), T (\<acute>Muts!j))] FI,, 
   80.19    \<acute>Muts:= \<acute>Muts[j:= (\<acute>Muts!j) \<lparr>Z:=False\<rparr>]\<rangle>"
   80.20  
   80.21 -  Mul_Color_Target :: "nat \<Rightarrow> nat \<Rightarrow> mul_gar_coll_state ann_com"
   80.22 +definition Mul_Color_Target :: "nat \<Rightarrow> nat \<Rightarrow> mul_gar_coll_state ann_com" where
   80.23    "Mul_Color_Target j n \<equiv>
   80.24    .{\<acute>Mul_mut_init n \<and> \<not> Z (\<acute>Muts!j)}. 
   80.25    \<langle>\<acute>M:=\<acute>M[T (\<acute>Muts!j):=Black],, \<acute>Muts:=\<acute>Muts[j:= (\<acute>Muts!j) \<lparr>Z:=True\<rparr>]\<rangle>"
   80.26  
   80.27 -  Mul_Mutator :: "nat \<Rightarrow> nat \<Rightarrow>  mul_gar_coll_state ann_com"
   80.28 +definition Mul_Mutator :: "nat \<Rightarrow> nat \<Rightarrow>  mul_gar_coll_state ann_com" where
   80.29    "Mul_Mutator j n \<equiv>
   80.30    .{\<acute>Mul_mut_init n \<and> Z (\<acute>Muts!j)}.  
   80.31    WHILE True  
   80.32 @@ -156,28 +155,25 @@
   80.33  
   80.34  subsection {* The Collector *}
   80.35  
   80.36 -constdefs
   80.37 -  Queue :: "mul_gar_coll_state \<Rightarrow> nat"
   80.38 +definition Queue :: "mul_gar_coll_state \<Rightarrow> nat" where
   80.39   "Queue \<equiv> \<guillemotleft> length (filter (\<lambda>i. \<not> Z i \<and> \<acute>M!(T i) \<noteq> Black) \<acute>Muts) \<guillemotright>"
   80.40  
   80.41  consts  M_init :: nodes
   80.42  
   80.43 -constdefs
   80.44 -  Proper_M_init :: "mul_gar_coll_state \<Rightarrow> bool"
   80.45 +definition Proper_M_init :: "mul_gar_coll_state \<Rightarrow> bool" where
   80.46    "Proper_M_init \<equiv> \<guillemotleft> Blacks M_init=Roots \<and> length M_init=length \<acute>M \<guillemotright>"
   80.47  
   80.48 -  Mul_Proper :: "mul_gar_coll_state \<Rightarrow> nat \<Rightarrow> bool"
   80.49 +definition Mul_Proper :: "mul_gar_coll_state \<Rightarrow> nat \<Rightarrow> bool" where
   80.50    "Mul_Proper \<equiv> \<guillemotleft> \<lambda>n. Proper_Roots \<acute>M \<and> Proper_Edges (\<acute>M, \<acute>E) \<and> \<acute>Proper_M_init \<and> n=length \<acute>Muts \<guillemotright>"
   80.51  
   80.52 -  Safe :: "mul_gar_coll_state \<Rightarrow> bool"
   80.53 +definition Safe :: "mul_gar_coll_state \<Rightarrow> bool" where
   80.54    "Safe \<equiv> \<guillemotleft> Reach \<acute>E \<subseteq> Blacks \<acute>M \<guillemotright>"
   80.55  
   80.56  lemmas mul_collector_defs = Proper_M_init_def Mul_Proper_def Safe_def
   80.57  
   80.58  subsubsection {* Blackening Roots *}
   80.59  
   80.60 -constdefs
   80.61 -  Mul_Blacken_Roots :: "nat \<Rightarrow>  mul_gar_coll_state ann_com"
   80.62 +definition Mul_Blacken_Roots :: "nat \<Rightarrow>  mul_gar_coll_state ann_com" where
   80.63    "Mul_Blacken_Roots n \<equiv>
   80.64    .{\<acute>Mul_Proper n}.
   80.65    \<acute>ind:=0;;
   80.66 @@ -208,16 +204,14 @@
   80.67  
   80.68  subsubsection {* Propagating Black *} 
   80.69  
   80.70 -constdefs
   80.71 -  Mul_PBInv :: "mul_gar_coll_state \<Rightarrow> bool"
   80.72 +definition Mul_PBInv :: "mul_gar_coll_state \<Rightarrow> bool" where
   80.73    "Mul_PBInv \<equiv>  \<guillemotleft>\<acute>Safe \<or> \<acute>obc\<subset>Blacks \<acute>M \<or> \<acute>l<\<acute>Queue 
   80.74                   \<or> (\<forall>i<\<acute>ind. \<not>BtoW(\<acute>E!i,\<acute>M)) \<and> \<acute>l\<le>\<acute>Queue\<guillemotright>"
   80.75  
   80.76 -  Mul_Auxk :: "mul_gar_coll_state \<Rightarrow> bool"
   80.77 +definition Mul_Auxk :: "mul_gar_coll_state \<Rightarrow> bool" where
   80.78    "Mul_Auxk \<equiv> \<guillemotleft>\<acute>l<\<acute>Queue \<or> \<acute>M!\<acute>k\<noteq>Black \<or> \<not>BtoW(\<acute>E!\<acute>ind, \<acute>M) \<or> \<acute>obc\<subset>Blacks \<acute>M\<guillemotright>"
   80.79  
   80.80 -constdefs
   80.81 -  Mul_Propagate_Black :: "nat \<Rightarrow>  mul_gar_coll_state ann_com"
   80.82 +definition Mul_Propagate_Black :: "nat \<Rightarrow>  mul_gar_coll_state ann_com" where
   80.83    "Mul_Propagate_Black n \<equiv>
   80.84   .{\<acute>Mul_Proper n \<and> Roots\<subseteq>Blacks \<acute>M \<and> \<acute>obc\<subseteq>Blacks \<acute>M \<and> \<acute>bc\<subseteq>Blacks \<acute>M 
   80.85    \<and> (\<acute>Safe \<or> \<acute>l\<le>\<acute>Queue \<or> \<acute>obc\<subset>Blacks \<acute>M)}. 
   80.86 @@ -296,11 +290,10 @@
   80.87  
   80.88  subsubsection {* Counting Black Nodes *}
   80.89  
   80.90 -constdefs
   80.91 -  Mul_CountInv :: "mul_gar_coll_state \<Rightarrow> nat \<Rightarrow> bool"
   80.92 - "Mul_CountInv \<equiv> \<guillemotleft> \<lambda>ind. {i. i<ind \<and> \<acute>Ma!i=Black}\<subseteq>\<acute>bc \<guillemotright>"
   80.93 +definition Mul_CountInv :: "mul_gar_coll_state \<Rightarrow> nat \<Rightarrow> bool" where
   80.94 +  "Mul_CountInv \<equiv> \<guillemotleft> \<lambda>ind. {i. i<ind \<and> \<acute>Ma!i=Black}\<subseteq>\<acute>bc \<guillemotright>"
   80.95  
   80.96 -  Mul_Count :: "nat \<Rightarrow>  mul_gar_coll_state ann_com"
   80.97 +definition Mul_Count :: "nat \<Rightarrow>  mul_gar_coll_state ann_com" where
   80.98    "Mul_Count n \<equiv> 
   80.99    .{\<acute>Mul_Proper n \<and> Roots\<subseteq>Blacks \<acute>M 
  80.100      \<and> \<acute>obc\<subseteq>Blacks \<acute>Ma \<and> Blacks \<acute>Ma\<subseteq>Blacks \<acute>M \<and> \<acute>bc\<subseteq>Blacks \<acute>M 
  80.101 @@ -396,11 +389,10 @@
  80.102    Append_to_free2: "i \<notin> Reach e 
  80.103             \<Longrightarrow> n \<in> Reach (Append_to_free(i, e)) = ( n = i \<or> n \<in> Reach e)"
  80.104  
  80.105 -constdefs
  80.106 -  Mul_AppendInv :: "mul_gar_coll_state \<Rightarrow> nat \<Rightarrow> bool"
  80.107 +definition Mul_AppendInv :: "mul_gar_coll_state \<Rightarrow> nat \<Rightarrow> bool" where
  80.108    "Mul_AppendInv \<equiv> \<guillemotleft> \<lambda>ind. (\<forall>i. ind\<le>i \<longrightarrow> i<length \<acute>M \<longrightarrow> i\<in>Reach \<acute>E \<longrightarrow> \<acute>M!i=Black)\<guillemotright>"
  80.109  
  80.110 -  Mul_Append :: "nat \<Rightarrow>  mul_gar_coll_state ann_com"
  80.111 +definition Mul_Append :: "nat \<Rightarrow>  mul_gar_coll_state ann_com" where
  80.112    "Mul_Append n \<equiv> 
  80.113    .{\<acute>Mul_Proper n \<and> Roots\<subseteq>Blacks \<acute>M \<and> \<acute>Safe}.
  80.114    \<acute>ind:=0;;
  80.115 @@ -438,8 +430,7 @@
  80.116  
  80.117  subsubsection {* Collector *}
  80.118  
  80.119 -constdefs 
  80.120 -  Mul_Collector :: "nat \<Rightarrow>  mul_gar_coll_state ann_com"
  80.121 +definition Mul_Collector :: "nat \<Rightarrow>  mul_gar_coll_state ann_com" where
  80.122    "Mul_Collector n \<equiv>
  80.123  .{\<acute>Mul_Proper n}.  
  80.124  WHILE True INV .{\<acute>Mul_Proper n}. 
    81.1 --- a/src/HOL/Hoare_Parallel/OG_Hoare.thy	Wed Feb 24 11:55:52 2010 +0100
    81.2 +++ b/src/HOL/Hoare_Parallel/OG_Hoare.thy	Mon Mar 01 13:40:23 2010 +0100
    81.3 @@ -27,12 +27,12 @@
    81.4  consts post :: "'a ann_triple_op \<Rightarrow> 'a assn"
    81.5  primrec "post (c, q) = q"
    81.6  
    81.7 -constdefs  interfree_aux :: "('a ann_com_op \<times> 'a assn \<times> 'a ann_com_op) \<Rightarrow> bool"
    81.8 +definition interfree_aux :: "('a ann_com_op \<times> 'a assn \<times> 'a ann_com_op) \<Rightarrow> bool" where
    81.9    "interfree_aux \<equiv> \<lambda>(co, q, co'). co'= None \<or>  
   81.10                      (\<forall>(r,a) \<in> atomics (the co'). \<parallel>= (q \<inter> r) a q \<and>
   81.11                      (co = None \<or> (\<forall>p \<in> assertions (the co). \<parallel>= (p \<inter> r) a p)))"
   81.12  
   81.13 -constdefs interfree :: "(('a ann_triple_op) list) \<Rightarrow> bool" 
   81.14 +definition interfree :: "(('a ann_triple_op) list) \<Rightarrow> bool" where 
   81.15    "interfree Ts \<equiv> \<forall>i j. i < length Ts \<and> j < length Ts \<and> i \<noteq> j \<longrightarrow> 
   81.16                           interfree_aux (com (Ts!i), post (Ts!i), com (Ts!j)) "
   81.17  
    82.1 --- a/src/HOL/Hoare_Parallel/OG_Tactics.thy	Wed Feb 24 11:55:52 2010 +0100
    82.2 +++ b/src/HOL/Hoare_Parallel/OG_Tactics.thy	Mon Mar 01 13:40:23 2010 +0100
    82.3 @@ -171,8 +171,7 @@
    82.4    "\<parallel>- (q \<inter> (r \<inter> b)) a q \<Longrightarrow> interfree_aux (None, q, Some (AnnAwait r b a))"
    82.5  by(simp add: interfree_aux_def oghoare_sound)
    82.6  
    82.7 -constdefs 
    82.8 -  interfree_swap :: "('a ann_triple_op * ('a ann_triple_op) list) \<Rightarrow> bool"
    82.9 +definition interfree_swap :: "('a ann_triple_op * ('a ann_triple_op) list) \<Rightarrow> bool" where
   82.10    "interfree_swap == \<lambda>(x, xs). \<forall>y\<in>set xs. interfree_aux (com x, post x, com y)
   82.11    \<and> interfree_aux(com y, post y, com x)"
   82.12  
   82.13 @@ -208,7 +207,7 @@
   82.14    \<Longrightarrow> interfree (map (\<lambda>k. (c k, Q k)) [a..<b])"
   82.15  by(force simp add: interfree_def less_diff_conv)
   82.16  
   82.17 -constdefs map_ann_hoare :: "(('a ann_com_op * 'a assn) list) \<Rightarrow> bool " ("[\<turnstile>] _" [0] 45)
   82.18 +definition map_ann_hoare :: "(('a ann_com_op * 'a assn) list) \<Rightarrow> bool " ("[\<turnstile>] _" [0] 45) where
   82.19    "[\<turnstile>] Ts == (\<forall>i<length Ts. \<exists>c q. Ts!i=(Some c, q) \<and> \<turnstile> c q)"
   82.20  
   82.21  lemma MapAnnEmpty: "[\<turnstile>] []"
    83.1 --- a/src/HOL/Hoare_Parallel/OG_Tran.thy	Wed Feb 24 11:55:52 2010 +0100
    83.2 +++ b/src/HOL/Hoare_Parallel/OG_Tran.thy	Mon Mar 01 13:40:23 2010 +0100
    83.3 @@ -7,14 +7,13 @@
    83.4    'a ann_com_op = "('a ann_com) option"
    83.5    'a ann_triple_op = "('a ann_com_op \<times> 'a assn)"
    83.6    
    83.7 -consts com :: "'a ann_triple_op \<Rightarrow> 'a ann_com_op"
    83.8 -primrec "com (c, q) = c"
    83.9 +primrec com :: "'a ann_triple_op \<Rightarrow> 'a ann_com_op" where
   83.10 +  "com (c, q) = c"
   83.11  
   83.12 -consts post :: "'a ann_triple_op \<Rightarrow> 'a assn"
   83.13 -primrec "post (c, q) = q"
   83.14 +primrec post :: "'a ann_triple_op \<Rightarrow> 'a assn" where
   83.15 +  "post (c, q) = q"
   83.16  
   83.17 -constdefs
   83.18 -  All_None :: "'a ann_triple_op list \<Rightarrow> bool"
   83.19 +definition All_None :: "'a ann_triple_op list \<Rightarrow> bool" where
   83.20    "All_None Ts \<equiv> \<forall>(c, q) \<in> set Ts. c = None"
   83.21  
   83.22  subsection {* The Transition Relation *}
   83.23 @@ -88,26 +87,24 @@
   83.24  
   83.25  subsection {* Definition of Semantics *}
   83.26  
   83.27 -constdefs
   83.28 -  ann_sem :: "'a ann_com \<Rightarrow> 'a \<Rightarrow> 'a set"
   83.29 +definition ann_sem :: "'a ann_com \<Rightarrow> 'a \<Rightarrow> 'a set" where
   83.30    "ann_sem c \<equiv> \<lambda>s. {t. (Some c, s) -*\<rightarrow> (None, t)}"
   83.31  
   83.32 -  ann_SEM :: "'a ann_com \<Rightarrow> 'a set \<Rightarrow> 'a set"
   83.33 +definition ann_SEM :: "'a ann_com \<Rightarrow> 'a set \<Rightarrow> 'a set" where
   83.34    "ann_SEM c S \<equiv> \<Union>ann_sem c ` S"  
   83.35  
   83.36 -  sem :: "'a com \<Rightarrow> 'a \<Rightarrow> 'a set"
   83.37 +definition sem :: "'a com \<Rightarrow> 'a \<Rightarrow> 'a set" where
   83.38    "sem c \<equiv> \<lambda>s. {t. \<exists>Ts. (c, s) -P*\<rightarrow> (Parallel Ts, t) \<and> All_None Ts}"
   83.39  
   83.40 -  SEM :: "'a com \<Rightarrow> 'a set \<Rightarrow> 'a set"
   83.41 +definition SEM :: "'a com \<Rightarrow> 'a set \<Rightarrow> 'a set" where
   83.42    "SEM c S \<equiv> \<Union>sem c ` S "
   83.43  
   83.44  abbreviation Omega :: "'a com"    ("\<Omega>" 63)
   83.45    where "\<Omega> \<equiv> While UNIV UNIV (Basic id)"
   83.46  
   83.47 -consts fwhile :: "'a bexp \<Rightarrow> 'a com \<Rightarrow> nat \<Rightarrow> 'a com"
   83.48 -primrec 
   83.49 -   "fwhile b c 0 = \<Omega>"
   83.50 -   "fwhile b c (Suc n) = Cond b (Seq c (fwhile b c n)) (Basic id)"
   83.51 +primrec fwhile :: "'a bexp \<Rightarrow> 'a com \<Rightarrow> nat \<Rightarrow> 'a com" where
   83.52 +    "fwhile b c 0 = \<Omega>"
   83.53 +  | "fwhile b c (Suc n) = Cond b (Seq c (fwhile b c n)) (Basic id)"
   83.54  
   83.55  subsubsection {* Proofs *}
   83.56  
   83.57 @@ -299,11 +296,10 @@
   83.58  
   83.59  section {* Validity of Correctness Formulas *}
   83.60  
   83.61 -constdefs 
   83.62 -  com_validity :: "'a assn \<Rightarrow> 'a com \<Rightarrow> 'a assn \<Rightarrow> bool"  ("(3\<parallel>= _// _//_)" [90,55,90] 50)
   83.63 +definition com_validity :: "'a assn \<Rightarrow> 'a com \<Rightarrow> 'a assn \<Rightarrow> bool" ("(3\<parallel>= _// _//_)" [90,55,90] 50) where
   83.64    "\<parallel>= p c q \<equiv> SEM c p \<subseteq> q"
   83.65  
   83.66 -  ann_com_validity :: "'a ann_com \<Rightarrow> 'a assn \<Rightarrow> bool"   ("\<Turnstile> _ _" [60,90] 45)
   83.67 +definition ann_com_validity :: "'a ann_com \<Rightarrow> 'a assn \<Rightarrow> bool" ("\<Turnstile> _ _" [60,90] 45) where
   83.68    "\<Turnstile> c q \<equiv> ann_SEM c (pre c) \<subseteq> q"
   83.69  
   83.70  end
   83.71 \ No newline at end of file
    84.1 --- a/src/HOL/Hoare_Parallel/RG_Hoare.thy	Wed Feb 24 11:55:52 2010 +0100
    84.2 +++ b/src/HOL/Hoare_Parallel/RG_Hoare.thy	Mon Mar 01 13:40:23 2010 +0100
    84.3 @@ -7,8 +7,7 @@
    84.4  declare Un_subset_iff [simp del] le_sup_iff [simp del]
    84.5  declare Cons_eq_map_conv [iff]
    84.6  
    84.7 -constdefs
    84.8 -  stable :: "'a set \<Rightarrow> ('a \<times> 'a) set \<Rightarrow> bool"  
    84.9 +definition stable :: "'a set \<Rightarrow> ('a \<times> 'a) set \<Rightarrow> bool" where  
   84.10    "stable \<equiv> \<lambda>f g. (\<forall>x y. x \<in> f \<longrightarrow> (x, y) \<in> g \<longrightarrow> y \<in> f)" 
   84.11  
   84.12  inductive
   84.13 @@ -39,16 +38,19 @@
   84.14               \<turnstile> P sat [pre', rely', guar', post'] \<rbrakk>
   84.15              \<Longrightarrow> \<turnstile> P sat [pre, rely, guar, post]"
   84.16  
   84.17 -constdefs 
   84.18 -  Pre :: "'a rgformula \<Rightarrow> 'a set"
   84.19 +definition Pre :: "'a rgformula \<Rightarrow> 'a set" where
   84.20    "Pre x \<equiv> fst(snd x)"
   84.21 -  Post :: "'a rgformula \<Rightarrow> 'a set"
   84.22 +
   84.23 +definition Post :: "'a rgformula \<Rightarrow> 'a set" where
   84.24    "Post x \<equiv> snd(snd(snd(snd x)))"
   84.25 -  Rely :: "'a rgformula \<Rightarrow> ('a \<times> 'a) set"
   84.26 +
   84.27 +definition Rely :: "'a rgformula \<Rightarrow> ('a \<times> 'a) set" where
   84.28    "Rely x \<equiv> fst(snd(snd x))"
   84.29 -  Guar :: "'a rgformula \<Rightarrow> ('a \<times> 'a) set"
   84.30 +
   84.31 +definition Guar :: "'a rgformula \<Rightarrow> ('a \<times> 'a) set" where
   84.32    "Guar x \<equiv> fst(snd(snd(snd x)))"
   84.33 -  Com :: "'a rgformula \<Rightarrow> 'a com"
   84.34 +
   84.35 +definition Com :: "'a rgformula \<Rightarrow> 'a com" where
   84.36    "Com x \<equiv> fst x"
   84.37  
   84.38  subsection {* Proof System for Parallel Programs *}
   84.39 @@ -1093,8 +1095,7 @@
   84.40  
   84.41  subsection {* Soundness of the System for Parallel Programs *}
   84.42  
   84.43 -constdefs
   84.44 -  ParallelCom :: "('a rgformula) list \<Rightarrow> 'a par_com"
   84.45 +definition ParallelCom :: "('a rgformula) list \<Rightarrow> 'a par_com" where
   84.46    "ParallelCom Ps \<equiv> map (Some \<circ> fst) Ps" 
   84.47  
   84.48  lemma two: 
    85.1 --- a/src/HOL/Hoare_Parallel/RG_Tran.thy	Wed Feb 24 11:55:52 2010 +0100
    85.2 +++ b/src/HOL/Hoare_Parallel/RG_Tran.thy	Mon Mar 01 13:40:23 2010 +0100
    85.3 @@ -81,8 +81,7 @@
    85.4  | CptnEnv: "(P, t)#xs \<in> cptn \<Longrightarrow> (P,s)#(P,t)#xs \<in> cptn"
    85.5  | CptnComp: "\<lbrakk>(P,s) -c\<rightarrow> (Q,t); (Q, t)#xs \<in> cptn \<rbrakk> \<Longrightarrow> (P,s)#(Q,t)#xs \<in> cptn"
    85.6  
    85.7 -constdefs
    85.8 -  cp :: "('a com) option \<Rightarrow> 'a \<Rightarrow> ('a confs) set"
    85.9 +definition cp :: "('a com) option \<Rightarrow> 'a \<Rightarrow> ('a confs) set" where
   85.10    "cp P s \<equiv> {l. l!0=(P,s) \<and> l \<in> cptn}"  
   85.11  
   85.12  subsubsection {* Parallel computations *}
   85.13 @@ -95,14 +94,12 @@
   85.14  | ParCptnEnv: "(P,t)#xs \<in> par_cptn \<Longrightarrow> (P,s)#(P,t)#xs \<in> par_cptn"
   85.15  | ParCptnComp: "\<lbrakk> (P,s) -pc\<rightarrow> (Q,t); (Q,t)#xs \<in> par_cptn \<rbrakk> \<Longrightarrow> (P,s)#(Q,t)#xs \<in> par_cptn"
   85.16  
   85.17 -constdefs
   85.18 -  par_cp :: "'a par_com \<Rightarrow> 'a \<Rightarrow> ('a par_confs) set"
   85.19 +definition par_cp :: "'a par_com \<Rightarrow> 'a \<Rightarrow> ('a par_confs) set" where
   85.20    "par_cp P s \<equiv> {l. l!0=(P,s) \<and> l \<in> par_cptn}"  
   85.21  
   85.22  subsection{* Modular Definition of Computation *}
   85.23  
   85.24 -constdefs 
   85.25 -  lift :: "'a com \<Rightarrow> 'a conf \<Rightarrow> 'a conf"
   85.26 +definition lift :: "'a com \<Rightarrow> 'a conf \<Rightarrow> 'a conf" where
   85.27    "lift Q \<equiv> \<lambda>(P, s). (if P=None then (Some Q,s) else (Some(Seq (the P) Q), s))"
   85.28  
   85.29  inductive_set cptn_mod :: "('a confs) set"
   85.30 @@ -380,38 +377,36 @@
   85.31  
   85.32  types 'a rgformula = "'a com \<times> 'a set \<times> ('a \<times> 'a) set \<times> ('a \<times> 'a) set \<times> 'a set"
   85.33  
   85.34 -constdefs
   85.35 -  assum :: "('a set \<times> ('a \<times> 'a) set) \<Rightarrow> ('a confs) set"
   85.36 +definition assum :: "('a set \<times> ('a \<times> 'a) set) \<Rightarrow> ('a confs) set" where
   85.37    "assum \<equiv> \<lambda>(pre, rely). {c. snd(c!0) \<in> pre \<and> (\<forall>i. Suc i<length c \<longrightarrow> 
   85.38                 c!i -e\<rightarrow> c!(Suc i) \<longrightarrow> (snd(c!i), snd(c!Suc i)) \<in> rely)}"
   85.39  
   85.40 -  comm :: "(('a \<times> 'a) set \<times> 'a set) \<Rightarrow> ('a confs) set"
   85.41 +definition comm :: "(('a \<times> 'a) set \<times> 'a set) \<Rightarrow> ('a confs) set" where
   85.42    "comm \<equiv> \<lambda>(guar, post). {c. (\<forall>i. Suc i<length c \<longrightarrow> 
   85.43                 c!i -c\<rightarrow> c!(Suc i) \<longrightarrow> (snd(c!i), snd(c!Suc i)) \<in> guar) \<and> 
   85.44                 (fst (last c) = None \<longrightarrow> snd (last c) \<in> post)}"
   85.45  
   85.46 -  com_validity :: "'a com \<Rightarrow> 'a set \<Rightarrow> ('a \<times> 'a) set \<Rightarrow> ('a \<times> 'a) set \<Rightarrow> 'a set \<Rightarrow> bool" 
   85.47 -                 ("\<Turnstile> _ sat [_, _, _, _]" [60,0,0,0,0] 45)
   85.48 +definition com_validity :: "'a com \<Rightarrow> 'a set \<Rightarrow> ('a \<times> 'a) set \<Rightarrow> ('a \<times> 'a) set \<Rightarrow> 'a set \<Rightarrow> bool" 
   85.49 +                 ("\<Turnstile> _ sat [_, _, _, _]" [60,0,0,0,0] 45) where
   85.50    "\<Turnstile> P sat [pre, rely, guar, post] \<equiv> 
   85.51     \<forall>s. cp (Some P) s \<inter> assum(pre, rely) \<subseteq> comm(guar, post)"
   85.52  
   85.53  subsection {* Validity for Parallel Programs. *}
   85.54  
   85.55 -constdefs
   85.56 -  All_None :: "(('a com) option) list \<Rightarrow> bool"
   85.57 +definition All_None :: "(('a com) option) list \<Rightarrow> bool" where
   85.58    "All_None xs \<equiv> \<forall>c\<in>set xs. c=None"
   85.59  
   85.60 -  par_assum :: "('a set \<times> ('a \<times> 'a) set) \<Rightarrow> ('a par_confs) set"
   85.61 +definition par_assum :: "('a set \<times> ('a \<times> 'a) set) \<Rightarrow> ('a par_confs) set" where
   85.62    "par_assum \<equiv> \<lambda>(pre, rely). {c. snd(c!0) \<in> pre \<and> (\<forall>i. Suc i<length c \<longrightarrow> 
   85.63               c!i -pe\<rightarrow> c!Suc i \<longrightarrow> (snd(c!i), snd(c!Suc i)) \<in> rely)}"
   85.64  
   85.65 -  par_comm :: "(('a \<times> 'a) set \<times> 'a set) \<Rightarrow> ('a par_confs) set"
   85.66 +definition par_comm :: "(('a \<times> 'a) set \<times> 'a set) \<Rightarrow> ('a par_confs) set" where
   85.67    "par_comm \<equiv> \<lambda>(guar, post). {c. (\<forall>i. Suc i<length c \<longrightarrow>   
   85.68          c!i -pc\<rightarrow> c!Suc i \<longrightarrow> (snd(c!i), snd(c!Suc i)) \<in> guar) \<and> 
   85.69           (All_None (fst (last c)) \<longrightarrow> snd( last c) \<in> post)}"
   85.70  
   85.71 -  par_com_validity :: "'a  par_com \<Rightarrow> 'a set \<Rightarrow> ('a \<times> 'a) set \<Rightarrow> ('a \<times> 'a) set 
   85.72 -\<Rightarrow> 'a set \<Rightarrow> bool"  ("\<Turnstile> _ SAT [_, _, _, _]" [60,0,0,0,0] 45)
   85.73 +definition par_com_validity :: "'a  par_com \<Rightarrow> 'a set \<Rightarrow> ('a \<times> 'a) set \<Rightarrow> ('a \<times> 'a) set 
   85.74 +\<Rightarrow> 'a set \<Rightarrow> bool"  ("\<Turnstile> _ SAT [_, _, _, _]" [60,0,0,0,0] 45) where
   85.75    "\<Turnstile> Ps SAT [pre, rely, guar, post] \<equiv> 
   85.76     \<forall>s. par_cp Ps s \<inter> par_assum(pre, rely) \<subseteq> par_comm(guar, post)"
   85.77  
   85.78 @@ -419,23 +414,22 @@
   85.79  
   85.80  subsubsection {* Definition of the conjoin operator *}
   85.81  
   85.82 -constdefs
   85.83 -  same_length :: "'a par_confs \<Rightarrow> ('a confs) list \<Rightarrow> bool"
   85.84 +definition same_length :: "'a par_confs \<Rightarrow> ('a confs) list \<Rightarrow> bool" where
   85.85    "same_length c clist \<equiv> (\<forall>i<length clist. length(clist!i)=length c)"
   85.86   
   85.87 -  same_state :: "'a par_confs \<Rightarrow> ('a confs) list \<Rightarrow> bool"
   85.88 +definition same_state :: "'a par_confs \<Rightarrow> ('a confs) list \<Rightarrow> bool" where
   85.89    "same_state c clist \<equiv> (\<forall>i <length clist. \<forall>j<length c. snd(c!j) = snd((clist!i)!j))"
   85.90  
   85.91 -  same_program :: "'a par_confs \<Rightarrow> ('a confs) list \<Rightarrow> bool"
   85.92 +definition same_program :: "'a par_confs \<Rightarrow> ('a confs) list \<Rightarrow> bool" where
   85.93    "same_program c clist \<equiv> (\<forall>j<length c. fst(c!j) = map (\<lambda>x. fst(nth x j)) clist)"
   85.94  
   85.95 -  compat_label :: "'a par_confs \<Rightarrow> ('a confs) list \<Rightarrow> bool"
   85.96 +definition compat_label :: "'a par_confs \<Rightarrow> ('a confs) list \<Rightarrow> bool" where
   85.97    "compat_label c clist \<equiv> (\<forall>j. Suc j<length c \<longrightarrow> 
   85.98           (c!j -pc\<rightarrow> c!Suc j \<and> (\<exists>i<length clist. (clist!i)!j -c\<rightarrow> (clist!i)! Suc j \<and> 
   85.99                         (\<forall>l<length clist. l\<noteq>i \<longrightarrow> (clist!l)!j -e\<rightarrow> (clist!l)! Suc j))) \<or> 
  85.100           (c!j -pe\<rightarrow> c!Suc j \<and> (\<forall>i<length clist. (clist!i)!j -e\<rightarrow> (clist!i)! Suc j)))"
  85.101  
  85.102 -  conjoin :: "'a par_confs \<Rightarrow> ('a confs) list \<Rightarrow> bool"  ("_ \<propto> _" [65,65] 64)
  85.103 +definition conjoin :: "'a par_confs \<Rightarrow> ('a confs) list \<Rightarrow> bool"  ("_ \<propto> _" [65,65] 64) where
  85.104    "c \<propto> clist \<equiv> (same_length c clist) \<and> (same_state c clist) \<and> (same_program c clist) \<and> (compat_label c clist)"
  85.105  
  85.106  subsubsection {* Some previous lemmas *}
    86.1 --- a/src/HOL/IOA/Solve.thy	Wed Feb 24 11:55:52 2010 +0100
    86.2 +++ b/src/HOL/IOA/Solve.thy	Mon Mar 01 13:40:23 2010 +0100
    86.3 @@ -10,9 +10,7 @@
    86.4  imports IOA
    86.5  begin
    86.6  
    86.7 -constdefs
    86.8 -
    86.9 -  is_weak_pmap :: "['c => 'a, ('action,'c)ioa,('action,'a)ioa] => bool"
   86.10 +definition is_weak_pmap :: "['c => 'a, ('action,'c)ioa,('action,'a)ioa] => bool" where
   86.11    "is_weak_pmap f C A ==
   86.12     (!s:starts_of(C). f(s):starts_of(A)) &
   86.13     (!s t a. reachable C s &
    87.1 --- a/src/HOL/Import/HOL/HOL4Base.thy	Wed Feb 24 11:55:52 2010 +0100
    87.2 +++ b/src/HOL/Import/HOL/HOL4Base.thy	Mon Mar 01 13:40:23 2010 +0100
    87.3 @@ -4,22 +4,19 @@
    87.4  
    87.5  ;setup_theory bool
    87.6  
    87.7 -constdefs
    87.8 -  ARB :: "'a" 
    87.9 +definition ARB :: "'a" where 
   87.10    "ARB == SOME x::'a::type. True"
   87.11  
   87.12  lemma ARB_DEF: "ARB = (SOME x::'a::type. True)"
   87.13    by (import bool ARB_DEF)
   87.14  
   87.15 -constdefs
   87.16 -  IN :: "'a => ('a => bool) => bool" 
   87.17 +definition IN :: "'a => ('a => bool) => bool" where 
   87.18    "IN == %(x::'a::type) f::'a::type => bool. f x"
   87.19  
   87.20  lemma IN_DEF: "IN = (%(x::'a::type) f::'a::type => bool. f x)"
   87.21    by (import bool IN_DEF)
   87.22  
   87.23 -constdefs
   87.24 -  RES_FORALL :: "('a => bool) => ('a => bool) => bool" 
   87.25 +definition RES_FORALL :: "('a => bool) => ('a => bool) => bool" where 
   87.26    "RES_FORALL ==
   87.27  %(p::'a::type => bool) m::'a::type => bool. ALL x::'a::type. IN x p --> m x"
   87.28  
   87.29 @@ -28,8 +25,7 @@
   87.30      ALL x::'a::type. IN x p --> m x)"
   87.31    by (import bool RES_FORALL_DEF)
   87.32  
   87.33 -constdefs
   87.34 -  RES_EXISTS :: "('a => bool) => ('a => bool) => bool" 
   87.35 +definition RES_EXISTS :: "('a => bool) => ('a => bool) => bool" where 
   87.36    "RES_EXISTS ==
   87.37  %(p::'a::type => bool) m::'a::type => bool. EX x::'a::type. IN x p & m x"
   87.38  
   87.39 @@ -37,8 +33,7 @@
   87.40  (%(p::'a::type => bool) m::'a::type => bool. EX x::'a::type. IN x p & m x)"
   87.41    by (import bool RES_EXISTS_DEF)
   87.42  
   87.43 -constdefs
   87.44 -  RES_EXISTS_UNIQUE :: "('a => bool) => ('a => bool) => bool" 
   87.45 +definition RES_EXISTS_UNIQUE :: "('a => bool) => ('a => bool) => bool" where 
   87.46    "RES_EXISTS_UNIQUE ==
   87.47  %(p::'a::type => bool) m::'a::type => bool.
   87.48     RES_EXISTS p m &
   87.49 @@ -52,8 +47,7 @@
   87.50       (%x::'a::type. RES_FORALL p (%y::'a::type. m x & m y --> x = y)))"
   87.51    by (import bool RES_EXISTS_UNIQUE_DEF)
   87.52  
   87.53 -constdefs
   87.54 -  RES_SELECT :: "('a => bool) => ('a => bool) => 'a" 
   87.55 +definition RES_SELECT :: "('a => bool) => ('a => bool) => 'a" where 
   87.56    "RES_SELECT ==
   87.57  %(p::'a::type => bool) m::'a::type => bool. SOME x::'a::type. IN x p & m x"
   87.58  
   87.59 @@ -264,15 +258,13 @@
   87.60  
   87.61  ;setup_theory combin
   87.62  
   87.63 -constdefs
   87.64 -  K :: "'a => 'b => 'a" 
   87.65 +definition K :: "'a => 'b => 'a" where 
   87.66    "K == %(x::'a::type) y::'b::type. x"
   87.67  
   87.68  lemma K_DEF: "K = (%(x::'a::type) y::'b::type. x)"
   87.69    by (import combin K_DEF)
   87.70  
   87.71 -constdefs
   87.72 -  S :: "('a => 'b => 'c) => ('a => 'b) => 'a => 'c" 
   87.73 +definition S :: "('a => 'b => 'c) => ('a => 'b) => 'a => 'c" where 
   87.74    "S ==
   87.75  %(f::'a::type => 'b::type => 'c::type) (g::'a::type => 'b::type)
   87.76     x::'a::type. f x (g x)"
   87.77 @@ -282,8 +274,7 @@
   87.78      x::'a::type. f x (g x))"
   87.79    by (import combin S_DEF)
   87.80  
   87.81 -constdefs
   87.82 -  I :: "'a => 'a" 
   87.83 +definition I :: "'a => 'a" where 
   87.84    "(op ==::('a::type => 'a::type) => ('a::type => 'a::type) => prop)
   87.85   (I::'a::type => 'a::type)
   87.86   ((S::('a::type => ('a::type => 'a::type) => 'a::type)
   87.87 @@ -299,16 +290,14 @@
   87.88     (K::'a::type => 'a::type => 'a::type))"
   87.89    by (import combin I_DEF)
   87.90  
   87.91 -constdefs
   87.92 -  C :: "('a => 'b => 'c) => 'b => 'a => 'c" 
   87.93 +definition C :: "('a => 'b => 'c) => 'b => 'a => 'c" where 
   87.94    "C == %(f::'a::type => 'b::type => 'c::type) (x::'b::type) y::'a::type. f y x"
   87.95  
   87.96  lemma C_DEF: "C =
   87.97  (%(f::'a::type => 'b::type => 'c::type) (x::'b::type) y::'a::type. f y x)"
   87.98    by (import combin C_DEF)
   87.99  
  87.100 -constdefs
  87.101 -  W :: "('a => 'a => 'b) => 'a => 'b" 
  87.102 +definition W :: "('a => 'a => 'b) => 'a => 'b" where 
  87.103    "W == %(f::'a::type => 'a::type => 'b::type) x::'a::type. f x x"
  87.104  
  87.105  lemma W_DEF: "W = (%(f::'a::type => 'a::type => 'b::type) x::'a::type. f x x)"
  87.106 @@ -582,8 +571,7 @@
  87.107  
  87.108  ;setup_theory relation
  87.109  
  87.110 -constdefs
  87.111 -  TC :: "('a => 'a => bool) => 'a => 'a => bool" 
  87.112 +definition TC :: "('a => 'a => bool) => 'a => 'a => bool" where 
  87.113    "TC ==
  87.114  %(R::'a::type => 'a::type => bool) (a::'a::type) b::'a::type.
  87.115     ALL P::'a::type => 'a::type => bool.
  87.116 @@ -601,8 +589,7 @@
  87.117         P a b)"
  87.118    by (import relation TC_DEF)
  87.119  
  87.120 -constdefs
  87.121 -  RTC :: "('a => 'a => bool) => 'a => 'a => bool" 
  87.122 +definition RTC :: "('a => 'a => bool) => 'a => 'a => bool" where 
  87.123    "RTC ==
  87.124  %(R::'a::type => 'a::type => bool) (a::'a::type) b::'a::type.
  87.125     ALL P::'a::type => 'a::type => bool.
  87.126 @@ -644,8 +631,7 @@
  87.127     (ALL (x::'a::type) (y::'a::type) z::'a::type. R x y & R y z --> R x z)"
  87.128    by (import relation transitive_def)
  87.129  
  87.130 -constdefs
  87.131 -  pred_reflexive :: "('a => 'a => bool) => bool" 
  87.132 +definition pred_reflexive :: "('a => 'a => bool) => bool" where 
  87.133    "pred_reflexive == %R::'a::type => 'a::type => bool. ALL x::'a::type. R x x"
  87.134  
  87.135  lemma reflexive_def: "ALL R::'a::type => 'a::type => bool.
  87.136 @@ -788,8 +774,7 @@
  87.137     (ALL (x::'a::type) y::'a::type. RTC R x y --> RTC Q x y)"
  87.138    by (import relation RTC_MONOTONE)
  87.139  
  87.140 -constdefs
  87.141 -  WF :: "('a => 'a => bool) => bool" 
  87.142 +definition WF :: "('a => 'a => bool) => bool" where 
  87.143    "WF ==
  87.144  %R::'a::type => 'a::type => bool.
  87.145     ALL B::'a::type => bool.
  87.146 @@ -814,8 +799,7 @@
  87.147     WF x --> x xa xb --> xa ~= xb"
  87.148    by (import relation WF_NOT_REFL)
  87.149  
  87.150 -constdefs
  87.151 -  EMPTY_REL :: "'a => 'a => bool" 
  87.152 +definition EMPTY_REL :: "'a => 'a => bool" where 
  87.153    "EMPTY_REL == %(x::'a::type) y::'a::type. False"
  87.154  
  87.155  lemma EMPTY_REL_DEF: "ALL (x::'a::type) y::'a::type. EMPTY_REL x y = False"
  87.156 @@ -847,8 +831,7 @@
  87.157     WF R --> WF (relation.inv_image R f)"
  87.158    by (import relation WF_inv_image)
  87.159  
  87.160 -constdefs
  87.161 -  RESTRICT :: "('a => 'b) => ('a => 'a => bool) => 'a => 'a => 'b" 
  87.162 +definition RESTRICT :: "('a => 'b) => ('a => 'a => bool) => 'a => 'a => 'b" where 
  87.163    "RESTRICT ==
  87.164  %(f::'a::type => 'b::type) (R::'a::type => 'a::type => bool) (x::'a::type)
  87.165     y::'a::type. if R y x then f y else ARB"
  87.166 @@ -891,8 +874,7 @@
  87.167     the_fun R M x = Eps (approx R M x)"
  87.168    by (import relation the_fun_def)
  87.169  
  87.170 -constdefs
  87.171 -  WFREC :: "('a => 'a => bool) => (('a => 'b) => 'a => 'b) => 'a => 'b" 
  87.172 +definition WFREC :: "('a => 'a => bool) => (('a => 'b) => 'a => 'b) => 'a => 'b" where 
  87.173    "WFREC ==
  87.174  %(R::'a::type => 'a::type => bool)
  87.175     (M::('a::type => 'b::type) => 'a::type => 'b::type) x::'a::type.
  87.176 @@ -1052,8 +1034,7 @@
  87.177     split xb x = split f' xa"
  87.178    by (import pair pair_case_cong)
  87.179  
  87.180 -constdefs
  87.181 -  LEX :: "('a => 'a => bool) => ('b => 'b => bool) => 'a * 'b => 'a * 'b => bool" 
  87.182 +definition LEX :: "('a => 'a => bool) => ('b => 'b => bool) => 'a * 'b => 'a * 'b => bool" where 
  87.183    "LEX ==
  87.184  %(R1::'a::type => 'a::type => bool) (R2::'b::type => 'b::type => bool)
  87.185     (s::'a::type, t::'b::type) (u::'a::type, v::'b::type).
  87.186 @@ -1069,8 +1050,7 @@
  87.187     WF x & WF xa --> WF (LEX x xa)"
  87.188    by (import pair WF_LEX)
  87.189  
  87.190 -constdefs
  87.191 -  RPROD :: "('a => 'a => bool) => ('b => 'b => bool) => 'a * 'b => 'a * 'b => bool" 
  87.192 +definition RPROD :: "('a => 'a => bool) => ('b => 'b => bool) => 'a * 'b => 'a * 'b => bool" where 
  87.193    "RPROD ==
  87.194  %(R1::'a::type => 'a::type => bool) (R2::'b::type => 'b::type => bool)
  87.195     (s::'a::type, t::'b::type) (u::'a::type, v::'b::type). R1 s u & R2 t v"
  87.196 @@ -1113,8 +1093,7 @@
  87.197  lemma NOT_LESS_EQ: "ALL (m::nat) n::nat. m = n --> ~ m < n"
  87.198    by (import prim_rec NOT_LESS_EQ)
  87.199  
  87.200 -constdefs
  87.201 -  SIMP_REC_REL :: "(nat => 'a) => 'a => ('a => 'a) => nat => bool" 
  87.202 +definition SIMP_REC_REL :: "(nat => 'a) => 'a => ('a => 'a) => nat => bool" where 
  87.203    "(op ==::((nat => 'a::type)
  87.204           => 'a::type => ('a::type => 'a::type) => nat => bool)
  87.205          => ((nat => 'a::type)
  87.206 @@ -1187,8 +1166,7 @@
  87.207     (ALL m::nat. SIMP_REC x f (Suc m) = f (SIMP_REC x f m))"
  87.208    by (import prim_rec SIMP_REC_THM)
  87.209  
  87.210 -constdefs
  87.211 -  PRE :: "nat => nat" 
  87.212 +definition PRE :: "nat => nat" where 
  87.213    "PRE == %m::nat. if m = 0 then 0 else SOME n::nat. m = Suc n"
  87.214  
  87.215  lemma PRE_DEF: "ALL m::nat. PRE m = (if m = 0 then 0 else SOME n::nat. m = Suc n)"
  87.216 @@ -1197,8 +1175,7 @@
  87.217  lemma PRE: "PRE 0 = 0 & (ALL m::nat. PRE (Suc m) = m)"
  87.218    by (import prim_rec PRE)
  87.219  
  87.220 -constdefs
  87.221 -  PRIM_REC_FUN :: "'a => ('a => nat => 'a) => nat => nat => 'a" 
  87.222 +definition PRIM_REC_FUN :: "'a => ('a => nat => 'a) => nat => nat => 'a" where 
  87.223    "PRIM_REC_FUN ==
  87.224  %(x::'a::type) f::'a::type => nat => 'a::type.
  87.225     SIMP_REC (%n::nat. x) (%(fun::nat => 'a::type) n::nat. f (fun (PRE n)) n)"
  87.226 @@ -1214,8 +1191,7 @@
  87.227         PRIM_REC_FUN x f (Suc m) n = f (PRIM_REC_FUN x f m (PRE n)) n)"
  87.228    by (import prim_rec PRIM_REC_EQN)
  87.229  
  87.230 -constdefs
  87.231 -  PRIM_REC :: "'a => ('a => nat => 'a) => nat => 'a" 
  87.232 +definition PRIM_REC :: "'a => ('a => nat => 'a) => nat => 'a" where 
  87.233    "PRIM_REC ==
  87.234  %(x::'a::type) (f::'a::type => nat => 'a::type) m::nat.
  87.235     PRIM_REC_FUN x f m (PRE m)"
  87.236 @@ -1286,8 +1262,7 @@
  87.237  
  87.238  ;setup_theory arithmetic
  87.239  
  87.240 -constdefs
  87.241 -  nat_elim__magic :: "nat => nat" 
  87.242 +definition nat_elim__magic :: "nat => nat" where 
  87.243    "nat_elim__magic == %n::nat. n"
  87.244  
  87.245  lemma nat_elim__magic: "ALL n::nat. nat_elim__magic n = n"
  87.246 @@ -1746,22 +1721,19 @@
  87.247  
  87.248  ;setup_theory hrat
  87.249  
  87.250 -constdefs
  87.251 -  trat_1 :: "nat * nat" 
  87.252 +definition trat_1 :: "nat * nat" where 
  87.253    "trat_1 == (0, 0)"
  87.254  
  87.255  lemma trat_1: "trat_1 = (0, 0)"
  87.256    by (import hrat trat_1)
  87.257  
  87.258 -constdefs
  87.259 -  trat_inv :: "nat * nat => nat * nat" 
  87.260 +definition trat_inv :: "nat * nat => nat * nat" where 
  87.261    "trat_inv == %(x::nat, y::nat). (y, x)"
  87.262  
  87.263  lemma trat_inv: "ALL (x::nat) y::nat. trat_inv (x, y) = (y, x)"
  87.264    by (import hrat trat_inv)
  87.265  
  87.266 -constdefs
  87.267 -  trat_add :: "nat * nat => nat * nat => nat * nat" 
  87.268 +definition trat_add :: "nat * nat => nat * nat => nat * nat" where 
  87.269    "trat_add ==
  87.270  %(x::nat, y::nat) (x'::nat, y'::nat).
  87.271     (PRE (Suc x * Suc y' + Suc x' * Suc y), PRE (Suc y * Suc y'))"
  87.272 @@ -1771,8 +1743,7 @@
  87.273     (PRE (Suc x * Suc y' + Suc x' * Suc y), PRE (Suc y * Suc y'))"
  87.274    by (import hrat trat_add)
  87.275  
  87.276 -constdefs
  87.277 -  trat_mul :: "nat * nat => nat * nat => nat * nat" 
  87.278 +definition trat_mul :: "nat * nat => nat * nat => nat * nat" where 
  87.279    "trat_mul ==
  87.280  %(x::nat, y::nat) (x'::nat, y'::nat).
  87.281     (PRE (Suc x * Suc x'), PRE (Suc y * Suc y'))"
  87.282 @@ -1788,8 +1759,7 @@
  87.283  (ALL n::nat. trat_sucint (Suc n) = trat_add (trat_sucint n) trat_1)"
  87.284    by (import hrat trat_sucint)
  87.285  
  87.286 -constdefs
  87.287 -  trat_eq :: "nat * nat => nat * nat => bool" 
  87.288 +definition trat_eq :: "nat * nat => nat * nat => bool" where 
  87.289    "trat_eq ==
  87.290  %(x::nat, y::nat) (x'::nat, y'::nat). Suc x * Suc y' = Suc x' * Suc y"
  87.291  
  87.292 @@ -1901,23 +1871,20 @@
  87.293      (EX x::nat * nat. r = trat_eq x) = (dest_hrat (mk_hrat r) = r))"
  87.294    by (import hrat hrat_tybij)
  87.295  
  87.296 -constdefs
  87.297 -  hrat_1 :: "hrat" 
  87.298 +definition hrat_1 :: "hrat" where 
  87.299    "hrat_1 == mk_hrat (trat_eq trat_1)"
  87.300  
  87.301  lemma hrat_1: "hrat_1 = mk_hrat (trat_eq trat_1)"
  87.302    by (import hrat hrat_1)
  87.303  
  87.304 -constdefs
  87.305 -  hrat_inv :: "hrat => hrat" 
  87.306 +definition hrat_inv :: "hrat => hrat" where 
  87.307    "hrat_inv == %T1::hrat. mk_hrat (trat_eq (trat_inv (Eps (dest_hrat T1))))"
  87.308  
  87.309  lemma hrat_inv: "ALL T1::hrat.
  87.310     hrat_inv T1 = mk_hrat (trat_eq (trat_inv (Eps (dest_hrat T1))))"
  87.311    by (import hrat hrat_inv)
  87.312  
  87.313 -constdefs
  87.314 -  hrat_add :: "hrat => hrat => hrat" 
  87.315 +definition hrat_add :: "hrat => hrat => hrat" where 
  87.316    "hrat_add ==
  87.317  %(T1::hrat) T2::hrat.
  87.318     mk_hrat (trat_eq (trat_add (Eps (dest_hrat T1)) (Eps (dest_hrat T2))))"
  87.319 @@ -1927,8 +1894,7 @@
  87.320     mk_hrat (trat_eq (trat_add (Eps (dest_hrat T1)) (Eps (dest_hrat T2))))"
  87.321    by (import hrat hrat_add)
  87.322  
  87.323 -constdefs
  87.324 -  hrat_mul :: "hrat => hrat => hrat" 
  87.325 +definition hrat_mul :: "hrat => hrat => hrat" where 
  87.326    "hrat_mul ==
  87.327  %(T1::hrat) T2::hrat.
  87.328     mk_hrat (trat_eq (trat_mul (Eps (dest_hrat T1)) (Eps (dest_hrat T2))))"
  87.329 @@ -1938,8 +1904,7 @@
  87.330     mk_hrat (trat_eq (trat_mul (Eps (dest_hrat T1)) (Eps (dest_hrat T2))))"
  87.331    by (import hrat hrat_mul)
  87.332  
  87.333 -constdefs
  87.334 -  hrat_sucint :: "nat => hrat" 
  87.335 +definition hrat_sucint :: "nat => hrat" where 
  87.336    "hrat_sucint == %T1::nat. mk_hrat (trat_eq (trat_sucint T1))"
  87.337  
  87.338  lemma hrat_sucint: "ALL T1::nat. hrat_sucint T1 = mk_hrat (trat_eq (trat_sucint T1))"
  87.339 @@ -1987,8 +1952,7 @@
  87.340  
  87.341  ;setup_theory hreal
  87.342  
  87.343 -constdefs
  87.344 -  hrat_lt :: "hrat => hrat => bool" 
  87.345 +definition hrat_lt :: "hrat => hrat => bool" where 
  87.346    "hrat_lt == %(x::hrat) y::hrat. EX d::hrat. y = hrat_add x d"
  87.347  
  87.348  lemma hrat_lt: "ALL (x::hrat) y::hrat. hrat_lt x y = (EX d::hrat. y = hrat_add x d)"
  87.349 @@ -2096,8 +2060,7 @@
  87.350     hrat_lt x y --> (EX xa::hrat. hrat_lt x xa & hrat_lt xa y)"
  87.351    by (import hreal HRAT_MEAN)
  87.352  
  87.353 -constdefs
  87.354 -  isacut :: "(hrat => bool) => bool" 
  87.355 +definition isacut :: "(hrat => bool) => bool" where 
  87.356    "isacut ==
  87.357  %C::hrat => bool.
  87.358     Ex C &
  87.359 @@ -2113,8 +2076,7 @@
  87.360      (ALL x::hrat. C x --> (EX y::hrat. C y & hrat_lt x y)))"
  87.361    by (import hreal isacut)
  87.362  
  87.363 -constdefs
  87.364 -  cut_of_hrat :: "hrat => hrat => bool" 
  87.365 +definition cut_of_hrat :: "hrat => hrat => bool" where 
  87.366    "cut_of_hrat == %(x::hrat) y::hrat. hrat_lt y x"
  87.367  
  87.368  lemma cut_of_hrat: "ALL x::hrat. cut_of_hrat x = (%y::hrat. hrat_lt y x)"
  87.369 @@ -2173,15 +2135,13 @@
  87.370     (EX x::hrat. hreal.cut X x & ~ hreal.cut X (hrat_mul u x))"
  87.371    by (import hreal CUT_NEARTOP_MUL)
  87.372  
  87.373 -constdefs
  87.374 -  hreal_1 :: "hreal" 
  87.375 +definition hreal_1 :: "hreal" where 
  87.376    "hreal_1 == hreal (cut_of_hrat hrat_1)"
  87.377  
  87.378  lemma hreal_1: "hreal_1 = hreal (cut_of_hrat hrat_1)"
  87.379    by (import hreal hreal_1)
  87.380  
  87.381 -constdefs
  87.382 -  hreal_add :: "hreal => hreal => hreal" 
  87.383 +definition hreal_add :: "hreal => hreal => hreal" where 
  87.384    "hreal_add ==
  87.385  %(X::hreal) Y::hreal.
  87.386     hreal
  87.387 @@ -2197,8 +2157,7 @@
  87.388             w = hrat_add x y & hreal.cut X x & hreal.cut Y y)"
  87.389    by (import hreal hreal_add)
  87.390  
  87.391 -constdefs
  87.392 -  hreal_mul :: "hreal => hreal => hreal" 
  87.393 +definition hreal_mul :: "hreal => hreal => hreal" where 
  87.394    "hreal_mul ==
  87.395  %(X::hreal) Y::hreal.
  87.396     hreal
  87.397 @@ -2214,8 +2173,7 @@
  87.398             w = hrat_mul x y & hreal.cut X x & hreal.cut Y y)"
  87.399    by (import hreal hreal_mul)
  87.400  
  87.401 -constdefs
  87.402 -  hreal_inv :: "hreal => hreal" 
  87.403 +definition hreal_inv :: "hreal => hreal" where 
  87.404    "hreal_inv ==
  87.405  %X::hreal.
  87.406     hreal
  87.407 @@ -2233,8 +2191,7 @@
  87.408             (ALL x::hrat. hreal.cut X x --> hrat_lt (hrat_mul w x) d))"
  87.409    by (import hreal hreal_inv)
  87.410  
  87.411 -constdefs
  87.412 -  hreal_sup :: "(hreal => bool) => hreal" 
  87.413 +definition hreal_sup :: "(hreal => bool) => hreal" where 
  87.414    "hreal_sup ==
  87.415  %P::hreal => bool. hreal (%w::hrat. EX X::hreal. P X & hreal.cut X w)"
  87.416  
  87.417 @@ -2242,8 +2199,7 @@
  87.418     hreal_sup P = hreal (%w::hrat. EX X::hreal. P X & hreal.cut X w)"
  87.419    by (import hreal hreal_sup)
  87.420  
  87.421 -constdefs
  87.422 -  hreal_lt :: "hreal => hreal => bool" 
  87.423 +definition hreal_lt :: "hreal => hreal => bool" where 
  87.424    "hreal_lt ==
  87.425  %(X::hreal) Y::hreal.
  87.426     X ~= Y & (ALL x::hrat. hreal.cut X x --> hreal.cut Y x)"
  87.427 @@ -2301,8 +2257,7 @@
  87.428  lemma HREAL_NOZERO: "ALL (X::hreal) Y::hreal. hreal_add X Y ~= X"
  87.429    by (import hreal HREAL_NOZERO)
  87.430  
  87.431 -constdefs
  87.432 -  hreal_sub :: "hreal => hreal => hreal" 
  87.433 +definition hreal_sub :: "hreal => hreal => hreal" where 
  87.434    "hreal_sub ==
  87.435  %(Y::hreal) X::hreal.
  87.436     hreal
  87.437 @@ -2358,15 +2313,13 @@
  87.438  (ALL x::nat. Suc (NUMERAL_BIT2 x) = NUMERAL_BIT1 (Suc x))"
  87.439    by (import numeral numeral_suc)
  87.440  
  87.441 -constdefs
  87.442 -  iZ :: "nat => nat" 
  87.443 +definition iZ :: "nat => nat" where 
  87.444    "iZ == %x::nat. x"
  87.445  
  87.446  lemma iZ: "ALL x::nat. iZ x = x"
  87.447    by (import numeral iZ)
  87.448  
  87.449 -constdefs
  87.450 -  iiSUC :: "nat => nat" 
  87.451 +definition iiSUC :: "nat => nat" where 
  87.452    "iiSUC == %n::nat. Suc (Suc n)"
  87.453  
  87.454  lemma iiSUC: "ALL n::nat. iiSUC n = Suc (Suc n)"
  87.455 @@ -2699,8 +2652,7 @@
  87.456      iBIT_cases (NUMERAL_BIT2 n) zf bf1 bf2 = bf2 n)"
  87.457    by (import numeral iBIT_cases)
  87.458  
  87.459 -constdefs
  87.460 -  iDUB :: "nat => nat" 
  87.461 +definition iDUB :: "nat => nat" where 
  87.462    "iDUB == %x::nat. x + x"
  87.463  
  87.464  lemma iDUB: "ALL x::nat. iDUB x = x + x"
  87.465 @@ -2771,8 +2723,7 @@
  87.466     NUMERAL_BIT2 x * xa = iDUB (iZ (x * xa + xa))"
  87.467    by (import numeral numeral_mult)
  87.468  
  87.469 -constdefs
  87.470 -  iSQR :: "nat => nat" 
  87.471 +definition iSQR :: "nat => nat" where 
  87.472    "iSQR == %x::nat. x * x"
  87.473  
  87.474  lemma iSQR: "ALL x::nat. iSQR x = x * x"
  87.475 @@ -2809,8 +2760,7 @@
  87.476         ALL (xa::'A::type) y::'B::type. x (P xa y) = xa & Y (P xa y) = y)"
  87.477    by (import ind_type INJ_INVERSE2)
  87.478  
  87.479 -constdefs
  87.480 -  NUMPAIR :: "nat => nat => nat" 
  87.481 +definition NUMPAIR :: "nat => nat => nat" where 
  87.482    "NUMPAIR == %(x::nat) y::nat. 2 ^ x * (2 * y + 1)"
  87.483  
  87.484  lemma NUMPAIR: "ALL (x::nat) y::nat. NUMPAIR x y = 2 ^ x * (2 * y + 1)"
  87.485 @@ -2831,8 +2781,7 @@
  87.486  specification (NUMFST NUMSND) NUMPAIR_DEST: "ALL (x::nat) y::nat. NUMFST (NUMPAIR x y) = x & NUMSND (NUMPAIR x y) = y"
  87.487    by (import ind_type NUMPAIR_DEST)
  87.488  
  87.489 -constdefs
  87.490 -  NUMSUM :: "bool => nat => nat" 
  87.491 +definition NUMSUM :: "bool => nat => nat" where 
  87.492    "NUMSUM == %(b::bool) x::nat. if b then Suc (2 * x) else 2 * x"
  87.493  
  87.494  lemma NUMSUM: "ALL (b::bool) x::nat. NUMSUM b x = (if b then Suc (2 * x) else 2 * x)"
  87.495 @@ -2849,8 +2798,7 @@
  87.496  specification (NUMLEFT NUMRIGHT) NUMSUM_DEST: "ALL (x::bool) y::nat. NUMLEFT (NUMSUM x y) = x & NUMRIGHT (NUMSUM x y) = y"
  87.497    by (import ind_type NUMSUM_DEST)
  87.498  
  87.499 -constdefs
  87.500 -  INJN :: "nat => nat => 'a => bool" 
  87.501 +definition INJN :: "nat => nat => 'a => bool" where 
  87.502    "INJN == %(m::nat) (n::nat) a::'a::type. n = m"
  87.503  
  87.504  lemma INJN: "ALL m::nat. INJN m = (%(n::nat) a::'a::type. n = m)"
  87.505 @@ -2859,8 +2807,7 @@
  87.506  lemma INJN_INJ: "ALL (n1::nat) n2::nat. (INJN n1 = INJN n2) = (n1 = n2)"
  87.507    by (import ind_type INJN_INJ)
  87.508  
  87.509 -constdefs
  87.510 -  INJA :: "'a => nat => 'a => bool" 
  87.511 +definition INJA :: "'a => nat => 'a => bool" where 
  87.512    "INJA == %(a::'a::type) (n::nat) b::'a::type. b = a"
  87.513  
  87.514  lemma INJA: "ALL a::'a::type. INJA a = (%(n::nat) b::'a::type. b = a)"
  87.515 @@ -2869,8 +2816,7 @@
  87.516  lemma INJA_INJ: "ALL (a1::'a::type) a2::'a::type. (INJA a1 = INJA a2) = (a1 = a2)"
  87.517    by (import ind_type INJA_INJ)
  87.518  
  87.519 -constdefs
  87.520 -  INJF :: "(nat => nat => 'a => bool) => nat => 'a => bool" 
  87.521 +definition INJF :: "(nat => nat => 'a => bool) => nat => 'a => bool" where 
  87.522    "INJF == %(f::nat => nat => 'a::type => bool) n::nat. f (NUMFST n) (NUMSND n)"
  87.523  
  87.524  lemma INJF: "ALL f::nat => nat => 'a::type => bool.
  87.525 @@ -2881,8 +2827,7 @@
  87.526     (INJF f1 = INJF f2) = (f1 = f2)"
  87.527    by (import ind_type INJF_INJ)
  87.528  
  87.529 -constdefs
  87.530 -  INJP :: "(nat => 'a => bool) => (nat => 'a => bool) => nat => 'a => bool" 
  87.531 +definition INJP :: "(nat => 'a => bool) => (nat => 'a => bool) => nat => 'a => bool" where 
  87.532    "INJP ==
  87.533  %(f1::nat => 'a::type => bool) (f2::nat => 'a::type => bool) (n::nat)
  87.534     a::'a::type. if NUMLEFT n then f1 (NUMRIGHT n) a else f2 (NUMRIGHT n) a"
  87.535 @@ -2898,8 +2843,7 @@
  87.536     (INJP f1 f2 = INJP f1' f2') = (f1 = f1' & f2 = f2')"
  87.537    by (import ind_type INJP_INJ)
  87.538  
  87.539 -constdefs
  87.540 -  ZCONSTR :: "nat => 'a => (nat => nat => 'a => bool) => nat => 'a => bool" 
  87.541 +definition ZCONSTR :: "nat => 'a => (nat => nat => 'a => bool) => nat => 'a => bool" where 
  87.542    "ZCONSTR ==
  87.543  %(c::nat) (i::'a::type) r::nat => nat => 'a::type => bool.
  87.544     INJP (INJN (Suc c)) (INJP (INJA i) (INJF r))"
  87.545 @@ -2908,8 +2852,7 @@
  87.546     ZCONSTR c i r = INJP (INJN (Suc c)) (INJP (INJA i) (INJF r))"
  87.547    by (import ind_type ZCONSTR)
  87.548  
  87.549 -constdefs
  87.550 -  ZBOT :: "nat => 'a => bool" 
  87.551 +definition ZBOT :: "nat => 'a => bool" where 
  87.552    "ZBOT == INJP (INJN 0) (SOME z::nat => 'a::type => bool. True)"
  87.553  
  87.554  lemma ZBOT: "ZBOT = INJP (INJN 0) (SOME z::nat => 'a::type => bool. True)"
  87.555 @@ -2919,8 +2862,7 @@
  87.556     ZCONSTR x xa xb ~= ZBOT"
  87.557    by (import ind_type ZCONSTR_ZBOT)
  87.558  
  87.559 -constdefs
  87.560 -  ZRECSPACE :: "(nat => 'a => bool) => bool" 
  87.561 +definition ZRECSPACE :: "(nat => 'a => bool) => bool" where 
  87.562    "ZRECSPACE ==
  87.563  %a0::nat => 'a::type => bool.
  87.564     ALL ZRECSPACE'::(nat => 'a::type => bool) => bool.
  87.565 @@ -2993,15 +2935,13 @@
  87.566  (ALL r::nat => 'a::type => bool. ZRECSPACE r = (dest_rec (mk_rec r) = r))"
  87.567    by (import ind_type recspace_repfns)
  87.568  
  87.569 -constdefs
  87.570 -  BOTTOM :: "'a recspace" 
  87.571 +definition BOTTOM :: "'a recspace" where 
  87.572    "BOTTOM == mk_rec ZBOT"
  87.573  
  87.574  lemma BOTTOM: "BOTTOM = mk_rec ZBOT"
  87.575    by (import ind_type BOTTOM)
  87.576  
  87.577 -constdefs
  87.578 -  CONSTR :: "nat => 'a => (nat => 'a recspace) => 'a recspace" 
  87.579 +definition CONSTR :: "nat => 'a => (nat => 'a recspace) => 'a recspace" where 
  87.580    "CONSTR ==
  87.581  %(c::nat) (i::'a::type) r::nat => 'a::type recspace.
  87.582     mk_rec (ZCONSTR c i (%n::nat. dest_rec (r n)))"
  87.583 @@ -3049,15 +2989,13 @@
  87.584  (ALL (a::'a::type) (f::nat => 'a::type) n::nat. FCONS a f (Suc n) = f n)"
  87.585    by (import ind_type FCONS)
  87.586  
  87.587 -constdefs
  87.588 -  FNIL :: "nat => 'a" 
  87.589 +definition FNIL :: "nat => 'a" where 
  87.590    "FNIL == %n::nat. SOME x::'a::type. True"
  87.591  
  87.592  lemma FNIL: "ALL n::nat. FNIL n = (SOME x::'a::type. True)"
  87.593    by (import ind_type FNIL)
  87.594  
  87.595 -constdefs
  87.596 -  ISO :: "('a => 'b) => ('b => 'a) => bool" 
  87.597 +definition ISO :: "('a => 'b) => ('b => 'a) => bool" where 
  87.598    "ISO ==
  87.599  %(f::'a::type => 'b::type) g::'b::type => 'a::type.
  87.600     (ALL x::'b::type. f (g x) = x) & (ALL y::'a::type. g (f y) = y)"
  87.601 @@ -3434,8 +3372,7 @@
  87.602     (EX x::'a::type. IN x s & (ALL y::'a::type. IN y s --> M x <= M y))"
  87.603    by (import pred_set SET_MINIMUM)
  87.604  
  87.605 -constdefs
  87.606 -  EMPTY :: "'a => bool" 
  87.607 +definition EMPTY :: "'a => bool" where 
  87.608    "EMPTY == %x::'a::type. False"
  87.609  
  87.610  lemma EMPTY_DEF: "EMPTY = (%x::'a::type. False)"
  87.611 @@ -3468,8 +3405,7 @@
  87.612  lemma EQ_UNIV: "(ALL x::'a::type. IN x (s::'a::type => bool)) = (s = pred_set.UNIV)"
  87.613    by (import pred_set EQ_UNIV)
  87.614  
  87.615 -constdefs
  87.616 -  SUBSET :: "('a => bool) => ('a => bool) => bool" 
  87.617 +definition SUBSET :: "('a => bool) => ('a => bool) => bool" where 
  87.618    "SUBSET ==
  87.619  %(s::'a::type => bool) t::'a::type => bool.
  87.620     ALL x::'a::type. IN x s --> IN x t"
  87.621 @@ -3501,8 +3437,7 @@
  87.622  lemma UNIV_SUBSET: "ALL x::'a::type => bool. SUBSET pred_set.UNIV x = (x = pred_set.UNIV)"
  87.623    by (import pred_set UNIV_SUBSET)
  87.624  
  87.625 -constdefs
  87.626 -  PSUBSET :: "('a => bool) => ('a => bool) => bool" 
  87.627 +definition PSUBSET :: "('a => bool) => ('a => bool) => bool" where 
  87.628    "PSUBSET == %(s::'a::type => bool) t::'a::type => bool. SUBSET s t & s ~= t"
  87.629  
  87.630  lemma PSUBSET_DEF: "ALL (s::'a::type => bool) t::'a::type => bool.
  87.631 @@ -3640,8 +3575,7 @@
  87.632     pred_set.INTER (pred_set.UNION x xa) (pred_set.UNION x xb)"
  87.633    by (import pred_set INTER_OVER_UNION)
  87.634  
  87.635 -constdefs
  87.636 -  DISJOINT :: "('a => bool) => ('a => bool) => bool" 
  87.637 +definition DISJOINT :: "('a => bool) => ('a => bool) => bool" where 
  87.638    "DISJOINT ==
  87.639  %(s::'a::type => bool) t::'a::type => bool. pred_set.INTER s t = EMPTY"
  87.640  
  87.641 @@ -3672,8 +3606,7 @@
  87.642     DISJOINT u (pred_set.UNION s t) = (DISJOINT s u & DISJOINT t u)"
  87.643    by (import pred_set DISJOINT_UNION_BOTH)
  87.644  
  87.645 -constdefs
  87.646 -  DIFF :: "('a => bool) => ('a => bool) => 'a => bool" 
  87.647 +definition DIFF :: "('a => bool) => ('a => bool) => 'a => bool" where 
  87.648    "DIFF ==
  87.649  %(s::'a::type => bool) t::'a::type => bool.
  87.650     GSPEC (%x::'a::type. (x, IN x s & ~ IN x t))"
  87.651 @@ -3702,8 +3635,7 @@
  87.652  lemma DIFF_EQ_EMPTY: "ALL x::'a::type => bool. DIFF x x = EMPTY"
  87.653    by (import pred_set DIFF_EQ_EMPTY)
  87.654  
  87.655 -constdefs
  87.656 -  INSERT :: "'a => ('a => bool) => 'a => bool" 
  87.657 +definition INSERT :: "'a => ('a => bool) => 'a => bool" where 
  87.658    "INSERT ==
  87.659  %(x::'a::type) s::'a::type => bool.
  87.660     GSPEC (%y::'a::type. (y, y = x | IN y s))"
  87.661 @@ -3778,8 +3710,7 @@
  87.662     DIFF (INSERT x s) t = (if IN x t then DIFF s t else INSERT x (DIFF s t))"
  87.663    by (import pred_set INSERT_DIFF)
  87.664  
  87.665 -constdefs
  87.666 -  DELETE :: "('a => bool) => 'a => 'a => bool" 
  87.667 +definition DELETE :: "('a => bool) => 'a => 'a => bool" where 
  87.668    "DELETE == %(s::'a::type => bool) x::'a::type. DIFF s (INSERT x EMPTY)"
  87.669  
  87.670  lemma DELETE_DEF: "ALL (s::'a::type => bool) x::'a::type. DELETE s x = DIFF s (INSERT x EMPTY)"
  87.671 @@ -3852,8 +3783,7 @@
  87.672  specification (CHOICE) CHOICE_DEF: "ALL x::'a::type => bool. x ~= EMPTY --> IN (CHOICE x) x"
  87.673    by (import pred_set CHOICE_DEF)
  87.674  
  87.675 -constdefs
  87.676 -  REST :: "('a => bool) => 'a => bool" 
  87.677 +definition REST :: "('a => bool) => 'a => bool" where 
  87.678    "REST == %s::'a::type => bool. DELETE s (CHOICE s)"
  87.679  
  87.680  lemma REST_DEF: "ALL s::'a::type => bool. REST s = DELETE s (CHOICE s)"
  87.681 @@ -3871,8 +3801,7 @@
  87.682  lemma REST_PSUBSET: "ALL x::'a::type => bool. x ~= EMPTY --> PSUBSET (REST x) x"
  87.683    by (import pred_set REST_PSUBSET)
  87.684  
  87.685 -constdefs
  87.686 -  SING :: "('a => bool) => bool" 
  87.687 +definition SING :: "('a => bool) => bool" where 
  87.688    "SING == %s::'a::type => bool. EX x::'a::type. s = INSERT x EMPTY"
  87.689  
  87.690  lemma SING_DEF: "ALL s::'a::type => bool. SING s = (EX x::'a::type. s = INSERT x EMPTY)"
  87.691 @@ -3917,8 +3846,7 @@
  87.692  lemma SING_IFF_EMPTY_REST: "ALL x::'a::type => bool. SING x = (x ~= EMPTY & REST x = EMPTY)"
  87.693    by (import pred_set SING_IFF_EMPTY_REST)
  87.694  
  87.695 -constdefs
  87.696 -  IMAGE :: "('a => 'b) => ('a => bool) => 'b => bool" 
  87.697 +definition IMAGE :: "('a => 'b) => ('a => bool) => 'b => bool" where 
  87.698    "IMAGE ==
  87.699  %(f::'a::type => 'b::type) s::'a::type => bool.
  87.700     GSPEC (%x::'a::type. (f x, IN x s))"
  87.701 @@ -3971,8 +3899,7 @@
  87.702      (pred_set.INTER (IMAGE f s) (IMAGE f t))"
  87.703    by (import pred_set IMAGE_INTER)
  87.704  
  87.705 -constdefs
  87.706 -  INJ :: "('a => 'b) => ('a => bool) => ('b => bool) => bool" 
  87.707 +definition INJ :: "('a => 'b) => ('a => bool) => ('b => bool) => bool" where 
  87.708    "INJ ==
  87.709  %(f::'a::type => 'b::type) (s::'a::type => bool) t::'b::type => bool.
  87.710     (ALL x::'a::type. IN x s --> IN (f x) t) &
  87.711 @@ -3998,8 +3925,7 @@
  87.712     (ALL xa::'a::type => bool. INJ x xa EMPTY = (xa = EMPTY))"
  87.713    by (import pred_set INJ_EMPTY)
  87.714  
  87.715 -constdefs
  87.716 -  SURJ :: "('a => 'b) => ('a => bool) => ('b => bool) => bool" 
  87.717 +definition SURJ :: "('a => 'b) => ('a => bool) => ('b => bool) => bool" where 
  87.718    "SURJ ==
  87.719  %(f::'a::type => 'b::type) (s::'a::type => bool) t::'b::type => bool.
  87.720     (ALL x::'a::type. IN x s --> IN (f x) t) &
  87.721 @@ -4028,8 +3954,7 @@
  87.722     SURJ x xa xb = (IMAGE x xa = xb)"
  87.723    by (import pred_set IMAGE_SURJ)
  87.724  
  87.725 -constdefs
  87.726 -  BIJ :: "('a => 'b) => ('a => bool) => ('b => bool) => bool" 
  87.727 +definition BIJ :: "('a => 'b) => ('a => bool) => ('b => bool) => bool" where 
  87.728    "BIJ ==
  87.729  %(f::'a::type => 'b::type) (s::'a::type => bool) t::'b::type => bool.
  87.730     INJ f s t & SURJ f s t"
  87.731 @@ -4065,8 +3990,7 @@
  87.732     SURJ f s t --> (ALL x::'b::type. IN x t --> f (RINV f s x) = x)"
  87.733    by (import pred_set RINV_DEF)
  87.734  
  87.735 -constdefs
  87.736 -  FINITE :: "('a => bool) => bool" 
  87.737 +definition FINITE :: "('a => bool) => bool" where 
  87.738    "FINITE ==
  87.739  %s::'a::type => bool.
  87.740     ALL P::('a::type => bool) => bool.
  87.741 @@ -4219,8 +4143,7 @@
  87.742     (ALL x::'a::type => bool. FINITE x --> P x)"
  87.743    by (import pred_set FINITE_COMPLETE_INDUCTION)
  87.744  
  87.745 -constdefs
  87.746 -  INFINITE :: "('a => bool) => bool" 
  87.747 +definition INFINITE :: "('a => bool) => bool" where 
  87.748    "INFINITE == %s::'a::type => bool. ~ FINITE s"
  87.749  
  87.750  lemma INFINITE_DEF: "ALL s::'a::type => bool. INFINITE s = (~ FINITE s)"
  87.751 @@ -4320,8 +4243,7 @@
  87.752                                  (f n)))))))))"
  87.753    by (import pred_set FINITE_WEAK_ENUMERATE)
  87.754  
  87.755 -constdefs
  87.756 -  BIGUNION :: "(('a => bool) => bool) => 'a => bool" 
  87.757 +definition BIGUNION :: "(('a => bool) => bool) => 'a => bool" where 
  87.758    "BIGUNION ==
  87.759  %P::('a::type => bool) => bool.
  87.760     GSPEC (%x::'a::type. (x, EX p::'a::type => bool. IN p P & IN x p))"
  87.761 @@ -4367,8 +4289,7 @@
  87.762     FINITE (BIGUNION x)"
  87.763    by (import pred_set FINITE_BIGUNION)
  87.764  
  87.765 -constdefs
  87.766 -  BIGINTER :: "(('a => bool) => bool) => 'a => bool" 
  87.767 +definition BIGINTER :: "(('a => bool) => bool) => 'a => bool" where 
  87.768    "BIGINTER ==
  87.769  %B::('a::type => bool) => bool.
  87.770     GSPEC (%x::'a::type. (x, ALL P::'a::type => bool. IN P B --> IN x P))"
  87.771 @@ -4406,8 +4327,7 @@
  87.772     DISJOINT x (BIGINTER xb) & DISJOINT (BIGINTER xb) x"
  87.773    by (import pred_set DISJOINT_BIGINTER)
  87.774  
  87.775 -constdefs
  87.776 -  CROSS :: "('a => bool) => ('b => bool) => 'a * 'b => bool" 
  87.777 +definition CROSS :: "('a => bool) => ('b => bool) => 'a * 'b => bool" where 
  87.778    "CROSS ==
  87.779  %(P::'a::type => bool) Q::'b::type => bool.
  87.780     GSPEC (%p::'a::type * 'b::type. (p, IN (fst p) P & IN (snd p) Q))"
  87.781 @@ -4460,8 +4380,7 @@
  87.782     FINITE (CROSS P Q) = (P = EMPTY | Q = EMPTY | FINITE P & FINITE Q)"
  87.783    by (import pred_set FINITE_CROSS_EQ)
  87.784  
  87.785 -constdefs
  87.786 -  COMPL :: "('a => bool) => 'a => bool" 
  87.787 +definition COMPL :: "('a => bool) => 'a => bool" where 
  87.788    "COMPL == DIFF pred_set.UNIV"
  87.789  
  87.790  lemma COMPL_DEF: "ALL P::'a::type => bool. COMPL P = DIFF pred_set.UNIV P"
  87.791 @@ -4513,8 +4432,7 @@
  87.792  lemma CARD_COUNT: "ALL n::nat. CARD (count n) = n"
  87.793    by (import pred_set CARD_COUNT)
  87.794  
  87.795 -constdefs
  87.796 -  ITSET_tupled :: "('a => 'b => 'b) => ('a => bool) * 'b => 'b" 
  87.797 +definition ITSET_tupled :: "('a => 'b => 'b) => ('a => bool) * 'b => 'b" where 
  87.798    "ITSET_tupled ==
  87.799  %f::'a::type => 'b::type => 'b::type.
  87.800     WFREC
  87.801 @@ -4546,8 +4464,7 @@
  87.802          else ARB)"
  87.803    by (import pred_set ITSET_tupled_primitive_def)
  87.804  
  87.805 -constdefs
  87.806 -  ITSET :: "('a => 'b => 'b) => ('a => bool) => 'b => 'b" 
  87.807 +definition ITSET :: "('a => 'b => 'b) => ('a => bool) => 'b => 'b" where 
  87.808    "ITSET ==
  87.809  %(f::'a::type => 'b::type => 'b::type) (x::'a::type => bool) x1::'b::type.
  87.810     ITSET_tupled f (x, x1)"
  87.811 @@ -4578,8 +4495,7 @@
  87.812  
  87.813  ;setup_theory operator
  87.814  
  87.815 -constdefs
  87.816 -  ASSOC :: "('a => 'a => 'a) => bool" 
  87.817 +definition ASSOC :: "('a => 'a => 'a) => bool" where 
  87.818    "ASSOC ==
  87.819  %f::'a::type => 'a::type => 'a::type.
  87.820     ALL (x::'a::type) (y::'a::type) z::'a::type. f x (f y z) = f (f x y) z"
  87.821 @@ -4589,8 +4505,7 @@
  87.822     (ALL (x::'a::type) (y::'a::type) z::'a::type. f x (f y z) = f (f x y) z)"
  87.823    by (import operator ASSOC_DEF)
  87.824  
  87.825 -constdefs
  87.826 -  COMM :: "('a => 'a => 'b) => bool" 
  87.827 +definition COMM :: "('a => 'a => 'b) => bool" where 
  87.828    "COMM ==
  87.829  %f::'a::type => 'a::type => 'b::type.
  87.830     ALL (x::'a::type) y::'a::type. f x y = f y x"
  87.831 @@ -4599,8 +4514,7 @@
  87.832     COMM f = (ALL (x::'a::type) y::'a::type. f x y = f y x)"
  87.833    by (import operator COMM_DEF)
  87.834  
  87.835 -constdefs
  87.836 -  FCOMM :: "('a => 'b => 'a) => ('c => 'a => 'a) => bool" 
  87.837 +definition FCOMM :: "('a => 'b => 'a) => ('c => 'a => 'a) => bool" where 
  87.838    "FCOMM ==
  87.839  %(f::'a::type => 'b::type => 'a::type) g::'c::type => 'a::type => 'a::type.
  87.840     ALL (x::'c::type) (y::'a::type) z::'b::type. g x (f y z) = f (g x y) z"
  87.841 @@ -4611,8 +4525,7 @@
  87.842     (ALL (x::'c::type) (y::'a::type) z::'b::type. g x (f y z) = f (g x y) z)"
  87.843    by (import operator FCOMM_DEF)
  87.844  
  87.845 -constdefs
  87.846 -  RIGHT_ID :: "('a => 'b => 'a) => 'b => bool" 
  87.847 +definition RIGHT_ID :: "('a => 'b => 'a) => 'b => bool" where 
  87.848    "RIGHT_ID ==
  87.849  %(f::'a::type => 'b::type => 'a::type) e::'b::type.
  87.850     ALL x::'a::type. f x e = x"
  87.851 @@ -4621,8 +4534,7 @@
  87.852     RIGHT_ID f e = (ALL x::'a::type. f x e = x)"
  87.853    by (import operator RIGHT_ID_DEF)
  87.854  
  87.855 -constdefs
  87.856 -  LEFT_ID :: "('a => 'b => 'b) => 'a => bool" 
  87.857 +definition LEFT_ID :: "('a => 'b => 'b) => 'a => bool" where 
  87.858    "LEFT_ID ==
  87.859  %(f::'a::type => 'b::type => 'b::type) e::'a::type.
  87.860     ALL x::'b::type. f e x = x"
  87.861 @@ -4631,8 +4543,7 @@
  87.862     LEFT_ID f e = (ALL x::'b::type. f e x = x)"
  87.863    by (import operator LEFT_ID_DEF)
  87.864  
  87.865 -constdefs
  87.866 -  MONOID :: "('a => 'a => 'a) => 'a => bool" 
  87.867 +definition MONOID :: "('a => 'a => 'a) => 'a => bool" where 
  87.868    "MONOID ==
  87.869  %(f::'a::type => 'a::type => 'a::type) e::'a::type.
  87.870     ASSOC f & RIGHT_ID f e & LEFT_ID f e"
  87.871 @@ -4690,15 +4601,13 @@
  87.872  lemma IS_EL_DEF: "ALL (x::'a::type) l::'a::type list. x mem l = list_exists (op = x) l"
  87.873    by (import rich_list IS_EL_DEF)
  87.874  
  87.875 -constdefs
  87.876 -  AND_EL :: "bool list => bool" 
  87.877 +definition AND_EL :: "bool list => bool" where 
  87.878    "AND_EL == list_all I"
  87.879  
  87.880  lemma AND_EL_DEF: "AND_EL = list_all I"
  87.881    by (import rich_list AND_EL_DEF)
  87.882  
  87.883 -constdefs
  87.884 -  OR_EL :: "bool list => bool" 
  87.885 +definition OR_EL :: "bool list => bool" where 
  87.886    "OR_EL == list_exists I"
  87.887  
  87.888  lemma OR_EL_DEF: "OR_EL = list_exists I"
  87.889 @@ -4816,16 +4725,14 @@
  87.890      (if P x then ([], x # l) else (x # fst (SPLITP P l), snd (SPLITP P l))))"
  87.891    by (import rich_list SPLITP)
  87.892  
  87.893 -constdefs
  87.894 -  PREFIX :: "('a => bool) => 'a list => 'a list" 
  87.895 +definition PREFIX :: "('a => bool) => 'a list => 'a list" where 
  87.896    "PREFIX == %(P::'a::type => bool) l::'a::type list. fst (SPLITP (Not o P) l)"
  87.897  
  87.898  lemma PREFIX_DEF: "ALL (P::'a::type => bool) l::'a::type list.
  87.899     PREFIX P l = fst (SPLITP (Not o P) l)"
  87.900    by (import rich_list PREFIX_DEF)
  87.901  
  87.902 -constdefs
  87.903 -  SUFFIX :: "('a => bool) => 'a list => 'a list" 
  87.904 +definition SUFFIX :: "('a => bool) => 'a list => 'a list" where 
  87.905    "SUFFIX ==
  87.906  %P::'a::type => bool.
  87.907     foldl (%(l'::'a::type list) x::'a::type. if P x then SNOC x l' else [])
  87.908 @@ -4837,15 +4744,13 @@
  87.909      [] l"
  87.910    by (import rich_list SUFFIX_DEF)
  87.911  
  87.912 -constdefs
  87.913 -  UNZIP_FST :: "('a * 'b) list => 'a list" 
  87.914 +definition UNZIP_FST :: "('a * 'b) list => 'a list" where 
  87.915    "UNZIP_FST == %l::('a::type * 'b::type) list. fst (unzip l)"
  87.916  
  87.917  lemma UNZIP_FST_DEF: "ALL l::('a::type * 'b::type) list. UNZIP_FST l = fst (unzip l)"
  87.918    by (import rich_list UNZIP_FST_DEF)
  87.919  
  87.920 -constdefs
  87.921 -  UNZIP_SND :: "('a * 'b) list => 'b list" 
  87.922 +definition UNZIP_SND :: "('a * 'b) list => 'b list" where 
  87.923    "UNZIP_SND == %l::('a::type * 'b::type) list. snd (unzip l)"
  87.924  
  87.925  lemma UNZIP_SND_DEF: "ALL l::('a::type * 'b::type) list. UNZIP_SND l = snd (unzip l)"
  87.926 @@ -5916,8 +5821,7 @@
  87.927  
  87.928  ;setup_theory state_transformer
  87.929  
  87.930 -constdefs
  87.931 -  UNIT :: "'b => 'a => 'b * 'a" 
  87.932 +definition UNIT :: "'b => 'a => 'b * 'a" where 
  87.933    "(op ==::('b::type => 'a::type => 'b::type * 'a::type)
  87.934          => ('b::type => 'a::type => 'b::type * 'a::type) => prop)
  87.935   (UNIT::'b::type => 'a::type => 'b::type * 'a::type)
  87.936 @@ -5926,8 +5830,7 @@
  87.937  lemma UNIT_DEF: "ALL x::'b::type. UNIT x = Pair x"
  87.938    by (import state_transformer UNIT_DEF)
  87.939  
  87.940 -constdefs
  87.941 -  BIND :: "('a => 'b * 'a) => ('b => 'a => 'c * 'a) => 'a => 'c * 'a" 
  87.942 +definition BIND :: "('a => 'b * 'a) => ('b => 'a => 'c * 'a) => 'a => 'c * 'a" where 
  87.943    "(op ==::(('a::type => 'b::type * 'a::type)
  87.944           => ('b::type => 'a::type => 'c::type * 'a::type)
  87.945              => 'a::type => 'c::type * 'a::type)
  87.946 @@ -5967,8 +5870,7 @@
  87.947               g)))"
  87.948    by (import state_transformer BIND_DEF)
  87.949  
  87.950 -constdefs
  87.951 -  MMAP :: "('c => 'b) => ('a => 'c * 'a) => 'a => 'b * 'a" 
  87.952 +definition MMAP :: "('c => 'b) => ('a => 'c * 'a) => 'a => 'b * 'a" where 
  87.953    "MMAP ==
  87.954  %(f::'c::type => 'b::type) m::'a::type => 'c::type * 'a::type.
  87.955     BIND m (UNIT o f)"
  87.956 @@ -5977,8 +5879,7 @@
  87.957     MMAP f m = BIND m (UNIT o f)"
  87.958    by (import state_transformer MMAP_DEF)
  87.959  
  87.960 -constdefs
  87.961 -  JOIN :: "('a => ('a => 'b * 'a) * 'a) => 'a => 'b * 'a" 
  87.962 +definition JOIN :: "('a => ('a => 'b * 'a) * 'a) => 'a => 'b * 'a" where 
  87.963    "JOIN ==
  87.964  %z::'a::type => ('a::type => 'b::type * 'a::type) * 'a::type. BIND z I"
  87.965  
    88.1 --- a/src/HOL/Import/HOL/HOL4Prob.thy	Wed Feb 24 11:55:52 2010 +0100
    88.2 +++ b/src/HOL/Import/HOL/HOL4Prob.thy	Mon Mar 01 13:40:23 2010 +0100
    88.3 @@ -373,8 +373,7 @@
    88.4     alg_twin x y = (EX l::bool list. x = SNOC True l & y = SNOC False l)"
    88.5    by (import prob_canon alg_twin_def)
    88.6  
    88.7 -constdefs
    88.8 -  alg_order_tupled :: "bool list * bool list => bool" 
    88.9 +definition alg_order_tupled :: "bool list * bool list => bool" where 
   88.10    "(op ==::(bool list * bool list => bool)
   88.11          => (bool list * bool list => bool) => prop)
   88.12   (alg_order_tupled::bool list * bool list => bool)
   88.13 @@ -1917,8 +1916,7 @@
   88.14     P 0 & (ALL v::nat. P (Suc v div 2) --> P (Suc v)) --> All P"
   88.15    by (import prob_uniform unif_bound_ind)
   88.16  
   88.17 -constdefs
   88.18 -  unif_tupled :: "nat * (nat => bool) => nat * (nat => bool)" 
   88.19 +definition unif_tupled :: "nat * (nat => bool) => nat * (nat => bool)" where 
   88.20    "unif_tupled ==
   88.21  WFREC
   88.22   (SOME R::nat * (nat => bool) => nat * (nat => bool) => bool.
   88.23 @@ -1963,8 +1961,7 @@
   88.24     (ALL v::nat. All (P v))"
   88.25    by (import prob_uniform unif_ind)
   88.26  
   88.27 -constdefs
   88.28 -  uniform_tupled :: "nat * nat * (nat => bool) => nat * (nat => bool)" 
   88.29 +definition uniform_tupled :: "nat * nat * (nat => bool) => nat * (nat => bool)" where 
   88.30    "uniform_tupled ==
   88.31  WFREC
   88.32   (SOME R::nat * nat * (nat => bool) => nat * nat * (nat => bool) => bool.
    89.1 --- a/src/HOL/Import/HOL/HOL4Real.thy	Wed Feb 24 11:55:52 2010 +0100
    89.2 +++ b/src/HOL/Import/HOL/HOL4Real.thy	Mon Mar 01 13:40:23 2010 +0100
    89.3 @@ -39,29 +39,25 @@
    89.4     hreal_lt (hreal_add x y) (hreal_add x z) = hreal_lt y z"
    89.5    by (import realax HREAL_LT_LADD)
    89.6  
    89.7 -constdefs
    89.8 -  treal_0 :: "hreal * hreal" 
    89.9 +definition treal_0 :: "hreal * hreal" where 
   89.10    "treal_0 == (hreal_1, hreal_1)"
   89.11  
   89.12  lemma treal_0: "treal_0 = (hreal_1, hreal_1)"
   89.13    by (import realax treal_0)
   89.14  
   89.15 -constdefs
   89.16 -  treal_1 :: "hreal * hreal" 
   89.17 +definition treal_1 :: "hreal * hreal" where 
   89.18    "treal_1 == (hreal_add hreal_1 hreal_1, hreal_1)"
   89.19  
   89.20  lemma treal_1: "treal_1 = (hreal_add hreal_1 hreal_1, hreal_1)"
   89.21    by (import realax treal_1)
   89.22  
   89.23 -constdefs
   89.24 -  treal_neg :: "hreal * hreal => hreal * hreal" 
   89.25 +definition treal_neg :: "hreal * hreal => hreal * hreal" where 
   89.26    "treal_neg == %(x::hreal, y::hreal). (y, x)"
   89.27  
   89.28  lemma treal_neg: "ALL (x::hreal) y::hreal. treal_neg (x, y) = (y, x)"
   89.29    by (import realax treal_neg)
   89.30  
   89.31 -constdefs
   89.32 -  treal_add :: "hreal * hreal => hreal * hreal => hreal * hreal" 
   89.33 +definition treal_add :: "hreal * hreal => hreal * hreal => hreal * hreal" where 
   89.34    "treal_add ==
   89.35  %(x1::hreal, y1::hreal) (x2::hreal, y2::hreal).
   89.36     (hreal_add x1 x2, hreal_add y1 y2)"
   89.37 @@ -70,8 +66,7 @@
   89.38     treal_add (x1, y1) (x2, y2) = (hreal_add x1 x2, hreal_add y1 y2)"
   89.39    by (import realax treal_add)
   89.40  
   89.41 -constdefs
   89.42 -  treal_mul :: "hreal * hreal => hreal * hreal => hreal * hreal" 
   89.43 +definition treal_mul :: "hreal * hreal => hreal * hreal => hreal * hreal" where 
   89.44    "treal_mul ==
   89.45  %(x1::hreal, y1::hreal) (x2::hreal, y2::hreal).
   89.46     (hreal_add (hreal_mul x1 x2) (hreal_mul y1 y2),
   89.47 @@ -83,8 +78,7 @@
   89.48      hreal_add (hreal_mul x1 y2) (hreal_mul y1 x2))"
   89.49    by (import realax treal_mul)
   89.50  
   89.51 -constdefs
   89.52 -  treal_lt :: "hreal * hreal => hreal * hreal => bool" 
   89.53 +definition treal_lt :: "hreal * hreal => hreal * hreal => bool" where 
   89.54    "treal_lt ==
   89.55  %(x1::hreal, y1::hreal) (x2::hreal, y2::hreal).
   89.56     hreal_lt (hreal_add x1 y2) (hreal_add x2 y1)"
   89.57 @@ -93,8 +87,7 @@
   89.58     treal_lt (x1, y1) (x2, y2) = hreal_lt (hreal_add x1 y2) (hreal_add x2 y1)"
   89.59    by (import realax treal_lt)
   89.60  
   89.61 -constdefs
   89.62 -  treal_inv :: "hreal * hreal => hreal * hreal" 
   89.63 +definition treal_inv :: "hreal * hreal => hreal * hreal" where 
   89.64    "treal_inv ==
   89.65  %(x::hreal, y::hreal).
   89.66     if x = y then treal_0
   89.67 @@ -110,8 +103,7 @@
   89.68           else (hreal_1, hreal_add (hreal_inv (hreal_sub y x)) hreal_1))"
   89.69    by (import realax treal_inv)
   89.70  
   89.71 -constdefs
   89.72 -  treal_eq :: "hreal * hreal => hreal * hreal => bool" 
   89.73 +definition treal_eq :: "hreal * hreal => hreal * hreal => bool" where 
   89.74    "treal_eq ==
   89.75  %(x1::hreal, y1::hreal) (x2::hreal, y2::hreal).
   89.76     hreal_add x1 y2 = hreal_add x2 y1"
   89.77 @@ -194,15 +186,13 @@
   89.78     treal_lt treal_0 (treal_mul x y)"
   89.79    by (import realax TREAL_LT_MUL)
   89.80  
   89.81 -constdefs
   89.82 -  treal_of_hreal :: "hreal => hreal * hreal" 
   89.83 +definition treal_of_hreal :: "hreal => hreal * hreal" where 
   89.84    "treal_of_hreal == %x::hreal. (hreal_add x hreal_1, hreal_1)"
   89.85  
   89.86  lemma treal_of_hreal: "ALL x::hreal. treal_of_hreal x = (hreal_add x hreal_1, hreal_1)"
   89.87    by (import realax treal_of_hreal)
   89.88  
   89.89 -constdefs
   89.90 -  hreal_of_treal :: "hreal * hreal => hreal" 
   89.91 +definition hreal_of_treal :: "hreal * hreal => hreal" where 
   89.92    "hreal_of_treal == %(x::hreal, y::hreal). SOME d::hreal. x = hreal_add y d"
   89.93  
   89.94  lemma hreal_of_treal: "ALL (x::hreal) y::hreal.
   89.95 @@ -579,8 +569,7 @@
   89.96     (EX x::real. ALL y::real. (EX x::real. P x & y < x) = (y < x))"
   89.97    by (import real REAL_SUP_EXISTS)
   89.98  
   89.99 -constdefs
  89.100 -  sup :: "(real => bool) => real" 
  89.101 +definition sup :: "(real => bool) => real" where 
  89.102    "sup ==
  89.103  %P::real => bool.
  89.104     SOME s::real. ALL y::real. (EX x::real. P x & y < x) = (y < s)"
  89.105 @@ -781,8 +770,7 @@
  89.106  
  89.107  ;setup_theory topology
  89.108  
  89.109 -constdefs
  89.110 -  re_Union :: "(('a => bool) => bool) => 'a => bool" 
  89.111 +definition re_Union :: "(('a => bool) => bool) => 'a => bool" where 
  89.112    "re_Union ==
  89.113  %(P::('a::type => bool) => bool) x::'a::type.
  89.114     EX s::'a::type => bool. P s & s x"
  89.115 @@ -791,8 +779,7 @@
  89.116     re_Union P = (%x::'a::type. EX s::'a::type => bool. P s & s x)"
  89.117    by (import topology re_Union)
  89.118  
  89.119 -constdefs
  89.120 -  re_union :: "('a => bool) => ('a => bool) => 'a => bool" 
  89.121 +definition re_union :: "('a => bool) => ('a => bool) => 'a => bool" where 
  89.122    "re_union ==
  89.123  %(P::'a::type => bool) (Q::'a::type => bool) x::'a::type. P x | Q x"
  89.124  
  89.125 @@ -800,8 +787,7 @@
  89.126     re_union P Q = (%x::'a::type. P x | Q x)"
  89.127    by (import topology re_union)
  89.128  
  89.129 -constdefs
  89.130 -  re_intersect :: "('a => bool) => ('a => bool) => 'a => bool" 
  89.131 +definition re_intersect :: "('a => bool) => ('a => bool) => 'a => bool" where 
  89.132    "re_intersect ==
  89.133  %(P::'a::type => bool) (Q::'a::type => bool) x::'a::type. P x & Q x"
  89.134  
  89.135 @@ -809,22 +795,19 @@
  89.136     re_intersect P Q = (%x::'a::type. P x & Q x)"
  89.137    by (import topology re_intersect)
  89.138  
  89.139 -constdefs
  89.140 -  re_null :: "'a => bool" 
  89.141 +definition re_null :: "'a => bool" where 
  89.142    "re_null == %x::'a::type. False"
  89.143  
  89.144  lemma re_null: "re_null = (%x::'a::type. False)"
  89.145    by (import topology re_null)
  89.146  
  89.147 -constdefs
  89.148 -  re_universe :: "'a => bool" 
  89.149 +definition re_universe :: "'a => bool" where 
  89.150    "re_universe == %x::'a::type. True"
  89.151  
  89.152  lemma re_universe: "re_universe = (%x::'a::type. True)"
  89.153    by (import topology re_universe)
  89.154  
  89.155 -constdefs
  89.156 -  re_subset :: "('a => bool) => ('a => bool) => bool" 
  89.157 +definition re_subset :: "('a => bool) => ('a => bool) => bool" where 
  89.158    "re_subset ==
  89.159  %(P::'a::type => bool) Q::'a::type => bool. ALL x::'a::type. P x --> Q x"
  89.160  
  89.161 @@ -832,8 +815,7 @@
  89.162     re_subset P Q = (ALL x::'a::type. P x --> Q x)"
  89.163    by (import topology re_subset)
  89.164  
  89.165 -constdefs
  89.166 -  re_compl :: "('a => bool) => 'a => bool" 
  89.167 +definition re_compl :: "('a => bool) => 'a => bool" where 
  89.168    "re_compl == %(P::'a::type => bool) x::'a::type. ~ P x"
  89.169  
  89.170  lemma re_compl: "ALL P::'a::type => bool. re_compl P = (%x::'a::type. ~ P x)"
  89.171 @@ -853,8 +835,7 @@
  89.172     re_subset P Q & re_subset Q R --> re_subset P R"
  89.173    by (import topology SUBSET_TRANS)
  89.174  
  89.175 -constdefs
  89.176 -  istopology :: "(('a => bool) => bool) => bool" 
  89.177 +definition istopology :: "(('a => bool) => bool) => bool" where 
  89.178    "istopology ==
  89.179  %L::('a::type => bool) => bool.
  89.180     L re_null &
  89.181 @@ -900,8 +881,7 @@
  89.182     re_subset xa (open x) --> open x (re_Union xa)"
  89.183    by (import topology TOPOLOGY_UNION)
  89.184  
  89.185 -constdefs
  89.186 -  neigh :: "'a topology => ('a => bool) * 'a => bool" 
  89.187 +definition neigh :: "'a topology => ('a => bool) * 'a => bool" where 
  89.188    "neigh ==
  89.189  %(top::'a::type topology) (N::'a::type => bool, x::'a::type).
  89.190     EX P::'a::type => bool. open top P & re_subset P N & P x"
  89.191 @@ -932,16 +912,14 @@
  89.192         S' x --> (EX N::'a::type => bool. neigh top (N, x) & re_subset N S'))"
  89.193    by (import topology OPEN_NEIGH)
  89.194  
  89.195 -constdefs
  89.196 -  closed :: "'a topology => ('a => bool) => bool" 
  89.197 +definition closed :: "'a topology => ('a => bool) => bool" where 
  89.198    "closed == %(L::'a::type topology) S'::'a::type => bool. open L (re_compl S')"
  89.199  
  89.200  lemma closed: "ALL (L::'a::type topology) S'::'a::type => bool.
  89.201     closed L S' = open L (re_compl S')"
  89.202    by (import topology closed)
  89.203  
  89.204 -constdefs
  89.205 -  limpt :: "'a topology => 'a => ('a => bool) => bool" 
  89.206 +definition limpt :: "'a topology => 'a => ('a => bool) => bool" where 
  89.207    "limpt ==
  89.208  %(top::'a::type topology) (x::'a::type) S'::'a::type => bool.
  89.209     ALL N::'a::type => bool.
  89.210 @@ -957,8 +935,7 @@
  89.211     closed top S' = (ALL x::'a::type. limpt top x S' --> S' x)"
  89.212    by (import topology CLOSED_LIMPT)
  89.213  
  89.214 -constdefs
  89.215 -  ismet :: "('a * 'a => real) => bool" 
  89.216 +definition ismet :: "('a * 'a => real) => bool" where 
  89.217    "ismet ==
  89.218  %m::'a::type * 'a::type => real.
  89.219     (ALL (x::'a::type) y::'a::type. (m (x, y) = 0) = (x = y)) &
  89.220 @@ -1012,8 +989,7 @@
  89.221     x ~= y --> 0 < dist m (x, y)"
  89.222    by (import topology METRIC_NZ)
  89.223  
  89.224 -constdefs
  89.225 -  mtop :: "'a metric => 'a topology" 
  89.226 +definition mtop :: "'a metric => 'a topology" where 
  89.227    "mtop ==
  89.228  %m::'a::type metric.
  89.229     topology
  89.230 @@ -1042,8 +1018,7 @@
  89.231         S' xa --> (EX e>0. ALL y::'a::type. dist x (xa, y) < e --> S' y))"
  89.232    by (import topology MTOP_OPEN)
  89.233  
  89.234 -constdefs
  89.235 -  B :: "'a metric => 'a * real => 'a => bool" 
  89.236 +definition B :: "'a metric => 'a * real => 'a => bool" where 
  89.237    "B ==
  89.238  %(m::'a::type metric) (x::'a::type, e::real) y::'a::type. dist m (x, y) < e"
  89.239  
  89.240 @@ -1067,8 +1042,7 @@
  89.241  lemma ISMET_R1: "ismet (%(x::real, y::real). abs (y - x))"
  89.242    by (import topology ISMET_R1)
  89.243  
  89.244 -constdefs
  89.245 -  mr1 :: "real metric" 
  89.246 +definition mr1 :: "real metric" where 
  89.247    "mr1 == metric (%(x::real, y::real). abs (y - x))"
  89.248  
  89.249  lemma mr1: "mr1 = metric (%(x::real, y::real). abs (y - x))"
  89.250 @@ -1105,8 +1079,7 @@
  89.251  
  89.252  ;setup_theory nets
  89.253  
  89.254 -constdefs
  89.255 -  dorder :: "('a => 'a => bool) => bool" 
  89.256 +definition dorder :: "('a => 'a => bool) => bool" where 
  89.257    "dorder ==
  89.258  %g::'a::type => 'a::type => bool.
  89.259     ALL (x::'a::type) y::'a::type.
  89.260 @@ -1120,8 +1093,7 @@
  89.261         (EX z::'a::type. g z z & (ALL w::'a::type. g w z --> g w x & g w y)))"
  89.262    by (import nets dorder)
  89.263  
  89.264 -constdefs
  89.265 -  tends :: "('b => 'a) => 'a => 'a topology * ('b => 'b => bool) => bool" 
  89.266 +definition tends :: "('b => 'a) => 'a => 'a topology * ('b => 'b => bool) => bool" where 
  89.267    "tends ==
  89.268  %(s::'b::type => 'a::type) (l::'a::type) (top::'a::type topology,
  89.269     g::'b::type => 'b::type => bool).
  89.270 @@ -1137,8 +1109,7 @@
  89.271         (EX n::'b::type. g n n & (ALL m::'b::type. g m n --> N (s m))))"
  89.272    by (import nets tends)
  89.273  
  89.274 -constdefs
  89.275 -  bounded :: "'a metric * ('b => 'b => bool) => ('b => 'a) => bool" 
  89.276 +definition bounded :: "'a metric * ('b => 'b => bool) => ('b => 'a) => bool" where 
  89.277    "bounded ==
  89.278  %(m::'a::type metric, g::'b::type => 'b::type => bool)
  89.279     f::'b::type => 'a::type.
  89.280 @@ -1152,8 +1123,7 @@
  89.281         g N N & (ALL n::'b::type. g n N --> dist m (f n, x) < k))"
  89.282    by (import nets bounded)
  89.283  
  89.284 -constdefs
  89.285 -  tendsto :: "'a metric * 'a => 'a => 'a => bool" 
  89.286 +definition tendsto :: "'a metric * 'a => 'a => 'a => bool" where 
  89.287    "tendsto ==
  89.288  %(m::'a::type metric, x::'a::type) (y::'a::type) z::'a::type.
  89.289     0 < dist m (x, y) & dist m (x, y) <= dist m (x, z)"
  89.290 @@ -1366,15 +1336,13 @@
  89.291     hol4--> x x1 & hol4--> x x2 --> x1 = x2"
  89.292    by (import seq SEQ_UNIQ)
  89.293  
  89.294 -constdefs
  89.295 -  convergent :: "(nat => real) => bool" 
  89.296 +definition convergent :: "(nat => real) => bool" where 
  89.297    "convergent == %f::nat => real. Ex (hol4--> f)"
  89.298  
  89.299  lemma convergent: "ALL f::nat => real. convergent f = Ex (hol4--> f)"
  89.300    by (import seq convergent)
  89.301  
  89.302 -constdefs
  89.303 -  cauchy :: "(nat => real) => bool" 
  89.304 +definition cauchy :: "(nat => real) => bool" where 
  89.305    "cauchy ==
  89.306  %f::nat => real.
  89.307     ALL e>0.
  89.308 @@ -1388,8 +1356,7 @@
  89.309            ALL (m::nat) n::nat. N <= m & N <= n --> abs (f m - f n) < e)"
  89.310    by (import seq cauchy)
  89.311  
  89.312 -constdefs
  89.313 -  lim :: "(nat => real) => real" 
  89.314 +definition lim :: "(nat => real) => real" where 
  89.315    "lim == %f::nat => real. Eps (hol4--> f)"
  89.316  
  89.317  lemma lim: "ALL f::nat => real. lim f = Eps (hol4--> f)"
  89.318 @@ -1398,8 +1365,7 @@
  89.319  lemma SEQ_LIM: "ALL f::nat => real. convergent f = hol4--> f (lim f)"
  89.320    by (import seq SEQ_LIM)
  89.321  
  89.322 -constdefs
  89.323 -  subseq :: "(nat => nat) => bool" 
  89.324 +definition subseq :: "(nat => nat) => bool" where 
  89.325    "subseq == %f::nat => nat. ALL (m::nat) n::nat. m < n --> f m < f n"
  89.326  
  89.327  lemma subseq: "ALL f::nat => nat. subseq f = (ALL (m::nat) n::nat. m < n --> f m < f n)"
  89.328 @@ -1541,23 +1507,20 @@
  89.329     (ALL (a::real) b::real. a <= b --> P (a, b))"
  89.330    by (import seq BOLZANO_LEMMA)
  89.331  
  89.332 -constdefs
  89.333 -  sums :: "(nat => real) => real => bool" 
  89.334 +definition sums :: "(nat => real) => real => bool" where 
  89.335    "sums == %f::nat => real. hol4--> (%n::nat. real.sum (0, n) f)"
  89.336  
  89.337  lemma sums: "ALL (f::nat => real) s::real.
  89.338     sums f s = hol4--> (%n::nat. real.sum (0, n) f) s"
  89.339    by (import seq sums)
  89.340  
  89.341 -constdefs
  89.342 -  summable :: "(nat => real) => bool" 
  89.343 +definition summable :: "(nat => real) => bool" where 
  89.344    "summable == %f::nat => real. Ex (sums f)"
  89.345  
  89.346  lemma summable: "ALL f::nat => real. summable f = Ex (sums f)"
  89.347    by (import seq summable)
  89.348  
  89.349 -constdefs
  89.350 -  suminf :: "(nat => real) => real" 
  89.351 +definition suminf :: "(nat => real) => real" where 
  89.352    "suminf == %f::nat => real. Eps (sums f)"
  89.353  
  89.354  lemma suminf: "ALL f::nat => real. suminf f = Eps (sums f)"
  89.355 @@ -1692,8 +1655,7 @@
  89.356  
  89.357  ;setup_theory lim
  89.358  
  89.359 -constdefs
  89.360 -  tends_real_real :: "(real => real) => real => real => bool" 
  89.361 +definition tends_real_real :: "(real => real) => real => real => bool" where 
  89.362    "tends_real_real ==
  89.363  %(f::real => real) (l::real) x0::real.
  89.364     tends f l (mtop mr1, tendsto (mr1, x0))"
  89.365 @@ -1763,8 +1725,7 @@
  89.366     tends_real_real f l x0"
  89.367    by (import lim LIM_TRANSFORM)
  89.368  
  89.369 -constdefs
  89.370 -  diffl :: "(real => real) => real => real => bool" 
  89.371 +definition diffl :: "(real => real) => real => real => bool" where 
  89.372    "diffl ==
  89.373  %(f::real => real) (l::real) x::real.
  89.374     tends_real_real (%h::real. (f (x + h) - f x) / h) l 0"
  89.375 @@ -1773,8 +1734,7 @@
  89.376     diffl f l x = tends_real_real (%h::real. (f (x + h) - f x) / h) l 0"
  89.377    by (import lim diffl)
  89.378  
  89.379 -constdefs
  89.380 -  contl :: "(real => real) => real => bool" 
  89.381 +definition contl :: "(real => real) => real => bool" where 
  89.382    "contl ==
  89.383  %(f::real => real) x::real. tends_real_real (%h::real. f (x + h)) (f x) 0"
  89.384  
  89.385 @@ -1782,8 +1742,7 @@
  89.386     contl f x = tends_real_real (%h::real. f (x + h)) (f x) 0"
  89.387    by (import lim contl)
  89.388  
  89.389 -constdefs
  89.390 -  differentiable :: "(real => real) => real => bool" 
  89.391 +definition differentiable :: "(real => real) => real => bool" where 
  89.392    "differentiable == %(f::real => real) x::real. EX l::real. diffl f l x"
  89.393  
  89.394  lemma differentiable: "ALL (f::real => real) x::real.
  89.395 @@ -2127,8 +2086,7 @@
  89.396     summable (%n::nat. f n * z ^ n)"
  89.397    by (import powser POWSER_INSIDE)
  89.398  
  89.399 -constdefs
  89.400 -  diffs :: "(nat => real) => nat => real" 
  89.401 +definition diffs :: "(nat => real) => nat => real" where 
  89.402    "diffs == %(c::nat => real) n::nat. real (Suc n) * c (Suc n)"
  89.403  
  89.404  lemma diffs: "ALL c::nat => real. diffs c = (%n::nat. real (Suc n) * c (Suc n))"
  89.405 @@ -2204,15 +2162,13 @@
  89.406  
  89.407  ;setup_theory transc
  89.408  
  89.409 -constdefs
  89.410 -  exp :: "real => real" 
  89.411 +definition exp :: "real => real" where 
  89.412    "exp == %x::real. suminf (%n::nat. inverse (real (FACT n)) * x ^ n)"
  89.413  
  89.414  lemma exp: "ALL x::real. exp x = suminf (%n::nat. inverse (real (FACT n)) * x ^ n)"
  89.415    by (import transc exp)
  89.416  
  89.417 -constdefs
  89.418 -  cos :: "real => real" 
  89.419 +definition cos :: "real => real" where 
  89.420    "cos ==
  89.421  %x::real.
  89.422     suminf
  89.423 @@ -2226,8 +2182,7 @@
  89.424          (if EVEN n then (- 1) ^ (n div 2) / real (FACT n) else 0) * x ^ n)"
  89.425    by (import transc cos)
  89.426  
  89.427 -constdefs
  89.428 -  sin :: "real => real" 
  89.429 +definition sin :: "real => real" where 
  89.430    "sin ==
  89.431  %x::real.
  89.432     suminf
  89.433 @@ -2364,8 +2319,7 @@
  89.434  lemma EXP_TOTAL: "ALL y>0. EX x::real. exp x = y"
  89.435    by (import transc EXP_TOTAL)
  89.436  
  89.437 -constdefs
  89.438 -  ln :: "real => real" 
  89.439 +definition ln :: "real => real" where 
  89.440    "ln == %x::real. SOME u::real. exp u = x"
  89.441  
  89.442  lemma ln: "ALL x::real. ln x = (SOME u::real. exp u = x)"
  89.443 @@ -2410,16 +2364,14 @@
  89.444  lemma LN_POS: "ALL x>=1. 0 <= ln x"
  89.445    by (import transc LN_POS)
  89.446  
  89.447 -constdefs
  89.448 -  root :: "nat => real => real" 
  89.449 +definition root :: "nat => real => real" where 
  89.450    "root == %(n::nat) x::real. SOME u::real. (0 < x --> 0 < u) & u ^ n = x"
  89.451  
  89.452  lemma root: "ALL (n::nat) x::real.
  89.453     root n x = (SOME u::real. (0 < x --> 0 < u) & u ^ n = x)"
  89.454    by (import transc root)
  89.455  
  89.456 -constdefs
  89.457 -  sqrt :: "real => real" 
  89.458 +definition sqrt :: "real => real" where 
  89.459    "sqrt == root 2"
  89.460  
  89.461  lemma sqrt: "ALL x::real. sqrt x = root 2 x"
  89.462 @@ -2584,8 +2536,7 @@
  89.463  lemma COS_ISZERO: "EX! x::real. 0 <= x & x <= 2 & cos x = 0"
  89.464    by (import transc COS_ISZERO)
  89.465  
  89.466 -constdefs
  89.467 -  pi :: "real" 
  89.468 +definition pi :: "real" where 
  89.469    "pi == 2 * (SOME x::real. 0 <= x & x <= 2 & cos x = 0)"
  89.470  
  89.471  lemma pi: "pi = 2 * (SOME x::real. 0 <= x & x <= 2 & cos x = 0)"
  89.472 @@ -2689,8 +2640,7 @@
  89.473      (EX n::nat. EVEN n & x = - (real n * (pi / 2))))"
  89.474    by (import transc SIN_ZERO)
  89.475  
  89.476 -constdefs
  89.477 -  tan :: "real => real" 
  89.478 +definition tan :: "real => real" where 
  89.479    "tan == %x::real. sin x / cos x"
  89.480  
  89.481  lemma tan: "ALL x::real. tan x = sin x / cos x"
  89.482 @@ -2736,23 +2686,20 @@
  89.483  lemma TAN_TOTAL: "ALL y::real. EX! x::real. - (pi / 2) < x & x < pi / 2 & tan x = y"
  89.484    by (import transc TAN_TOTAL)
  89.485  
  89.486 -constdefs
  89.487 -  asn :: "real => real" 
  89.488 +definition asn :: "real => real" where 
  89.489    "asn == %y::real. SOME x::real. - (pi / 2) <= x & x <= pi / 2 & sin x = y"
  89.490  
  89.491  lemma asn: "ALL y::real.
  89.492     asn y = (SOME x::real. - (pi / 2) <= x & x <= pi / 2 & sin x = y)"
  89.493    by (import transc asn)
  89.494  
  89.495 -constdefs
  89.496 -  acs :: "real => real" 
  89.497 +definition acs :: "real => real" where 
  89.498    "acs == %y::real. SOME x::real. 0 <= x & x <= pi & cos x = y"
  89.499  
  89.500  lemma acs: "ALL y::real. acs y = (SOME x::real. 0 <= x & x <= pi & cos x = y)"
  89.501    by (import transc acs)
  89.502  
  89.503 -constdefs
  89.504 -  atn :: "real => real" 
  89.505 +definition atn :: "real => real" where 
  89.506    "atn == %y::real. SOME x::real. - (pi / 2) < x & x < pi / 2 & tan x = y"
  89.507  
  89.508  lemma atn: "ALL y::real. atn y = (SOME x::real. - (pi / 2) < x & x < pi / 2 & tan x = y)"
  89.509 @@ -2845,8 +2792,7 @@
  89.510  lemma DIFF_ATN: "ALL x::real. diffl atn (inverse (1 + x ^ 2)) x"
  89.511    by (import transc DIFF_ATN)
  89.512  
  89.513 -constdefs
  89.514 -  division :: "real * real => (nat => real) => bool" 
  89.515 +definition division :: "real * real => (nat => real) => bool" where 
  89.516    "(op ==::(real * real => (nat => real) => bool)
  89.517          => (real * real => (nat => real) => bool) => prop)
  89.518   (division::real * real => (nat => real) => bool)
  89.519 @@ -2898,8 +2844,7 @@
  89.520                                    b)))))))))"
  89.521    by (import transc division)
  89.522  
  89.523 -constdefs
  89.524 -  dsize :: "(nat => real) => nat" 
  89.525 +definition dsize :: "(nat => real) => nat" where 
  89.526    "(op ==::((nat => real) => nat) => ((nat => real) => nat) => prop)
  89.527   (dsize::(nat => real) => nat)
  89.528   (%D::nat => real.
  89.529 @@ -2937,8 +2882,7 @@
  89.530                      ((op =::real => real => bool) (D n) (D N)))))))"
  89.531    by (import transc dsize)
  89.532  
  89.533 -constdefs
  89.534 -  tdiv :: "real * real => (nat => real) * (nat => real) => bool" 
  89.535 +definition tdiv :: "real * real => (nat => real) * (nat => real) => bool" where 
  89.536    "tdiv ==
  89.537  %(a::real, b::real) (D::nat => real, p::nat => real).
  89.538     division (a, b) D & (ALL n::nat. D n <= p n & p n <= D (Suc n))"
  89.539 @@ -2948,16 +2892,14 @@
  89.540     (division (a, b) D & (ALL n::nat. D n <= p n & p n <= D (Suc n)))"
  89.541    by (import transc tdiv)
  89.542  
  89.543 -constdefs
  89.544 -  gauge :: "(real => bool) => (real => real) => bool" 
  89.545 +definition gauge :: "(real => bool) => (real => real) => bool" where 
  89.546    "gauge == %(E::real => bool) g::real => real. ALL x::real. E x --> 0 < g x"
  89.547  
  89.548  lemma gauge: "ALL (E::real => bool) g::real => real.
  89.549     gauge E g = (ALL x::real. E x --> 0 < g x)"
  89.550    by (import transc gauge)
  89.551  
  89.552 -constdefs
  89.553 -  fine :: "(real => real) => (nat => real) * (nat => real) => bool" 
  89.554 +definition fine :: "(real => real) => (nat => real) * (nat => real) => bool" where 
  89.555    "(op ==::((real => real) => (nat => real) * (nat => real) => bool)
  89.556          => ((real => real) => (nat => real) * (nat => real) => bool)
  89.557             => prop)
  89.558 @@ -3000,8 +2942,7 @@
  89.559                           (g (p n))))))))"
  89.560    by (import transc fine)
  89.561  
  89.562 -constdefs
  89.563 -  rsum :: "(nat => real) * (nat => real) => (real => real) => real" 
  89.564 +definition rsum :: "(nat => real) * (nat => real) => (real => real) => real" where 
  89.565    "rsum ==
  89.566  %(D::nat => real, p::nat => real) f::real => real.
  89.567     real.sum (0, dsize D) (%n::nat. f (p n) * (D (Suc n) - D n))"
  89.568 @@ -3011,8 +2952,7 @@
  89.569     real.sum (0, dsize D) (%n::nat. f (p n) * (D (Suc n) - D n))"
  89.570    by (import transc rsum)
  89.571  
  89.572 -constdefs
  89.573 -  Dint :: "real * real => (real => real) => real => bool" 
  89.574 +definition Dint :: "real * real => (real => real) => real => bool" where 
  89.575    "Dint ==
  89.576  %(a::real, b::real) (f::real => real) k::real.
  89.577     ALL e>0.
  89.578 @@ -3313,8 +3253,7 @@
  89.579      poly_diff_aux n (h # t) = real n * h # poly_diff_aux (Suc n) t)"
  89.580    by (import poly poly_diff_aux_def)
  89.581  
  89.582 -constdefs
  89.583 -  diff :: "real list => real list" 
  89.584 +definition diff :: "real list => real list" where 
  89.585    "diff == %l::real list. if l = [] then [] else poly_diff_aux 1 (tl l)"
  89.586  
  89.587  lemma poly_diff_def: "ALL l::real list. diff l = (if l = [] then [] else poly_diff_aux 1 (tl l))"
  89.588 @@ -3622,8 +3561,7 @@
  89.589     poly p = poly q --> poly (diff p) = poly (diff q)"
  89.590    by (import poly POLY_DIFF_WELLDEF)
  89.591  
  89.592 -constdefs
  89.593 -  poly_divides :: "real list => real list => bool" 
  89.594 +definition poly_divides :: "real list => real list => bool" where 
  89.595    "poly_divides ==
  89.596  %(p1::real list) p2::real list.
  89.597     EX q::real list. poly p2 = poly (poly_mul p1 q)"
  89.598 @@ -3681,8 +3619,7 @@
  89.599         ~ poly_divides (poly_exp [- a, 1] (Suc n)) p)"
  89.600    by (import poly POLY_ORDER)
  89.601  
  89.602 -constdefs
  89.603 -  poly_order :: "real => real list => nat" 
  89.604 +definition poly_order :: "real => real list => nat" where 
  89.605    "poly_order ==
  89.606  %(a::real) p::real list.
  89.607     SOME n::nat.
  89.608 @@ -3754,8 +3691,7 @@
  89.609     (ALL a::real. poly_order a q = (if poly_order a p = 0 then 0 else 1))"
  89.610    by (import poly POLY_SQUAREFREE_DECOMP_ORDER)
  89.611  
  89.612 -constdefs
  89.613 -  rsquarefree :: "real list => bool" 
  89.614 +definition rsquarefree :: "real list => bool" where 
  89.615    "rsquarefree ==
  89.616  %p::real list.
  89.617     poly p ~= poly [] &
  89.618 @@ -3798,8 +3734,7 @@
  89.619  lemma POLY_NORMALIZE: "ALL t::real list. poly (normalize t) = poly t"
  89.620    by (import poly POLY_NORMALIZE)
  89.621  
  89.622 -constdefs
  89.623 -  degree :: "real list => nat" 
  89.624 +definition degree :: "real list => nat" where 
  89.625    "degree == %p::real list. PRE (length (normalize p))"
  89.626  
  89.627  lemma degree: "ALL p::real list. degree p = PRE (length (normalize p))"
    90.1 --- a/src/HOL/Import/HOL/HOL4Vec.thy	Wed Feb 24 11:55:52 2010 +0100
    90.2 +++ b/src/HOL/Import/HOL/HOL4Vec.thy	Mon Mar 01 13:40:23 2010 +0100
    90.3 @@ -164,8 +164,7 @@
    90.4  lemma word_base0_def: "word_base0 = (%a::'a::type list. mk_word (CONSTR 0 a (%n::nat. BOTTOM)))"
    90.5    by (import word_base word_base0_def)
    90.6  
    90.7 -constdefs
    90.8 -  WORD :: "'a list => 'a word" 
    90.9 +definition WORD :: "'a list => 'a word" where 
   90.10    "WORD == word_base0"
   90.11  
   90.12  lemma WORD: "WORD = word_base0"
   90.13 @@ -680,8 +679,7 @@
   90.14  
   90.15  ;setup_theory word_num
   90.16  
   90.17 -constdefs
   90.18 -  LVAL :: "('a => nat) => nat => 'a list => nat" 
   90.19 +definition LVAL :: "('a => nat) => nat => 'a list => nat" where 
   90.20    "LVAL ==
   90.21  %(f::'a::type => nat) b::nat. foldl (%(e::nat) x::'a::type. b * e + f x) 0"
   90.22  
   90.23 @@ -756,8 +754,7 @@
   90.24      SNOC (frep (m mod b)) (NLIST n frep b (m div b)))"
   90.25    by (import word_num NLIST_DEF)
   90.26  
   90.27 -constdefs
   90.28 -  NWORD :: "nat => (nat => 'a) => nat => nat => 'a word" 
   90.29 +definition NWORD :: "nat => (nat => 'a) => nat => nat => 'a word" where 
   90.30    "NWORD ==
   90.31  %(n::nat) (frep::nat => 'a::type) (b::nat) m::nat. WORD (NLIST n frep b m)"
   90.32  
   90.33 @@ -1076,8 +1073,7 @@
   90.34     EXISTSABIT P (WCAT (w1, w2)) = (EXISTSABIT P w1 | EXISTSABIT P w2)"
   90.35    by (import word_bitop EXISTSABIT_WCAT)
   90.36  
   90.37 -constdefs
   90.38 -  SHR :: "bool => 'a => 'a word => 'a word * 'a" 
   90.39 +definition SHR :: "bool => 'a => 'a word => 'a word * 'a" where 
   90.40    "SHR ==
   90.41  %(f::bool) (b::'a::type) w::'a::type word.
   90.42     (WCAT
   90.43 @@ -1093,8 +1089,7 @@
   90.44      bit 0 w)"
   90.45    by (import word_bitop SHR_DEF)
   90.46  
   90.47 -constdefs
   90.48 -  SHL :: "bool => 'a word => 'a => 'a * 'a word" 
   90.49 +definition SHL :: "bool => 'a word => 'a => 'a * 'a word" where 
   90.50    "SHL ==
   90.51  %(f::bool) (w::'a::type word) b::'a::type.
   90.52     (bit (PRE (WORDLEN w)) w,
   90.53 @@ -1196,8 +1191,7 @@
   90.54  
   90.55  ;setup_theory bword_num
   90.56  
   90.57 -constdefs
   90.58 -  BV :: "bool => nat" 
   90.59 +definition BV :: "bool => nat" where 
   90.60    "BV == %b::bool. if b then Suc 0 else 0"
   90.61  
   90.62  lemma BV_DEF: "ALL b::bool. BV b = (if b then Suc 0 else 0)"
   90.63 @@ -1248,15 +1242,13 @@
   90.64               BNVAL (WCAT (w1, w2)) = BNVAL w1 * 2 ^ m + BNVAL w2))"
   90.65    by (import bword_num BNVAL_WCAT)
   90.66  
   90.67 -constdefs
   90.68 -  VB :: "nat => bool" 
   90.69 +definition VB :: "nat => bool" where 
   90.70    "VB == %n::nat. n mod 2 ~= 0"
   90.71  
   90.72  lemma VB_DEF: "ALL n::nat. VB n = (n mod 2 ~= 0)"
   90.73    by (import bword_num VB_DEF)
   90.74  
   90.75 -constdefs
   90.76 -  NBWORD :: "nat => nat => bool word" 
   90.77 +definition NBWORD :: "nat => nat => bool word" where 
   90.78    "NBWORD == %(n::nat) m::nat. WORD (NLIST n VB 2 m)"
   90.79  
   90.80  lemma NBWORD_DEF: "ALL (n::nat) m::nat. NBWORD n m = WORD (NLIST n VB 2 m)"
    91.1 --- a/src/HOL/Import/HOL/HOL4Word32.thy	Wed Feb 24 11:55:52 2010 +0100
    91.2 +++ b/src/HOL/Import/HOL/HOL4Word32.thy	Mon Mar 01 13:40:23 2010 +0100
    91.3 @@ -68,8 +68,7 @@
    91.4     BITS h l n = MOD_2EXP (Suc h - l) (DIV_2EXP l n)"
    91.5    by (import bits BITS_def)
    91.6  
    91.7 -constdefs
    91.8 -  bit :: "nat => nat => bool" 
    91.9 +definition bit :: "nat => nat => bool" where 
   91.10    "bit == %(b::nat) n::nat. BITS b b n = 1"
   91.11  
   91.12  lemma BIT_def: "ALL (b::nat) n::nat. bit b n = (BITS b b n = 1)"
   91.13 @@ -840,15 +839,13 @@
   91.14  lemma w_T_def: "w_T = mk_word32 (EQUIV COMP0)"
   91.15    by (import word32 w_T_def)
   91.16  
   91.17 -constdefs
   91.18 -  word_suc :: "word32 => word32" 
   91.19 +definition word_suc :: "word32 => word32" where 
   91.20    "word_suc == %T1::word32. mk_word32 (EQUIV (Suc (Eps (dest_word32 T1))))"
   91.21  
   91.22  lemma word_suc: "ALL T1::word32. word_suc T1 = mk_word32 (EQUIV (Suc (Eps (dest_word32 T1))))"
   91.23    by (import word32 word_suc)
   91.24  
   91.25 -constdefs
   91.26 -  word_add :: "word32 => word32 => word32" 
   91.27 +definition word_add :: "word32 => word32 => word32" where 
   91.28    "word_add ==
   91.29  %(T1::word32) T2::word32.
   91.30     mk_word32 (EQUIV (Eps (dest_word32 T1) + Eps (dest_word32 T2)))"
   91.31 @@ -858,8 +855,7 @@
   91.32     mk_word32 (EQUIV (Eps (dest_word32 T1) + Eps (dest_word32 T2)))"
   91.33    by (import word32 word_add)
   91.34  
   91.35 -constdefs
   91.36 -  word_mul :: "word32 => word32 => word32" 
   91.37 +definition word_mul :: "word32 => word32 => word32" where 
   91.38    "word_mul ==
   91.39  %(T1::word32) T2::word32.
   91.40     mk_word32 (EQUIV (Eps (dest_word32 T1) * Eps (dest_word32 T2)))"
   91.41 @@ -869,8 +865,7 @@
   91.42     mk_word32 (EQUIV (Eps (dest_word32 T1) * Eps (dest_word32 T2)))"
   91.43    by (import word32 word_mul)
   91.44  
   91.45 -constdefs
   91.46 -  word_1comp :: "word32 => word32" 
   91.47 +definition word_1comp :: "word32 => word32" where 
   91.48    "word_1comp ==
   91.49  %T1::word32. mk_word32 (EQUIV (ONE_COMP (Eps (dest_word32 T1))))"
   91.50  
   91.51 @@ -878,8 +873,7 @@
   91.52     word_1comp T1 = mk_word32 (EQUIV (ONE_COMP (Eps (dest_word32 T1))))"
   91.53    by (import word32 word_1comp)
   91.54  
   91.55 -constdefs
   91.56 -  word_2comp :: "word32 => word32" 
   91.57 +definition word_2comp :: "word32 => word32" where 
   91.58    "word_2comp ==
   91.59  %T1::word32. mk_word32 (EQUIV (TWO_COMP (Eps (dest_word32 T1))))"
   91.60  
   91.61 @@ -887,24 +881,21 @@
   91.62     word_2comp T1 = mk_word32 (EQUIV (TWO_COMP (Eps (dest_word32 T1))))"
   91.63    by (import word32 word_2comp)
   91.64  
   91.65 -constdefs
   91.66 -  word_lsr1 :: "word32 => word32" 
   91.67 +definition word_lsr1 :: "word32 => word32" where 
   91.68    "word_lsr1 == %T1::word32. mk_word32 (EQUIV (LSR_ONE (Eps (dest_word32 T1))))"
   91.69  
   91.70  lemma word_lsr1: "ALL T1::word32.
   91.71     word_lsr1 T1 = mk_word32 (EQUIV (LSR_ONE (Eps (dest_word32 T1))))"
   91.72    by (import word32 word_lsr1)
   91.73  
   91.74 -constdefs
   91.75 -  word_asr1 :: "word32 => word32" 
   91.76 +definition word_asr1 :: "word32 => word32" where 
   91.77    "word_asr1 == %T1::word32. mk_word32 (EQUIV (ASR_ONE (Eps (dest_word32 T1))))"
   91.78  
   91.79  lemma word_asr1: "ALL T1::word32.
   91.80     word_asr1 T1 = mk_word32 (EQUIV (ASR_ONE (Eps (dest_word32 T1))))"
   91.81    by (import word32 word_asr1)
   91.82  
   91.83 -constdefs
   91.84 -  word_ror1 :: "word32 => word32" 
   91.85 +definition word_ror1 :: "word32 => word32" where 
   91.86    "word_ror1 == %T1::word32. mk_word32 (EQUIV (ROR_ONE (Eps (dest_word32 T1))))"
   91.87  
   91.88  lemma word_ror1: "ALL T1::word32.
   91.89 @@ -940,8 +931,7 @@
   91.90  lemma MSB_def: "ALL T1::word32. MSB T1 = MSBn (Eps (dest_word32 T1))"
   91.91    by (import word32 MSB_def)
   91.92  
   91.93 -constdefs
   91.94 -  bitwise_or :: "word32 => word32 => word32" 
   91.95 +definition bitwise_or :: "word32 => word32 => word32" where 
   91.96    "bitwise_or ==
   91.97  %(T1::word32) T2::word32.
   91.98     mk_word32 (EQUIV (OR (Eps (dest_word32 T1)) (Eps (dest_word32 T2))))"
   91.99 @@ -951,8 +941,7 @@
  91.100     mk_word32 (EQUIV (OR (Eps (dest_word32 T1)) (Eps (dest_word32 T2))))"
  91.101    by (import word32 bitwise_or)
  91.102  
  91.103 -constdefs
  91.104 -  bitwise_eor :: "word32 => word32 => word32" 
  91.105 +definition bitwise_eor :: "word32 => word32 => word32" where 
  91.106    "bitwise_eor ==
  91.107  %(T1::word32) T2::word32.
  91.108     mk_word32 (EQUIV (EOR (Eps (dest_word32 T1)) (Eps (dest_word32 T2))))"
  91.109 @@ -962,8 +951,7 @@
  91.110     mk_word32 (EQUIV (EOR (Eps (dest_word32 T1)) (Eps (dest_word32 T2))))"
  91.111    by (import word32 bitwise_eor)
  91.112  
  91.113 -constdefs
  91.114 -  bitwise_and :: "word32 => word32 => word32" 
  91.115 +definition bitwise_and :: "word32 => word32 => word32" where 
  91.116    "bitwise_and ==
  91.117  %(T1::word32) T2::word32.
  91.118     mk_word32 (EQUIV (AND (Eps (dest_word32 T1)) (Eps (dest_word32 T2))))"
  91.119 @@ -1154,36 +1142,31 @@
  91.120  lemma ADD_TWO_COMP2: "ALL x::word32. word_add (word_2comp x) x = w_0"
  91.121    by (import word32 ADD_TWO_COMP2)
  91.122  
  91.123 -constdefs
  91.124 -  word_sub :: "word32 => word32 => word32" 
  91.125 +definition word_sub :: "word32 => word32 => word32" where 
  91.126    "word_sub == %(a::word32) b::word32. word_add a (word_2comp b)"
  91.127  
  91.128  lemma word_sub: "ALL (a::word32) b::word32. word_sub a b = word_add a (word_2comp b)"
  91.129    by (import word32 word_sub)
  91.130  
  91.131 -constdefs
  91.132 -  word_lsl :: "word32 => nat => word32" 
  91.133 +definition word_lsl :: "word32 => nat => word32" where 
  91.134    "word_lsl == %(a::word32) n::nat. word_mul a (n2w (2 ^ n))"
  91.135  
  91.136  lemma word_lsl: "ALL (a::word32) n::nat. word_lsl a n = word_mul a (n2w (2 ^ n))"
  91.137    by (import word32 word_lsl)
  91.138  
  91.139 -constdefs
  91.140 -  word_lsr :: "word32 => nat => word32" 
  91.141 +definition word_lsr :: "word32 => nat => word32" where 
  91.142    "word_lsr == %(a::word32) n::nat. (word_lsr1 ^^ n) a"
  91.143  
  91.144  lemma word_lsr: "ALL (a::word32) n::nat. word_lsr a n = (word_lsr1 ^^ n) a"
  91.145    by (import word32 word_lsr)
  91.146  
  91.147 -constdefs
  91.148 -  word_asr :: "word32 => nat => word32" 
  91.149 +definition word_asr :: "word32 => nat => word32" where 
  91.150    "word_asr == %(a::word32) n::nat. (word_asr1 ^^ n) a"
  91.151  
  91.152  lemma word_asr: "ALL (a::word32) n::nat. word_asr a n = (word_asr1 ^^ n) a"
  91.153    by (import word32 word_asr)
  91.154  
  91.155 -constdefs
  91.156 -  word_ror :: "word32 => nat => word32" 
  91.157 +definition word_ror :: "word32 => nat => word32" where 
  91.158    "word_ror == %(a::word32) n::nat. (word_ror1 ^^ n) a"
  91.159  
  91.160  lemma word_ror: "ALL (a::word32) n::nat. word_ror a n = (word_ror1 ^^ n) a"
    92.1 --- a/src/HOL/Import/HOL4Compat.thy	Wed Feb 24 11:55:52 2010 +0100
    92.2 +++ b/src/HOL/Import/HOL4Compat.thy	Mon Mar 01 13:40:23 2010 +0100
    92.3 @@ -15,8 +15,7 @@
    92.4  lemma COND_DEF:"(If b t f) = (@x. ((b = True) --> (x = t)) & ((b = False) --> (x = f)))"
    92.5    by auto
    92.6  
    92.7 -constdefs
    92.8 -  LET :: "['a \<Rightarrow> 'b,'a] \<Rightarrow> 'b"
    92.9 +definition LET :: "['a \<Rightarrow> 'b,'a] \<Rightarrow> 'b" where
   92.10    "LET f s == f s"
   92.11  
   92.12  lemma [hol4rew]: "LET f s = Let s f"
   92.13 @@ -119,10 +118,10 @@
   92.14  lemma LESS_OR_EQ: "m <= (n::nat) = (m < n | m = n)"
   92.15    by auto
   92.16  
   92.17 -constdefs
   92.18 -  nat_gt :: "nat => nat => bool"
   92.19 +definition nat_gt :: "nat => nat => bool" where
   92.20    "nat_gt == %m n. n < m"
   92.21 -  nat_ge :: "nat => nat => bool"
   92.22 +
   92.23 +definition nat_ge :: "nat => nat => bool" where
   92.24    "nat_ge == %m n. nat_gt m n | m = n"
   92.25  
   92.26  lemma [hol4rew]: "nat_gt m n = (n < m)"
   92.27 @@ -200,8 +199,7 @@
   92.28    qed
   92.29  qed;
   92.30  
   92.31 -constdefs
   92.32 -  FUNPOW :: "('a => 'a) => nat => 'a => 'a"
   92.33 +definition FUNPOW :: "('a => 'a) => nat => 'a => 'a" where
   92.34    "FUNPOW f n == f ^^ n"
   92.35  
   92.36  lemma FUNPOW: "(ALL f x. (f ^^ 0) x = x) &
   92.37 @@ -229,14 +227,16 @@
   92.38  lemma DIVISION: "(0::nat) < n --> (!k. (k = k div n * n + k mod n) & k mod n < n)"
   92.39    by simp
   92.40  
   92.41 -constdefs
   92.42 -  ALT_ZERO :: nat
   92.43 +definition ALT_ZERO :: nat where 
   92.44    "ALT_ZERO == 0"
   92.45 -  NUMERAL_BIT1 :: "nat \<Rightarrow> nat"
   92.46 +
   92.47 +definition NUMERAL_BIT1 :: "nat \<Rightarrow> nat" where 
   92.48    "NUMERAL_BIT1 n == n + (n + Suc 0)"
   92.49 -  NUMERAL_BIT2 :: "nat \<Rightarrow> nat"
   92.50 +
   92.51 +definition NUMERAL_BIT2 :: "nat \<Rightarrow> nat" where 
   92.52    "NUMERAL_BIT2 n == n + (n + Suc (Suc 0))"
   92.53 -  NUMERAL :: "nat \<Rightarrow> nat"
   92.54 +
   92.55 +definition NUMERAL :: "nat \<Rightarrow> nat" where 
   92.56    "NUMERAL x == x"
   92.57  
   92.58  lemma [hol4rew]: "NUMERAL ALT_ZERO = 0"
   92.59 @@ -329,8 +329,7 @@
   92.60  lemma NULL_DEF: "(null [] = True) & (!h t. null (h # t) = False)"
   92.61    by simp
   92.62  
   92.63 -constdefs
   92.64 -  sum :: "nat list \<Rightarrow> nat"
   92.65 +definition sum :: "nat list \<Rightarrow> nat" where
   92.66    "sum l == foldr (op +) l 0"
   92.67  
   92.68  lemma SUM: "(sum [] = 0) & (!h t. sum (h#t) = h + sum t)"
   92.69 @@ -359,8 +358,7 @@
   92.70    (ALL n x. replicate (Suc n) x = x # replicate n x)"
   92.71    by simp
   92.72  
   92.73 -constdefs
   92.74 -  FOLDR :: "[['a,'b]\<Rightarrow>'b,'b,'a list] \<Rightarrow> 'b"
   92.75 +definition FOLDR :: "[['a,'b]\<Rightarrow>'b,'b,'a list] \<Rightarrow> 'b" where
   92.76    "FOLDR f e l == foldr f l e"
   92.77  
   92.78  lemma [hol4rew]: "FOLDR f e l = foldr f l e"
   92.79 @@ -418,8 +416,7 @@
   92.80  lemma list_CASES: "(l = []) | (? t h. l = h#t)"
   92.81    by (induct l,auto)
   92.82  
   92.83 -constdefs
   92.84 -  ZIP :: "'a list * 'b list \<Rightarrow> ('a * 'b) list"
   92.85 +definition ZIP :: "'a list * 'b list \<Rightarrow> ('a * 'b) list" where
   92.86    "ZIP == %(a,b). zip a b"
   92.87  
   92.88  lemma ZIP: "(zip [] [] = []) &
   92.89 @@ -514,8 +511,7 @@
   92.90  lemma pow: "(!x::real. x ^ 0 = 1) & (!x::real. ALL n. x ^ (Suc n) = x * x ^ n)"
   92.91    by simp
   92.92  
   92.93 -constdefs
   92.94 -  real_gt :: "real => real => bool" 
   92.95 +definition real_gt :: "real => real => bool" where 
   92.96    "real_gt == %x y. y < x"
   92.97  
   92.98  lemma [hol4rew]: "real_gt x y = (y < x)"
   92.99 @@ -524,8 +520,7 @@
  92.100  lemma real_gt: "ALL x (y::real). (y < x) = (y < x)"
  92.101    by simp
  92.102  
  92.103 -constdefs
  92.104 -  real_ge :: "real => real => bool"
  92.105 +definition real_ge :: "real => real => bool" where
  92.106    "real_ge x y == y <= x"
  92.107  
  92.108  lemma [hol4rew]: "real_ge x y = (y <= x)"
    93.1 --- a/src/HOL/Import/HOLLight/HOLLight.thy	Wed Feb 24 11:55:52 2010 +0100
    93.2 +++ b/src/HOL/Import/HOLLight/HOLLight.thy	Mon Mar 01 13:40:23 2010 +0100
    93.3 @@ -95,8 +95,7 @@
    93.4  lemma EXCLUDED_MIDDLE: "ALL t::bool. t | ~ t"
    93.5    by (import hollight EXCLUDED_MIDDLE)
    93.6  
    93.7 -constdefs
    93.8 -  COND :: "bool => 'A => 'A => 'A" 
    93.9 +definition COND :: "bool => 'A => 'A => 'A" where 
   93.10    "COND ==
   93.11  %(t::bool) (t1::'A::type) t2::'A::type.
   93.12     SOME x::'A::type. (t = True --> x = t1) & (t = False --> x = t2)"
   93.13 @@ -173,15 +172,13 @@
   93.14  (b & P x True | ~ b & P y False)"
   93.15    by (import hollight th_cond)
   93.16  
   93.17 -constdefs
   93.18 -  LET_END :: "'A => 'A" 
   93.19 +definition LET_END :: "'A => 'A" where 
   93.20    "LET_END == %t::'A::type. t"
   93.21  
   93.22  lemma DEF_LET_END: "LET_END = (%t::'A::type. t)"
   93.23    by (import hollight DEF_LET_END)
   93.24  
   93.25 -constdefs
   93.26 -  GABS :: "('A => bool) => 'A" 
   93.27 +definition GABS :: "('A => bool) => 'A" where 
   93.28    "(op ==::(('A::type => bool) => 'A::type)
   93.29          => (('A::type => bool) => 'A::type) => prop)
   93.30   (GABS::('A::type => bool) => 'A::type)
   93.31 @@ -193,8 +190,7 @@
   93.32   (Eps::('A::type => bool) => 'A::type)"
   93.33    by (import hollight DEF_GABS)
   93.34  
   93.35 -constdefs
   93.36 -  GEQ :: "'A => 'A => bool" 
   93.37 +definition GEQ :: "'A => 'A => bool" where 
   93.38    "(op ==::('A::type => 'A::type => bool)
   93.39          => ('A::type => 'A::type => bool) => prop)
   93.40   (GEQ::'A::type => 'A::type => bool) (op =::'A::type => 'A::type => bool)"
   93.41 @@ -208,8 +204,7 @@
   93.42     x = Pair_Rep a b"
   93.43    by (import hollight PAIR_EXISTS_THM)
   93.44  
   93.45 -constdefs
   93.46 -  CURRY :: "('A * 'B => 'C) => 'A => 'B => 'C" 
   93.47 +definition CURRY :: "('A * 'B => 'C) => 'A => 'B => 'C" where 
   93.48    "CURRY ==
   93.49  %(u::'A::type * 'B::type => 'C::type) (ua::'A::type) ub::'B::type.
   93.50     u (ua, ub)"
   93.51 @@ -219,8 +214,7 @@
   93.52      u (ua, ub))"
   93.53    by (import hollight DEF_CURRY)
   93.54  
   93.55 -constdefs
   93.56 -  UNCURRY :: "('A => 'B => 'C) => 'A * 'B => 'C" 
   93.57 +definition UNCURRY :: "('A => 'B => 'C) => 'A * 'B => 'C" where 
   93.58    "UNCURRY ==
   93.59  %(u::'A::type => 'B::type => 'C::type) ua::'A::type * 'B::type.
   93.60     u (fst ua) (snd ua)"
   93.61 @@ -230,8 +224,7 @@
   93.62      u (fst ua) (snd ua))"
   93.63    by (import hollight DEF_UNCURRY)
   93.64  
   93.65 -constdefs
   93.66 -  PASSOC :: "(('A * 'B) * 'C => 'D) => 'A * 'B * 'C => 'D" 
   93.67 +definition PASSOC :: "(('A * 'B) * 'C => 'D) => 'A * 'B * 'C => 'D" where 
   93.68    "PASSOC ==
   93.69  %(u::('A::type * 'B::type) * 'C::type => 'D::type)
   93.70     ua::'A::type * 'B::type * 'C::type.
   93.71 @@ -291,8 +284,7 @@
   93.72     (m * n = NUMERAL_BIT1 0) = (m = NUMERAL_BIT1 0 & n = NUMERAL_BIT1 0)"
   93.73    by (import hollight MULT_EQ_1)
   93.74  
   93.75 -constdefs
   93.76 -  EXP :: "nat => nat => nat" 
   93.77 +definition EXP :: "nat => nat => nat" where 
   93.78    "EXP ==
   93.79  SOME EXP::nat => nat => nat.
   93.80     (ALL m::nat. EXP m 0 = NUMERAL_BIT1 0) &
   93.81 @@ -549,8 +541,7 @@
   93.82     (EX m::nat. P m & (ALL x::nat. P x --> <= x m))"
   93.83    by (import hollight num_MAX)
   93.84  
   93.85 -constdefs
   93.86 -  EVEN :: "nat => bool" 
   93.87 +definition EVEN :: "nat => bool" where 
   93.88    "EVEN ==
   93.89  SOME EVEN::nat => bool.
   93.90     EVEN 0 = True & (ALL n::nat. EVEN (Suc n) = (~ EVEN n))"
   93.91 @@ -560,8 +551,7 @@
   93.92      EVEN 0 = True & (ALL n::nat. EVEN (Suc n) = (~ EVEN n)))"
   93.93    by (import hollight DEF_EVEN)
   93.94  
   93.95 -constdefs
   93.96 -  ODD :: "nat => bool" 
   93.97 +definition ODD :: "nat => bool" where 
   93.98    "ODD ==
   93.99  SOME ODD::nat => bool. ODD 0 = False & (ALL n::nat. ODD (Suc n) = (~ ODD n))"
  93.100  
  93.101 @@ -641,8 +631,7 @@
  93.102  lemma SUC_SUB1: "ALL x::nat. Suc x - NUMERAL_BIT1 0 = x"
  93.103    by (import hollight SUC_SUB1)
  93.104  
  93.105 -constdefs
  93.106 -  FACT :: "nat => nat" 
  93.107 +definition FACT :: "nat => nat" where 
  93.108    "FACT ==
  93.109  SOME FACT::nat => nat.
  93.110     FACT 0 = NUMERAL_BIT1 0 & (ALL n::nat. FACT (Suc n) = Suc n * FACT n)"
  93.111 @@ -669,8 +658,7 @@
  93.112        COND (n = 0) (x = 0 & xa = 0) (m = x * n + xa & < xa n)"
  93.113    by (import hollight DIVMOD_EXIST_0)
  93.114  
  93.115 -constdefs
  93.116 -  DIV :: "nat => nat => nat" 
  93.117 +definition DIV :: "nat => nat => nat" where 
  93.118    "DIV ==
  93.119  SOME q::nat => nat => nat.
  93.120     EX r::nat => nat => nat.
  93.121 @@ -686,8 +674,7 @@
  93.122             (m = q m n * n + r m n & < (r m n) n))"
  93.123    by (import hollight DEF_DIV)
  93.124  
  93.125 -constdefs
  93.126 -  MOD :: "nat => nat => nat" 
  93.127 +definition MOD :: "nat => nat => nat" where 
  93.128    "MOD ==
  93.129  SOME r::nat => nat => nat.
  93.130     ALL (m::nat) n::nat.
  93.131 @@ -877,8 +864,7 @@
  93.132   n ~= 0 & (ALL (q::nat) r::nat. m = q * n + r & < r n --> P q r))"
  93.133    by (import hollight DIVMOD_ELIM_THM)
  93.134  
  93.135 -constdefs
  93.136 -  eqeq :: "'q_9910 => 'q_9909 => ('q_9910 => 'q_9909 => bool) => bool" 
  93.137 +definition eqeq :: "'q_9910 => 'q_9909 => ('q_9910 => 'q_9909 => bool) => bool" where 
  93.138    "eqeq ==
  93.139  %(u::'q_9910::type) (ua::'q_9909::type)
  93.140     ub::'q_9910::type => 'q_9909::type => bool. ub u ua"
  93.141 @@ -888,8 +874,7 @@
  93.142      ub::'q_9910::type => 'q_9909::type => bool. ub u ua)"
  93.143    by (import hollight DEF__equal__equal_)
  93.144  
  93.145 -constdefs
  93.146 -  mod_nat :: "nat => nat => nat => bool" 
  93.147 +definition mod_nat :: "nat => nat => nat => bool" where 
  93.148    "mod_nat ==
  93.149  %(u::nat) (ua::nat) ub::nat. EX (q1::nat) q2::nat. ua + u * q1 = ub + u * q2"
  93.150  
  93.151 @@ -898,8 +883,7 @@
  93.152      EX (q1::nat) q2::nat. ua + u * q1 = ub + u * q2)"
  93.153    by (import hollight DEF_mod_nat)
  93.154  
  93.155 -constdefs
  93.156 -  minimal :: "(nat => bool) => nat" 
  93.157 +definition minimal :: "(nat => bool) => nat" where 
  93.158    "minimal == %u::nat => bool. SOME n::nat. u n & (ALL m::nat. < m n --> ~ u m)"
  93.159  
  93.160  lemma DEF_minimal: "minimal =
  93.161 @@ -910,8 +894,7 @@
  93.162     Ex P = (P (minimal P) & (ALL x::nat. < x (minimal P) --> ~ P x))"
  93.163    by (import hollight MINIMAL)
  93.164  
  93.165 -constdefs
  93.166 -  WF :: "('A => 'A => bool) => bool" 
  93.167 +definition WF :: "('A => 'A => bool) => bool" where 
  93.168    "WF ==
  93.169  %u::'A::type => 'A::type => bool.
  93.170     ALL P::'A::type => bool.
  93.171 @@ -1605,8 +1588,7 @@
  93.172         ALL (xa::'A::type) y::'B::type. x (P xa y) = xa & Y (P xa y) = y)"
  93.173    by (import hollight INJ_INVERSE2)
  93.174  
  93.175 -constdefs
  93.176 -  NUMPAIR :: "nat => nat => nat" 
  93.177 +definition NUMPAIR :: "nat => nat => nat" where 
  93.178    "NUMPAIR ==
  93.179  %(u::nat) ua::nat.
  93.180     EXP (NUMERAL_BIT0 (NUMERAL_BIT1 0)) u *
  93.181 @@ -1626,8 +1608,7 @@
  93.182     (NUMPAIR x1 y1 = NUMPAIR x2 y2) = (x1 = x2 & y1 = y2)"
  93.183    by (import hollight NUMPAIR_INJ)
  93.184  
  93.185 -constdefs
  93.186 -  NUMFST :: "nat => nat" 
  93.187 +definition NUMFST :: "nat => nat" where 
  93.188    "NUMFST ==
  93.189  SOME X::nat => nat.
  93.190     EX Y::nat => nat.
  93.191 @@ -1639,8 +1620,7 @@
  93.192         ALL (x::nat) y::nat. X (NUMPAIR x y) = x & Y (NUMPAIR x y) = y)"
  93.193    by (import hollight DEF_NUMFST)
  93.194  
  93.195 -constdefs
  93.196 -  NUMSND :: "nat => nat" 
  93.197 +definition NUMSND :: "nat => nat" where 
  93.198    "NUMSND ==
  93.199  SOME Y::nat => nat.
  93.200     ALL (x::nat) y::nat. NUMFST (NUMPAIR x y) = x & Y (NUMPAIR x y) = y"
  93.201 @@ -1650,8 +1630,7 @@
  93.202      ALL (x::nat) y::nat. NUMFST (NUMPAIR x y) = x & Y (NUMPAIR x y) = y)"
  93.203    by (import hollight DEF_NUMSND)
  93.204  
  93.205 -constdefs
  93.206 -  NUMSUM :: "bool => nat => nat" 
  93.207 +definition NUMSUM :: "bool => nat => nat" where 
  93.208    "NUMSUM ==
  93.209  %(u::bool) ua::nat.
  93.210     COND u (Suc (NUMERAL_BIT0 (NUMERAL_BIT1 0) * ua))
  93.211 @@ -1667,8 +1646,7 @@
  93.212     (NUMSUM b1 x1 = NUMSUM b2 x2) = (b1 = b2 & x1 = x2)"
  93.213    by (import hollight NUMSUM_INJ)
  93.214  
  93.215 -constdefs
  93.216 -  NUMLEFT :: "nat => bool" 
  93.217 +definition NUMLEFT :: "nat => bool" where 
  93.218    "NUMLEFT ==
  93.219  SOME X::nat => bool.
  93.220     EX Y::nat => nat.
  93.221 @@ -1680,8 +1658,7 @@
  93.222         ALL (x::bool) y::nat. X (NUMSUM x y) = x & Y (NUMSUM x y) = y)"
  93.223    by (import hollight DEF_NUMLEFT)
  93.224  
  93.225 -constdefs
  93.226 -  NUMRIGHT :: "nat => nat" 
  93.227 +definition NUMRIGHT :: "nat => nat" where 
  93.228    "NUMRIGHT ==
  93.229  SOME Y::nat => nat.
  93.230     ALL (x::bool) y::nat. NUMLEFT (NUMSUM x y) = x & Y (NUMSUM x y) = y"
  93.231 @@ -1691,8 +1668,7 @@
  93.232      ALL (x::bool) y::nat. NUMLEFT (NUMSUM x y) = x & Y (NUMSUM x y) = y)"
  93.233    by (import hollight DEF_NUMRIGHT)
  93.234  
  93.235 -constdefs
  93.236 -  INJN :: "nat => nat => 'A => bool" 
  93.237 +definition INJN :: "nat => nat => 'A => bool" where 
  93.238    "INJN == %(u::nat) (n::nat) a::'A::type. n = u"
  93.239  
  93.240  lemma DEF_INJN: "INJN = (%(u::nat) (n::nat) a::'A::type. n = u)"
  93.241 @@ -1710,8 +1686,7 @@
  93.242             ((op =::nat => nat => bool) n1 n2)))"
  93.243    by (import hollight INJN_INJ)
  93.244  
  93.245 -constdefs
  93.246 -  INJA :: "'A => nat => 'A => bool" 
  93.247 +definition INJA :: "'A => nat => 'A => bool" where 
  93.248    "INJA == %(u::'A::type) (n::nat) b::'A::type. b = u"
  93.249  
  93.250  lemma DEF_INJA: "INJA = (%(u::'A::type) (n::nat) b::'A::type. b = u)"
  93.251 @@ -1720,8 +1695,7 @@
  93.252  lemma INJA_INJ: "ALL (a1::'A::type) a2::'A::type. (INJA a1 = INJA a2) = (a1 = a2)"
  93.253    by (import hollight INJA_INJ)
  93.254  
  93.255 -constdefs
  93.256 -  INJF :: "(nat => nat => 'A => bool) => nat => 'A => bool" 
  93.257 +definition INJF :: "(nat => nat => 'A => bool) => nat => 'A => bool" where 
  93.258    "INJF == %(u::nat => nat => 'A::type => bool) n::nat. u (NUMFST n) (NUMSND n)"
  93.259  
  93.260  lemma DEF_INJF: "INJF =
  93.261 @@ -1732,8 +1706,7 @@
  93.262     (INJF f1 = INJF f2) = (f1 = f2)"
  93.263    by (import hollight INJF_INJ)
  93.264  
  93.265 -constdefs
  93.266 -  INJP :: "(nat => 'A => bool) => (nat => 'A => bool) => nat => 'A => bool" 
  93.267 +definition INJP :: "(nat => 'A => bool) => (nat => 'A => bool) => nat => 'A => bool" where 
  93.268    "INJP ==
  93.269  %(u::nat => 'A::type => bool) (ua::nat => 'A::type => bool) (n::nat)
  93.270     a::'A::type. COND (NUMLEFT n) (u (NUMRIGHT n) a) (ua (NUMRIGHT n) a)"
  93.271 @@ -1748,8 +1721,7 @@
  93.272     (INJP f1 f2 = INJP f1' f2') = (f1 = f1' & f2 = f2')"
  93.273    by (import hollight INJP_INJ)
  93.274  
  93.275 -constdefs
  93.276 -  ZCONSTR :: "nat => 'A => (nat => nat => 'A => bool) => nat => 'A => bool" 
  93.277 +definition ZCONSTR :: "nat => 'A => (nat => nat => 'A => bool) => nat => 'A => bool" where 
  93.278    "ZCONSTR ==
  93.279  %(u::nat) (ua::'A::type) ub::nat => nat => 'A::type => bool.
  93.280     INJP (INJN (Suc u)) (INJP (INJA ua) (INJF ub))"
  93.281 @@ -1759,8 +1731,7 @@
  93.282      INJP (INJN (Suc u)) (INJP (INJA ua) (INJF ub)))"
  93.283    by (import hollight DEF_ZCONSTR)
  93.284  
  93.285 -constdefs
  93.286 -  ZBOT :: "nat => 'A => bool" 
  93.287 +definition ZBOT :: "nat => 'A => bool" where 
  93.288    "ZBOT == INJP (INJN 0) (SOME z::nat => 'A::type => bool. True)"
  93.289  
  93.290  lemma DEF_ZBOT: "ZBOT = INJP (INJN 0) (SOME z::nat => 'A::type => bool. True)"
  93.291 @@ -1770,8 +1741,7 @@
  93.292     ZCONSTR x xa xb ~= ZBOT"
  93.293    by (import hollight ZCONSTR_ZBOT)
  93.294  
  93.295 -constdefs
  93.296 -  ZRECSPACE :: "(nat => 'A => bool) => bool" 
  93.297 +definition ZRECSPACE :: "(nat => 'A => bool) => bool" where 
  93.298    "ZRECSPACE ==
  93.299  %a::nat => 'A::type => bool.
  93.300     ALL ZRECSPACE'::(nat => 'A::type => bool) => bool.
  93.301 @@ -1809,8 +1779,7 @@
  93.302    [where a="a :: 'A recspace" and r=r ,
  93.303     OF type_definition_recspace]
  93.304  
  93.305 -constdefs
  93.306 -  BOTTOM :: "'A recspace" 
  93.307 +definition BOTTOM :: "'A recspace" where 
  93.308    "(op ==::'A::type recspace => 'A::type recspace => prop)
  93.309   (BOTTOM::'A::type recspace)
  93.310   ((_mk_rec::(nat => 'A::type => bool) => 'A::type recspace)
  93.311 @@ -1822,8 +1791,7 @@
  93.312     (ZBOT::nat => 'A::type => bool))"
  93.313    by (import hollight DEF_BOTTOM)
  93.314  
  93.315 -constdefs
  93.316 -  CONSTR :: "nat => 'A => (nat => 'A recspace) => 'A recspace" 
  93.317 +definition CONSTR :: "nat => 'A => (nat => 'A recspace) => 'A recspace" where 
  93.318    "(op ==::(nat => 'A::type => (nat => 'A::type recspace) => 'A::type recspace)
  93.319          => (nat
  93.320              => 'A::type => (nat => 'A::type recspace) => 'A::type recspace)
  93.321 @@ -1900,8 +1868,7 @@
  93.322           f (CONSTR c i r) = Fn c i r (%n::nat. f (r n))"
  93.323    by (import hollight CONSTR_REC)
  93.324  
  93.325 -constdefs
  93.326 -  FCONS :: "'A => (nat => 'A) => nat => 'A" 
  93.327 +definition FCONS :: "'A => (nat => 'A) => nat => 'A" where 
  93.328    "FCONS ==
  93.329  SOME FCONS::'A::type => (nat => 'A::type) => nat => 'A::type.
  93.330     (ALL (a::'A::type) f::nat => 'A::type. FCONS a f 0 = a) &
  93.331 @@ -1917,8 +1884,7 @@
  93.332  lemma FCONS_UNDO: "ALL f::nat => 'A::type. f = FCONS (f 0) (f o Suc)"
  93.333    by (import hollight FCONS_UNDO)
  93.334  
  93.335 -constdefs
  93.336 -  FNIL :: "nat => 'A" 
  93.337 +definition FNIL :: "nat => 'A" where 
  93.338    "FNIL == %u::nat. SOME x::'A::type. True"
  93.339  
  93.340  lemma DEF_FNIL: "FNIL = (%u::nat. SOME x::'A::type. True)"
  93.341 @@ -1995,8 +1961,7 @@
  93.342    [where a="a :: 'A hollight.option" and r=r ,
  93.343     OF type_definition_option]
  93.344  
  93.345 -constdefs
  93.346 -  NONE :: "'A hollight.option" 
  93.347 +definition NONE :: "'A hollight.option" where 
  93.348    "(op ==::'A::type hollight.option => 'A::type hollight.option => prop)
  93.349   (NONE::'A::type hollight.option)
  93.350   ((_mk_option::'A::type recspace => 'A::type hollight.option)
  93.351 @@ -2093,8 +2058,7 @@
  93.352    [where a="a :: 'A hollight.list" and r=r ,
  93.353     OF type_definition_list]
  93.354  
  93.355 -constdefs
  93.356 -  NIL :: "'A hollight.list" 
  93.357 +definition NIL :: "'A hollight.list" where 
  93.358    "(op ==::'A::type hollight.list => 'A::type hollight.list => prop)
  93.359   (NIL::'A::type hollight.list)
  93.360   ((_mk_list::'A::type recspace => 'A::type hollight.list)
  93.361 @@ -2114,8 +2078,7 @@
  93.362       (%n::nat. BOTTOM::'A::type recspace)))"
  93.363    by (import hollight DEF_NIL)
  93.364  
  93.365 -constdefs
  93.366 -  CONS :: "'A => 'A hollight.list => 'A hollight.list" 
  93.367 +definition CONS :: "'A => 'A hollight.list => 'A hollight.list" where 
  93.368    "(op ==::('A::type => 'A::type hollight.list => 'A::type hollight.list)
  93.369          => ('A::type => 'A::type hollight.list => 'A::type hollight.list)
  93.370             => prop)
  93.371 @@ -2160,8 +2123,7 @@
  93.372     EX x::bool => 'A::type. x False = a & x True = b"
  93.373    by (import hollight bool_RECURSION)
  93.374  
  93.375 -constdefs
  93.376 -  ISO :: "('A => 'B) => ('B => 'A) => bool" 
  93.377 +definition ISO :: "('A => 'B) => ('B => 'A) => bool" where 
  93.378    "ISO ==
  93.379  %(u::'A::type => 'B::type) ua::'B::type => 'A::type.
  93.380     (ALL x::'B::type. u (ua x) = x) & (ALL y::'A::type. ua (u y) = y)"
  93.381 @@ -2244,15 +2206,13 @@
  93.382       (%n::nat. BOTTOM::bool recspace)))"
  93.383    by (import hollight DEF__10303)
  93.384  
  93.385 -constdefs
  93.386 -  two_1 :: "N_2" 
  93.387 +definition two_1 :: "N_2" where 
  93.388    "two_1 == _10302"
  93.389  
  93.390  lemma DEF_two_1: "two_1 = _10302"
  93.391    by (import hollight DEF_two_1)
  93.392  
  93.393 -constdefs
  93.394 -  two_2 :: "N_2" 
  93.395 +definition two_2 :: "N_2" where 
  93.396    "two_2 == _10303"
  93.397  
  93.398  lemma DEF_two_2: "two_2 = _10303"
  93.399 @@ -2337,22 +2297,19 @@
  93.400       (%n::nat. BOTTOM::bool recspace)))"
  93.401    by (import hollight DEF__10328)
  93.402  
  93.403 -constdefs
  93.404 -  three_1 :: "N_3" 
  93.405 +definition three_1 :: "N_3" where 
  93.406    "three_1 == _10326"
  93.407  
  93.408  lemma DEF_three_1: "three_1 = _10326"
  93.409    by (import hollight DEF_three_1)
  93.410  
  93.411 -constdefs
  93.412 -  three_2 :: "N_3" 
  93.413 +definition three_2 :: "N_3" where 
  93.414    "three_2 == _10327"
  93.415  
  93.416  lemma DEF_three_2: "three_2 = _10327"
  93.417    by (import hollight DEF_three_2)
  93.418  
  93.419 -constdefs
  93.420 -  three_3 :: "N_3" 
  93.421 +definition three_3 :: "N_3" where 
  93.422    "three_3 == _10328"
  93.423  
  93.424  lemma DEF_three_3: "three_3 = _10328"
  93.425 @@ -2365,8 +2322,7 @@
  93.426     All P"
  93.427    by (import hollight list_INDUCT)
  93.428  
  93.429 -constdefs
  93.430 -  HD :: "'A hollight.list => 'A" 
  93.431 +definition HD :: "'A hollight.list => 'A" where 
  93.432    "HD ==
  93.433  SOME HD::'A::type hollight.list => 'A::type.
  93.434     ALL (t::'A::type hollight.list) h::'A::type. HD (CONS h t) = h"
  93.435 @@ -2376,8 +2332,7 @@
  93.436      ALL (t::'A::type hollight.list) h::'A::type. HD (CONS h t) = h)"
  93.437    by (import hollight DEF_HD)
  93.438  
  93.439 -constdefs
  93.440 -  TL :: "'A hollight.list => 'A hollight.list" 
  93.441 +definition TL :: "'A hollight.list => 'A hollight.list" where 
  93.442    "TL ==
  93.443  SOME TL::'A::type hollight.list => 'A::type hollight.list.
  93.444     ALL (h::'A::type) t::'A::type hollight.list. TL (CONS h t) = t"
  93.445 @@ -2387,8 +2342,7 @@
  93.446      ALL (h::'A::type) t::'A::type hollight.list. TL (CONS h t) = t)"
  93.447    by (import hollight DEF_TL)
  93.448  
  93.449 -constdefs
  93.450 -  APPEND :: "'A hollight.list => 'A hollight.list => 'A hollight.list" 
  93.451 +definition APPEND :: "'A hollight.list => 'A hollight.list => 'A hollight.list" where 
  93.452    "APPEND ==
  93.453  SOME APPEND::'A::type hollight.list
  93.454               => 'A::type hollight.list => 'A::type hollight.list.
  93.455 @@ -2405,8 +2359,7 @@
  93.456          APPEND (CONS h t) l = CONS h (APPEND t l)))"
  93.457    by (import hollight DEF_APPEND)
  93.458  
  93.459 -constdefs
  93.460 -  REVERSE :: "'A hollight.list => 'A hollight.list" 
  93.461 +definition REVERSE :: "'A hollight.list => 'A hollight.list" where 
  93.462    "REVERSE ==
  93.463  SOME REVERSE::'A::type hollight.list => 'A::type hollight.list.
  93.464     REVERSE NIL = NIL &
  93.465 @@ -2420,8 +2373,7 @@
  93.466          REVERSE (CONS x l) = APPEND (REVERSE l) (CONS x NIL)))"
  93.467    by (import hollight DEF_REVERSE)
  93.468  
  93.469 -constdefs
  93.470 -  LENGTH :: "'A hollight.list => nat" 
  93.471 +definition LENGTH :: "'A hollight.list => nat" where 
  93.472    "LENGTH ==
  93.473  SOME LENGTH::'A::type hollight.list => nat.
  93.474     LENGTH NIL = 0 &
  93.475 @@ -2435,8 +2387,7 @@
  93.476          LENGTH (CONS h t) = Suc (LENGTH t)))"
  93.477    by (import hollight DEF_LENGTH)
  93.478  
  93.479 -constdefs
  93.480 -  MAP :: "('A => 'B) => 'A hollight.list => 'B hollight.list" 
  93.481 +definition MAP :: "('A => 'B) => 'A hollight.list => 'B hollight.list" where 
  93.482    "MAP ==
  93.483  SOME MAP::('A::type => 'B::type)
  93.484            => 'A::type hollight.list => 'B::type hollight.list.
  93.485 @@ -2452,8 +2403,7 @@
  93.486          MAP f (CONS h t) = CONS (f h) (MAP f t)))"
  93.487    by (import hollight DEF_MAP)
  93.488  
  93.489 -constdefs
  93.490 -  LAST :: "'A hollight.list => 'A" 
  93.491 +definition LAST :: "'A hollight.list => 'A" where 
  93.492    "LAST ==
  93.493  SOME LAST::'A::type hollight.list => 'A::type.
  93.494     ALL (h::'A::type) t::'A::type hollight.list.
  93.495 @@ -2465,8 +2415,7 @@
  93.496         LAST (CONS h t) = COND (t = NIL) h (LAST t))"
  93.497    by (import hollight DEF_LAST)
  93.498  
  93.499 -constdefs
  93.500 -  REPLICATE :: "nat => 'q_16860 => 'q_16860 hollight.list" 
  93.501 +definition REPLICATE :: "nat => 'q_16860 => 'q_16860 hollight.list" where 
  93.502    "REPLICATE ==
  93.503  SOME REPLICATE::nat => 'q_16860::type => 'q_16860::type hollight.list.
  93.504     (ALL x::'q_16860::type. REPLICATE 0 x = NIL) &
  93.505 @@ -2480,8 +2429,7 @@
  93.506          REPLICATE (Suc n) x = CONS x (REPLICATE n x)))"
  93.507    by (import hollight DEF_REPLICATE)
  93.508  
  93.509 -constdefs
  93.510 -  NULL :: "'q_16875 hollight.list => bool" 
  93.511 +definition NULL :: "'q_16875 hollight.list => bool" where 
  93.512    "NULL ==
  93.513  SOME NULL::'q_16875::type hollight.list => bool.
  93.514     NULL NIL = True &
  93.515 @@ -2495,8 +2443,7 @@
  93.516          NULL (CONS h t) = False))"
  93.517    by (import hollight DEF_NULL)
  93.518  
  93.519 -constdefs
  93.520 -  ALL_list :: "('q_16895 => bool) => 'q_16895 hollight.list => bool" 
  93.521 +definition ALL_list :: "('q_16895 => bool) => 'q_16895 hollight.list => bool" where 
  93.522    "ALL_list ==
  93.523  SOME u::('q_16895::type => bool) => 'q_16895::type hollight.list => bool.
  93.524     (ALL P::'q_16895::type => bool. u P NIL = True) &
  93.525 @@ -2527,9 +2474,8 @@
  93.526          t::'q_16916::type hollight.list. u P (CONS h t) = (P h | u P t)))"
  93.527    by (import hollight DEF_EX)
  93.528  
  93.529 -constdefs
  93.530 -  ITLIST :: "('q_16939 => 'q_16938 => 'q_16938)
  93.531 -=> 'q_16939 hollight.list => 'q_16938 => 'q_16938" 
  93.532 +definition ITLIST :: "('q_16939 => 'q_16938 => 'q_16938)
  93.533 +=> 'q_16939 hollight.list => 'q_16938 => 'q_16938" where 
  93.534    "ITLIST ==
  93.535  SOME ITLIST::('q_16939::type => 'q_16938::type => 'q_16938::type)
  93.536               => 'q_16939::type hollight.list
  93.537 @@ -2553,8 +2499,7 @@
  93.538          ITLIST f (CONS h t) b = f h (ITLIST f t b)))"
  93.539    by (import hollight DEF_ITLIST)
  93.540  
  93.541 -constdefs
  93.542 -  MEM :: "'q_16964 => 'q_16964 hollight.list => bool" 
  93.543 +definition MEM :: "'q_16964 => 'q_16964 hollight.list => bool" where 
  93.544    "MEM ==
  93.545  SOME MEM::'q_16964::type => 'q_16964::type hollight.list => bool.
  93.546     (ALL x::'q_16964::type. MEM x NIL = False) &
  93.547 @@ -2570,9 +2515,8 @@
  93.548          MEM x (CONS h t) = (x = h | MEM x t)))"
  93.549    by (import hollight DEF_MEM)
  93.550  
  93.551 -constdefs
  93.552 -  ALL2 :: "('q_16997 => 'q_17004 => bool)
  93.553 -=> 'q_16997 hollight.list => 'q_17004 hollight.list => bool" 
  93.554 +definition ALL2 :: "('q_16997 => 'q_17004 => bool)
  93.555 +=> 'q_16997 hollight.list => 'q_17004 hollight.list => bool" where 
  93.556    "ALL2 ==
  93.557  SOME ALL2::('q_16997::type => 'q_17004::type => bool)
  93.558             => 'q_16997::type hollight.list
  93.559 @@ -2604,10 +2548,9 @@
  93.560  ALL2 P (CONS h1 t1) (CONS h2 t2) = (P h1 h2 & ALL2 P t1 t2)"
  93.561    by (import hollight ALL2)
  93.562  
  93.563 -constdefs
  93.564 -  MAP2 :: "('q_17089 => 'q_17096 => 'q_17086)
  93.565 +definition MAP2 :: "('q_17089 => 'q_17096 => 'q_17086)
  93.566  => 'q_17089 hollight.list
  93.567 -   => 'q_17096 hollight.list => 'q_17086 hollight.list" 
  93.568 +   => 'q_17096 hollight.list => 'q_17086 hollight.list" where 
  93.569    "MAP2 ==
  93.570  SOME MAP2::('q_17089::type => 'q_17096::type => 'q_17086::type)
  93.571             => 'q_17089::type hollight.list
  93.572 @@ -2639,8 +2582,7 @@
  93.573  CONS (f h1 h2) (MAP2 f t1 t2)"
  93.574    by (import hollight MAP2)
  93.575  
  93.576 -constdefs
  93.577 -  EL :: "nat => 'q_17157 hollight.list => 'q_17157" 
  93.578 +definition EL :: "nat => 'q_17157 hollight.list => 'q_17157" where 
  93.579    "EL ==
  93.580  SOME EL::nat => 'q_17157::type hollight.list => 'q_17157::type.
  93.581     (ALL l::'q_17157::type hollight.list. EL 0 l = HD l) &
  93.582 @@ -2654,8 +2596,7 @@
  93.583          EL (Suc n) l = EL n (TL l)))"
  93.584    by (import hollight DEF_EL)
  93.585  
  93.586 -constdefs
  93.587 -  FILTER :: "('q_17182 => bool) => 'q_17182 hollight.list => 'q_17182 hollight.list" 
  93.588 +definition FILTER :: "('q_17182 => bool) => 'q_17182 hollight.list => 'q_17182 hollight.list" where 
  93.589    "FILTER ==
  93.590  SOME FILTER::('q_17182::type => bool)
  93.591               => 'q_17182::type hollight.list
  93.592 @@ -2676,8 +2617,7 @@
  93.593          COND (P h) (CONS h (FILTER P t)) (FILTER P t)))"
  93.594    by (import hollight DEF_FILTER)
  93.595  
  93.596 -constdefs
  93.597 -  ASSOC :: "'q_17211 => ('q_17211 * 'q_17205) hollight.list => 'q_17205" 
  93.598 +definition ASSOC :: "'q_17211 => ('q_17211 * 'q_17205) hollight.list => 'q_17205" where 
  93.599    "ASSOC ==
  93.600  SOME ASSOC::'q_17211::type
  93.601              => ('q_17211::type * 'q_17205::type) hollight.list
  93.602 @@ -2695,9 +2635,8 @@
  93.603         ASSOC a (CONS h t) = COND (fst h = a) (snd h) (ASSOC a t))"
  93.604    by (import hollight DEF_ASSOC)
  93.605  
  93.606 -constdefs
  93.607 -  ITLIST2 :: "('q_17235 => 'q_17243 => 'q_17233 => 'q_17233)
  93.608 -=> 'q_17235 hollight.list => 'q_17243 hollight.list => 'q_17233 => 'q_17233" 
  93.609 +definition ITLIST2 :: "('q_17235 => 'q_17243 => 'q_17233 => 'q_17233)
  93.610 +=> 'q_17235 hollight.list => 'q_17243 hollight.list => 'q_17233 => 'q_17233" where 
  93.611    "ITLIST2 ==
  93.612  SOME ITLIST2::('q_17235::type
  93.613                 => 'q_17243::type => 'q_17233::type => 'q_17233::type)
  93.614 @@ -3041,8 +2980,7 @@
  93.615  ALL2 Q l l'"
  93.616    by (import hollight MONO_ALL2)
  93.617  
  93.618 -constdefs
  93.619 -  dist :: "nat * nat => nat" 
  93.620 +definition dist :: "nat * nat => nat" where 
  93.621    "dist == %u::nat * nat. fst u - snd u + (snd u - fst u)"
  93.622  
  93.623  lemma DEF_dist: "dist = (%u::nat * nat. fst u - snd u + (snd u - fst u))"
  93.624 @@ -3133,8 +3071,7 @@
  93.625     (EX (x::nat) N::nat. ALL i::nat. <= N i --> <= (P i) (Q i + x))"
  93.626    by (import hollight BOUNDS_IGNORE)
  93.627  
  93.628 -constdefs
  93.629 -  is_nadd :: "(nat => nat) => bool" 
  93.630 +definition is_nadd :: "(nat => nat) => bool" where 
  93.631    "is_nadd ==
  93.632  %u::nat => nat.
  93.633     EX B::nat.
  93.634 @@ -3211,8 +3148,7 @@
  93.635            (A * n + B)"
  93.636    by (import hollight NADD_ALTMUL)
  93.637  
  93.638 -constdefs
  93.639 -  nadd_eq :: "nadd => nadd => bool" 
  93.640 +definition nadd_eq :: "nadd => nadd => bool" where 
  93.641    "nadd_eq ==
  93.642  %(u::nadd) ua::nadd.
  93.643     EX B::nat. ALL n::nat. <= (dist (dest_nadd u n, dest_nadd ua n)) B"
  93.644 @@ -3231,8 +3167,7 @@
  93.645  lemma NADD_EQ_TRANS: "ALL (x::nadd) (y::nadd) z::nadd. nadd_eq x y & nadd_eq y z --> nadd_eq x z"
  93.646    by (import hollight NADD_EQ_TRANS)
  93.647  
  93.648 -constdefs
  93.649 -  nadd_of_num :: "nat => nadd" 
  93.650 +definition nadd_of_num :: "nat => nadd" where 
  93.651    "nadd_of_num == %u::nat. mk_nadd (op * u)"
  93.652  
  93.653  lemma DEF_nadd_of_num: "nadd_of_num = (%u::nat. mk_nadd (op * u))"
  93.654 @@ -3247,8 +3182,7 @@
  93.655  lemma NADD_OF_NUM_EQ: "ALL (m::nat) n::nat. nadd_eq (nadd_of_num m) (nadd_of_num n) = (m = n)"
  93.656    by (import hollight NADD_OF_NUM_EQ)
  93.657  
  93.658 -constdefs
  93.659 -  nadd_le :: "nadd => nadd => bool" 
  93.660 +definition nadd_le :: "nadd => nadd => bool" where 
  93.661    "nadd_le ==
  93.662  %(u::nadd) ua::nadd.
  93.663     EX B::nat. ALL n::nat. <= (dest_nadd u n) (dest_nadd ua n + B)"
  93.664 @@ -3289,8 +3223,7 @@
  93.665  lemma NADD_OF_NUM_LE: "ALL (m::nat) n::nat. nadd_le (nadd_of_num m) (nadd_of_num n) = <= m n"
  93.666    by (import hollight NADD_OF_NUM_LE)
  93.667  
  93.668 -constdefs
  93.669 -  nadd_add :: "nadd => nadd => nadd" 
  93.670 +definition nadd_add :: "nadd => nadd => nadd" where 
  93.671    "nadd_add ==
  93.672  %(u::nadd) ua::nadd. mk_nadd (%n::nat. dest_nadd u n + dest_nadd ua n)"
  93.673  
  93.674 @@ -3332,8 +3265,7 @@
  93.675      (nadd_of_num (x + xa))"
  93.676    by (import hollight NADD_OF_NUM_ADD)
  93.677  
  93.678 -constdefs
  93.679 -  nadd_mul :: "nadd => nadd => nadd" 
  93.680 +definition nadd_mul :: "nadd => nadd => nadd" where 
  93.681    "nadd_mul ==
  93.682  %(u::nadd) ua::nadd. mk_nadd (%n::nat. dest_nadd u (dest_nadd ua n))"
  93.683  
  93.684 @@ -3438,8 +3370,7 @@
  93.685     (EX (A::nat) N::nat. ALL n::nat. <= N n --> <= n (A * dest_nadd x n))"
  93.686    by (import hollight NADD_LBOUND)
  93.687  
  93.688 -constdefs
  93.689 -  nadd_rinv :: "nadd => nat => nat" 
  93.690 +definition nadd_rinv :: "nadd => nat => nat" where 
  93.691    "nadd_rinv == %(u::nadd) n::nat. DIV (n * n) (dest_nadd u n)"
  93.692  
  93.693  lemma DEF_nadd_rinv: "nadd_rinv = (%(u::nadd) n::nat. DIV (n * n) (dest_nadd u n))"
  93.694 @@ -3528,8 +3459,7 @@
  93.695            <= (dist (m * nadd_rinv x n, n * nadd_rinv x m)) (B * (m + n)))"
  93.696    by (import hollight NADD_MUL_LINV_LEMMA8)
  93.697  
  93.698 -constdefs
  93.699 -  nadd_inv :: "nadd => nadd" 
  93.700 +definition nadd_inv :: "nadd => nadd" where 
  93.701    "nadd_inv ==
  93.702  %u::nadd.
  93.703     COND (nadd_eq u (nadd_of_num 0)) (nadd_of_num 0) (mk_nadd (nadd_rinv u))"
  93.704 @@ -3570,15 +3500,13 @@
  93.705    [where a="a :: hreal" and r=r ,
  93.706     OF type_definition_hreal]
  93.707  
  93.708 -constdefs
  93.709 -  hreal_of_num :: "nat => hreal" 
  93.710 +definition hreal_of_num :: "nat => hreal" where 
  93.711    "hreal_of_num == %m::nat. mk_hreal (nadd_eq (nadd_of_num m))"
  93.712  
  93.713  lemma DEF_hreal_of_num: "hreal_of_num = (%m::nat. mk_hreal (nadd_eq (nadd_of_num m)))"
  93.714    by (import hollight DEF_hreal_of_num)
  93.715  
  93.716 -constdefs
  93.717 -  hreal_add :: "hreal => hreal => hreal" 
  93.718 +definition hreal_add :: "hreal => hreal => hreal" where 
  93.719    "hreal_add ==
  93.720  %(x::hreal) y::hreal.
  93.721     mk_hreal
  93.722 @@ -3594,8 +3522,7 @@
  93.723              nadd_eq (nadd_add xa ya) u & dest_hreal x xa & dest_hreal y ya))"
  93.724    by (import hollight DEF_hreal_add)
  93.725  
  93.726 -constdefs
  93.727 -  hreal_mul :: "hreal => hreal => hreal" 
  93.728 +definition hreal_mul :: "hreal => hreal => hreal" where 
  93.729    "hreal_mul ==
  93.730  %(x::hreal) y::hreal.
  93.731     mk_hreal
  93.732 @@ -3611,8 +3538,7 @@
  93.733              nadd_eq (nadd_mul xa ya) u & dest_hreal x xa & dest_hreal y ya))"
  93.734    by (import hollight DEF_hreal_mul)
  93.735  
  93.736 -constdefs
  93.737 -  hreal_le :: "hreal => hreal => bool" 
  93.738 +definition hreal_le :: "hreal => hreal => bool" where 
  93.739    "hreal_le ==
  93.740  %(x::hreal) y::hreal.
  93.741     SOME u::bool.
  93.742 @@ -3626,8 +3552,7 @@
  93.743            nadd_le xa ya = u & dest_hreal x xa & dest_hreal y ya)"
  93.744    by (import hollight DEF_hreal_le)
  93.745  
  93.746 -constdefs
  93.747 -  hreal_inv :: "hreal => hreal" 
  93.748 +definition hreal_inv :: "hreal => hreal" where 
  93.749    "hreal_inv ==
  93.750  %x::hreal.
  93.751     mk_hreal
  93.752 @@ -3685,22 +3610,19 @@
  93.753     hreal_le a b --> hreal_le (hreal_mul a c) (hreal_mul b c)"
  93.754    by (import hollight HREAL_LE_MUL_RCANCEL_IMP)
  93.755  
  93.756 -constdefs
  93.757 -  treal_of_num :: "nat => hreal * hreal" 
  93.758 +definition treal_of_num :: "nat => hreal * hreal" where 
  93.759    "treal_of_num == %u::nat. (hreal_of_num u, hreal_of_num 0)"
  93.760  
  93.761  lemma DEF_treal_of_num: "treal_of_num = (%u::nat. (hreal_of_num u, hreal_of_num 0))"
  93.762    by (import hollight DEF_treal_of_num)
  93.763  
  93.764 -constdefs
  93.765 -  treal_neg :: "hreal * hreal => hreal * hreal" 
  93.766 +definition treal_neg :: "hreal * hreal => hreal * hreal" where 
  93.767    "treal_neg == %u::hreal * hreal. (snd u, fst u)"
  93.768  
  93.769  lemma DEF_treal_neg: "treal_neg = (%u::hreal * hreal. (snd u, fst u))"
  93.770    by (import hollight DEF_treal_neg)
  93.771  
  93.772 -constdefs
  93.773 -  treal_add :: "hreal * hreal => hreal * hreal => hreal * hreal" 
  93.774 +definition treal_add :: "hreal * hreal => hreal * hreal => hreal * hreal" where 
  93.775    "treal_add ==
  93.776  %(u::hreal * hreal) ua::hreal * hreal.
  93.777     (hreal_add (fst u) (fst ua), hreal_add (snd u) (snd ua))"
  93.778 @@ -3710,8 +3632,7 @@
  93.779      (hreal_add (fst u) (fst ua), hreal_add (snd u) (snd ua)))"
  93.780    by (import hollight DEF_treal_add)
  93.781  
  93.782 -constdefs
  93.783 -  treal_mul :: "hreal * hreal => hreal * hreal => hreal * hreal" 
  93.784 +definition treal_mul :: "hreal * hreal => hreal * hreal => hreal * hreal" where 
  93.785    "treal_mul ==
  93.786  %(u::hreal * hreal) ua::hreal * hreal.
  93.787     (hreal_add (hreal_mul (fst u) (fst ua)) (hreal_mul (snd u) (snd ua)),
  93.788 @@ -3723,8 +3644,7 @@
  93.789       hreal_add (hreal_mul (fst u) (snd ua)) (hreal_mul (snd u) (fst ua))))"
  93.790    by (import hollight DEF_treal_mul)
  93.791  
  93.792 -constdefs
  93.793 -  treal_le :: "hreal * hreal => hreal * hreal => bool" 
  93.794 +definition treal_le :: "hreal * hreal => hreal * hreal => bool" where 
  93.795    "treal_le ==
  93.796  %(u::hreal * hreal) ua::hreal * hreal.
  93.797     hreal_le (hreal_add (fst u) (snd ua)) (hreal_add (fst ua) (snd u))"
  93.798 @@ -3734,8 +3654,7 @@
  93.799      hreal_le (hreal_add (fst u) (snd ua)) (hreal_add (fst ua) (snd u)))"
  93.800    by (import hollight DEF_treal_le)
  93.801  
  93.802 -constdefs
  93.803 -  treal_inv :: "hreal * hreal => hreal * hreal" 
  93.804 +definition treal_inv :: "hreal * hreal => hreal * hreal" where 
  93.805    "treal_inv ==
  93.806  %u::hreal * hreal.
  93.807     COND (fst u = snd u) (hreal_of_num 0, hreal_of_num 0)
  93.808 @@ -3755,8 +3674,7 @@
  93.809          hreal_inv (SOME d::hreal. snd u = hreal_add (fst u) d))))"
  93.810    by (import hollight DEF_treal_inv)
  93.811  
  93.812 -constdefs
  93.813 -  treal_eq :: "hreal * hreal => hreal * hreal => bool" 
  93.814 +definition treal_eq :: "hreal * hreal => hreal * hreal => bool" where 
  93.815    "treal_eq ==
  93.816  %(u::hreal * hreal) ua::hreal * hreal.
  93.817     hreal_add (fst u) (snd ua) = hreal_add (fst ua) (snd u)"
  93.818 @@ -3916,15 +3834,13 @@
  93.819    [where a="a :: hollight.real" and r=r ,
  93.820     OF type_definition_real]
  93.821  
  93.822 -constdefs
  93.823 -  real_of_num :: "nat => hollight.real" 
  93.824 +definition real_of_num :: "nat => hollight.real" where 
  93.825    "real_of_num == %m::nat. mk_real (treal_eq (treal_of_num m))"
  93.826  
  93.827  lemma DEF_real_of_num: "real_of_num = (%m::nat. mk_real (treal_eq (treal_of_num m)))"
  93.828    by (import hollight DEF_real_of_num)
  93.829  
  93.830 -constdefs
  93.831 -  real_neg :: "hollight.real => hollight.real" 
  93.832 +definition real_neg :: "hollight.real => hollight.real" where 
  93.833    "real_neg ==
  93.834  %x1::hollight.real.
  93.835     mk_real
  93.836 @@ -3940,8 +3856,7 @@
  93.837              treal_eq (treal_neg x1a) u & dest_real x1 x1a))"
  93.838    by (import hollight DEF_real_neg)
  93.839  
  93.840 -constdefs
  93.841 -  real_add :: "hollight.real => hollight.real => hollight.real" 
  93.842 +definition real_add :: "hollight.real => hollight.real => hollight.real" where 
  93.843    "real_add ==
  93.844  %(x1::hollight.real) y1::hollight.real.
  93.845     mk_real
  93.846 @@ -3959,8 +3874,7 @@
  93.847              dest_real x1 x1a & dest_real y1 y1a))"
  93.848    by (import hollight DEF_real_add)
  93.849  
  93.850 -constdefs
  93.851 -  real_mul :: "hollight.real => hollight.real => hollight.real" 
  93.852 +definition real_mul :: "hollight.real => hollight.real => hollight.real" where 
  93.853    "real_mul ==
  93.854  %(x1::hollight.real) y1::hollight.real.
  93.855     mk_real
  93.856 @@ -3978,8 +3892,7 @@
  93.857              dest_real x1 x1a & dest_real y1 y1a))"
  93.858    by (import hollight DEF_real_mul)
  93.859  
  93.860 -constdefs
  93.861 -  real_le :: "hollight.real => hollight.real => bool" 
  93.862 +definition real_le :: "hollight.real => hollight.real => bool" where 
  93.863    "real_le ==
  93.864  %(x1::hollight.real) y1::hollight.real.
  93.865     SOME u::bool.
  93.866 @@ -3993,8 +3906,7 @@
  93.867            treal_le x1a y1a = u & dest_real x1 x1a & dest_real y1 y1a)"
  93.868    by (import hollight DEF_real_le)
  93.869  
  93.870 -constdefs
  93.871 -  real_inv :: "hollight.real => hollight.real" 
  93.872 +definition real_inv :: "hollight.real => hollight.real" where 
  93.873    "real_inv ==
  93.874  %x::hollight.real.
  93.875     mk_real
  93.876 @@ -4008,15 +3920,13 @@
  93.877           EX xa::hreal * hreal. treal_eq (treal_inv xa) u & dest_real x xa))"
  93.878    by (import hollight DEF_real_inv)
  93.879  
  93.880 -constdefs
  93.881 -  real_sub :: "hollight.real => hollight.real => hollight.real" 
  93.882 +definition real_sub :: "hollight.real => hollight.real => hollight.real" where 
  93.883    "real_sub == %(u::hollight.real) ua::hollight.real. real_add u (real_neg ua)"
  93.884  
  93.885  lemma DEF_real_sub: "real_sub = (%(u::hollight.real) ua::hollight.real. real_add u (real_neg ua))"
  93.886    by (import hollight DEF_real_sub)
  93.887  
  93.888 -constdefs
  93.889 -  real_lt :: "hollight.real => hollight.real => bool" 
  93.890 +definition real_lt :: "hollight.real => hollight.real => bool" where 
  93.891    "real_lt == %(u::hollight.real) ua::hollight.real. ~ real_le ua u"
  93.892  
  93.893  lemma DEF_real_lt: "real_lt = (%(u::hollight.real) ua::hollight.real. ~ real_le ua u)"
  93.894 @@ -4040,8 +3950,7 @@
  93.895  lemma DEF_real_gt: "hollight.real_gt = (%(u::hollight.real) ua::hollight.real. real_lt ua u)"
  93.896    by (import hollight DEF_real_gt)
  93.897  
  93.898 -constdefs
  93.899 -  real_abs :: "hollight.real => hollight.real" 
  93.900 +definition real_abs :: "hollight.real => hollight.real" where 
  93.901    "real_abs ==
  93.902  %u::hollight.real. COND (real_le (real_of_num 0) u) u (real_neg u)"
  93.903  
  93.904 @@ -4049,8 +3958,7 @@
  93.905  (%u::hollight.real. COND (real_le (real_of_num 0) u) u (real_neg u))"
  93.906    by (import hollight DEF_real_abs)
  93.907  
  93.908 -constdefs
  93.909 -  real_pow :: "hollight.real => nat => hollight.real" 
  93.910 +definition real_pow :: "hollight.real => nat => hollight.real" where 
  93.911    "real_pow ==
  93.912  SOME real_pow::hollight.real => nat => hollight.real.
  93.913     (ALL x::hollight.real. real_pow x 0 = real_of_num (NUMERAL_BIT1 0)) &
  93.914 @@ -4064,22 +3972,19 @@
  93.915          real_pow x (Suc n) = real_mul x (real_pow x n)))"
  93.916    by (import hollight DEF_real_pow)
  93.917  
  93.918 -constdefs
  93.919 -  real_div :: "hollight.real => hollight.real => hollight.real" 
  93.920 +definition real_div :: "hollight.real => hollight.real => hollight.real" where 
  93.921    "real_div == %(u::hollight.real) ua::hollight.real. real_mul u (real_inv ua)"
  93.922  
  93.923  lemma DEF_real_div: "real_div = (%(u::hollight.real) ua::hollight.real. real_mul u (real_inv ua))"
  93.924    by (import hollight DEF_real_div)
  93.925  
  93.926 -constdefs
  93.927 -  real_max :: "hollight.real => hollight.real => hollight.real" 
  93.928 +definition real_max :: "hollight.real => hollight.real => hollight.real" where 
  93.929    "real_max == %(u::hollight.real) ua::hollight.real. COND (real_le u ua) ua u"
  93.930  
  93.931  lemma DEF_real_max: "real_max = (%(u::hollight.real) ua::hollight.real. COND (real_le u ua) ua u)"
  93.932    by (import hollight DEF_real_max)
  93.933  
  93.934 -constdefs
  93.935 -  real_min :: "hollight.real => hollight.real => hollight.real" 
  93.936 +definition real_min :: "hollight.real => hollight.real => hollight.real" where 
  93.937    "real_min == %(u::hollight.real) ua::hollight.real. COND (real_le u ua) u ua"
  93.938  
  93.939  lemma DEF_real_min: "real_min = (%(u::hollight.real) ua::hollight.real. COND (real_le u ua) u ua)"
  93.940 @@ -5212,8 +5117,7 @@
  93.941  (ALL x::hollight.real. All (P x))"
  93.942    by (import hollight REAL_WLOG_LT)
  93.943  
  93.944 -constdefs
  93.945 -  mod_real :: "hollight.real => hollight.real => hollight.real => bool" 
  93.946 +definition mod_real :: "hollight.real => hollight.real => hollight.real => bool" where 
  93.947    "mod_real ==
  93.948  %(u::hollight.real) (ua::hollight.real) ub::hollight.real.
  93.949     EX q::hollight.real. real_sub ua ub = real_mul q u"