isabelle update_cartouches -c -t;
authorwenzelm
Thu May 26 17:51:22 2016 +0200 (2016-05-26)
changeset 631670909deb8059b
parent 63166 143f58bb34f9
child 63168 466177e5736c
isabelle update_cartouches -c -t;
src/HOL/Algebra/AbelCoset.thy
src/HOL/Algebra/Bij.thy
src/HOL/Algebra/Congruence.thy
src/HOL/Algebra/Coset.thy
src/HOL/Algebra/Divisibility.thy
src/HOL/Algebra/FiniteProduct.thy
src/HOL/Algebra/Group.thy
src/HOL/Algebra/Ideal.thy
src/HOL/Algebra/IntRing.thy
src/HOL/Algebra/Lattice.thy
src/HOL/Algebra/QuotRing.thy
src/HOL/Algebra/Ring.thy
src/HOL/Algebra/RingHom.thy
src/HOL/Algebra/Sylow.thy
src/HOL/Algebra/UnivPoly.thy
src/HOL/Cardinals/Bounded_Set.thy
src/HOL/Cardinals/Cardinal_Arithmetic.thy
src/HOL/Cardinals/Cardinal_Order_Relation.thy
src/HOL/Cardinals/Cardinals.thy
src/HOL/Cardinals/Fun_More.thy
src/HOL/Cardinals/Order_Relation_More.thy
src/HOL/Cardinals/Order_Union.thy
src/HOL/Cardinals/Ordinal_Arithmetic.thy
src/HOL/Cardinals/Wellfounded_More.thy
src/HOL/Cardinals/Wellorder_Constructions.thy
src/HOL/Cardinals/Wellorder_Embedding.thy
src/HOL/Cardinals/Wellorder_Extension.thy
src/HOL/Cardinals/Wellorder_Relation.thy
src/HOL/Codegenerator_Test/Candidates.thy
src/HOL/Codegenerator_Test/Code_Test_GHC.thy
src/HOL/Codegenerator_Test/Code_Test_OCaml.thy
src/HOL/Codegenerator_Test/Code_Test_Scala.thy
src/HOL/Codegenerator_Test/Generate.thy
src/HOL/Codegenerator_Test/Generate_Binary_Nat.thy
src/HOL/Codegenerator_Test/Generate_Efficient_Datastructures.thy
src/HOL/Codegenerator_Test/Generate_Pretty_Char.thy
src/HOL/Codegenerator_Test/Generate_Target_Nat.thy
src/HOL/Corec_Examples/LFilter.thy
src/HOL/Datatype_Examples/Compat.thy
src/HOL/Datatype_Examples/Derivation_Trees/DTree.thy
src/HOL/Datatype_Examples/Derivation_Trees/Gram_Lang.thy
src/HOL/Datatype_Examples/Derivation_Trees/Parallel.thy
src/HOL/Datatype_Examples/Derivation_Trees/Prelim.thy
src/HOL/Datatype_Examples/Koenig.thy
src/HOL/Datatype_Examples/Lambda_Term.thy
src/HOL/Datatype_Examples/Lift_BNF.thy
src/HOL/Datatype_Examples/Misc_Codatatype.thy
src/HOL/Datatype_Examples/Misc_Datatype.thy
src/HOL/Datatype_Examples/Misc_Primcorec.thy
src/HOL/Datatype_Examples/Misc_Primrec.thy
src/HOL/Datatype_Examples/Process.thy
src/HOL/Datatype_Examples/Stream_Processor.thy
src/HOL/Datatype_Examples/TreeFI.thy
src/HOL/Datatype_Examples/TreeFsetI.thy
src/HOL/IMPP/Com.thy
src/HOL/IMPP/EvenOdd.thy
src/HOL/IMPP/Hoare.thy
src/HOL/IMPP/Misc.thy
src/HOL/IMPP/Natural.thy
src/HOL/IOA/Asig.thy
src/HOL/IOA/IOA.thy
src/HOL/IOA/Solve.thy
src/HOL/Imperative_HOL/Array.thy
src/HOL/Imperative_HOL/Heap.thy
src/HOL/Imperative_HOL/Heap_Monad.thy
src/HOL/Imperative_HOL/Imperative_HOL.thy
src/HOL/Imperative_HOL/Imperative_HOL_ex.thy
src/HOL/Imperative_HOL/Overview.thy
src/HOL/Imperative_HOL/Ref.thy
src/HOL/Imperative_HOL/ex/Imperative_Quicksort.thy
src/HOL/Imperative_HOL/ex/Imperative_Reverse.thy
src/HOL/Imperative_HOL/ex/Linked_Lists.thy
src/HOL/Imperative_HOL/ex/List_Sublist.thy
src/HOL/Imperative_HOL/ex/SatChecker.thy
src/HOL/Imperative_HOL/ex/Sorted_List.thy
src/HOL/Imperative_HOL/ex/Subarray.thy
src/HOL/Import/HOL_Light_Import.thy
src/HOL/Import/HOL_Light_Maps.thy
src/HOL/Import/Import_Setup.thy
src/HOL/Induct/ABexp.thy
src/HOL/Induct/Com.thy
src/HOL/Induct/Common_Patterns.thy
src/HOL/Induct/PropLog.thy
src/HOL/Induct/QuoDataType.thy
src/HOL/Induct/QuoNestedDataType.thy
src/HOL/Induct/Sigma_Algebra.thy
src/HOL/Matrix_LP/ComputeFloat.thy
src/HOL/Matrix_LP/ComputeHOL.thy
src/HOL/Matrix_LP/Matrix.thy
src/HOL/Metis_Examples/Abstraction.thy
src/HOL/Metis_Examples/Big_O.thy
src/HOL/Metis_Examples/Binary_Tree.thy
src/HOL/Metis_Examples/Clausification.thy
src/HOL/Metis_Examples/Message.thy
src/HOL/Metis_Examples/Proxies.thy
src/HOL/Metis_Examples/Sets.thy
src/HOL/Metis_Examples/Tarski.thy
src/HOL/Metis_Examples/Trans_Closure.thy
src/HOL/Metis_Examples/Type_Encodings.thy
src/HOL/Mirabelle/Mirabelle.thy
src/HOL/Mirabelle/Mirabelle_Test.thy
src/HOL/Mirabelle/ex/Ex.thy
src/HOL/Mutabelle/MutabelleExtra.thy
src/HOL/NanoJava/AxSem.thy
src/HOL/NanoJava/Decl.thy
src/HOL/NanoJava/Equivalence.thy
src/HOL/NanoJava/Example.thy
src/HOL/NanoJava/State.thy
src/HOL/NanoJava/Term.thy
src/HOL/NanoJava/TypeRel.thy
src/HOL/Nitpick_Examples/Core_Nits.thy
src/HOL/Nitpick_Examples/Datatype_Nits.thy
src/HOL/Nitpick_Examples/Hotel_Nits.thy
src/HOL/Nitpick_Examples/Induct_Nits.thy
src/HOL/Nitpick_Examples/Integer_Nits.thy
src/HOL/Nitpick_Examples/Manual_Nits.thy
src/HOL/Nitpick_Examples/Mini_Nits.thy
src/HOL/Nitpick_Examples/Mono_Nits.thy
src/HOL/Nitpick_Examples/Pattern_Nits.thy
src/HOL/Nitpick_Examples/Record_Nits.thy
src/HOL/Nitpick_Examples/Refute_Nits.thy
src/HOL/Nitpick_Examples/Special_Nits.thy
src/HOL/Nitpick_Examples/Tests_Nits.thy
src/HOL/Nitpick_Examples/Typedef_Nits.thy
src/HOL/Nominal/Examples/CK_Machine.thy
src/HOL/Nominal/Examples/CR.thy
src/HOL/Nominal/Examples/CR_Takahashi.thy
src/HOL/Nominal/Examples/Class1.thy
src/HOL/Nominal/Examples/Class2.thy
src/HOL/Nominal/Examples/Class3.thy
src/HOL/Nominal/Examples/Compile.thy
src/HOL/Nominal/Examples/Contexts.thy
src/HOL/Nominal/Examples/Crary.thy
src/HOL/Nominal/Examples/Fsub.thy
src/HOL/Nominal/Examples/Height.thy
src/HOL/Nominal/Examples/Lam_Funs.thy
src/HOL/Nominal/Examples/Lambda_mu.thy
src/HOL/Nominal/Examples/LocalWeakening.thy
src/HOL/Nominal/Examples/Pattern.thy
src/HOL/Nominal/Examples/SN.thy
src/HOL/Nominal/Examples/SOS.thy
src/HOL/Nominal/Examples/Standardization.thy
src/HOL/Nominal/Examples/Support.thy
src/HOL/Nominal/Examples/Type_Preservation.thy
src/HOL/Nominal/Examples/VC_Condition.thy
src/HOL/Nominal/Examples/W.thy
src/HOL/Nominal/Examples/Weakening.thy
src/HOL/Nominal/Nominal.thy
src/HOL/Number_Theory/Cong.thy
src/HOL/Number_Theory/Euclidean_Algorithm.thy
src/HOL/Number_Theory/Fib.thy
src/HOL/Number_Theory/Residues.thy
src/HOL/Old_Number_Theory/Chinese.thy
src/HOL/Old_Number_Theory/EulerFermat.thy
src/HOL/Old_Number_Theory/Fib.thy
src/HOL/Old_Number_Theory/IntFact.thy
src/HOL/Old_Number_Theory/IntPrimes.thy
src/HOL/Old_Number_Theory/Legacy_GCD.thy
src/HOL/Old_Number_Theory/WilsonBij.thy
src/HOL/Predicate_Compile_Examples/Code_Prolog_Examples.thy
src/HOL/Predicate_Compile_Examples/Context_Free_Grammar_Example.thy
src/HOL/Predicate_Compile_Examples/Examples.thy
src/HOL/Predicate_Compile_Examples/Hotel_Example.thy
src/HOL/Predicate_Compile_Examples/Hotel_Example_Prolog.thy
src/HOL/Predicate_Compile_Examples/Hotel_Example_Small_Generator.thy
src/HOL/Predicate_Compile_Examples/IMP_1.thy
src/HOL/Predicate_Compile_Examples/IMP_2.thy
src/HOL/Predicate_Compile_Examples/IMP_3.thy
src/HOL/Predicate_Compile_Examples/IMP_4.thy
src/HOL/Predicate_Compile_Examples/Lambda_Example.thy
src/HOL/Predicate_Compile_Examples/List_Examples.thy
src/HOL/Predicate_Compile_Examples/Predicate_Compile_Quickcheck_Examples.thy
src/HOL/Predicate_Compile_Examples/Predicate_Compile_Tests.thy
src/HOL/Predicate_Compile_Examples/Reg_Exp_Example.thy
src/HOL/Predicate_Compile_Examples/Specialisation_Examples.thy
src/HOL/Probability/Borel_Space.thy
src/HOL/Probability/Characteristic_Functions.thy
src/HOL/Probability/Distribution_Functions.thy
src/HOL/Probability/Levy.thy
src/HOL/Probability/Nonnegative_Lebesgue_Integration.thy
src/HOL/Probability/Sigma_Algebra.thy
src/HOL/Probability/Sinc_Integral.thy
src/HOL/Prolog/Func.thy
src/HOL/Prolog/HOHH.thy
src/HOL/Prolog/Test.thy
src/HOL/Prolog/Type.thy
src/HOL/Quickcheck_Examples/Completeness.thy
src/HOL/Quickcheck_Examples/Hotel_Example.thy
src/HOL/Quickcheck_Examples/Quickcheck_Examples.thy
src/HOL/Quickcheck_Examples/Quickcheck_Interfaces.thy
src/HOL/Quickcheck_Examples/Quickcheck_Lattice_Examples.thy
src/HOL/Quickcheck_Examples/Quickcheck_Narrowing_Examples.thy
src/HOL/Quotient_Examples/DList.thy
src/HOL/Quotient_Examples/FSet.thy
src/HOL/Quotient_Examples/Int_Pow.thy
src/HOL/Quotient_Examples/Lift_DList.thy
src/HOL/Quotient_Examples/Lift_FSet.thy
src/HOL/Quotient_Examples/Lift_Fun.thy
src/HOL/Quotient_Examples/Lift_Set.thy
src/HOL/Quotient_Examples/Quotient_Int.thy
src/HOL/Quotient_Examples/Quotient_Message.thy
src/HOL/SET_Protocol/Cardholder_Registration.thy
src/HOL/SET_Protocol/Event_SET.thy
src/HOL/SET_Protocol/Merchant_Registration.thy
src/HOL/SET_Protocol/Message_SET.thy
src/HOL/SET_Protocol/Public_SET.thy
src/HOL/SET_Protocol/Purchase.thy
src/HOL/SMT_Examples/Boogie.thy
src/HOL/SMT_Examples/SMT_Examples.thy
src/HOL/SMT_Examples/SMT_Tests.thy
src/HOL/SMT_Examples/SMT_Word_Examples.thy
src/HOL/SPARK/Examples/Gcd/Greatest_Common_Divisor.thy
src/HOL/SPARK/Examples/Liseq/Longest_Increasing_Subsequence.thy
src/HOL/SPARK/Examples/RIPEMD-160/Hash.thy
src/HOL/SPARK/Examples/RIPEMD-160/R_L.thy
src/HOL/SPARK/Examples/RIPEMD-160/R_R.thy
src/HOL/SPARK/Examples/RIPEMD-160/Round.thy
src/HOL/SPARK/Examples/RIPEMD-160/S_L.thy
src/HOL/SPARK/Examples/RIPEMD-160/S_R.thy
src/HOL/SPARK/Examples/Sqrt/Sqrt.thy
src/HOL/SPARK/Manual/Complex_Types.thy
src/HOL/SPARK/Manual/Example_Verification.thy
src/HOL/SPARK/Manual/Reference.thy
src/HOL/SPARK/Manual/Simple_Greatest_Common_Divisor.thy
src/HOL/SPARK/Manual/VC_Principles.thy
src/HOL/SPARK/SPARK.thy
src/HOL/SPARK/SPARK_Setup.thy
src/HOL/Statespace/DistinctTreeProver.thy
src/HOL/Statespace/StateFun.thy
src/HOL/Statespace/StateSpaceEx.thy
src/HOL/Statespace/StateSpaceLocale.thy
src/HOL/Statespace/StateSpaceSyntax.thy
src/HOL/TPTP/ATP_Problem_Import.thy
src/HOL/TPTP/ATP_Theory_Export.thy
src/HOL/TPTP/MaSh_Eval.thy
src/HOL/TPTP/MaSh_Export.thy
src/HOL/TPTP/MaSh_Export_Base.thy
src/HOL/TPTP/TPTP_Interpret_Test.thy
src/HOL/TPTP/TPTP_Parser.thy
src/HOL/TPTP/TPTP_Parser_Example.thy
src/HOL/TPTP/TPTP_Parser_Test.thy
src/HOL/TPTP/TPTP_Proof_Reconstruction.thy
src/HOL/TPTP/TPTP_Proof_Reconstruction_Test.thy
src/HOL/TPTP/TPTP_Proof_Reconstruction_Test_Units.thy
src/HOL/TPTP/TPTP_Test.thy
src/HOL/ZF/HOLZF.thy
     1.1 --- a/src/HOL/Algebra/AbelCoset.thy	Thu May 26 16:57:14 2016 +0200
     1.2 +++ b/src/HOL/Algebra/AbelCoset.thy	Thu May 26 17:51:22 2016 +0200
     1.3 @@ -10,7 +10,7 @@
     1.4  
     1.5  subsubsection \<open>Definitions\<close>
     1.6  
     1.7 -text \<open>Hiding @{text "<+>"} from @{theory Sum_Type} until I come
     1.8 +text \<open>Hiding \<open><+>\<close> from @{theory Sum_Type} until I come
     1.9    up with better syntax here\<close>
    1.10  
    1.11  no_notation Sum_Type.Plus (infixr "<+>" 65)
    1.12 @@ -41,12 +41,12 @@
    1.13  
    1.14  definition
    1.15    A_FactGroup :: "[('a,'b) ring_scheme, 'a set] \<Rightarrow> ('a set) monoid" (infixl "A'_Mod" 65)
    1.16 -    --\<open>Actually defined for groups rather than monoids\<close>
    1.17 +    \<comment>\<open>Actually defined for groups rather than monoids\<close>
    1.18    where "A_FactGroup G H = FactGroup \<lparr>carrier = carrier G, mult = add G, one = zero G\<rparr> H"
    1.19  
    1.20  definition
    1.21    a_kernel :: "('a, 'm) ring_scheme \<Rightarrow> ('b, 'n) ring_scheme \<Rightarrow>  ('a \<Rightarrow> 'b) \<Rightarrow> 'a set"
    1.22 -    --\<open>the kernel of a homomorphism (additive)\<close>
    1.23 +    \<comment>\<open>the kernel of a homomorphism (additive)\<close>
    1.24    where "a_kernel G H h =
    1.25      kernel \<lparr>carrier = carrier G, mult = add G, one = zero G\<rparr>
    1.26        \<lparr>carrier = carrier H, mult = add H, one = zero H\<rparr> h"
    1.27 @@ -218,7 +218,7 @@
    1.28  
    1.29  subsubsection \<open>Additive subgroups are normal\<close>
    1.30  
    1.31 -text \<open>Every subgroup of an @{text "abelian_group"} is normal\<close>
    1.32 +text \<open>Every subgroup of an \<open>abelian_group\<close> is normal\<close>
    1.33  
    1.34  locale abelian_subgroup = additive_subgroup + abelian_group G +
    1.35    assumes a_normal: "normal H \<lparr>carrier = carrier G, mult = add G, one = zero G\<rparr>"
    1.36 @@ -378,7 +378,7 @@
    1.37  
    1.38  lemma (in abelian_subgroup) rcosets_add_eq:
    1.39    "M \<in> a_rcosets H \<Longrightarrow> H <+> M = M"
    1.40 -  -- \<open>generalizes @{text subgroup_mult_id}\<close>
    1.41 +  \<comment> \<open>generalizes \<open>subgroup_mult_id\<close>\<close>
    1.42  by (rule normal.rcosets_mult_eq [OF a_normal,
    1.43      folded set_add_def A_RCOSETS_def, simplified monoid_record_simps])
    1.44  
    1.45 @@ -687,7 +687,7 @@
    1.46  by (rule subgroup.rcos_module [OF a_subgroup a_group,
    1.47      folded a_r_coset_def a_inv_def, simplified monoid_record_simps])
    1.48  
    1.49 ---"variant"
    1.50 +\<comment>"variant"
    1.51  lemma (in abelian_subgroup) a_rcos_module_minus:
    1.52    assumes "ring G"
    1.53    assumes carr: "x \<in> carrier G" "x' \<in> carrier G"
     2.1 --- a/src/HOL/Algebra/Bij.thy	Thu May 26 16:57:14 2016 +0200
     2.2 +++ b/src/HOL/Algebra/Bij.thy	Thu May 26 17:51:22 2016 +0200
     2.3 @@ -10,7 +10,7 @@
     2.4  
     2.5  definition
     2.6    Bij :: "'a set \<Rightarrow> ('a \<Rightarrow> 'a) set"
     2.7 -    --\<open>Only extensional functions, since otherwise we get too many.\<close>
     2.8 +    \<comment>\<open>Only extensional functions, since otherwise we get too many.\<close>
     2.9     where "Bij S = extensional S \<inter> {f. bij_betw f S S}"
    2.10  
    2.11  definition
     3.1 --- a/src/HOL/Algebra/Congruence.thy	Thu May 26 16:57:14 2016 +0200
     3.2 +++ b/src/HOL/Algebra/Congruence.thy	Thu May 26 17:51:22 2016 +0200
     3.3 @@ -15,7 +15,7 @@
     3.4    carrier :: "'a set"
     3.5  
     3.6  
     3.7 -subsection \<open>Structure with Carrier and Equivalence Relation @{text eq}\<close>
     3.8 +subsection \<open>Structure with Carrier and Equivalence Relation \<open>eq\<close>\<close>
     3.9  
    3.10  record 'a eq_object = "'a partial_object" +
    3.11    eq :: "'a \<Rightarrow> 'a \<Rightarrow> bool" (infixl ".=\<index>" 50)
     4.1 --- a/src/HOL/Algebra/Coset.thy	Thu May 26 16:57:14 2016 +0200
     4.2 +++ b/src/HOL/Algebra/Coset.thy	Thu May 26 17:51:22 2016 +0200
     4.3 @@ -85,7 +85,7 @@
     4.4  
     4.5  lemma (in group) coset_join2:
     4.6       "\<lbrakk>x \<in> carrier G;  subgroup H G;  x\<in>H\<rbrakk> \<Longrightarrow> H #> x = H"
     4.7 -  --\<open>Alternative proof is to put @{term "x=\<one>"} in @{text repr_independence}.\<close>
     4.8 +  \<comment>\<open>Alternative proof is to put @{term "x=\<one>"} in \<open>repr_independence\<close>.\<close>
     4.9  by (force simp add: subgroup.m_closed r_coset_def solve_equation)
    4.10  
    4.11  lemma (in monoid) r_coset_subset_G:
    4.12 @@ -171,7 +171,7 @@
    4.13    qed
    4.14  qed
    4.15  
    4.16 -text \<open>Step one for lemma @{text "rcos_module"}\<close>
    4.17 +text \<open>Step one for lemma \<open>rcos_module\<close>\<close>
    4.18  lemma (in subgroup) rcos_module_imp:
    4.19    assumes "group G"
    4.20    assumes xcarr: "x \<in> carrier G"
    4.21 @@ -211,7 +211,7 @@
    4.22        show "x' \<otimes> (inv x) \<in> H" by simp
    4.23  qed
    4.24  
    4.25 -text \<open>Step two for lemma @{text "rcos_module"}\<close>
    4.26 +text \<open>Step two for lemma \<open>rcos_module\<close>\<close>
    4.27  lemma (in subgroup) rcos_module_rev:
    4.28    assumes "group G"
    4.29    assumes carr: "x \<in> carrier G" "x' \<in> carrier G"
    4.30 @@ -524,7 +524,7 @@
    4.31  done
    4.32  
    4.33  
    4.34 -subsubsection \<open>Set of Inverses of an @{text r_coset}.\<close>
    4.35 +subsubsection \<open>Set of Inverses of an \<open>r_coset\<close>.\<close>
    4.36  
    4.37  lemma (in normal) rcos_inv:
    4.38    assumes x:     "x \<in> carrier G"
    4.39 @@ -549,7 +549,7 @@
    4.40  qed
    4.41  
    4.42  
    4.43 -subsubsection \<open>Theorems for @{text "<#>"} with @{text "#>"} or @{text "<#"}.\<close>
    4.44 +subsubsection \<open>Theorems for \<open><#>\<close> with \<open>#>\<close> or \<open><#\<close>.\<close>
    4.45  
    4.46  lemma (in group) setmult_rcos_assoc:
    4.47       "\<lbrakk>H \<subseteq> carrier G; K \<subseteq> carrier G; x \<in> carrier G\<rbrakk>
    4.48 @@ -584,7 +584,7 @@
    4.49  by (simp add: rcos_mult_step1 rcos_mult_step2 rcos_mult_step3)
    4.50  
    4.51  lemma (in normal) rcosets_mult_eq: "M \<in> rcosets H \<Longrightarrow> H <#> M = M"
    4.52 -  -- \<open>generalizes @{text subgroup_mult_id}\<close>
    4.53 +  \<comment> \<open>generalizes \<open>subgroup_mult_id\<close>\<close>
    4.54    by (auto simp add: RCOSETS_def subset
    4.55          setmult_rcos_assoc subgroup_mult_id normal.axioms normal_axioms)
    4.56  
    4.57 @@ -628,7 +628,7 @@
    4.58    qed
    4.59  qed
    4.60  
    4.61 -text\<open>Equivalence classes of @{text rcong} correspond to left cosets.
    4.62 +text\<open>Equivalence classes of \<open>rcong\<close> correspond to left cosets.
    4.63    Was there a mistake in the definitions? I'd have expected them to
    4.64    correspond to right cosets.\<close>
    4.65  
    4.66 @@ -679,7 +679,7 @@
    4.67  qed
    4.68  
    4.69  
    4.70 -subsection \<open>Further lemmas for @{text "r_congruent"}\<close>
    4.71 +subsection \<open>Further lemmas for \<open>r_congruent\<close>\<close>
    4.72  
    4.73  text \<open>The relation is a congruence\<close>
    4.74  
    4.75 @@ -780,7 +780,7 @@
    4.76  apply (simp add: r_coset_subset_G [THEN finite_subset])
    4.77  done
    4.78  
    4.79 -text\<open>The next two lemmas support the proof of @{text card_cosets_equal}.\<close>
    4.80 +text\<open>The next two lemmas support the proof of \<open>card_cosets_equal\<close>.\<close>
    4.81  lemma (in group) inj_on_f:
    4.82      "\<lbrakk>H \<subseteq> carrier G;  a \<in> carrier G\<rbrakk> \<Longrightarrow> inj_on (\<lambda>y. y \<otimes> inv a) (H #> a)"
    4.83  apply (rule inj_onI)
    4.84 @@ -831,7 +831,7 @@
    4.85  
    4.86  definition
    4.87    FactGroup :: "[('a,'b) monoid_scheme, 'a set] \<Rightarrow> ('a set) monoid" (infixl "Mod" 65)
    4.88 -    --\<open>Actually defined for groups rather than monoids\<close>
    4.89 +    \<comment>\<open>Actually defined for groups rather than monoids\<close>
    4.90     where "FactGroup G H = \<lparr>carrier = rcosets\<^bsub>G\<^esub> H, mult = set_mult G, one = H\<rparr>"
    4.91  
    4.92  lemma (in normal) setmult_closed:
    4.93 @@ -897,7 +897,7 @@
    4.94  
    4.95  definition
    4.96    kernel :: "('a, 'm) monoid_scheme \<Rightarrow> ('b, 'n) monoid_scheme \<Rightarrow>  ('a \<Rightarrow> 'b) \<Rightarrow> 'a set"
    4.97 -    --\<open>the kernel of a homomorphism\<close>
    4.98 +    \<comment>\<open>the kernel of a homomorphism\<close>
    4.99    where "kernel G H h = {x. x \<in> carrier G & h x = \<one>\<^bsub>H\<^esub>}"
   4.100  
   4.101  lemma (in group_hom) subgroup_kernel: "subgroup (kernel G H h) G"
     5.1 --- a/src/HOL/Algebra/Divisibility.thy	Thu May 26 16:57:14 2016 +0200
     5.2 +++ b/src/HOL/Algebra/Divisibility.thy	Thu May 26 17:51:22 2016 +0200
     5.3 @@ -2340,7 +2340,7 @@
     5.4  qed
     5.5  
     5.6  
     5.7 ---"A version using @{const factors}, more complicated"
     5.8 +\<comment>"A version using @{const factors}, more complicated"
     5.9  lemma (in factorial_monoid) factors_irreducible_is_prime:
    5.10    assumes pirr: "irreducible G p"
    5.11      and pcarr: "p \<in> carrier G"
     6.1 --- a/src/HOL/Algebra/FiniteProduct.thy	Thu May 26 16:57:14 2016 +0200
     6.2 +++ b/src/HOL/Algebra/FiniteProduct.thy	Thu May 26 17:51:22 2016 +0200
     6.3 @@ -12,10 +12,10 @@
     6.4  
     6.5  subsubsection \<open>Inductive Definition of a Relation for Products over Sets\<close>
     6.6  
     6.7 -text \<open>Instantiation of locale @{text LC} of theory @{text Finite_Set} is not
     6.8 +text \<open>Instantiation of locale \<open>LC\<close> of theory \<open>Finite_Set\<close> is not
     6.9    possible, because here we have explicit typing rules like 
    6.10 -  @{text "x \<in> carrier G"}.  We introduce an explicit argument for the domain
    6.11 -  @{text D}.\<close>
    6.12 +  \<open>x \<in> carrier G\<close>.  We introduce an explicit argument for the domain
    6.13 +  \<open>D\<close>.\<close>
    6.14  
    6.15  inductive_set
    6.16    foldSetD :: "['a set, 'b => 'a => 'a, 'a] => ('b set * 'a) set"
    6.17 @@ -111,7 +111,7 @@
    6.18    apply (erule foldSetD.cases)
    6.19     apply blast
    6.20    apply clarify
    6.21 -  txt \<open>force simplification of @{text "card A < card (insert ...)"}.\<close>
    6.22 +  txt \<open>force simplification of \<open>card A < card (insert ...)\<close>.\<close>
    6.23    apply (erule rev_mp)
    6.24    apply (simp add: less_Suc_eq_le)
    6.25    apply (rule impI)
    6.26 @@ -221,7 +221,7 @@
    6.27      ==> foldD D f e (A Un B) = foldD D f (foldD D f e B) A"
    6.28    by (simp add: foldD_nest_Un_Int)
    6.29  
    6.30 --- \<open>Delete rules to do with @{text foldSetD} relation.\<close>
    6.31 +\<comment> \<open>Delete rules to do with \<open>foldSetD\<close> relation.\<close>
    6.32  
    6.33  declare foldSetD_imp_finite [simp del]
    6.34    empty_foldSetDE [rule del]
    6.35 @@ -233,8 +233,8 @@
    6.36  text \<open>Commutative Monoids\<close>
    6.37  
    6.38  text \<open>
    6.39 -  We enter a more restrictive context, with @{text "f :: 'a => 'a => 'a"}
    6.40 -  instead of @{text "'b => 'a => 'a"}.
    6.41 +  We enter a more restrictive context, with \<open>f :: 'a => 'a => 'a\<close>
    6.42 +  instead of \<open>'b => 'a => 'a\<close>.
    6.43  \<close>
    6.44  
    6.45  locale ACeD =
    6.46 @@ -299,7 +299,7 @@
    6.47        ("(3\<Otimes>__\<in>_. _)" [1000, 0, 51, 10] 10)
    6.48  translations
    6.49    "\<Otimes>\<^bsub>G\<^esub>i\<in>A. b" \<rightleftharpoons> "CONST finprod G (%i. b) A"
    6.50 -  -- \<open>Beware of argument permutation!\<close>
    6.51 +  \<comment> \<open>Beware of argument permutation!\<close>
    6.52  
    6.53  lemma (in comm_monoid) finprod_empty [simp]: 
    6.54    "finprod G f {} = \<one>"
    6.55 @@ -367,7 +367,7 @@
    6.56    "[| finite A; finite B; g \<in> A \<rightarrow> carrier G; g \<in> B \<rightarrow> carrier G |] ==>
    6.57       finprod G g (A Un B) \<otimes> finprod G g (A Int B) =
    6.58       finprod G g A \<otimes> finprod G g B"
    6.59 --- \<open>The reversed orientation looks more natural, but LOOPS as a simprule!\<close>
    6.60 +\<comment> \<open>The reversed orientation looks more natural, but LOOPS as a simprule!\<close>
    6.61  proof (induct set: finite)
    6.62    case empty then show ?case by simp
    6.63  next
    6.64 @@ -451,7 +451,7 @@
    6.65    by (rule finprod_cong') (auto simp add: simp_implies_def)
    6.66  
    6.67  text \<open>Usually, if this rule causes a failed congruence proof error,
    6.68 -  the reason is that the premise @{text "g \<in> B \<rightarrow> carrier G"} cannot be shown.
    6.69 +  the reason is that the premise \<open>g \<in> B \<rightarrow> carrier G\<close> cannot be shown.
    6.70    Adding @{thm [source] Pi_def} to the simpset is often useful.
    6.71    For this reason, @{thm [source] finprod_cong}
    6.72    is not added to the simpset by default.
     7.1 --- a/src/HOL/Algebra/Group.thy	Thu May 26 16:57:14 2016 +0200
     7.2 +++ b/src/HOL/Algebra/Group.thy	Thu May 26 17:51:22 2016 +0200
     7.3 @@ -26,7 +26,7 @@
     7.4  
     7.5  definition
     7.6    Units :: "_ => 'a set"
     7.7 -  --\<open>The set of invertible elements\<close>
     7.8 +  \<comment>\<open>The set of invertible elements\<close>
     7.9    where "Units G = {y. y \<in> carrier G & (\<exists>x \<in> carrier G. x \<otimes>\<^bsub>G\<^esub> y = \<one>\<^bsub>G\<^esub> & y \<otimes>\<^bsub>G\<^esub> x = \<one>\<^bsub>G\<^esub>)}"
    7.10  
    7.11  consts
    7.12 @@ -98,7 +98,7 @@
    7.13    moreover from x y xinv yinv have "x \<otimes> (y \<otimes> y') \<otimes> x' = \<one>" by simp
    7.14    moreover note x y
    7.15    ultimately show ?thesis unfolding Units_def
    7.16 -    -- "Must avoid premature use of @{text hyp_subst_tac}."
    7.17 +    \<comment> "Must avoid premature use of \<open>hyp_subst_tac\<close>."
    7.18      apply (rule_tac CollectI)
    7.19      apply (rule)
    7.20      apply (fast)
    7.21 @@ -486,8 +486,8 @@
    7.22  
    7.23  text \<open>
    7.24    Since @{term H} is nonempty, it contains some element @{term x}.  Since
    7.25 -  it is closed under inverse, it contains @{text "inv x"}.  Since
    7.26 -  it is closed under product, it contains @{text "x \<otimes> inv x = \<one>"}.
    7.27 +  it is closed under inverse, it contains \<open>inv x\<close>.  Since
    7.28 +  it is closed under product, it contains \<open>x \<otimes> inv x = \<one>\<close>.
    7.29  \<close>
    7.30  
    7.31  lemma (in group) one_in_subset:
     8.1 --- a/src/HOL/Algebra/Ideal.thy	Thu May 26 16:57:14 2016 +0200
     8.2 +++ b/src/HOL/Algebra/Ideal.thy	Thu May 26 17:51:22 2016 +0200
     8.3 @@ -592,14 +592,14 @@
     8.4  
     8.5  subsection \<open>Properties of Principal Ideals\<close>
     8.6  
     8.7 -text \<open>@{text "\<zero>"} generates the zero ideal\<close>
     8.8 +text \<open>\<open>\<zero>\<close> generates the zero ideal\<close>
     8.9  lemma (in ring) zero_genideal: "Idl {\<zero>} = {\<zero>}"
    8.10    apply rule
    8.11    apply (simp add: genideal_minimal zeroideal)
    8.12    apply (fast intro!: genideal_self)
    8.13    done
    8.14  
    8.15 -text \<open>@{text "\<one>"} generates the unit ideal\<close>
    8.16 +text \<open>\<open>\<one>\<close> generates the unit ideal\<close>
    8.17  lemma (in ring) one_genideal: "Idl {\<one>} = carrier R"
    8.18  proof -
    8.19    have "\<one> \<in> Idl {\<one>}"
    8.20 @@ -684,7 +684,7 @@
    8.21    then show thesis using primeidealCD [OF R.is_cring notprime] by blast
    8.22  qed
    8.23  
    8.24 -text \<open>If @{text "{\<zero>}"} is a prime ideal of a commutative ring, the ring is a domain\<close>
    8.25 +text \<open>If \<open>{\<zero>}\<close> is a prime ideal of a commutative ring, the ring is a domain\<close>
    8.26  lemma (in cring) zeroprimeideal_domainI:
    8.27    assumes pi: "primeideal {\<zero>} R"
    8.28    shows "domain R"
    8.29 @@ -828,7 +828,7 @@
    8.30  
    8.31  subsection \<open>Derived Theorems\<close>
    8.32  
    8.33 ---"A non-zero cring that has only the two trivial ideals is a field"
    8.34 +\<comment>"A non-zero cring that has only the two trivial ideals is a field"
    8.35  lemma (in cring) trivialideals_fieldI:
    8.36    assumes carrnzero: "carrier R \<noteq> {\<zero>}"
    8.37      and haveideals: "{I. ideal I R} = {{\<zero>}, carrier R}"
    8.38 @@ -921,7 +921,7 @@
    8.39    qed
    8.40  qed (simp add: zeroideal oneideal)
    8.41  
    8.42 ---"Jacobson Theorem 2.2"
    8.43 +\<comment>"Jacobson Theorem 2.2"
    8.44  lemma (in cring) trivialideals_eq_field:
    8.45    assumes carrnzero: "carrier R \<noteq> {\<zero>}"
    8.46    shows "({I. ideal I R} = {{\<zero>}, carrier R}) = field R"
     9.1 --- a/src/HOL/Algebra/IntRing.thy	Thu May 26 16:57:14 2016 +0200
     9.2 +++ b/src/HOL/Algebra/IntRing.thy	Thu May 26 17:51:22 2016 +0200
     9.3 @@ -20,7 +20,7 @@
     9.4  done
     9.5  
     9.6  
     9.7 -subsection \<open>@{text "\<Z>"}: The Set of Integers as Algebraic Structure\<close>
     9.8 +subsection \<open>\<open>\<Z>\<close>: The Set of Integers as Algebraic Structure\<close>
     9.9  
    9.10  abbreviation int_ring :: "int ring" ("\<Z>")
    9.11    where "int_ring \<equiv> \<lparr>carrier = UNIV, mult = op *, one = 1, zero = 0, add = op +\<rparr>"
    9.12 @@ -59,14 +59,14 @@
    9.13      and "one \<Z> = 1"
    9.14      and "pow \<Z> x n = x^n"
    9.15  proof -
    9.16 -  -- "Specification"
    9.17 +  \<comment> "Specification"
    9.18    show "monoid \<Z>" by standard auto
    9.19    then interpret int: monoid \<Z> .
    9.20  
    9.21 -  -- "Carrier"
    9.22 +  \<comment> "Carrier"
    9.23    show "carrier \<Z> = UNIV" by simp
    9.24  
    9.25 -  -- "Operations"
    9.26 +  \<comment> "Operations"
    9.27    { fix x y show "mult \<Z> x y = x * y" by simp }
    9.28    show "one \<Z> = 1" by simp
    9.29    show "pow \<Z> x n = x^n" by (induct n) simp_all
    9.30 @@ -75,11 +75,11 @@
    9.31  interpretation int: comm_monoid \<Z>
    9.32    rewrites "finprod \<Z> f A = setprod f A"
    9.33  proof -
    9.34 -  -- "Specification"
    9.35 +  \<comment> "Specification"
    9.36    show "comm_monoid \<Z>" by standard auto
    9.37    then interpret int: comm_monoid \<Z> .
    9.38  
    9.39 -  -- "Operations"
    9.40 +  \<comment> "Operations"
    9.41    { fix x y have "mult \<Z> x y = x * y" by simp }
    9.42    note mult = this
    9.43    have one: "one \<Z> = 1" by simp
    9.44 @@ -93,14 +93,14 @@
    9.45      and int_add_eq: "add \<Z> x y = x + y"
    9.46      and int_finsum_eq: "finsum \<Z> f A = setsum f A"
    9.47  proof -
    9.48 -  -- "Specification"
    9.49 +  \<comment> "Specification"
    9.50    show "abelian_monoid \<Z>" by standard auto
    9.51    then interpret int: abelian_monoid \<Z> .
    9.52  
    9.53 -  -- "Carrier"
    9.54 +  \<comment> "Carrier"
    9.55    show "carrier \<Z> = UNIV" by simp
    9.56  
    9.57 -  -- "Operations"
    9.58 +  \<comment> "Operations"
    9.59    { fix x y show "add \<Z> x y = x + y" by simp }
    9.60    note add = this
    9.61    show zero: "zero \<Z> = 0"
    9.62 @@ -121,7 +121,7 @@
    9.63      and int_a_inv_eq: "a_inv \<Z> x = - x"
    9.64      and int_a_minus_eq: "a_minus \<Z> x y = x - y"
    9.65  proof -
    9.66 -  -- "Specification"
    9.67 +  \<comment> "Specification"
    9.68    show "abelian_group \<Z>"
    9.69    proof (rule abelian_groupI)
    9.70      fix x
    9.71 @@ -130,7 +130,7 @@
    9.72        by simp arith
    9.73    qed auto
    9.74    then interpret int: abelian_group \<Z> .
    9.75 -  -- "Operations"
    9.76 +  \<comment> "Operations"
    9.77    { fix x y have "add \<Z> x y = x + y" by simp }
    9.78    note add = this
    9.79    have zero: "zero \<Z> = 0" by simp
    9.80 @@ -218,7 +218,7 @@
    9.81    by standard clarsimp
    9.82  
    9.83  
    9.84 -subsection \<open>Generated Ideals of @{text "\<Z>"}\<close>
    9.85 +subsection \<open>Generated Ideals of \<open>\<Z>\<close>\<close>
    9.86  
    9.87  lemma int_Idl: "Idl\<^bsub>\<Z>\<^esub> {a} = {x * a | x. True}"
    9.88    apply (subst int.cgenideal_eq_genideal[symmetric]) apply simp
    10.1 --- a/src/HOL/Algebra/Lattice.thy	Thu May 26 16:57:14 2016 +0200
    10.2 +++ b/src/HOL/Algebra/Lattice.thy	Thu May 26 17:51:22 2016 +0200
    10.3 @@ -507,7 +507,7 @@
    10.4    unfolding sup_def
    10.5    by (rule someI2) (auto intro: sup_of_singletonI)
    10.6  
    10.7 -text \<open>Condition on @{text A}: supremum exists.\<close>
    10.8 +text \<open>Condition on \<open>A\<close>: supremum exists.\<close>
    10.9  
   10.10  lemma (in weak_upper_semilattice) sup_insertI:
   10.11    "[| !!s. least L s (Upper L (insert x A)) ==> P s;
   10.12 @@ -638,7 +638,7 @@
   10.13    assumes L: "x \<in> carrier L"  "y \<in> carrier L"  "z \<in> carrier L"
   10.14    shows "x \<squnion> (y \<squnion> z) .= \<Squnion>{x, y, z}"
   10.15  proof (rule finite_sup_insertI)
   10.16 -  -- \<open>The textbook argument in Jacobson I, p 457\<close>
   10.17 +  \<comment> \<open>The textbook argument in Jacobson I, p 457\<close>
   10.18    fix s
   10.19    assume sup: "least L s (Upper L {x, y, z})"
   10.20    show "x \<squnion> (y \<squnion> z) .= s"
   10.21 @@ -652,7 +652,7 @@
   10.22    qed (simp_all add: L least_closed [OF sup])
   10.23  qed (simp_all add: L)
   10.24  
   10.25 -text \<open>Commutativity holds for @{text "="}.\<close>
   10.26 +text \<open>Commutativity holds for \<open>=\<close>.\<close>
   10.27  
   10.28  lemma join_comm:
   10.29    fixes L (structure)
   10.30 @@ -747,7 +747,7 @@
   10.31    unfolding inf_def
   10.32    by (rule someI2) (auto intro: inf_of_singletonI)
   10.33  
   10.34 -text \<open>Condition on @{text A}: infimum exists.\<close>
   10.35 +text \<open>Condition on \<open>A\<close>: infimum exists.\<close>
   10.36  
   10.37  lemma (in weak_lower_semilattice) inf_insertI:
   10.38    "[| !!i. greatest L i (Lower L (insert x A)) ==> P i;
   10.39 @@ -1090,7 +1090,7 @@
   10.40  (* TODO: prove dual version *)
   10.41  
   10.42  
   10.43 -subsection \<open>Orders and Lattices where @{text eq} is the Equality\<close>
   10.44 +subsection \<open>Orders and Lattices where \<open>eq\<close> is the Equality\<close>
   10.45  
   10.46  locale partial_order = weak_partial_order +
   10.47    assumes eq_is_equal: "op .= = op ="
   10.48 @@ -1172,7 +1172,7 @@
   10.49    "x \<in> carrier L ==> \<Sqinter>{x} = x"
   10.50    using weak_inf_of_singleton unfolding eq_is_equal .
   10.51  
   10.52 -text \<open>Condition on @{text A}: infimum exists.\<close>
   10.53 +text \<open>Condition on \<open>A\<close>: infimum exists.\<close>
   10.54  
   10.55  lemma (in lower_semilattice) meet_assoc_lemma:
   10.56    assumes L: "x \<in> carrier L"  "y \<in> carrier L"  "z \<in> carrier L"
    11.1 --- a/src/HOL/Algebra/QuotRing.thy	Thu May 26 16:57:14 2016 +0200
    11.2 +++ b/src/HOL/Algebra/QuotRing.thy	Thu May 26 17:51:22 2016 +0200
    11.3 @@ -84,28 +84,28 @@
    11.4  text \<open>The quotient is a ring\<close>
    11.5  lemma (in ideal) quotient_is_ring: "ring (R Quot I)"
    11.6  apply (rule ringI)
    11.7 -   --\<open>abelian group\<close>
    11.8 +   \<comment>\<open>abelian group\<close>
    11.9     apply (rule comm_group_abelian_groupI)
   11.10     apply (simp add: FactRing_def)
   11.11     apply (rule a_factorgroup_is_comm_group[unfolded A_FactGroup_def'])
   11.12 -  --\<open>mult monoid\<close>
   11.13 +  \<comment>\<open>mult monoid\<close>
   11.14    apply (rule monoidI)
   11.15        apply (simp_all add: FactRing_def A_RCOSETS_def RCOSETS_def
   11.16               a_r_coset_def[symmetric])
   11.17 -      --\<open>mult closed\<close>
   11.18 +      \<comment>\<open>mult closed\<close>
   11.19        apply (clarify)
   11.20        apply (simp add: rcoset_mult_add, fast)
   11.21 -     --\<open>mult @{text one_closed}\<close>
   11.22 +     \<comment>\<open>mult \<open>one_closed\<close>\<close>
   11.23       apply force
   11.24 -    --\<open>mult assoc\<close>
   11.25 +    \<comment>\<open>mult assoc\<close>
   11.26      apply clarify
   11.27      apply (simp add: rcoset_mult_add m_assoc)
   11.28 -   --\<open>mult one\<close>
   11.29 +   \<comment>\<open>mult one\<close>
   11.30     apply clarify
   11.31     apply (simp add: rcoset_mult_add)
   11.32    apply clarify
   11.33    apply (simp add: rcoset_mult_add)
   11.34 - --\<open>distr\<close>
   11.35 + \<comment>\<open>distr\<close>
   11.36   apply clarify
   11.37   apply (simp add: rcoset_mult_add a_rcos_sum l_distr)
   11.38  apply clarify
   11.39 @@ -225,7 +225,7 @@
   11.40       apply (simp add: FactRing_def A_RCOSETS_defs a_r_coset_def[symmetric], clarsimp)
   11.41       apply (simp add: rcoset_mult_add) defer 1
   11.42    proof (rule ccontr, simp)
   11.43 -    --\<open>Quotient is not empty\<close>
   11.44 +    \<comment>\<open>Quotient is not empty\<close>
   11.45      assume "\<zero>\<^bsub>R Quot I\<^esub> = \<one>\<^bsub>R Quot I\<^esub>"
   11.46      then have II1: "I = I +> \<one>" by (simp add: FactRing_def)
   11.47      from a_rcos_self[OF one_closed] have "\<one> \<in> I"
   11.48 @@ -233,11 +233,11 @@
   11.49      then have "I = carrier R" by (rule one_imp_carrier)
   11.50      with I_notcarr show False by simp
   11.51    next
   11.52 -    --\<open>Existence of Inverse\<close>
   11.53 +    \<comment>\<open>Existence of Inverse\<close>
   11.54      fix a
   11.55      assume IanI: "I +> a \<noteq> I" and acarr: "a \<in> carrier R"
   11.56  
   11.57 -    --\<open>Helper ideal @{text "J"}\<close>
   11.58 +    \<comment>\<open>Helper ideal \<open>J\<close>\<close>
   11.59      define J :: "'a set" where "J = (carrier R #> a) <+> I"
   11.60      have idealJ: "ideal J R"
   11.61        apply (unfold J_def, rule add_ideals)
   11.62 @@ -245,7 +245,7 @@
   11.63        apply (rule is_ideal)
   11.64        done
   11.65  
   11.66 -    --\<open>Showing @{term "J"} not smaller than @{term "I"}\<close>
   11.67 +    \<comment>\<open>Showing @{term "J"} not smaller than @{term "I"}\<close>
   11.68      have IinJ: "I \<subseteq> J"
   11.69      proof (rule, simp add: J_def r_coset_def set_add_defs)
   11.70        fix x
   11.71 @@ -256,7 +256,7 @@
   11.72        with Zcarr and xI show "\<exists>xa\<in>carrier R. \<exists>k\<in>I. x = xa \<otimes> a \<oplus> k" by fast
   11.73      qed
   11.74  
   11.75 -    --\<open>Showing @{term "J \<noteq> I"}\<close>
   11.76 +    \<comment>\<open>Showing @{term "J \<noteq> I"}\<close>
   11.77      have anI: "a \<notin> I"
   11.78      proof (rule ccontr, simp)
   11.79        assume "a \<in> I"
   11.80 @@ -274,7 +274,7 @@
   11.81  
   11.82      from aJ and anI have JnI: "J \<noteq> I" by fast
   11.83  
   11.84 -    --\<open>Deducing @{term "J = carrier R"} because @{term "I"} is maximal\<close>
   11.85 +    \<comment>\<open>Deducing @{term "J = carrier R"} because @{term "I"} is maximal\<close>
   11.86      from idealJ and IinJ have "J = I \<or> J = carrier R"
   11.87      proof (rule I_maximal, unfold J_def)
   11.88        have "carrier R #> a \<subseteq> carrier R"
   11.89 @@ -285,7 +285,7 @@
   11.90  
   11.91      with JnI have Jcarr: "J = carrier R" by simp
   11.92  
   11.93 -    --\<open>Calculating an inverse for @{term "a"}\<close>
   11.94 +    \<comment>\<open>Calculating an inverse for @{term "a"}\<close>
   11.95      from one_closed[folded Jcarr]
   11.96      have "\<exists>r\<in>carrier R. \<exists>i\<in>I. \<one> = r \<otimes> a \<oplus> i"
   11.97        by (simp add: J_def r_coset_def set_add_defs)
   11.98 @@ -294,7 +294,7 @@
   11.99      from one and rcarr and acarr and iI[THEN a_Hcarr]
  11.100      have rai1: "a \<otimes> r = \<ominus>i \<oplus> \<one>" by algebra
  11.101  
  11.102 -    --\<open>Lifting to cosets\<close>
  11.103 +    \<comment>\<open>Lifting to cosets\<close>
  11.104      from iI have "\<ominus>i \<oplus> \<one> \<in> I +> \<one>"
  11.105        by (intro a_rcosI, simp, intro a_subset, simp)
  11.106      with rai1 have "a \<otimes> r \<in> I +> \<one>" by simp
    12.1 --- a/src/HOL/Algebra/Ring.thy	Thu May 26 16:57:14 2016 +0200
    12.2 +++ b/src/HOL/Algebra/Ring.thy	Thu May 26 17:51:22 2016 +0200
    12.3 @@ -39,7 +39,7 @@
    12.4        ("(3\<Oplus>__\<in>_. _)" [1000, 0, 51, 10] 10)
    12.5  translations
    12.6    "\<Oplus>\<^bsub>G\<^esub>i\<in>A. b" \<rightleftharpoons> "CONST finsum G (%i. b) A"
    12.7 -  -- \<open>Beware of argument permutation!\<close>
    12.8 +  \<comment> \<open>Beware of argument permutation!\<close>
    12.9  
   12.10  
   12.11  locale abelian_group = abelian_monoid +
   12.12 @@ -141,7 +141,7 @@
   12.13  
   12.14  lemmas finsum_cong = add.finprod_cong
   12.15  text \<open>Usually, if this rule causes a failed congruence proof error,
   12.16 -   the reason is that the premise @{text "g \<in> B \<rightarrow> carrier G"} cannot be shown.
   12.17 +   the reason is that the premise \<open>g \<in> B \<rightarrow> carrier G\<close> cannot be shown.
   12.18     Adding @{thm [source] Pi_def} to the simpset is often useful.\<close>
   12.19  
   12.20  lemmas finsum_reindex = add.finprod_reindex
   12.21 @@ -206,7 +206,7 @@
   12.22  
   12.23  lemmas (in abelian_group) minus_add = add.inv_mult
   12.24   
   12.25 -text \<open>Derive an @{text "abelian_group"} from a @{text "comm_group"}\<close>
   12.26 +text \<open>Derive an \<open>abelian_group\<close> from a \<open>comm_group\<close>\<close>
   12.27  
   12.28  lemma comm_group_abelian_groupI:
   12.29    fixes G (structure)
   12.30 @@ -283,7 +283,7 @@
   12.31    shows "cring R"
   12.32  proof (intro cring.intro ring.intro)
   12.33    show "ring_axioms R"
   12.34 -    -- \<open>Right-distributivity follows from left-distributivity and
   12.35 +    \<comment> \<open>Right-distributivity follows from left-distributivity and
   12.36            commutativity.\<close>
   12.37    proof (rule ring_axioms.intro)
   12.38      fix x y z
    13.1 --- a/src/HOL/Algebra/RingHom.thy	Thu May 26 16:57:14 2016 +0200
    13.2 +++ b/src/HOL/Algebra/RingHom.thy	Thu May 26 17:51:22 2016 +0200
    13.3 @@ -8,7 +8,7 @@
    13.4  
    13.5  section \<open>Homomorphisms of Non-Commutative Rings\<close>
    13.6  
    13.7 -text \<open>Lifting existing lemmas in a @{text ring_hom_ring} locale\<close>
    13.8 +text \<open>Lifting existing lemmas in a \<open>ring_hom_ring\<close> locale\<close>
    13.9  locale ring_hom_ring = R?: ring R + S?: ring S
   13.10      for R (structure) and S (structure) +
   13.11    fixes h
   13.12 @@ -102,7 +102,7 @@
   13.13  
   13.14  subsection \<open>The Kernel of a Ring Homomorphism\<close>
   13.15  
   13.16 ---"the kernel of a ring homomorphism is an ideal"
   13.17 +\<comment>"the kernel of a ring homomorphism is an ideal"
   13.18  lemma (in ring_hom_ring) kernel_is_ideal:
   13.19    shows "ideal (a_kernel R S h) R"
   13.20  apply (rule idealI)
    14.1 --- a/src/HOL/Algebra/Sylow.thy	Thu May 26 16:57:14 2016 +0200
    14.2 +++ b/src/HOL/Algebra/Sylow.thy	Thu May 26 17:51:22 2016 +0200
    14.3 @@ -104,7 +104,7 @@
    14.4  
    14.5  end
    14.6  
    14.7 -subsection\<open>Discharging the Assumptions of @{text sylow_central}\<close>
    14.8 +subsection\<open>Discharging the Assumptions of \<open>sylow_central\<close>\<close>
    14.9  
   14.10  context sylow
   14.11  begin
   14.12 @@ -265,7 +265,7 @@
   14.13              intro!: M1_in_M in_quotient_imp_closed [OF RelM_equiv M_in_quot _  M1_RelM_rcosetGM1g])
   14.14  done
   14.15  
   14.16 -text\<open>close to a duplicate of @{text inj_M_GmodH}\<close>
   14.17 +text\<open>close to a duplicate of \<open>inj_M_GmodH\<close>\<close>
   14.18  lemma (in sylow_central) inj_GmodH_M:
   14.19       "\<exists>g \<in> rcosets H\<rightarrow>M. inj_on g (rcosets H)"
   14.20  apply (rule bexI)
    15.1 --- a/src/HOL/Algebra/UnivPoly.thy	Thu May 26 16:57:14 2016 +0200
    15.2 +++ b/src/HOL/Algebra/UnivPoly.thy	Thu May 26 17:51:22 2016 +0200
    15.3 @@ -14,7 +14,7 @@
    15.4  text \<open>
    15.5    Polynomials are formalised as modules with additional operations for
    15.6    extracting coefficients from polynomials and for obtaining monomials
    15.7 -  from coefficients and exponents (record @{text "up_ring"}).  The
    15.8 +  from coefficients and exponents (record \<open>up_ring\<close>).  The
    15.9    carrier set is a set of bounded functions from Nat to the
   15.10    coefficient domain.  Bounded means that these functions return zero
   15.11    above a certain bound (the degree).  There is a chapter on the
   15.12 @@ -754,7 +754,7 @@
   15.13    assumes non_zero: "n ~= 0 ==> coeff P p n ~= \<zero>"
   15.14      and R: "p \<in> carrier P"
   15.15    shows "n <= deg R p"
   15.16 --- \<open>Logically, this is a slightly stronger version of
   15.17 +\<comment> \<open>Logically, this is a slightly stronger version of
   15.18     @{thm [source] deg_aboveD}\<close>
   15.19  proof (cases "n=0")
   15.20    case True then show ?thesis by simp
   15.21 @@ -864,7 +864,7 @@
   15.22  qed
   15.23  
   15.24  text\<open>The following lemma is later \emph{overwritten} by the most
   15.25 -  specific one for domains, @{text deg_smult}.\<close>
   15.26 +  specific one for domains, \<open>deg_smult\<close>.\<close>
   15.27  
   15.28  lemma deg_smult_ring [simp]:
   15.29    "[| a \<in> carrier R; p \<in> carrier P |] ==>
   15.30 @@ -1202,7 +1202,7 @@
   15.31    defines Eval_def: "Eval == eval R S h s"
   15.32  
   15.33  text\<open>JE: I have moved the following lemma from Ring.thy and lifted then to the locale @{term ring_hom_ring} from @{term ring_hom_cring}.\<close>
   15.34 -text\<open>JE: I was considering using it in @{text eval_ring_hom}, but that property does not hold for non commutative rings, so 
   15.35 +text\<open>JE: I was considering using it in \<open>eval_ring_hom\<close>, but that property does not hold for non commutative rings, so 
   15.36    maybe it is not that necessary.\<close>
   15.37  
   15.38  lemma (in ring_hom_ring) hom_finsum [simp]:
   15.39 @@ -1295,8 +1295,8 @@
   15.40  qed
   15.41  
   15.42  text \<open>
   15.43 -  The following lemma could be proved in @{text UP_cring} with the additional
   15.44 -  assumption that @{text h} is closed.\<close>
   15.45 +  The following lemma could be proved in \<open>UP_cring\<close> with the additional
   15.46 +  assumption that \<open>h\<close> is closed.\<close>
   15.47  
   15.48  lemma (in UP_pre_univ_prop) eval_const:
   15.49    "[| s \<in> carrier S; r \<in> carrier R |] ==> eval R S h s (monom P r 0) = h r"
    16.1 --- a/src/HOL/Cardinals/Bounded_Set.thy	Thu May 26 16:57:14 2016 +0200
    16.2 +++ b/src/HOL/Cardinals/Bounded_Set.thy	Thu May 26 17:51:22 2016 +0200
    16.3 @@ -61,9 +61,9 @@
    16.4    hence *: "set_bset R' = ?L'" unfolding R'_def by (intro set_bset_to_set_bset)
    16.5    show ?R unfolding Grp_def relcompp.simps conversep.simps
    16.6    proof (intro CollectI case_prodI exI[of _ a] exI[of _ b] exI[of _ R'] conjI refl)
    16.7 -    from * show "a = map_bset fst R'" using conjunct1[OF `?L`]
    16.8 +    from * show "a = map_bset fst R'" using conjunct1[OF \<open>?L\<close>]
    16.9        by (transfer, auto simp add: image_def Int_def split: prod.splits)
   16.10 -    from * show "b = map_bset snd R'" using conjunct2[OF `?L`]
   16.11 +    from * show "b = map_bset snd R'" using conjunct2[OF \<open>?L\<close>]
   16.12        by (transfer, auto simp add: image_def Int_def split: prod.splits)
   16.13    qed (auto simp add: *)
   16.14  next
    17.1 --- a/src/HOL/Cardinals/Cardinal_Arithmetic.thy	Thu May 26 16:57:14 2016 +0200
    17.2 +++ b/src/HOL/Cardinals/Cardinal_Arithmetic.thy	Thu May 26 17:51:22 2016 +0200
    17.3 @@ -5,13 +5,13 @@
    17.4  Cardinal arithmetic.
    17.5  *)
    17.6  
    17.7 -section {* Cardinal Arithmetic *}
    17.8 +section \<open>Cardinal Arithmetic\<close>
    17.9  
   17.10  theory Cardinal_Arithmetic
   17.11  imports BNF_Cardinal_Arithmetic Cardinal_Order_Relation
   17.12  begin
   17.13  
   17.14 -subsection {* Binary sum *}
   17.15 +subsection \<open>Binary sum\<close>
   17.16  
   17.17  lemma csum_Cnotzero2:
   17.18    "Cnotzero r2 \<Longrightarrow> Cnotzero (r1 +c r2)"
   17.19 @@ -41,7 +41,7 @@
   17.20    by (rule ordIso_transitive[OF ordIso_symmetric[OF card_of_Plus_empty2] card_of_Field_ordIso])
   17.21  
   17.22  
   17.23 -subsection {* Product *}
   17.24 +subsection \<open>Product\<close>
   17.25  
   17.26  lemma Times_cprod: "|A \<times> B| =o |A| *c |B|"
   17.27  by (simp only: cprod_def Field_card_of card_of_refl)
   17.28 @@ -71,7 +71,7 @@
   17.29  unfolding cprod_def by (metis Card_order_Times1 czeroI)
   17.30  
   17.31  
   17.32 -subsection {* Exponentiation *}
   17.33 +subsection \<open>Exponentiation\<close>
   17.34  
   17.35  lemma cexp_czero: "r ^c czero =o cone"
   17.36  unfolding cexp_def czero_def Field_card_of Func_empty by (rule single_cone)
   17.37 @@ -269,7 +269,7 @@
   17.38    unfolding cexp_def cprod_def csum_def Field_card_of by (rule card_of_Func_Plus)
   17.39  
   17.40  
   17.41 -subsection {* Powerset *}
   17.42 +subsection \<open>Powerset\<close>
   17.43  
   17.44  definition cpow where "cpow r = |Pow (Field r)|"
   17.45  
   17.46 @@ -291,7 +291,7 @@
   17.47  lemma cpow_cexp_ctwo: "cpow r =o ctwo ^c r"
   17.48  unfolding cpow_def ctwo_def cexp_def Field_card_of by (rule card_of_Pow_Func)
   17.49  
   17.50 -subsection {* Inverse image *}
   17.51 +subsection \<open>Inverse image\<close>
   17.52  
   17.53  lemma vimage_ordLeq:
   17.54  assumes "|A| \<le>o k" and "\<forall> a \<in> A. |vimage f {a}| \<le>o k" and "Cinfinite k"
   17.55 @@ -303,7 +303,7 @@
   17.56    finally show ?thesis .
   17.57  qed
   17.58  
   17.59 -subsection {* Maximum *}
   17.60 +subsection \<open>Maximum\<close>
   17.61  
   17.62  definition cmax where
   17.63    "cmax r s =
   17.64 @@ -372,7 +372,7 @@
   17.65    case False
   17.66    hence "s \<le>o r" by (metis ordLeq_total r s card_order_on_def)
   17.67    hence "cmax r s =o r" by (metis cmax1 r s)
   17.68 -  also have "r =o r +c s" by (metis `s \<le>o r` csum_absorb1 ordIso_symmetric r)
   17.69 +  also have "r =o r +c s" by (metis \<open>s \<le>o r\<close> csum_absorb1 ordIso_symmetric r)
   17.70    finally show ?thesis .
   17.71  qed
   17.72  
   17.73 @@ -386,7 +386,7 @@
   17.74    case False
   17.75    hence "s \<le>o r" by (metis ordLeq_total r s card_order_on_def)
   17.76    hence "cmax r s =o r" by (metis cmax1 r s)
   17.77 -  also have "r =o r *c s" by (metis Cinfinite_Cnotzero `s \<le>o r` cprod_infinite1' ordIso_symmetric r s)
   17.78 +  also have "r =o r *c s" by (metis Cinfinite_Cnotzero \<open>s \<le>o r\<close> cprod_infinite1' ordIso_symmetric r s)
   17.79    finally show ?thesis .
   17.80  qed
   17.81  
    18.1 --- a/src/HOL/Cardinals/Cardinal_Order_Relation.thy	Thu May 26 16:57:14 2016 +0200
    18.2 +++ b/src/HOL/Cardinals/Cardinal_Order_Relation.thy	Thu May 26 17:51:22 2016 +0200
    18.3 @@ -5,7 +5,7 @@
    18.4  Cardinal-order relations.
    18.5  *)
    18.6  
    18.7 -section {* Cardinal-Order Relations *}
    18.8 +section \<open>Cardinal-Order Relations\<close>
    18.9  
   18.10  theory Cardinal_Order_Relation
   18.11  imports BNF_Cardinal_Order_Relation Wellorder_Constructions
   18.12 @@ -69,7 +69,7 @@
   18.13    curr_in[intro, simp]
   18.14  
   18.15  
   18.16 -subsection {* Cardinal of a set *}
   18.17 +subsection \<open>Cardinal of a set\<close>
   18.18  
   18.19  lemma card_of_inj_rel: assumes INJ: "!! x y y'. \<lbrakk>(x,y) : R; (x,y') : R\<rbrakk> \<Longrightarrow> y = y'"
   18.20  shows "|{y. EX x. (x,y) : R}| <=o |{x. EX y. (x,y) : R}|"
   18.21 @@ -132,7 +132,7 @@
   18.22  qed
   18.23  
   18.24  
   18.25 -subsection {* Cardinals versus set operations on arbitrary sets *}
   18.26 +subsection \<open>Cardinals versus set operations on arbitrary sets\<close>
   18.27  
   18.28  lemma card_of_set_type[simp]: "|UNIV::'a set| <o |UNIV::'a set set|"
   18.29  using card_of_Pow[of "UNIV::'a set"] by simp
   18.30 @@ -659,7 +659,7 @@
   18.31  by (metis assms ordIso_iff_ordLeq ordLeq_finite_Field)
   18.32  
   18.33  
   18.34 -subsection {* Cardinals versus set operations involving infinite sets *}
   18.35 +subsection \<open>Cardinals versus set operations involving infinite sets\<close>
   18.36  
   18.37  lemma finite_iff_cardOf_nat:
   18.38  "finite A = ( |A| <o |UNIV :: nat set| )"
   18.39 @@ -704,10 +704,10 @@
   18.40  qed
   18.41  
   18.42  
   18.43 -subsection {* Cardinals versus lists *}
   18.44 +subsection \<open>Cardinals versus lists\<close>
   18.45  
   18.46 -text{* The next is an auxiliary operator, which shall be used for inductive
   18.47 -proofs of facts concerning the cardinality of @{text "List"} : *}
   18.48 +text\<open>The next is an auxiliary operator, which shall be used for inductive
   18.49 +proofs of facts concerning the cardinality of \<open>List\<close> :\<close>
   18.50  
   18.51  definition nlists :: "'a set \<Rightarrow> nat \<Rightarrow> 'a list set"
   18.52  where "nlists A n \<equiv> {l. set l \<le> A \<and> length l = n}"
   18.53 @@ -886,7 +886,7 @@
   18.54  using lists_UNIV by auto
   18.55  
   18.56  
   18.57 -subsection {* Cardinals versus the set-of-finite-sets operator *}
   18.58 +subsection \<open>Cardinals versus the set-of-finite-sets operator\<close>
   18.59  
   18.60  definition Fpow :: "'a set \<Rightarrow> 'a set set"
   18.61  where "Fpow A \<equiv> {X. X \<le> A \<and> finite X}"
   18.62 @@ -999,9 +999,9 @@
   18.63  using assms card_of_Fpow_infinite card_of_ordIso by blast
   18.64  
   18.65  
   18.66 -subsection {* The cardinal $\omega$ and the finite cardinals *}
   18.67 +subsection \<open>The cardinal $\omega$ and the finite cardinals\<close>
   18.68  
   18.69 -subsubsection {* First as well-orders *}
   18.70 +subsubsection \<open>First as well-orders\<close>
   18.71  
   18.72  lemma Field_natLess: "Field natLess = (UNIV::nat set)"
   18.73  by(unfold Field_def natLess_def, auto)
   18.74 @@ -1111,7 +1111,7 @@
   18.75  qed
   18.76  
   18.77  
   18.78 -subsubsection {* Then as cardinals *}
   18.79 +subsubsection \<open>Then as cardinals\<close>
   18.80  
   18.81  lemma ordIso_natLeq_infinite1:
   18.82  "|A| =o natLeq \<Longrightarrow> \<not>finite A"
   18.83 @@ -1179,7 +1179,7 @@
   18.84  qed
   18.85  
   18.86  
   18.87 -subsubsection {* "Backward compatibility" with the numeric cardinal operator for finite sets *}
   18.88 +subsubsection \<open>"Backward compatibility" with the numeric cardinal operator for finite sets\<close>
   18.89  
   18.90  lemma finite_card_of_iff_card2:
   18.91  assumes FIN: "finite A" and FIN': "finite B"
   18.92 @@ -1221,7 +1221,7 @@
   18.93  using Field_natLeq_on card_atLeastLessThan by auto
   18.94  
   18.95  
   18.96 -subsection {* The successor of a cardinal *}
   18.97 +subsection \<open>The successor of a cardinal\<close>
   18.98  
   18.99  lemma embed_implies_ordIso_Restr:
  18.100  assumes WELL: "Well_order r" and WELL': "Well_order r'" and EMB: "embed r' r f"
  18.101 @@ -1321,7 +1321,7 @@
  18.102  ordLeq_transitive by metis
  18.103  
  18.104  
  18.105 -subsection {* Others *}
  18.106 +subsection \<open>Others\<close>
  18.107  
  18.108  lemma under_mono[simp]:
  18.109  assumes "Well_order r" and "(i,j) \<in> r"
  18.110 @@ -1575,7 +1575,7 @@
  18.111  using ordLeq_Func[OF B] by (metis A card_of_ordLeq_finite)
  18.112  
  18.113  
  18.114 -subsection {* Infinite cardinals are limit ordinals *}
  18.115 +subsection \<open>Infinite cardinals are limit ordinals\<close>
  18.116  
  18.117  lemma card_order_infinite_isLimOrd:
  18.118  assumes c: "Card_order r" and i: "\<not>finite (Field r)"
  18.119 @@ -1683,7 +1683,7 @@
  18.120  qed
  18.121  
  18.122  
  18.123 -subsection {* Regular vs. stable cardinals *}
  18.124 +subsection \<open>Regular vs. stable cardinals\<close>
  18.125  
  18.126  definition stable :: "'a rel \<Rightarrow> bool"
  18.127  where
  18.128 @@ -1851,9 +1851,9 @@
  18.129  lemma stable_nat: "stable |UNIV::nat set|"
  18.130  using stable_natLeq card_of_nat stable_ordIso by auto
  18.131  
  18.132 -text{* Below, the type of "A" is not important -- we just had to choose an appropriate
  18.133 +text\<open>Below, the type of "A" is not important -- we just had to choose an appropriate
  18.134     type to make "A" possible. What is important is that arbitrarily large
  18.135 -   infinite sets of stable cardinality exist. *}
  18.136 +   infinite sets of stable cardinality exist.\<close>
  18.137  
  18.138  lemma infinite_stable_exists:
  18.139  assumes CARD: "\<forall>r \<in> R. Card_order (r::'a rel)"
    19.1 --- a/src/HOL/Cardinals/Cardinals.thy	Thu May 26 16:57:14 2016 +0200
    19.2 +++ b/src/HOL/Cardinals/Cardinals.thy	Thu May 26 17:51:22 2016 +0200
    19.3 @@ -6,7 +6,7 @@
    19.4  Theory of ordinals and cardinals.
    19.5  *)
    19.6  
    19.7 -section {* Theory of Ordinals and Cardinals *}
    19.8 +section \<open>Theory of Ordinals and Cardinals\<close>
    19.9  
   19.10  theory Cardinals
   19.11  imports Ordinal_Arithmetic Cardinal_Arithmetic Wellorder_Extension
    20.1 --- a/src/HOL/Cardinals/Fun_More.thy	Thu May 26 16:57:14 2016 +0200
    20.2 +++ b/src/HOL/Cardinals/Fun_More.thy	Thu May 26 17:51:22 2016 +0200
    20.3 @@ -5,13 +5,13 @@
    20.4  More on injections, bijections and inverses.
    20.5  *)
    20.6  
    20.7 -section {* More on Injections, Bijections and Inverses *}
    20.8 +section \<open>More on Injections, Bijections and Inverses\<close>
    20.9  
   20.10  theory Fun_More
   20.11  imports Main
   20.12  begin
   20.13  
   20.14 -subsection {* Purely functional properties *}
   20.15 +subsection \<open>Purely functional properties\<close>
   20.16  
   20.17  (* unused *)
   20.18  (*1*)lemma notIn_Un_bij_betw2:
   20.19 @@ -56,7 +56,7 @@
   20.20  qed
   20.21  
   20.22  
   20.23 -subsection {* Properties involving finite and infinite sets *}
   20.24 +subsection \<open>Properties involving finite and infinite sets\<close>
   20.25  
   20.26  (*3*)lemma inj_on_image_Pow:
   20.27  assumes "inj_on f A"
   20.28 @@ -128,7 +128,7 @@
   20.29  qed
   20.30  
   20.31  
   20.32 -subsection {* Properties involving Hilbert choice *}
   20.33 +subsection \<open>Properties involving Hilbert choice\<close>
   20.34  
   20.35  (*1*)lemma bij_betw_inv_into_LEFT:
   20.36  assumes BIJ: "bij_betw f A A'" and SUB: "B \<le> A"
   20.37 @@ -142,7 +142,7 @@
   20.38  using assms bij_betw_inv_into_LEFT[of f A A' B] by fast
   20.39  
   20.40  
   20.41 -subsection {* Other facts *}
   20.42 +subsection \<open>Other facts\<close>
   20.43  
   20.44  (*3*)lemma atLeastLessThan_injective:
   20.45  assumes "{0 ..< m::nat} = {0 ..< n}"
    21.1 --- a/src/HOL/Cardinals/Order_Relation_More.thy	Thu May 26 16:57:14 2016 +0200
    21.2 +++ b/src/HOL/Cardinals/Order_Relation_More.thy	Thu May 26 17:51:22 2016 +0200
    21.3 @@ -5,13 +5,13 @@
    21.4  Basics on order-like relations.
    21.5  *)
    21.6  
    21.7 -section {* Basics on Order-Like Relations *}
    21.8 +section \<open>Basics on Order-Like Relations\<close>
    21.9  
   21.10  theory Order_Relation_More
   21.11  imports Main
   21.12  begin
   21.13  
   21.14 -subsection {* The upper and lower bounds operators *}
   21.15 +subsection \<open>The upper and lower bounds operators\<close>
   21.16  
   21.17  lemma aboveS_subset_above: "aboveS r a \<le> above r a"
   21.18  by(auto simp add: aboveS_def above_def)
   21.19 @@ -572,7 +572,7 @@
   21.20  qed
   21.21  
   21.22  
   21.23 -subsection {* Properties depending on more than one relation *}
   21.24 +subsection \<open>Properties depending on more than one relation\<close>
   21.25  
   21.26  lemma under_incr2:
   21.27  "r \<le> r' \<Longrightarrow> under r a \<le> under r' a"
    22.1 --- a/src/HOL/Cardinals/Order_Union.thy	Thu May 26 16:57:14 2016 +0200
    22.2 +++ b/src/HOL/Cardinals/Order_Union.thy	Thu May 26 17:51:22 2016 +0200
    22.3 @@ -4,7 +4,7 @@
    22.4  The ordinal-like sum of two orders with disjoint fields
    22.5  *)
    22.6  
    22.7 -section {* Order Union *}
    22.8 +section \<open>Order Union\<close>
    22.9  
   22.10  theory Order_Union
   22.11  imports Order_Relation
    23.1 --- a/src/HOL/Cardinals/Ordinal_Arithmetic.thy	Thu May 26 16:57:14 2016 +0200
    23.2 +++ b/src/HOL/Cardinals/Ordinal_Arithmetic.thy	Thu May 26 17:51:22 2016 +0200
    23.3 @@ -5,7 +5,7 @@
    23.4  Ordinal arithmetic.
    23.5  *)
    23.6  
    23.7 -section {* Ordinal Arithmetic *}
    23.8 +section \<open>Ordinal Arithmetic\<close>
    23.9  
   23.10  theory Ordinal_Arithmetic
   23.11  imports Wellorder_Constructions
   23.12 @@ -252,7 +252,7 @@
   23.13    fix B
   23.14    assume *: "B \<subseteq> Field {((x,y1), (x,y2)) . x \<in> A \<and> (y1, y2) \<in> r}" and "B \<noteq> {}"
   23.15    from image_mono[OF *, of snd] have "snd ` B \<subseteq> Field r" unfolding Field_def by force
   23.16 -  with `B \<noteq> {}` obtain x where x: "x \<in> snd ` B" "\<forall>x'\<in>snd ` B. (x', x) \<notin> r"
   23.17 +  with \<open>B \<noteq> {}\<close> obtain x where x: "x \<in> snd ` B" "\<forall>x'\<in>snd ` B. (x', x) \<notin> r"
   23.18      using spec[OF assms[unfolded wf_eq_minimal2], of "snd ` B"] by auto
   23.19    then obtain a where "(a, x) \<in> B" by auto
   23.20    moreover
   23.21 @@ -271,7 +271,7 @@
   23.22    fix B
   23.23    assume *: "B \<subseteq> Field {((x1, y), (x2, y)). (x1, x2) \<in> r \<and> y \<in> A}" and "B \<noteq> {}"
   23.24    from image_mono[OF *, of fst] have "fst ` B \<subseteq> Field r" unfolding Field_def by force
   23.25 -  with `B \<noteq> {}` obtain x where x: "x \<in> fst ` B" "\<forall>x'\<in>fst ` B. (x', x) \<notin> r"
   23.26 +  with \<open>B \<noteq> {}\<close> obtain x where x: "x \<in> fst ` B" "\<forall>x'\<in>fst ` B. (x', x) \<notin> r"
   23.27      using spec[OF assms[unfolded wf_eq_minimal2], of "fst ` B"] by auto
   23.28    then obtain a where "(x, a) \<in> B" by auto
   23.29    moreover
   23.30 @@ -364,9 +364,9 @@
   23.31    (f o Inl) \<in> fin_support z A \<and> (f o Inr) \<in> fin_support z B" (is "?L \<longleftrightarrow> ?R1 \<and> ?R2")
   23.32  proof safe
   23.33    assume ?L
   23.34 -  from `?L` show ?R1 unfolding fin_support_def support_def
   23.35 +  from \<open>?L\<close> show ?R1 unfolding fin_support_def support_def
   23.36      by (fastforce simp: image_iff elim: finite_surj[of _ _ "case_sum id undefined"])
   23.37 -  from `?L` show ?R2 unfolding fin_support_def support_def
   23.38 +  from \<open>?L\<close> show ?R2 unfolding fin_support_def support_def
   23.39      by (fastforce simp: image_iff elim: finite_surj[of _ _ "case_sum undefined id"])
   23.40  next
   23.41    assume ?R1 ?R2
   23.42 @@ -618,7 +618,7 @@
   23.43        show ?thesis
   23.44        proof (cases "?fg = ?gh \<longrightarrow> f ?fg \<noteq> h ?gh")
   23.45          case True
   23.46 -        show ?thesis using max_fun_diff_max2[of f g h, OF True] * `f \<noteq> h` max_fun_diff_in
   23.47 +        show ?thesis using max_fun_diff_max2[of f g h, OF True] * \<open>f \<noteq> h\<close> max_fun_diff_in
   23.48            r.max2_iff[OF FINFUNCD FINFUNCD] r.max2_equals1[OF FINFUNCD FINFUNCD] max_fun_diff_le_eq
   23.49            s.in_notinI[OF disjI1] unfolding oexp_def Let_def s.max2_def mem_Collect_eq by safe metis
   23.50        next
   23.51 @@ -685,10 +685,10 @@
   23.52    show "SUPP f \<noteq> {}"
   23.53    proof (rule ccontr, unfold not_not)
   23.54      assume "SUPP f = {}"
   23.55 -    moreover from `f \<in> F` assms(1) have "f \<in> FINFUNC" by blast
   23.56 +    moreover from \<open>f \<in> F\<close> assms(1) have "f \<in> FINFUNC" by blast
   23.57      ultimately have "f = const"
   23.58        by (auto simp: fun_eq_iff support_def FinFunc_def Func_def const_def)
   23.59 -    with assms(2) `f \<in> F` show False by blast
   23.60 +    with assms(2) \<open>f \<in> F\<close> show False by blast
   23.61    qed
   23.62  qed
   23.63  
   23.64 @@ -787,7 +787,7 @@
   23.65                  and SUPPG: "\<forall>g \<in> G. finite (SUPP g) \<and> SUPP g \<noteq> {} \<and> SUPP g \<subseteq> Field s"
   23.66                  using maxim_isMaxim_support support_not_const by auto
   23.67                define y' where "y' = s.minim {s.maxim (SUPP f) | f. f \<in> G}"
   23.68 -              from G SUPPG maxG `G \<noteq> {}` have y'min: "s.isMinim {s.maxim (SUPP f) | f. f \<in> G} y'"
   23.69 +              from G SUPPG maxG \<open>G \<noteq> {}\<close> have y'min: "s.isMinim {s.maxim (SUPP f) | f. f \<in> G} y'"
   23.70                  unfolding y'_def by (intro s.minim_isMinim) (auto simp: s.isMaxim_def)
   23.71                moreover
   23.72                have "\<forall>g \<in> G. z \<notin> SUPP g" unfolding support_def G_def by auto
   23.73 @@ -804,7 +804,7 @@
   23.74                  unfolding s.isMinim_def s.isMaxim_def by auto
   23.75                with zy have "y' \<noteq> y" "(y', y) \<in> s" using antisymD[OF s.ANTISYM] transD[OF s.TRANS]
   23.76                  by blast+
   23.77 -              moreover from `G \<noteq> {}` have "\<exists>g \<in> G. y' = wo_rel.maxim s (SUPP g)" using y'min
   23.78 +              moreover from \<open>G \<noteq> {}\<close> have "\<exists>g \<in> G. y' = wo_rel.maxim s (SUPP g)" using y'min
   23.79                  by (auto simp: G_def s.isMinim_def)
   23.80                ultimately show ?thesis using mp[OF spec[OF mp[OF spec[OF 1]]], of y' G] G by auto
   23.81              qed simp
   23.82 @@ -1315,8 +1315,8 @@
   23.83      fix g h assume gh: "g \<in> FinFunc r s" "h \<in> FinFunc r s" "F g \<noteq> F h"
   23.84        "let m = s.max_fun_diff g h in (g m, h m) \<in> r"
   23.85      hence "g \<noteq> h" by auto
   23.86 -    note max_fun_diff_in = rs.max_fun_diff_in[OF `g \<noteq> h` gh(1,2)]
   23.87 -    and max_fun_diff_max = rs.max_fun_diff_max[OF `g \<noteq> h` gh(1,2)]
   23.88 +    note max_fun_diff_in = rs.max_fun_diff_in[OF \<open>g \<noteq> h\<close> gh(1,2)]
   23.89 +    and max_fun_diff_max = rs.max_fun_diff_max[OF \<open>g \<noteq> h\<close> gh(1,2)]
   23.90      with *(4) invff *(2) have "t.max_fun_diff (F g) (F h) = f (s.max_fun_diff g h)"
   23.91        unfolding t.max_fun_diff_def compat_def
   23.92        by (intro t.maxim_equality) (auto simp: t.isMaxim_def F_def dest: injfD)
   23.93 @@ -1401,14 +1401,14 @@
   23.94    next
   23.95      case False thus ?thesis
   23.96      proof (cases "r = {}")
   23.97 -      case True thus ?thesis using t `t \<noteq> {}` st.oexp_Well_order ozero_ordLeq[unfolded ozero_def]
   23.98 +      case True thus ?thesis using t \<open>t \<noteq> {}\<close> st.oexp_Well_order ozero_ordLeq[unfolded ozero_def]
   23.99          by auto
  23.100      next
  23.101        case False
  23.102        from assms obtain f where f: "embed r s f" unfolding ordLeq_def by blast
  23.103        hence f_underS: "\<forall>a\<in>Field r. f a \<in> Field s \<and> f ` underS r a \<subseteq> underS s (f a)"
  23.104          using embed_in_Field[OF rt.rWELL f] embed_underS2[OF rt.rWELL st.rWELL f] by auto
  23.105 -      from f `t \<noteq> {}` False have *: "Field r \<noteq> {}" "Field s \<noteq> {}" "Field t \<noteq> {}"
  23.106 +      from f \<open>t \<noteq> {}\<close> False have *: "Field r \<noteq> {}" "Field s \<noteq> {}" "Field t \<noteq> {}"
  23.107          unfolding Field_def embed_def under_def bij_betw_def by auto
  23.108        with f obtain x where "s.zero = f x" "x \<in> Field r" unfolding embed_def bij_betw_def
  23.109          using embed_in_Field[OF r.WELL f] s.zero_under set_mp[OF under_Field[of r]] by blast
  23.110 @@ -1435,11 +1435,11 @@
  23.111              by simp metis
  23.112            moreover
  23.113            with hg have "t.max_fun_diff (?f h) (?f g) = t.max_fun_diff h g" unfolding rt.oexp_def
  23.114 -            using rt.max_fun_diff[OF `h \<noteq> g`] rt.max_fun_diff_in[OF `h \<noteq> g`]
  23.115 +            using rt.max_fun_diff[OF \<open>h \<noteq> g\<close>] rt.max_fun_diff_in[OF \<open>h \<noteq> g\<close>]
  23.116              by (subst t.max_fun_diff_def, intro t.maxim_equality)
  23.117                (auto simp: t.isMaxim_def intro: inj_onD[OF inj] intro!: rt.max_fun_diff_max)
  23.118            with Field_fg Field_fh hg fz f_underS compat neq have "(?f h, ?f g) \<in> st.oexp"
  23.119 -             using rt.max_fun_diff[OF `h \<noteq> g`] rt.max_fun_diff_in[OF `h \<noteq> g`] unfolding st.Field_oexp
  23.120 +             using rt.max_fun_diff[OF \<open>h \<noteq> g\<close>] rt.max_fun_diff_in[OF \<open>h \<noteq> g\<close>] unfolding st.Field_oexp
  23.121               unfolding rt.oexp_def st.oexp_def Let_def compat_def by auto
  23.122            ultimately show "?f h \<in> underS (s ^o t) (?f g)" unfolding underS_def by auto
  23.123          qed
  23.124 @@ -1497,9 +1497,9 @@
  23.125    (is "?L = (?R1 \<and> ?R2)")
  23.126  proof safe
  23.127    assume ?L
  23.128 -  from `?L` show ?R1 unfolding FinFunc_def Field_osum Func_def Int_iff fin_support_Field_osum o_def
  23.129 +  from \<open>?L\<close> show ?R1 unfolding FinFunc_def Field_osum Func_def Int_iff fin_support_Field_osum o_def
  23.130      by (auto split: sum.splits)
  23.131 -  from `?L` show ?R2 unfolding FinFunc_def Field_osum Func_def Int_iff fin_support_Field_osum o_def
  23.132 +  from \<open>?L\<close> show ?R2 unfolding FinFunc_def Field_osum Func_def Int_iff fin_support_Field_osum o_def
  23.133      by (auto split: sum.splits)
  23.134  next
  23.135    assume ?R1 ?R2
  23.136 @@ -1674,14 +1674,14 @@
  23.137    interpret rst: wo_rel2 "r ^o s" t by unfold_locales (rule oexp_Well_order[OF r s], rule t)
  23.138    show ?thesis
  23.139    proof (cases "s = {} \<or> t = {}")
  23.140 -    case True with `r = {}` show ?thesis
  23.141 +    case True with \<open>r = {}\<close> show ?thesis
  23.142        by (auto simp: oexp_empty[OF oexp_Well_order[OF Well_order_empty s]]
  23.143          intro!: ordIso_transitive[OF ordIso_symmetric[OF oone_ordIso] oone_ordIso]
  23.144            ordIso_transitive[OF oone_ordIso_oexp[OF ordIso_symmetric[OF oone_ordIso] t] oone_ordIso])
  23.145    next
  23.146       case False
  23.147       moreover hence "s *o t \<noteq> {}" unfolding oprod_def Field_def by fastforce
  23.148 -     ultimately show ?thesis using `r = {}` ozero_ordIso
  23.149 +     ultimately show ?thesis using \<open>r = {}\<close> ozero_ordIso
  23.150         by (auto simp add: s t oprod_Well_order ozero_def)
  23.151    qed
  23.152  next
    24.1 --- a/src/HOL/Cardinals/Wellfounded_More.thy	Thu May 26 16:57:14 2016 +0200
    24.2 +++ b/src/HOL/Cardinals/Wellfounded_More.thy	Thu May 26 17:51:22 2016 +0200
    24.3 @@ -5,13 +5,13 @@
    24.4  More on well-founded relations.
    24.5  *)
    24.6  
    24.7 -section {* More on Well-Founded Relations *}
    24.8 +section \<open>More on Well-Founded Relations\<close>
    24.9  
   24.10  theory Wellfounded_More
   24.11  imports Wellfounded Order_Relation_More
   24.12  begin
   24.13  
   24.14 -subsection {* Well-founded recursion via genuine fixpoints *}
   24.15 +subsection \<open>Well-founded recursion via genuine fixpoints\<close>
   24.16  
   24.17  (*2*)lemma adm_wf_unique_fixpoint:
   24.18  fixes r :: "('a * 'a) set" and
    25.1 --- a/src/HOL/Cardinals/Wellorder_Constructions.thy	Thu May 26 16:57:14 2016 +0200
    25.2 +++ b/src/HOL/Cardinals/Wellorder_Constructions.thy	Thu May 26 17:51:22 2016 +0200
    25.3 @@ -5,7 +5,7 @@
    25.4  Constructions on wellorders.
    25.5  *)
    25.6  
    25.7 -section {* Constructions on Wellorders *}
    25.8 +section \<open>Constructions on Wellorders\<close>
    25.9  
   25.10  theory Wellorder_Constructions
   25.11  imports
   25.12 @@ -23,7 +23,7 @@
   25.13  lemma Func_emp2[simp]: "A \<noteq> {} \<Longrightarrow> Func A {} = {}" by auto
   25.14  
   25.15  
   25.16 -subsection {* Restriction to a set *}
   25.17 +subsection \<open>Restriction to a set\<close>
   25.18  
   25.19  lemma Restr_incr2:
   25.20  "r <= r' \<Longrightarrow> Restr r A <= Restr r' A"
   25.21 @@ -55,7 +55,7 @@
   25.22  by blast
   25.23  
   25.24  
   25.25 -subsection {* Order filters versus restrictions and embeddings *}
   25.26 +subsection \<open>Order filters versus restrictions and embeddings\<close>
   25.27  
   25.28  lemma ofilter_Restr:
   25.29  assumes WELL: "Well_order r" and
   25.30 @@ -92,7 +92,7 @@
   25.31  by (auto simp add: ofilter_subset_embedS_iso)
   25.32  
   25.33  
   25.34 -subsection {* Ordering the well-orders by existence of embeddings *}
   25.35 +subsection \<open>Ordering the well-orders by existence of embeddings\<close>
   25.36  
   25.37  corollary ordLeq_refl_on: "refl_on {r. Well_order r} ordLeq"
   25.38  using ordLeq_reflexive unfolding ordLeq_def refl_on_def
   25.39 @@ -169,7 +169,7 @@
   25.40  by (auto simp add: ofilter_ordLeq wo_rel.under_ofilter wo_rel_def)
   25.41  
   25.42  
   25.43 -subsection {* Copy via direct images *}
   25.44 +subsection \<open>Copy via direct images\<close>
   25.45  
   25.46  lemma Id_dir_image: "dir_image Id f \<le> Id"
   25.47  unfolding dir_image_def by auto
   25.48 @@ -275,9 +275,9 @@
   25.49  qed
   25.50  
   25.51  
   25.52 -subsection {* The maxim among a finite set of ordinals *}
   25.53 +subsection \<open>The maxim among a finite set of ordinals\<close>
   25.54  
   25.55 -text {* The correct phrasing would be ``a maxim of ...", as @{text "\<le>o"} is only a preorder. *}
   25.56 +text \<open>The correct phrasing would be ``a maxim of ...", as \<open>\<le>o\<close> is only a preorder.\<close>
   25.57  
   25.58  definition isOmax :: "'a rel set \<Rightarrow> 'a rel \<Rightarrow> bool"
   25.59  where
   25.60 @@ -437,7 +437,7 @@
   25.61  qed
   25.62  
   25.63  
   25.64 -subsection {* Limit and succesor ordinals *}
   25.65 +subsection \<open>Limit and succesor ordinals\<close>
   25.66  
   25.67  lemma embed_underS2:
   25.68  assumes r: "Well_order r" and s: "Well_order s"  and g: "embed r s g" and a: "a \<in> Field r"
   25.69 @@ -548,7 +548,7 @@
   25.70    by (elim cases_Total3 disjE) (auto elim: cases_Total3 intro!: assms simp: Field_def)
   25.71  qed
   25.72  
   25.73 -subsubsection {* Successor and limit elements of an ordinal *}
   25.74 +subsubsection \<open>Successor and limit elements of an ordinal\<close>
   25.75  
   25.76  definition "succ i \<equiv> suc {i}"
   25.77  
   25.78 @@ -724,7 +724,7 @@
   25.79   else L f i"
   25.80  
   25.81  
   25.82 -subsubsection {* Well-order recursion with (zero), succesor, and limit *}
   25.83 +subsubsection \<open>Well-order recursion with (zero), succesor, and limit\<close>
   25.84  
   25.85  definition worecSL :: "('a \<Rightarrow> 'b \<Rightarrow> 'b) \<Rightarrow> (('a \<Rightarrow> 'b) \<Rightarrow> 'a \<Rightarrow> 'b) \<Rightarrow> 'a \<Rightarrow> 'b"
   25.86  where "worecSL S L \<equiv> worec (mergeSL S L)"
   25.87 @@ -819,7 +819,7 @@
   25.88  qed
   25.89  
   25.90  
   25.91 -subsubsection {* Well-order succ-lim induction *}
   25.92 +subsubsection \<open>Well-order succ-lim induction\<close>
   25.93  
   25.94  lemma ord_cases:
   25.95  obtains j where "i = succ j" and "aboveS j \<noteq> {}"  | "isLim i"
   25.96 @@ -901,7 +901,7 @@
   25.97  abbreviation "worecZSL \<equiv> wo_rel.worecZSL"
   25.98  
   25.99  
  25.100 -subsection {* Projections of wellorders *}
  25.101 +subsection \<open>Projections of wellorders\<close>
  25.102  
  25.103  definition "oproj r s f \<equiv> Field s \<subseteq> f ` (Field r) \<and> compat r s f"
  25.104  
  25.105 @@ -1018,7 +1018,7 @@
  25.106           fix b1 assume "b1 \<in> g ` underS r a"
  25.107           then obtain a1 where a1: "b1 = g a1" and a1: "a1 \<in> underS r a" by auto
  25.108           hence "b1 \<in> underS s (f a)"
  25.109 -         using a by (metis `\<And>a1. a1 \<in> underS r a \<Longrightarrow> g a1 \<in> underS s (f a)`)
  25.110 +         using a by (metis \<open>\<And>a1. a1 \<in> underS r a \<Longrightarrow> g a1 \<in> underS s (f a)\<close>)
  25.111           thus "f a \<noteq> b1 \<and> (b1, f a) \<in> s" unfolding underS_def by auto
  25.112         qed(insert fa, auto)
  25.113         thus "g a \<in> under s (f a)" unfolding under_def by auto
  25.114 @@ -1061,7 +1061,7 @@
  25.115        by (auto dest!: oproj_Field2[OF f] inv_into_injective intro!: inv_into_into)
  25.116      ultimately have "(inv_into (Field r) f b, inv_into (Field r) f a) \<in> r"
  25.117        using r by (auto simp: well_order_on_def linear_order_on_def total_on_def)
  25.118 -    with f[unfolded oproj_def compat_def] *(1) `a \<in> Field s`
  25.119 +    with f[unfolded oproj_def compat_def] *(1) \<open>a \<in> Field s\<close>
  25.120        f_inv_into_f[of b f "Field r"] f_inv_into_f[of a f "Field r"]
  25.121        have "(b, a) \<in> s" by (metis in_mono)
  25.122      with *(2,3) s have False
    26.1 --- a/src/HOL/Cardinals/Wellorder_Embedding.thy	Thu May 26 16:57:14 2016 +0200
    26.2 +++ b/src/HOL/Cardinals/Wellorder_Embedding.thy	Thu May 26 17:51:22 2016 +0200
    26.3 @@ -5,13 +5,13 @@
    26.4  Well-order embeddings.
    26.5  *)
    26.6  
    26.7 -section {* Well-Order Embeddings *}
    26.8 +section \<open>Well-Order Embeddings\<close>
    26.9  
   26.10  theory Wellorder_Embedding
   26.11  imports BNF_Wellorder_Embedding Fun_More Wellorder_Relation
   26.12  begin
   26.13  
   26.14 -subsection {* Auxiliaries *}
   26.15 +subsection \<open>Auxiliaries\<close>
   26.16  
   26.17  lemma UNION_bij_betw_ofilter:
   26.18  assumes WELL: "Well_order r" and
   26.19 @@ -27,8 +27,8 @@
   26.20  qed
   26.21  
   26.22  
   26.23 -subsection {* (Well-order) embeddings, strict embeddings, isomorphisms and order-compatible
   26.24 -functions *}
   26.25 +subsection \<open>(Well-order) embeddings, strict embeddings, isomorphisms and order-compatible
   26.26 +functions\<close>
   26.27  
   26.28  lemma embed_halfcong:
   26.29  assumes EQ: "\<And> a. a \<in> Field r \<Longrightarrow> f a = g a" and
   26.30 @@ -103,7 +103,7 @@
   26.31  using one_set_greater[of UNIV UNIV] by auto
   26.32  
   26.33  
   26.34 -subsection {* Uniqueness of embeddings *}
   26.35 +subsection \<open>Uniqueness of embeddings\<close>
   26.36  
   26.37  lemma comp_embedS:
   26.38  assumes WELL: "Well_order r" and WELL': "Well_order r'" and WELL'': "Well_order r''"
    27.1 --- a/src/HOL/Cardinals/Wellorder_Extension.thy	Thu May 26 16:57:14 2016 +0200
    27.2 +++ b/src/HOL/Cardinals/Wellorder_Extension.thy	Thu May 26 17:51:22 2016 +0200
    27.3 @@ -2,16 +2,16 @@
    27.4      Author:     Christian Sternagel, JAIST
    27.5  *)
    27.6  
    27.7 -section {* Extending Well-founded Relations to Wellorders *}
    27.8 +section \<open>Extending Well-founded Relations to Wellorders\<close>
    27.9  
   27.10  theory Wellorder_Extension
   27.11  imports Main Order_Union
   27.12  begin
   27.13  
   27.14 -subsection {* Extending Well-founded Relations to Wellorders *}
   27.15 +subsection \<open>Extending Well-founded Relations to Wellorders\<close>
   27.16  
   27.17 -text {*A \emph{downset} (also lower set, decreasing set, initial segment, or
   27.18 -downward closed set) is closed w.r.t.\ smaller elements.*}
   27.19 +text \<open>A \emph{downset} (also lower set, decreasing set, initial segment, or
   27.20 +downward closed set) is closed w.r.t.\ smaller elements.\<close>
   27.21  definition downset_on where
   27.22    "downset_on A r = (\<forall>x y. (x, y) \<in> r \<and> y \<in> A \<longrightarrow> x \<in> A)"
   27.23  
   27.24 @@ -30,7 +30,7 @@
   27.25    "downset_on A r \<Longrightarrow> (x, y) \<in> r \<Longrightarrow> y \<in> A \<Longrightarrow> x \<in> A"
   27.26    unfolding downset_on_def by blast
   27.27  
   27.28 -text {*Extensions of relations w.r.t.\ a given set.*}
   27.29 +text \<open>Extensions of relations w.r.t.\ a given set.\<close>
   27.30  definition extension_on where
   27.31    "extension_on A r s = (\<forall>x\<in>A. \<forall>y\<in>A. (x, y) \<in> s \<longrightarrow> (x, y) \<in> r)"
   27.32  
   27.33 @@ -60,7 +60,7 @@
   27.34  lemma extension_on_empty [simp]: "extension_on {} p q"
   27.35    by (auto simp: extension_on_def)
   27.36  
   27.37 -text {*Every well-founded relation can be extended to a wellorder.*}
   27.38 +text \<open>Every well-founded relation can be extended to a wellorder.\<close>
   27.39  theorem well_order_extension:
   27.40    assumes "wf p"
   27.41    shows "\<exists>w. p \<subseteq> w \<and> Well_order w"
   27.42 @@ -79,39 +79,39 @@
   27.43        trans_def I_def elim: trans_init_seg_of)
   27.44    { fix R assume "R \<in> Chains I"
   27.45      then have Ris: "R \<in> Chains init_seg_of" using mono_Chains [OF I_init] by blast
   27.46 -    have subch: "chain\<^sub>\<subseteq> R" using `R \<in> Chains I` I_init
   27.47 +    have subch: "chain\<^sub>\<subseteq> R" using \<open>R \<in> Chains I\<close> I_init
   27.48        by (auto simp: init_seg_of_def chain_subset_def Chains_def)
   27.49      have "\<forall>r\<in>R. Refl r" and "\<forall>r\<in>R. trans r" and "\<forall>r\<in>R. antisym r" and
   27.50        "\<forall>r\<in>R. Total r" and "\<forall>r\<in>R. wf (r - Id)" and
   27.51        "\<And>r. r \<in> R \<Longrightarrow> downset_on (Field r) p" and
   27.52        "\<And>r. r \<in> R \<Longrightarrow> extension_on (Field r) r p"
   27.53 -      using Chains_wo [OF `R \<in> Chains I`] by (simp_all add: order_on_defs)
   27.54 -    have "Refl (\<Union>R)" using `\<forall>r\<in>R. Refl r`  unfolding refl_on_def by fastforce
   27.55 +      using Chains_wo [OF \<open>R \<in> Chains I\<close>] by (simp_all add: order_on_defs)
   27.56 +    have "Refl (\<Union>R)" using \<open>\<forall>r\<in>R. Refl r\<close>  unfolding refl_on_def by fastforce
   27.57      moreover have "trans (\<Union>R)"
   27.58 -      by (rule chain_subset_trans_Union [OF subch `\<forall>r\<in>R. trans r`])
   27.59 +      by (rule chain_subset_trans_Union [OF subch \<open>\<forall>r\<in>R. trans r\<close>])
   27.60      moreover have "antisym (\<Union>R)"
   27.61 -      by (rule chain_subset_antisym_Union [OF subch `\<forall>r\<in>R. antisym r`])
   27.62 +      by (rule chain_subset_antisym_Union [OF subch \<open>\<forall>r\<in>R. antisym r\<close>])
   27.63      moreover have "Total (\<Union>R)"
   27.64 -      by (rule chain_subset_Total_Union [OF subch `\<forall>r\<in>R. Total r`])
   27.65 +      by (rule chain_subset_Total_Union [OF subch \<open>\<forall>r\<in>R. Total r\<close>])
   27.66      moreover have "wf ((\<Union>R) - Id)"
   27.67      proof -
   27.68        have "(\<Union>R) - Id = \<Union>{r - Id | r. r \<in> R}" by blast
   27.69 -      with `\<forall>r\<in>R. wf (r - Id)` wf_Union_wf_init_segs [OF Chains_inits_DiffI [OF Ris]]
   27.70 +      with \<open>\<forall>r\<in>R. wf (r - Id)\<close> wf_Union_wf_init_segs [OF Chains_inits_DiffI [OF Ris]]
   27.71        show ?thesis by fastforce
   27.72      qed
   27.73      ultimately have "Well_order (\<Union>R)" by (simp add: order_on_defs)
   27.74      moreover have "\<forall>r\<in>R. r initial_segment_of \<Union>R" using Ris
   27.75        by (simp add: Chains_init_seg_of_Union)
   27.76      moreover have "downset_on (Field (\<Union>R)) p"
   27.77 -      by (rule downset_on_Union [OF `\<And>r. r \<in> R \<Longrightarrow> downset_on (Field r) p`])
   27.78 +      by (rule downset_on_Union [OF \<open>\<And>r. r \<in> R \<Longrightarrow> downset_on (Field r) p\<close>])
   27.79      moreover have "extension_on (Field (\<Union>R)) (\<Union>R) p"
   27.80 -      by (rule chain_subset_extension_on_Union [OF subch `\<And>r. r \<in> R \<Longrightarrow> extension_on (Field r) r p`])
   27.81 +      by (rule chain_subset_extension_on_Union [OF subch \<open>\<And>r. r \<in> R \<Longrightarrow> extension_on (Field r) r p\<close>])
   27.82      ultimately have "\<Union>R \<in> ?K \<and> (\<forall>r\<in>R. (r,\<Union>R) \<in> I)"
   27.83 -      using mono_Chains [OF I_init] and `R \<in> Chains I`
   27.84 +      using mono_Chains [OF I_init] and \<open>R \<in> Chains I\<close>
   27.85        by (simp (no_asm) add: I_def del: Field_Union) (metis Chains_wo)
   27.86    }
   27.87    then have 1: "\<forall>R\<in>Chains I. \<exists>u\<in>Field I. \<forall>r\<in>R. (r, u) \<in> I" by (subst FI) blast
   27.88 -  txt {*Zorn's Lemma yields a maximal wellorder m.*}
   27.89 +  txt \<open>Zorn's Lemma yields a maximal wellorder m.\<close>
   27.90    from Zorns_po_lemma [OF 0 1] obtain m :: "('a \<times> 'a) set"
   27.91      where "Well_order m" and "downset_on (Field m) p" and "extension_on (Field m) m p" and
   27.92      max: "\<forall>r. Well_order r \<and> downset_on (Field r) p \<and> extension_on (Field r) r p \<and>
   27.93 @@ -124,52 +124,52 @@
   27.94      with assms [unfolded wf_eq_minimal, THEN spec, of ?Q]
   27.95        obtain x where "x \<in> Field p" and "x \<notin> Field m" and
   27.96        min: "\<forall>y. (y, x) \<in> p \<longrightarrow> y \<notin> ?Q" by blast
   27.97 -    txt {*Add @{term x} as topmost element to @{term m}.*}
   27.98 +    txt \<open>Add @{term x} as topmost element to @{term m}.\<close>
   27.99      let ?s = "{(y, x) | y. y \<in> Field m}"
  27.100      let ?m = "insert (x, x) m \<union> ?s"
  27.101      have Fm: "Field ?m = insert x (Field m)" by (auto simp: Field_def)
  27.102      have "Refl m" and "trans m" and "antisym m" and "Total m" and "wf (m - Id)"
  27.103 -      using `Well_order m` by (simp_all add: order_on_defs)
  27.104 -    txt {*We show that the extension is a wellorder.*}
  27.105 -    have "Refl ?m" using `Refl m` Fm by (auto simp: refl_on_def)
  27.106 -    moreover have "trans ?m" using `trans m` `x \<notin> Field m`
  27.107 +      using \<open>Well_order m\<close> by (simp_all add: order_on_defs)
  27.108 +    txt \<open>We show that the extension is a wellorder.\<close>
  27.109 +    have "Refl ?m" using \<open>Refl m\<close> Fm by (auto simp: refl_on_def)
  27.110 +    moreover have "trans ?m" using \<open>trans m\<close> \<open>x \<notin> Field m\<close>
  27.111        unfolding trans_def Field_def Domain_unfold Domain_converse [symmetric] by blast
  27.112 -    moreover have "antisym ?m" using `antisym m` `x \<notin> Field m`
  27.113 +    moreover have "antisym ?m" using \<open>antisym m\<close> \<open>x \<notin> Field m\<close>
  27.114        unfolding antisym_def Field_def Domain_unfold Domain_converse [symmetric] by blast
  27.115 -    moreover have "Total ?m" using `Total m` Fm by (auto simp: Relation.total_on_def)
  27.116 +    moreover have "Total ?m" using \<open>Total m\<close> Fm by (auto simp: Relation.total_on_def)
  27.117      moreover have "wf (?m - Id)"
  27.118      proof -
  27.119 -      have "wf ?s" using `x \<notin> Field m`
  27.120 +      have "wf ?s" using \<open>x \<notin> Field m\<close>
  27.121          by (simp add: wf_eq_minimal Field_def Domain_unfold Domain_converse [symmetric]) metis
  27.122 -      thus ?thesis using `wf (m - Id)` `x \<notin> Field m`
  27.123 -        wf_subset [OF `wf ?s` Diff_subset]
  27.124 +      thus ?thesis using \<open>wf (m - Id)\<close> \<open>x \<notin> Field m\<close>
  27.125 +        wf_subset [OF \<open>wf ?s\<close> Diff_subset]
  27.126          by (fastforce intro!: wf_Un simp add: Un_Diff Field_def)
  27.127      qed
  27.128      ultimately have "Well_order ?m" by (simp add: order_on_defs)
  27.129      moreover have "extension_on (Field ?m) ?m p"
  27.130 -      using `extension_on (Field m) m p` `downset_on (Field m) p`
  27.131 +      using \<open>extension_on (Field m) m p\<close> \<open>downset_on (Field m) p\<close>
  27.132        by (subst Fm) (auto simp: extension_on_def dest: downset_onD)
  27.133      moreover have "downset_on (Field ?m) p"
  27.134        apply (subst Fm)
  27.135 -      using `downset_on (Field m) p` and min
  27.136 +      using \<open>downset_on (Field m) p\<close> and min
  27.137        unfolding downset_on_def Field_def by blast
  27.138      moreover have "(m, ?m) \<in> I"
  27.139 -      using `Well_order m` and `Well_order ?m` and
  27.140 -      `downset_on (Field m) p` and `downset_on (Field ?m) p` and
  27.141 -      `extension_on (Field m) m p` and `extension_on (Field ?m) ?m p` and
  27.142 -      `Refl m` and `x \<notin> Field m`
  27.143 +      using \<open>Well_order m\<close> and \<open>Well_order ?m\<close> and
  27.144 +      \<open>downset_on (Field m) p\<close> and \<open>downset_on (Field ?m) p\<close> and
  27.145 +      \<open>extension_on (Field m) m p\<close> and \<open>extension_on (Field ?m) ?m p\<close> and
  27.146 +      \<open>Refl m\<close> and \<open>x \<notin> Field m\<close>
  27.147        by (auto simp: I_def init_seg_of_def refl_on_def)
  27.148      ultimately
  27.149 -    --{*This contradicts maximality of m:*}
  27.150 -    show False using max and `x \<notin> Field m` unfolding Field_def by blast
  27.151 +    \<comment>\<open>This contradicts maximality of m:\<close>
  27.152 +    show False using max and \<open>x \<notin> Field m\<close> unfolding Field_def by blast
  27.153    qed
  27.154    have "p \<subseteq> m"
  27.155 -    using `Field p \<subseteq> Field m` and `extension_on (Field m) m p`
  27.156 +    using \<open>Field p \<subseteq> Field m\<close> and \<open>extension_on (Field m) m p\<close>
  27.157      unfolding Field_def extension_on_def by auto fast
  27.158 -  with `Well_order m` show ?thesis by blast
  27.159 +  with \<open>Well_order m\<close> show ?thesis by blast
  27.160  qed
  27.161  
  27.162 -text {*Every well-founded relation can be extended to a total wellorder.*}
  27.163 +text \<open>Every well-founded relation can be extended to a total wellorder.\<close>
  27.164  corollary total_well_order_extension:
  27.165    assumes "wf p"
  27.166    shows "\<exists>w. p \<subseteq> w \<and> Well_order w \<and> Field w = UNIV"
  27.167 @@ -181,7 +181,7 @@
  27.168    have [simp]: "Field w' = ?A" using well_order_on_Well_order [OF wo'] by simp
  27.169    have *: "Field w \<inter> Field w' = {}" by simp
  27.170    let ?w = "w \<union>o w'"
  27.171 -  have "p \<subseteq> ?w" using `p \<subseteq> w` by (auto simp: Osum_def)
  27.172 +  have "p \<subseteq> ?w" using \<open>p \<subseteq> w\<close> by (auto simp: Osum_def)
  27.173    moreover have "Well_order ?w" using Osum_Well_order [OF * wo] and wo' by simp
  27.174    moreover have "Field ?w = UNIV" by (simp add: Field_Osum)
  27.175    ultimately show ?thesis by blast
  27.176 @@ -191,23 +191,23 @@
  27.177    assumes "wf p" and "Field p \<subseteq> A"
  27.178    shows "\<exists>w. p \<subseteq> w \<and> well_order_on A w"
  27.179  proof -
  27.180 -  from total_well_order_extension [OF `wf p`] obtain r
  27.181 +  from total_well_order_extension [OF \<open>wf p\<close>] obtain r
  27.182      where "p \<subseteq> r" and wo: "Well_order r" and univ: "Field r = UNIV" by blast
  27.183    let ?r = "{(x, y). x \<in> A \<and> y \<in> A \<and> (x, y) \<in> r}"
  27.184 -  from `p \<subseteq> r` have "p \<subseteq> ?r" using `Field p \<subseteq> A` by (auto simp: Field_def)
  27.185 +  from \<open>p \<subseteq> r\<close> have "p \<subseteq> ?r" using \<open>Field p \<subseteq> A\<close> by (auto simp: Field_def)
  27.186    have 1: "Field ?r = A" using wo univ
  27.187      by (fastforce simp: Field_def order_on_defs refl_on_def)
  27.188    have "Refl r" "trans r" "antisym r" "Total r" "wf (r - Id)"
  27.189 -    using `Well_order r` by (simp_all add: order_on_defs)
  27.190 -  have "refl_on A ?r" using `Refl r` by (auto simp: refl_on_def univ)
  27.191 -  moreover have "trans ?r" using `trans r`
  27.192 +    using \<open>Well_order r\<close> by (simp_all add: order_on_defs)
  27.193 +  have "refl_on A ?r" using \<open>Refl r\<close> by (auto simp: refl_on_def univ)
  27.194 +  moreover have "trans ?r" using \<open>trans r\<close>
  27.195      unfolding trans_def by blast
  27.196 -  moreover have "antisym ?r" using `antisym r`
  27.197 +  moreover have "antisym ?r" using \<open>antisym r\<close>
  27.198      unfolding antisym_def by blast
  27.199 -  moreover have "total_on A ?r" using `Total r` by (simp add: total_on_def univ)
  27.200 -  moreover have "wf (?r - Id)" by (rule wf_subset [OF `wf(r - Id)`]) blast
  27.201 +  moreover have "total_on A ?r" using \<open>Total r\<close> by (simp add: total_on_def univ)
  27.202 +  moreover have "wf (?r - Id)" by (rule wf_subset [OF \<open>wf(r - Id)\<close>]) blast
  27.203    ultimately have "well_order_on A ?r" by (simp add: order_on_defs)
  27.204 -  with `p \<subseteq> ?r` show ?thesis by blast
  27.205 +  with \<open>p \<subseteq> ?r\<close> show ?thesis by blast
  27.206  qed
  27.207  
  27.208  end
    28.1 --- a/src/HOL/Cardinals/Wellorder_Relation.thy	Thu May 26 16:57:14 2016 +0200
    28.2 +++ b/src/HOL/Cardinals/Wellorder_Relation.thy	Thu May 26 17:51:22 2016 +0200
    28.3 @@ -5,7 +5,7 @@
    28.4  Well-order relations.
    28.5  *)
    28.6  
    28.7 -section {* Well-Order Relations *}
    28.8 +section \<open>Well-Order Relations\<close>
    28.9  
   28.10  theory Wellorder_Relation
   28.11  imports BNF_Wellorder_Relation Wellfounded_More
   28.12 @@ -14,7 +14,7 @@
   28.13  context wo_rel
   28.14  begin
   28.15  
   28.16 -subsection {* Auxiliaries *}
   28.17 +subsection \<open>Auxiliaries\<close>
   28.18  
   28.19  lemma PREORD: "Preorder r"
   28.20  using WELL order_on_defs[of _ r] by auto
   28.21 @@ -29,7 +29,7 @@
   28.22  using TOTALS by auto
   28.23  
   28.24  
   28.25 -subsection {* Well-founded induction and recursion adapted to non-strict well-order relations *}
   28.26 +subsection \<open>Well-founded induction and recursion adapted to non-strict well-order relations\<close>
   28.27  
   28.28  lemma worec_unique_fixpoint:
   28.29  assumes ADM: "adm_wo H" and fp: "f = H f"
   28.30 @@ -44,7 +44,7 @@
   28.31  qed
   28.32  
   28.33  
   28.34 -subsubsection {* Properties of max2 *}
   28.35 +subsubsection \<open>Properties of max2\<close>
   28.36  
   28.37  lemma max2_iff:
   28.38  assumes "a \<in> Field r" and "b \<in> Field r"
   28.39 @@ -60,7 +60,7 @@
   28.40  qed
   28.41  
   28.42  
   28.43 -subsubsection {* Properties of minim *}
   28.44 +subsubsection \<open>Properties of minim\<close>
   28.45  
   28.46  lemma minim_Under:
   28.47  "\<lbrakk>B \<le> Field r; B \<noteq> {}\<rbrakk> \<Longrightarrow> minim B \<in> Under B"
   28.48 @@ -166,7 +166,7 @@
   28.49  qed
   28.50  
   28.51  
   28.52 -subsubsection {* Properties of supr *}
   28.53 +subsubsection \<open>Properties of supr\<close>
   28.54  
   28.55  lemma supr_Above:
   28.56  assumes SUB: "B \<le> Field r" and ABOVE: "Above B \<noteq> {}"
   28.57 @@ -287,7 +287,7 @@
   28.58  qed
   28.59  
   28.60  
   28.61 -subsubsection {* Properties of successor *}
   28.62 +subsubsection \<open>Properties of successor\<close>
   28.63  
   28.64  lemma suc_least:
   28.65  "\<lbrakk>B \<le> Field r; a \<in> Field r; (\<And> b. b \<in> B \<Longrightarrow> a \<noteq> b \<and> (b,a) \<in> r)\<rbrakk>
   28.66 @@ -400,7 +400,7 @@
   28.67  qed
   28.68  
   28.69  
   28.70 -subsubsection {* Properties of order filters *}
   28.71 +subsubsection \<open>Properties of order filters\<close>
   28.72  
   28.73  lemma ofilter_Under[simp]:
   28.74  assumes "A \<le> Field r"
   28.75 @@ -453,7 +453,7 @@
   28.76  using ofilter_under_UNION [of A] by auto
   28.77  
   28.78  
   28.79 -subsubsection {* Other properties *}
   28.80 +subsubsection \<open>Other properties\<close>
   28.81  
   28.82  lemma Trans_Under_regressive:
   28.83  assumes NE: "A \<noteq> {}" and SUB: "A \<le> Field r"
    29.1 --- a/src/HOL/Codegenerator_Test/Candidates.thy	Thu May 26 16:57:14 2016 +0200
    29.2 +++ b/src/HOL/Codegenerator_Test/Candidates.thy	Thu May 26 17:51:22 2016 +0200
    29.3 @@ -1,7 +1,7 @@
    29.4  
    29.5  (* Author: Florian Haftmann, TU Muenchen *)
    29.6  
    29.7 -section {* A huge collection of equations to generate code from *}
    29.8 +section \<open>A huge collection of equations to generate code from\<close>
    29.9  
   29.10  theory Candidates
   29.11  imports
   29.12 @@ -40,7 +40,7 @@
   29.13  
   29.14  code_reserved SML upto
   29.15  
   29.16 -text \<open>Explicit check in @{text OCaml} for correct precedence of let expressions in list expressions\<close>
   29.17 +text \<open>Explicit check in \<open>OCaml\<close> for correct precedence of let expressions in list expressions\<close>
   29.18  
   29.19  definition funny_list :: "bool list"
   29.20  where
   29.21 @@ -58,7 +58,7 @@
   29.22  where
   29.23    "check_list = (if funny_list = funny_list' then () else undefined)"
   29.24  
   29.25 -text \<open>Explicit check in @{text Scala} for correct bracketing of abstractions\<close>
   29.26 +text \<open>Explicit check in \<open>Scala\<close> for correct bracketing of abstractions\<close>
   29.27  
   29.28  definition funny_funs :: "(bool \<Rightarrow> bool) list \<Rightarrow> (bool \<Rightarrow> bool) list"
   29.29  where
    30.1 --- a/src/HOL/Codegenerator_Test/Code_Test_GHC.thy	Thu May 26 16:57:14 2016 +0200
    30.2 +++ b/src/HOL/Codegenerator_Test/Code_Test_GHC.thy	Thu May 26 17:51:22 2016 +0200
    30.3 @@ -10,7 +10,7 @@
    30.4  
    30.5  value [GHC] "14 + 7 * -12 :: integer"
    30.6  
    30.7 -test_code -- \<open>Tests for the serialisation of @{const gcd} on @{typ integer}\<close>
    30.8 +test_code \<comment> \<open>Tests for the serialisation of @{const gcd} on @{typ integer}\<close>
    30.9    "gcd 15 10 = (5 :: integer)"
   30.10    "gcd 15 (- 10) = (5 :: integer)"
   30.11    "gcd (- 10) 15 = (5 :: integer)"
    31.1 --- a/src/HOL/Codegenerator_Test/Code_Test_OCaml.thy	Thu May 26 16:57:14 2016 +0200
    31.2 +++ b/src/HOL/Codegenerator_Test/Code_Test_OCaml.thy	Thu May 26 17:51:22 2016 +0200
    31.3 @@ -10,7 +10,7 @@
    31.4  
    31.5  value [OCaml] "14 + 7 * -12 :: integer"
    31.6  
    31.7 -test_code -- \<open>Tests for the serialisation of @{const gcd} on @{typ integer}\<close>
    31.8 +test_code \<comment> \<open>Tests for the serialisation of @{const gcd} on @{typ integer}\<close>
    31.9    "gcd 15 10 = (5 :: integer)"
   31.10    "gcd 15 (- 10) = (5 :: integer)"
   31.11    "gcd (- 10) 15 = (5 :: integer)"
    32.1 --- a/src/HOL/Codegenerator_Test/Code_Test_Scala.thy	Thu May 26 16:57:14 2016 +0200
    32.2 +++ b/src/HOL/Codegenerator_Test/Code_Test_Scala.thy	Thu May 26 17:51:22 2016 +0200
    32.3 @@ -12,7 +12,7 @@
    32.4  
    32.5  value [Scala] "14 + 7 * -12 :: integer"
    32.6  
    32.7 -test_code -- \<open>Tests for the serialisation of @{const gcd} on @{typ integer}\<close>
    32.8 +test_code \<comment> \<open>Tests for the serialisation of @{const gcd} on @{typ integer}\<close>
    32.9    "gcd 15 10 = (5 :: integer)"
   32.10    "gcd 15 (- 10) = (5 :: integer)"
   32.11    "gcd (- 10) 15 = (5 :: integer)"
    33.1 --- a/src/HOL/Codegenerator_Test/Generate.thy	Thu May 26 16:57:14 2016 +0200
    33.2 +++ b/src/HOL/Codegenerator_Test/Generate.thy	Thu May 26 17:51:22 2016 +0200
    33.3 @@ -1,7 +1,7 @@
    33.4  
    33.5  (* Author: Florian Haftmann, TU Muenchen *)
    33.6  
    33.7 -section {* Pervasive test of code generator *}
    33.8 +section \<open>Pervasive test of code generator\<close>
    33.9  
   33.10  theory Generate
   33.11  imports
   33.12 @@ -10,10 +10,10 @@
   33.13    "~~/src/HOL/Library/Finite_Lattice"
   33.14  begin
   33.15  
   33.16 -text {*
   33.17 +text \<open>
   33.18    If any of the checks fails, inspect the code generated
   33.19 -  by a corresponding @{text export_code} command.
   33.20 -*}
   33.21 +  by a corresponding \<open>export_code\<close> command.
   33.22 +\<close>
   33.23  
   33.24  export_code _ checking SML OCaml? Haskell? Scala
   33.25  
    34.1 --- a/src/HOL/Codegenerator_Test/Generate_Binary_Nat.thy	Thu May 26 16:57:14 2016 +0200
    34.2 +++ b/src/HOL/Codegenerator_Test/Generate_Binary_Nat.thy	Thu May 26 17:51:22 2016 +0200
    34.3 @@ -1,7 +1,7 @@
    34.4  
    34.5  (* Author: Florian Haftmann, TU Muenchen *)
    34.6  
    34.7 -section {* Pervasive test of code generator *}
    34.8 +section \<open>Pervasive test of code generator\<close>
    34.9  
   34.10  theory Generate_Binary_Nat
   34.11  imports
   34.12 @@ -11,10 +11,10 @@
   34.13    "~~/src/HOL/Library/Code_Binary_Nat"
   34.14  begin
   34.15  
   34.16 -text {*
   34.17 +text \<open>
   34.18    If any of the checks fails, inspect the code generated
   34.19 -  by a corresponding @{text export_code} command.
   34.20 -*}
   34.21 +  by a corresponding \<open>export_code\<close> command.
   34.22 +\<close>
   34.23  
   34.24  export_code _ checking SML OCaml? Haskell? Scala
   34.25  
    35.1 --- a/src/HOL/Codegenerator_Test/Generate_Efficient_Datastructures.thy	Thu May 26 16:57:14 2016 +0200
    35.2 +++ b/src/HOL/Codegenerator_Test/Generate_Efficient_Datastructures.thy	Thu May 26 17:51:22 2016 +0200
    35.3 @@ -1,7 +1,7 @@
    35.4  
    35.5  (* Author: Ondrej Kuncar, TU Muenchen *)
    35.6  
    35.7 -section {* Pervasive test of code generator *}
    35.8 +section \<open>Pervasive test of code generator\<close>
    35.9  
   35.10  theory Generate_Efficient_Datastructures
   35.11  imports
   35.12 @@ -18,7 +18,7 @@
   35.13    val consts = map_filter (try (curry (Axclass.param_of_inst thy)
   35.14      @{const_name "Quickcheck_Narrowing.partial_term_of"})) tycos;
   35.15  in fold Code.del_eqns consts thy end
   35.16 -\<close> -- \<open>drop technical stuff from @{text Quickcheck_Narrowing} which is tailored towards Haskell\<close>
   35.17 +\<close> \<comment> \<open>drop technical stuff from \<open>Quickcheck_Narrowing\<close> which is tailored towards Haskell\<close>
   35.18  
   35.19  (* 
   35.20     The following code equations have to be deleted because they use 
    36.1 --- a/src/HOL/Codegenerator_Test/Generate_Pretty_Char.thy	Thu May 26 16:57:14 2016 +0200
    36.2 +++ b/src/HOL/Codegenerator_Test/Generate_Pretty_Char.thy	Thu May 26 17:51:22 2016 +0200
    36.3 @@ -1,7 +1,7 @@
    36.4  
    36.5  (* Author: Florian Haftmann, TU Muenchen *)
    36.6  
    36.7 -section {* Pervasive test of code generator *}
    36.8 +section \<open>Pervasive test of code generator\<close>
    36.9  
   36.10  theory Generate_Pretty_Char
   36.11  imports
   36.12 @@ -11,10 +11,10 @@
   36.13    "~~/src/HOL/Library/Code_Char"
   36.14  begin
   36.15  
   36.16 -text {*
   36.17 +text \<open>
   36.18    If any of the checks fails, inspect the code generated
   36.19 -  by a corresponding @{text export_code} command.
   36.20 -*}
   36.21 +  by a corresponding \<open>export_code\<close> command.
   36.22 +\<close>
   36.23  
   36.24  export_code _ checking SML OCaml? Haskell? Scala
   36.25  
    37.1 --- a/src/HOL/Codegenerator_Test/Generate_Target_Nat.thy	Thu May 26 16:57:14 2016 +0200
    37.2 +++ b/src/HOL/Codegenerator_Test/Generate_Target_Nat.thy	Thu May 26 17:51:22 2016 +0200
    37.3 @@ -1,7 +1,7 @@
    37.4  
    37.5  (* Author: Florian Haftmann, TU Muenchen *)
    37.6  
    37.7 -section {* Pervasive test of code generator *}
    37.8 +section \<open>Pervasive test of code generator\<close>
    37.9  
   37.10  theory Generate_Target_Nat
   37.11  imports
   37.12 @@ -11,10 +11,10 @@
   37.13    "~~/src/HOL/Library/Code_Target_Numeral"
   37.14  begin
   37.15  
   37.16 -text {*
   37.17 +text \<open>
   37.18    If any of the checks fails, inspect the code generated
   37.19 -  by a corresponding @{text export_code} command.
   37.20 -*}
   37.21 +  by a corresponding \<open>export_code\<close> command.
   37.22 +\<close>
   37.23  
   37.24  export_code _ checking SML OCaml? Haskell? Scala
   37.25  
    38.1 --- a/src/HOL/Corec_Examples/LFilter.thy	Thu May 26 16:57:14 2016 +0200
    38.2 +++ b/src/HOL/Corec_Examples/LFilter.thy	Thu May 26 17:51:22 2016 +0200
    38.3 @@ -82,7 +82,7 @@
    38.4      else if P (lhd xs) then LCons (lhd xs) (f (ltl xs))
    38.5      else f (ltl xs))"
    38.6    shows "f = lfilter P"
    38.7 --- \<open>It seems as if we cannot use @{thm lfilter_unique_weak} for showing this as the induction and the coinduction must be nested\<close>
    38.8 +\<comment> \<open>It seems as if we cannot use @{thm lfilter_unique_weak} for showing this as the induction and the coinduction must be nested\<close>
    38.9  proof(rule ext)
   38.10    show "f xs = lfilter P xs" for xs
   38.11    proof(coinduction arbitrary: xs)
    39.1 --- a/src/HOL/Datatype_Examples/Compat.thy	Thu May 26 16:57:14 2016 +0200
    39.2 +++ b/src/HOL/Datatype_Examples/Compat.thy	Thu May 26 17:51:22 2016 +0200
    39.3 @@ -5,15 +5,15 @@
    39.4  Tests for compatibility with the old datatype package.
    39.5  *)
    39.6  
    39.7 -section {* Tests for Compatibility with the Old Datatype Package *}
    39.8 +section \<open>Tests for Compatibility with the Old Datatype Package\<close>
    39.9  
   39.10  theory Compat
   39.11  imports "~~/src/HOL/Library/Old_Datatype"
   39.12  begin
   39.13  
   39.14 -subsection {* Viewing and Registering New-Style Datatypes as Old-Style Ones *}
   39.15 +subsection \<open>Viewing and Registering New-Style Datatypes as Old-Style Ones\<close>
   39.16  
   39.17 -ML {*
   39.18 +ML \<open>
   39.19  fun check_len n xs label =
   39.20    length xs = n orelse error ("Expected length " ^ string_of_int (length xs) ^ " for " ^ label);
   39.21  
   39.22 @@ -25,13 +25,13 @@
   39.23     these (Option.map #descr (BNF_LFP_Compat.get_info thy [] T_name)),
   39.24     these (Option.map #descr (BNF_LFP_Compat.get_info thy [BNF_LFP_Compat.Keep_Nesting] T_name)))
   39.25    |> tap (check_lens lens);
   39.26 -*}
   39.27 +\<close>
   39.28  
   39.29  old_datatype 'a old_lst = Old_Nl | Old_Cns 'a "'a old_lst"
   39.30  
   39.31 -text {*
   39.32 -A few tests to make sure that @{text old_datatype} works as expected:
   39.33 -*}
   39.34 +text \<open>
   39.35 +A few tests to make sure that \<open>old_datatype\<close> works as expected:
   39.36 +\<close>
   39.37  
   39.38  primrec old_len :: "'a old_lst \<Rightarrow> nat" where
   39.39    "old_len Old_Nl = 0"
   39.40 @@ -49,208 +49,208 @@
   39.41  lemma "old_len xs = size xs"
   39.42    by (induct xs) auto
   39.43  
   39.44 -ML {* get_descrs @{theory} (1, 1, 1) @{type_name old_lst} *}
   39.45 +ML \<open>get_descrs @{theory} (1, 1, 1) @{type_name old_lst}\<close>
   39.46  
   39.47  datatype 'a lst = Nl | Cns 'a "'a lst"
   39.48  
   39.49 -ML {* get_descrs @{theory} (0, 1, 1) @{type_name lst} *}
   39.50 +ML \<open>get_descrs @{theory} (0, 1, 1) @{type_name lst}\<close>
   39.51  
   39.52  datatype_compat lst
   39.53  
   39.54 -ML {* get_descrs @{theory} (1, 1, 1) @{type_name lst} *}
   39.55 +ML \<open>get_descrs @{theory} (1, 1, 1) @{type_name lst}\<close>
   39.56  
   39.57  datatype 'b w = W | W' "'b w \<times> 'b list"
   39.58  
   39.59 -ML {* get_descrs @{theory} (0, 1, 1) @{type_name w} *}
   39.60 +ML \<open>get_descrs @{theory} (0, 1, 1) @{type_name w}\<close>
   39.61  
   39.62  datatype_compat w
   39.63  
   39.64 -ML {* get_descrs @{theory} (2, 2, 1) @{type_name w} *}
   39.65 +ML \<open>get_descrs @{theory} (2, 2, 1) @{type_name w}\<close>
   39.66  
   39.67  datatype ('c, 'b) s = L 'c | R 'b
   39.68  
   39.69 -ML {* get_descrs @{theory} (0, 1, 1) @{type_name s} *}
   39.70 +ML \<open>get_descrs @{theory} (0, 1, 1) @{type_name s}\<close>
   39.71  
   39.72  datatype 'd x = X | X' "('d x lst, 'd list) s"
   39.73  
   39.74 -ML {* get_descrs @{theory} (0, 1, 1) @{type_name x} *}
   39.75 +ML \<open>get_descrs @{theory} (0, 1, 1) @{type_name x}\<close>
   39.76  
   39.77  datatype_compat s
   39.78  
   39.79 -ML {* get_descrs @{theory} (1, 1, 1) @{type_name s} *}
   39.80 -ML {* get_descrs @{theory} (0, 1, 1) @{type_name x} *}
   39.81 +ML \<open>get_descrs @{theory} (1, 1, 1) @{type_name s}\<close>
   39.82 +ML \<open>get_descrs @{theory} (0, 1, 1) @{type_name x}\<close>
   39.83  
   39.84  datatype_compat x
   39.85  
   39.86 -ML {* get_descrs @{theory} (3, 3, 1) @{type_name x} *}
   39.87 +ML \<open>get_descrs @{theory} (3, 3, 1) @{type_name x}\<close>
   39.88  
   39.89  thm x.induct x.rec
   39.90  thm compat_x.induct compat_x.rec
   39.91  
   39.92  datatype 'a tttre = TTTre 'a "'a tttre lst lst lst"
   39.93  
   39.94 -ML {* get_descrs @{theory} (0, 1, 1) @{type_name tttre} *}
   39.95 +ML \<open>get_descrs @{theory} (0, 1, 1) @{type_name tttre}\<close>
   39.96  
   39.97  datatype_compat tttre
   39.98  
   39.99 -ML {* get_descrs @{theory} (4, 4, 1) @{type_name tttre} *}
  39.100 +ML \<open>get_descrs @{theory} (4, 4, 1) @{type_name tttre}\<close>
  39.101  
  39.102  thm tttre.induct tttre.rec
  39.103  thm compat_tttre.induct compat_tttre.rec
  39.104  
  39.105  datatype 'a ftre = FEmp | FTre "'a \<Rightarrow> 'a ftre lst"
  39.106  
  39.107 -ML {* get_descrs @{theory} (0, 1, 1) @{type_name ftre} *}
  39.108 +ML \<open>get_descrs @{theory} (0, 1, 1) @{type_name ftre}\<close>
  39.109  
  39.110  datatype_compat ftre
  39.111  
  39.112 -ML {* get_descrs @{theory} (2, 2, 1) @{type_name ftre} *}
  39.113 +ML \<open>get_descrs @{theory} (2, 2, 1) @{type_name ftre}\<close>
  39.114  
  39.115  thm ftre.induct ftre.rec
  39.116  thm compat_ftre.induct compat_ftre.rec
  39.117  
  39.118  datatype 'a btre = BTre 'a "'a btre lst" "'a btre lst"
  39.119  
  39.120 -ML {* get_descrs @{theory} (0, 1, 1) @{type_name btre} *}
  39.121 +ML \<open>get_descrs @{theory} (0, 1, 1) @{type_name btre}\<close>
  39.122  
  39.123  datatype_compat btre
  39.124  
  39.125 -ML {* get_descrs @{theory} (3, 3, 1) @{type_name btre} *}
  39.126 +ML \<open>get_descrs @{theory} (3, 3, 1) @{type_name btre}\<close>
  39.127  
  39.128  thm btre.induct btre.rec
  39.129  thm compat_btre.induct compat_btre.rec
  39.130  
  39.131  datatype 'a foo = Foo | Foo' 'a "'a bar" and 'a bar = Bar | Bar' 'a "'a foo"
  39.132  
  39.133 -ML {* get_descrs @{theory} (0, 2, 2) @{type_name foo} *}
  39.134 -ML {* get_descrs @{theory} (0, 2, 2) @{type_name bar} *}
  39.135 +ML \<open>get_descrs @{theory} (0, 2, 2) @{type_name foo}\<close>
  39.136 +ML \<open>get_descrs @{theory} (0, 2, 2) @{type_name bar}\<close>
  39.137  
  39.138  datatype_compat foo bar
  39.139  
  39.140 -ML {* get_descrs @{theory} (2, 2, 2) @{type_name foo} *}
  39.141 -ML {* get_descrs @{theory} (2, 2, 2) @{type_name bar} *}
  39.142 +ML \<open>get_descrs @{theory} (2, 2, 2) @{type_name foo}\<close>
  39.143 +ML \<open>get_descrs @{theory} (2, 2, 2) @{type_name bar}\<close>
  39.144  
  39.145  datatype 'a tre = Tre 'a "'a tre lst"
  39.146  
  39.147 -ML {* get_descrs @{theory} (0, 1, 1) @{type_name tre} *}
  39.148 +ML \<open>get_descrs @{theory} (0, 1, 1) @{type_name tre}\<close>
  39.149  
  39.150  datatype_compat tre
  39.151  
  39.152 -ML {* get_descrs @{theory} (2, 2, 1) @{type_name tre} *}
  39.153 +ML \<open>get_descrs @{theory} (2, 2, 1) @{type_name tre}\<close>
  39.154  
  39.155  thm tre.induct tre.rec
  39.156  thm compat_tre.induct compat_tre.rec
  39.157  
  39.158  datatype 'a f = F 'a and 'a g = G 'a
  39.159  
  39.160 -ML {* get_descrs @{theory} (0, 2, 2) @{type_name f} *}
  39.161 -ML {* get_descrs @{theory} (0, 2, 2) @{type_name g} *}
  39.162 +ML \<open>get_descrs @{theory} (0, 2, 2) @{type_name f}\<close>
  39.163 +ML \<open>get_descrs @{theory} (0, 2, 2) @{type_name g}\<close>
  39.164  
  39.165  datatype h = H "h f" | H'
  39.166  
  39.167 -ML {* get_descrs @{theory} (0, 1, 1) @{type_name h} *}
  39.168 +ML \<open>get_descrs @{theory} (0, 1, 1) @{type_name h}\<close>
  39.169  
  39.170  datatype_compat f g
  39.171  
  39.172 -ML {* get_descrs @{theory} (2, 2, 2) @{type_name f} *}
  39.173 -ML {* get_descrs @{theory} (2, 2, 2) @{type_name g} *}
  39.174 -ML {* get_descrs @{theory} (0, 1, 1) @{type_name h} *}
  39.175 +ML \<open>get_descrs @{theory} (2, 2, 2) @{type_name f}\<close>
  39.176 +ML \<open>get_descrs @{theory} (2, 2, 2) @{type_name g}\<close>
  39.177 +ML \<open>get_descrs @{theory} (0, 1, 1) @{type_name h}\<close>
  39.178  
  39.179  datatype_compat h
  39.180  
  39.181 -ML {* get_descrs @{theory} (3, 3, 1) @{type_name h} *}
  39.182 +ML \<open>get_descrs @{theory} (3, 3, 1) @{type_name h}\<close>
  39.183  
  39.184  thm h.induct h.rec
  39.185  thm compat_h.induct compat_h.rec
  39.186  
  39.187  datatype myunit = MyUnity
  39.188  
  39.189 -ML {* get_descrs @{theory} (0, 1, 1) @{type_name myunit} *}
  39.190 +ML \<open>get_descrs @{theory} (0, 1, 1) @{type_name myunit}\<close>
  39.191  
  39.192  datatype_compat myunit
  39.193  
  39.194 -ML {* get_descrs @{theory} (1, 1, 1) @{type_name myunit} *}
  39.195 +ML \<open>get_descrs @{theory} (1, 1, 1) @{type_name myunit}\<close>
  39.196  
  39.197  datatype mylist = MyNil | MyCons nat mylist
  39.198  
  39.199 -ML {* get_descrs @{theory} (0, 1, 1) @{type_name mylist} *}
  39.200 +ML \<open>get_descrs @{theory} (0, 1, 1) @{type_name mylist}\<close>
  39.201  
  39.202  datatype_compat mylist
  39.203  
  39.204 -ML {* get_descrs @{theory} (1, 1, 1) @{type_name mylist} *}
  39.205 +ML \<open>get_descrs @{theory} (1, 1, 1) @{type_name mylist}\<close>
  39.206  
  39.207  datatype foo' = FooNil | FooCons bar' foo' and bar' = Bar
  39.208  
  39.209 -ML {* get_descrs @{theory} (0, 2, 2) @{type_name foo'} *}
  39.210 -ML {* get_descrs @{theory} (0, 2, 2) @{type_name bar'} *}
  39.211 +ML \<open>get_descrs @{theory} (0, 2, 2) @{type_name foo'}\<close>
  39.212 +ML \<open>get_descrs @{theory} (0, 2, 2) @{type_name bar'}\<close>
  39.213  
  39.214  datatype_compat bar' foo'
  39.215  
  39.216 -ML {* get_descrs @{theory} (2, 2, 2) @{type_name foo'} *}
  39.217 -ML {* get_descrs @{theory} (2, 2, 2) @{type_name bar'} *}
  39.218 +ML \<open>get_descrs @{theory} (2, 2, 2) @{type_name foo'}\<close>
  39.219 +ML \<open>get_descrs @{theory} (2, 2, 2) @{type_name bar'}\<close>
  39.220  
  39.221  old_datatype funky = Funky "funky tre" | Funky'
  39.222  
  39.223 -ML {* get_descrs @{theory} (3, 3, 3) @{type_name funky} *}
  39.224 +ML \<open>get_descrs @{theory} (3, 3, 3) @{type_name funky}\<close>
  39.225  
  39.226  old_datatype fnky = Fnky "nat tre"
  39.227  
  39.228 -ML {* get_descrs @{theory} (1, 1, 1) @{type_name fnky} *}
  39.229 +ML \<open>get_descrs @{theory} (1, 1, 1) @{type_name fnky}\<close>
  39.230  
  39.231  datatype tree = Tree "tree foo"
  39.232  
  39.233 -ML {* get_descrs @{theory} (0, 1, 1) @{type_name tree} *}
  39.234 +ML \<open>get_descrs @{theory} (0, 1, 1) @{type_name tree}\<close>
  39.235  
  39.236  datatype_compat tree
  39.237  
  39.238 -ML {* get_descrs @{theory} (3, 3, 1) @{type_name tree} *}
  39.239 +ML \<open>get_descrs @{theory} (3, 3, 1) @{type_name tree}\<close>
  39.240  
  39.241  thm tree.induct tree.rec
  39.242  thm compat_tree.induct compat_tree.rec
  39.243  
  39.244  
  39.245 -subsection {* Creating New-Style Datatypes Using Old-Style Interfaces *}
  39.246 +subsection \<open>Creating New-Style Datatypes Using Old-Style Interfaces\<close>
  39.247  
  39.248 -ML {*
  39.249 +ML \<open>
  39.250  val l_specs =
  39.251    [((@{binding l}, [("'a", @{sort type})], NoSyn),
  39.252     [(@{binding N}, [], NoSyn),
  39.253      (@{binding C}, [@{typ 'a}, Type (Sign.full_name @{theory} @{binding l}, [@{typ 'a}])],
  39.254       NoSyn)])];
  39.255 -*}
  39.256 +\<close>
  39.257  
  39.258 -setup {* snd o BNF_LFP_Compat.add_datatype [] l_specs *}
  39.259 +setup \<open>snd o BNF_LFP_Compat.add_datatype [] l_specs\<close>
  39.260  
  39.261 -ML {* get_descrs @{theory} (1, 1, 1) @{type_name l} *}
  39.262 +ML \<open>get_descrs @{theory} (1, 1, 1) @{type_name l}\<close>
  39.263  
  39.264  thm l.exhaust l.map l.induct l.rec l.size
  39.265  
  39.266 -ML {*
  39.267 +ML \<open>
  39.268  val t_specs =
  39.269    [((@{binding t}, [("'b", @{sort type})], NoSyn),
  39.270     [(@{binding T}, [@{typ 'b},
  39.271         Type (@{type_name l}, [Type (Sign.full_name @{theory} @{binding t}, [@{typ 'b}])])],
  39.272       NoSyn)])];
  39.273 -*}
  39.274 +\<close>
  39.275  
  39.276 -setup {* snd o BNF_LFP_Compat.add_datatype [] t_specs *}
  39.277 +setup \<open>snd o BNF_LFP_Compat.add_datatype [] t_specs\<close>
  39.278  
  39.279 -ML {* get_descrs @{theory} (2, 2, 1) @{type_name t} *}
  39.280 +ML \<open>get_descrs @{theory} (2, 2, 1) @{type_name t}\<close>
  39.281  
  39.282  thm t.exhaust t.map t.induct t.rec t.size
  39.283  thm compat_t.induct compat_t.rec
  39.284  
  39.285 -ML {*
  39.286 +ML \<open>
  39.287  val ft_specs =
  39.288    [((@{binding ft}, [("'a", @{sort type})], NoSyn),
  39.289     [(@{binding FT0}, [], NoSyn),
  39.290      (@{binding FT}, [@{typ 'a} --> Type (Sign.full_name @{theory} @{binding ft}, [@{typ 'a}])],
  39.291       NoSyn)])];
  39.292 -*}
  39.293 +\<close>
  39.294  
  39.295 -setup {* snd o BNF_LFP_Compat.add_datatype [] ft_specs *}
  39.296 +setup \<open>snd o BNF_LFP_Compat.add_datatype [] ft_specs\<close>
  39.297  
  39.298 -ML {* get_descrs @{theory} (1, 1, 1) @{type_name ft} *}
  39.299 +ML \<open>get_descrs @{theory} (1, 1, 1) @{type_name ft}\<close>
  39.300  
  39.301  thm ft.exhaust ft.induct ft.rec ft.size
  39.302  thm compat_ft.induct compat_ft.rec
    40.1 --- a/src/HOL/Datatype_Examples/Derivation_Trees/DTree.thy	Thu May 26 16:57:14 2016 +0200
    40.2 +++ b/src/HOL/Datatype_Examples/Derivation_Trees/DTree.thy	Thu May 26 17:51:22 2016 +0200
    40.3 @@ -5,7 +5,7 @@
    40.4  Derivation trees with nonterminal internal nodes and terminal leaves.
    40.5  *)
    40.6  
    40.7 -section {* Trees with Nonterminal Internal Nodes and Terminal Leaves *}
    40.8 +section \<open>Trees with Nonterminal Internal Nodes and Terminal Leaves\<close>
    40.9  
   40.10  theory DTree
   40.11  imports Prelim
   40.12 @@ -16,7 +16,7 @@
   40.13  
   40.14  codatatype dtree = NNode (root: N) (ccont: "(T + dtree) fset")
   40.15  
   40.16 -subsection{* Transporting the Characteristic Lemmas from @{text "fset"} to @{text "set"} *}
   40.17 +subsection\<open>Transporting the Characteristic Lemmas from \<open>fset\<close> to \<open>set\<close>\<close>
   40.18  
   40.19  definition "Node n as \<equiv> NNode n (the_inv fset as)"
   40.20  definition "cont \<equiv> fset o ccont"
    41.1 --- a/src/HOL/Datatype_Examples/Derivation_Trees/Gram_Lang.thy	Thu May 26 16:57:14 2016 +0200
    41.2 +++ b/src/HOL/Datatype_Examples/Derivation_Trees/Gram_Lang.thy	Thu May 26 17:51:22 2016 +0200
    41.3 @@ -5,7 +5,7 @@
    41.4  Language of a grammar.
    41.5  *)
    41.6  
    41.7 -section {* Language of a Grammar *}
    41.8 +section \<open>Language of a Grammar\<close>
    41.9  
   41.10  theory Gram_Lang
   41.11  imports DTree "~~/src/HOL/Library/Infinite_Set"
   41.12 @@ -21,7 +21,7 @@
   41.13  and used: "\<And> n. \<exists> tns. (n,tns) \<in> P"
   41.14  
   41.15  
   41.16 -subsection{* Tree Basics: frontier, interior, etc. *}
   41.17 +subsection\<open>Tree Basics: frontier, interior, etc.\<close>
   41.18  
   41.19  
   41.20  (* Frontier *)
   41.21 @@ -309,7 +309,7 @@
   41.22    by (metis inItr.Base subtr_inItr subtr_rootL_in)
   41.23  
   41.24  
   41.25 -subsection{* The Immediate Subtree Function *}
   41.26 +subsection\<open>The Immediate Subtree Function\<close>
   41.27  
   41.28  (* production of: *)
   41.29  abbreviation "prodOf tr \<equiv> (id \<oplus> root) ` (cont tr)"
   41.30 @@ -343,7 +343,7 @@
   41.31  by (metis (lifting) assms image_iff map_sum.simps(2))
   41.32  
   41.33  
   41.34 -subsection{* Well-Formed Derivation Trees *}
   41.35 +subsection\<open>Well-Formed Derivation Trees\<close>
   41.36  
   41.37  hide_const wf
   41.38  
   41.39 @@ -448,7 +448,7 @@
   41.40  qed
   41.41  
   41.42  
   41.43 -subsection{* Default Trees *}
   41.44 +subsection\<open>Default Trees\<close>
   41.45  
   41.46  (* Pick a left-hand side of a production for each nonterminal *)
   41.47  definition S where "S n \<equiv> SOME tns. (n,tns) \<in> P"
   41.48 @@ -488,7 +488,7 @@
   41.49  qed
   41.50  
   41.51  
   41.52 -subsection{* Hereditary Substitution *}
   41.53 +subsection\<open>Hereditary Substitution\<close>
   41.54  
   41.55  (* Auxiliary concept: The root-ommiting frontier: *)
   41.56  definition "inFrr ns tr t \<equiv> \<exists> tr'. Inr tr' \<in> cont tr \<and> inFr ns tr' t"
   41.57 @@ -679,7 +679,7 @@
   41.58  end (* context *)
   41.59  
   41.60  
   41.61 -subsection{* Regular Trees *}
   41.62 +subsection\<open>Regular Trees\<close>
   41.63  
   41.64  definition "reg f tr \<equiv> \<forall> tr'. subtr UNIV tr' tr \<longrightarrow> tr' = f (root tr')"
   41.65  definition "regular tr \<equiv> \<exists> f. reg f tr"
   41.66 @@ -770,7 +770,7 @@
   41.67  
   41.68  
   41.69  
   41.70 -subsection {* Paths in a Regular Tree *}
   41.71 +subsection \<open>Paths in a Regular Tree\<close>
   41.72  
   41.73  inductive path :: "(N \<Rightarrow> dtree) \<Rightarrow> N list \<Rightarrow> bool" for f where
   41.74  Base: "path f [n]"
   41.75 @@ -914,7 +914,7 @@
   41.76  
   41.77  
   41.78  
   41.79 -subsection{* The Regular Cut of a Tree *}
   41.80 +subsection\<open>The Regular Cut of a Tree\<close>
   41.81  
   41.82  context fixes tr0 :: dtree
   41.83  begin
   41.84 @@ -1081,7 +1081,7 @@
   41.85  end (* context *)
   41.86  
   41.87  
   41.88 -subsection{* Recursive Description of the Regular Tree Frontiers *}
   41.89 +subsection\<open>Recursive Description of the Regular Tree Frontiers\<close>
   41.90  
   41.91  lemma regular_inFr:
   41.92  assumes r: "regular tr" and In: "root tr \<in> ns"
   41.93 @@ -1130,7 +1130,7 @@
   41.94  by (simp, metis (lifting) inFr_Ind_minus insert_Diff)
   41.95  
   41.96  
   41.97 -subsection{* The Generated Languages *}
   41.98 +subsection\<open>The Generated Languages\<close>
   41.99  
  41.100  (* The (possibly inifinite tree) generated language *)
  41.101  definition "L ns n \<equiv> {Fr ns tr | tr. wf tr \<and> root tr = n}"
    42.1 --- a/src/HOL/Datatype_Examples/Derivation_Trees/Parallel.thy	Thu May 26 16:57:14 2016 +0200
    42.2 +++ b/src/HOL/Datatype_Examples/Derivation_Trees/Parallel.thy	Thu May 26 17:51:22 2016 +0200
    42.3 @@ -5,7 +5,7 @@
    42.4  Parallel composition.
    42.5  *)
    42.6  
    42.7 -section {* Parallel Composition *}
    42.8 +section \<open>Parallel Composition\<close>
    42.9  
   42.10  theory Parallel
   42.11  imports DTree
   42.12 @@ -19,7 +19,7 @@
   42.13      Nplus_comm: "(a::N) + b = b + (a::N)"
   42.14  and Nplus_assoc: "((a::N) + b) + c = a + (b + c)"
   42.15  
   42.16 -subsection{* Corecursive Definition of Parallel Composition *}
   42.17 +subsection\<open>Corecursive Definition of Parallel Composition\<close>
   42.18  
   42.19  fun par_r where "par_r (tr1,tr2) = root tr1 + root tr2"
   42.20  fun par_c where
   42.21 @@ -65,7 +65,7 @@
   42.22  using Inr_cont_par[of tr1 tr2] unfolding vimage_def by auto
   42.23  
   42.24  
   42.25 -subsection{* Structural Coinduction Proofs *}
   42.26 +subsection\<open>Structural Coinduction Proofs\<close>
   42.27  
   42.28  lemma rel_set_rel_sum_eq[simp]:
   42.29  "rel_set (rel_sum (op =) \<phi>) A1 A2 \<longleftrightarrow>
    43.1 --- a/src/HOL/Datatype_Examples/Derivation_Trees/Prelim.thy	Thu May 26 16:57:14 2016 +0200
    43.2 +++ b/src/HOL/Datatype_Examples/Derivation_Trees/Prelim.thy	Thu May 26 17:51:22 2016 +0200
    43.3 @@ -5,7 +5,7 @@
    43.4  Preliminaries.
    43.5  *)
    43.6  
    43.7 -section {* Preliminaries *}
    43.8 +section \<open>Preliminaries\<close>
    43.9  
   43.10  theory Prelim
   43.11  imports "~~/src/HOL/Library/FSet"
    44.1 --- a/src/HOL/Datatype_Examples/Koenig.thy	Thu May 26 16:57:14 2016 +0200
    44.2 +++ b/src/HOL/Datatype_Examples/Koenig.thy	Thu May 26 17:51:22 2016 +0200
    44.3 @@ -6,7 +6,7 @@
    44.4  Koenig's lemma.
    44.5  *)
    44.6  
    44.7 -section {* Koenig's Lemma *}
    44.8 +section \<open>Koenig's Lemma\<close>
    44.9  
   44.10  theory Koenig
   44.11  imports TreeFI "~~/src/HOL/Library/Stream"
    45.1 --- a/src/HOL/Datatype_Examples/Lambda_Term.thy	Thu May 26 16:57:14 2016 +0200
    45.2 +++ b/src/HOL/Datatype_Examples/Lambda_Term.thy	Thu May 26 17:51:22 2016 +0200
    45.3 @@ -6,13 +6,13 @@
    45.4  Lambda-terms.
    45.5  *)
    45.6  
    45.7 -section {* Lambda-Terms *}
    45.8 +section \<open>Lambda-Terms\<close>
    45.9  
   45.10  theory Lambda_Term
   45.11  imports "~~/src/HOL/Library/FSet"
   45.12  begin
   45.13  
   45.14 -section {* Datatype definition *}
   45.15 +section \<open>Datatype definition\<close>
   45.16  
   45.17  datatype 'a trm =
   45.18    Var 'a |
   45.19 @@ -21,7 +21,7 @@
   45.20    Lt "('a \<times> 'a trm) fset" "'a trm"
   45.21  
   45.22  
   45.23 -subsection {* Example: The set of all variables varsOf and free variables fvarsOf of a term *}
   45.24 +subsection \<open>Example: The set of all variables varsOf and free variables fvarsOf of a term\<close>
   45.25  
   45.26  primrec varsOf :: "'a trm \<Rightarrow> 'a set" where
   45.27    "varsOf (Var a) = {a}"
    46.1 --- a/src/HOL/Datatype_Examples/Lift_BNF.thy	Thu May 26 16:57:14 2016 +0200
    46.2 +++ b/src/HOL/Datatype_Examples/Lift_BNF.thy	Thu May 26 17:51:22 2016 +0200
    46.3 @@ -5,7 +5,7 @@
    46.4  Demonstration of the "lift_bnf" command.
    46.5  *)
    46.6  
    46.7 -section {* Demonstration of the \textbf{lift_bnf} Command *}
    46.8 +section \<open>Demonstration of the \textbf{lift_bnf} Command\<close>
    46.9  
   46.10  theory Lift_BNF
   46.11  imports Main
    47.1 --- a/src/HOL/Datatype_Examples/Misc_Codatatype.thy	Thu May 26 16:57:14 2016 +0200
    47.2 +++ b/src/HOL/Datatype_Examples/Misc_Codatatype.thy	Thu May 26 17:51:22 2016 +0200
    47.3 @@ -7,7 +7,7 @@
    47.4  Miscellaneous codatatype definitions.
    47.5  *)
    47.6  
    47.7 -section {* Miscellaneous Codatatype Definitions *}
    47.8 +section \<open>Miscellaneous Codatatype Definitions\<close>
    47.9  
   47.10  theory Misc_Codatatype
   47.11  imports "~~/src/HOL/Library/FSet"
    48.1 --- a/src/HOL/Datatype_Examples/Misc_Datatype.thy	Thu May 26 16:57:14 2016 +0200
    48.2 +++ b/src/HOL/Datatype_Examples/Misc_Datatype.thy	Thu May 26 17:51:22 2016 +0200
    48.3 @@ -7,7 +7,7 @@
    48.4  Miscellaneous datatype definitions.
    48.5  *)
    48.6  
    48.7 -section {* Miscellaneous Datatype Definitions *}
    48.8 +section \<open>Miscellaneous Datatype Definitions\<close>
    48.9  
   48.10  theory Misc_Datatype
   48.11  imports "~~/src/HOL/Library/Countable" "~~/src/HOL/Library/FSet"
    49.1 --- a/src/HOL/Datatype_Examples/Misc_Primcorec.thy	Thu May 26 16:57:14 2016 +0200
    49.2 +++ b/src/HOL/Datatype_Examples/Misc_Primcorec.thy	Thu May 26 17:51:22 2016 +0200
    49.3 @@ -5,7 +5,7 @@
    49.4  Miscellaneous primitive corecursive function definitions.
    49.5  *)
    49.6  
    49.7 -section {* Miscellaneous Primitive Corecursive Function Definitions *}
    49.8 +section \<open>Miscellaneous Primitive Corecursive Function Definitions\<close>
    49.9  
   49.10  theory Misc_Primcorec
   49.11  imports Misc_Codatatype
    50.1 --- a/src/HOL/Datatype_Examples/Misc_Primrec.thy	Thu May 26 16:57:14 2016 +0200
    50.2 +++ b/src/HOL/Datatype_Examples/Misc_Primrec.thy	Thu May 26 17:51:22 2016 +0200
    50.3 @@ -5,7 +5,7 @@
    50.4  Miscellaneous primitive recursive function definitions.
    50.5  *)
    50.6  
    50.7 -section {* Miscellaneous Primitive Recursive Function Definitions *}
    50.8 +section \<open>Miscellaneous Primitive Recursive Function Definitions\<close>
    50.9  
   50.10  theory Misc_Primrec
   50.11  imports Misc_Datatype
    51.1 --- a/src/HOL/Datatype_Examples/Process.thy	Thu May 26 16:57:14 2016 +0200
    51.2 +++ b/src/HOL/Datatype_Examples/Process.thy	Thu May 26 17:51:22 2016 +0200
    51.3 @@ -5,7 +5,7 @@
    51.4  Processes.
    51.5  *)
    51.6  
    51.7 -section {* Processes *}
    51.8 +section \<open>Processes\<close>
    51.9  
   51.10  theory Process
   51.11  imports "~~/src/HOL/Library/Stream"
   51.12 @@ -17,7 +17,7 @@
   51.13  
   51.14  (* Read: prefix of, continuation of, choice 1 of, choice 2 of *)
   51.15  
   51.16 -subsection {* Basic properties *}
   51.17 +subsection \<open>Basic properties\<close>
   51.18  
   51.19  (* Constructors versus discriminators *)
   51.20  theorem isAction_isChoice:
   51.21 @@ -28,7 +28,7 @@
   51.22  by (cases rule: process.exhaust[of p]) auto
   51.23  
   51.24  
   51.25 -subsection{* Coinduction *}
   51.26 +subsection\<open>Coinduction\<close>
   51.27  
   51.28  theorem process_coind[elim, consumes 1, case_names iss Action Choice, induct pred: "HOL.eq"]:
   51.29    assumes phi: "\<phi> p p'" and
   51.30 @@ -50,19 +50,19 @@
   51.31    by (coinduct rule: process.coinduct_strong) (metis process.collapse(1,2) process.disc(3))
   51.32  
   51.33  
   51.34 -subsection {* Coiteration (unfold) *}
   51.35 +subsection \<open>Coiteration (unfold)\<close>
   51.36  
   51.37  
   51.38 -section{* Coinductive definition of the notion of trace *}
   51.39 +section\<open>Coinductive definition of the notion of trace\<close>
   51.40  coinductive trace where
   51.41  "trace p as \<Longrightarrow> trace (Action a p) (a ## as)"
   51.42  |
   51.43  "trace p as \<or> trace q as \<Longrightarrow> trace (Choice p q) as"
   51.44  
   51.45  
   51.46 -section{* Examples of corecursive definitions: *}
   51.47 +section\<open>Examples of corecursive definitions:\<close>
   51.48  
   51.49 -subsection{* Single-guard fixpoint definition *}
   51.50 +subsection\<open>Single-guard fixpoint definition\<close>
   51.51  
   51.52  primcorec BX where
   51.53    "isAction BX"
   51.54 @@ -70,7 +70,7 @@
   51.55  | "contOf BX = BX"
   51.56  
   51.57  
   51.58 -subsection{* Multi-guard fixpoint definitions, simulated with auxiliary arguments *}
   51.59 +subsection\<open>Multi-guard fixpoint definitions, simulated with auxiliary arguments\<close>
   51.60  
   51.61  datatype x_y_ax = x | y | ax
   51.62  
   51.63 @@ -94,7 +94,7 @@
   51.64  
   51.65  
   51.66  
   51.67 -section{* Case study: Multi-guard fixpoint definitions, without auxiliary arguments *}
   51.68 +section\<open>Case study: Multi-guard fixpoint definitions, without auxiliary arguments\<close>
   51.69  
   51.70  hide_const x y ax X Y AX
   51.71  
    52.1 --- a/src/HOL/Datatype_Examples/Stream_Processor.thy	Thu May 26 16:57:14 2016 +0200
    52.2 +++ b/src/HOL/Datatype_Examples/Stream_Processor.thy	Thu May 26 17:51:22 2016 +0200
    52.3 @@ -6,7 +6,7 @@
    52.4  Stream processors---a syntactic representation of continuous functions on streams.
    52.5  *)
    52.6  
    52.7 -section {* Stream Processors---A Syntactic Representation of Continuous Functions on Streams *}
    52.8 +section \<open>Stream Processors---A Syntactic Representation of Continuous Functions on Streams\<close>
    52.9  
   52.10  theory Stream_Processor
   52.11  imports "~~/src/HOL/Library/Stream" "~~/src/HOL/Library/BNF_Axiomatization"
   52.12 @@ -15,7 +15,7 @@
   52.13  declare [[typedef_overloaded]]
   52.14  
   52.15  
   52.16 -section {* Continuous Functions on Streams *}
   52.17 +section \<open>Continuous Functions on Streams\<close>
   52.18  
   52.19  datatype ('a, 'b, 'c) sp\<^sub>\<mu> =
   52.20    Get "'a \<Rightarrow> ('a, 'b, 'c) sp\<^sub>\<mu>"
   52.21 @@ -37,10 +37,10 @@
   52.22  lemma run\<^sub>\<nu>_copy: "run\<^sub>\<nu> copy s = s"
   52.23    by (coinduction arbitrary: s) simp
   52.24  
   52.25 -text {*
   52.26 +text \<open>
   52.27  To use the function package for the definition of composition the
   52.28  wellfoundedness of the subtree relation needs to be proved first.
   52.29 -*}
   52.30 +\<close>
   52.31  
   52.32  definition "sub \<equiv> {(f a, Get f) | a f. True}"
   52.33  
   52.34 @@ -88,7 +88,7 @@
   52.35    qed
   52.36  qed
   52.37  
   52.38 -text {* Alternative definition of composition using primrec instead of function *}
   52.39 +text \<open>Alternative definition of composition using primrec instead of function\<close>
   52.40  
   52.41  primrec sp\<^sub>\<mu>_comp2R  where
   52.42    "sp\<^sub>\<mu>_comp2R f (Put b sp) = f b (out sp)"
   52.43 @@ -125,7 +125,7 @@
   52.44    qed
   52.45  qed
   52.46  
   52.47 -text {* The two definitions are equivalent *}
   52.48 +text \<open>The two definitions are equivalent\<close>
   52.49  
   52.50  lemma sp\<^sub>\<mu>_comp_sp\<^sub>\<mu>_comp2[simp]: "sp o\<^sub>\<mu> sp' = sp o\<^sup>*\<^sub>\<mu> sp'"
   52.51    by (induct sp sp' rule: sp\<^sub>\<mu>_comp.induct) auto
   52.52 @@ -134,7 +134,7 @@
   52.53  lemma sp\<^sub>\<mu>_rel_map_map[unfolded vimage2p_def, simp]:
   52.54    "rel_sp\<^sub>\<mu> R1 R2 (map_sp\<^sub>\<mu> f1 f2 sp) (map_sp\<^sub>\<mu> g1 g2 sp') =
   52.55    rel_sp\<^sub>\<mu> (BNF_Def.vimage2p f1 g1 R1) (BNF_Def.vimage2p f2 g2 R2) sp sp'"
   52.56 -by (tactic {*
   52.57 +by (tactic \<open>
   52.58    let
   52.59      val ks = 1 upto 2;
   52.60      val ctxt = @{context};
   52.61 @@ -157,7 +157,7 @@
   52.62        hyp_subst_tac ctxt,
   52.63        assume_tac ctxt])
   52.64    end
   52.65 -*})
   52.66 +\<close>)
   52.67  
   52.68  lemma sp\<^sub>\<mu>_rel_self: "\<lbrakk>op = \<le> R1; op = \<le> R2\<rbrakk> \<Longrightarrow> rel_sp\<^sub>\<mu> R1 R2 x x"
   52.69    by (erule (1) predicate2D[OF sp\<^sub>\<mu>.rel_mono]) (simp only: sp\<^sub>\<mu>.rel_eq)
   52.70 @@ -166,7 +166,7 @@
   52.71    by (coinduction arbitrary: sp sp') (auto intro!: sp\<^sub>\<mu>_rel_self)
   52.72  
   52.73  
   52.74 -section {* Generalization to an Arbitrary BNF as Codomain *}
   52.75 +section \<open>Generalization to an Arbitrary BNF as Codomain\<close>
   52.76  
   52.77  bnf_axiomatization ('a, 'b) F for map: F
   52.78  
    53.1 --- a/src/HOL/Datatype_Examples/TreeFI.thy	Thu May 26 16:57:14 2016 +0200
    53.2 +++ b/src/HOL/Datatype_Examples/TreeFI.thy	Thu May 26 17:51:22 2016 +0200
    53.3 @@ -6,7 +6,7 @@
    53.4  Finitely branching possibly infinite trees.
    53.5  *)
    53.6  
    53.7 -section {* Finitely Branching Possibly Infinite Trees *}
    53.8 +section \<open>Finitely Branching Possibly Infinite Trees\<close>
    53.9  
   53.10  theory TreeFI
   53.11  imports Main
    54.1 --- a/src/HOL/Datatype_Examples/TreeFsetI.thy	Thu May 26 16:57:14 2016 +0200
    54.2 +++ b/src/HOL/Datatype_Examples/TreeFsetI.thy	Thu May 26 17:51:22 2016 +0200
    54.3 @@ -6,7 +6,7 @@
    54.4  Finitely branching possibly infinite trees, with sets of children.
    54.5  *)
    54.6  
    54.7 -section {* Finitely Branching Possibly Infinite Trees, with Sets of Children *}
    54.8 +section \<open>Finitely Branching Possibly Infinite Trees, with Sets of Children\<close>
    54.9  
   54.10  theory TreeFsetI
   54.11  imports "~~/src/HOL/Library/FSet"
    55.1 --- a/src/HOL/IMPP/Com.thy	Thu May 26 16:57:14 2016 +0200
    55.2 +++ b/src/HOL/IMPP/Com.thy	Thu May 26 17:51:22 2016 +0200
    55.3 @@ -2,7 +2,7 @@
    55.4      Author:   David von Oheimb (based on a theory by Tobias Nipkow et al), TUM
    55.5  *)
    55.6  
    55.7 -section {* Semantics of arithmetic and boolean expressions, Syntax of commands *}
    55.8 +section \<open>Semantics of arithmetic and boolean expressions, Syntax of commands\<close>
    55.9  
   55.10  theory Com
   55.11  imports Main
   55.12 @@ -83,10 +83,10 @@
   55.13    "WT_bodies = (!(pn,b):set bodies. WT b)"
   55.14  
   55.15  
   55.16 -ML {*
   55.17 +ML \<open>
   55.18    fun make_imp_tac ctxt =
   55.19      EVERY' [resolve_tac ctxt [mp], fn i => assume_tac ctxt (i + 1), eresolve_tac ctxt [thin_rl]]
   55.20 -*}
   55.21 +\<close>
   55.22  
   55.23  lemma finite_dom_body: "finite (dom body)"
   55.24  apply (unfold body_def)
    56.1 --- a/src/HOL/IMPP/EvenOdd.thy	Thu May 26 16:57:14 2016 +0200
    56.2 +++ b/src/HOL/IMPP/EvenOdd.thy	Thu May 26 17:51:22 2016 +0200
    56.3 @@ -2,7 +2,7 @@
    56.4      Author:     David von Oheimb, TUM
    56.5  *)
    56.6  
    56.7 -section {* Example of mutually recursive procedures verified with Hoare logic *}
    56.8 +section \<open>Example of mutually recursive procedures verified with Hoare logic\<close>
    56.9  
   56.10  theory EvenOdd
   56.11  imports Main Misc
    57.1 --- a/src/HOL/IMPP/Hoare.thy	Thu May 26 16:57:14 2016 +0200
    57.2 +++ b/src/HOL/IMPP/Hoare.thy	Thu May 26 17:51:22 2016 +0200
    57.3 @@ -3,18 +3,18 @@
    57.4      Copyright   1999 TUM
    57.5  *)
    57.6  
    57.7 -section {* Inductive definition of Hoare logic for partial correctness *}
    57.8 +section \<open>Inductive definition of Hoare logic for partial correctness\<close>
    57.9  
   57.10  theory Hoare
   57.11  imports Natural
   57.12  begin
   57.13  
   57.14 -text {*
   57.15 +text \<open>
   57.16    Completeness is taken relative to completeness of the underlying logic.
   57.17  
   57.18    Two versions of completeness proof: nested single recursion
   57.19    vs. simultaneous recursion in call rule
   57.20 -*}
   57.21 +\<close>
   57.22  
   57.23  type_synonym 'a assn = "'a => state => bool"
   57.24  translations
   57.25 @@ -105,7 +105,7 @@
   57.26               X:=CALL pn(a) .{Q}"
   57.27  
   57.28  
   57.29 -section {* Soundness and relative completeness of Hoare rules wrt operational semantics *}
   57.30 +section \<open>Soundness and relative completeness of Hoare rules wrt operational semantics\<close>
   57.31  
   57.32  lemma single_stateE:
   57.33    "state_not_singleton ==> !t. (!s::state. s = t) --> False"
   57.34 @@ -209,7 +209,7 @@
   57.35  *)
   57.36  lemma thin [rule_format]: "G'||-ts ==> !G. G' <= G --> G||-ts"
   57.37  apply (erule hoare_derivs.induct)
   57.38 -apply                (tactic {* ALLGOALS (EVERY'[clarify_tac @{context}, REPEAT o smp_tac @{context} 1]) *})
   57.39 +apply                (tactic \<open>ALLGOALS (EVERY'[clarify_tac @{context}, REPEAT o smp_tac @{context} 1])\<close>)
   57.40  apply (rule hoare_derivs.empty)
   57.41  apply               (erule (1) hoare_derivs.insert)
   57.42  apply              (fast intro: hoare_derivs.asm)
   57.43 @@ -218,7 +218,7 @@
   57.44  apply           (rule hoare_derivs.conseq, intro strip, tactic "smp_tac @{context} 2 1", clarify, tactic "smp_tac @{context} 1 1",rule exI, rule exI, erule (1) conjI)
   57.45  prefer 7
   57.46  apply          (rule_tac hoare_derivs.Body, drule_tac spec, erule_tac mp, fast)
   57.47 -apply         (tactic {* ALLGOALS (resolve_tac @{context} ((funpow 5 tl) @{thms hoare_derivs.intros}) THEN_ALL_NEW (fast_tac @{context})) *})
   57.48 +apply         (tactic \<open>ALLGOALS (resolve_tac @{context} ((funpow 5 tl) @{thms hoare_derivs.intros}) THEN_ALL_NEW (fast_tac @{context}))\<close>)
   57.49  done
   57.50  
   57.51  lemma weak_Body: "G|-{P}. the (body pn) .{Q} ==> G|-{P}. BODY pn .{Q}"
   57.52 @@ -278,19 +278,19 @@
   57.53  
   57.54  lemma hoare_sound: "G||-ts ==> G||=ts"
   57.55  apply (erule hoare_derivs.induct)
   57.56 -apply              (tactic {* TRYALL (eresolve_tac @{context} [@{thm Loop_sound_lemma}, @{thm Body_sound_lemma}] THEN_ALL_NEW assume_tac @{context}) *})
   57.57 +apply              (tactic \<open>TRYALL (eresolve_tac @{context} [@{thm Loop_sound_lemma}, @{thm Body_sound_lemma}] THEN_ALL_NEW assume_tac @{context})\<close>)
   57.58  apply            (unfold hoare_valids_def)
   57.59  apply            blast
   57.60  apply           blast
   57.61  apply          (blast) (* asm *)
   57.62  apply         (blast) (* cut *)
   57.63  apply        (blast) (* weaken *)
   57.64 -apply       (tactic {* ALLGOALS (EVERY'
   57.65 +apply       (tactic \<open>ALLGOALS (EVERY'
   57.66    [REPEAT o Rule_Insts.thin_tac @{context} "hoare_derivs _ _" [],
   57.67 -   simp_tac @{context}, clarify_tac @{context}, REPEAT o smp_tac @{context} 1]) *})
   57.68 +   simp_tac @{context}, clarify_tac @{context}, REPEAT o smp_tac @{context} 1])\<close>)
   57.69  apply       (simp_all (no_asm_use) add: triple_valid_def2)
   57.70  apply       (intro strip, tactic "smp_tac @{context} 2 1", blast) (* conseq *)
   57.71 -apply      (tactic {* ALLGOALS (clarsimp_tac @{context}) *}) (* Skip, Ass, Local *)
   57.72 +apply      (tactic \<open>ALLGOALS (clarsimp_tac @{context})\<close>) (* Skip, Ass, Local *)
   57.73  prefer 3 apply   (force) (* Call *)
   57.74  apply  (erule_tac [2] evaln_elim_cases) (* If *)
   57.75  apply   blast+
   57.76 @@ -335,24 +335,24 @@
   57.77  lemma MGF_lemma1 [rule_format (no_asm)]: "state_not_singleton ==>
   57.78    !pn:dom body. G|-{=}.BODY pn.{->} ==> WT c --> G|-{=}.c.{->}"
   57.79  apply (induct_tac c)
   57.80 -apply        (tactic {* ALLGOALS (clarsimp_tac @{context}) *})
   57.81 +apply        (tactic \<open>ALLGOALS (clarsimp_tac @{context})\<close>)
   57.82  prefer 7 apply        (fast intro: domI)
   57.83  apply (erule_tac [6] MGT_alternD)
   57.84  apply       (unfold MGT_def)
   57.85  apply       (drule_tac [7] bspec, erule_tac [7] domI)
   57.86 -apply       (rule_tac [7] escape, tactic {* clarsimp_tac @{context} 7 *},
   57.87 +apply       (rule_tac [7] escape, tactic \<open>clarsimp_tac @{context} 7\<close>,
   57.88    rename_tac [7] "fun" y Z,
   57.89    rule_tac [7] P1 = "%Z' s. s= (setlocs Z newlocs) [Loc Arg ::= fun Z]" in hoare_derivs.Call [THEN conseq1], erule_tac [7] conseq12)
   57.90  apply        (erule_tac [!] thin_rl)
   57.91  apply (rule hoare_derivs.Skip [THEN conseq2])
   57.92  apply (rule_tac [2] hoare_derivs.Ass [THEN conseq1])
   57.93 -apply        (rule_tac [3] escape, tactic {* clarsimp_tac @{context} 3 *},
   57.94 +apply        (rule_tac [3] escape, tactic \<open>clarsimp_tac @{context} 3\<close>,
   57.95    rename_tac [3] loc "fun" y Z,
   57.96    rule_tac [3] P1 = "%Z' s. s= (Z[Loc loc::=fun Z])" in hoare_derivs.Local [THEN conseq1],
   57.97    erule_tac [3] conseq12)
   57.98  apply         (erule_tac [5] hoare_derivs.Comp, erule_tac [5] conseq12)
   57.99 -apply         (tactic {* (resolve_tac @{context} @{thms hoare_derivs.If} THEN_ALL_NEW
  57.100 -                eresolve_tac @{context} @{thms conseq12}) 6 *})
  57.101 +apply         (tactic \<open>(resolve_tac @{context} @{thms hoare_derivs.If} THEN_ALL_NEW
  57.102 +                eresolve_tac @{context} @{thms conseq12}) 6\<close>)
  57.103  apply          (rule_tac [8] hoare_derivs.Loop [THEN conseq2], erule_tac [8] conseq12)
  57.104  apply           auto
  57.105  done
  57.106 @@ -367,7 +367,7 @@
  57.107    shows "finite U ==> uG = mgt_call`U ==>
  57.108    !G. G <= uG --> n <= card uG --> card G = card uG - n --> (!c. wt c --> P G {mgt c})"
  57.109  apply (induct_tac n)
  57.110 -apply  (tactic {* ALLGOALS (clarsimp_tac @{context}) *})
  57.111 +apply  (tactic \<open>ALLGOALS (clarsimp_tac @{context})\<close>)
  57.112  apply  (subgoal_tac "G = mgt_call ` U")
  57.113  prefer 2
  57.114  apply   (simp add: card_seteq)
    58.1 --- a/src/HOL/IMPP/Misc.thy	Thu May 26 16:57:14 2016 +0200
    58.2 +++ b/src/HOL/IMPP/Misc.thy	Thu May 26 17:51:22 2016 +0200
    58.3 @@ -2,7 +2,7 @@
    58.4      Author:     David von Oheimb, TUM
    58.5  *)
    58.6  
    58.7 -section {* Several examples for Hoare logic *}
    58.8 +section \<open>Several examples for Hoare logic\<close>
    58.9  
   58.10  theory Misc
   58.11  imports Hoare
    59.1 --- a/src/HOL/IMPP/Natural.thy	Thu May 26 16:57:14 2016 +0200
    59.2 +++ b/src/HOL/IMPP/Natural.thy	Thu May 26 17:51:22 2016 +0200
    59.3 @@ -2,7 +2,7 @@
    59.4      Author:     David von Oheimb (based on a theory by Tobias Nipkow et al), TUM
    59.5  *)
    59.6  
    59.7 -section {* Natural semantics of commands *}
    59.8 +section \<open>Natural semantics of commands\<close>
    59.9  
   59.10  theory Natural
   59.11  imports Com
   59.12 @@ -111,9 +111,9 @@
   59.13  
   59.14  lemma evaln_evalc: "<c,s> -n-> t ==> <c,s> -c-> t"
   59.15  apply (erule evaln.induct)
   59.16 -apply (tactic {*
   59.17 +apply (tactic \<open>
   59.18    ALLGOALS (resolve_tac @{context} @{thms evalc.intros} THEN_ALL_NEW assume_tac @{context})
   59.19 -*})
   59.20 +\<close>)
   59.21  done
   59.22  
   59.23  lemma Suc_le_D_lemma: "[| Suc n <= m'; (!!m. n <= m ==> P (Suc m)) |] ==> P m'"
   59.24 @@ -139,12 +139,12 @@
   59.25  
   59.26  lemma evalc_evaln: "<c,s> -c-> t ==> ? n. <c,s> -n-> t"
   59.27  apply (erule evalc.induct)
   59.28 -apply (tactic {* ALLGOALS (REPEAT o eresolve_tac @{context} [exE]) *})
   59.29 -apply (tactic {* TRYALL (EVERY' [dresolve_tac @{context} @{thms evaln_max2}, assume_tac @{context},
   59.30 -  REPEAT o eresolve_tac @{context} [exE, conjE]]) *})
   59.31 +apply (tactic \<open>ALLGOALS (REPEAT o eresolve_tac @{context} [exE])\<close>)
   59.32 +apply (tactic \<open>TRYALL (EVERY' [dresolve_tac @{context} @{thms evaln_max2}, assume_tac @{context},
   59.33 +  REPEAT o eresolve_tac @{context} [exE, conjE]])\<close>)
   59.34  apply (tactic
   59.35 -  {* ALLGOALS (resolve_tac @{context} [exI] THEN'
   59.36 -    resolve_tac @{context} @{thms evaln.intros} THEN_ALL_NEW assume_tac @{context}) *})
   59.37 +  \<open>ALLGOALS (resolve_tac @{context} [exI] THEN'
   59.38 +    resolve_tac @{context} @{thms evaln.intros} THEN_ALL_NEW assume_tac @{context})\<close>)
   59.39  done
   59.40  
   59.41  lemma eval_eq: "<c,s> -c-> t = (? n. <c,s> -n-> t)"
    60.1 --- a/src/HOL/IOA/Asig.thy	Thu May 26 16:57:14 2016 +0200
    60.2 +++ b/src/HOL/IOA/Asig.thy	Thu May 26 17:51:22 2016 +0200
    60.3 @@ -3,7 +3,7 @@
    60.4      Copyright   1994  TU Muenchen
    60.5  *)
    60.6  
    60.7 -section {* Action signatures *}
    60.8 +section \<open>Action signatures\<close>
    60.9  
   60.10  theory Asig
   60.11  imports Main
    61.1 --- a/src/HOL/IOA/IOA.thy	Thu May 26 16:57:14 2016 +0200
    61.2 +++ b/src/HOL/IOA/IOA.thy	Thu May 26 17:51:22 2016 +0200
    61.3 @@ -3,7 +3,7 @@
    61.4      Copyright   1994  TU Muenchen
    61.5  *)
    61.6  
    61.7 -section {* The I/O automata of Lynch and Tuttle *}
    61.8 +section \<open>The I/O automata of Lynch and Tuttle\<close>
    61.9  
   61.10  theory IOA
   61.11  imports Asig
    62.1 --- a/src/HOL/IOA/Solve.thy	Thu May 26 16:57:14 2016 +0200
    62.2 +++ b/src/HOL/IOA/Solve.thy	Thu May 26 17:51:22 2016 +0200
    62.3 @@ -3,7 +3,7 @@
    62.4      Copyright   1994  TU Muenchen
    62.5  *)
    62.6  
    62.7 -section {* Weak possibilities mapping (abstraction) *}
    62.8 +section \<open>Weak possibilities mapping (abstraction)\<close>
    62.9  
   62.10  theory Solve
   62.11  imports IOA
   62.12 @@ -144,9 +144,9 @@
   62.13    prefer 2
   62.14    apply force
   62.15    apply (simp (no_asm) add: conj_disj_distribR cong add: conj_cong split add: if_split)
   62.16 -  apply (tactic {*
   62.17 +  apply (tactic \<open>
   62.18      REPEAT((resolve_tac @{context} [conjI, impI] 1 ORELSE eresolve_tac @{context} [conjE] 1) THEN
   62.19 -      asm_full_simp_tac(@{context} addsimps [@{thm comp1_reachable}, @{thm comp2_reachable}]) 1) *})
   62.20 +      asm_full_simp_tac(@{context} addsimps [@{thm comp1_reachable}, @{thm comp2_reachable}]) 1)\<close>)
   62.21    done
   62.22  
   62.23  
    63.1 --- a/src/HOL/Imperative_HOL/Array.thy	Thu May 26 16:57:14 2016 +0200
    63.2 +++ b/src/HOL/Imperative_HOL/Array.thy	Thu May 26 17:51:22 2016 +0200
    63.3 @@ -2,13 +2,13 @@
    63.4      Author:     John Matthews, Galois Connections; Alexander Krauss, Lukas Bulwahn & Florian Haftmann, TU Muenchen
    63.5  *)
    63.6  
    63.7 -section {* Monadic arrays *}
    63.8 +section \<open>Monadic arrays\<close>
    63.9  
   63.10  theory Array
   63.11  imports Heap_Monad
   63.12  begin
   63.13  
   63.14 -subsection {* Primitives *}
   63.15 +subsection \<open>Primitives\<close>
   63.16  
   63.17  definition present :: "heap \<Rightarrow> 'a::heap array \<Rightarrow> bool" where
   63.18    "present h a \<longleftrightarrow> addr_of_array a < lim h"
   63.19 @@ -36,7 +36,7 @@
   63.20    "r =!!= s \<longleftrightarrow> TYPEREP('a) \<noteq> TYPEREP('b) \<or> addr_of_array r \<noteq> addr_of_array s"
   63.21  
   63.22  
   63.23 -subsection {* Monad operations *}
   63.24 +subsection \<open>Monad operations\<close>
   63.25  
   63.26  definition new :: "nat \<Rightarrow> 'a::heap \<Rightarrow> 'a array Heap" where
   63.27    [code del]: "new n x = Heap_Monad.heap (alloc (replicate n x))"
   63.28 @@ -70,12 +70,12 @@
   63.29    [code del]: "freeze a = Heap_Monad.tap (\<lambda>h. get h a)"
   63.30  
   63.31  
   63.32 -subsection {* Properties *}
   63.33 +subsection \<open>Properties\<close>
   63.34  
   63.35 -text {* FIXME: Does there exist a "canonical" array axiomatisation in
   63.36 -the literature?  *}
   63.37 +text \<open>FIXME: Does there exist a "canonical" array axiomatisation in
   63.38 +the literature?\<close>
   63.39  
   63.40 -text {* Primitives *}
   63.41 +text \<open>Primitives\<close>
   63.42  
   63.43  lemma noteq_sym: "a =!!= b \<Longrightarrow> b =!!= a"
   63.44    and unequal [simp]: "a \<noteq> a' \<longleftrightarrow> a =!!= a'"
   63.45 @@ -160,7 +160,7 @@
   63.46    by (simp add: present_def alloc_def Let_def)
   63.47  
   63.48  
   63.49 -text {* Monad operations *}
   63.50 +text \<open>Monad operations\<close>
   63.51  
   63.52  lemma execute_new [execute_simps]:
   63.53    "execute (new n x) h = Some (alloc (replicate n x) h)"
   63.54 @@ -352,9 +352,9 @@
   63.55  hide_const (open) present get set alloc length update noteq new of_list make len nth upd map_entry swap freeze
   63.56  
   63.57  
   63.58 -subsection {* Code generator setup *}
   63.59 +subsection \<open>Code generator setup\<close>
   63.60  
   63.61 -subsubsection {* Logical intermediate layer *}
   63.62 +subsubsection \<open>Logical intermediate layer\<close>
   63.63  
   63.64  definition new' where
   63.65    [code del]: "new' = Array.new o nat_of_integer"
   63.66 @@ -439,7 +439,7 @@
   63.67  hide_const (open) new' make' len' nth' upd'
   63.68  
   63.69  
   63.70 -text {* SML *}
   63.71 +text \<open>SML\<close>
   63.72  
   63.73  code_printing type_constructor array \<rightharpoonup> (SML) "_/ array"
   63.74  code_printing constant Array \<rightharpoonup> (SML) "raise/ (Fail/ \"bare Array\")"
   63.75 @@ -454,7 +454,7 @@
   63.76  code_reserved SML Array
   63.77  
   63.78  
   63.79 -text {* OCaml *}
   63.80 +text \<open>OCaml\<close>
   63.81  
   63.82  code_printing type_constructor array \<rightharpoonup> (OCaml) "_/ array"
   63.83  code_printing constant Array \<rightharpoonup> (OCaml) "failwith/ \"bare Array\""
   63.84 @@ -470,7 +470,7 @@
   63.85  code_reserved OCaml Array
   63.86  
   63.87  
   63.88 -text {* Haskell *}
   63.89 +text \<open>Haskell\<close>
   63.90  
   63.91  code_printing type_constructor array \<rightharpoonup> (Haskell) "Heap.STArray/ Heap.RealWorld/ _"
   63.92  code_printing constant Array \<rightharpoonup> (Haskell) "error/ \"bare Array\""
   63.93 @@ -484,7 +484,7 @@
   63.94  code_printing class_instance array :: HOL.equal \<rightharpoonup> (Haskell) -
   63.95  
   63.96  
   63.97 -text {* Scala *}
   63.98 +text \<open>Scala\<close>
   63.99  
  63.100  code_printing type_constructor array \<rightharpoonup> (Scala) "!collection.mutable.ArraySeq[_]"
  63.101  code_printing constant Array \<rightharpoonup> (Scala) "!sys.error(\"bare Array\")"
    64.1 --- a/src/HOL/Imperative_HOL/Heap.thy	Thu May 26 16:57:14 2016 +0200
    64.2 +++ b/src/HOL/Imperative_HOL/Heap.thy	Thu May 26 17:51:22 2016 +0200
    64.3 @@ -2,15 +2,15 @@
    64.4      Author:     John Matthews, Galois Connections; Alexander Krauss, TU Muenchen
    64.5  *)
    64.6  
    64.7 -section {* A polymorphic heap based on cantor encodings *}
    64.8 +section \<open>A polymorphic heap based on cantor encodings\<close>
    64.9  
   64.10  theory Heap
   64.11  imports Main "~~/src/HOL/Library/Countable"
   64.12  begin
   64.13  
   64.14 -subsection {* Representable types *}
   64.15 +subsection \<open>Representable types\<close>
   64.16  
   64.17 -text {* The type class of representable types *}
   64.18 +text \<open>The type class of representable types\<close>
   64.19  
   64.20  class heap = typerep + countable
   64.21  
   64.22 @@ -35,15 +35,15 @@
   64.23  instance typerep :: heap ..
   64.24  
   64.25  
   64.26 -subsection {* A polymorphic heap with dynamic arrays and references *}
   64.27 +subsection \<open>A polymorphic heap with dynamic arrays and references\<close>
   64.28  
   64.29 -text {*
   64.30 +text \<open>
   64.31    References and arrays are developed in parallel,
   64.32    but keeping them separate makes some later proofs simpler.
   64.33 -*}
   64.34 +\<close>
   64.35  
   64.36 -type_synonym addr = nat -- "untyped heap references"
   64.37 -type_synonym heap_rep = nat -- "representable values"
   64.38 +type_synonym addr = nat \<comment> "untyped heap references"
   64.39 +type_synonym heap_rep = nat \<comment> "representable values"
   64.40  
   64.41  record heap =
   64.42    arrays :: "typerep \<Rightarrow> addr \<Rightarrow> heap_rep list"
   64.43 @@ -53,8 +53,8 @@
   64.44  definition empty :: heap where
   64.45    "empty = \<lparr>arrays = (\<lambda>_ _. []), refs = (\<lambda>_ _. 0), lim = 0\<rparr>"
   64.46  
   64.47 -datatype 'a array = Array addr -- "note the phantom type 'a"
   64.48 -datatype 'a ref = Ref addr -- "note the phantom type 'a"
   64.49 +datatype 'a array = Array addr \<comment> "note the phantom type 'a"
   64.50 +datatype 'a ref = Ref addr \<comment> "note the phantom type 'a"
   64.51  
   64.52  primrec addr_of_array :: "'a array \<Rightarrow> addr" where
   64.53    "addr_of_array (Array x) = x"
   64.54 @@ -76,14 +76,14 @@
   64.55  instance ref :: (type) countable
   64.56    by (rule countable_classI [of addr_of_ref]) simp
   64.57  
   64.58 -text {* Syntactic convenience *}
   64.59 +text \<open>Syntactic convenience\<close>
   64.60  
   64.61 -setup {*
   64.62 +setup \<open>
   64.63    Sign.add_const_constraint (@{const_name Array}, SOME @{typ "nat \<Rightarrow> 'a::heap array"})
   64.64    #> Sign.add_const_constraint (@{const_name Ref}, SOME @{typ "nat \<Rightarrow> 'a::heap ref"})
   64.65    #> Sign.add_const_constraint (@{const_name addr_of_array}, SOME @{typ "'a::heap array \<Rightarrow> nat"})
   64.66    #> Sign.add_const_constraint (@{const_name addr_of_ref}, SOME @{typ "'a::heap ref \<Rightarrow> nat"})
   64.67 -*}
   64.68 +\<close>
   64.69  
   64.70  hide_const (open) empty
   64.71  
    65.1 --- a/src/HOL/Imperative_HOL/Heap_Monad.thy	Thu May 26 16:57:14 2016 +0200
    65.2 +++ b/src/HOL/Imperative_HOL/Heap_Monad.thy	Thu May 26 17:51:22 2016 +0200
    65.3 @@ -2,7 +2,7 @@
    65.4      Author:     John Matthews, Galois Connections; Alexander Krauss, Lukas Bulwahn & Florian Haftmann, TU Muenchen
    65.5  *)
    65.6  
    65.7 -section {* A monad with a polymorphic heap and primitive reasoning infrastructure *}
    65.8 +section \<open>A monad with a polymorphic heap and primitive reasoning infrastructure\<close>
    65.9  
   65.10  theory Heap_Monad
   65.11  imports
   65.12 @@ -10,12 +10,12 @@
   65.13    "~~/src/HOL/Library/Monad_Syntax"
   65.14  begin
   65.15  
   65.16 -subsection {* The monad *}
   65.17 +subsection \<open>The monad\<close>
   65.18  
   65.19 -subsubsection {* Monad construction *}
   65.20 +subsubsection \<open>Monad construction\<close>
   65.21  
   65.22 -text {* Monadic heap actions either produce values
   65.23 -  and transform the heap, or fail *}
   65.24 +text \<open>Monadic heap actions either produce values
   65.25 +  and transform the heap, or fail\<close>
   65.26  datatype 'a Heap = Heap "heap \<Rightarrow> ('a \<times> heap) option"
   65.27  
   65.28  lemma [code, code del]:
   65.29 @@ -46,7 +46,7 @@
   65.30    by (simp add: Let_def)
   65.31  
   65.32  
   65.33 -subsubsection {* Specialised lifters *}
   65.34 +subsubsection \<open>Specialised lifters\<close>
   65.35  
   65.36  definition tap :: "(heap \<Rightarrow> 'a) \<Rightarrow> 'a Heap" where
   65.37    [code del]: "tap f = Heap (\<lambda>h. Some (f h, h))"
   65.38 @@ -71,7 +71,7 @@
   65.39    by (simp_all add: guard_def)
   65.40  
   65.41  
   65.42 -subsubsection {* Predicate classifying successful computations *}
   65.43 +subsubsection \<open>Predicate classifying successful computations\<close>
   65.44  
   65.45  definition success :: "'a Heap \<Rightarrow> heap \<Rightarrow> bool" where
   65.46    "success f h \<longleftrightarrow> execute f h \<noteq> None"
   65.47 @@ -109,13 +109,13 @@
   65.48    by (simp add: success_def)
   65.49  
   65.50  
   65.51 -subsubsection {* Predicate for a simple relational calculus *}
   65.52 +subsubsection \<open>Predicate for a simple relational calculus\<close>
   65.53  
   65.54 -text {*
   65.55 -  The @{text effect} predicate states that when a computation @{text c}
   65.56 -  runs with the heap @{text h} will result in return value @{text r}
   65.57 -  and a heap @{text "h'"}, i.e.~no exception occurs.
   65.58 -*}  
   65.59 +text \<open>
   65.60 +  The \<open>effect\<close> predicate states that when a computation \<open>c\<close>
   65.61 +  runs with the heap \<open>h\<close> will result in return value \<open>r\<close>
   65.62 +  and a heap \<open>h'\<close>, i.e.~no exception occurs.
   65.63 +\<close>  
   65.64  
   65.65  definition effect :: "'a Heap \<Rightarrow> heap \<Rightarrow> heap \<Rightarrow> 'a \<Rightarrow> bool" where
   65.66    effect_def: "effect c h h' r \<longleftrightarrow> execute c h = Some (r, h')"
   65.67 @@ -210,7 +210,7 @@
   65.68      (auto simp add: execute_simps elim!: successE, cases "P h", auto simp add: execute_simps)
   65.69  
   65.70  
   65.71 -subsubsection {* Monad combinators *}
   65.72 +subsubsection \<open>Monad combinators\<close>
   65.73  
   65.74  definition return :: "'a \<Rightarrow> 'a Heap" where
   65.75    [code del]: "return x = heap (Pair x)"
   65.76 @@ -232,7 +232,7 @@
   65.77    obtains "r = x" "h' = h"
   65.78    using assms by (rule effectE) (simp add: execute_simps)
   65.79  
   65.80 -definition raise :: "string \<Rightarrow> 'a Heap" where -- {* the string is just decoration *}
   65.81 +definition raise :: "string \<Rightarrow> 'a Heap" where \<comment> \<open>the string is just decoration\<close>
   65.82    [code del]: "raise s = Heap (\<lambda>_. None)"
   65.83  
   65.84  lemma execute_raise [execute_simps]:
   65.85 @@ -306,9 +306,9 @@
   65.86    by (rule Heap_eqI) (simp add: execute_simps)
   65.87  
   65.88  
   65.89 -subsection {* Generic combinators *}
   65.90 +subsection \<open>Generic combinators\<close>
   65.91  
   65.92 -subsubsection {* Assertions *}
   65.93 +subsubsection \<open>Assertions\<close>
   65.94  
   65.95  definition assert :: "('a \<Rightarrow> bool) \<Rightarrow> 'a \<Rightarrow> 'a Heap" where
   65.96    "assert P x = (if P x then return x else raise ''assert'')"
   65.97 @@ -338,7 +338,7 @@
   65.98    by (rule Heap_eqI) (insert assms, simp add: assert_def)
   65.99  
  65.100  
  65.101 -subsubsection {* Plain lifting *}
  65.102 +subsubsection \<open>Plain lifting\<close>
  65.103  
  65.104  definition lift :: "('a \<Rightarrow> 'b) \<Rightarrow> 'a \<Rightarrow> 'b Heap" where
  65.105    "lift f = return o f"
  65.106 @@ -352,7 +352,7 @@
  65.107    by (simp add: lift_def comp_def)
  65.108  
  65.109  
  65.110 -subsubsection {* Iteration -- warning: this is rarely useful! *}
  65.111 +subsubsection \<open>Iteration -- warning: this is rarely useful!\<close>
  65.112  
  65.113  primrec fold_map :: "('a \<Rightarrow> 'b Heap) \<Rightarrow> 'a list \<Rightarrow> 'b list Heap" where
  65.114    "fold_map f [] = return []"
  65.115 @@ -382,7 +382,7 @@
  65.116  qed
  65.117  
  65.118  
  65.119 -subsection {* Partial function definition setup *}
  65.120 +subsection \<open>Partial function definition setup\<close>
  65.121  
  65.122  definition Heap_ord :: "'a Heap \<Rightarrow> 'a Heap \<Rightarrow> bool" where
  65.123    "Heap_ord = img_ord execute (fun_ord option_ord)"
  65.124 @@ -455,9 +455,9 @@
  65.125    unfolding effect_def execute.simps
  65.126    by blast
  65.127  
  65.128 -declaration {* Partial_Function.init "heap" @{term heap.fixp_fun}
  65.129 +declaration \<open>Partial_Function.init "heap" @{term heap.fixp_fun}
  65.130    @{term heap.mono_body} @{thm heap.fixp_rule_uc} @{thm heap.fixp_induct_uc}
  65.131 -  (SOME @{thm fixp_induct_heap}) *}
  65.132 +  (SOME @{thm fixp_induct_heap})\<close>
  65.133  
  65.134  
  65.135  abbreviation "mono_Heap \<equiv> monotone (fun_ord Heap_ord) Heap_ord"
  65.136 @@ -516,9 +516,9 @@
  65.137  qed
  65.138  
  65.139  
  65.140 -subsection {* Code generator setup *}
  65.141 +subsection \<open>Code generator setup\<close>
  65.142  
  65.143 -subsubsection {* Logical intermediate layer *}
  65.144 +subsubsection \<open>Logical intermediate layer\<close>
  65.145  
  65.146  definition raise' :: "String.literal \<Rightarrow> 'a Heap" where
  65.147    [code del]: "raise' s = raise (String.explode s)"
  65.148 @@ -530,10 +530,10 @@
  65.149    "raise s = raise' (STR s)"
  65.150    unfolding raise'_def by (simp add: STR_inverse)
  65.151  
  65.152 -code_datatype raise' -- {* avoid @{const "Heap"} formally *}
  65.153 +code_datatype raise' \<comment> \<open>avoid @{const "Heap"} formally\<close>
  65.154  
  65.155  
  65.156 -subsubsection {* SML and OCaml *}
  65.157 +subsubsection \<open>SML and OCaml\<close>
  65.158  
  65.159  code_printing type_constructor Heap \<rightharpoonup> (SML) "(unit/ ->/ _)"
  65.160  code_printing constant bind \<rightharpoonup> (SML) "!(fn/ f'_/ =>/ fn/ ()/ =>/ f'_/ (_/ ())/ ())"
  65.161 @@ -546,12 +546,12 @@
  65.162  code_printing constant Heap_Monad.raise' \<rightharpoonup> (OCaml) "failwith"
  65.163  
  65.164  
  65.165 -subsubsection {* Haskell *}
  65.166 +subsubsection \<open>Haskell\<close>
  65.167  
  65.168 -text {* Adaption layer *}
  65.169 +text \<open>Adaption layer\<close>
  65.170  
  65.171  code_printing code_module "Heap" \<rightharpoonup> (Haskell)
  65.172 -{*import qualified Control.Monad;
  65.173 +\<open>import qualified Control.Monad;
  65.174  import qualified Control.Monad.ST;
  65.175  import qualified Data.STRef;
  65.176  import qualified Data.Array.ST;
  65.177 @@ -581,11 +581,11 @@
  65.178  readArray = Data.Array.ST.readArray;
  65.179  
  65.180  writeArray :: STArray s a -> Integer -> a -> ST s ();
  65.181 -writeArray = Data.Array.ST.writeArray;*}
  65.182 +writeArray = Data.Array.ST.writeArray;\<close>
  65.183  
  65.184  code_reserved Haskell Heap
  65.185  
  65.186 -text {* Monad *}
  65.187 +text \<open>Monad\<close>
  65.188  
  65.189  code_printing type_constructor Heap \<rightharpoonup> (Haskell) "Heap.ST/ Heap.RealWorld/ _"
  65.190  code_monad bind Haskell
  65.191 @@ -593,10 +593,10 @@
  65.192  code_printing constant Heap_Monad.raise' \<rightharpoonup> (Haskell) "error"
  65.193  
  65.194  
  65.195 -subsubsection {* Scala *}
  65.196 +subsubsection \<open>Scala\<close>
  65.197  
  65.198  code_printing code_module "Heap" \<rightharpoonup> (Scala)
  65.199 -{*object Heap {
  65.200 +\<open>object Heap {
  65.201    def bind[A, B](f: Unit => A, g: A => Unit => B): Unit => B = (_: Unit) => g (f ()) ()
  65.202  }
  65.203  
  65.204 @@ -628,7 +628,7 @@
  65.205    def freeze[A](a: ArraySeq[A]): List[A] =
  65.206      a.toList
  65.207  }
  65.208 -*}
  65.209 +\<close>
  65.210  
  65.211  code_reserved Scala Heap Ref Array
  65.212  
  65.213 @@ -638,9 +638,9 @@
  65.214  code_printing constant Heap_Monad.raise' \<rightharpoonup> (Scala) "!sys.error((_))"
  65.215  
  65.216  
  65.217 -subsubsection {* Target variants with less units *}
  65.218 +subsubsection \<open>Target variants with less units\<close>
  65.219  
  65.220 -setup {*
  65.221 +setup \<open>
  65.222  
  65.223  let
  65.224  
  65.225 @@ -703,7 +703,7 @@
  65.226  
  65.227  end
  65.228  
  65.229 -*}
  65.230 +\<close>
  65.231  
  65.232  hide_const (open) Heap heap guard raise' fold_map
  65.233  
    66.1 --- a/src/HOL/Imperative_HOL/Imperative_HOL.thy	Thu May 26 16:57:14 2016 +0200
    66.2 +++ b/src/HOL/Imperative_HOL/Imperative_HOL.thy	Thu May 26 17:51:22 2016 +0200
    66.3 @@ -2,7 +2,7 @@
    66.4      Author:     John Matthews, Galois Connections; Alexander Krauss, Lukas Bulwahn & Florian Haftmann, TU Muenchen
    66.5  *)
    66.6  
    66.7 -section {* Entry point into monadic imperative HOL *}
    66.8 +section \<open>Entry point into monadic imperative HOL\<close>
    66.9  
   66.10  theory Imperative_HOL
   66.11  imports Array Ref
    67.1 --- a/src/HOL/Imperative_HOL/Imperative_HOL_ex.thy	Thu May 26 16:57:14 2016 +0200
    67.2 +++ b/src/HOL/Imperative_HOL/Imperative_HOL_ex.thy	Thu May 26 17:51:22 2016 +0200
    67.3 @@ -3,7 +3,7 @@
    67.4                  Alexander Krauss, Lukas Bulwahn & Florian Haftmann, TU Muenchen
    67.5  *)
    67.6  
    67.7 -section {* Monadic imperative HOL with examples *}
    67.8 +section \<open>Monadic imperative HOL with examples\<close>
    67.9  
   67.10  theory Imperative_HOL_ex
   67.11  imports Imperative_HOL Overview
    68.1 --- a/src/HOL/Imperative_HOL/Overview.thy	Thu May 26 16:57:14 2016 +0200
    68.2 +++ b/src/HOL/Imperative_HOL/Overview.thy	Thu May 26 17:51:22 2016 +0200
    68.3 @@ -17,9 +17,9 @@
    68.4    "_constrain" :: "prop' => type => prop'"  ("_ :: _" [4, 0] 3)
    68.5  (*>*)
    68.6  
    68.7 -text {*
    68.8 -  @{text "Imperative HOL"} is a leightweight framework for reasoning
    68.9 -  about imperative data structures in @{text "Isabelle/HOL"}
   68.10 +text \<open>
   68.11 +  \<open>Imperative HOL\<close> is a leightweight framework for reasoning
   68.12 +  about imperative data structures in \<open>Isabelle/HOL\<close>
   68.13    @{cite "Nipkow-et-al:2002:tutorial"}.  Its basic ideas are described in
   68.14    @{cite "Bulwahn-et-al:2008:imp_HOL"}.  However their concrete
   68.15    realisation has changed since, due to both extensions and
   68.16 @@ -27,16 +27,16 @@
   68.17    \qt{as it is} by now.  It focusses on the user-view, less on matters
   68.18    of construction.  For details study of the theory sources is
   68.19    encouraged.
   68.20 -*}
   68.21 +\<close>
   68.22  
   68.23  
   68.24 -section {* A polymorphic heap inside a monad *}
   68.25 +section \<open>A polymorphic heap inside a monad\<close>
   68.26  
   68.27 -text {*
   68.28 +text \<open>
   68.29    Heaps (@{type heap}) can be populated by values of class @{class
   68.30    heap}; HOL's default types are already instantiated to class @{class
   68.31    heap}.  Class @{class heap} is a subclass of @{class countable};  see
   68.32 -  theory @{text Countable} for ways to instantiate types as @{class countable}.
   68.33 +  theory \<open>Countable\<close> for ways to instantiate types as @{class countable}.
   68.34  
   68.35    The heap is wrapped up in a monad @{typ "'a Heap"} by means of the
   68.36    following specification:
   68.37 @@ -53,11 +53,11 @@
   68.38    \end{quote}
   68.39  
   68.40    This allows for equational reasoning about monadic expressions; the
   68.41 -  fact collection @{text execute_simps} contains appropriate rewrites
   68.42 +  fact collection \<open>execute_simps\<close> contains appropriate rewrites
   68.43    for all fundamental operations.
   68.44  
   68.45    Primitive fine-granular control over heaps is available through rule
   68.46 -  @{text Heap_cases}:
   68.47 +  \<open>Heap_cases\<close>:
   68.48  
   68.49    \begin{quote}
   68.50      @{thm [break] Heap_cases [no_vars]}
   68.51 @@ -81,22 +81,21 @@
   68.52      @{term_type assert} \\
   68.53      @{thm assert_def [no_vars]}
   68.54    \end{quote}
   68.55 -*}
   68.56 +\<close>
   68.57  
   68.58  
   68.59 -section {* Relational reasoning about @{type Heap} expressions *}
   68.60 +section \<open>Relational reasoning about @{type Heap} expressions\<close>
   68.61  
   68.62 -text {*
   68.63 +text \<open>
   68.64    To establish correctness of imperative programs, predicate
   68.65  
   68.66    \begin{quote}
   68.67      @{term_type effect}
   68.68    \end{quote}
   68.69  
   68.70 -  provides a simple relational calculus.  Primitive rules are @{text
   68.71 -  effectI} and @{text effectE}, rules appropriate for reasoning about
   68.72 -  imperative operations are available in the @{text effect_intros} and
   68.73 -  @{text effect_elims} fact collections.
   68.74 +  provides a simple relational calculus.  Primitive rules are \<open>effectI\<close> and \<open>effectE\<close>, rules appropriate for reasoning about
   68.75 +  imperative operations are available in the \<open>effect_intros\<close> and
   68.76 +  \<open>effect_elims\<close> fact collections.
   68.77  
   68.78    Often non-failure of imperative computations does not depend
   68.79    on the heap at all;  reasoning then can be easier using predicate
   68.80 @@ -106,18 +105,16 @@
   68.81    \end{quote}
   68.82  
   68.83    Introduction rules for @{const success} are available in the
   68.84 -  @{text success_intro} fact collection.
   68.85 +  \<open>success_intro\<close> fact collection.
   68.86  
   68.87    @{const execute}, @{const effect}, @{const success} and @{const bind}
   68.88 -  are related by rules @{text execute_bind_success}, @{text
   68.89 -  success_bind_executeI}, @{text success_bind_effectI}, @{text
   68.90 -  effect_bindI}, @{text effect_bindE} and @{text execute_bind_eq_SomeI}.
   68.91 -*}
   68.92 +  are related by rules \<open>execute_bind_success\<close>, \<open>success_bind_executeI\<close>, \<open>success_bind_effectI\<close>, \<open>effect_bindI\<close>, \<open>effect_bindE\<close> and \<open>execute_bind_eq_SomeI\<close>.
   68.93 +\<close>
   68.94  
   68.95  
   68.96 -section {* Monadic data structures *}
   68.97 +section \<open>Monadic data structures\<close>
   68.98  
   68.99 -text {*
  68.100 +text \<open>
  68.101    The operations for monadic data structures (arrays and references)
  68.102    come in two flavours:
  68.103  
  68.104 @@ -136,11 +133,11 @@
  68.105  
  68.106    Note that HOL equality coincides with reference equality and may be
  68.107    used as primitive executable operation.
  68.108 -*}
  68.109 +\<close>
  68.110  
  68.111 -subsection {* Arrays *}
  68.112 +subsection \<open>Arrays\<close>
  68.113  
  68.114 -text {*
  68.115 +text \<open>
  68.116    Heap operations:
  68.117  
  68.118    \begin{quote}
  68.119 @@ -166,11 +163,11 @@
  68.120      @{term_type Array.swap} \\
  68.121      @{term_type Array.freeze}
  68.122    \end{quote}
  68.123 -*}
  68.124 +\<close>
  68.125  
  68.126 -subsection {* References *}
  68.127 +subsection \<open>References\<close>
  68.128  
  68.129 -text {*
  68.130 +text \<open>
  68.131    Heap operations:
  68.132  
  68.133    \begin{quote}
  68.134 @@ -189,26 +186,26 @@
  68.135      @{term_type Ref.update} \\
  68.136      @{term_type Ref.change}
  68.137    \end{quote}
  68.138 -*}
  68.139 +\<close>
  68.140  
  68.141  
  68.142 -section {* Code generation *}
  68.143 +section \<open>Code generation\<close>
  68.144  
  68.145 -text {*
  68.146 +text \<open>
  68.147    Imperative HOL sets up the code generator in a way that imperative
  68.148    operations are mapped to suitable counterparts in the target
  68.149 -  language.  For @{text Haskell}, a suitable @{text ST} monad is used;
  68.150 -  for @{text SML}, @{text Ocaml} and @{text Scala} unit values ensure
  68.151 +  language.  For \<open>Haskell\<close>, a suitable \<open>ST\<close> monad is used;
  68.152 +  for \<open>SML\<close>, \<open>Ocaml\<close> and \<open>Scala\<close> unit values ensure
  68.153    that the evaluation order is the same as you would expect from the
  68.154    original monadic expressions.  These units may look cumbersome; the
  68.155 -  target language variants @{text SML_imp}, @{text Ocaml_imp} and
  68.156 -  @{text Scala_imp} make some effort to optimize some of them away.
  68.157 -*}
  68.158 +  target language variants \<open>SML_imp\<close>, \<open>Ocaml_imp\<close> and
  68.159 +  \<open>Scala_imp\<close> make some effort to optimize some of them away.
  68.160 +\<close>
  68.161  
  68.162  
  68.163 -section {* Some hints for using the framework *}
  68.164 +section \<open>Some hints for using the framework\<close>
  68.165  
  68.166 -text {*
  68.167 +text \<open>
  68.168    Of course a framework itself does not by itself indicate how to make
  68.169    best use of it.  Here some hints drawn from prior experiences with
  68.170    Imperative HOL:
  68.171 @@ -228,8 +225,8 @@
  68.172        consists of composing those.
  68.173        
  68.174      \item Whether one should prefer equational reasoning (fact
  68.175 -      collection @{text execute_simps} or relational reasoning (fact
  68.176 -      collections @{text effect_intros} and @{text effect_elims}) depends
  68.177 +      collection \<open>execute_simps\<close> or relational reasoning (fact
  68.178 +      collections \<open>effect_intros\<close> and \<open>effect_elims\<close>) depends
  68.179        on the problems to solve.  For complex expressions or
  68.180        expressions involving binders, the relation style usually is
  68.181        superior but requires more proof text.
  68.182 @@ -238,6 +235,6 @@
  68.183        HOL yourself whenever appropriate.
  68.184  
  68.185    \end{itemize}
  68.186 -*}
  68.187 +\<close>
  68.188  
  68.189  end
    69.1 --- a/src/HOL/Imperative_HOL/Ref.thy	Thu May 26 16:57:14 2016 +0200
    69.2 +++ b/src/HOL/Imperative_HOL/Ref.thy	Thu May 26 17:51:22 2016 +0200
    69.3 @@ -2,19 +2,19 @@
    69.4      Author:     John Matthews, Galois Connections; Alexander Krauss, Lukas Bulwahn & Florian Haftmann, TU Muenchen
    69.5  *)
    69.6  
    69.7 -section {* Monadic references *}
    69.8 +section \<open>Monadic references\<close>
    69.9  
   69.10  theory Ref
   69.11  imports Array
   69.12  begin
   69.13  
   69.14 -text {*
   69.15 +text \<open>
   69.16    Imperative reference operations; modeled after their ML counterparts.
   69.17    See @{url "http://caml.inria.fr/pub/docs/manual-caml-light/node14.15.html"}
   69.18    and @{url "http://www.smlnj.org/doc/Conversion/top-level-comparison.html"}
   69.19 -*}
   69.20 +\<close>
   69.21  
   69.22 -subsection {* Primitives *}
   69.23 +subsection \<open>Primitives\<close>
   69.24  
   69.25  definition present :: "heap \<Rightarrow> 'a::heap ref \<Rightarrow> bool" where
   69.26    "present h r \<longleftrightarrow> addr_of_ref r < lim h"
   69.27 @@ -36,7 +36,7 @@
   69.28    "r =!= s \<longleftrightarrow> TYPEREP('a) \<noteq> TYPEREP('b) \<or> addr_of_ref r \<noteq> addr_of_ref s"
   69.29  
   69.30  
   69.31 -subsection {* Monad operations *}
   69.32 +subsection \<open>Monad operations\<close>
   69.33  
   69.34  definition ref :: "'a::heap \<Rightarrow> 'a ref Heap" where
   69.35    [code del]: "ref v = Heap_Monad.heap (alloc v)"
   69.36 @@ -56,12 +56,12 @@
   69.37     }"
   69.38  
   69.39  
   69.40 -subsection {* Properties *}
   69.41 +subsection \<open>Properties\<close>
   69.42  
   69.43 -text {* Primitives *}
   69.44 +text \<open>Primitives\<close>
   69.45  
   69.46  lemma noteq_sym: "r =!= s \<Longrightarrow> s =!= r"
   69.47 -  and unequal [simp]: "r \<noteq> r' \<longleftrightarrow> r =!= r'" -- "same types!"
   69.48 +  and unequal [simp]: "r \<noteq> r' \<longleftrightarrow> r =!= r'" \<comment> "same types!"
   69.49    by (auto simp add: noteq_def)
   69.50  
   69.51  lemma noteq_irrefl: "r =!= r \<Longrightarrow> False"
   69.52 @@ -133,7 +133,7 @@
   69.53    by (auto simp add: noteq_def present_def)
   69.54  
   69.55  
   69.56 -text {* Monad operations *}
   69.57 +text \<open>Monad operations\<close>
   69.58  
   69.59  lemma execute_ref [execute_simps]:
   69.60    "execute (ref v) h = Some (alloc v h)"
   69.61 @@ -216,7 +216,7 @@
   69.62    by (rule Heap_eqI) (simp add: change_def lookup_chain)
   69.63  
   69.64  
   69.65 -text {* Non-interaction between imperative arrays and imperative references *}
   69.66 +text \<open>Non-interaction between imperative arrays and imperative references\<close>
   69.67  
   69.68  lemma array_get_set [simp]:
   69.69    "Array.get (set r v h) = Array.get h"
   69.70 @@ -261,9 +261,9 @@
   69.71  hide_const (open) present get set alloc noteq lookup update change
   69.72  
   69.73  
   69.74 -subsection {* Code generator setup *}
   69.75 +subsection \<open>Code generator setup\<close>
   69.76  
   69.77 -text {* Intermediate operation avoids invariance problem in @{text Scala} (similar to value restriction) *}
   69.78 +text \<open>Intermediate operation avoids invariance problem in \<open>Scala\<close> (similar to value restriction)\<close>
   69.79  
   69.80  definition ref' where
   69.81    [code del]: "ref' = ref"
   69.82 @@ -273,7 +273,7 @@
   69.83    by (simp add: ref'_def)
   69.84  
   69.85  
   69.86 -text {* SML / Eval *}
   69.87 +text \<open>SML / Eval\<close>
   69.88  
   69.89  code_printing type_constructor ref \<rightharpoonup> (SML) "_/ ref"
   69.90  code_printing type_constructor ref \<rightharpoonup> (Eval) "_/ Unsynchronized.ref"
   69.91 @@ -287,7 +287,7 @@
   69.92  code_reserved Eval Unsynchronized
   69.93  
   69.94  
   69.95 -text {* OCaml *}
   69.96 +text \<open>OCaml\<close>
   69.97  
   69.98  code_printing type_constructor ref \<rightharpoonup> (OCaml) "_/ ref"
   69.99  code_printing constant Ref \<rightharpoonup> (OCaml) "failwith/ \"bare Ref\""
  69.100 @@ -299,7 +299,7 @@
  69.101  code_reserved OCaml ref
  69.102  
  69.103  
  69.104 -text {* Haskell *}
  69.105 +text \<open>Haskell\<close>
  69.106  
  69.107  code_printing type_constructor ref \<rightharpoonup> (Haskell) "Heap.STRef/ Heap.RealWorld/ _"
  69.108  code_printing constant Ref \<rightharpoonup> (Haskell) "error/ \"bare Ref\""
  69.109 @@ -310,7 +310,7 @@
  69.110  code_printing class_instance ref :: HOL.equal \<rightharpoonup> (Haskell) -
  69.111  
  69.112  
  69.113 -text {* Scala *}
  69.114 +text \<open>Scala\<close>
  69.115  
  69.116  code_printing type_constructor ref \<rightharpoonup> (Scala) "!Ref[_]"
  69.117  code_printing constant Ref \<rightharpoonup> (Scala) "!sys.error(\"bare Ref\")"
    70.1 --- a/src/HOL/Imperative_HOL/ex/Imperative_Quicksort.thy	Thu May 26 16:57:14 2016 +0200
    70.2 +++ b/src/HOL/Imperative_HOL/ex/Imperative_Quicksort.thy	Thu May 26 17:51:22 2016 +0200
    70.3 @@ -2,7 +2,7 @@
    70.4      Author:     Lukas Bulwahn, TU Muenchen
    70.5  *)
    70.6  
    70.7 -section {* An imperative implementation of Quicksort on arrays *}
    70.8 +section \<open>An imperative implementation of Quicksort on arrays\<close>
    70.9  
   70.10  theory Imperative_Quicksort
   70.11  imports
   70.12 @@ -12,7 +12,7 @@
   70.13    "~~/src/HOL/Library/Code_Target_Numeral"
   70.14  begin
   70.15  
   70.16 -text {* We prove QuickSort correct in the Relational Calculus. *}
   70.17 +text \<open>We prove QuickSort correct in the Relational Calculus.\<close>
   70.18  
   70.19  definition swap :: "'a::heap array \<Rightarrow> nat \<Rightarrow> nat \<Rightarrow> unit Heap"
   70.20  where
   70.21 @@ -76,11 +76,11 @@
   70.22  using assms
   70.23  proof (induct a l r p arbitrary: h h' rs rule:part1.induct)
   70.24    case (1 a l r p h h' rs)
   70.25 -  note cr = `effect (part1 a l r p) h h' rs`
   70.26 +  note cr = \<open>effect (part1 a l r p) h h' rs\<close>
   70.27    show ?case
   70.28    proof (cases "r \<le> l")
   70.29      case True (* Terminating case *)
   70.30 -    with cr `l \<le> r` show ?thesis
   70.31 +    with cr \<open>l \<le> r\<close> show ?thesis
   70.32        unfolding part1.simps[of a l r p]
   70.33        by (elim effect_bindE effect_ifE effect_returnE effect_nthE) auto
   70.34    next
   70.35 @@ -95,7 +95,7 @@
   70.36          unfolding part1.simps[of a l r p]
   70.37          by (elim effect_bindE effect_nthE effect_ifE effect_returnE) auto
   70.38        from rec_condition have "l + 1 \<le> r" by arith
   70.39 -      from 1(1)[OF rec_condition True rec1 `l + 1 \<le> r`]
   70.40 +      from 1(1)[OF rec_condition True rec1 \<open>l + 1 \<le> r\<close>]
   70.41        show ?thesis by simp
   70.42      next
   70.43        case False
   70.44 @@ -105,7 +105,7 @@
   70.45          unfolding part1.simps[of a l r p]
   70.46          by (elim effect_bindE effect_nthE effect_ifE effect_returnE) auto
   70.47        from rec_condition have "l \<le> r - 1" by arith
   70.48 -      from 1(2) [OF rec_condition False rec2 `l \<le> r - 1`] show ?thesis by fastforce
   70.49 +      from 1(2) [OF rec_condition False rec2 \<open>l \<le> r - 1\<close>] show ?thesis by fastforce
   70.50      qed
   70.51    qed
   70.52  qed
   70.53 @@ -116,7 +116,7 @@
   70.54  using assms
   70.55  proof (induct a l r p arbitrary: h h' rs rule:part1.induct)
   70.56    case (1 a l r p h h' rs)
   70.57 -  note cr = `effect (part1 a l r p) h h' rs`
   70.58 +  note cr = \<open>effect (part1 a l r p) h h' rs\<close>
   70.59    
   70.60    show ?case
   70.61    proof (cases "r \<le> l")
   70.62 @@ -138,7 +138,7 @@
   70.63    using assms
   70.64  proof (induct a l r p arbitrary: h h' rs rule:part1.induct)
   70.65    case (1 a l r p h h' rs)
   70.66 -  note cr = `effect (part1 a l r p) h h' rs`
   70.67 +  note cr = \<open>effect (part1 a l r p) h h' rs\<close>
   70.68    
   70.69    show ?case
   70.70    proof (cases "r \<le> l")
   70.71 @@ -183,7 +183,7 @@
   70.72    using assms
   70.73  proof (induct a l r p arbitrary: h h' rs rule:part1.induct)
   70.74    case (1 a l r p h h' rs)
   70.75 -  note cr = `effect (part1 a l r p) h h' rs`
   70.76 +  note cr = \<open>effect (part1 a l r p) h h' rs\<close>
   70.77    
   70.78    show ?case
   70.79    proof (cases "r \<le> l")
   70.80 @@ -281,8 +281,8 @@
   70.81           else middle)"
   70.82      unfolding partition.simps
   70.83      by (elim effect_bindE effect_returnE effect_nthE effect_ifE effect_updE) simp 
   70.84 -  from `l < r` have "l \<le> r - 1" by arith
   70.85 -  from part_returns_index_in_bounds[OF part this] rs_equals `l < r` show ?thesis by auto
   70.86 +  from \<open>l < r\<close> have "l \<le> r - 1" by arith
   70.87 +  from part_returns_index_in_bounds[OF part this] rs_equals \<open>l < r\<close> show ?thesis by auto
   70.88  qed
   70.89  
   70.90  lemma partition_partitions:
   70.91 @@ -307,9 +307,9 @@
   70.92      by (elim effect_bindE effect_returnE effect_nthE effect_updE) simp
   70.93    from swap have swap_length_remains: "Array.length h1 a = Array.length h' a"
   70.94      unfolding swap_def by (elim effect_bindE effect_returnE effect_nthE effect_updE) auto
   70.95 -  from `l < r` have "l \<le> r - 1" by simp
   70.96 +  from \<open>l < r\<close> have "l \<le> r - 1" by simp
   70.97    note middle_in_bounds = part_returns_index_in_bounds[OF part this]
   70.98 -  from part_outer_remains[OF part] `l < r`
   70.99 +  from part_outer_remains[OF part] \<open>l < r\<close>
  70.100    have "Array.get h a ! r = Array.get h1 a ! r"
  70.101      by fastforce
  70.102    with swap
  70.103 @@ -324,7 +324,7 @@
  70.104      { 
  70.105        fix i
  70.106        assume i_is_left: "l \<le> i \<and> i < rs"
  70.107 -      with swap_length_remains in_bounds middle_in_bounds rs_equals `l < r`
  70.108 +      with swap_length_remains in_bounds middle_in_bounds rs_equals \<open>l < r\<close>
  70.109        have i_props: "i < Array.length h' a" "i \<noteq> r" "i \<noteq> rs" by auto
  70.110        from i_is_left rs_equals have "l \<le> i \<and> i < middle \<or> i = middle" by arith
  70.111        with part_partitions[OF part] right_remains True
  70.112 @@ -350,7 +350,7 @@
  70.113        next
  70.114          assume i_is: "rs < i \<and> i = r"
  70.115          with rs_equals have "Suc middle \<noteq> r" by arith
  70.116 -        with middle_in_bounds `l < r` have "Suc middle \<le> r - 1" by arith
  70.117 +        with middle_in_bounds \<open>l < r\<close> have "Suc middle \<le> r - 1" by arith
  70.118          with part_partitions[OF part] right_remains 
  70.119          have "Array.get h' a ! rs \<le> Array.get h1 a ! (Suc middle)"
  70.120            by fastforce
  70.121 @@ -451,7 +451,7 @@
  70.122    using assms
  70.123  proof (induct a l r arbitrary: h h' rs rule: quicksort.induct)
  70.124    case (1 a l r h h' rs)
  70.125 -  note cr = `effect (quicksort a l r) h h' rs`
  70.126 +  note cr = \<open>effect (quicksort a l r) h h' rs\<close>
  70.127    thus ?case
  70.128    proof (cases "r > l")
  70.129      case False
  70.130 @@ -498,7 +498,7 @@
  70.131    using assms
  70.132  proof (induct a l r arbitrary: h h' rs rule: quicksort.induct)
  70.133    case (1 a l r h h' rs)
  70.134 -  note cr = `effect (quicksort a l r) h h' rs`
  70.135 +  note cr = \<open>effect (quicksort a l r) h h' rs\<close>
  70.136    thus ?case
  70.137    proof (cases "r > l")
  70.138      case False
  70.139 @@ -582,9 +582,9 @@
  70.140    with quicksort_permutes [OF effect] properties_for_sort show ?thesis by fastforce
  70.141  qed
  70.142  
  70.143 -subsection {* No Errors in quicksort *}
  70.144 -text {* We have proved that quicksort sorts (if no exceptions occur).
  70.145 -We will now show that exceptions do not occur. *}
  70.146 +subsection \<open>No Errors in quicksort\<close>
  70.147 +text \<open>We have proved that quicksort sorts (if no exceptions occur).
  70.148 +We will now show that exceptions do not occur.\<close>
  70.149  
  70.150  lemma success_part1I: 
  70.151    assumes "l < Array.length h a" "r < Array.length h a"
  70.152 @@ -647,7 +647,7 @@
  70.153  qed
  70.154  
  70.155  
  70.156 -subsection {* Example *}
  70.157 +subsection \<open>Example\<close>
  70.158  
  70.159  definition "qsort a = do {
  70.160      k \<leftarrow> Array.len a;
  70.161 @@ -662,7 +662,7 @@
  70.162      qsort a
  70.163    }"
  70.164  
  70.165 -ML_val {* @{code example} () *}
  70.166 +ML_val \<open>@{code example} ()\<close>
  70.167  
  70.168  export_code qsort checking SML SML_imp OCaml? OCaml_imp? Haskell? Scala Scala_imp
  70.169  
    71.1 --- a/src/HOL/Imperative_HOL/ex/Imperative_Reverse.thy	Thu May 26 16:57:14 2016 +0200
    71.2 +++ b/src/HOL/Imperative_HOL/ex/Imperative_Reverse.thy	Thu May 26 17:51:22 2016 +0200
    71.3 @@ -2,7 +2,7 @@
    71.4      Author:     Lukas Bulwahn, TU Muenchen
    71.5  *)
    71.6  
    71.7 -section {* An imperative in-place reversal on arrays *}
    71.8 +section \<open>An imperative in-place reversal on arrays\<close>
    71.9  
   71.10  theory Imperative_Reverse
   71.11  imports Subarray "~~/src/HOL/Imperative_HOL/Imperative_HOL"
    72.1 --- a/src/HOL/Imperative_HOL/ex/Linked_Lists.thy	Thu May 26 16:57:14 2016 +0200
    72.2 +++ b/src/HOL/Imperative_HOL/ex/Linked_Lists.thy	Thu May 26 17:51:22 2016 +0200
    72.3 @@ -2,15 +2,15 @@
    72.4      Author:     Lukas Bulwahn, TU Muenchen
    72.5  *)
    72.6  
    72.7 -section {* Linked Lists by ML references *}
    72.8 +section \<open>Linked Lists by ML references\<close>
    72.9  
   72.10  theory Linked_Lists
   72.11  imports "../Imperative_HOL" "~~/src/HOL/Library/Code_Target_Int"
   72.12  begin
   72.13  
   72.14 -section {* Definition of Linked Lists *}
   72.15 +section \<open>Definition of Linked Lists\<close>
   72.16  
   72.17 -setup {* Sign.add_const_constraint (@{const_name Ref}, SOME @{typ "nat \<Rightarrow> 'a::type ref"}) *}
   72.18 +setup \<open>Sign.add_const_constraint (@{const_name Ref}, SOME @{typ "nat \<Rightarrow> 'a::type ref"})\<close>
   72.19  datatype 'a node = Empty | Node 'a "'a node ref"
   72.20  
   72.21  primrec
   72.22 @@ -55,9 +55,9 @@
   72.23  by (simp_all add: traverse.simps[of "Empty"] traverse.simps[of "Node x r"])
   72.24  
   72.25  
   72.26 -section {* Proving correctness with relational abstraction *}
   72.27 +section \<open>Proving correctness with relational abstraction\<close>
   72.28  
   72.29 -subsection {* Definition of list_of, list_of', refs_of and refs_of' *}
   72.30 +subsection \<open>Definition of list_of, list_of', refs_of and refs_of'\<close>
   72.31  
   72.32  primrec list_of :: "heap \<Rightarrow> ('a::heap) node \<Rightarrow> 'a list \<Rightarrow> bool"
   72.33  where
   72.34 @@ -79,7 +79,7 @@
   72.35  | "refs_of' h r (x#xs) = ((x = r) \<and> refs_of h (Ref.get h x) xs)"
   72.36  
   72.37  
   72.38 -subsection {* Properties of these definitions *}
   72.39 +subsection \<open>Properties of these definitions\<close>
   72.40  
   72.41  lemma list_of_Empty[simp]: "list_of h Empty xs = (xs = [])"
   72.42  by (cases xs, auto)
   72.43 @@ -216,7 +216,7 @@
   72.44    thus ?thesis by (auto simp add: refs_of'_def')
   72.45  qed
   72.46  
   72.47 -subsection {* More complicated properties of these predicates *}
   72.48 +subsection \<open>More complicated properties of these predicates\<close>
   72.49  
   72.50  lemma list_of_append:
   72.51    "list_of h n (as @ bs) \<Longrightarrow> \<exists>m. list_of h m bs"
   72.52 @@ -258,7 +258,7 @@
   72.53    by (fastforce simp add: refs_of_distinct refs_of_next)
   72.54  
   72.55  
   72.56 -subsection {* Interaction of these predicates with our heap transitions *}
   72.57 +subsection \<open>Interaction of these predicates with our heap transitions\<close>
   72.58  
   72.59  lemma list_of_set_ref: "refs_of h q rs \<Longrightarrow> p \<notin> set rs \<Longrightarrow> list_of (Ref.set p v h) q as = list_of h q as"
   72.60  proof (induct as arbitrary: q rs)
   72.61 @@ -378,7 +378,7 @@
   72.62    with assms that show thesis by auto
   72.63  qed
   72.64  
   72.65 -section {* Proving make_llist and traverse correct *}
   72.66 +section \<open>Proving make_llist and traverse correct\<close>
   72.67  
   72.68  lemma refs_of_invariant:
   72.69    assumes "refs_of h (r::('a::heap) node) xs"
   72.70 @@ -518,9 +518,9 @@
   72.71      using effect_deterministic by fastforce
   72.72  qed
   72.73  
   72.74 -section {* Proving correctness of in-place reversal *}
   72.75 +section \<open>Proving correctness of in-place reversal\<close>
   72.76  
   72.77 -subsection {* Definition of in-place reversal *}
   72.78 +subsection \<open>Definition of in-place reversal\<close>
   72.79  
   72.80  partial_function (heap) rev' :: "('a::heap) node ref \<Rightarrow> 'a node ref \<Rightarrow> 'a node ref Heap"
   72.81  where
   72.82 @@ -541,7 +541,7 @@
   72.83    "rev Empty = return Empty"
   72.84  | "rev (Node x n) = do { q \<leftarrow> ref Empty; p \<leftarrow> ref (Node x n); v \<leftarrow> rev' q p; !v }"
   72.85  
   72.86 -subsection {* Correctness Proof *}
   72.87 +subsection \<open>Correctness Proof\<close>
   72.88  
   72.89  lemma rev'_invariant:
   72.90    assumes "effect (rev' q p) h h' v"
   72.91 @@ -649,10 +649,10 @@
   72.92  qed
   72.93  
   72.94  
   72.95 -section {* The merge function on Linked Lists *}
   72.96 -text {* We also prove merge correct *}
   72.97 +section \<open>The merge function on Linked Lists\<close>
   72.98 +text \<open>We also prove merge correct\<close>
   72.99  
  72.100 -text{* First, we define merge on lists in a natural way. *}
  72.101 +text\<open>First, we define merge on lists in a natural way.\<close>
  72.102  
  72.103  fun Lmerge :: "('a::ord) list \<Rightarrow> 'a list \<Rightarrow> 'a list"
  72.104  where
  72.105 @@ -661,7 +661,7 @@
  72.106  | "Lmerge [] ys = ys"
  72.107  | "Lmerge xs [] = xs"
  72.108  
  72.109 -subsection {* Definition of merge function *}
  72.110 +subsection \<open>Definition of merge function\<close>
  72.111  
  72.112  partial_function (heap) merge :: "('a::{heap, ord}) node ref \<Rightarrow> 'a node ref \<Rightarrow> 'a node ref Heap"
  72.113  where
  72.114 @@ -694,9 +694,9 @@
  72.115  lemma sum_distrib: "case_sum fl fr (case x of Empty \<Rightarrow> y | Node v n \<Rightarrow> (z v n)) = (case x of Empty \<Rightarrow> case_sum fl fr y | Node v n \<Rightarrow> case_sum fl fr (z v n))"
  72.116  by (cases x) auto
  72.117  
  72.118 -subsection {* Induction refinement by applying the abstraction function to our induct rule *}
  72.119 +subsection \<open>Induction refinement by applying the abstraction function to our induct rule\<close>
  72.120  
  72.121 -text {* From our original induction rule Lmerge.induct, we derive a new rule with our list_of' predicate *}
  72.122 +text \<open>From our original induction rule Lmerge.induct, we derive a new rule with our list_of' predicate\<close>
  72.123  
  72.124  lemma merge_induct2:
  72.125    assumes "list_of' h (p::'a::{heap, ord} node ref) xs"
  72.126 @@ -741,7 +741,7 @@
  72.127  qed
  72.128  
  72.129  
  72.130 -text {* secondly, we add the effect statement in the premise, and derive the effect statements for the single cases which we then eliminate with our effect elim rules. *}
  72.131 +text \<open>secondly, we add the effect statement in the premise, and derive the effect statements for the single cases which we then eliminate with our effect elim rules.\<close>
  72.132    
  72.133  lemma merge_induct3: 
  72.134  assumes  "list_of' h p xs"
  72.135 @@ -790,10 +790,10 @@
  72.136  qed
  72.137  
  72.138  
  72.139 -subsection {* Proving merge correct *}
  72.140 +subsection \<open>Proving merge correct\<close>
  72.141  
  72.142 -text {* As many parts of the following three proofs are identical, we could actually move the
  72.143 -same reasoning into an extended induction rule *}
  72.144 +text \<open>As many parts of the following three proofs are identical, we could actually move the
  72.145 +same reasoning into an extended induction rule\<close>
  72.146   
  72.147  lemma merge_unchanged:
  72.148    assumes "refs_of' h p xs"
  72.149 @@ -822,7 +822,7 @@
  72.150      from 3(11) pnrs_def have no_inter: "set pnrs \<inter> set ys = {}" by auto
  72.151      from 3(7)[OF refs_of'_pn 3(10) this p_in] 3(3) have p_is_Node: "Ref.get h1 p = Node x pn"
  72.152        by simp
  72.153 -    from 3(7)[OF refs_of'_pn 3(10) no_inter r_in] 3(8) `r \<noteq> p` show ?case
  72.154 +    from 3(7)[OF refs_of'_pn 3(10) no_inter r_in] 3(8) \<open>r \<noteq> p\<close> show ?case
  72.155        by simp
  72.156    next
  72.157      case (4 x xs' y ys' p q pn qn h1 r1 h' xs ys r)
  72.158 @@ -835,7 +835,7 @@
  72.159      with 4(11) 4(12) qnrs_def refs_of'_distinct[OF 4(10)] have q_in: "q \<notin> set xs \<union> set qnrs" by auto
  72.160      from 4(11) qnrs_def have no_inter: "set xs \<inter> set qnrs = {}" by auto
  72.161      from 4(7)[OF 4(9) refs_of'_qn this q_in] 4(4) have q_is_Node: "Ref.get h1 q = Node y qn" by simp
  72.162 -    from 4(7)[OF 4(9) refs_of'_qn no_inter r_in] 4(8) `r \<noteq> q` show ?case
  72.163 +    from 4(7)[OF 4(9) refs_of'_qn no_inter r_in] 4(8) \<open>r \<noteq> q\<close> show ?case
  72.164        by simp
  72.165    qed
  72.166  qed
  72.167 @@ -937,9 +937,9 @@
  72.168    show ?case by (auto simp: list_of'_set_ref)
  72.169  qed
  72.170  
  72.171 -section {* Code generation *}
  72.172 +section \<open>Code generation\<close>
  72.173  
  72.174 -text {* A simple example program *}
  72.175 +text \<open>A simple example program\<close>
  72.176  
  72.177  definition test_1 where "test_1 = (do { ll_xs \<leftarrow> make_llist [1..(15::int)]; xs \<leftarrow> traverse ll_xs; return xs })" 
  72.178  definition test_2 where "test_2 = (do { ll_xs \<leftarrow> make_llist [1..(15::int)]; ll_ys \<leftarrow> rev ll_xs; ys \<leftarrow> traverse ll_ys; return ys })"
  72.179 @@ -958,9 +958,9 @@
  72.180  
  72.181  code_reserved SML upto
  72.182  
  72.183 -ML_val {* @{code test_1} () *}
  72.184 -ML_val {* @{code test_2} () *}
  72.185 -ML_val {* @{code test_3} () *}
  72.186 +ML_val \<open>@{code test_1} ()\<close>
  72.187 +ML_val \<open>@{code test_2} ()\<close>
  72.188 +ML_val \<open>@{code test_3} ()\<close>
  72.189  
  72.190  export_code test_1 test_2 test_3 checking SML SML_imp OCaml? OCaml_imp? Haskell? Scala Scala_imp
  72.191  
    73.1 --- a/src/HOL/Imperative_HOL/ex/List_Sublist.thy	Thu May 26 16:57:14 2016 +0200
    73.2 +++ b/src/HOL/Imperative_HOL/ex/List_Sublist.thy	Thu May 26 17:51:22 2016 +0200
    73.3 @@ -2,7 +2,7 @@
    73.4      Author:     Lukas Bulwahn, TU Muenchen
    73.5  *)
    73.6  
    73.7 -section {* Slices of lists *}
    73.8 +section \<open>Slices of lists\<close>
    73.9  
   73.10  theory List_Sublist
   73.11  imports "~~/src/HOL/Library/Multiset"
   73.12 @@ -188,7 +188,7 @@
   73.13  apply auto
   73.14  done
   73.15  
   73.16 -section {* Another sublist function *}
   73.17 +section \<open>Another sublist function\<close>
   73.18  
   73.19  function sublist' :: "nat \<Rightarrow> nat \<Rightarrow> 'a list \<Rightarrow> 'a list"
   73.20  where
   73.21 @@ -199,7 +199,7 @@
   73.22  by pat_completeness auto
   73.23  termination by lexicographic_order
   73.24  
   73.25 -subsection {* Proving equivalence to the other sublist command *}
   73.26 +subsection \<open>Proving equivalence to the other sublist command\<close>
   73.27  
   73.28  lemma sublist'_sublist: "sublist' n m xs = sublist xs {j. n \<le> j \<and> j < m}"
   73.29  apply (induct xs arbitrary: n m)
   73.30 @@ -227,7 +227,7 @@
   73.31  done
   73.32  
   73.33  
   73.34 -subsection {* Showing equivalence to use of drop and take for definition *}
   73.35 +subsection \<open>Showing equivalence to use of drop and take for definition\<close>
   73.36  
   73.37  lemma "sublist' n m xs = take (m - n) (drop n xs)"
   73.38  apply (induct xs arbitrary: n m)
   73.39 @@ -239,7 +239,7 @@
   73.40  apply simp
   73.41  done
   73.42  
   73.43 -subsection {* General lemma about sublist *}
   73.44 +subsection \<open>General lemma about sublist\<close>
   73.45  
   73.46  lemma sublist'_Nil[simp]: "sublist' i j [] = []"
   73.47  by simp
    74.1 --- a/src/HOL/Imperative_HOL/ex/SatChecker.thy	Thu May 26 16:57:14 2016 +0200
    74.2 +++ b/src/HOL/Imperative_HOL/ex/SatChecker.thy	Thu May 26 17:51:22 2016 +0200
    74.3 @@ -2,22 +2,22 @@
    74.4      Author:     Lukas Bulwahn, TU Muenchen
    74.5  *)
    74.6  
    74.7 -section {* An efficient checker for proofs from a SAT solver *}
    74.8 +section \<open>An efficient checker for proofs from a SAT solver\<close>
    74.9  
   74.10  theory SatChecker
   74.11  imports "~~/src/HOL/Library/RBT_Impl" Sorted_List "../Imperative_HOL"
   74.12  begin
   74.13  
   74.14 -section{* General settings and functions for our representation of clauses *}
   74.15 +section\<open>General settings and functions for our representation of clauses\<close>
   74.16  
   74.17 -subsection{* Types for Literals, Clauses and ProofSteps *}
   74.18 -text {* We encode Literals as integers and Clauses as sorted Lists. *}
   74.19 +subsection\<open>Types for Literals, Clauses and ProofSteps\<close>
   74.20 +text \<open>We encode Literals as integers and Clauses as sorted Lists.\<close>
   74.21  
   74.22  type_synonym ClauseId = nat
   74.23  type_synonym Lit = int
   74.24  type_synonym Clause = "Lit list"
   74.25  
   74.26 -text {* This resembles exactly to Isat's Proof Steps *}
   74.27 +text \<open>This resembles exactly to Isat's Proof Steps\<close>
   74.28  
   74.29  type_synonym Resolvants = "ClauseId * (Lit * ClauseId) list"
   74.30  datatype ProofStep =
   74.31 @@ -27,8 +27,8 @@
   74.32    | Delete ClauseId
   74.33    | Xstep ClauseId ClauseId
   74.34  
   74.35 -subsection{* Interpretation of Literals, Clauses, and an array of Clauses *} 
   74.36 -text {* Specific definitions for Literals as integers *}
   74.37 +subsection\<open>Interpretation of Literals, Clauses, and an array of Clauses\<close> 
   74.38 +text \<open>Specific definitions for Literals as integers\<close>
   74.39  
   74.40  definition compl :: "Lit \<Rightarrow> Lit"
   74.41  where
   74.42 @@ -54,7 +54,7 @@
   74.43  lemma compl_exists: "\<exists>l'. l = compl l'"
   74.44  unfolding compl_def by arith
   74.45  
   74.46 -text {* Specific definitions for Clauses as sorted lists *}
   74.47 +text \<open>Specific definitions for Clauses as sorted lists\<close>
   74.48  
   74.49  definition interpClause :: "(nat \<Rightarrow> bool) \<Rightarrow> Clause \<Rightarrow> bool"
   74.50  where
   74.51 @@ -116,12 +116,12 @@
   74.52  unfolding inconsistent_def correctClause_def
   74.53  by auto
   74.54  
   74.55 -text {* Specific definition for derived clauses in the Array *}
   74.56 +text \<open>Specific definition for derived clauses in the Array\<close>
   74.57  
   74.58  definition
   74.59    array_ran :: "('a::heap) option array \<Rightarrow> heap \<Rightarrow> 'a set" where
   74.60    "array_ran a h = {e. Some e \<in> set (Array.get h a)}"
   74.61 -    -- {*FIXME*}
   74.62 +    \<comment> \<open>FIXME\<close>
   74.63  
   74.64  lemma array_ranI: "\<lbrakk> Some b = Array.get h a ! i; i < Array.length h a \<rbrakk> \<Longrightarrow> b \<in> array_ran a h"
   74.65  unfolding array_ran_def Array.length_def by simp
   74.66 @@ -165,11 +165,11 @@
   74.67    by auto
   74.68  
   74.69  
   74.70 -section{* Improved version of SatChecker *}
   74.71 +section\<open>Improved version of SatChecker\<close>
   74.72  
   74.73 -text{* This version just uses a single list traversal. *}
   74.74 +text\<open>This version just uses a single list traversal.\<close>
   74.75  
   74.76 -subsection{* Function definitions *}
   74.77 +subsection\<open>Function definitions\<close>
   74.78  
   74.79  primrec res_mem :: "Lit \<Rightarrow> Clause \<Rightarrow> Clause Heap"
   74.80  where
   74.81 @@ -209,7 +209,7 @@
   74.82  
   74.83  declare res_mem.simps [simp del] resolve1.simps [simp del] resolve2.simps [simp del] res_thm'.simps [simp del]
   74.84  
   74.85 -subsection {* Proofs about these functions *}
   74.86 +subsection \<open>Proofs about these functions\<close>
   74.87  
   74.88  lemma res_mem:
   74.89  assumes "effect (res_mem l xs) h h' r"
   74.90 @@ -408,7 +408,7 @@
   74.91      done
   74.92  qed
   74.93  
   74.94 -subsection {* res_thm and doProofStep *}
   74.95 +subsection \<open>res_thm and doProofStep\<close>
   74.96  
   74.97  definition get_clause :: "Clause option array \<Rightarrow> ClauseId \<Rightarrow> Clause Heap"
   74.98  where
   74.99 @@ -598,9 +598,9 @@
  74.100  apply (drule bspec)
  74.101  by (rule array_ranI, auto)
  74.102  
  74.103 -section {* Functional version with Lists as Array *}
  74.104 +section \<open>Functional version with Lists as Array\<close>
  74.105  
  74.106 -subsection {* List specific definitions *}
  74.107 +subsection \<open>List specific definitions\<close>
  74.108  
  74.109  definition list_ran :: "'a option list \<Rightarrow> 'a set"
  74.110  where
  74.111 @@ -636,7 +636,7 @@
  74.112    "correctList rootcls xs =
  74.113    (\<forall>cl \<in> list_ran xs. correctClause rootcls cl \<and> sorted cl \<and> distinct cl)"
  74.114  
  74.115 -subsection {* Checker functions *}
  74.116 +subsection \<open>Checker functions\<close>
  74.117  
  74.118  primrec lres_thm :: "Clause option list \<Rightarrow> (Lit * ClauseId) \<Rightarrow> Clause \<Rightarrow> Clause Heap" 
  74.119  where
  74.120 @@ -670,7 +670,7 @@
  74.121    }"
  74.122  
  74.123  
  74.124 -section {* Functional version with RedBlackTrees *}
  74.125 +section \<open>Functional version with RedBlackTrees\<close>
  74.126  
  74.127  primrec tres_thm :: "(ClauseId, Clause) RBT_Impl.rbt \<Rightarrow> Lit \<times> ClauseId \<Rightarrow> Clause \<Rightarrow> Clause Heap"
  74.128  where
    75.1 --- a/src/HOL/Imperative_HOL/ex/Sorted_List.thy	Thu May 26 16:57:14 2016 +0200
    75.2 +++ b/src/HOL/Imperative_HOL/ex/Sorted_List.thy	Thu May 26 17:51:22 2016 +0200
    75.3 @@ -2,13 +2,13 @@
    75.4      Author:     Lukas Bulwahn, TU Muenchen
    75.5  *)
    75.6  
    75.7 -section {* Sorted lists as representation of finite sets *}
    75.8 +section \<open>Sorted lists as representation of finite sets\<close>
    75.9  
   75.10  theory Sorted_List
   75.11  imports Main
   75.12  begin
   75.13  
   75.14 -text {* Merge function for two distinct sorted lists to get compound distinct sorted list *}
   75.15 +text \<open>Merge function for two distinct sorted lists to get compound distinct sorted list\<close>
   75.16     
   75.17  fun merge :: "('a::linorder) list \<Rightarrow> 'a list \<Rightarrow> 'a list"
   75.18  where
   75.19 @@ -17,7 +17,7 @@
   75.20  | "merge xs [] = xs"
   75.21  | "merge [] ys = ys"
   75.22  
   75.23 -text {* The function package does not derive automatically the more general rewrite rule as follows: *}
   75.24 +text \<open>The function package does not derive automatically the more general rewrite rule as follows:\<close>
   75.25  lemma merge_Nil[simp]: "merge [] ys = ys"
   75.26  by (cases ys) auto
   75.27  
   75.28 @@ -31,7 +31,7 @@
   75.29  lemma distinct_merge[simp]: "\<lbrakk> distinct xs; distinct ys; List.sorted xs; List.sorted ys \<rbrakk> \<Longrightarrow> distinct (merge xs ys)"
   75.30  by (induct xs ys rule: merge.induct, auto simp add: sorted_Cons)
   75.31  
   75.32 -text {* The remove function removes an element from a sorted list *}
   75.33 +text \<open>The remove function removes an element from a sorted list\<close>
   75.34  
   75.35  primrec remove :: "('a :: linorder) \<Rightarrow> 'a list \<Rightarrow> 'a list"
   75.36  where
   75.37 @@ -86,7 +86,7 @@
   75.38  apply (auto simp add: sorted_Cons)
   75.39  done
   75.40  
   75.41 -subsection {* Efficient member function for sorted lists *}
   75.42 +subsection \<open>Efficient member function for sorted lists\<close>
   75.43  
   75.44  primrec smember :: "'a list \<Rightarrow> 'a::linorder \<Rightarrow> bool" where
   75.45    "smember [] x \<longleftrightarrow> False"
    76.1 --- a/src/HOL/Imperative_HOL/ex/Subarray.thy	Thu May 26 16:57:14 2016 +0200
    76.2 +++ b/src/HOL/Imperative_HOL/ex/Subarray.thy	Thu May 26 17:51:22 2016 +0200
    76.3 @@ -2,7 +2,7 @@
    76.4      Author:     Lukas Bulwahn, TU Muenchen
    76.5  *)
    76.6  
    76.7 -section {* Theorems about sub arrays *}
    76.8 +section \<open>Theorems about sub arrays\<close>
    76.9  
   76.10  theory Subarray
   76.11  imports "~~/src/HOL/Imperative_HOL/Array" List_Sublist
    77.1 --- a/src/HOL/Import/HOL_Light_Import.thy	Thu May 26 16:57:14 2016 +0200
    77.2 +++ b/src/HOL/Import/HOL_Light_Import.thy	Thu May 26 17:51:22 2016 +0200
    77.3 @@ -3,7 +3,7 @@
    77.4      Author:     Alexander Krauss, QAware GmbH
    77.5  *)
    77.6  
    77.7 -section {* Main HOL Light importer *}
    77.8 +section \<open>Main HOL Light importer\<close>
    77.9  
   77.10  theory HOL_Light_Import
   77.11  imports HOL_Light_Maps
    78.1 --- a/src/HOL/Import/HOL_Light_Maps.thy	Thu May 26 16:57:14 2016 +0200
    78.2 +++ b/src/HOL/Import/HOL_Light_Maps.thy	Thu May 26 17:51:22 2016 +0200
    78.3 @@ -5,7 +5,7 @@
    78.4  Based on earlier code by Steven Obua and Sebastian Skalberg
    78.5  *)
    78.6  
    78.7 -section {* Type and constant mappings of HOL Light importer *}
    78.8 +section \<open>Type and constant mappings of HOL Light importer\<close>
    78.9  
   78.10  theory HOL_Light_Maps
   78.11  imports Import_Setup
    79.1 --- a/src/HOL/Import/Import_Setup.thy	Thu May 26 16:57:14 2016 +0200
    79.2 +++ b/src/HOL/Import/Import_Setup.thy	Thu May 26 17:51:22 2016 +0200
    79.3 @@ -3,7 +3,7 @@
    79.4      Author:     Alexander Krauss, QAware GmbH
    79.5  *)
    79.6  
    79.7 -section {* Importer machinery and required theorems *}
    79.8 +section \<open>Importer machinery and required theorems\<close>
    79.9  
   79.10  theory Import_Setup
   79.11  imports Main "~~/src/HOL/Binomial"
    80.1 --- a/src/HOL/Induct/ABexp.thy	Thu May 26 16:57:14 2016 +0200
    80.2 +++ b/src/HOL/Induct/ABexp.thy	Thu May 26 17:51:22 2016 +0200
    80.3 @@ -55,7 +55,7 @@
    80.4    "evala env (substa (Var (v := a')) a) = evala (env (v := evala env a')) a"
    80.5  and subst1_bexp:
    80.6    "evalb env (substb (Var (v := a')) b) = evalb (env (v := evala env a')) b"
    80.7 -    --  \<open>one variable\<close>
    80.8 +    \<comment>  \<open>one variable\<close>
    80.9    by (induct a and b) simp_all
   80.10  
   80.11  lemma subst_all_aexp:
    81.1 --- a/src/HOL/Induct/Com.thy	Thu May 26 16:57:14 2016 +0200
    81.2 +++ b/src/HOL/Induct/Com.thy	Thu May 26 17:51:22 2016 +0200
    81.3 @@ -136,7 +136,7 @@
    81.4    by (rule fun_upd_same [THEN subst]) fast
    81.5  
    81.6  
    81.7 -text\<open>Make the induction rule look nicer -- though @{text eta_contract} makes the new
    81.8 +text\<open>Make the induction rule look nicer -- though \<open>eta_contract\<close> makes the new
    81.9      version look worse than it is...\<close>
   81.10  
   81.11  lemma split_lemma: "{((e,s),(n,s')). P e s n s'} = Collect (case_prod (%v. case_prod (case_prod P v)))"
   81.12 @@ -167,11 +167,11 @@
   81.13  done
   81.14  
   81.15  
   81.16 -text\<open>Lemma for @{text Function_eval}.  The major premise is that @{text "(c,s)"} executes to @{text "s1"}
   81.17 +text\<open>Lemma for \<open>Function_eval\<close>.  The major premise is that \<open>(c,s)\<close> executes to \<open>s1\<close>
   81.18    using eval restricted to its functional part.  Note that the execution
   81.19 -  @{text "(c,s) -[eval]-> s2"} can use unrestricted @{text eval}!  The reason is that
   81.20 -  the execution @{text "(c,s) -[eval Int {...}]-> s1"} assures us that execution is
   81.21 -  functional on the argument @{text "(c,s)"}.
   81.22 +  \<open>(c,s) -[eval]-> s2\<close> can use unrestricted \<open>eval\<close>!  The reason is that
   81.23 +  the execution \<open>(c,s) -[eval Int {...}]-> s1\<close> assures us that execution is
   81.24 +  functional on the argument \<open>(c,s)\<close>.
   81.25  \<close>
   81.26  lemma com_Unique:
   81.27   "(c,s) -[eval Int {((e,s),(n,t)). \<forall>nt'. (e,s) -|-> nt' --> (n,t)=nt'}]-> s1
    82.1 --- a/src/HOL/Induct/Common_Patterns.thy	Thu May 26 16:57:14 2016 +0200
    82.2 +++ b/src/HOL/Induct/Common_Patterns.thy	Thu May 26 17:51:22 2016 +0200
    82.3 @@ -10,7 +10,7 @@
    82.4  
    82.5  text \<open>
    82.6    The subsequent Isar proof schemes illustrate common proof patterns
    82.7 -  supported by the generic @{text "induct"} method.
    82.8 +  supported by the generic \<open>induct\<close> method.
    82.9  
   82.10    To demonstrate variations on statement (goal) structure we refer to
   82.11    the induction rule of Peano natural numbers: @{thm nat.induct
   82.12 @@ -29,8 +29,8 @@
   82.13  text \<open>
   82.14    Augmenting a problem by additional facts and locally fixed variables
   82.15    is a bread-and-butter method in many applications.  This is where
   82.16 -  unwieldy object-level @{text "\<forall>"} and @{text "\<longrightarrow>"} used to occur in
   82.17 -  the past.  The @{text "induct"} method works with primary means of
   82.18 +  unwieldy object-level \<open>\<forall>\<close> and \<open>\<longrightarrow>\<close> used to occur in
   82.19 +  the past.  The \<open>induct\<close> method works with primary means of
   82.20    the proof language instead.
   82.21  \<close>
   82.22  
   82.23 @@ -80,8 +80,8 @@
   82.24  qed
   82.25  
   82.26  text \<open>
   82.27 -  Observe how the local definition @{text "n = a x"} recurs in the
   82.28 -  inductive cases as @{text "0 = a x"} and @{text "Suc n = a x"},
   82.29 +  Observe how the local definition \<open>n = a x\<close> recurs in the
   82.30 +  inductive cases as \<open>0 = a x\<close> and \<open>Suc n = a x\<close>,
   82.31    according to underlying induction rule.
   82.32  \<close>
   82.33  
   82.34 @@ -155,9 +155,9 @@
   82.35    The following pattern illustrates the slightly more complex
   82.36    situation of simultaneous goals with individual local assumptions.
   82.37    In compound simultaneous statements like this, local assumptions
   82.38 -  need to be included into each goal, using @{text "\<Longrightarrow>"} of the Pure
   82.39 +  need to be included into each goal, using \<open>\<Longrightarrow>\<close> of the Pure
   82.40    framework.  In contrast, local parameters do not require separate
   82.41 -  @{text "\<And>"} prefixes here, but may be moved into the common context
   82.42 +  \<open>\<And>\<close> prefixes here, but may be moved into the common context
   82.43    of the whole statement.
   82.44  \<close>
   82.45  
   82.46 @@ -196,7 +196,7 @@
   82.47  qed
   82.48  
   82.49  text \<open>
   82.50 -  Here @{text "induct"} provides again nested cases with numbered
   82.51 +  Here \<open>induct\<close> provides again nested cases with numbered
   82.52    sub-cases, which allows to share common parts of the body context.
   82.53    In typical applications, there could be a long intermediate proof of
   82.54    general consequences of the induction hypotheses, before finishing
   82.55 @@ -208,8 +208,7 @@
   82.56  
   82.57  text \<open>
   82.58    Multiple induction rules emerge from mutual definitions of
   82.59 -  datatypes, inductive predicates, functions etc.  The @{text
   82.60 -  "induct"} method accepts replicated arguments (with @{text "and"}
   82.61 +  datatypes, inductive predicates, functions etc.  The \<open>induct\<close> method accepts replicated arguments (with \<open>and\<close>
   82.62    separator), corresponding to each projection of the induction
   82.63    principle.
   82.64  
   82.65 @@ -344,7 +343,7 @@
   82.66  text \<open>
   82.67    Working with mutual rules requires special care in composing the
   82.68    statement as a two-level conjunction, using lists of propositions
   82.69 -  separated by @{text "and"}.  For example:
   82.70 +  separated by \<open>and\<close>.  For example:
   82.71  \<close>
   82.72  
   82.73  inductive Evn :: "nat \<Rightarrow> bool" and Odd :: "nat \<Rightarrow> bool"
    83.1 --- a/src/HOL/Induct/PropLog.thy	Thu May 26 16:57:14 2016 +0200
    83.2 +++ b/src/HOL/Induct/PropLog.thy	Thu May 26 17:51:22 2016 +0200
    83.3 @@ -14,8 +14,8 @@
    83.4    Inductive definition of propositional logic.  Soundness and
    83.5    completeness w.r.t.\ truth-tables.
    83.6  
    83.7 -  Prove: If @{text "H |= p"} then @{text "G |= p"} where @{text "G \<in>
    83.8 -  Fin(H)"}
    83.9 +  Prove: If \<open>H |= p\<close> then \<open>G |= p\<close> where \<open>G \<in>
   83.10 +  Fin(H)\<close>
   83.11  \<close>
   83.12  
   83.13  subsection \<open>The datatype of propositions\<close>
   83.14 @@ -49,8 +49,8 @@
   83.15  | eval_imp: "tt[[p->q]] = (tt[[p]] --> tt[[q]])"
   83.16  
   83.17  text \<open>
   83.18 -  A finite set of hypotheses from @{text t} and the @{text Var}s in
   83.19 -  @{text p}.
   83.20 +  A finite set of hypotheses from \<open>t\<close> and the \<open>Var\<close>s in
   83.21 +  \<open>p\<close>.
   83.22  \<close>
   83.23  
   83.24  primrec hyps :: "['a pl, 'a set] => 'a pl set"
   83.25 @@ -63,8 +63,8 @@
   83.26  subsubsection \<open>Logical consequence\<close>
   83.27  
   83.28  text \<open>
   83.29 -  For every valuation, if all elements of @{text H} are true then so
   83.30 -  is @{text p}.
   83.31 +  For every valuation, if all elements of \<open>H\<close> are true then so
   83.32 +  is \<open>p\<close>.
   83.33  \<close>
   83.34  
   83.35  definition sat :: "['a pl set, 'a pl] => bool"  (infixl "|=" 50)
   83.36 @@ -80,14 +80,14 @@
   83.37  done
   83.38  
   83.39  lemma thms_I: "H |- p->p"
   83.40 -  -- \<open>Called @{text I} for Identity Combinator, not for Introduction.\<close>
   83.41 +  \<comment> \<open>Called \<open>I\<close> for Identity Combinator, not for Introduction.\<close>
   83.42  by (best intro: thms.K thms.S thms.MP)
   83.43  
   83.44  
   83.45  subsubsection \<open>Weakening, left and right\<close>
   83.46  
   83.47  lemma weaken_left: "[| G \<subseteq> H;  G|-p |] ==> H|-p"
   83.48 -  -- \<open>Order of premises is convenient with @{text THEN}\<close>
   83.49 +  \<comment> \<open>Order of premises is convenient with \<open>THEN\<close>\<close>
   83.50    by (erule thms_mono [THEN predicate1D])
   83.51  
   83.52  lemma weaken_left_insert: "G |- p \<Longrightarrow> insert a G |- p"
   83.53 @@ -146,7 +146,7 @@
   83.54  done
   83.55  
   83.56  lemma hyps_thms_if: "hyps p tt |- (if tt[[p]] then p else p->false)"
   83.57 -  -- \<open>Typical example of strengthening the induction statement.\<close>
   83.58 +  \<comment> \<open>Typical example of strengthening the induction statement.\<close>
   83.59  apply simp
   83.60  apply (induct p)
   83.61  apply (simp_all add: thms_I thms.H)
   83.62 @@ -155,8 +155,8 @@
   83.63  done
   83.64  
   83.65  lemma sat_thms_p: "{} |= p ==> hyps p tt |- p"
   83.66 -  -- \<open>Key lemma for completeness; yields a set of assumptions
   83.67 -        satisfying @{text p}\<close>
   83.68 +  \<comment> \<open>Key lemma for completeness; yields a set of assumptions
   83.69 +        satisfying \<open>p\<close>\<close>
   83.70  unfolding sat_def
   83.71  by (metis (full_types) empty_iff hyps_thms_if)
   83.72  
   83.73 @@ -178,7 +178,7 @@
   83.74  
   83.75  lemma thms_excluded_middle_rule:
   83.76      "[| insert p H |- q;  insert (p->false) H |- q |] ==> H |- q"
   83.77 -  -- \<open>Hard to prove directly because it requires cuts\<close>
   83.78 +  \<comment> \<open>Hard to prove directly because it requires cuts\<close>
   83.79  by (rule thms_excluded_middle [THEN thms.MP, THEN thms.MP], auto)
   83.80  
   83.81  
   83.82 @@ -200,7 +200,7 @@
   83.83  lemma hyps_insert: "hyps p (insert v t) <= insert (#v) (hyps p t-{#v->false})"
   83.84  by (induct p) auto
   83.85  
   83.86 -text \<open>Two lemmas for use with @{text weaken_left}\<close>
   83.87 +text \<open>Two lemmas for use with \<open>weaken_left\<close>\<close>
   83.88  
   83.89  lemma insert_Diff_same: "B-C <= insert a (B-insert a C)"
   83.90  by fast
   83.91 @@ -234,12 +234,12 @@
   83.92      "{} |= p ==> \<forall>t. hyps p t - hyps p t0 |- p"
   83.93  apply (rule hyps_subset [THEN hyps_finite [THEN finite_subset_induct]])
   83.94   apply (simp add: sat_thms_p, safe)
   83.95 - txt\<open>Case @{text"hyps p t-insert(#v,Y) |- p"}\<close>
   83.96 + txt\<open>Case \<open>hyps p t-insert(#v,Y) |- p\<close>\<close>
   83.97   apply (iprover intro: thms_excluded_middle_rule
   83.98                       insert_Diff_same [THEN weaken_left]
   83.99                       insert_Diff_subset2 [THEN weaken_left]
  83.100                       hyps_Diff [THEN Diff_weaken_left])
  83.101 -txt\<open>Case @{text"hyps p t-insert(#v -> false,Y) |- p"}\<close>
  83.102 +txt\<open>Case \<open>hyps p t-insert(#v -> false,Y) |- p\<close>\<close>
  83.103   apply (iprover intro: thms_excluded_middle_rule
  83.104                       insert_Diff_same [THEN weaken_left]
  83.105                       insert_Diff_subset2 [THEN weaken_left]
    84.1 --- a/src/HOL/Induct/QuoDataType.thy	Thu May 26 16:57:14 2016 +0200
    84.2 +++ b/src/HOL/Induct/QuoDataType.thy	Thu May 26 17:51:22 2016 +0200
    84.3 @@ -420,7 +420,7 @@
    84.4  
    84.5  subsection\<open>The Abstract Discriminator\<close>
    84.6  
    84.7 -text\<open>However, as @{text Crypt_Nonce_neq_Nonce} above illustrates, we don't
    84.8 +text\<open>However, as \<open>Crypt_Nonce_neq_Nonce\<close> above illustrates, we don't
    84.9  need this function in order to prove discrimination theorems.\<close>
   84.10  
   84.11  definition
    85.1 --- a/src/HOL/Induct/QuoNestedDataType.thy	Thu May 26 16:57:14 2016 +0200
    85.2 +++ b/src/HOL/Induct/QuoNestedDataType.thy	Thu May 26 17:51:22 2016 +0200
    85.3 @@ -241,7 +241,7 @@
    85.4  regard an @{typ "exp list"} as a @{term "listrel exprel"} equivalence class\<close>
    85.5  
    85.6  text\<open>This theorem is easily proved but never used. There's no obvious way
    85.7 -even to state the analogous result, @{text FnCall_Cons}.\<close>
    85.8 +even to state the analogous result, \<open>FnCall_Cons\<close>.\<close>
    85.9  lemma FnCall_Nil: "FnCall F [] = Abs_Exp (exprel``{FNCALL F []})"
   85.10    by (simp add: FnCall_def)
   85.11  
   85.12 @@ -390,7 +390,7 @@
   85.13  
   85.14  
   85.15  subsection\<open>The Abstract Discriminator\<close>
   85.16 -text\<open>However, as @{text FnCall_Var_neq_Var} illustrates, we don't need this
   85.17 +text\<open>However, as \<open>FnCall_Var_neq_Var\<close> illustrates, we don't need this
   85.18  function in order to prove discrimination theorems.\<close>
   85.19  
   85.20  definition
    86.1 --- a/src/HOL/Induct/Sigma_Algebra.thy	Thu May 26 16:57:14 2016 +0200
    86.2 +++ b/src/HOL/Induct/Sigma_Algebra.thy	Thu May 26 17:51:22 2016 +0200
    86.3 @@ -10,8 +10,7 @@
    86.4  
    86.5  text \<open>
    86.6    This is just a tiny example demonstrating the use of inductive
    86.7 -  definitions in classical mathematics.  We define the least @{text
    86.8 -  \<sigma>}-algebra over a given set of sets.
    86.9 +  definitions in classical mathematics.  We define the least \<open>\<sigma>\<close>-algebra over a given set of sets.
   86.10  \<close>
   86.11  
   86.12  inductive_set \<sigma>_algebra :: "'a set set \<Rightarrow> 'a set set"
   86.13 @@ -24,7 +23,7 @@
   86.14  
   86.15  text \<open>
   86.16    The following basic facts are consequences of the closure properties
   86.17 -  of any @{text \<sigma>}-algebra, merely using the introduction rules, but
   86.18 +  of any \<open>\<sigma>\<close>-algebra, merely using the introduction rules, but
   86.19    no induction nor cases.
   86.20  \<close>
   86.21  
    87.1 --- a/src/HOL/Matrix_LP/ComputeFloat.thy	Thu May 26 16:57:14 2016 +0200
    87.2 +++ b/src/HOL/Matrix_LP/ComputeFloat.thy	Thu May 26 17:51:22 2016 +0200
    87.3 @@ -2,7 +2,7 @@
    87.4      Author:     Steven Obua
    87.5  *)
    87.6  
    87.7 -section {* Floating Point Representation of the Reals *}
    87.8 +section \<open>Floating Point Representation of the Reals\<close>
    87.9  
   87.10  theory ComputeFloat
   87.11  imports Complex_Main "~~/src/HOL/Library/Lattice_Algebras"
    88.1 --- a/src/HOL/Matrix_LP/ComputeHOL.thy	Thu May 26 16:57:14 2016 +0200
    88.2 +++ b/src/HOL/Matrix_LP/ComputeHOL.thy	Thu May 26 17:51:22 2016 +0200
    88.3 @@ -134,7 +134,7 @@
    88.4  
    88.5  lemmas compute_hol = compute_if compute_bool compute_pair compute_option compute_list compute_let
    88.6  
    88.7 -ML {*
    88.8 +ML \<open>
    88.9  signature ComputeHOL =
   88.10  sig
   88.11    val prep_thms : thm list -> thm list
   88.12 @@ -182,6 +182,6 @@
   88.13  end
   88.14  
   88.15  end
   88.16 -*}
   88.17 +\<close>
   88.18  
   88.19  end
    89.1 --- a/src/HOL/Matrix_LP/Matrix.thy	Thu May 26 16:57:14 2016 +0200
    89.2 +++ b/src/HOL/Matrix_LP/Matrix.thy	Thu May 26 17:51:22 2016 +0200
    89.3 @@ -265,13 +265,13 @@
    89.4  definition associative :: "('a \<Rightarrow> 'a \<Rightarrow> 'a) \<Rightarrow> bool" where
    89.5  "associative f == ! x y z. f (f x y) z = f x (f y z)"
    89.6  
    89.7 -text{*
    89.8 +text\<open>
    89.9  To reason about associativity and commutativity of operations on matrices,
   89.10  let's take a step back and look at the general situtation: Assume that we have
   89.11  sets $A$ and $B$ with $B \subset A$ and an abstraction $u: A \rightarrow B$. This abstraction has to fulfill $u(b) = b$ for all $b \in B$, but is arbitrary otherwise.
   89.12  Each function $f: A \times A \rightarrow A$ now induces a function $f': B \times B \rightarrow B$ by $f' = u \circ f$.
   89.13  It is obvious that commutativity of $f$ implies commutativity of $f'$: $f' x y = u (f x y) = u (f y x) = f' y x.$
   89.14 -*}
   89.15 +\<close>
   89.16  
   89.17  lemma combine_infmatrix_commute:
   89.18    "commutative f \<Longrightarrow> commutative (combine_infmatrix f)"
   89.19 @@ -281,14 +281,14 @@
   89.20  "commutative f \<Longrightarrow> commutative (combine_matrix f)"
   89.21  by (simp add: combine_matrix_def commutative_def combine_infmatrix_def)
   89.22  
   89.23 -text{*
   89.24 +text\<open>
   89.25  On the contrary, given an associative function $f$ we cannot expect $f'$ to be associative. A counterexample is given by $A=\ganz$, $B=\{-1, 0, 1\}$,
   89.26  as $f$ we take addition on $\ganz$, which is clearly associative. The abstraction is given by  $u(a) = 0$ for $a \notin B$. Then we have
   89.27  \[ f' (f' 1 1) -1 = u(f (u (f 1 1)) -1) = u(f (u 2) -1) = u (f 0 -1) = -1, \]
   89.28  but on the other hand we have
   89.29  \[ f' 1 (f' 1 -1) = u (f 1 (u (f 1 -1))) = u (f 1 0) = 1.\]
   89.30  A way out of this problem is to assume that $f(A\times A)\subset A$ holds, and this is what we are going to do:
   89.31 -*}
   89.32 +\<close>
   89.33  
   89.34  lemma nonzero_positions_combine_infmatrix[simp]: "f 0 0 = 0 \<Longrightarrow> nonzero_positions (combine_infmatrix f A B) \<subseteq> (nonzero_positions A) \<union> (nonzero_positions B)"
   89.35  by (rule subsetI, simp add: nonzero_positions_def combine_infmatrix_def, auto)
   89.36 @@ -303,7 +303,7 @@
   89.37  apply (rule finite_subset[of _ "(nonzero_positions (Rep_matrix A)) \<union> (nonzero_positions (Rep_matrix B))"])
   89.38  by (simp_all)
   89.39  
   89.40 -text {* We need the next two lemmas only later, but it is analog to the above one, so we prove them now: *}
   89.41 +text \<open>We need the next two lemmas only later, but it is analog to the above one, so we prove them now:\<close>
   89.42  lemma nonzero_positions_apply_infmatrix[simp]: "f 0 = 0 \<Longrightarrow> nonzero_positions (apply_infmatrix f A) \<subseteq> nonzero_positions A"
   89.43  by (rule subsetI, simp add: nonzero_positions_def apply_infmatrix_def, auto)
   89.44  
    90.1 --- a/src/HOL/Metis_Examples/Abstraction.thy	Thu May 26 16:57:14 2016 +0200
    90.2 +++ b/src/HOL/Metis_Examples/Abstraction.thy	Thu May 26 17:51:22 2016 +0200
    90.3 @@ -5,7 +5,7 @@
    90.4  Example featuring Metis's support for lambda-abstractions.
    90.5  *)
    90.6  
    90.7 -section {* Example Featuring Metis's Support for Lambda-Abstractions *}
    90.8 +section \<open>Example Featuring Metis's Support for Lambda-Abstractions\<close>
    90.9  
   90.10  theory Abstraction
   90.11  imports "~~/src/HOL/Library/FuncSet"
    91.1 --- a/src/HOL/Metis_Examples/Big_O.thy	Thu May 26 16:57:14 2016 +0200
    91.2 +++ b/src/HOL/Metis_Examples/Big_O.thy	Thu May 26 17:51:22 2016 +0200
    91.3 @@ -5,7 +5,7 @@
    91.4  Metis example featuring the Big O notation.
    91.5  *)
    91.6  
    91.7 -section {* Metis Example Featuring the Big O Notation *}
    91.8 +section \<open>Metis Example Featuring the Big O Notation\<close>
    91.9  
   91.10  theory Big_O
   91.11  imports
   91.12 @@ -14,7 +14,7 @@
   91.13    "~~/src/HOL/Library/Set_Algebras"
   91.14  begin
   91.15  
   91.16 -subsection {* Definitions *}
   91.17 +subsection \<open>Definitions\<close>
   91.18  
   91.19  definition bigo :: "('a => 'b::linordered_idom) => ('a => 'b) set" ("(1O'(_'))") where
   91.20    "O(f::('a => 'b)) == {h. \<exists>c. \<forall>x. \<bar>h x\<bar> <= c * \<bar>f x\<bar>}"
   91.21 @@ -457,7 +457,7 @@
   91.22    hence "\<exists>(v::'a) (u::'a) SKF\<^sub>7::'a \<Rightarrow> 'b. \<bar>inverse c\<bar> * \<bar>g (SKF\<^sub>7 (u * v))\<bar> \<le> u * (v * \<bar>f (SKF\<^sub>7 (u * v))\<bar>)"
   91.23      by (metis mult_left_mono)
   91.24    then show "\<exists>ca::'a. \<forall>x::'b. inverse \<bar>c\<bar> * \<bar>g x\<bar> \<le> ca * \<bar>f x\<bar>"
   91.25 -    using A2 F4 by (metis F1 `0 < \<bar>inverse c\<bar>` linordered_field_class.sign_simps(23) mult_le_cancel_left_pos)
   91.26 +    using A2 F4 by (metis F1 \<open>0 < \<bar>inverse c\<bar>\<close> linordered_field_class.sign_simps(23) mult_le_cancel_left_pos)
   91.27  qed
   91.28  
   91.29  lemma bigo_const_mult6 [intro]: "(\<lambda>x. c) *o O(f) <= O(f)"
   91.30 @@ -489,7 +489,7 @@
   91.31  apply (simp add: fun_diff_def)
   91.32  done
   91.33  
   91.34 -subsection {* Setsum *}
   91.35 +subsection \<open>Setsum\<close>
   91.36  
   91.37  lemma bigo_setsum_main: "\<forall>x. \<forall>y \<in> A x. 0 <= h x y \<Longrightarrow>
   91.38      \<exists>c. \<forall>x. \<forall>y \<in> A x. \<bar>f x y\<bar> <= c * (h x y) \<Longrightarrow>
   91.39 @@ -566,7 +566,7 @@
   91.40    apply auto
   91.41  done
   91.42  
   91.43 -subsection {* Misc useful stuff *}
   91.44 +subsection \<open>Misc useful stuff\<close>
   91.45  
   91.46  lemma bigo_useful_intro: "A <= O(f) \<Longrightarrow> B <= O(f) \<Longrightarrow>
   91.47    A + B <= O(f)"
   91.48 @@ -610,7 +610,7 @@
   91.49    apply (simp add: fun_diff_def)
   91.50  done
   91.51  
   91.52 -subsection {* Less than or equal to *}
   91.53 +subsection \<open>Less than or equal to\<close>
   91.54  
   91.55  definition lesso :: "('a => 'b::linordered_idom) => ('a => 'b) => ('a => 'b)" (infixl "<o" 70) where
   91.56    "f <o g == (\<lambda>x. max (f x - g x) 0)"
    92.1 --- a/src/HOL/Metis_Examples/Binary_Tree.thy	Thu May 26 16:57:14 2016 +0200
    92.2 +++ b/src/HOL/Metis_Examples/Binary_Tree.thy	Thu May 26 17:51:22 2016 +0200
    92.3 @@ -5,7 +5,7 @@
    92.4  Metis example featuring binary trees.
    92.5  *)
    92.6  
    92.7 -section {* Metis Example Featuring Binary Trees *}
    92.8 +section \<open>Metis Example Featuring Binary Trees\<close>
    92.9  
   92.10  theory Binary_Tree
   92.11  imports Main
   92.12 @@ -53,7 +53,7 @@
   92.13    "append Lf t = t"
   92.14  | "append (Br a t1 t2) t = Br a (append t1 t) (append t2 t)"
   92.15  
   92.16 -text {* \medskip BT simplification *}
   92.17 +text \<open>\medskip BT simplification\<close>
   92.18  
   92.19  lemma n_leaves_reflect: "n_leaves (reflect t) = n_leaves t"
   92.20  proof (induct t)
   92.21 @@ -82,9 +82,9 @@
   92.22   apply (metis depth.simps(1) reflect.simps(1))
   92.23  by (metis depth.simps(2) max.commute reflect.simps(2))
   92.24  
   92.25 -text {*
   92.26 +text \<open>
   92.27  The famous relationship between the numbers of leaves and nodes.
   92.28 -*}
   92.29 +\<close>
   92.30  
   92.31  lemma n_leaves_nodes: "n_leaves t = Suc (n_nodes t)"
   92.32  apply (induct t)
   92.33 @@ -197,9 +197,9 @@
   92.34                reflect.simps(1))
   92.35  by (metis preorder_reflect reflect_reflect_ident rev_swap)
   92.36  
   92.37 -text {*
   92.38 +text \<open>
   92.39  Analogues of the standard properties of the append function for lists.
   92.40 -*}
   92.41 +\<close>
   92.42  
   92.43  lemma append_assoc [simp]: "append (append t1 t2) t3 = append t1 (append t2 t3)"
   92.44  apply (induct t1)
    93.1 --- a/src/HOL/Metis_Examples/Clausification.thy	Thu May 26 16:57:14 2016 +0200
    93.2 +++ b/src/HOL/Metis_Examples/Clausification.thy	Thu May 26 17:51:22 2016 +0200
    93.3 @@ -4,14 +4,14 @@
    93.4  Example that exercises Metis's Clausifier.
    93.5  *)
    93.6  
    93.7 -section {* Example that Exercises Metis's Clausifier *}
    93.8 +section \<open>Example that Exercises Metis's Clausifier\<close>
    93.9  
   93.10  theory Clausification
   93.11  imports Complex_Main
   93.12  begin
   93.13  
   93.14  
   93.15 -text {* Definitional CNF for facts *}
   93.16 +text \<open>Definitional CNF for facts\<close>
   93.17  
   93.18  declare [[meson_max_clauses = 10]]
   93.19  
   93.20 @@ -83,7 +83,7 @@
   93.21  by (metis (full_types) rax)
   93.22  
   93.23  
   93.24 -text {* Definitional CNF for goal *}
   93.25 +text \<open>Definitional CNF for goal\<close>
   93.26  
   93.27  axiomatization p :: "nat \<Rightarrow> nat \<Rightarrow> bool" where
   93.28  pax: "\<exists>b. \<forall>a. (p b a \<and> p 0 0 \<and> p 1 a) \<or> (p 0 1 \<and> p 1 0 \<and> p a b)"
   93.29 @@ -109,7 +109,7 @@
   93.30  by (metis (full_types) pax)
   93.31  
   93.32  
   93.33 -text {* New Skolemizer *}
   93.34 +text \<open>New Skolemizer\<close>
   93.35  
   93.36  declare [[metis_new_skolem]]
   93.37  
    94.1 --- a/src/HOL/Metis_Examples/Message.thy	Thu May 26 16:57:14 2016 +0200
    94.2 +++ b/src/HOL/Metis_Examples/Message.thy	Thu May 26 17:51:22 2016 +0200
    94.3 @@ -5,7 +5,7 @@
    94.4  Metis example featuring message authentication.
    94.5  *)
    94.6  
    94.7 -section {* Metis Example Featuring Message Authentication *}
    94.8 +section \<open>Metis Example Featuring Message Authentication\<close>
    94.9  
   94.10  theory Message
   94.11  imports Main
   94.12 @@ -19,8 +19,8 @@
   94.13  type_synonym key = nat
   94.14  
   94.15  consts
   94.16 -  all_symmetric :: bool        --{*true if all keys are symmetric*}
   94.17 -  invKey        :: "key=>key"  --{*inverse of a symmetric key*}
   94.18 +  all_symmetric :: bool        \<comment>\<open>true if all keys are symmetric\<close>
   94.19 +  invKey        :: "key=>key"  \<comment>\<open>inverse of a symmetric key\<close>
   94.20  
   94.21  specification (invKey)
   94.22    invKey [simp]: "invKey (invKey K) = K"
   94.23 @@ -28,26 +28,26 @@
   94.24  by (metis id_apply)
   94.25  
   94.26  
   94.27 -text{*The inverse of a symmetric key is itself; that of a public key
   94.28 -      is the private key and vice versa*}
   94.29 +text\<open>The inverse of a symmetric key is itself; that of a public key
   94.30 +      is the private key and vice versa\<close>
   94.31  
   94.32  definition symKeys :: "key set" where
   94.33    "symKeys == {K. invKey K = K}"
   94.34  
   94.35 -datatype  --{*We allow any number of friendly agents*}
   94.36 +datatype  \<comment>\<open>We allow any number of friendly agents\<close>
   94.37    agent = Server | Friend nat | Spy
   94.38  
   94.39  datatype
   94.40 -     msg = Agent  agent     --{*Agent names*}
   94.41 -         | Number nat       --{*Ordinary integers, timestamps, ...*}
   94.42 -         | Nonce  nat       --{*Unguessable nonces*}
   94.43 -         | Key    key       --{*Crypto keys*}
   94.44 -         | Hash   msg       --{*Hashing*}
   94.45 -         | MPair  msg msg   --{*Compound messages*}
   94.46 -         | Crypt  key msg   --{*Encryption, public- or shared-key*}
   94.47 +     msg = Agent  agent     \<comment>\<open>Agent names\<close>
   94.48 +         | Number nat       \<comment>\<open>Ordinary integers, timestamps, ...\<close>
   94.49 +         | Nonce  nat       \<comment>\<open>Unguessable nonces\<close>
   94.50 +         | Key    key       \<comment>\<open>Crypto keys\<close>
   94.51 +         | Hash   msg       \<comment>\<open>Hashing\<close>
   94.52 +         | MPair  msg msg   \<comment>\<open>Compound messages\<close>
   94.53 +         | Crypt  key msg   \<comment>\<open>Encryption, public- or shared-key\<close>
   94.54  
   94.55  
   94.56 -text{*Concrete syntax: messages appear as \<open>\<lbrace>A,B,NA\<rbrace>\<close>, etc...*}
   94.57 +text\<open>Concrete syntax: messages appear as \<open>\<lbrace>A,B,NA\<rbrace>\<close>, etc...\<close>
   94.58  syntax
   94.59    "_MTuple"      :: "['a, args] => 'a * 'b"       ("(2\<lbrace>_,/ _\<rbrace>)")
   94.60  translations
   94.61 @@ -56,15 +56,15 @@
   94.62  
   94.63  
   94.64  definition HPair :: "[msg,msg] => msg" ("(4Hash[_] /_)" [0, 1000]) where
   94.65 -    --{*Message Y paired with a MAC computed with the help of X*}
   94.66 +    \<comment>\<open>Message Y paired with a MAC computed with the help of X\<close>
   94.67      "Hash[X] Y == \<lbrace> Hash\<lbrace>X,Y\<rbrace>, Y\<rbrace>"
   94.68  
   94.69  definition keysFor :: "msg set => key set" where
   94.70 -    --{*Keys useful to decrypt elements of a message set*}
   94.71 +    \<comment>\<open>Keys useful to decrypt elements of a message set\<close>
   94.72    "keysFor H == invKey ` {K. \<exists>X. Crypt K X \<in> H}"
   94.73  
   94.74  
   94.75 -subsubsection{*Inductive Definition of All Parts" of a Message*}
   94.76 +subsubsection\<open>Inductive Definition of All Parts" of a Message\<close>
   94.77  
   94.78  inductive_set
   94.79    parts :: "msg set => msg set"
   94.80 @@ -83,7 +83,7 @@
   94.81   apply (metis parts.Snd)
   94.82  by (metis parts.Body)
   94.83  
   94.84 -text{*Equations hold because constructors are injective.*}
   94.85 +text\<open>Equations hold because constructors are injective.\<close>
   94.86  lemma Friend_image_eq [simp]: "(Friend x \<in> Friend`A) = (x:A)"
   94.87  by (metis agent.inject image_iff)
   94.88  
   94.89 @@ -94,13 +94,13 @@
   94.90  by (metis image_iff msg.distinct(23))
   94.91  
   94.92  
   94.93 -subsubsection{*Inverse of keys *}
   94.94 +subsubsection\<open>Inverse of keys\<close>
   94.95  
   94.96  lemma invKey_eq [simp]: "(invKey K = invKey K') = (K = K')"
   94.97  by (metis invKey)
   94.98  
   94.99  
  94.100 -subsection{*keysFor operator*}
  94.101 +subsection\<open>keysFor operator\<close>
  94.102  
  94.103  lemma keysFor_empty [simp]: "keysFor {} = {}"
  94.104  by (unfold keysFor_def, blast)
  94.105 @@ -111,7 +111,7 @@
  94.106  lemma keysFor_UN [simp]: "keysFor (\<Union>i\<in>A. H i) = (\<Union>i\<in>A. keysFor (H i))"
  94.107  by (unfold keysFor_def, blast)
  94.108  
  94.109 -text{*Monotonicity*}
  94.110 +text\<open>Monotonicity\<close>
  94.111  lemma keysFor_mono: "G \<subseteq> H ==> keysFor(G) \<subseteq> keysFor(H)"
  94.112  by (unfold keysFor_def, blast)
  94.113  
  94.114 @@ -144,7 +144,7 @@
  94.115  by (unfold keysFor_def, blast)
  94.116  
  94.117  
  94.118 -subsection{*Inductive relation "parts"*}
  94.119 +subsection\<open>Inductive relation "parts"\<close>
  94.120  
  94.121  lemma MPair_parts:
  94.122       "[| \<lbrace>X,Y\<rbrace> \<in> parts H;
  94.123 @@ -152,10 +152,10 @@
  94.124  by (blast dest: parts.Fst parts.Snd)
  94.125  
  94.126  declare MPair_parts [elim!] parts.Body [dest!]
  94.127 -text{*NB These two rules are UNSAFE in the formal sense, as they discard the
  94.128 +text\<open>NB These two rules are UNSAFE in the formal sense, as they discard the
  94.129       compound message.  They work well on THIS FILE.
  94.130 -  @{text MPair_parts} is left as SAFE because it speeds up proofs.
  94.131 -  The Crypt rule is normally kept UNSAFE to avoid breaking up certificates.*}
  94.132 +  \<open>MPair_parts\<close> is left as SAFE because it speeds up proofs.
  94.133 +  The Crypt rule is normally kept UNSAFE to avoid breaking up certificates.\<close>
  94.134  
  94.135  lemma parts_increasing: "H \<subseteq> parts(H)"
  94.136  by blast
  94.137 @@ -171,14 +171,14 @@
  94.138  lemma parts_emptyE [elim!]: "X\<in> parts{} ==> P"
  94.139  by simp
  94.140  
  94.141 -text{*WARNING: loops if H = {Y}, therefore must not be repeated!*}
  94.142 +text\<open>WARNING: loops if H = {Y}, therefore must not be repeated!\<close>
  94.143  lemma parts_singleton: "X\<in> parts H ==> \<exists>Y\<in>H. X\<in> parts {Y}"
  94.144  apply (erule parts.induct)
  94.145  apply fast+
  94.146  done
  94.147  
  94.148  
  94.149 -subsubsection{*Unions *}
  94.150 +subsubsection\<open>Unions\<close>
  94.151  
  94.152  lemma parts_Un_subset1: "parts(G) \<union> parts(H) \<subseteq> parts(G \<union> H)"
  94.153  by (intro Un_least parts_mono Un_upper1 Un_upper2)
  94.154 @@ -212,19 +212,19 @@
  94.155  lemma parts_UN [simp]: "parts(\<Union>x\<in>A. H x) = (\<Union>x\<in>A. parts(H x))"
  94.156  by (intro equalityI parts_UN_subset1 parts_UN_subset2)
  94.157  
  94.158 -text{*Added to simplify arguments to parts, analz and synth.
  94.159 -  NOTE: the UN versions are no longer used!*}
  94.160 +text\<open>Added to simplify arguments to parts, analz and synth.
  94.161 +  NOTE: the UN versions are no longer used!\<close>
  94.162  
  94.163  
  94.164 -text{*This allows @{text blast} to simplify occurrences of
  94.165 -  @{term "parts(G\<union>H)"} in the assumption.*}
  94.166 +text\<open>This allows \<open>blast\<close> to simplify occurrences of
  94.167 +  @{term "parts(G\<union>H)"} in the assumption.\<close>
  94.168  lemmas in_parts_UnE = parts_Un [THEN equalityD1, THEN subsetD, THEN UnE]
  94.169  declare in_parts_UnE [elim!]
  94.170  
  94.171  lemma parts_insert_subset: "insert X (parts H) \<subseteq> parts(insert X H)"
  94.172  by (blast intro: parts_mono [THEN [2] rev_subsetD])
  94.173  
  94.174 -subsubsection{*Idempotence and transitivity *}
  94.175 +subsubsection\<open>Idempotence and transitivity\<close>
  94.176  
  94.177  lemma parts_partsD [dest!]: "X\<in> parts (parts H) ==> X\<in> parts H"
  94.178  by (erule parts.induct, blast+)
  94.179 @@ -245,7 +245,7 @@
  94.180  by (metis (no_types) Un_insert_left Un_insert_right insert_absorb le_supE
  94.181            parts_Un parts_idem parts_increasing parts_trans)
  94.182  
  94.183 -subsubsection{*Rewrite rules for pulling out atomic messages *}
  94.184 +subsubsection\<open>Rewrite rules for pulling out atomic messages\<close>
  94.185  
  94.186  lemmas parts_insert_eq_I = equalityI [OF subsetI parts_insert_subset]
  94.187  
  94.188 @@ -310,11 +310,11 @@
  94.189  apply (metis le_trans linorder_linear)
  94.190  done
  94.191  
  94.192 -subsection{*Inductive relation "analz"*}
  94.193 +subsection\<open>Inductive relation "analz"\<close>
  94.194  
  94.195 -text{*Inductive definition of "analz" -- what can be broken down from a set of
  94.196 +text\<open>Inductive definition of "analz" -- what can be broken down from a set of
  94.197      messages, including keys.  A form of downward closure.  Pairs can
  94.198 -    be taken apart; messages decrypted with known keys.  *}
  94.199 +    be taken apart; messages decrypted with known keys.\<close>
  94.200  
  94.201  inductive_set
  94.202    analz :: "msg set => msg set"
  94.203 @@ -327,14 +327,14 @@
  94.204               "[|Crypt K X \<in> analz H; Key(invKey K): analz H|] ==> X \<in> analz H"
  94.205  
  94.206  
  94.207 -text{*Monotonicity; Lemma 1 of Lowe's paper*}
  94.208 +text\<open>Monotonicity; Lemma 1 of Lowe's paper\<close>
  94.209  lemma analz_mono: "G\<subseteq>H ==> analz(G) \<subseteq> analz(H)"
  94.210  apply auto
  94.211  apply (erule analz.induct)
  94.212  apply (auto dest: analz.Fst analz.Snd)
  94.213  done
  94.214  
  94.215 -text{*Making it safe speeds up proofs*}
  94.216 +text\<open>Making it safe speeds up proofs\<close>
  94.217  lemma MPair_analz [elim!]:
  94.218       "[| \<lbrace>X,Y\<rbrace> \<in> analz H;
  94.219               [| X \<in> analz H; Y \<in> analz H |] ==> P
  94.220 @@ -367,22 +367,22 @@
  94.221  
  94.222  lemmas analz_insertI = subset_insertI [THEN analz_mono, THEN [2] rev_subsetD]
  94.223  
  94.224 -subsubsection{*General equational properties *}
  94.225 +subsubsection\<open>General equational properties\<close>
  94.226  
  94.227  lemma analz_empty [simp]: "analz{} = {}"
  94.228  apply safe
  94.229  apply (erule analz.induct, blast+)
  94.230  done
  94.231  
  94.232 -text{*Converse fails: we can analz more from the union than from the
  94.233 -  separate parts, as a key in one might decrypt a message in the other*}
  94.234 +text\<open>Converse fails: we can analz more from the union than from the
  94.235 +  separate parts, as a key in one might decrypt a message in the other\<close>
  94.236  lemma analz_Un: "analz(G) \<union> analz(H) \<subseteq> analz(G \<union> H)"
  94.237  by (intro Un_least analz_mono Un_upper1 Un_upper2)
  94.238  
  94.239  lemma analz_insert: "insert X (analz H) \<subseteq> analz(insert X H)"
  94.240  by (blast intro: analz_mono [THEN [2] rev_subsetD])
  94.241  
  94.242 -subsubsection{*Rewrite rules for pulling out atomic messages *}
  94.243 +subsubsection\<open>Rewrite rules for pulling out atomic messages\<close>
  94.244  
  94.245  lemmas analz_insert_eq_I = equalityI [OF subsetI analz_insert]
  94.246  
  94.247 @@ -410,7 +410,7 @@
  94.248  apply (erule analz.induct, auto)
  94.249  done
  94.250  
  94.251 -text{*Can only pull out Keys if they are not needed to decrypt the rest*}
  94.252 +text\<open>Can only pull out Keys if they are not needed to decrypt the rest\<close>
  94.253  lemma analz_insert_Key [simp]:
  94.254      "K \<notin> keysFor (analz H) ==>
  94.255            analz (insert (Key K) H) = insert (Key K) (analz H)"
  94.256 @@ -429,7 +429,7 @@
  94.257  apply (blast intro: analz.Fst analz.Snd)+
  94.258  done
  94.259  
  94.260 -text{*Can pull out enCrypted message if the Key is not known*}
  94.261 +text\<open>Can pull out enCrypted message if the Key is not known\<close>
  94.262  lemma analz_insert_Crypt:
  94.263       "Key (invKey K) \<notin> analz H
  94.264        ==> analz (insert (Crypt K X) H) = insert (Crypt K X) (analz H)"
  94.265 @@ -459,10 +459,10 @@
  94.266                 insert (Crypt K X) (analz (insert X H))"
  94.267  by (intro equalityI lemma1 lemma2)
  94.268  
  94.269 -text{*Case analysis: either the message is secure, or it is not! Effective,
  94.270 -but can cause subgoals to blow up! Use with @{text "if_split"}; apparently
  94.271 -@{text "split_tac"} does not cope with patterns such as @{term"analz (insert
  94.272 -(Crypt K X) H)"} *}
  94.273 +text\<open>Case analysis: either the message is secure, or it is not! Effective,
  94.274 +but can cause subgoals to blow up! Use with \<open>if_split\<close>; apparently
  94.275 +\<open>split_tac\<close> does not cope with patterns such as @{term"analz (insert
  94.276 +(Crypt K X) H)"}\<close>
  94.277  lemma analz_Crypt_if [simp]:
  94.278       "analz (insert (Crypt K X) H) =
  94.279            (if (Key (invKey K) \<in> analz H)
  94.280 @@ -471,7 +471,7 @@
  94.281  by (simp add: analz_insert_Crypt analz_insert_Decrypt)
  94.282  
  94.283  
  94.284 -text{*This rule supposes "for the sake of argument" that we have the key.*}
  94.285 +text\<open>This rule supposes "for the sake of argument" that we have the key.\<close>
  94.286  lemma analz_insert_Crypt_subset:
  94.287       "analz (insert (Crypt K X) H) \<subseteq>
  94.288             insert (Crypt K X) (analz (insert X H))"
  94.289 @@ -486,7 +486,7 @@
  94.290  done
  94.291  
  94.292  
  94.293 -subsubsection{*Idempotence and transitivity *}
  94.294 +subsubsection\<open>Idempotence and transitivity\<close>
  94.295  
  94.296  lemma analz_analzD [dest!]: "X\<in> analz (analz H) ==> X\<in> analz H"
  94.297  by (erule analz.induct, blast+)
  94.298 @@ -509,14 +509,14 @@
  94.299  lemma analz_cut: "[| Y\<in> analz (insert X H);  X\<in> analz H |] ==> Y\<in> analz H"
  94.300  by (metis analz_idem analz_increasing analz_mono insert_absorb insert_mono insert_subset)
  94.301  
  94.302 -text{*This rewrite rule helps in the simplification of messages that involve
  94.303 +text\<open>This rewrite rule helps in the simplification of messages that involve
  94.304    the forwarding of unknown components (X).  Without it, removing occurrences
  94.305 -  of X can be very complicated. *}
  94.306 +  of X can be very complicated.\<close>
  94.307  lemma analz_insert_eq: "X\<in> analz H ==> analz (insert X H) = analz H"
  94.308  by (blast intro: analz_cut analz_insertI)
  94.309  
  94.310  
  94.311 -text{*A congruence rule for "analz" *}
  94.312 +text\<open>A congruence rule for "analz"\<close>
  94.313  
  94.314  lemma analz_subset_cong:
  94.315       "[| analz G \<subseteq> analz G'; analz H \<subseteq> analz H' |]
  94.316 @@ -535,14 +535,14 @@
  94.317       "analz H = analz H' ==> analz(insert X H) = analz(insert X H')"
  94.318  by (force simp only: insert_def intro!: analz_cong)
  94.319  
  94.320 -text{*If there are no pairs or encryptions then analz does nothing*}
  94.321 +text\<open>If there are no pairs or encryptions then analz does nothing\<close>
  94.322  lemma analz_trivial:
  94.323       "[| \<forall>X Y. \<lbrace>X,Y\<rbrace> \<notin> H;  \<forall>X K. Crypt K X \<notin> H |] ==> analz H = H"
  94.324  apply safe
  94.325  apply (erule analz.induct, blast+)
  94.326  done
  94.327  
  94.328 -text{*These two are obsolete (with a single Spy) but cost little to prove...*}
  94.329 +text\<open>These two are obsolete (with a single Spy) but cost little to prove...\<close>
  94.330  lemma analz_UN_analz_lemma:
  94.331       "X\<in> analz (\<Union>i\<in>A. analz (H i)) ==> X\<in> analz (\<Union>i\<in>A. H i)"
  94.332  apply (erule analz.induct)
  94.333 @@ -553,12 +553,12 @@
  94.334  by (blast intro: analz_UN_analz_lemma analz_mono [THEN [2] rev_subsetD])
  94.335  
  94.336  
  94.337 -subsection{*Inductive relation "synth"*}
  94.338 +subsection\<open>Inductive relation "synth"\<close>
  94.339  
  94.340 -text{*Inductive definition of "synth" -- what can be built up from a set of
  94.341 +text\<open>Inductive definition of "synth" -- what can be built up from a set of
  94.342      messages.  A form of upward closure.  Pairs can be built, messages
  94.343      encrypted with known keys.  Agent names are public domain.
  94.344 -    Numbers can be guessed, but Nonces cannot be.  *}
  94.345 +    Numbers can be guessed, but Nonces cannot be.\<close>
  94.346  
  94.347  inductive_set
  94.348    synth :: "msg set => msg set"
  94.349 @@ -571,12 +571,12 @@
  94.350    | MPair  [intro]:   "[|X \<in> synth H;  Y \<in> synth H|] ==> \<lbrace>X,Y\<rbrace> \<in> synth H"
  94.351    | Crypt  [intro]:   "[|X \<in> synth H;  Key(K) \<in> H|] ==> Crypt K X \<in> synth H"
  94.352  
  94.353 -text{*Monotonicity*}
  94.354 +text\<open>Monotonicity\<close>
  94.355  lemma synth_mono: "G\<subseteq>H ==> synth(G) \<subseteq> synth(H)"
  94.356    by (auto, erule synth.induct, auto)
  94.357  
  94.358 -text{*NO @{text Agent_synth}, as any Agent name can be synthesized.
  94.359 -  The same holds for @{term Number}*}
  94.360 +text\<open>NO \<open>Agent_synth\<close>, as any Agent name can be synthesized.
  94.361 +  The same holds for @{term Number}\<close>
  94.362  inductive_cases Nonce_synth [elim!]: "Nonce n \<in> synth H"
  94.363  inductive_cases Key_synth   [elim!]: "Key K \<in> synth H"
  94.364  inductive_cases Hash_synth  [elim!]: "Hash X \<in> synth H"
  94.365 @@ -587,17 +587,17 @@
  94.366  lemma synth_increasing: "H \<subseteq> synth(H)"
  94.367  by blast
  94.368  
  94.369 -subsubsection{*Unions *}
  94.370 +subsubsection\<open>Unions\<close>
  94.371  
  94.372 -text{*Converse fails: we can synth more from the union than from the
  94.373 -  separate parts, building a compound message using elements of each.*}
  94.374 +text\<open>Converse fails: we can synth more from the union than from the
  94.375 +  separate parts, building a compound message using elements of each.\<close>
  94.376  lemma synth_Un: "synth(G) \<union> synth(H) \<subseteq> synth(G \<union> H)"
  94.377  by (intro Un_least synth_mono Un_upper1 Un_upper2)
  94.378  
  94.379  lemma synth_insert: "insert X (synth H) \<subseteq> synth(insert X H)"
  94.380  by (metis insert_iff insert_subset subset_insertI synth.Inj synth_mono)
  94.381  
  94.382 -subsubsection{*Idempotence and transitivity *}
  94.383 +subsubsection\<open>Idempotence and transitivity\<close>
  94.384  
  94.385  lemma synth_synthD [dest!]: "X\<in> synth (synth H) ==> X\<in> synth H"
  94.386  by (erule synth.induct, blast+)
  94.387 @@ -639,7 +639,7 @@
  94.388  by (unfold keysFor_def, blast)
  94.389  
  94.390  
  94.391 -subsubsection{*Combinations of parts, analz and synth *}
  94.392 +subsubsection\<open>Combinations of parts, analz and synth\<close>
  94.393  
  94.394  lemma parts_synth [simp]: "parts (synth H) = parts H \<union> synth H"
  94.395  apply (rule equalityI)
  94.396 @@ -681,7 +681,7 @@
  94.397  qed
  94.398  
  94.399  
  94.400 -subsubsection{*For reasoning about the Fake rule in traces *}
  94.401 +subsubsection\<open>For reasoning about the Fake rule in traces\<close>
  94.402  
  94.403  lemma parts_insert_subset_Un: "X \<in> G ==> parts(insert X H) \<subseteq> parts G \<union> parts H"
  94.404  proof -
    95.1 --- a/src/HOL/Metis_Examples/Proxies.thy	Thu May 26 16:57:14 2016 +0200
    95.2 +++ b/src/HOL/Metis_Examples/Proxies.thy	Thu May 26 17:51:22 2016 +0200
    95.3 @@ -5,10 +5,10 @@
    95.4  rudimentary higher-order reasoning.
    95.5  *)
    95.6  
    95.7 -section {*
    95.8 +section \<open>
    95.9  Example that Exercises Metis's and Sledgehammer's Logical Symbol Proxies for
   95.10  Rudimentary Higher-Order Reasoning.
   95.11 -*}
   95.12 +\<close>
   95.13  
   95.14  theory Proxies
   95.15  imports Type_Encodings
   95.16 @@ -17,7 +17,7 @@
   95.17  sledgehammer_params [prover = spass, fact_filter = mepo, timeout = 30, preplay_timeout = 0,
   95.18    dont_minimize]
   95.19  
   95.20 -text {* Extensionality and set constants *}
   95.21 +text \<open>Extensionality and set constants\<close>
   95.22  
   95.23  lemma plus_1_not_0: "n + (1::nat) \<noteq> 0"
   95.24  by simp
   95.25 @@ -57,7 +57,7 @@
   95.26  sledgehammer [expect = some]
   95.27  by (metis_exhaust B_def C_def int_le_0_imp_le_1 predicate1I)
   95.28  
   95.29 -text {* Proxies for logical constants *}
   95.30 +text \<open>Proxies for logical constants\<close>
   95.31  
   95.32  lemma "id (op =) x x"
   95.33  sledgehammer [type_enc = erased, expect = none] (id_apply)
    96.1 --- a/src/HOL/Metis_Examples/Sets.thy	Thu May 26 16:57:14 2016 +0200
    96.2 +++ b/src/HOL/Metis_Examples/Sets.thy	Thu May 26 17:51:22 2016 +0200
    96.3 @@ -5,7 +5,7 @@
    96.4  Metis example featuring typed set theory.
    96.5  *)
    96.6  
    96.7 -section {* Metis Example Featuring Typed Set Theory *}
    96.8 +section \<open>Metis Example Featuring Typed Set Theory\<close>
    96.9  
   96.10  theory Sets
   96.11  imports Main
   96.12 @@ -177,10 +177,10 @@
   96.13    thus "\<exists>z. S \<subseteq> {z}" by metis
   96.14  qed
   96.15  
   96.16 -text {*
   96.17 +text \<open>
   96.18    From W. W. Bledsoe and Guohui Feng, SET-VAR. JAR 11 (3), 1993, pages
   96.19    293-314.
   96.20 -*}
   96.21 +\<close>
   96.22  
   96.23  (* Notes: (1) The numbering doesn't completely agree with the paper.
   96.24     (2) We must rename set variables to avoid type clashes. *)
    97.1 --- a/src/HOL/Metis_Examples/Tarski.thy	Thu May 26 16:57:14 2016 +0200
    97.2 +++ b/src/HOL/Metis_Examples/Tarski.thy	Thu May 26 17:51:22 2016 +0200
    97.3 @@ -5,7 +5,7 @@
    97.4  Metis example featuring the full theorem of Tarski.
    97.5  *)
    97.6  
    97.7 -section {* Metis Example Featuring the Full Theorem of Tarski *}
    97.8 +section \<open>Metis Example Featuring the Full Theorem of Tarski\<close>
    97.9  
   97.10  theory Tarski
   97.11  imports Main "~~/src/HOL/Library/FuncSet"
   97.12 @@ -117,7 +117,7 @@
   97.13                               x: intY1}
   97.14                        (| pset=intY1, order=induced intY1 r|)"
   97.15  
   97.16 -subsection {* Partial Order *}
   97.17 +subsection \<open>Partial Order\<close>
   97.18  
   97.19  lemma (in PO) PO_imp_refl_on: "refl_on A r"
   97.20  apply (insert cl_po)
   97.21 @@ -158,13 +158,13 @@
   97.22       "S \<subseteq> A ==> (| pset = S, order = induced S r |) \<in> PartialOrder"
   97.23  apply (simp (no_asm) add: PartialOrder_def)
   97.24  apply auto
   97.25 --- {* refl *}
   97.26 +\<comment> \<open>refl\<close>
   97.27  apply (simp add: refl_on_def induced_def)
   97.28  apply (blast intro: reflE)
   97.29 --- {* antisym *}
   97.30 +\<comment> \<open>antisym\<close>
   97.31  apply (simp add: antisym_def induced_def)
   97.32  apply (blast intro: antisymE)
   97.33 --- {* trans *}
   97.34 +\<comment> \<open>trans\<close>
   97.35  apply (simp add: trans_def induced_def)
   97.36  apply (blast intro: transE)
   97.37  done
   97.38 @@ -290,7 +290,7 @@
   97.39  apply (simp add: reflE)
   97.40  done
   97.41  
   97.42 -subsection {* sublattice *}
   97.43 +subsection \<open>sublattice\<close>
   97.44  
   97.45  lemma (in PO) sublattice_imp_CL:
   97.46       "S <<= cl  ==> (| pset = S, order = induced S r |) \<in> CompleteLattice"
   97.47 @@ -301,7 +301,7 @@
   97.48        ==> S <<= cl"
   97.49  by (simp add: sublattice_def A_def r_def)
   97.50  
   97.51 -subsection {* lub *}
   97.52 +subsection \<open>lub\<close>
   97.53  
   97.54  lemma (in CL) lub_unique: "[| S \<subseteq> A; isLub S cl x; isLub S cl L|] ==> x = L"
   97.55  apply (rule antisymE)
   97.56 @@ -366,7 +366,7 @@
   97.57           (\<forall>z \<in> A. (\<forall>y \<in> S. (y, z):r) --> (L, z) \<in> r)|] ==> isLub S cl L"
   97.58  by (simp add: isLub_def A_def r_def)
   97.59  
   97.60 -subsection {* glb *}
   97.61 +subsection \<open>glb\<close>
   97.62  
   97.63  lemma (in CL) glb_in_lattice: "S \<subseteq> A ==> glb S cl \<in> A"
   97.64  apply (subst glb_dual_lub)
   97.65 @@ -394,10 +394,10 @@
   97.66  apply (simp add: dualA_iff A_def, assumption)
   97.67  done
   97.68  
   97.69 -text {*
   97.70 +text \<open>
   97.71    Reduce the sublattice property by using substructural properties;
   97.72 -  abandoned see @{text "Tarski_4.ML"}.
   97.73 -*}
   97.74 +  abandoned see \<open>Tarski_4.ML\<close>.
   97.75 +\<close>
   97.76  
   97.77  declare (in CLF) f_cl [simp]
   97.78  
   97.79 @@ -433,7 +433,7 @@
   97.80  declare (in CLF) CLF_set_def[simp del] CL_dualCL[simp del] monotone_dual[simp del]
   97.81            dualA_iff[simp del]
   97.82  
   97.83 -subsection {* fixed points *}
   97.84 +subsection \<open>fixed points\<close>
   97.85  
   97.86  lemma fix_subset: "fix f A \<subseteq> A"
   97.87  by (simp add: fix_def, fast)
   97.88 @@ -445,7 +445,7 @@
   97.89       "[| A \<subseteq> B; x \<in> fix (%y: A. f y) A |] ==> x \<in> fix f B"
   97.90  by (simp add: fix_def, auto)
   97.91  
   97.92 -subsection {* lemmas for Tarski, lub *}
   97.93 +subsection \<open>lemmas for Tarski, lub\<close>
   97.94  
   97.95  (*never proved, 2007-01-22*)
   97.96  
   97.97 @@ -456,14 +456,14 @@
   97.98  apply (rule lub_least, fast)
   97.99  apply (rule f_in_funcset [THEN funcset_mem])
  97.100  apply (rule lub_in_lattice, fast)
  97.101 --- {* @{text "\<forall>x:H. (x, f (lub H r)) \<in> r"} *}
  97.102 +\<comment> \<open>\<open>\<forall>x:H. (x, f (lub H r)) \<in> r\<close>\<close>
  97.103  apply (rule ballI)
  97.104  (*never proved, 2007-01-22*)
  97.105  apply (rule transE)
  97.106 --- {* instantiates @{text "(x, ?z) \<in> order cl to (x, f x)"}, *}
  97.107 --- {* because of the definition of @{text H} *}
  97.108 +\<comment> \<open>instantiates \<open>(x, ?z) \<in> order cl to (x, f x)\<close>,\<close>
  97.109 +\<comment> \<open>because of the definition of \<open>H\<close>\<close>
  97.110  apply fast
  97.111 --- {* so it remains to show @{text "(f x, f (lub H cl)) \<in> r"} *}
  97.112 +\<comment> \<open>so it remains to show \<open>(f x, f (lub H cl)) \<in> r\<close>\<close>
  97.113  apply (rule_tac f = "f" in monotoneE)
  97.114  apply (rule monotone_f, fast)
  97.115  apply (rule lub_in_lattice, fast)
  97.116 @@ -557,7 +557,7 @@
  97.117  apply (metis P_def lubH_is_fixp)
  97.118  done
  97.119  
  97.120 -subsection {* Tarski fixpoint theorem 1, first part *}
  97.121 +subsection \<open>Tarski fixpoint theorem 1, first part\<close>
  97.122  
  97.123  declare CL.lubI[intro] fix_subset[intro] CL.lub_in_lattice[intro]
  97.124          CLF.fixf_le_lubH[simp] CLF.lubH_least_fixf[simp]
  97.125 @@ -582,7 +582,7 @@
  97.126          PO.dualPO[intro] CL.CL_dualCL[intro] PO.dualr_iff[simp]
  97.127  
  97.128  lemma (in CLF) glbH_is_fixp: "H = {x. (f x, x) \<in> r & x \<in> A} ==> glb H cl \<in> P"
  97.129 -  -- {* Tarski for glb *}
  97.130 +  \<comment> \<open>Tarski for glb\<close>
  97.131  (*sledgehammer;*)
  97.132  apply (simp add: glb_dual_lub P_def A_def r_def)
  97.133  apply (rule dualA_iff [THEN subst])
  97.134 @@ -613,7 +613,7 @@
  97.135    OF dualPO CL_dualCL] dualPO CL_dualCL CLF_dual dualr_iff)
  97.136  done
  97.137  
  97.138 -subsection {* interval *}
  97.139 +subsection \<open>interval\<close>
  97.140  
  97.141  declare (in CLF) CO_refl_on[simp] refl_on_def [simp]
  97.142  
  97.143 @@ -671,7 +671,7 @@
  97.144  apply (rule ballI)
  97.145  apply (simp add: interval_lemma1)
  97.146  apply (simp add: isLub_upper)
  97.147 --- {* @{text "(L, b) \<in> r"} *}
  97.148 +\<comment> \<open>\<open>(L, b) \<in> r\<close>\<close>
  97.149  apply (simp add: isLub_least interval_lemma2)
  97.150  done
  97.151  
  97.152 @@ -709,31 +709,31 @@
  97.153  prefer 2 apply assumption
  97.154  apply assumption
  97.155  apply (erule exE)
  97.156 --- {* define the lub for the interval as *}
  97.157 +\<comment> \<open>define the lub for the interval as\<close>
  97.158  apply (rule_tac x = "if S = {} then a else L" in exI)
  97.159  apply (simp (no_asm_simp) add: isLub_def split del: if_split)
  97.160  apply (intro impI conjI)
  97.161 --- {* @{text "(if S = {} then a else L) \<in> interval r a b"} *}
  97.162 +\<comment> \<open>\<open>(if S = {} then a else L) \<in> interval r a b\<close>\<close>
  97.163  apply (simp add: CL_imp_PO L_in_interval)
  97.164  apply (simp add: left_in_interval)
  97.165 --- {* lub prop 1 *}
  97.166 +\<comment> \<open>lub prop 1\<close>
  97.167  apply (case_tac "S = {}")
  97.168 --- {* @{text "S = {}, y \<in> S = False => everything"} *}
  97.169 +\<comment> \<open>\<open>S = {}, y \<in> S = False => everything\<close>\<close>
  97.170  apply fast
  97.171 --- {* @{text "S \<noteq> {}"} *}
  97.172 +\<comment> \<open>\<open>S \<noteq> {}\<close>\<close>
  97.173  apply simp
  97.174 --- {* @{text "\<forall>y:S. (y, L) \<in> induced (interval r a b) r"} *}
  97.175 +\<comment> \<open>\<open>\<forall>y:S. (y, L) \<in> induced (interval r a b) r\<close>\<close>
  97.176  apply (rule ballI)
  97.177  apply (simp add: induced_def  L_in_interval)
  97.178  apply (rule conjI)
  97.179  apply (rule subsetD)
  97.180  apply (simp add: S_intv_cl, assumption)
  97.181  apply (simp add: isLub_upper)
  97.182 --- {* @{text "\<forall>z:interval r a b. (\<forall>y:S. (y, z) \<in> induced (interval r a b) r \<longrightarrow> (if S = {} then a else L, z) \<in> induced (interval r a b) r"} *}
  97.183 +\<comment> \<open>\<open>\<forall>z:interval r a b. (\<forall>y:S. (y, z) \<in> induced (interval r a b) r \<longrightarrow> (if S = {} then a else L, z) \<in> induced (interval r a b) r\<close>\<close>
  97.184  apply (rule ballI)
  97.185  apply (rule impI)
  97.186  apply (case_tac "S = {}")
  97.187 --- {* @{text "S = {}"} *}
  97.188 +\<comment> \<open>\<open>S = {}\<close>\<close>
  97.189  apply simp
  97.190  apply (simp add: induced_def  interval_def)
  97.191  apply (rule conjI)
  97.192 @@ -741,7 +741,7 @@
  97.193  apply (rule interval_not_empty)
  97.194  apply (rule CO_trans)
  97.195  apply (simp add: interval_def)
  97.196 --- {* @{text "S \<noteq> {}"} *}
  97.197 +\<comment> \<open>\<open>S \<noteq> {}\<close>\<close>
  97.198  apply simp
  97.199  apply (simp add: induced_def  L_in_interval)
  97.200  apply (rule isLub_least, assumption)
  97.201 @@ -771,7 +771,7 @@
  97.202  lemmas (in CLF) interv_is_compl_latt =
  97.203      interval_is_sublattice [THEN sublattice_imp_CL]
  97.204  
  97.205 -subsection {* Top and Bottom *}
  97.206 +subsection \<open>Top and Bottom\<close>
  97.207  lemma (in CLF) Top_dual_Bot: "Top cl = Bot (dual cl)"
  97.208  by (simp add: Top_def Bot_def least_def greatest_def dualA_iff dualr_iff)
  97.209  
  97.210 @@ -826,7 +826,7 @@
  97.211  apply (metis Bot_prop ex_in_conv intervalI reflE rel_imp_elem)
  97.212  done
  97.213  
  97.214 -subsection {* fixed points form a partial order *}
  97.215 +subsection \<open>fixed points form a partial order\<close>
  97.216  
  97.217  lemma (in CLF) fixf_po: "(| pset = P, order = induced P r|) \<in> PartialOrder"
  97.218  by (simp add: P_def fix_subset po_subset_po)
  97.219 @@ -856,12 +856,12 @@
  97.220  apply (rule Y_subset_A)
  97.221  apply (rule f_in_funcset [THEN funcset_mem])
  97.222  apply (rule lubY_in_A)
  97.223 --- {* @{text "Y \<subseteq> P ==> f x = x"} *}
  97.224 +\<comment> \<open>\<open>Y \<subseteq> P ==> f x = x\<close>\<close>
  97.225  apply (rule ballI)
  97.226  (*sledgehammer *)
  97.227  apply (rule_tac t = "x" in fix_imp_eq [THEN subst])
  97.228  apply (erule Y_ss [simplified P_def, THEN subsetD])
  97.229 --- {* @{text "reduce (f x, f (lub Y cl)) \<in> r to (x, lub Y cl) \<in> r"} by monotonicity *}
  97.230 +\<comment> \<open>\<open>reduce (f x, f (lub Y cl)) \<in> r to (x, lub Y cl) \<in> r\<close> by monotonicity\<close>
  97.231  (*sledgehammer*)
  97.232  apply (rule_tac f = "f" in monotoneE)
  97.233  apply (rule monotone_f)
  97.234 @@ -890,14 +890,14 @@
  97.235  apply (rule conjI)
  97.236  apply (rule transE)
  97.237  apply (rule lubY_le_flubY)
  97.238 --- {* @{text "(f (lub Y cl), f x) \<in> r"} *}
  97.239 +\<comment> \<open>\<open>(f (lub Y cl), f x) \<in> r\<close>\<close>
  97.240  (*sledgehammer [has been proved before now...]*)
  97.241  apply (rule_tac f=f in monotoneE)
  97.242  apply (rule monotone_f)
  97.243  apply (rule lubY_in_A)
  97.244  apply (simp add: intY1_def interval_def  intY1_elem)
  97.245  apply (simp add: intY1_def  interval_def)
  97.246 --- {* @{text "(f x, Top cl) \<in> r"} *}
  97.247 +\<comment> \<open>\<open>(f x, Top cl) \<in> r\<close>\<close>
  97.248  apply (rule Top_prop)
  97.249  apply (rule f_in_funcset [THEN funcset_mem])
  97.250  apply (simp add: intY1_def interval_def  intY1_elem)
  97.251 @@ -966,12 +966,12 @@
  97.252       "\<exists>L. isLub Y (| pset = P, order = induced P r |) L"
  97.253  apply (rule_tac x = "v" in exI)
  97.254  apply (simp add: isLub_def)
  97.255 --- {* @{text "v \<in> P"} *}
  97.256 +\<comment> \<open>\<open>v \<in> P\<close>\<close>
  97.257  apply (simp add: v_in_P)
  97.258  apply (rule conjI)
  97.259  (*sledgehammer*)
  97.260 --- {* @{text v} is lub *}
  97.261 --- {* @{text "1. \<forall>y:Y. (y, v) \<in> induced P r"} *}
  97.262 +\<comment> \<open>\<open>v\<close> is lub\<close>
  97.263 +\<comment> \<open>\<open>1. \<forall>y:Y. (y, v) \<in> induced P r\<close>\<close>
  97.264  apply (rule ballI)
  97.265  apply (simp add: induced_def subsetD v_in_P)
  97.266  apply (rule conjI)
  97.267 @@ -984,7 +984,7 @@
  97.268  apply (fold intY1_def)
  97.269  apply (rule CL.glb_in_lattice [OF CL.intro, OF PO.intro CL_axioms.intro, OF _ intY1_is_cl, simplified])
  97.270   apply (simp add: CL_imp_PO intY1_is_cl, force)
  97.271 --- {* @{text v} is LEAST ub *}
  97.272 +\<comment> \<open>\<open>v\<close> is LEAST ub\<close>
  97.273  apply clarify
  97.274  apply (rule indI)
  97.275    prefer 3 apply assumption
    98.1 --- a/src/HOL/Metis_Examples/Trans_Closure.thy	Thu May 26 16:57:14 2016 +0200
    98.2 +++ b/src/HOL/Metis_Examples/Trans_Closure.thy	Thu May 26 17:51:22 2016 +0200
    98.3 @@ -5,7 +5,7 @@
    98.4  Metis example featuring the transitive closure.
    98.5  *)
    98.6  
    98.7 -section {* Metis Example Featuring the Transitive Closure *}
    98.8 +section \<open>Metis Example Featuring the Transitive Closure\<close>
    98.9  
   98.10  theory Trans_Closure
   98.11  imports Main
   98.12 @@ -16,11 +16,11 @@
   98.13  type_synonym addr = nat
   98.14  
   98.15  datatype val
   98.16 -  = Unit        -- "dummy result value of void expressions"
   98.17 -  | Null        -- "null reference"
   98.18 -  | Bool bool   -- "Boolean value"
   98.19 -  | Intg int    -- "integer value"
   98.20 -  | Addr addr   -- "addresses of objects in the heap"
   98.21 +  = Unit        \<comment> "dummy result value of void expressions"
   98.22 +  | Null        \<comment> "null reference"
   98.23 +  | Bool bool   \<comment> "Boolean value"
   98.24 +  | Intg int    \<comment> "integer value"
   98.25 +  | Addr addr   \<comment> "addresses of objects in the heap"
   98.26  
   98.27  consts R :: "(addr \<times> addr) set"
   98.28  
    99.1 --- a/src/HOL/Metis_Examples/Type_Encodings.thy	Thu May 26 16:57:14 2016 +0200
    99.2 +++ b/src/HOL/Metis_Examples/Type_Encodings.thy	Thu May 26 17:51:22 2016 +0200
    99.3 @@ -4,9 +4,9 @@
    99.4  Example that exercises Metis's (and hence Sledgehammer's) type encodings.
    99.5  *)
    99.6  
    99.7 -section {*
    99.8 +section \<open>
    99.9  Example that Exercises Metis's (and Hence Sledgehammer's) Type Encodings
   99.10 -*}
   99.11 +\<close>
   99.12  
   99.13  theory Type_Encodings
   99.14  imports Main
   99.15 @@ -14,11 +14,11 @@
   99.16  
   99.17  declare [[metis_new_skolem]]
   99.18  
   99.19 -text {* Setup for testing Metis exhaustively *}
   99.20 +text \<open>Setup for testing Metis exhaustively\<close>
   99.21  
   99.22  lemma fork: "P \<Longrightarrow> P \<Longrightarrow> P" by assumption
   99.23  
   99.24 -ML {*
   99.25 +ML \<open>
   99.26  val type_encs =
   99.27    ["erased",
   99.28     "poly_guards",
   99.29 @@ -60,14 +60,14 @@
   99.30                 THEN COND (has_fewer_prems 2) all_tac no_tac
   99.31                 THEN tac type_encs)
   99.32    in tac type_encs end
   99.33 -*}
   99.34 +\<close>
   99.35  
   99.36 -method_setup metis_exhaust = {*
   99.37 +method_setup metis_exhaust = \<open>
   99.38    Attrib.thms >>
   99.39      (fn ths => fn ctxt => SIMPLE_METHOD (metis_exhaust_tac ctxt ths))
   99.40 -*} "exhaustively run Metis with all type encodings"
   99.41 +\<close> "exhaustively run Metis with all type encodings"
   99.42  
   99.43 -text {* Miscellaneous tests *}
   99.44 +text \<open>Miscellaneous tests\<close>
   99.45  
   99.46  lemma "x = y \<Longrightarrow> y = x"
   99.47  by metis_exhaust
   100.1 --- a/src/HOL/Mirabelle/Mirabelle.thy	Thu May 26 16:57:14 2016 +0200
   100.2 +++ b/src/HOL/Mirabelle/Mirabelle.thy	Thu May 26 17:51:22 2016 +0200
   100.3 @@ -9,13 +9,13 @@
   100.4  ML_file "Tools/mirabelle.ML"
   100.5  ML_file "../TPTP/sledgehammer_tactics.ML"
   100.6  
   100.7 -ML {* Toplevel.add_hook Mirabelle.step_hook *}
   100.8 +ML \<open>Toplevel.add_hook Mirabelle.step_hook\<close>
   100.9  
  100.10 -ML {*
  100.11 +ML \<open>
  100.12  signature MIRABELLE_ACTION =
  100.13  sig
  100.14    val invoke : (string * string) list -> theory -> theory
  100.15  end
  100.16 -*}
  100.17 +\<close>
  100.18  
  100.19  end
   101.1 --- a/src/HOL/Mirabelle/Mirabelle_Test.thy	Thu May 26 16:57:14 2016 +0200
   101.2 +++ b/src/HOL/Mirabelle/Mirabelle_Test.thy	Thu May 26 17:51:22 2016 +0200
   101.3 @@ -2,7 +2,7 @@
   101.4      Author:     Sascha Boehme, TU Munich
   101.5  *)
   101.6  
   101.7 -section {* Simple test theory for Mirabelle actions *}
   101.8 +section \<open>Simple test theory for Mirabelle actions\<close>
   101.9  
  101.10  theory Mirabelle_Test
  101.11  imports Main Mirabelle
  101.12 @@ -16,9 +16,9 @@
  101.13  ML_file "Tools/mirabelle_sledgehammer_filter.ML"
  101.14  ML_file "Tools/mirabelle_try0.ML"
  101.15  
  101.16 -text {*
  101.17 +text \<open>
  101.18    Only perform type-checking of the actions,
  101.19    any reasonable test would be too complicated.
  101.20 -*}
  101.21 +\<close>
  101.22  
  101.23  end
   102.1 --- a/src/HOL/Mirabelle/ex/Ex.thy	Thu May 26 16:57:14 2016 +0200
   102.2 +++ b/src/HOL/Mirabelle/ex/Ex.thy	Thu May 26 17:51:22 2016 +0200
   102.3 @@ -1,12 +1,12 @@
   102.4  theory Ex imports Pure
   102.5  begin
   102.6  
   102.7 -ML {*
   102.8 +ML \<open>
   102.9    val rc = Isabelle_System.bash
  102.10      "cd \"$ISABELLE_HOME/src/HOL/Library\"; isabelle mirabelle arith Inner_Product.thy";
  102.11    if rc <> 0 then error ("Mirabelle example failed: " ^ string_of_int rc)
  102.12    else ();
  102.13 -*} -- "some arbitrary small test case"
  102.14 +\<close> \<comment> "some arbitrary small test case"
  102.15  
  102.16  end
  102.17  
   103.1 --- a/src/HOL/Mutabelle/MutabelleExtra.thy	Thu May 26 16:57:14 2016 +0200
   103.2 +++ b/src/HOL/Mutabelle/MutabelleExtra.thy	Thu May 26 17:51:22 2016 +0200
   103.3 @@ -15,9 +15,9 @@
   103.4  ML_file "mutabelle_extra.ML"
   103.5  
   103.6  
   103.7 -section {* configuration *}
   103.8 +section \<open>configuration\<close>
   103.9  
  103.10 -ML {* val log_directory = "" *}
  103.11 +ML \<open>val log_directory = ""\<close>
  103.12  
  103.13  
  103.14  quickcheck_params [quiet, finite_types = false, report = false, size = 5, iterations = 1000]
  103.15 @@ -27,25 +27,25 @@
  103.16  refute_params [maxtime = 10, minsize = 1, maxsize = 5, satsolver = jerusat]
  103.17  *)
  103.18  
  103.19 -ML {* val mtds = [
  103.20 +ML \<open>val mtds = [
  103.21    MutabelleExtra.quickcheck_mtd (Config.put Quickcheck.finite_types false) "random",
  103.22    MutabelleExtra.quickcheck_mtd (Config.put Quickcheck.finite_types true) "random",
  103.23    MutabelleExtra.quickcheck_mtd (Config.put Quickcheck.finite_types false) "small",
  103.24    MutabelleExtra.quickcheck_mtd (Config.put Quickcheck.finite_types true) "small"
  103.25  ]
  103.26 -*}
  103.27 +\<close>
  103.28  
  103.29 -ML {*
  103.30 +ML \<open>
  103.31  fun mutation_testing_of (name, thy) =
  103.32    (MutabelleExtra.init_random 1.0;
  103.33    MutabelleExtra.thms_of false thy
  103.34    |> MutabelleExtra.take_random 200
  103.35    |> (fn thms => MutabelleExtra.mutate_theorems_and_write_report
  103.36           @{theory} (1, 50) mtds thms (log_directory ^ "/" ^ name)))
  103.37 -*}
  103.38 +\<close>
  103.39    
  103.40  
  103.41 -text {* Uncomment the following ML code to check the counterexample generation with all theorems of Complex_Main. *}
  103.42 +text \<open>Uncomment the following ML code to check the counterexample generation with all theorems of Complex_Main.\<close>
  103.43  
  103.44  (*
  103.45  ML {*
  103.46 @@ -64,9 +64,9 @@
  103.47   *}
  103.48  *)
  103.49  
  103.50 -section {* Mutation testing Isabelle theories *}
  103.51 +section \<open>Mutation testing Isabelle theories\<close>
  103.52  
  103.53 -subsection {* List theory *}
  103.54 +subsection \<open>List theory\<close>
  103.55  
  103.56  (*
  103.57  ML {*
  103.58 @@ -74,9 +74,9 @@
  103.59   *}
  103.60  *)
  103.61  
  103.62 -section {* Mutation testing AFP theories *}
  103.63 +section \<open>Mutation testing AFP theories\<close>
  103.64  
  103.65 -subsection {* AVL-Trees *}
  103.66 +subsection \<open>AVL-Trees\<close>
  103.67  
  103.68  (*
  103.69  ML {*
  103.70 @@ -84,7 +84,7 @@
  103.71   *}
  103.72  *)
  103.73  
  103.74 -subsection {* BinaryTree *}
  103.75 +subsection \<open>BinaryTree\<close>
  103.76  
  103.77  (*
  103.78  ML {*
  103.79 @@ -92,7 +92,7 @@
  103.80   *}
  103.81  *)
  103.82  
  103.83 -subsection {* Huffman *}
  103.84 +subsection \<open>Huffman\<close>
  103.85  
  103.86  (*
  103.87  ML {*
  103.88 @@ -100,7 +100,7 @@
  103.89   *}
  103.90  *)
  103.91  
  103.92 -subsection {* List_Index *}
  103.93 +subsection \<open>List_Index\<close>
  103.94  
  103.95  (*
  103.96  ML {*
  103.97 @@ -108,7 +108,7 @@
  103.98   *}
  103.99  *)
 103.100  
 103.101 -subsection {* Matrix *}
 103.102 +subsection \<open>Matrix\<close>
 103.103  
 103.104  (*
 103.105  ML {*
 103.106 @@ -116,7 +116,7 @@
 103.107   *}
 103.108  *)
 103.109  
 103.110 -subsection {* NBE *}
 103.111 +subsection \<open>NBE\<close>
 103.112  
 103.113  (*
 103.114  ML {*
 103.115 @@ -124,7 +124,7 @@
 103.116   *}
 103.117  *)
 103.118  
 103.119 -subsection {* Polynomial *}
 103.120 +subsection \<open>Polynomial\<close>
 103.121  
 103.122  (*
 103.123  ML {*
 103.124 @@ -132,7 +132,7 @@
 103.125   *}
 103.126  *)
 103.127  
 103.128 -subsection {* Presburger Automata *}
 103.129 +subsection \<open>Presburger Automata\<close>
 103.130  
 103.131  (*
 103.132  ML {*
   104.1 --- a/src/HOL/NanoJava/AxSem.thy	Thu May 26 16:57:14 2016 +0200
   104.2 +++ b/src/HOL/NanoJava/AxSem.thy	Thu May 26 17:51:22 2016 +0200
   104.3 @@ -72,13 +72,13 @@
   104.4                    Impl (D,m) {Q} ==>
   104.5               A \<turnstile> {P} Meth (C,m) {Q}"
   104.6  
   104.7 -  --{* @{text "\<Union>Z"} instead of @{text "\<forall>Z"} in the conclusion and\\
   104.8 -       Z restricted to type state due to limitations of the inductive package *}
   104.9 +  \<comment>\<open>\<open>\<Union>Z\<close> instead of \<open>\<forall>Z\<close> in the conclusion and\\
  104.10 +       Z restricted to type state due to limitations of the inductive package\<close>
  104.11  | Impl: "\<forall>Z::state. A\<union> (\<Union>Z. (\<lambda>Cm. (P Z Cm, Impl Cm, Q Z Cm))`Ms) |\<turnstile> 
  104.12                              (\<lambda>Cm. (P Z Cm, body Cm, Q Z Cm))`Ms ==>
  104.13                        A |\<turnstile> (\<lambda>Cm. (P Z Cm, Impl Cm, Q Z Cm))`Ms"
  104.14  
  104.15 ---{* structural rules *}
  104.16 +\<comment>\<open>structural rules\<close>
  104.17  
  104.18  | Asm:  "   a \<in> A ==> A |\<turnstile> {a}"
  104.19  
  104.20 @@ -86,12 +86,12 @@
  104.21  
  104.22  | ConjE: "[|A |\<turnstile> C; c \<in> C |] ==> A |\<turnstile> {c}"
  104.23  
  104.24 -  --{* Z restricted to type state due to limitations of the inductive package *}
  104.25 +  \<comment>\<open>Z restricted to type state due to limitations of the inductive package\<close>
  104.26  | Conseq:"[| \<forall>Z::state. A \<turnstile> {P' Z} c {Q' Z};
  104.27               \<forall>s t. (\<forall>Z. P' Z s --> Q' Z t) --> (P s --> Q t) |] ==>
  104.28              A \<turnstile> {P} c {Q }"
  104.29  
  104.30 -  --{* Z restricted to type state due to limitations of the inductive package *}
  104.31 +  \<comment>\<open>Z restricted to type state due to limitations of the inductive package\<close>
  104.32  | eConseq:"[| \<forall>Z::state. A \<turnstile>\<^sub>e {P' Z} e {Q' Z};
  104.33               \<forall>s v t. (\<forall>Z. P' Z s --> Q' Z v t) --> (P s --> Q v t) |] ==>
  104.34              A \<turnstile>\<^sub>e {P} e {Q }"
   105.1 --- a/src/HOL/NanoJava/Decl.thy	Thu May 26 16:57:14 2016 +0200
   105.2 +++ b/src/HOL/NanoJava/Decl.thy	Thu May 26 17:51:22 2016 +0200
   105.3 @@ -8,10 +8,10 @@
   105.4  theory Decl imports Term begin
   105.5  
   105.6  datatype ty
   105.7 -  = NT           --{* null type  *}
   105.8 -  | Class cname  --{* class type *}
   105.9 +  = NT           \<comment>\<open>null type\<close>
  105.10 +  | Class cname  \<comment>\<open>class type\<close>
  105.11  
  105.12 -text{* Field declaration *}
  105.13 +text\<open>Field declaration\<close>
  105.14  type_synonym fdecl           
  105.15          = "fname \<times> ty"
  105.16  
  105.17 @@ -21,7 +21,7 @@
  105.18            lcl ::"(vname \<times> ty) list"
  105.19            bdy :: stmt
  105.20  
  105.21 -text{* Method declaration *}
  105.22 +text\<open>Method declaration\<close>
  105.23  type_synonym mdecl
  105.24          = "mname \<times> methd"
  105.25  
  105.26 @@ -30,7 +30,7 @@
  105.27            flds    ::"fdecl list"
  105.28            methods ::"mdecl list"
  105.29  
  105.30 -text{* Class declaration *}
  105.31 +text\<open>Class declaration\<close>
  105.32  type_synonym cdecl
  105.33          = "cname \<times> class"
  105.34  
  105.35 @@ -45,9 +45,9 @@
  105.36    (type) "prog " \<leftharpoondown> (type) "cdecl list"
  105.37  
  105.38  axiomatization
  105.39 -  Prog    :: prog       --{* program as a global value *}
  105.40 +  Prog    :: prog       \<comment>\<open>program as a global value\<close>
  105.41  and
  105.42 -  Object  :: cname      --{* name of root class *}
  105.43 +  Object  :: cname      \<comment>\<open>name of root class\<close>
  105.44  
  105.45  
  105.46  definition "class" :: "cname \<rightharpoonup> class" where
   106.1 --- a/src/HOL/NanoJava/Equivalence.thy	Thu May 26 16:57:14 2016 +0200
   106.2 +++ b/src/HOL/NanoJava/Equivalence.thy	Thu May 26 17:51:22 2016 +0200
   106.3 @@ -94,9 +94,9 @@
   106.4  apply (tactic "split_all_tac @{context} 1", rename_tac P e Q)
   106.5  apply (rule hoare_ehoare.induct)
   106.6  (*18*)
   106.7 -apply (tactic {* ALLGOALS (REPEAT o dresolve_tac @{context} [@{thm all_conjunct2}, @{thm all3_conjunct2}]) *})
   106.8 -apply (tactic {* ALLGOALS (REPEAT o Rule_Insts.thin_tac @{context} "hoare _ _" []) *})
   106.9 -apply (tactic {* ALLGOALS (REPEAT o Rule_Insts.thin_tac @{context} "ehoare _ _" []) *})
  106.10 +apply (tactic \<open>ALLGOALS (REPEAT o dresolve_tac @{context} [@{thm all_conjunct2}, @{thm all3_conjunct2}])\<close>)
  106.11 +apply (tactic \<open>ALLGOALS (REPEAT o Rule_Insts.thin_tac @{context} "hoare _ _" [])\<close>)
  106.12 +apply (tactic \<open>ALLGOALS (REPEAT o Rule_Insts.thin_tac @{context} "ehoare _ _" [])\<close>)
  106.13  apply (simp_all only: cnvalid1_eq cenvalid_def2)
  106.14                   apply fast
  106.15                  apply fast
   107.1 --- a/src/HOL/NanoJava/Example.thy	Thu May 26 16:57:14 2016 +0200
   107.2 +++ b/src/HOL/NanoJava/Example.thy	Thu May 26 17:51:22 2016 +0200
   107.3 @@ -9,7 +9,7 @@
   107.4  imports Equivalence
   107.5  begin
   107.6  
   107.7 -text {*
   107.8 +text \<open>
   107.9  
  107.10  \begin{verbatim}
  107.11  class Nat {
  107.12 @@ -39,7 +39,7 @@
  107.13  }
  107.14  \end{verbatim}
  107.15  
  107.16 -*}
  107.17 +\<close>
  107.18  
  107.19  axiomatization where
  107.20    This_neq_Par [simp]: "This \<noteq> Par" and
  107.21 @@ -62,8 +62,8 @@
  107.22    one :: expr
  107.23    where "one == {Nat}new Nat..suc(<>)"
  107.24  
  107.25 -text {* The following properties could be derived from a more complete
  107.26 -        program model, which we leave out for laziness. *}
  107.27 +text \<open>The following properties could be derived from a more complete
  107.28 +        program model, which we leave out for laziness.\<close>
  107.29  
  107.30  axiomatization where Nat_no_subclasses [simp]: "D \<preceq>C Nat = (D=Nat)"
  107.31  
   108.1 --- a/src/HOL/NanoJava/State.thy	Thu May 26 16:57:14 2016 +0200
   108.2 +++ b/src/HOL/NanoJava/State.thy	Thu May 26 17:51:22 2016 +0200
   108.3 @@ -10,12 +10,12 @@
   108.4  definition body :: "cname \<times> mname => stmt" where
   108.5   "body \<equiv> \<lambda>(C,m). bdy (the (method C m))"
   108.6  
   108.7 -text {* Locations, i.e.\ abstract references to objects *}
   108.8 +text \<open>Locations, i.e.\ abstract references to objects\<close>
   108.9  typedecl loc 
  108.10  
  108.11  datatype val
  108.12 -  = Null        --{* null reference *}
  108.13 -  | Addr loc    --{* address, i.e. location of object *}
  108.14 +  = Null        \<comment>\<open>null reference\<close>
  108.15 +  | Addr loc    \<comment>\<open>address, i.e. location of object\<close>
  108.16  
  108.17  type_synonym fields
  108.18          = "(fname \<rightharpoonup> val)"
  108.19 @@ -30,11 +30,11 @@
  108.20  definition init_vars :: "('a \<rightharpoonup> 'b) => ('a \<rightharpoonup> val)" where
  108.21   "init_vars m == map_option (\<lambda>T. Null) o m"
  108.22    
  108.23 -text {* private: *}
  108.24 +text \<open>private:\<close>
  108.25  type_synonym heap = "loc   \<rightharpoonup> obj"
  108.26  type_synonym locals = "vname \<rightharpoonup> val"  
  108.27  
  108.28 -text {* private: *}
  108.29 +text \<open>private:\<close>
  108.30  record  state
  108.31          = heap   :: heap
  108.32            locals :: locals
  108.33 @@ -51,15 +51,15 @@
  108.34   "init_locs C m s \<equiv> s (| locals := locals s ++ 
  108.35                           init_vars (map_of (lcl (the (method C m)))) |)"
  108.36  
  108.37 -text {* The first parameter of @{term set_locs} is of type @{typ state} 
  108.38 -        rather than @{typ locals} in order to keep @{typ locals} private.*}
  108.39 +text \<open>The first parameter of @{term set_locs} is of type @{typ state} 
  108.40 +        rather than @{typ locals} in order to keep @{typ locals} private.\<close>
  108.41  definition set_locs :: "state => state => state" where
  108.42   "set_locs s s' \<equiv> s' (| locals := locals s |)"
  108.43  
  108.44  definition get_local     :: "state => vname => val" ("_<_>" [99,0] 99) where
  108.45   "get_local s x  \<equiv> the (locals s x)"
  108.46  
  108.47 ---{* local function: *}
  108.48 +\<comment>\<open>local function:\<close>
  108.49  definition get_obj       :: "state => loc => obj" where
  108.50   "get_obj s a \<equiv> the (heap s a)"
  108.51  
  108.52 @@ -69,7 +69,7 @@
  108.53  definition get_field     :: "state => loc => fname => val" where
  108.54   "get_field s a f \<equiv> the (snd (get_obj s a) f)"
  108.55  
  108.56 ---{* local function: *}
  108.57 +\<comment>\<open>local function:\<close>
  108.58  definition hupd       :: "loc => obj => state => state"   ("hupd'(_\<mapsto>_')" [10,10] 1000) where
  108.59   "hupd a obj s \<equiv> s (| heap   := ((heap   s)(a\<mapsto>obj))|)"
  108.60  
   109.1 --- a/src/HOL/NanoJava/Term.thy	Thu May 26 16:57:14 2016 +0200
   109.2 +++ b/src/HOL/NanoJava/Term.thy	Thu May 26 17:51:22 2016 +0200
   109.3 @@ -6,16 +6,16 @@
   109.4  
   109.5  theory Term imports Main begin
   109.6  
   109.7 -typedecl cname  --{* class    name *}
   109.8 -typedecl mname  --{* method   name *}
   109.9 -typedecl fname  --{* field    name *}
  109.10 -typedecl vname  --{* variable name *}
  109.11 +typedecl cname  \<comment>\<open>class    name\<close>
  109.12 +typedecl mname  \<comment>\<open>method   name\<close>
  109.13 +typedecl fname  \<comment>\<open>field    name\<close>
  109.14 +typedecl vname  \<comment>\<open>variable name\<close>
  109.15  
  109.16  axiomatization
  109.17 -  This --{* This pointer *}
  109.18 -  Par  --{* method parameter *}
  109.19 -  Res  :: vname --{* method result *}
  109.20 - -- {* Inequality axioms are not required for the meta theory. *}
  109.21 +  This \<comment>\<open>This pointer\<close>
  109.22 +  Par  \<comment>\<open>method parameter\<close>
  109.23 +  Res  :: vname \<comment>\<open>method result\<close>
  109.24 + \<comment> \<open>Inequality axioms are not required for the meta theory.\<close>
  109.25  (*
  109.26  where
  109.27    This_neq_Par [simp]: "This \<noteq> Par"
  109.28 @@ -24,21 +24,21 @@
  109.29  *)
  109.30  
  109.31  datatype stmt
  109.32 -  = Skip                   --{* empty statement *}
  109.33 +  = Skip                   \<comment>\<open>empty statement\<close>
  109.34    | Comp       stmt stmt   ("_;; _"             [91,90   ] 90)
  109.35    | Cond expr  stmt stmt   ("If '(_') _ Else _" [ 3,91,91] 91)
  109.36    | Loop vname stmt        ("While '(_') _"     [ 3,91   ] 91)
  109.37 -  | LAss vname expr        ("_ :== _"           [99,   95] 94) --{* local assignment *}
  109.38 -  | FAss expr  fname expr  ("_.._:==_"          [95,99,95] 94) --{* field assignment *}
  109.39 -  | Meth "cname \<times> mname"   --{* virtual method *}
  109.40 -  | Impl "cname \<times> mname"   --{* method implementation *}
  109.41 +  | LAss vname expr        ("_ :== _"           [99,   95] 94) \<comment>\<open>local assignment\<close>
  109.42 +  | FAss expr  fname expr  ("_.._:==_"          [95,99,95] 94) \<comment>\<open>field assignment\<close>
  109.43 +  | Meth "cname \<times> mname"   \<comment>\<open>virtual method\<close>
  109.44 +  | Impl "cname \<times> mname"   \<comment>\<open>method implementation\<close>
  109.45  and expr
  109.46 -  = NewC cname       ("new _"        [   99] 95) --{* object creation  *}
  109.47 -  | Cast cname expr                              --{* type cast        *}
  109.48 -  | LAcc vname                                   --{* local access     *}
  109.49 -  | FAcc expr  fname ("_.._"         [95,99] 95) --{* field access     *}
  109.50 +  = NewC cname       ("new _"        [   99] 95) \<comment>\<open>object creation\<close>
  109.51 +  | Cast cname expr                              \<comment>\<open>type cast\<close>
  109.52 +  | LAcc vname                                   \<comment>\<open>local access\<close>
  109.53 +  | FAcc expr  fname ("_.._"         [95,99] 95) \<comment>\<open>field access\<close>
  109.54    | Call cname expr mname expr                   
  109.55 -                     ("{_}_.._'(_')" [99,95,99,95] 95) --{* method call *}
  109.56 +                     ("{_}_.._'(_')" [99,95,99,95] 95) \<comment>\<open>method call\<close>
  109.57  
  109.58  end
  109.59  
   110.1 --- a/src/HOL/NanoJava/TypeRel.thy	Thu May 26 16:57:14 2016 +0200
   110.2 +++ b/src/HOL/NanoJava/TypeRel.thy	Thu May 26 17:51:22 2016 +0200
   110.3 @@ -8,7 +8,7 @@
   110.4  imports Decl
   110.5  begin
   110.6  
   110.7 -text{* Direct subclass relation *}
   110.8 +text\<open>Direct subclass relation\<close>
   110.9  
  110.10  definition subcls1 :: "(cname \<times> cname) set"
  110.11  where
  110.12 @@ -24,7 +24,7 @@
  110.13  
  110.14  subsection "Declarations and properties not used in the meta theory"
  110.15  
  110.16 -text{* Widening, viz. method invocation conversion *}
  110.17 +text\<open>Widening, viz. method invocation conversion\<close>
  110.18  inductive
  110.19    widen :: "ty => ty => bool"  ("_ \<preceq> _" [71,71] 70)
  110.20  where
  110.21 @@ -103,7 +103,7 @@
  110.22  apply (subst cut_apply, auto intro: subcls1I)
  110.23  done
  110.24  
  110.25 ---{* Methods of a class, with inheritance and hiding *}
  110.26 +\<comment>\<open>Methods of a class, with inheritance and hiding\<close>
  110.27  definition "method" :: "cname => (mname \<rightharpoonup> methd)" where
  110.28    "method C \<equiv> class_rec C methods"
  110.29  
  110.30 @@ -115,7 +115,7 @@
  110.31  done
  110.32  
  110.33  
  110.34 ---{* Fields of a class, with inheritance and hiding *}
  110.35 +\<comment>\<open>Fields of a class, with inheritance and hiding\<close>
  110.36  definition field  :: "cname => (fname \<rightharpoonup> ty)" where
  110.37    "field C \<equiv> class_rec C flds"
  110.38  
   111.1 --- a/src/HOL/Nitpick_Examples/Core_Nits.thy	Thu May 26 16:57:14 2016 +0200
   111.2 +++ b/src/HOL/Nitpick_Examples/Core_Nits.thy	Thu May 26 17:51:22 2016 +0200
   111.3 @@ -5,7 +5,7 @@
   111.4  Examples featuring Nitpick's functional core.
   111.5  *)
   111.6  
   111.7 -section {* Examples Featuring Nitpick's Functional Core *}
   111.8 +section \<open>Examples Featuring Nitpick's Functional Core\<close>
   111.9  
  111.10  theory Core_Nits
  111.11  imports Main
  111.12 @@ -14,7 +14,7 @@
  111.13  nitpick_params [verbose, card = 1-6, unary_ints, max_potential = 0,
  111.14                  sat_solver = MiniSat_JNI, max_threads = 1, timeout = 240]
  111.15  
  111.16 -subsection {* Curry in a Hurry *}
  111.17 +subsection \<open>Curry in a Hurry\<close>
  111.18  
  111.19  lemma "(\<lambda>f x y. (curry o case_prod) f x y) = (\<lambda>f x y. (\<lambda>x. x) f x y)"
  111.20  nitpick [card = 1-12, expect = none]
  111.21 @@ -36,7 +36,7 @@
  111.22  nitpick [card = 1-12, expect = none]
  111.23  by auto
  111.24  
  111.25 -subsection {* Representations *}
  111.26 +subsection \<open>Representations\<close>
  111.27  
  111.28  lemma "\<exists>f. f = (\<lambda>x. x) \<and> f y = y"
  111.29  nitpick [expect = none]
  111.30 @@ -156,7 +156,7 @@
  111.31  nitpick [card = 8, expect = genuine]
  111.32  oops
  111.33  
  111.34 -subsection {* Quantifiers *}
  111.35 +subsection \<open>Quantifiers\<close>
  111.36  
  111.37  lemma "x = y"
  111.38  nitpick [card 'a = 1, expect = none]
  111.39 @@ -264,7 +264,7 @@
  111.40  nitpick [expect = none]
  111.41  by auto
  111.42  
  111.43 -subsection {* Schematic Variables *}
  111.44 +subsection \<open>Schematic Variables\<close>
  111.45  
  111.46  schematic_goal "x = ?x"
  111.47  nitpick [expect = none]
  111.48 @@ -290,7 +290,7 @@
  111.49  nitpick [expect = none]
  111.50  by auto
  111.51  
  111.52 -subsection {* Known Constants *}
  111.53 +subsection \<open>Known Constants\<close>
  111.54  
  111.55  lemma "x \<equiv> Pure.all \<Longrightarrow> False"
  111.56  nitpick [card = 1, expect = genuine]
  111.57 @@ -678,7 +678,7 @@
  111.58  nitpick [expect = none]
  111.59  oops
  111.60  
  111.61 -subsection {* The and Eps *}
  111.62 +subsection \<open>The and Eps\<close>
  111.63  
  111.64  lemma "x = The"
  111.65  nitpick [card = 5, expect = genuine]
  111.66 @@ -919,7 +919,7 @@
  111.67  
  111.68  nitpick_params [max_potential = 0]
  111.69  
  111.70 -subsection {* Destructors and Recursors *}
  111.71 +subsection \<open>Destructors and Recursors\<close>
  111.72  
  111.73  lemma "(x::'a) = (case True of True \<Rightarrow> x | False \<Rightarrow> x)"
  111.74  nitpick [card = 2, expect = none]
   112.1 --- a/src/HOL/Nitpick_Examples/Datatype_Nits.thy	Thu May 26 16:57:14 2016 +0200
   112.2 +++ b/src/HOL/Nitpick_Examples/Datatype_Nits.thy	Thu May 26 17:51:22 2016 +0200
   112.3 @@ -5,7 +5,7 @@
   112.4  Examples featuring Nitpick applied to datatypes.
   112.5  *)
   112.6  
   112.7 -section {* Examples Featuring Nitpick Applied to Datatypes *}
   112.8 +section \<open>Examples Featuring Nitpick Applied to Datatypes\<close>
   112.9  
  112.10  theory Datatype_Nits
  112.11  imports Main
   113.1 --- a/src/HOL/Nitpick_Examples/Hotel_Nits.thy	Thu May 26 16:57:14 2016 +0200
   113.2 +++ b/src/HOL/Nitpick_Examples/Hotel_Nits.thy	Thu May 26 17:51:22 2016 +0200
   113.3 @@ -5,8 +5,8 @@
   113.4  Nitpick example based on Tobias Nipkow's hotel key card formalization.
   113.5  *)
   113.6  
   113.7 -section {* Nitpick Example Based on Tobias Nipkow's Hotel Key Card
   113.8 -          Formalization *}
   113.9 +section \<open>Nitpick Example Based on Tobias Nipkow's Hotel Key Card
  113.10 +          Formalization\<close>
  113.11  
  113.12  theory Hotel_Nits
  113.13  imports Main
   114.1 --- a/src/HOL/Nitpick_Examples/Induct_Nits.thy	Thu May 26 16:57:14 2016 +0200
   114.2 +++ b/src/HOL/Nitpick_Examples/Induct_Nits.thy	Thu May 26 17:51:22 2016 +0200
   114.3 @@ -5,7 +5,7 @@
   114.4  Examples featuring Nitpick applied to (co)inductive definitions.
   114.5  *)
   114.6  
   114.7 -section {* Examples Featuring Nitpick Applied to (Co)inductive Definitions *}
   114.8 +section \<open>Examples Featuring Nitpick Applied to (Co)inductive Definitions\<close>
   114.9  
  114.10  theory Induct_Nits
  114.11  imports Main
   115.1 --- a/src/HOL/Nitpick_Examples/Integer_Nits.thy	Thu May 26 16:57:14 2016 +0200
   115.2 +++ b/src/HOL/Nitpick_Examples/Integer_Nits.thy	Thu May 26 17:51:22 2016 +0200
   115.3 @@ -5,7 +5,7 @@
   115.4  Examples featuring Nitpick applied to natural numbers and integers.
   115.5  *)
   115.6  
   115.7 -section {* Examples Featuring Nitpick Applied to Natural Numbers and Integers *}
   115.8 +section \<open>Examples Featuring Nitpick Applied to Natural Numbers and Integers\<close>
   115.9  
  115.10  theory Integer_Nits
  115.11  imports Main
   116.1 --- a/src/HOL/Nitpick_Examples/Manual_Nits.thy	Thu May 26 16:57:14 2016 +0200
   116.2 +++ b/src/HOL/Nitpick_Examples/Manual_Nits.thy	Thu May 26 17:51:22 2016 +0200
   116.3 @@ -5,7 +5,7 @@
   116.4  Examples from the Nitpick manual.
   116.5  *)
   116.6  
   116.7 -section {* Examples from the Nitpick Manual *}
   116.8 +section \<open>Examples from the Nitpick Manual\<close>
   116.9  
  116.10  (* The "expect" arguments to Nitpick in this theory and the other example
  116.11     theories are there so that the example can also serve as a regression test
  116.12 @@ -15,12 +15,12 @@
  116.13  imports Real "~~/src/HOL/Library/Quotient_Product"
  116.14  begin
  116.15  
  116.16 -section {* 2. First Steps *}
  116.17 +section \<open>2. First Steps\<close>
  116.18  
  116.19  nitpick_params [sat_solver = MiniSat_JNI, max_threads = 1, timeout = 240]
  116.20  
  116.21  
  116.22 -subsection {* 2.1. Propositional Logic *}
  116.23 +subsection \<open>2.1. Propositional Logic\<close>
  116.24  
  116.25  lemma "P \<longleftrightarrow> Q"
  116.26  nitpick [expect = genuine]
  116.27 @@ -30,14 +30,14 @@
  116.28  oops
  116.29  
  116.30  
  116.31 -subsection {* 2.2. Type Variables *}
  116.32 +subsection \<open>2.2. Type Variables\<close>
  116.33  
  116.34  lemma "x \<in> A \<Longrightarrow> (THE y. y \<in> A) \<in> A"
  116.35  nitpick [verbose, expect = genuine]
  116.36  oops
  116.37  
  116.38  
  116.39 -subsection {* 2.3. Constants *}
  116.40 +subsection \<open>2.3. Constants\<close>
  116.41  
  116.42  lemma "x \<in> A \<Longrightarrow> (THE y. y \<in> A) \<in> A"
  116.43  nitpick [show_consts, expect = genuine]
  116.44 @@ -51,7 +51,7 @@
  116.45  by (metis the_equality)
  116.46  
  116.47  
  116.48 -subsection {* 2.4. Skolemization *}
  116.49 +subsection \<open>2.4. Skolemization\<close>
  116.50  
  116.51  lemma "\<exists>g. \<forall>x. g (f x) = x \<Longrightarrow> \<forall>y. \<exists>x. y = f x"
  116.52  nitpick [expect = genuine]
  116.53 @@ -66,7 +66,7 @@
  116.54  oops
  116.55  
  116.56  
  116.57 -subsection {* 2.5. Natural Numbers and Integers *}
  116.58 +subsection \<open>2.5. Natural Numbers and Integers\<close>
  116.59  
  116.60  lemma "\<lbrakk>i \<le> j; n \<le> (m::int)\<rbrakk> \<Longrightarrow> i * n + j * m \<le> i * m + j * n"
  116.61  nitpick [expect = genuine]
  116.62 @@ -87,7 +87,7 @@
  116.63  oops
  116.64  
  116.65  
  116.66 -subsection {* 2.6. Inductive Datatypes *}
  116.67 +subsection \<open>2.6. Inductive Datatypes\<close>
  116.68  
  116.69  lemma "hd (xs @ [y, y]) = hd xs"
  116.70  nitpick [expect = genuine]
  116.71 @@ -99,7 +99,7 @@
  116.72  oops
  116.73  
  116.74  
  116.75 -subsection {* 2.7. Typedefs, Records, Rationals, and Reals *}
  116.76 +subsection \<open>2.7. Typedefs, Records, Rationals, and Reals\<close>
  116.77  
  116.78  definition "three = {0::nat, 1, 2}"
  116.79  typedef three = three
  116.80 @@ -129,16 +129,16 @@
  116.81  nitpick [show_types, expect = genuine]
  116.82  oops
  116.83  
  116.84 -ML {*
  116.85 +ML \<open>
  116.86  fun my_int_postproc _ _ _ T (Const _ $ (Const _ $ t1 $ t2)) =
  116.87      HOLogic.mk_number T (snd (HOLogic.dest_number t1)
  116.88                           - snd (HOLogic.dest_number t2))
  116.89    | my_int_postproc _ _ _ _ t = t
  116.90 -*}
  116.91 +\<close>
  116.92  
  116.93 -declaration {*
  116.94 +declaration \<open>
  116.95  Nitpick_Model.register_term_postprocessor @{typ my_int} my_int_postproc
  116.96 -*}
  116.97 +\<close>
  116.98  
  116.99  lemma "add x y = add x x"
 116.100  nitpick [show_types]
 116.101 @@ -157,7 +157,7 @@
 116.102  oops
 116.103  
 116.104  
 116.105 -subsection {* 2.8. Inductive and Coinductive Predicates *}
 116.106 +subsection \<open>2.8. Inductive and Coinductive Predicates\<close>
 116.107  
 116.108  inductive even where
 116.109  "even 0" |
 116.110 @@ -200,7 +200,7 @@
 116.111  oops
 116.112  
 116.113  
 116.114 -subsection {* 2.9. Coinductive Datatypes *}
 116.115 +subsection \<open>2.9. Coinductive Datatypes\<close>
 116.116  
 116.117  codatatype 'a llist = LNil | LCons 'a "'a llist"
 116.118  
 116.119 @@ -221,7 +221,7 @@
 116.120  sorry
 116.121  
 116.122  
 116.123 -subsection {* 2.10. Boxing *}
 116.124 +subsection \<open>2.10. Boxing\<close>
 116.125  
 116.126  datatype tm = Var nat | Lam tm | App tm tm
 116.127  
 116.128 @@ -258,7 +258,7 @@
 116.129  sorry
 116.130  
 116.131  
 116.132 -subsection {* 2.11. Scope Monotonicity *}
 116.133 +subsection \<open>2.11. Scope Monotonicity\<close>
 116.134  
 116.135  lemma "length xs = length ys \<Longrightarrow> rev (zip xs ys) = zip xs (rev ys)"
 116.136  nitpick [verbose, expect = genuine]
 116.137 @@ -270,7 +270,7 @@
 116.138  oops
 116.139  
 116.140  
 116.141 -subsection {* 2.12. Inductive Properties *}
 116.142 +subsection \<open>2.12. Inductive Properties\<close>
 116.143  
 116.144  inductive_set reach where
 116.145  "(4::nat) \<in> reach" |
 116.146 @@ -299,12 +299,12 @@
 116.147  by (induct set: reach) arith+
 116.148  
 116.149  
 116.150 -section {* 3. Case Studies *}
 116.151 +section \<open>3. Case Studies\<close>
 116.152  
 116.153  nitpick_params [max_potential = 0]
 116.154  
 116.155  
 116.156 -subsection {* 3.1. A Context-Free Grammar *}
 116.157 +subsection \<open>3.1. A Context-Free Grammar\<close>
 116.158  
 116.159  datatype alphabet = a | b
 116.160  
 116.161 @@ -379,7 +379,7 @@
 116.162  sorry
 116.163  
 116.164  
 116.165 -subsection {* 3.2. AA Trees *}
 116.166 +subsection \<open>3.2. AA Trees\<close>
 116.167  
 116.168  datatype 'a aa_tree = \<Lambda> | N "'a::linorder" nat "'a aa_tree" "'a aa_tree"
 116.169  
   117.1 --- a/src/HOL/Nitpick_Examples/Mini_Nits.thy	Thu May 26 16:57:14 2016 +0200
   117.2 +++ b/src/HOL/Nitpick_Examples/Mini_Nits.thy	Thu May 26 17:51:22 2016 +0200
   117.3 @@ -5,7 +5,7 @@
   117.4  Examples featuring Minipick, the minimalistic version of Nitpick.
   117.5  *)
   117.6  
   117.7 -section {* Examples Featuring Minipick, the Minimalistic Version of Nitpick *}
   117.8 +section \<open>Examples Featuring Minipick, the Minimalistic Version of Nitpick\<close>
   117.9  
  117.10  theory Mini_Nits
  117.11  imports Main
  117.12 @@ -16,96 +16,96 @@
  117.13  nitpick_params [verbose, sat_solver = MiniSat_JNI, max_threads = 1,
  117.14    total_consts = smart]
  117.15  
  117.16 -ML {*
  117.17 +ML \<open>
  117.18  val check = Minipick.minipick @{context}
  117.19  val expect = Minipick.minipick_expect @{context}
  117.20  val none = expect "none"
  117.21  val genuine = expect "genuine"
  117.22  val unknown = expect "unknown"
  117.23 -*}
  117.24 +\<close>
  117.25  
  117.26 -ML_val {* genuine 1 @{prop "x = Not"} *}
  117.27 -ML_val {* none 1 @{prop "\<exists>x. x = Not"} *}
  117.28 -ML_val {* none 1 @{prop "\<not> False"} *}
  117.29 -ML_val {* genuine 1 @{prop "\<not> True"} *}
  117.30 -ML_val {* none 1 @{prop "\<not> \<not> b \<longleftrightarrow> b"} *}
  117.31 -ML_val {* none 1 @{prop True} *}
  117.32 -ML_val {* genuine 1 @{prop False} *}
  117.33 -ML_val {* genuine 1 @{prop "True \<longleftrightarrow> False"} *}
  117.34 -ML_val {* none 1 @{prop "True \<longleftrightarrow> \<not> False"} *}
  117.35 -ML_val {* none 4 @{prop "\<forall>x. x = x"} *}
  117.36 -ML_val {* none 4 @{prop "\<exists>x. x = x"} *}
  117.37 -ML_val {* none 1 @{prop "\<forall>x. x = y"} *}
  117.38 -ML_val {* genuine 2 @{prop "\<forall>x. x = y"} *}
  117.39 -ML_val {* none 2 @{prop "\<exists>x. x = y"} *}
  117.40 -ML_val {* none 2 @{prop "\<forall>x::'a \<times> 'a. x = x"} *}
  117.41 -ML_val {* none 2 @{prop "\<exists>x::'a \<times> 'a. x = y"} *}
  117.42 -ML_val {* genuine 2 @{prop "\<forall>x::'a \<times> 'a. x = y"} *}
  117.43 -ML_val {* none 2 @{prop "\<exists>x::'a \<times> 'a. x = y"} *}
  117.44 -ML_val {* none 1 @{prop "All = Ex"} *}
  117.45 -ML_val {* genuine 2 @{prop "All = Ex"} *}
  117.46 -ML_val {* none 1 @{prop "All P = Ex P"} *}
  117.47 -ML_val {* genuine 2 @{prop "All P = Ex P"} *}
  117.48 -ML_val {* none 4 @{prop "x = y \<longrightarrow> P x = P y"} *}
  117.49 -ML_val {* none 4 @{prop "(x::'a \<times> 'a) = y \<longrightarrow> P x = P y"} *}
  117.50 -ML_val {* none 2 @{prop "(x::'a \<times> 'a) = y \<longrightarrow> P x y = P y x"} *}
  117.51 -ML_val {* none 4 @{prop "\<exists>x::'a \<times> 'a. x = y \<longrightarrow> P x = P y"} *}
  117.52 -ML_val {* none 2 @{prop "(x::'a \<Rightarrow> 'a) = y \<longrightarrow> P x = P y"} *}
  117.53 -ML_val {* none 2 @{prop "\<exists>x::'a \<Rightarrow> 'a. x = y \<longrightarrow> P x = P y"} *}
  117.54 -ML_val {* genuine 1 @{prop "(op =) X = Ex"} *}
  117.55 -ML_val {* none 2 @{prop "\<forall>x::'a \<Rightarrow> 'a. x = x"} *}
  117.56 -ML_val {* none 1 @{prop "x = y"} *}
  117.57 -ML_val {* genuine 1 @{prop "x \<longleftrightarrow> y"} *}
  117.58 -ML_val {* genuine 2 @{prop "x = y"} *}
  117.59 -ML_val {* genuine 1 @{prop "X \<subseteq> Y"} *}
  117.60 -ML_val {* none 1 @{prop "P \<and> Q \<longleftrightarrow> Q \<and> P"} *}
  117.61 -ML_val {* none 1 @{prop "P \<and> Q \<longrightarrow> P"} *}
  117.62 -ML_val {* none 1 @{prop "P \<or> Q \<longleftrightarrow> Q \<or> P"} *}
  117.63 -ML_val {* genuine 1 @{prop "P \<or> Q \<longrightarrow> P"} *}
  117.64 -ML_val {* none 1 @{prop "(P \<longrightarrow> Q) \<longleftrightarrow> (\<not> P \<or> Q)"} *}
  117.65 -ML_val {* none 4 @{prop "{a} = {a, a}"} *}
  117.66 -ML_val {* genuine 2 @{prop "{a} = {a, b}"} *}
  117.67 -ML_val {* genuine 1 @{prop "{a} \<noteq> {a, b}"} *}
  117.68 -ML_val {* none 4 @{prop "{}\<^sup>+ = {}"} *}
  117.69 -ML_val {* none 4 @{prop "UNIV\<^sup>+ = UNIV"} *}
  117.70 -ML_val {* none 4 @{prop "(UNIV :: ('a \<times> 'b) set) - {} = UNIV"} *}
  117.71 -ML_val {* none 4 @{prop "{} - (UNIV :: ('a \<times> 'b) set) = {}"} *}
  117.72 -ML_val {* none 1 @{prop "{(a, b), (b, c)}\<^sup>+ = {(a, b), (a, c), (b, c)}"} *}
  117.73 -ML_val {* genuine 2 @{prop "{(a, b), (b, c)}\<^sup>+ = {(a, b), (a, c), (b, c)}"} *}
  117.74 -ML_val {* none 4 @{prop "a \<noteq> c \<Longrightarrow> {(a, b), (b, c)}\<^sup>+ = {(a, b), (a, c), (b, c)}"} *}
  117.75 -ML_val {* none 4 @{prop "A \<union> B = {x. x \<in> A \<or> x \<in> B}"} *}
  117.76 -ML_val {* none 4 @{prop "A \<inter> B = {x. x \<in> A \<and> x \<in> B}"} *}
  117.77 -ML_val {* none 4 @{prop "A - B = (\<lambda>x. A x \<and> \<not> B x)"} *}
  117.78 -ML_val {* none 4 @{prop "\<exists>a b. (a, b) = (b, a)"} *}
  117.79 -ML_val {* genuine 2 @{prop "(a, b) = (b, a)"} *}
  117.80 -ML_val {* genuine 2 @{prop "(a, b) \<noteq> (b, a)"} *}
  117.81 -ML_val {* none 4 @{prop "\<exists>a b::'a \<times> 'a. (a, b) = (b, a)"} *}
  117.82 -ML_val {* genuine 2 @{prop "(a::'a \<times> 'a, b) = (b, a)"} *}
  117.83 -ML_val {* none 4 @{prop "\<exists>a b::'a \<times> 'a \<times> 'a. (a, b) = (b, a)"} *}
  117.84 -ML_val {* genuine 2 @{prop "(a::'a \<times> 'a \<times> 'a, b) \<noteq> (b, a)"} *}
  117.85 -ML_val {* none 4 @{prop "\<exists>a b::'a \<Rightarrow> 'a. (a, b) = (b, a)"} *}
  117.86 -ML_val {* genuine 1 @{prop "(a::'a \<Rightarrow> 'a, b) \<noteq> (b, a)"} *}
  117.87 -ML_val {* none 4 @{prop "fst (a, b) = a"} *}
  117.88 -ML_val {* none 1 @{prop "fst (a, b) = b"} *}
  117.89 -ML_val {* genuine 2 @{prop "fst (a, b) = b"} *}
  117.90 -ML_val {* genuine 2 @{prop "fst (a, b) \<noteq> b"} *}
  117.91 -ML_val {* genuine 2 @{prop "f ((x, z), y) = (x, z)"} *}
  117.92 -ML_val {* none 2 @{prop "(ALL x. f x = fst x) \<longrightarrow> f ((x, z), y) = (x, z)"} *}
  117.93 -ML_val {* none 4 @{prop "snd (a, b) = b"} *}
  117.94 -ML_val {* none 1 @{prop "snd (a, b) = a"} *}
  117.95 -ML_val {* genuine 2 @{prop "snd (a, b) = a"} *}
  117.96 -ML_val {* genuine 2 @{prop "snd (a, b) \<noteq> a"} *}
  117.97 -ML_val {* genuine 1 @{prop P} *}
  117.98 -ML_val {* genuine 1 @{prop "(\<lambda>x. P) a"} *}
  117.99 -ML_val {* genuine 1 @{prop "(\<lambda>x y z. P y x z) a b c"} *}
 117.100 -ML_val {* none 4 @{prop "\<exists>f. f = (\<lambda>x. x) \<and> f y = y"} *}
 117.101 -ML_val {* genuine 1 @{prop "\<exists>f. f p \<noteq> p \<and> (\<forall>a b. f (a, b) = (a, b))"} *}
 117.102 -ML_val {* none 2 @{prop "\<exists>f. \<forall>a b. f (a, b) = (a, b)"} *}
 117.103 -ML_val {* none 3 @{prop "f = (\<lambda>a b. (b, a)) \<longrightarrow> f x y = (y, x)"} *}
 117.104 -ML_val {* genuine 2 @{prop "f = (\<lambda>a b. (b, a)) \<longrightarrow> f x y = (x, y)"} *}
 117.105 -ML_val {* none 4 @{prop "f = (\<lambda>x. f x)"} *}
 117.106 -ML_val {* none 4 @{prop "f = (\<lambda>x. f x::'a \<Rightarrow> bool)"} *}
 117.107 -ML_val {* none 4 @{prop "f = (\<lambda>x y. f x y)"} *}
 117.108 -ML_val {* none 4 @{prop "f = (\<lambda>x y. f x y::'a \<Rightarrow> bool)"} *}
 117.109 +ML_val \<open>genuine 1 @{prop "x = Not"}\<close>
 117.110 +ML_val \<open>none 1 @{prop "\<exists>x. x = Not"}\<close>
 117.111 +ML_val \<open>none 1 @{prop "\<not> False"}\<close>
 117.112 +ML_val \<open>genuine 1 @{prop "\<not> True"}\<close>
 117.113 +ML_val \<open>none 1 @{prop "\<not> \<not> b \<longleftrightarrow> b"}\<close>
 117.114 +ML_val \<open>none 1 @{prop True}\<close>
 117.115 +ML_val \<open>genuine 1 @{prop False}\<close>
 117.116 +ML_val \<open>genuine 1 @{prop "True \<longleftrightarrow> False"}\<close>
 117.117 +ML_val \<open>none 1 @{prop "True \<longleftrightarrow> \<not> False"}\<close>
 117.118 +ML_val \<open>none 4 @{prop "\<forall>x. x = x"}\<close>
 117.119 +ML_val \<open>none 4 @{prop "\<exists>x. x = x"}\<close>
 117.120 +ML_val \<open>none 1 @{prop "\<forall>x. x = y"}\<close>
 117.121 +ML_val \<open>genuine 2 @{prop "\<forall>x. x = y"}\<close>
 117.122 +ML_val \<open>none 2 @{prop "\<exists>x. x = y"}\<close>
 117.123 +ML_val \<open>none 2 @{prop "\<forall>x::'a \<times> 'a. x = x"}\<close>
 117.124 +ML_val \<open>none 2 @{prop "\<exists>x::'a \<times> 'a. x = y"}\<close>
 117.125 +ML_val \<open>genuine 2 @{prop "\<forall>x::'a \<times> 'a. x = y"}\<close>
 117.126 +ML_val \<open>none 2 @{prop "\<exists>x::'a \<times> 'a. x = y"}\<close>
 117.127 +ML_val \<open>none 1 @{prop "All = Ex"}\<close>
 117.128 +ML_val \<open>genuine 2 @{prop "All = Ex"}\<close>
 117.129 +ML_val \<open>none 1 @{prop "All P = Ex P"}\<close>
 117.130 +ML_val \<open>genuine 2 @{prop "All P = Ex P"}\<close>
 117.131 +ML_val \<open>none 4 @{prop "x = y \<longrightarrow> P x = P y"}\<close>
 117.132 +ML_val \<open>none 4 @{prop "(x::'a \<times> 'a) = y \<longrightarrow> P x = P y"}\<close>
 117.133 +ML_val \<open>none 2 @{prop "(x::'a \<times> 'a) = y \<longrightarrow> P x y = P y x"}\<close>
 117.134 +ML_val \<open>none 4 @{prop "\<exists>x::'a \<times> 'a. x = y \<longrightarrow> P x = P y"}\<close>
 117.135 +ML_val \<open>none 2 @{prop "(x::'a \<Rightarrow> 'a) = y \<longrightarrow> P x = P y"}\<close>
 117.136 +ML_val \<open>none 2 @{prop "\<exists>x::'a \<Rightarrow> 'a. x = y \<longrightarrow> P x = P y"}\<close>
 117.137 +ML_val \<open>genuine 1 @{prop "(op =) X = Ex"}\<close>
 117.138 +ML_val \<open>none 2 @{prop "\<forall>x::'a \<Rightarrow> 'a. x = x"}\<close>
 117.139 +ML_val \<open>none 1 @{prop "x = y"}\<close>
 117.140 +ML_val \<open>genuine 1 @{prop "x \<longleftrightarrow> y"}\<close>
 117.141 +ML_val \<open>genuine 2 @{prop "x = y"}\<close>
 117.142 +ML_val \<open>genuine 1 @{prop "X \<subseteq> Y"}\<close>
 117.143 +ML_val \<open>none 1 @{prop "P \<and> Q \<longleftrightarrow> Q \<and> P"}\<close>
 117.144 +ML_val \<open>none 1 @{prop "P \<and> Q \<longrightarrow> P"}\<close>
 117.145 +ML_val \<open>none 1 @{prop "P \<or> Q \<longleftrightarrow> Q \<or> P"}\<close>
 117.146 +ML_val \<open>genuine 1 @{prop "P \<or> Q \<longrightarrow> P"}\<close>
 117.147 +ML_val \<open>none 1 @{prop "(P \<longrightarrow> Q) \<longleftrightarrow> (\<not> P \<or> Q)"}\<close>
 117.148 +ML_val \<open>none 4 @{prop "{a} = {a, a}"}\<close>
 117.149 +ML_val \<open>genuine 2 @{prop "{a} = {a, b}"}\<close>
 117.150 +ML_val \<open>genuine 1 @{prop "{a} \<noteq> {a, b}"}\<close>
 117.151 +ML_val \<open>none 4 @{prop "{}\<^sup>+ = {}"}\<close>
 117.152 +ML_val \<open>none 4 @{prop "UNIV\<^sup>+ = UNIV"}\<close>
 117.153 +ML_val \<open>none 4 @{prop "(UNIV :: ('a \<times> 'b) set) - {} = UNIV"}\<close>
 117.154 +ML_val \<open>none 4 @{prop "{} - (UNIV :: ('a \<times> 'b) set) = {}"}\<close>
 117.155 +ML_val \<open>none 1 @{prop "{(a, b), (b, c)}\<^sup>+ = {(a, b), (a, c), (b, c)}"}\<close>
 117.156 +ML_val \<open>genuine 2 @{prop "{(a, b), (b, c)}\<^sup>+ = {(a, b), (a, c), (b, c)}"}\<close>
 117.157 +ML_val \<open>none 4 @{prop "a \<noteq> c \<Longrightarrow> {(a, b), (b, c)}\<^sup>+ = {(a, b), (a, c), (b, c)}"}\<close>
 117.158 +ML_val \<open>none 4 @{prop "A \<union> B = {x. x \<in> A \<or> x \<in> B}"}\<close>
 117.159 +ML_val \<open>none 4 @{prop "A \<inter> B = {x. x \<in> A \<and> x \<in> B}"}\<close>
 117.160 +ML_val \<open>none 4 @{prop "A - B = (\<lambda>x. A x \<and> \<not> B x)"}\<close>
 117.161 +ML_val \<open>none 4 @{prop "\<exists>a b. (a, b) = (b, a)"}\<close>
 117.162 +ML_val \<open>genuine 2 @{prop "(a, b) = (b, a)"}\<close>
 117.163 +ML_val \<open>genuine 2 @{prop "(a, b) \<noteq> (b, a)"}\<close>
 117.164 +ML_val \<open>none 4 @{prop "\<exists>a b::'a \<times> 'a. (a, b) = (b, a)"}\<close>
 117.165 +ML_val \<open>genuine 2 @{prop "(a::'a \<times> 'a, b) = (b, a)"}\<close>
 117.166 +ML_val \<open>none 4 @{prop "\<exists>a b::'a \<times> 'a \<times> 'a. (a, b) = (b, a)"}\<close>
 117.167 +ML_val \<open>genuine 2 @{prop "(a::'a \<times> 'a \<times> 'a, b) \<noteq> (b, a)"}\<close>
 117.168 +ML_val \<open>none 4 @{prop "\<exists>a b::'a \<Rightarrow> 'a. (a, b) = (b, a)"}\<close>
 117.169 +ML_val \<open>genuine 1 @{prop "(a::'a \<Rightarrow> 'a, b) \<noteq> (b, a)"}\<close>
 117.170 +ML_val \<open>none 4 @{prop "fst (a, b) = a"}\<close>
 117.171 +ML_val \<open>none 1 @{prop "fst (a, b) = b"}\<close>
 117.172 +ML_val \<open>genuine 2 @{prop "fst (a, b) = b"}\<close>
 117.173 +ML_val \<open>genuine 2 @{prop "fst (a, b) \<noteq> b"}\<close>
 117.174 +ML_val \<open>genuine 2 @{prop "f ((x, z), y) = (x, z)"}\<close>
 117.175 +ML_val \<open>none 2 @{prop "(ALL x. f x = fst x) \<longrightarrow> f ((x, z), y) = (x, z)"}\<close>
 117.176 +ML_val \<open>none 4 @{prop "snd (a, b) = b"}\<close>
 117.177 +ML_val \<open>none 1 @{prop "snd (a, b) = a"}\<close>
 117.178 +ML_val \<open>genuine 2 @{prop "snd (a, b) = a"}\<close>
 117.179 +ML_val \<open>genuine 2 @{prop "snd (a, b) \<noteq> a"}\<close>
 117.180 +ML_val \<open>genuine 1 @{prop P}\<close>
 117.181 +ML_val \<open>genuine 1 @{prop "(\<lambda>x. P) a"}\<close>
 117.182 +ML_val \<open>genuine 1 @{prop "(\<lambda>x y z. P y x z) a b c"}\<close>
 117.183 +ML_val \<open>none 4 @{prop "\<exists>f. f = (\<lambda>x. x) \<and> f y = y"}\<close>
 117.184 +ML_val \<open>genuine 1 @{prop "\<exists>f. f p \<noteq> p \<and> (\<forall>a b. f (a, b) = (a, b))"}\<close>
 117.185 +ML_val \<open>none 2 @{prop "\<exists>f. \<forall>a b. f (a, b) = (a, b)"}\<close>
 117.186 +ML_val \<open>none 3 @{prop "f = (\<lambda>a b. (b, a)) \<longrightarrow> f x y = (y, x)"}\<close>
 117.187 +ML_val \<open>genuine 2 @{prop "f = (\<lambda>a b. (b, a)) \<longrightarrow> f x y = (x, y)"}\<close>
 117.188 +ML_val \<open>none 4 @{prop "f = (\<lambda>x. f x)"}\<close>
 117.189 +ML_val \<open>none 4 @{prop "f = (\<lambda>x. f x::'a \<Rightarrow> bool)"}\<close>
 117.190 +ML_val \<open>none 4 @{prop "f = (\<lambda>x y. f x y)"}\<close>
 117.191 +ML_val \<open>none 4 @{prop "f = (\<lambda>x y. f x y::'a \<Rightarrow> bool)"}\<close>
 117.192  
 117.193  end
   118.1 --- a/src/HOL/Nitpick_Examples/Mono_Nits.thy	Thu May 26 16:57:14 2016 +0200
   118.2 +++ b/src/HOL/Nitpick_Examples/Mono_Nits.thy	Thu May 26 17:51:22 2016 +0200
   118.3 @@ -5,7 +5,7 @@
   118.4  Examples featuring Nitpick's monotonicity check.
   118.5  *)
   118.6  
   118.7 -section {* Examples Featuring Nitpick's Monotonicity Check *}
   118.8 +section \<open>Examples Featuring Nitpick's Monotonicity Check\<close>
   118.9  
  118.10  theory Mono_Nits
  118.11  imports Main
  118.12 @@ -13,7 +13,7 @@
  118.13          (* "~/afp/thys/AVL-Trees/AVL2" "~/afp/thys/Huffman/Huffman" *)
  118.14  begin
  118.15  
  118.16 -ML {*
  118.17 +ML \<open>
  118.18  open Nitpick_Util
  118.19  open Nitpick_HOL
  118.20  open Nitpick_Preproc
  118.21 @@ -62,84 +62,84 @@
  118.22  fun nonmono t = not (is_mono t) orelse raise BUG
  118.23  fun const t = is_const t orelse raise BUG
  118.24  fun nonconst t = not (is_const t) orelse raise BUG
  118.25 -*}
  118.26 +\<close>
  118.27  
  118.28 -ML {* Nitpick_Mono.trace := false *}
  118.29 +ML \<open>Nitpick_Mono.trace := false\<close>
  118.30  
  118.31 -ML_val {* const @{term "A::('a\<Rightarrow>'b)"} *}
  118.32 -ML_val {* const @{term "(A::'a set) = A"} *}
  118.33 -ML_val {* const @{term "(A::'a set set) = A"} *}
  118.34 -ML_val {* const @{term "(\<lambda>x::'a set. a \<in> x)"} *}
  118.35 -ML_val {* const @{term "{{a::'a}} = C"} *}
  118.36 -ML_val {* const @{term "{f::'a\<Rightarrow>nat} = {g::'a\<Rightarrow>nat}"} *}
  118.37 -ML_val {* const @{term "A \<union> (B::'a set)"} *}
  118.38 -ML_val {* const @{term "\<lambda>A B x::'a. A x \<or> B x"} *}
  118.39 -ML_val {* const @{term "P (a::'a)"} *}
  118.40 -ML_val {* const @{term "\<lambda>a::'a. b (c (d::'a)) (e::'a) (f::'a)"} *}
  118.41 -ML_val {* const @{term "\<forall>A::'a set. a \<in> A"} *}
  118.42 -ML_val {* const @{term "\<forall>A::'a set. P A"} *}
  118.43 -ML_val {* const @{term "P \<or> Q"} *}
  118.44 -ML_val {* const @{term "A \<union> B = (C::'a set)"} *}
  118.45 -ML_val {* const @{term "(\<lambda>A B x::'a. A x \<or> B x) A B = C"} *}
  118.46 -ML_val {* const @{term "(if P then (A::'a set) else B) = C"} *}
  118.47 -ML_val {* const @{term "let A = (C::'a set) in A \<union> B"} *}
  118.48 -ML_val {* const @{term "THE x::'b. P x"} *}
  118.49 -ML_val {* const @{term "(\<lambda>x::'a. False)"} *}
  118.50 -ML_val {* const @{term "(\<lambda>x::'a. True)"} *}
  118.51 -ML_val {* const @{term "(\<lambda>x::'a. False) = (\<lambda>x::'a. False)"} *}
  118.52 -ML_val {* const @{term "(\<lambda>x::'a. True) = (\<lambda>x::'a. True)"} *}
  118.53 -ML_val {* const @{term "Let (a::'a) A"} *}
  118.54 -ML_val {* const @{term "A (a::'a)"} *}
  118.55 -ML_val {* const @{term "insert (a::'a) A = B"} *}
  118.56 -ML_val {* const @{term "- (A::'a set)"} *}
  118.57 -ML_val {* const @{term "finite (A::'a set)"} *}
  118.58 -ML_val {* const @{term "\<not> finite (A::'a set)"} *}
  118.59 -ML_val {* const @{term "finite (A::'a set set)"} *}
  118.60 -ML_val {* const @{term "\<lambda>a::'a. A a \<and> \<not> B a"} *}
  118.61 -ML_val {* const @{term "A < (B::'a set)"} *}
  118.62 -ML_val {* const @{term "A \<le> (B::'a set)"} *}
  118.63 -ML_val {* const @{term "[a::'a]"} *}
  118.64 -ML_val {* const @{term "[a::'a set]"} *}
  118.65 -ML_val {* const @{term "[A \<union> (B::'a set)]"} *}
  118.66 -ML_val {* const @{term "[A \<union> (B::'a set)] = [C]"} *}
  118.67 -ML_val {* const @{term "{(\<lambda>x::'a. x = a)} = C"} *}
  118.68 -ML_val {* const @{term "(\<lambda>a::'a. \<not> A a) = B"} *}
  118.69 -ML_val {* const @{prop "\<forall>F f g (h::'a set). F f \<and> F g \<and> \<not> f a \<and> g a \<longrightarrow> \<not> f a"} *}
  118.70 -ML_val {* const @{term "\<lambda>A B x::'a. A x \<and> B x \<and> A = B"} *}
  118.71 -ML_val {* const @{term "p = (\<lambda>(x::'a) (y::'a). P x \<or> \<not> Q y)"} *}
  118.72 -ML_val {* const @{term "p = (\<lambda>(x::'a) (y::'a). p x y :: bool)"} *}
  118.73 -ML_val {* const @{term "p = (\<lambda>A B x. A x \<and> \<not> B x) (\<lambda>x. True) (\<lambda>y. x \<noteq> y)"} *}
  118.74 -ML_val {* const @{term "p = (\<lambda>y. x \<noteq> y)"} *}
  118.75 -ML_val {* const @{term "(\<lambda>x. (p::'a\<Rightarrow>bool\<Rightarrow>bool) x False)"} *}
  118.76 -ML_val {* const @{term "(\<lambda>x y. (p::'a\<Rightarrow>'a\<Rightarrow>bool\<Rightarrow>bool) x y False)"} *}
  118.77 -ML_val {* const @{term "f = (\<lambda>x::'a. P x \<longrightarrow> Q x)"} *}
  118.78 -ML_val {* const @{term "\<forall>a::'a. P a"} *}
  118.79 +ML_val \<open>const @{term "A::('a\<Rightarrow>'b)"}\<close>
  118.80 +ML_val \<open>const @{term "(A::'a set) = A"}\<close>
  118.81 +ML_val \<open>const @{term "(A::'a set set) = A"}\<close>
  118.82 +ML_val \<open>const @{term "(\<lambda>x::'a set. a \<in> x)"}\<close>
  118.83 +ML_val \<open>const @{term "{{a::'a}} = C"}\<close>
  118.84 +ML_val \<open>const @{term "{f::'a\<Rightarrow>nat} = {g::'a\<Rightarrow>nat}"}\<close>
  118.85 +ML_val \<open>const @{term "A \<union> (B::'a set)"}\<close>
  118.86 +ML_val \<open>const @{term "\<lambda>A B x::'a. A x \<or> B x"}\<close>
  118.87 +ML_val \<open>const @{term "P (a::'a)"}\<close>
  118.88 +ML_val \<open>const @{term "\<lambda>a::'a. b (c (d::'a)) (e::'a) (f::'a)"}\<close>
  118.89 +ML_val \<open>const @{term "\<forall>A::'a set. a \<in> A"}\<close>
  118.90 +ML_val \<open>const @{term "\<forall>A::'a set. P A"}\<close>
  118.91 +ML_val \<open>const @{term "P \<or> Q"}\<close>
  118.92 +ML_val \<open>const @{term "A \<union> B = (C::'a set)"}\<close>
  118.93 +ML_val \<open>const @{term "(\<lambda>A B x::'a. A x \<or> B x) A B = C"}\<close>
  118.94 +ML_val \<open>const @{term "(if P then (A::'a set) else B) = C"}\<close>
  118.95 +ML_val \<open>const @{term "let A = (C::'a set) in A \<union> B"}\<close>
  118.96 +ML_val \<open>const @{term "THE x::'b. P x"}\<close>
  118.97 +ML_val \<open>const @{term "(\<lambda>x::'a. False)"}\<close>
  118.98 +ML_val \<open>const @{term "(\<lambda>x::'a. True)"}\<close>
  118.99 +ML_val \<open>const @{term "(\<lambda>x::'a. False) = (\<lambda>x::'a. False)"}\<close>
 118.100 +ML_val \<open>const @{term "(\<lambda>x::'a. True) = (\<lambda>x::'a. True)"}\<close>
 118.101 +ML_val \<open>const @{term "Let (a::'a) A"}\<close>
 118.102 +ML_val \<open>const @{term "A (a::'a)"}\<close>
 118.103 +ML_val \<open>const @{term "insert (a::'a) A = B"}\<close>
 118.104 +ML_val \<open>const @{term "- (A::'a set)"}\<close>
 118.105 +ML_val \<open>const @{term "finite (A::'a set)"}\<close>
 118.106 +ML_val \<open>const @{term "\<not> finite (A::'a set)"}\<close>
 118.107 +ML_val \<open>const @{term "finite (A::'a set set)"}\<close>
 118.108 +ML_val \<open>const @{term "\<lambda>a::'a. A a \<and> \<not> B a"}\<close>
 118.109 +ML_val \<open>const @{term "A < (B::'a set)"}\<close>
 118.110 +ML_val \<open>const @{term "A \<le> (B::'a set)"}\<close>
 118.111 +ML_val \<open>const @{term "[a::'a]"}\<close>
 118.112 +ML_val \<open>const @{term "[a::'a set]"}\<close>
 118.113 +ML_val \<open>const @{term "[A \<union> (B::'a set)]"}\<close>
 118.114 +ML_val \<open>const @{term "[A \<union> (B::'a set)] = [C]"}\<close>
 118.115 +ML_val \<open>const @{term "{(\<lambda>x::'a. x = a)} = C"}\<close>
 118.116 +ML_val \<open>const @{term "(\<lambda>a::'a. \<not> A a) = B"}\<close>
 118.117 +ML_val \<open>const @{prop "\<forall>F f g (h::'a set). F f \<and> F g \<and> \<not> f a \<and> g a \<longrightarrow> \<not> f a"}\<close>
 118.118 +ML_val \<open>const @{term "\<lambda>A B x::'a. A x \<and> B x \<and> A = B"}\<close>
 118.119 +ML_val \<open>const @{term "p = (\<lambda>(x::'a) (y::'a). P x \<or> \<not> Q y)"}\<close>
 118.120 +ML_val \<open>const @{term "p = (\<lambda>(x::'a) (y::'a). p x y :: bool)"}\<close>
 118.121 +ML_val \<open>const @{term "p = (\<lambda>A B x. A x \<and> \<not> B x) (\<lambda>x. True) (\<lambda>y. x \<noteq> y)"}\<close>
 118.122 +ML_val \<open>const @{term "p = (\<lambda>y. x \<noteq> y)"}\<close>
 118.123 +ML_val \<open>const @{term "(\<lambda>x. (p::'a\<Rightarrow>bool\<Rightarrow>bool) x False)"}\<close>
 118.124 +ML_val \<open>const @{term "(\<lambda>x y. (p::'a\<Rightarrow>'a\<Rightarrow>bool\<Rightarrow>bool) x y False)"}\<close>
 118.125 +ML_val \<open>const @{term "f = (\<lambda>x::'a. P x \<longrightarrow> Q x)"}\<close>
 118.126 +ML_val \<open>const @{term "\<forall>a::'a. P a"}\<close>
 118.127  
 118.128 -ML_val {* nonconst @{term "\<forall>P (a::'a). P a"} *}
 118.129 -ML_val {* nonconst @{term "THE x::'a. P x"} *}
 118.130 -ML_val {* nonconst @{term "SOME x::'a. P x"} *}
 118.131 -ML_val {* nonconst @{term "(\<lambda>A B x::'a. A x \<or> B x) = myunion"} *}
 118.132 -ML_val {* nonconst @{term "(\<lambda>x::'a. False) = (\<lambda>x::'a. True)"} *}
 118.133 -ML_val {* nonconst @{prop "\<forall>F f g (h::'a set). F f \<and> F g \<and> \<not> a \<in> f \<and> a \<in> g \<longrightarrow> F h"} *}
 118.134 +ML_val \<open>nonconst @{term "\<forall>P (a::'a). P a"}\<close>
 118.135 +ML_val \<open>nonconst @{term "THE x::'a. P x"}\<close>
 118.136 +ML_val \<open>nonconst @{term "SOME x::'a. P x"}\<close>
 118.137 +ML_val \<open>nonconst @{term "(\<lambda>A B x::'a. A x \<or> B x) = myunion"}\<close>
 118.138 +ML_val \<open>nonconst @{term "(\<lambda>x::'a. False) = (\<lambda>x::'a. True)"}\<close>
 118.139 +ML_val \<open>nonconst @{prop "\<forall>F f g (h::'a set). F f \<and> F g \<and> \<not> a \<in> f \<and> a \<in> g \<longrightarrow> F h"}\<close>
 118.140  
 118.141 -ML_val {* mono @{prop "Q (\<forall>x::'a set. P x)"} *}
 118.142 -ML_val {* mono @{prop "P (a::'a)"} *}
 118.143 -ML_val {* mono @{prop "{a} = {b::'a}"} *}
 118.144 -ML_val {* mono @{prop "(\<lambda>x. x = a) = (\<lambda>y. y = (b::'a))"} *}
 118.145 -ML_val {* mono @{prop "(a::'a) \<in> P \<and> P \<union> P = P"} *}
 118.146 -ML_val {* mono @{prop "\<forall>F::'a set set. P"} *}
 118.147 -ML_val {* mono @{prop "\<not> (\<forall>F f g (h::'a set). F f \<and> F g \<and> \<not> a \<in> f \<and> a \<in> g \<longrightarrow> F h)"} *}
 118.148 -ML_val {* mono @{prop "\<not> Q (\<forall>x::'a set. P x)"} *}
 118.149 -ML_val {* mono @{prop "\<not> (\<forall>x::'a. P x)"} *}
 118.150 -ML_val {* mono @{prop "myall P = (P = (\<lambda>x::'a. True))"} *}
 118.151 -ML_val {* mono @{prop "myall P = (P = (\<lambda>x::'a. False))"} *}
 118.152 -ML_val {* mono @{prop "\<forall>x::'a. P x"} *}
 118.153 -ML_val {* mono @{term "(\<lambda>A B x::'a. A x \<or> B x) \<noteq> myunion"} *}
 118.154 +ML_val \<open>mono @{prop "Q (\<forall>x::'a set. P x)"}\<close>
 118.155 +ML_val \<open>mono @{prop "P (a::'a)"}\<close>
 118.156 +ML_val \<open>mono @{prop "{a} = {b::'a}"}\<close>
 118.157 +ML_val \<open>mono @{prop "(\<lambda>x. x = a) = (\<lambda>y. y = (b::'a))"}\<close>
 118.158 +ML_val \<open>mono @{prop "(a::'a) \<in> P \<and> P \<union> P = P"}\<close>
 118.159 +ML_val \<open>mono @{prop "\<forall>F::'a set set. P"}\<close>
 118.160 +ML_val \<open>mono @{prop "\<not> (\<forall>F f g (h::'a set). F f \<and> F g \<and> \<not> a \<in> f \<and> a \<in> g \<longrightarrow> F h)"}\<close>
 118.161 +ML_val \<open>mono @{prop "\<not> Q (\<forall>x::'a set. P x)"}\<close>
 118.162 +ML_val \<open>mono @{prop "\<not> (\<forall>x::'a. P x)"}\<close>
 118.163 +ML_val \<open>mono @{prop "myall P = (P = (\<lambda>x::'a. True))"}\<close>
 118.164 +ML_val \<open>mono @{prop "myall P = (P = (\<lambda>x::'a. False))"}\<close>
 118.165 +ML_val \<open>mono @{prop "\<forall>x::'a. P x"}\<close>
 118.166 +ML_val \<open>mono @{term "(\<lambda>A B x::'a. A x \<or> B x) \<noteq> myunion"}\<close>
 118.167  
 118.168 -ML_val {* nonmono @{prop "A = (\<lambda>x::'a. True) \<and> A = (\<lambda>x. False)"} *}
 118.169 -ML_val {* nonmono @{prop "\<forall>F f g (h::'a set). F f \<and> F g \<and> \<not> a \<in> f \<and> a \<in> g \<longrightarrow> F h"} *}
 118.170 +ML_val \<open>nonmono @{prop "A = (\<lambda>x::'a. True) \<and> A = (\<lambda>x. False)"}\<close>
 118.171 +ML_val \<open>nonmono @{prop "\<forall>F f g (h::'a set). F f \<and> F g \<and> \<not> a \<in> f \<and> a \<in> g \<longrightarrow> F h"}\<close>
 118.172  
 118.173 -ML {*
 118.174 +ML \<open>
 118.175  val preproc_timeout = seconds 5.0
 118.176  val mono_timeout = seconds 1.0
 118.177  
 118.178 @@ -188,7 +188,7 @@
 118.179        in File.append path (res ^ "\n"); writeln res end
 118.180        handle Timeout.TIMEOUT _ => ()
 118.181    in thy |> theorems_of |> List.app check_theorem end
 118.182 -*}
 118.183 +\<close>
 118.184  
 118.185  (*
 118.186  ML_val {* check_theory @{theory AVL2} *}
 118.187 @@ -199,6 +199,6 @@
 118.188  ML_val {* check_theory @{theory Relation} *}
 118.189  *)
 118.190  
 118.191 -ML {* getenv "ISABELLE_TMP" *}
 118.192 +ML \<open>getenv "ISABELLE_TMP"\<close>
 118.193  
 118.194  end
   119.1 --- a/src/HOL/Nitpick_Examples/Pattern_Nits.thy	Thu May 26 16:57:14 2016 +0200
   119.2 +++ b/src/HOL/Nitpick_Examples/Pattern_Nits.thy	Thu May 26 17:51:22 2016 +0200
   119.3 @@ -5,7 +5,7 @@
   119.4  Examples featuring Nitpick's "destroy_constrs" optimization.
   119.5  *)
   119.6  
   119.7 -section {* Examples Featuring Nitpick's \textit{destroy\_constrs} Optimization *}
   119.8 +section \<open>Examples Featuring Nitpick's \textit{destroy\_constrs} Optimization\<close>
   119.9  
  119.10  theory Pattern_Nits
  119.11  imports Main
   120.1 --- a/src/HOL/Nitpick_Examples/Record_Nits.thy	Thu May 26 16:57:14 2016 +0200
   120.2 +++ b/src/HOL/Nitpick_Examples/Record_Nits.thy	Thu May 26 17:51:22 2016 +0200
   120.3 @@ -5,7 +5,7 @@
   120.4  Examples featuring Nitpick applied to records.
   120.5  *)
   120.6  
   120.7 -section {* Examples Featuring Nitpick Applied to Records *}
   120.8 +section \<open>Examples Featuring Nitpick Applied to Records\<close>
   120.9  
  120.10  theory Record_Nits
  120.11  imports Main
   121.1 --- a/src/HOL/Nitpick_Examples/Refute_Nits.thy	Thu May 26 16:57:14 2016 +0200
   121.2 +++ b/src/HOL/Nitpick_Examples/Refute_Nits.thy	Thu May 26 17:51:22 2016 +0200
   121.3 @@ -5,7 +5,7 @@
   121.4  Refute examples adapted to Nitpick.
   121.5  *)
   121.6  
   121.7 -section {* Refute Examples Adapted to Nitpick *}
   121.8 +section \<open>Refute Examples Adapted to Nitpick\<close>
   121.9  
  121.10  theory Refute_Nits
  121.11  imports Main
  121.12 @@ -23,9 +23,9 @@
  121.13  nitpick [sat_solver = SAT4J, expect = genuine] 2
  121.14  oops
  121.15  
  121.16 -subsection {* Examples and Test Cases *}
  121.17 +subsection \<open>Examples and Test Cases\<close>
  121.18  
  121.19 -subsubsection {* Propositional logic *}
  121.20 +subsubsection \<open>Propositional logic\<close>
  121.21  
  121.22  lemma "True"
  121.23  nitpick [expect = none]
  121.24 @@ -64,7 +64,7 @@
  121.25  nitpick [expect = genuine]
  121.26  oops
  121.27  
  121.28 -subsubsection {* Predicate logic *}
  121.29 +subsubsection \<open>Predicate logic\<close>
  121.30  
  121.31  lemma "P x y z"
  121.32  nitpick [expect = genuine]
  121.33 @@ -78,7 +78,7 @@
  121.34  nitpick [expect = genuine]
  121.35  oops
  121.36  
  121.37 -subsubsection {* Equality *}
  121.38 +subsubsection \<open>Equality\<close>
  121.39  
  121.40  lemma "P = True"
  121.41  nitpick [expect = genuine]
  121.42 @@ -110,7 +110,7 @@
  121.43  nitpick [expect = genuine]
  121.44  oops
  121.45  
  121.46 -subsubsection {* First-Order Logic *}
  121.47 +subsubsection \<open>First-Order Logic\<close>
  121.48  
  121.49  lemma "\<exists>x. P x"
  121.50  nitpick [expect = genuine]
  121.51 @@ -148,14 +148,14 @@
  121.52  nitpick [expect = genuine]
  121.53  oops
  121.54  
  121.55 -text {* A true statement (also testing names of free and bound variables being identical) *}
  121.56 +text \<open>A true statement (also testing names of free and bound variables being identical)\<close>
  121.57  
  121.58  lemma "(\<forall>x y. P x y \<longrightarrow> P y x) \<longrightarrow> (\<forall>x. P x y) \<longrightarrow> P y x"
  121.59  nitpick [expect = none]
  121.60  apply fast
  121.61  done
  121.62  
  121.63 -text {* "A type has at most 4 elements." *}
  121.64 +text \<open>"A type has at most 4 elements."\<close>
  121.65  
  121.66  lemma "\<not> distinct [a, b, c, d, e]"
  121.67  nitpick [expect = genuine]
  121.68 @@ -169,44 +169,44 @@
  121.69  nitpick [expect = genuine]
  121.70  oops
  121.71  
  121.72 -text {* "Every reflexive and symmetric relation is transitive." *}
  121.73 +text \<open>"Every reflexive and symmetric relation is transitive."\<close>
  121.74  
  121.75  lemma "\<lbrakk>\<forall>x. P x x; \<forall>x y. P x y \<longrightarrow> P y x\<rbrakk> \<Longrightarrow> P x y \<longrightarrow> P y z \<longrightarrow> P x z"
  121.76  nitpick [expect = genuine]
  121.77  oops
  121.78  
  121.79 -text {* The ``Drinker's theorem'' *}
  121.80 +text \<open>The ``Drinker's theorem''\<close>
  121.81  
  121.82  lemma "\<exists>x. f x = g x \<longrightarrow> f = g"
  121.83  nitpick [expect = none]
  121.84  apply (auto simp add: ext)
  121.85  done
  121.86  
  121.87 -text {* And an incorrect version of it *}
  121.88 +text \<open>And an incorrect version of it\<close>
  121.89  
  121.90  lemma "(\<exists>x. f x = g x) \<longrightarrow> f = g"
  121.91  nitpick [expect = genuine]
  121.92  oops
  121.93  
  121.94 -text {* "Every function has a fixed point." *}
  121.95 +text \<open>"Every function has a fixed point."\<close>
  121.96  
  121.97  lemma "\<exists>x. f x = x"
  121.98  nitpick [expect = genuine]
  121.99  oops
 121.100  
 121.101 -text {* "Function composition is commutative." *}
 121.102 +text \<open>"Function composition is commutative."\<close>
 121.103  
 121.104  lemma "f (g x) = g (f x)"
 121.105  nitpick [expect = genuine]
 121.106  oops
 121.107  
 121.108 -text {* "Two functions that are equivalent wrt.\ the same predicate 'P' are equal." *}
 121.109 +text \<open>"Two functions that are equivalent wrt.\ the same predicate 'P' are equal."\<close>
 121.110  
 121.111  lemma "((P::('a\<Rightarrow>'b)\<Rightarrow>bool) f = P g) \<longrightarrow> (f x = g x)"
 121.112  nitpick [expect = genuine]
 121.113  oops
 121.114  
 121.115 -subsubsection {* Higher-Order Logic *}
 121.116 +subsubsection \<open>Higher-Order Logic\<close>
 121.117  
 121.118  lemma "\<exists>P. P"
 121.119  nitpick [expect = none]
 121.120 @@ -242,7 +242,7 @@
 121.121  nitpick [expect = genuine]
 121.122  oops
 121.123  
 121.124 -text {* ``The transitive closure of an arbitrary relation is non-empty.'' *}
 121.125 +text \<open>``The transitive closure of an arbitrary relation is non-empty.''\<close>
 121.126  
 121.127  definition "trans" :: "('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> bool" where
 121.128  "trans P \<equiv> (ALL x y z. P x y \<longrightarrow> P y z \<longrightarrow> P x z)"
 121.129 @@ -259,7 +259,7 @@
 121.130  nitpick [expect = genuine]
 121.131  oops
 121.132  
 121.133 -text {* ``The union of transitive closures is equal to the transitive closure of unions.'' *}
 121.134 +text \<open>``The union of transitive closures is equal to the transitive closure of unions.''\<close>
 121.135  
 121.136  lemma "(\<forall>x y. (P x y \<or> R x y) \<longrightarrow> T x y) \<longrightarrow> trans T \<longrightarrow> (\<forall>Q. (\<forall>x y. (P x y \<or> R x y) \<longrightarrow> Q x y) \<longrightarrow> trans Q \<longrightarrow> subset T Q)
 121.137   \<longrightarrow> trans_closure TP P
 121.138 @@ -268,19 +268,19 @@
 121.139  nitpick [expect = genuine]
 121.140  oops
 121.141  
 121.142 -text {* ``Every surjective function is invertible.'' *}
 121.143 +text \<open>``Every surjective function is invertible.''\<close>
 121.144  
 121.145  lemma "(\<forall>y. \<exists>x. y = f x) \<longrightarrow> (\<exists>g. \<forall>x. g (f x) = x)"
 121.146  nitpick [expect = genuine]
 121.147  oops
 121.148  
 121.149 -text {* ``Every invertible function is surjective.'' *}
 121.150 +text \<open>``Every invertible function is surjective.''\<close>
 121.151  
 121.152  lemma "(\<exists>g. \<forall>x. g (f x) = x) \<longrightarrow> (\<forall>y. \<exists>x. y = f x)"
 121.153  nitpick [expect = genuine]
 121.154  oops
 121.155  
 121.156 -text {* ``Every point is a fixed point of some function.'' *}
 121.157 +text \<open>``Every point is a fixed point of some function.''\<close>
 121.158  
 121.159  lemma "\<exists>f. f x = x"
 121.160  nitpick [card = 1-7, expect = none]
 121.161 @@ -288,13 +288,13 @@
 121.162  apply simp
 121.163  done
 121.164  
 121.165 -text {* Axiom of Choice: first an incorrect version *}
 121.166 +text \<open>Axiom of Choice: first an incorrect version\<close>
 121.167  
 121.168  lemma "(\<forall>x. \<exists>y. P x y) \<longrightarrow> (\<exists>!f. \<forall>x. P x (f x))"
 121.169  nitpick [expect = genuine]
 121.170  oops
 121.171  
 121.172 -text {* And now two correct ones *}
 121.173 +text \<open>And now two correct ones\<close>
 121.174  
 121.175  lemma "(\<forall>x. \<exists>y. P x y) \<longrightarrow> (\<exists>f. \<forall>x. P x (f x))"
 121.176  nitpick [card = 1-4, expect = none]
 121.177 @@ -308,7 +308,7 @@
 121.178  apply (fast intro: ext)
 121.179  done
 121.180  
 121.181 -subsubsection {* Metalogic *}
 121.182 +subsubsection \<open>Metalogic\<close>
 121.183  
 121.184  lemma "\<And>x. P x"
 121.185  nitpick [expect = genuine]
 121.186 @@ -338,7 +338,7 @@
 121.187  nitpick [expect = genuine]
 121.188  oops
 121.189  
 121.190 -subsubsection {* Schematic Variables *}
 121.191 +subsubsection \<open>Schematic Variables\<close>
 121.192  
 121.193  schematic_goal "?P"
 121.194  nitpick [expect = none]
 121.195 @@ -350,7 +350,7 @@
 121.196  apply auto
 121.197  done
 121.198  
 121.199 -subsubsection {* Abstractions *}
 121.200 +subsubsection \<open>Abstractions\<close>
 121.201  
 121.202  lemma "(\<lambda>x. x) = (\<lambda>x. y)"
 121.203  nitpick [expect = genuine]
 121.204 @@ -365,7 +365,7 @@
 121.205  apply simp
 121.206  done
 121.207  
 121.208 -subsubsection {* Sets *}
 121.209 +subsubsection \<open>Sets\<close>
 121.210  
 121.211  lemma "P (A::'a set)"
 121.212  nitpick [expect = genuine]
 121.213 @@ -408,7 +408,7 @@
 121.214  nitpick [expect = genuine]
 121.215  oops
 121.216  
 121.217 -subsubsection {* @{const undefined} *}
 121.218 +subsubsection \<open>@{const undefined}\<close>
 121.219  
 121.220  lemma "undefined"
 121.221  nitpick [expect = genuine]
 121.222 @@ -426,7 +426,7 @@
 121.223  nitpick [expect = genuine]
 121.224  oops
 121.225  
 121.226 -subsubsection {* @{const The} *}
 121.227 +subsubsection \<open>@{const The}\<close>
 121.228  
 121.229  lemma "The P"
 121.230  nitpick [expect = genuine]
 121.231 @@ -448,7 +448,7 @@
 121.232  nitpick [expect = genuine]
 121.233  oops
 121.234  
 121.235 -subsubsection {* @{const Eps} *}
 121.236 +subsubsection \<open>@{const Eps}\<close>
 121.237  
 121.238  lemma "Eps P"
 121.239  nitpick [expect = genuine]
 121.240 @@ -471,7 +471,7 @@
 121.241  apply (auto simp add: someI)
 121.242  done
 121.243  
 121.244 -subsubsection {* Operations on Natural Numbers *}
 121.245 +subsubsection \<open>Operations on Natural Numbers\<close>
 121.246  
 121.247  lemma "(x::nat) + y = 0"
 121.248  nitpick [expect = genuine]
 121.249 @@ -493,7 +493,7 @@
 121.250  nitpick [card = 1, expect = genuine]
 121.251  oops
 121.252  
 121.253 -text {* \<times> *}
 121.254 +text \<open>\<times>\<close>
 121.255  
 121.256  lemma "P (x::'a\<times>'b)"
 121.257  nitpick [expect = genuine]
 121.258 @@ -523,9 +523,9 @@
 121.259  nitpick [expect = genuine]
 121.260  oops
 121.261  
 121.262 -subsubsection {* Subtypes (typedef), typedecl *}
 121.263 +subsubsection \<open>Subtypes (typedef), typedecl\<close>
 121.264  
 121.265 -text {* A completely unspecified non-empty subset of @{typ "'a"}: *}
 121.266 +text \<open>A completely unspecified non-empty subset of @{typ "'a"}:\<close>
 121.267  
 121.268  definition "myTdef = insert (undefined::'a) (undefined::'a set)"
 121.269  
 121.270 @@ -547,9 +547,9 @@
 121.271  nitpick [expect = genuine]
 121.272  oops
 121.273  
 121.274 -subsubsection {* Inductive Datatypes *}
 121.275 +subsubsection \<open>Inductive Datatypes\<close>
 121.276  
 121.277 -text {* unit *}
 121.278 +text \<open>unit\<close>
 121.279  
 121.280  lemma "P (x::unit)"
 121.281  nitpick [expect = genuine]
 121.282 @@ -567,7 +567,7 @@
 121.283  nitpick [expect = genuine]
 121.284  oops
 121.285  
 121.286 -text {* option *}
 121.287 +text \<open>option\<close>
 121.288  
 121.289  lemma "P (x::'a option)"
 121.290  nitpick [expect = genuine]
 121.291 @@ -589,7 +589,7 @@
 121.292  nitpick [expect = genuine]
 121.293  oops
 121.294  
 121.295 -text {* + *}
 121.296 +text \<open>+\<close>
 121.297  
 121.298  lemma "P (x::'a+'b)"
 121.299  nitpick [expect = genuine]
 121.300 @@ -615,7 +615,7 @@
 121.301  nitpick [expect = genuine]
 121.302  oops
 121.303  
 121.304 -text {* Non-recursive datatypes *}
 121.305 +text \<open>Non-recursive datatypes\<close>
 121.306  
 121.307  datatype T1 = A | B
 121.308  
 121.309 @@ -712,9 +712,9 @@
 121.310  nitpick [expect = genuine]
 121.311  oops
 121.312  
 121.313 -text {* Recursive datatypes *}
 121.314 +text \<open>Recursive datatypes\<close>
 121.315  
 121.316 -text {* nat *}
 121.317 +text \<open>nat\<close>
 121.318  
 121.319  lemma "P (x::nat)"
 121.320  nitpick [expect = genuine]
 121.321 @@ -750,7 +750,7 @@
 121.322  nitpick [expect = genuine]
 121.323  oops
 121.324  
 121.325 -text {* 'a list *}
 121.326 +text \<open>'a list\<close>
 121.327  
 121.328  lemma "P (xs::'a list)"
 121.329  nitpick [expect = genuine]
 121.330 @@ -855,7 +855,7 @@
 121.331  nitpick [expect = genuine]
 121.332  oops
 121.333  
 121.334 -text {* Mutually recursive datatypes *}
 121.335 +text \<open>Mutually recursive datatypes\<close>
 121.336  
 121.337  datatype 'a aexp = Number 'a | ITE "'a bexp" "'a aexp" "'a aexp"
 121.338   and 'a bexp = Equal "'a aexp" "'a aexp"
 121.339 @@ -995,9 +995,9 @@
 121.340  nitpick [expect = genuine]
 121.341  oops
 121.342  
 121.343 -text {* Other datatype examples *}
 121.344 +text \<open>Other datatype examples\<close>
 121.345  
 121.346 -text {* Indirect recursion is implemented via mutual recursion. *}
 121.347 +text \<open>Indirect recursion is implemented via mutual recursion.\<close>
 121.348  
 121.349  datatype XOpt = CX "XOpt option" | DX "bool \<Rightarrow> XOpt option"
 121.350  
 121.351 @@ -1107,7 +1107,7 @@
 121.352  nitpick [expect = genuine]
 121.353  oops
 121.354  
 121.355 -text {* Taken from "Inductive datatypes in HOL", p. 8: *}
 121.356 +text \<open>Taken from "Inductive datatypes in HOL", p. 8:\<close>
 121.357  
 121.358  datatype (dead 'a, 'b) T = C "'a \<Rightarrow> bool" | D "'b list"
 121.359  datatype 'c U = E "('c, 'c U) T"
 121.360 @@ -1124,7 +1124,7 @@
 121.361  nitpick [expect = genuine]
 121.362  oops
 121.363  
 121.364 -subsubsection {* Records *}
 121.365 +subsubsection \<open>Records\<close>
 121.366  
 121.367  record ('a, 'b) point =
 121.368    xpos :: 'a
 121.369 @@ -1141,7 +1141,7 @@
 121.370  nitpick [expect = genuine]
 121.371  oops
 121.372  
 121.373 -subsubsection {* Inductively Defined Sets *}
 121.374 +subsubsection \<open>Inductively Defined Sets\<close>
 121.375  
 121.376  inductive_set undefinedSet :: "'a set" where
 121.377  "undefined \<in> undefinedSet"
 121.378 @@ -1182,7 +1182,7 @@
 121.379  nitpick [expect = genuine]
 121.380  oops
 121.381  
 121.382 -subsubsection {* Examples Involving Special Functions *}
 121.383 +subsubsection \<open>Examples Involving Special Functions\<close>
 121.384  
 121.385  lemma "card x = 0"
 121.386  nitpick [expect = genuine]
 121.387 @@ -1212,9 +1212,9 @@
 121.388  nitpick [card = 2, expect = genuine]
 121.389  oops
 121.390  
 121.391 -subsubsection {* Axiomatic Type Classes and Overloading *}
 121.392 +subsubsection \<open>Axiomatic Type Classes and Overloading\<close>
 121.393  
 121.394 -text {* A type class without axioms: *}
 121.395 +text \<open>A type class without axioms:\<close>
 121.396  
 121.397  class classA
 121.398  
 121.399 @@ -1222,7 +1222,7 @@
 121.400  nitpick [expect = genuine]
 121.401  oops
 121.402  
 121.403 -text {* An axiom with a type variable (denoting types which have at least two elements): *}
 121.404 +text \<open>An axiom with a type variable (denoting types which have at least two elements):\<close>
 121.405  
 121.406  class classC =
 121.407    assumes classC_ax: "\<exists>x y. x \<noteq> y"
 121.408 @@ -1235,7 +1235,7 @@
 121.409  nitpick [expect = none]
 121.410  sorry
 121.411  
 121.412 -text {* A type class for which a constant is defined: *}
 121.413 +text \<open>A type class for which a constant is defined:\<close>
 121.414  
 121.415  class classD =
 121.416    fixes classD_const :: "'a \<Rightarrow> 'a"
 121.417 @@ -1245,7 +1245,7 @@
 121.418  nitpick [expect = genuine]
 121.419  oops
 121.420  
 121.421 -text {* A type class with multiple superclasses: *}
 121.422 +text \<open>A type class with multiple superclasses:\<close>
 121.423  
 121.424  class classE = classC + classD
 121.425  
 121.426 @@ -1253,7 +1253,7 @@
 121.427  nitpick [expect = genuine]
 121.428  oops
 121.429  
 121.430 -text {* OFCLASS: *}
 121.431 +text \<open>OFCLASS:\<close>
 121.432  
 121.433  lemma "OFCLASS('a::type, type_class)"
 121.434  nitpick [expect = none]
 121.435 @@ -1269,7 +1269,7 @@
 121.436  nitpick [expect = genuine]
 121.437  oops
 121.438  
 121.439 -text {* Overloading: *}
 121.440 +text \<open>Overloading:\<close>
 121.441  
 121.442  consts inverse :: "'a \<Rightarrow> 'a"
 121.443  
   122.1 --- a/src/HOL/Nitpick_Examples/Special_Nits.thy	Thu May 26 16:57:14 2016 +0200
   122.2 +++ b/src/HOL/Nitpick_Examples/Special_Nits.thy	Thu May 26 17:51:22 2016 +0200
   122.3 @@ -5,7 +5,7 @@
   122.4  Examples featuring Nitpick's "specialize" optimization.
   122.5  *)
   122.6  
   122.7 -section {* Examples Featuring Nitpick's \textit{specialize} Optimization *}
   122.8 +section \<open>Examples Featuring Nitpick's \textit{specialize} Optimization\<close>
   122.9  
  122.10  theory Special_Nits
  122.11  imports Main
   123.1 --- a/src/HOL/Nitpick_Examples/Tests_Nits.thy	Thu May 26 16:57:14 2016 +0200
   123.2 +++ b/src/HOL/Nitpick_Examples/Tests_Nits.thy	Thu May 26 17:51:22 2016 +0200
   123.3 @@ -5,12 +5,12 @@
   123.4  Nitpick tests.
   123.5  *)
   123.6  
   123.7 -section {* Nitpick Tests *}
   123.8 +section \<open>Nitpick Tests\<close>
   123.9  
  123.10  theory Tests_Nits
  123.11  imports Main
  123.12  begin
  123.13  
  123.14 -ML {* () |> getenv "KODKODI" <> "" ? Nitpick_Tests.run_all_tests *}
  123.15 +ML \<open>() |> getenv "KODKODI" <> "" ? Nitpick_Tests.run_all_tests\<close>
  123.16  
  123.17  end
   124.1 --- a/src/HOL/Nitpick_Examples/Typedef_Nits.thy	Thu May 26 16:57:14 2016 +0200
   124.2 +++ b/src/HOL/Nitpick_Examples/Typedef_Nits.thy	Thu May 26 17:51:22 2016 +0200
   124.3 @@ -5,7 +5,7 @@
   124.4  Examples featuring Nitpick applied to typedefs.
   124.5  *)
   124.6  
   124.7 -section {* Examples Featuring Nitpick Applied to Typedefs *}
   124.8 +section \<open>Examples Featuring Nitpick Applied to Typedefs\<close>
   124.9  
  124.10  theory Typedef_Nits
  124.11  imports Complex_Main
   125.1 --- a/src/HOL/Nominal/Examples/CK_Machine.thy	Thu May 26 16:57:14 2016 +0200
   125.2 +++ b/src/HOL/Nominal/Examples/CK_Machine.thy	Thu May 26 17:51:22 2016 +0200
   125.3 @@ -2,7 +2,7 @@
   125.4    imports "../Nominal" 
   125.5  begin
   125.6  
   125.7 -text {* 
   125.8 +text \<open>
   125.9    
  125.10    This theory establishes soundness and completeness for a CK-machine
  125.11    with respect to a cbv-big-step semantics. The language includes 
  125.12 @@ -19,7 +19,7 @@
  125.13       @{url "http://www.cs.indiana.edu/~rpjames/lm.pdf"}
  125.14       @{url "http://www.cl.cam.ac.uk/teaching/2001/Semantics/"}
  125.15  
  125.16 -*}
  125.17 +\<close>
  125.18  
  125.19  atom_decl name
  125.20  
  125.21 @@ -37,7 +37,7 @@
  125.22  | ZET "lam"                      (* zero test *)
  125.23  | EQI "lam" "lam"                (* equality test on numbers *)
  125.24  
  125.25 -section {* Capture-Avoiding Substitution *}
  125.26 +section \<open>Capture-Avoiding Substitution\<close>
  125.27  
  125.28  nominal_primrec
  125.29    subst :: "lam \<Rightarrow> name \<Rightarrow> lam \<Rightarrow> lam"  ("_[_::=_]" [100,100,100] 100)
  125.30 @@ -79,7 +79,7 @@
  125.31  by (nominal_induct t avoiding: x y s rule: lam.strong_induct)
  125.32     (auto simp add: calc_atm fresh_atm abs_fresh perm_nat_def)
  125.33  
  125.34 -section {* Evaluation Contexts *}
  125.35 +section \<open>Evaluation Contexts\<close>
  125.36</