isabelle update -u control_cartouches;
authorwenzelm
Fri, 04 Jan 2019 23:22:53 +0100
changeset 69593 3dda49e08b9d
parent 69592 a80d8ec6c998
child 69594 1d340f7f8dce
isabelle update -u control_cartouches;
src/CCL/CCL.thy
src/CCL/Term.thy
src/CCL/Type.thy
src/CCL/Wfd.thy
src/CCL/ex/Stream.thy
src/CTT/CTT.thy
src/CTT/ex/Elimination.thy
src/CTT/ex/Equality.thy
src/CTT/ex/Synthesis.thy
src/Cube/Cube.thy
src/Doc/Isar_Ref/First_Order_Logic.thy
src/Doc/Logics_ZF/IFOL_examples.thy
src/Doc/Logics_ZF/ZF_Isar.thy
src/Doc/System/Environment.thy
src/Doc/System/Server.thy
src/Doc/System/Sessions.thy
src/Doc/antiquote_setup.ML
src/FOL/FOL.thy
src/FOL/IFOL.thy
src/FOL/ex/Intuitionistic.thy
src/FOL/ex/Locale_Test/Locale_Test1.thy
src/FOL/ex/Miniscope.thy
src/FOL/ex/Prolog.thy
src/FOL/ex/Propositional_Cla.thy
src/FOL/ex/Propositional_Int.thy
src/FOL/ex/Quantifiers_Int.thy
src/FOL/fologic.ML
src/FOL/simpdata.ML
src/FOLP/FOLP.thy
src/FOLP/IFOLP.thy
src/FOLP/ex/Classical.thy
src/FOLP/ex/If.thy
src/FOLP/ex/Intro.thy
src/FOLP/ex/Intuitionistic.thy
src/FOLP/ex/Nat.thy
src/FOLP/ex/Propositional_Cla.thy
src/FOLP/ex/Propositional_Int.thy
src/FOLP/ex/Quantifiers_Cla.thy
src/FOLP/ex/Quantifiers_Int.thy
src/FOLP/hypsubst.ML
src/FOLP/simp.ML
src/FOLP/simpdata.ML
src/HOL/BNF_Wellorder_Relation.thy
src/HOL/Binomial.thy
src/HOL/Code_Numeral.thy
src/HOL/Complete_Lattices.thy
src/HOL/Complete_Partial_Order.thy
src/HOL/Conditionally_Complete_Lattices.thy
src/HOL/Deriv.thy
src/HOL/Divides.thy
src/HOL/Eisbach/Eisbach_Tools.thy
src/HOL/Eisbach/eisbach_rule_insts.ML
src/HOL/Eisbach/match_method.ML
src/HOL/Eisbach/method_closure.ML
src/HOL/Enum.thy
src/HOL/Euclidean_Division.thy
src/HOL/Extraction.thy
src/HOL/Fields.thy
src/HOL/Filter.thy
src/HOL/Finite_Set.thy
src/HOL/Fun.thy
src/HOL/GCD.thy
src/HOL/Groebner_Basis.thy
src/HOL/Groups.thy
src/HOL/Groups_Big.thy
src/HOL/Groups_List.thy
src/HOL/HOL.thy
src/HOL/Hilbert_Choice.thy
src/HOL/Inductive.thy
src/HOL/Int.thy
src/HOL/Isar_Examples/Higher_Order_Logic.thy
src/HOL/Lattices.thy
src/HOL/Lattices_Big.thy
src/HOL/Library/AList.thy
src/HOL/Library/Bit.thy
src/HOL/Library/Cancellation/cancel.ML
src/HOL/Library/Cancellation/cancel_data.ML
src/HOL/Library/Cancellation/cancel_simprocs.ML
src/HOL/Library/Cardinality.thy
src/HOL/Library/Code_Abstract_Nat.thy
src/HOL/Library/Code_Binary_Nat.thy
src/HOL/Library/Code_Lazy.thy
src/HOL/Library/Code_Prolog.thy
src/HOL/Library/Code_Target_Nat.thy
src/HOL/Library/Code_Test.thy
src/HOL/Library/Complete_Partial_Order2.thy
src/HOL/Library/Countable.thy
src/HOL/Library/Countable_Set_Type.thy
src/HOL/Library/DAList_Multiset.thy
src/HOL/Library/Disjoint_Sets.thy
src/HOL/Library/Dlist.thy
src/HOL/Library/Extended_Nat.thy
src/HOL/Library/Extended_Nonnegative_Real.thy
src/HOL/Library/Extended_Real.thy
src/HOL/Library/FSet.thy
src/HOL/Library/Finite_Lattice.thy
src/HOL/Library/Finite_Map.thy
src/HOL/Library/Float.thy
src/HOL/Library/FuncSet.thy
src/HOL/Library/Function_Division.thy
src/HOL/Library/Going_To_Filter.thy
src/HOL/Library/IArray.thy
src/HOL/Library/Infinite_Set.thy
src/HOL/Library/LaTeXsugar.thy
src/HOL/Library/Lub_Glb.thy
src/HOL/Library/Monad_Syntax.thy
src/HOL/Library/Multiset.thy
src/HOL/Library/Nat_Bijection.thy
src/HOL/Library/Nonpos_Ints.thy
src/HOL/Library/Numeral_Type.thy
src/HOL/Library/Open_State_Syntax.thy
src/HOL/Library/Pattern_Aliases.thy
src/HOL/Library/Periodic_Fun.thy
src/HOL/Library/Phantom_Type.thy
src/HOL/Library/Predicate_Compile_Alternative_Defs.thy
src/HOL/Library/Quotient_Type.thy
src/HOL/Library/RBT_Impl.thy
src/HOL/Library/RBT_Mapping.thy
src/HOL/Library/Ramsey.thy
src/HOL/Library/Sum_of_Squares/sos_wrapper.ML
src/HOL/Library/Tree.thy
src/HOL/Library/Tree_Multiset.thy
src/HOL/Library/Tree_Real.thy
src/HOL/Library/Type_Length.thy
src/HOL/Library/While_Combinator.thy
src/HOL/Library/adhoc_overloading.ML
src/HOL/Library/case_converter.ML
src/HOL/Library/cconv.ML
src/HOL/Library/code_lazy.ML
src/HOL/Library/code_test.ML
src/HOL/Library/conditional_parametricity.ML
src/HOL/Library/datatype_records.ML
src/HOL/Library/multiset_simprocs.ML
src/HOL/Library/old_recdef.ML
src/HOL/Library/positivstellensatz.ML
src/HOL/Library/refute.ML
src/HOL/Library/rewrite.ML
src/HOL/Library/simps_case_conv.ML
src/HOL/Limits.thy
src/HOL/List.thy
src/HOL/Map.thy
src/HOL/Meson.thy
src/HOL/Nat.thy
src/HOL/Nitpick.thy
src/HOL/Num.thy
src/HOL/Numeral_Simprocs.thy
src/HOL/Orderings.thy
src/HOL/Parity.thy
src/HOL/Partial_Function.thy
src/HOL/Power.thy
src/HOL/Predicate_Compile.thy
src/HOL/Presburger.thy
src/HOL/Product_Type.thy
src/HOL/Quickcheck_Narrowing.thy
src/HOL/Quickcheck_Random.thy
src/HOL/Rat.thy
src/HOL/Real.thy
src/HOL/Real_Vector_Spaces.thy
src/HOL/Relation.thy
src/HOL/Rings.thy
src/HOL/Semiring_Normalization.thy
src/HOL/Series.thy
src/HOL/Set.thy
src/HOL/Set_Interval.thy
src/HOL/String.thy
src/HOL/TPTP/TPTP_Parser/tptp_syntax.ML
src/HOL/Tools/ATP/atp_problem_generate.ML
src/HOL/Tools/ATP/atp_proof_reconstruct.ML
src/HOL/Tools/ATP/atp_satallax.ML
src/HOL/Tools/ATP/atp_systems.ML
src/HOL/Tools/ATP/atp_util.ML
src/HOL/Tools/ATP/atp_waldmeister.ML
src/HOL/Tools/BNF/bnf_axiomatization.ML
src/HOL/Tools/BNF/bnf_comp.ML
src/HOL/Tools/BNF/bnf_def.ML
src/HOL/Tools/BNF/bnf_fp_def_sugar.ML
src/HOL/Tools/BNF/bnf_fp_def_sugar_tactics.ML
src/HOL/Tools/BNF/bnf_fp_n2m.ML
src/HOL/Tools/BNF/bnf_fp_n2m_sugar.ML
src/HOL/Tools/BNF/bnf_fp_rec_sugar_transfer.ML
src/HOL/Tools/BNF/bnf_fp_rec_sugar_util.ML
src/HOL/Tools/BNF/bnf_fp_util.ML
src/HOL/Tools/BNF/bnf_gfp.ML
src/HOL/Tools/BNF/bnf_gfp_grec.ML
src/HOL/Tools/BNF/bnf_gfp_grec_sugar.ML
src/HOL/Tools/BNF/bnf_gfp_grec_sugar_tactics.ML
src/HOL/Tools/BNF/bnf_gfp_grec_sugar_util.ML
src/HOL/Tools/BNF/bnf_gfp_grec_tactics.ML
src/HOL/Tools/BNF/bnf_gfp_grec_unique_sugar.ML
src/HOL/Tools/BNF/bnf_gfp_rec_sugar.ML
src/HOL/Tools/BNF/bnf_gfp_rec_sugar_tactics.ML
src/HOL/Tools/BNF/bnf_gfp_util.ML
src/HOL/Tools/BNF/bnf_lfp.ML
src/HOL/Tools/BNF/bnf_lfp_basic_sugar.ML
src/HOL/Tools/BNF/bnf_lfp_compat.ML
src/HOL/Tools/BNF/bnf_lfp_countable.ML
src/HOL/Tools/BNF/bnf_lfp_rec_sugar.ML
src/HOL/Tools/BNF/bnf_lfp_rec_sugar_more.ML
src/HOL/Tools/BNF/bnf_lfp_size.ML
src/HOL/Tools/BNF/bnf_lfp_util.ML
src/HOL/Tools/BNF/bnf_lift.ML
src/HOL/Tools/BNF/bnf_tactics.ML
src/HOL/Tools/BNF/bnf_util.ML
src/HOL/Tools/Ctr_Sugar/case_translation.ML
src/HOL/Tools/Ctr_Sugar/ctr_sugar.ML
src/HOL/Tools/Ctr_Sugar/ctr_sugar_code.ML
src/HOL/Tools/Ctr_Sugar/ctr_sugar_util.ML
src/HOL/Tools/Function/function_lib.ML
src/HOL/Tools/Function/lexicographic_order.ML
src/HOL/Tools/Function/partial_function.ML
src/HOL/Tools/Function/scnp_reconstruct.ML
src/HOL/Tools/Function/sum_tree.ML
src/HOL/Tools/Lifting/lifting_bnf.ML
src/HOL/Tools/Lifting/lifting_def.ML
src/HOL/Tools/Lifting/lifting_def_code_dt.ML
src/HOL/Tools/Lifting/lifting_info.ML
src/HOL/Tools/Lifting/lifting_setup.ML
src/HOL/Tools/Lifting/lifting_term.ML
src/HOL/Tools/Lifting/lifting_util.ML
src/HOL/Tools/Meson/meson.ML
src/HOL/Tools/Meson/meson_clausify.ML
src/HOL/Tools/Metis/metis_generate.ML
src/HOL/Tools/Metis/metis_reconstruct.ML
src/HOL/Tools/Metis/metis_tactic.ML
src/HOL/Tools/Nitpick/nitpick.ML
src/HOL/Tools/Nitpick/nitpick_commands.ML
src/HOL/Tools/Nitpick/nitpick_hol.ML
src/HOL/Tools/Nitpick/nitpick_kodkod.ML
src/HOL/Tools/Nitpick/nitpick_model.ML
src/HOL/Tools/Nitpick/nitpick_mono.ML
src/HOL/Tools/Nitpick/nitpick_nut.ML
src/HOL/Tools/Nitpick/nitpick_preproc.ML
src/HOL/Tools/Nitpick/nitpick_rep.ML
src/HOL/Tools/Nitpick/nitpick_scope.ML
src/HOL/Tools/Nitpick/nitpick_tests.ML
src/HOL/Tools/Nitpick/nitpick_util.ML
src/HOL/Tools/Nunchaku/nunchaku.ML
src/HOL/Tools/Nunchaku/nunchaku_collect.ML
src/HOL/Tools/Nunchaku/nunchaku_commands.ML
src/HOL/Tools/Nunchaku/nunchaku_reconstruct.ML
src/HOL/Tools/Nunchaku/nunchaku_translate.ML
src/HOL/Tools/Nunchaku/nunchaku_util.ML
src/HOL/Tools/Old_Datatype/old_datatype_aux.ML
src/HOL/Tools/Old_Datatype/old_datatype_data.ML
src/HOL/Tools/Old_Datatype/old_datatype_prop.ML
src/HOL/Tools/Old_Datatype/old_primrec.ML
src/HOL/Tools/Old_Datatype/old_rep_datatype.ML
src/HOL/Tools/Predicate_Compile/code_prolog.ML
src/HOL/Tools/Predicate_Compile/core_data.ML
src/HOL/Tools/Predicate_Compile/mode_inference.ML
src/HOL/Tools/Predicate_Compile/predicate_compile.ML
src/HOL/Tools/Predicate_Compile/predicate_compile_aux.ML
src/HOL/Tools/Predicate_Compile/predicate_compile_compilations.ML
src/HOL/Tools/Predicate_Compile/predicate_compile_core.ML
src/HOL/Tools/Predicate_Compile/predicate_compile_data.ML
src/HOL/Tools/Predicate_Compile/predicate_compile_fun.ML
src/HOL/Tools/Predicate_Compile/predicate_compile_pred.ML
src/HOL/Tools/Predicate_Compile/predicate_compile_proof.ML
src/HOL/Tools/Predicate_Compile/predicate_compile_quickcheck.ML
src/HOL/Tools/Predicate_Compile/predicate_compile_specialisation.ML
src/HOL/Tools/Qelim/cooper.ML
src/HOL/Tools/Qelim/qelim.ML
src/HOL/Tools/Quickcheck/random_generators.ML
src/HOL/Tools/Quotient/quotient_def.ML
src/HOL/Tools/Quotient/quotient_info.ML
src/HOL/Tools/Quotient/quotient_tacs.ML
src/HOL/Tools/Quotient/quotient_term.ML
src/HOL/Tools/Quotient/quotient_type.ML
src/HOL/Tools/SMT/conj_disj_perm.ML
src/HOL/Tools/SMT/smt_normalize.ML
src/HOL/Tools/SMT/smt_real.ML
src/HOL/Tools/SMT/smt_replay.ML
src/HOL/Tools/SMT/smt_replay_methods.ML
src/HOL/Tools/SMT/smt_solver.ML
src/HOL/Tools/SMT/smt_systems.ML
src/HOL/Tools/SMT/smt_util.ML
src/HOL/Tools/SMT/smtlib_interface.ML
src/HOL/Tools/SMT/smtlib_proof.ML
src/HOL/Tools/SMT/verit_proof.ML
src/HOL/Tools/SMT/verit_replay.ML
src/HOL/Tools/SMT/verit_replay_methods.ML
src/HOL/Tools/SMT/z3_interface.ML
src/HOL/Tools/SMT/z3_isar.ML
src/HOL/Tools/SMT/z3_proof.ML
src/HOL/Tools/SMT/z3_real.ML
src/HOL/Tools/SMT/z3_replay.ML
src/HOL/Tools/SMT/z3_replay_methods.ML
src/HOL/Tools/Sledgehammer/sledgehammer_commands.ML
src/HOL/Tools/Sledgehammer/sledgehammer_fact.ML
src/HOL/Tools/Sledgehammer/sledgehammer_isar.ML
src/HOL/Tools/Sledgehammer/sledgehammer_isar_preplay.ML
src/HOL/Tools/Sledgehammer/sledgehammer_mash.ML
src/HOL/Tools/Sledgehammer/sledgehammer_mepo.ML
src/HOL/Tools/Sledgehammer/sledgehammer_prover_atp.ML
src/HOL/Tools/Sledgehammer/sledgehammer_prover_minimize.ML
src/HOL/Tools/Sledgehammer/sledgehammer_prover_smt.ML
src/HOL/Tools/Transfer/transfer.ML
src/HOL/Tools/Transfer/transfer_bnf.ML
src/HOL/Tools/datatype_realizer.ML
src/HOL/Tools/functor.ML
src/HOL/Tools/groebner.ML
src/HOL/Tools/hologic.ML
src/HOL/Tools/inductive.ML
src/HOL/Tools/inductive_realizer.ML
src/HOL/Tools/inductive_set.ML
src/HOL/Tools/int_arith.ML
src/HOL/Tools/lambda_lifting.ML
src/HOL/Tools/lin_arith.ML
src/HOL/Tools/literal.ML
src/HOL/Tools/nat_numeral_simprocs.ML
src/HOL/Tools/numeral.ML
src/HOL/Tools/numeral_simprocs.ML
src/HOL/Tools/prop_logic.ML
src/HOL/Tools/record.ML
src/HOL/Tools/reflection.ML
src/HOL/Tools/reification.ML
src/HOL/Tools/rewrite_hol_proof.ML
src/HOL/Tools/sat.ML
src/HOL/Tools/semiring_normalizer.ML
src/HOL/Tools/set_comprehension_pointfree.ML
src/HOL/Tools/simpdata.ML
src/HOL/Tools/string_syntax.ML
src/HOL/Tools/try0.ML
src/HOL/Topological_Spaces.thy
src/HOL/Transcendental.thy
src/HOL/Transfer.thy
src/HOL/Transitive_Closure.thy
src/HOL/Typerep.thy
src/HOL/Vector_Spaces.thy
src/HOL/Wellfounded.thy
src/HOL/Wfrec.thy
src/HOL/Zorn.thy
src/Provers/Arith/cancel_div_mod.ML
src/Provers/blast.ML
src/Provers/clasimp.ML
src/Provers/classical.ML
src/Provers/hypsubst.ML
src/Provers/splitter.ML
src/Sequents/ILL.thy
src/Sequents/LK.thy
src/Sequents/LK0.thy
src/Sequents/Modal0.thy
src/Sequents/S43.thy
src/Sequents/Sequents.thy
src/Sequents/modal.ML
src/Sequents/prover.ML
src/Sequents/simpdata.ML
src/Tools/Code/code_haskell.ML
src/Tools/Code/code_preproc.ML
src/Tools/Code/code_printer.ML
src/Tools/Code/code_runtime.ML
src/Tools/Code/code_simp.ML
src/Tools/Code/code_target.ML
src/Tools/Code/code_thingol.ML
src/Tools/Spec_Check/Examples.thy
src/Tools/Spec_Check/spec_check.ML
src/Tools/induct.ML
src/Tools/misc_legacy.ML
src/Tools/nbe.ML
src/Tools/solve_direct.ML
src/Tools/try.ML
src/ZF/Arith.thy
src/ZF/ArithSimp.thy
src/ZF/Bin.thy
src/ZF/Cardinal.thy
src/ZF/CardinalArith.thy
src/ZF/Cardinal_AC.thy
src/ZF/Constructible/AC_in_L.thy
src/ZF/Constructible/DPow_absolute.thy
src/ZF/Constructible/Datatype_absolute.thy
src/ZF/Constructible/Formula.thy
src/ZF/Constructible/Internalize.thy
src/ZF/Constructible/L_axioms.thy
src/ZF/Constructible/Normal.thy
src/ZF/Constructible/Rank.thy
src/ZF/Constructible/Rank_Separation.thy
src/ZF/Constructible/Rec_Separation.thy
src/ZF/Constructible/Reflection.thy
src/ZF/Constructible/Relative.thy
src/ZF/Constructible/Satisfies_absolute.thy
src/ZF/Constructible/Separation.thy
src/ZF/Constructible/WF_absolute.thy
src/ZF/Constructible/WFrec.thy
src/ZF/Constructible/Wellorderings.thy
src/ZF/Datatype.thy
src/ZF/Epsilon.thy
src/ZF/EquivClass.thy
src/ZF/Fixedpt.thy
src/ZF/Induct/Acc.thy
src/ZF/Induct/Binary_Trees.thy
src/ZF/Induct/Comb.thy
src/ZF/Induct/Datatypes.thy
src/ZF/Induct/FoldSet.thy
src/ZF/Induct/Multiset.thy
src/ZF/Induct/Ntree.thy
src/ZF/Induct/Primrec.thy
src/ZF/Induct/PropLog.thy
src/ZF/Induct/Term.thy
src/ZF/Induct/Tree_Forest.thy
src/ZF/Inductive.thy
src/ZF/Int.thy
src/ZF/IntDiv.thy
src/ZF/Nat.thy
src/ZF/OrdQuant.thy
src/ZF/OrderArith.thy
src/ZF/OrderType.thy
src/ZF/Ordinal.thy
src/ZF/Perm.thy
src/ZF/Sum.thy
src/ZF/Tools/cartprod.ML
src/ZF/Tools/datatype_package.ML
src/ZF/Tools/ind_cases.ML
src/ZF/Tools/induct_tacs.ML
src/ZF/Tools/inductive_package.ML
src/ZF/Tools/numeral_syntax.ML
src/ZF/Tools/primrec_package.ML
src/ZF/Tools/typechk.ML
src/ZF/UNITY/AllocBase.thy
src/ZF/UNITY/AllocImpl.thy
src/ZF/UNITY/Constrains.thy
src/ZF/UNITY/SubstAx.thy
src/ZF/UNITY/UNITY.thy
src/ZF/Univ.thy
src/ZF/WF.thy
src/ZF/ZF.thy
src/ZF/ZF_Base.thy
src/ZF/Zorn.thy
src/ZF/arith_data.ML
src/ZF/equalities.thy
src/ZF/ex/CoUnit.thy
src/ZF/ex/Group.thy
src/ZF/ex/Primes.thy
src/ZF/func.thy
src/ZF/ind_syntax.ML
src/ZF/int_arith.ML
src/ZF/pair.thy
src/ZF/simpdata.ML
src/ZF/upair.thy
--- a/src/CCL/CCL.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/CCL/CCL.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -267,10 +267,10 @@
 val ccl_dstncts =
   let
     fun mk_raw_dstnct_thm rls s =
-      Goal.prove_global @{theory} [] [] (Syntax.read_prop_global @{theory} s)
+      Goal.prove_global \<^theory> [] [] (Syntax.read_prop_global \<^theory> s)
         (fn {context = ctxt, ...} => resolve_tac ctxt @{thms notI} 1 THEN eresolve_tac ctxt rls 1)
   in map (mk_raw_dstnct_thm caseB_lemmas)
-    (mk_dstnct_rls @{theory} ["bot","true","false","pair","lambda"]) end
+    (mk_dstnct_rls \<^theory> ["bot","true","false","pair","lambda"]) end
 
 fun mk_dstnct_thms ctxt defs inj_rls xs =
   let
--- a/src/CCL/Term.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/CCL/Term.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -79,30 +79,30 @@
 (* FIXME does not handle "_idtdummy" *)
 (* FIXME should use Syntax_Trans.mark_bound, Syntax_Trans.variant_abs' *)
 
-fun let_tr [Free x, a, b] = Const(@{const_syntax let},dummyT) $ a $ absfree x b;
+fun let_tr [Free x, a, b] = Const(\<^const_syntax>\<open>let\<close>,dummyT) $ a $ absfree x b;
 fun let_tr' [a,Abs(id,T,b)] =
      let val (id',b') = Syntax_Trans.variant_abs(id,T,b)
-     in Const(@{syntax_const "_let"},dummyT) $ Free(id',T) $ a $ b' end;
+     in Const(\<^syntax_const>\<open>_let\<close>,dummyT) $ Free(id',T) $ a $ b' end;
 
 fun letrec_tr [Free f, Free x, a, b] =
-      Const(@{const_syntax letrec}, dummyT) $ absfree x (absfree f a) $ absfree f b;
+      Const(\<^const_syntax>\<open>letrec\<close>, dummyT) $ absfree x (absfree f a) $ absfree f b;
 fun letrec2_tr [Free f, Free x, Free y, a, b] =
-      Const(@{const_syntax letrec2}, dummyT) $ absfree x (absfree y (absfree f a)) $ absfree f b;
+      Const(\<^const_syntax>\<open>letrec2\<close>, dummyT) $ absfree x (absfree y (absfree f a)) $ absfree f b;
 fun letrec3_tr [Free f, Free x, Free y, Free z, a, b] =
-      Const(@{const_syntax letrec3}, dummyT) $
+      Const(\<^const_syntax>\<open>letrec3\<close>, dummyT) $
         absfree x (absfree y (absfree z (absfree f a))) $ absfree f b;
 
 fun letrec_tr' [Abs(x,T,Abs(f,S,a)),Abs(ff,SS,b)] =
      let val (f',b') = Syntax_Trans.variant_abs(ff,SS,b)
          val (_,a'') = Syntax_Trans.variant_abs(f,S,a)
          val (x',a') = Syntax_Trans.variant_abs(x,T,a'')
-     in Const(@{syntax_const "_letrec"},dummyT) $ Free(f',SS) $ Free(x',T) $ a' $ b' end;
+     in Const(\<^syntax_const>\<open>_letrec\<close>,dummyT) $ Free(f',SS) $ Free(x',T) $ a' $ b' end;
 fun letrec2_tr' [Abs(x,T,Abs(y,U,Abs(f,S,a))),Abs(ff,SS,b)] =
      let val (f',b') = Syntax_Trans.variant_abs(ff,SS,b)
          val ( _,a1) = Syntax_Trans.variant_abs(f,S,a)
          val (y',a2) = Syntax_Trans.variant_abs(y,U,a1)
          val (x',a') = Syntax_Trans.variant_abs(x,T,a2)
-     in Const(@{syntax_const "_letrec2"},dummyT) $ Free(f',SS) $ Free(x',T) $ Free(y',U) $ a' $ b'
+     in Const(\<^syntax_const>\<open>_letrec2\<close>,dummyT) $ Free(f',SS) $ Free(x',T) $ Free(y',U) $ a' $ b'
       end;
 fun letrec3_tr' [Abs(x,T,Abs(y,U,Abs(z,V,Abs(f,S,a)))),Abs(ff,SS,b)] =
      let val (f',b') = Syntax_Trans.variant_abs(ff,SS,b)
@@ -110,22 +110,22 @@
          val (z',a2) = Syntax_Trans.variant_abs(z,V,a1)
          val (y',a3) = Syntax_Trans.variant_abs(y,U,a2)
          val (x',a') = Syntax_Trans.variant_abs(x,T,a3)
-     in Const(@{syntax_const "_letrec3"},dummyT) $ Free(f',SS) $ Free(x',T) $ Free(y',U) $ Free(z',V) $ a' $ b'
+     in Const(\<^syntax_const>\<open>_letrec3\<close>,dummyT) $ Free(f',SS) $ Free(x',T) $ Free(y',U) $ Free(z',V) $ a' $ b'
       end;
 \<close>
 
 parse_translation \<open>
- [(@{syntax_const "_let"}, K let_tr),
-  (@{syntax_const "_letrec"}, K letrec_tr),
-  (@{syntax_const "_letrec2"}, K letrec2_tr),
-  (@{syntax_const "_letrec3"}, K letrec3_tr)]
+ [(\<^syntax_const>\<open>_let\<close>, K let_tr),
+  (\<^syntax_const>\<open>_letrec\<close>, K letrec_tr),
+  (\<^syntax_const>\<open>_letrec2\<close>, K letrec2_tr),
+  (\<^syntax_const>\<open>_letrec3\<close>, K letrec3_tr)]
 \<close>
 
 print_translation \<open>
- [(@{const_syntax let}, K let_tr'),
-  (@{const_syntax letrec}, K letrec_tr'),
-  (@{const_syntax letrec2}, K letrec2_tr'),
-  (@{const_syntax letrec3}, K letrec3_tr')]
+ [(\<^const_syntax>\<open>let\<close>, K let_tr'),
+  (\<^const_syntax>\<open>letrec\<close>, K letrec_tr'),
+  (\<^const_syntax>\<open>letrec2\<close>, K letrec2_tr'),
+  (\<^const_syntax>\<open>letrec3\<close>, K letrec3_tr')]
 \<close>
 
 
@@ -289,7 +289,7 @@
 
 ML \<open>
 ML_Thms.bind_thms ("term_dstncts",
-  mkall_dstnct_thms @{context} @{thms data_defs} (@{thms ccl_injs} @ @{thms term_injs})
+  mkall_dstnct_thms \<^context> @{thms data_defs} (@{thms ccl_injs} @ @{thms term_injs})
     [["bot","inl","inr"], ["bot","zero","succ"], ["bot","nil","cons"]]);
 \<close>
 
--- a/src/CCL/Type.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/CCL/Type.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -43,10 +43,10 @@
   "SUM x:A. B" \<rightharpoonup> "CONST Sigma(A, \<lambda>x. B)"
   "A * B" \<rightharpoonup> "CONST Sigma(A, \<lambda>_. B)"
 print_translation \<open>
- [(@{const_syntax Pi},
-    fn _ => Syntax_Trans.dependent_tr' (@{syntax_const "_Pi"}, @{syntax_const "_arrow"})),
-  (@{const_syntax Sigma},
-    fn _ => Syntax_Trans.dependent_tr' (@{syntax_const "_Sigma"}, @{syntax_const "_star"}))]
+ [(\<^const_syntax>\<open>Pi\<close>,
+    fn _ => Syntax_Trans.dependent_tr' (\<^syntax_const>\<open>_Pi\<close>, \<^syntax_const>\<open>_arrow\<close>)),
+  (\<^const_syntax>\<open>Sigma\<close>,
+    fn _ => Syntax_Trans.dependent_tr' (\<^syntax_const>\<open>_Sigma\<close>, \<^syntax_const>\<open>_star\<close>))]
 \<close>
 
 definition Nat :: "i set"
--- a/src/CCL/Wfd.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/CCL/Wfd.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -413,13 +413,13 @@
   @{thms canTs} @ @{thms icanTs} @ @{thms applyT2} @ @{thms ncanTs} @ @{thms incanTs} @
   @{thms precTs} @ @{thms letrecTs} @ @{thms letT} @ @{thms Subtype_canTs};
 
-fun bvars (Const(@{const_name Pure.all},_) $ Abs(s,_,t)) l = bvars t (s::l)
+fun bvars (Const(\<^const_name>\<open>Pure.all\<close>,_) $ Abs(s,_,t)) l = bvars t (s::l)
   | bvars _ l = l
 
-fun get_bno l n (Const(@{const_name Pure.all},_) $ Abs(s,_,t)) = get_bno (s::l) n t
-  | get_bno l n (Const(@{const_name Trueprop},_) $ t) = get_bno l n t
-  | get_bno l n (Const(@{const_name Ball},_) $ _ $ Abs(s,_,t)) = get_bno (s::l) (n+1) t
-  | get_bno l n (Const(@{const_name mem},_) $ t $ _) = get_bno l n t
+fun get_bno l n (Const(\<^const_name>\<open>Pure.all\<close>,_) $ Abs(s,_,t)) = get_bno (s::l) n t
+  | get_bno l n (Const(\<^const_name>\<open>Trueprop\<close>,_) $ t) = get_bno l n t
+  | get_bno l n (Const(\<^const_name>\<open>Ball\<close>,_) $ _ $ Abs(s,_,t)) = get_bno (s::l) (n+1) t
+  | get_bno l n (Const(\<^const_name>\<open>mem\<close>,_) $ t $ _) = get_bno l n t
   | get_bno l n (t $ s) = get_bno l n t
   | get_bno l n (Bound m) = (m-length(l),n)
 
@@ -441,7 +441,7 @@
 
 fun is_rigid_prog t =
   (case (Logic.strip_assums_concl t) of
-    (Const(@{const_name Trueprop},_) $ (Const(@{const_name mem},_) $ a $ _)) =>
+    (Const(\<^const_name>\<open>Trueprop\<close>,_) $ (Const(\<^const_name>\<open>mem\<close>,_) $ a $ _)) =>
       null (Term.add_vars a [])
   | _ => false)
 
@@ -500,7 +500,7 @@
 ML \<open>
 fun eval_tac ths =
   Subgoal.FOCUS_PREMS (fn {context = ctxt, prems, ...} =>
-    let val eval_rules = Named_Theorems.get ctxt @{named_theorems eval}
+    let val eval_rules = Named_Theorems.get ctxt \<^named_theorems>\<open>eval\<close>
     in DEPTH_SOLVE_1 (resolve_tac ctxt (ths @ prems @ rev eval_rules) 1) end)
 \<close>
 
@@ -524,8 +524,8 @@
   apply (unfold let_def)
   apply (rule 1 [THEN canonical])
   apply (tactic \<open>
-    REPEAT (DEPTH_SOLVE_1 (resolve_tac @{context} (@{thms assms} @ @{thms eval_rls}) 1 ORELSE
-      eresolve_tac @{context} @{thms substitute} 1))\<close>)
+    REPEAT (DEPTH_SOLVE_1 (resolve_tac \<^context> (@{thms assms} @ @{thms eval_rls}) 1 ORELSE
+      eresolve_tac \<^context> @{thms substitute} 1))\<close>)
   done
 
 lemma fixV: "f(fix(f)) \<longlongrightarrow> c \<Longrightarrow> fix(f) \<longlongrightarrow> c"
--- a/src/CCL/ex/Stream.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/CCL/ex/Stream.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -82,8 +82,8 @@
   apply EQgen
    prefer 2
    apply blast
-  apply (tactic \<open>DEPTH_SOLVE (eresolve_tac @{context} [XH_to_E @{thm ListsXH}] 1
-    THEN EQgen_tac @{context} [] 1)\<close>)
+  apply (tactic \<open>DEPTH_SOLVE (eresolve_tac \<^context> [XH_to_E @{thm ListsXH}] 1
+    THEN EQgen_tac \<^context> [] 1)\<close>)
   done
 
 
--- a/src/CTT/CTT.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/CTT/CTT.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -304,9 +304,9 @@
 ML \<open>
 local
 
-fun is_rigid_elem (Const(@{const_name Elem},_) $ a $ _) = not(is_Var (head_of a))
-  | is_rigid_elem (Const(@{const_name Eqelem},_) $ a $ _ $ _) = not(is_Var (head_of a))
-  | is_rigid_elem (Const(@{const_name Type},_) $ a) = not(is_Var (head_of a))
+fun is_rigid_elem (Const(\<^const_name>\<open>Elem\<close>,_) $ a $ _) = not(is_Var (head_of a))
+  | is_rigid_elem (Const(\<^const_name>\<open>Eqelem\<close>,_) $ a $ _ $ _) = not(is_Var (head_of a))
+  | is_rigid_elem (Const(\<^const_name>\<open>Type\<close>,_) $ a) = not(is_Var (head_of a))
   | is_rigid_elem _ = false
 
 in
--- a/src/CTT/ex/Elimination.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/CTT/ex/Elimination.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -180,7 +180,7 @@
     and "\<And>z. z:A \<times> B \<Longrightarrow> C(z) type"
   shows "?a : (\<Sum>z:A \<times> B. C(z)) \<longrightarrow> (\<Sum>u:A. \<Sum>v:B. C(<u,v>))"
 apply (rule intr_rls)
-apply (tactic \<open>biresolve_tac @{context} safe_brls 2\<close>)
+apply (tactic \<open>biresolve_tac \<^context> safe_brls 2\<close>)
 (*Now must convert assumption C(z) into antecedent C(<kd,ke>) *)
 apply (rule_tac [2] a = "y" in ProdE)
 apply (typechk assms)
--- a/src/CTT/ex/Equality.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/CTT/ex/Equality.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -47,7 +47,7 @@
 lemma "p : Sum(A,B) \<Longrightarrow> <split(p,\<lambda>x y. x), split(p,\<lambda>x y. y)> = p : Sum(A,B)"
 apply (rule EqE)
 apply (rule elim_rls, assumption)
-apply (tactic \<open>DEPTH_SOLVE_1 (rew_tac @{context} [])\<close>) (*!!!!!!!*)
+apply (tactic \<open>DEPTH_SOLVE_1 (rew_tac \<^context> [])\<close>) (*!!!!!!!*)
 done
 
 lemma "\<lbrakk>a : A; b : B\<rbrakk> \<Longrightarrow> (\<^bold>\<lambda>u. split(u, \<lambda>v w.<w,v>)) ` <a,b> = <b,a> : \<Sum>x:B. A"
--- a/src/CTT/ex/Synthesis.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/CTT/ex/Synthesis.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -91,10 +91,10 @@
                 \<times>  (\<Prod>y:N. Eq(N, plus`succ(y)`x, succ(plus`y`x)))"
 apply intr
 apply eqintr
-apply (tactic "resolve_tac @{context} [TSimp.split_eqn] 3")
-apply (tactic "SELECT_GOAL (rew_tac @{context} []) 4")
-apply (tactic "resolve_tac @{context} [TSimp.split_eqn] 3")
-apply (tactic "SELECT_GOAL (rew_tac @{context} []) 4")
+apply (tactic "resolve_tac \<^context> [TSimp.split_eqn] 3")
+apply (tactic "SELECT_GOAL (rew_tac \<^context> []) 4")
+apply (tactic "resolve_tac \<^context> [TSimp.split_eqn] 3")
+apply (tactic "SELECT_GOAL (rew_tac \<^context> []) 4")
 apply (rule_tac [3] p = "y" in NC_succ)
   (**  by (resolve_tac @{context} comp_rls 3);  caused excessive branching  **)
 apply rew
--- a/src/Cube/Cube.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/Cube/Cube.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -49,8 +49,8 @@
   "\<Prod>x:A. B" \<rightharpoonup> "CONST Prod(A, \<lambda>x. B)"
   "A \<rightarrow> B" \<rightharpoonup> "CONST Prod(A, \<lambda>_. B)"
 print_translation \<open>
-  [(@{const_syntax Prod},
-    fn _ => Syntax_Trans.dependent_tr' (@{syntax_const "_Pi"}, @{syntax_const "_arrow"}))]
+  [(\<^const_syntax>\<open>Prod\<close>,
+    fn _ => Syntax_Trans.dependent_tr' (\<^syntax_const>\<open>_Pi\<close>, \<^syntax_const>\<open>_arrow\<close>))]
 \<close>
 
 axiomatization where
--- a/src/Doc/Isar_Ref/First_Order_Logic.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/Doc/Isar_Ref/First_Order_Logic.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -20,8 +20,8 @@
 
 text \<open>
   Note that the object-logic judgment is implicit in the syntax: writing
-  @{prop A} produces @{term "Trueprop A"} internally. From the Pure
-  perspective this means ``@{prop A} is derivable in the object-logic''.
+  \<^prop>\<open>A\<close> produces \<^term>\<open>Trueprop A\<close> internally. From the Pure
+  perspective this means ``\<^prop>\<open>A\<close> is derivable in the object-logic''.
 \<close>
 
 
@@ -41,7 +41,7 @@
 
 text \<open>
   Substitution is very powerful, but also hard to control in full generality.
-  We derive some common symmetry~/ transitivity schemes of @{term equal} as
+  We derive some common symmetry~/ transitivity schemes of \<^term>\<open>equal\<close> as
   particular consequences.
 \<close>
 
@@ -182,10 +182,9 @@
     and conjD\<^sub>2: "A \<and> B \<Longrightarrow> B"
 
 text \<open>
-  The conjunctive destructions have the disadvantage that decomposing @{prop
-  "A \<and> B"} involves an immediate decision which component should be projected.
-  The more convenient simultaneous elimination @{prop "A \<and> B \<Longrightarrow> (A \<Longrightarrow> B \<Longrightarrow> C) \<Longrightarrow>
-  C"} can be derived as follows:
+  The conjunctive destructions have the disadvantage that decomposing \<^prop>\<open>A \<and> B\<close> involves an immediate decision which component should be projected.
+  The more convenient simultaneous elimination \<^prop>\<open>A \<and> B \<Longrightarrow> (A \<Longrightarrow> B \<Longrightarrow> C) \<Longrightarrow>
+  C\<close> can be derived as follows:
 \<close>
 
 theorem conjE [elim]:
@@ -300,8 +299,8 @@
   These examples illustrate both classical reasoning and non-trivial
   propositional proofs in general. All three rules characterize classical
   logic independently, but the original rule is already the most convenient to
-  use, because it leaves the conclusion unchanged. Note that @{prop "(\<not> C \<Longrightarrow> C)
-  \<Longrightarrow> C"} fits again into our format for eliminations, despite the additional
+  use, because it leaves the conclusion unchanged. Note that \<^prop>\<open>(\<not> C \<Longrightarrow> C)
+  \<Longrightarrow> C\<close> fits again into our format for eliminations, despite the additional
   twist that the context refers to the main conclusion. So we may write @{thm
   classical} as the Isar statement ``\<^theory_text>\<open>obtains \<not> thesis\<close>''. This also explains
   nicely how classical reasoning really works: whatever the main \<open>thesis\<close>
@@ -317,7 +316,7 @@
   Representing quantifiers is easy, thanks to the higher-order nature of the
   underlying framework. According to the well-known technique introduced by
   Church @{cite "church40"}, quantifiers are operators on predicates, which
-  are syntactically represented as \<open>\<lambda>\<close>-terms of type @{typ "i \<Rightarrow> o"}. Binder
+  are syntactically represented as \<open>\<lambda>\<close>-terms of type \<^typ>\<open>i \<Rightarrow> o\<close>. Binder
   notation turns \<open>All (\<lambda>x. B x)\<close> into \<open>\<forall>x. B x\<close> etc.
 \<close>
 
--- a/src/Doc/Logics_ZF/IFOL_examples.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/Doc/Logics_ZF/IFOL_examples.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -36,7 +36,7 @@
 done
 
 lemma "(EX y. ALL x. Q(x,y)) -->  (ALL x. EX y. Q(x,y))"
-by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 text\<open>Example of Dyckhoff's method\<close>
 lemma "~ ~ ((P-->Q) | (Q-->P))"
--- a/src/Doc/Logics_ZF/ZF_Isar.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/Doc/Logics_ZF/ZF_Isar.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -23,9 +23,9 @@
     @{attribute_def (ZF) TC} & : & \<open>attribute\<close> \\
   \end{matharray}
 
-  @{rail \<open>
+  \<^rail>\<open>
     @@{attribute (ZF) TC} (() | 'add' | 'del')
-  \<close>}
+  \<close>
 
   \begin{description}
   
@@ -58,7 +58,7 @@
     @{command_def (ZF) "codatatype"} & : & \<open>theory \<rightarrow> theory\<close> \\
   \end{matharray}
 
-  @{rail \<open>
+  \<^rail>\<open>
     (@@{command (ZF) inductive} | @@{command (ZF) coinductive}) domains intros hints
     ;
 
@@ -76,11 +76,11 @@
     @{syntax_def (ZF) typeintros}: @'type_intros' @{syntax thms}
     ;
     @{syntax_def (ZF) typeelims}: @'type_elims' @{syntax thms}
-  \<close>}
+  \<close>
 
   In the following syntax specification \<open>monos\<close>, \<open>typeintros\<close>, and \<open>typeelims\<close> are the same as above.
 
-  @{rail \<open>
+  \<^rail>\<open>
     (@@{command (ZF) datatype} | @@{command (ZF) codatatype}) domain? (dtspec + @'and') hints
     ;
 
@@ -91,7 +91,7 @@
     con: @{syntax name} ('(' (@{syntax term} ',' +) ')')?
     ;
     hints: @{syntax (ZF) "monos"}? @{syntax (ZF) typeintros}? @{syntax (ZF) typeelims}?
-  \<close>}
+  \<close>
 
   See @{cite "isabelle-ZF"} for further information on inductive
   definitions in ZF, but note that this covers the old-style theory
@@ -106,9 +106,9 @@
     @{command_def (ZF) "primrec"} & : & \<open>theory \<rightarrow> theory\<close> \\
   \end{matharray}
 
-  @{rail \<open>
+  \<^rail>\<open>
     @@{command (ZF) primrec} (@{syntax thmdecl}? @{syntax prop} +)
-  \<close>}
+  \<close>
 \<close>
 
 
@@ -125,13 +125,13 @@
     @{command_def (ZF) "inductive_cases"} & : & \<open>theory \<rightarrow> theory\<close> \\
   \end{matharray}
 
-  @{rail \<open>
+  \<^rail>\<open>
     (@@{method (ZF) case_tac} | @@{method (ZF) induct_tac}) @{syntax goal_spec}? @{syntax name}
     ;
     @@{method (ZF) ind_cases} (@{syntax prop} +)
     ;
     @@{command (ZF) inductive_cases} (@{syntax thmdecl}? (@{syntax prop} +) + @'and')
-  \<close>}
+  \<close>
 \<close>
 
 end
--- a/src/Doc/System/Environment.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/Doc/System/Environment.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -55,7 +55,7 @@
     variables. When installing the system, only a few of these may have to be
     adapted (probably @{setting ML_SYSTEM} etc.).
 
-    \<^enum> The file @{path "$ISABELLE_HOME_USER/etc/settings"} (if it
+    \<^enum> The file \<^path>\<open>$ISABELLE_HOME_USER/etc/settings\<close> (if it
     exists) is run in the same way as the site default settings. Note that the
     variable @{setting ISABELLE_HOME_USER} has already been set before ---
     usually to something like \<^verbatim>\<open>$USER_HOME/.isabelle/Isabelle2018\<close>.
@@ -95,7 +95,7 @@
   On Unix systems this is usually the same as @{setting HOME}, but on Windows
   it is the regular home directory of the user, not the one of within the
   Cygwin root file-system.\<^footnote>\<open>Cygwin itself offers another choice whether its
-  HOME should point to the @{path "/home"} directory tree or the Windows user
+  HOME should point to the \<^path>\<open>/home\<close> directory tree or the Windows user
   home.\<close>
 
   \<^descr>[@{setting_def ISABELLE_HOME}\<open>\<^sup>*\<close>] is the location of the top-level
@@ -104,8 +104,7 @@
   ISABELLE_HOME} yourself from the shell!
 
   \<^descr>[@{setting_def ISABELLE_HOME_USER}] is the user-specific counterpart of
-  @{setting ISABELLE_HOME}. The default value is relative to @{path
-  "$USER_HOME/.isabelle"}, under rare circumstances this may be changed in the
+  @{setting ISABELLE_HOME}. The default value is relative to \<^path>\<open>$USER_HOME/.isabelle\<close>, under rare circumstances this may be changed in the
   global setting file. Typically, the @{setting ISABELLE_HOME_USER} directory
   mimics @{setting ISABELLE_HOME} to some extend. In particular, site-wide
   defaults may be overridden by a private \<^verbatim>\<open>$ISABELLE_HOME_USER/etc/settings\<close>.
@@ -177,15 +176,14 @@
 
   \<^descr>[@{setting_def ISABELLE_BROWSER_INFO}] is the directory where HTML and PDF
   browser information is stored (see also \secref{sec:info}); its default is
-  @{path "$ISABELLE_HOME_USER/browser_info"}. For ``system build mode'' (see
+  \<^path>\<open>$ISABELLE_HOME_USER/browser_info\<close>. For ``system build mode'' (see
   \secref{sec:tool-build}), @{setting_def ISABELLE_BROWSER_INFO_SYSTEM} is
-  used instead; its default is @{path "$ISABELLE_HOME/browser_info"}.
+  used instead; its default is \<^path>\<open>$ISABELLE_HOME/browser_info\<close>.
 
   \<^descr>[@{setting_def ISABELLE_HEAPS}] is the directory where session heap images,
-  log files, and build databases are stored; its default is @{path
-  "$ISABELLE_HOME_USER/heaps"}. For ``system build mode'' (see
+  log files, and build databases are stored; its default is \<^path>\<open>$ISABELLE_HOME_USER/heaps\<close>. For ``system build mode'' (see
   \secref{sec:tool-build}), @{setting_def ISABELLE_HEAPS_SYSTEM} is used
-  instead; its default is @{path "$ISABELLE_HOME/heaps"}.
+  instead; its default is \<^path>\<open>$ISABELLE_HOME/heaps\<close>.
 
   \<^descr>[@{setting_def ISABELLE_LOGIC}] specifies the default logic to load if none
   is given explicitely by the user. The default value is \<^verbatim>\<open>HOL\<close>.
@@ -249,8 +247,7 @@
   The root of component initialization is @{setting ISABELLE_HOME} itself.
   After initializing all of its sub-components recursively, @{setting
   ISABELLE_HOME_USER} is included in the same manner (if that directory
-  exists). This allows to install private components via @{path
-  "$ISABELLE_HOME_USER/etc/components"}, although it is often more convenient
+  exists). This allows to install private components via \<^path>\<open>$ISABELLE_HOME_USER/etc/components\<close>, although it is often more convenient
   to do that programmatically via the \<^verbatim>\<open>init_component\<close> shell function in the
   \<^verbatim>\<open>etc/settings\<close> script of \<^verbatim>\<open>$ISABELLE_HOME_USER\<close> (or any other component
   directory). For example:
@@ -361,7 +358,7 @@
 
   \<^medskip>
   Option \<^verbatim>\<open>-T\<close> loads a specified theory file. This is a wrapper for \<^verbatim>\<open>-e\<close> with
-  a suitable @{ML use_thy} invocation.
+  a suitable \<^ML>\<open>use_thy\<close> invocation.
 
   \<^medskip>
   Option \<^verbatim>\<open>-l\<close> specifies the logic session name. Option \<^verbatim>\<open>-d\<close> specifies
@@ -443,8 +440,8 @@
 
   The user is connected to the raw ML toplevel loop: this is neither
   Isabelle/Isar nor Isabelle/ML within the usual formal context. The most
-  relevant ML commands at this stage are @{ML use} (for ML files) and
-  @{ML use_thy} (for theory files).
+  relevant ML commands at this stage are \<^ML>\<open>use\<close> (for ML files) and
+  \<^ML>\<open>use_thy\<close> (for theory files).
 \<close>
 
 
--- a/src/Doc/System/Server.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/Doc/System/Server.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -17,7 +17,7 @@
   In contrast, the Isabelle server exposes Isabelle/Scala as a
   ``terminate-stay-resident'' application that manages multiple logic
   \<^emph>\<open>sessions\<close> and concurrent tasks to use \<^emph>\<open>theories\<close>. This provides an
-  analogous to @{ML Thy_Info.use_theories} in Isabelle/ML, but with full
+  analogous to \<^ML>\<open>Thy_Info.use_theories\<close> in Isabelle/ML, but with full
   concurrency and Isabelle/PIDE markup.
 
   The client/server arrangement via TCP sockets also opens possibilities for
@@ -48,7 +48,7 @@
 
   The main operation of \<^verbatim>\<open>isabelle server\<close> is to ensure that a named server is
   running, either by finding an already running process (according to the
-  central database file @{path "$ISABELLE_HOME_USER/servers.db"}) or by
+  central database file \<^path>\<open>$ISABELLE_HOME_USER/servers.db\<close>) or by
   becoming itself a new server that accepts connections on a particular TCP
   socket. The server name and its address are printed as initial output line.
   If another server instance is already running, the current
@@ -464,7 +464,7 @@
   string, id?: long}\<close> describes a source position within Isabelle text. Only
   the \<open>line\<close> and \<open>file\<close> fields make immediate sense to external programs.
   Detailed \<open>offset\<close> and \<open>end_offset\<close> positions are counted according to
-  Isabelle symbols, see @{ML_type Symbol.symbol} in Isabelle/ML @{cite
+  Isabelle symbols, see \<^ML_type>\<open>Symbol.symbol\<close> in Isabelle/ML @{cite
   "isabelle-implementation"}. The position \<open>id\<close> belongs to the representation
   of command transactions in the Isabelle/PIDE protocol: it normally does not
   occur in externalized positions.
@@ -724,8 +724,7 @@
   in a robust manner, instead of relying on directory locations.
 
   \<^medskip>
-  If \<open>system_mode\<close> is \<^verbatim>\<open>true\<close>, session images are stored in @{path
-  "$ISABELLE_HEAPS_SYSTEM"} instead of @{path "$ISABELLE_HEAPS"}. See also
+  If \<open>system_mode\<close> is \<^verbatim>\<open>true\<close>, session images are stored in \<^path>\<open>$ISABELLE_HEAPS_SYSTEM\<close> instead of \<^path>\<open>$ISABELLE_HEAPS\<close>. See also
   option \<^verbatim>\<open>-s\<close> in @{tool build} (\secref{sec:tool-build}).
 
   \<^medskip>
--- a/src/Doc/System/Sessions.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/Doc/System/Sessions.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -48,7 +48,7 @@
   \<^verbatim>\<open>isabelle-root\<close> for session ROOT files, which is enabled by default for any
   file of that name.
 
-  @{rail \<open>
+  \<^rail>\<open>
     @{syntax_def session_chapter}: @'chapter' @{syntax name}
     ;
 
@@ -77,7 +77,7 @@
     document_files: @'document_files' ('(' dir ')')? (@{syntax embedded}+)
     ;
     export_files: @'export_files' ('(' dir ')')? (@{syntax embedded}+)
-  \<close>}
+  \<close>
 
   \<^descr> \isakeyword{session}~\<open>A = B + body\<close> defines a new session \<open>A\<close> based on
   parent session \<open>B\<close>, with its content given in \<open>body\<close> (imported sessions and
@@ -237,7 +237,7 @@
 
     \<^item> @{system_option_def "profiling"} specifies a mode for global ML
     profiling. Possible values are the empty string (disabled), \<^verbatim>\<open>time\<close> for
-    @{ML profile_time} and \<^verbatim>\<open>allocations\<close> for @{ML profile_allocations}.
+    \<^ML>\<open>profile_time\<close> and \<^verbatim>\<open>allocations\<close> for \<^ML>\<open>profile_allocations\<close>.
     Results appear near the bottom of the session log file.
 
   The @{tool_def options} tool prints Isabelle system options. Its
@@ -396,8 +396,7 @@
 
   \<^medskip>
   Option \<^verbatim>\<open>-s\<close> enables \<^emph>\<open>system mode\<close>, which means that session images are
-  stored in @{path "$ISABELLE_HEAPS_SYSTEM"} instead of @{path
-  "$ISABELLE_HEAPS"}.
+  stored in \<^path>\<open>$ISABELLE_HEAPS_SYSTEM\<close> instead of \<^path>\<open>$ISABELLE_HEAPS\<close>.
 
   \<^medskip>
   Option \<^verbatim>\<open>-v\<close> increases the general level of verbosity. Option \<^verbatim>\<open>-l\<close> lists
--- a/src/Doc/antiquote_setup.ML	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/Doc/antiquote_setup.ML	Fri Jan 04 23:22:53 2019 +0100
@@ -107,12 +107,12 @@
 
 val _ =
   Theory.setup
-   (index_ml @{binding index_ML} "" ml_val #>
-    index_ml @{binding index_ML_op} "infix" ml_op #>
-    index_ml @{binding index_ML_type} "type" ml_type #>
-    index_ml @{binding index_ML_exception} "exception" ml_exception #>
-    index_ml @{binding index_ML_structure} "structure" ml_structure #>
-    index_ml @{binding index_ML_functor} "functor" ml_functor);
+   (index_ml \<^binding>\<open>index_ML\<close> "" ml_val #>
+    index_ml \<^binding>\<open>index_ML_op\<close> "infix" ml_op #>
+    index_ml \<^binding>\<open>index_ML_type\<close> "type" ml_type #>
+    index_ml \<^binding>\<open>index_ML_exception\<close> "exception" ml_exception #>
+    index_ml \<^binding>\<open>index_ML_structure\<close> "structure" ml_structure #>
+    index_ml \<^binding>\<open>index_ML_functor\<close> "functor" ml_functor);
 
 end;
 
@@ -120,7 +120,7 @@
 (* named theorems *)
 
 val _ =
-  Theory.setup (Thy_Output.antiquotation_raw @{binding named_thms}
+  Theory.setup (Thy_Output.antiquotation_raw \<^binding>\<open>named_thms\<close>
     (Scan.repeat (Attrib.thm -- Scan.lift (Args.parens Args.name)))
     (fn ctxt =>
       map (fn (thm, name) =>
@@ -185,24 +185,24 @@
 
 val _ =
   Theory.setup
-   (entity_antiqs no_check "" @{binding syntax} #>
-    entity_antiqs Outer_Syntax.check_command "isacommand" @{binding command} #>
-    entity_antiqs check_keyword "isakeyword" @{binding keyword} #>
-    entity_antiqs check_keyword "isakeyword" @{binding element} #>
-    entity_antiqs Method.check_name "" @{binding method} #>
-    entity_antiqs Attrib.check_name "" @{binding attribute} #>
-    entity_antiqs no_check "" @{binding fact} #>
-    entity_antiqs no_check "" @{binding variable} #>
-    entity_antiqs no_check "" @{binding case} #>
-    entity_antiqs Document_Antiquotation.check "" @{binding antiquotation} #>
-    entity_antiqs Document_Antiquotation.check_option "" @{binding antiquotation_option} #>
-    entity_antiqs no_check "isasystem" @{binding setting} #>
-    entity_antiqs check_system_option "isasystem" @{binding system_option} #>
-    entity_antiqs no_check "" @{binding inference} #>
-    entity_antiqs no_check "isasystem" @{binding executable} #>
-    entity_antiqs no_check "isatool" @{binding tool} #>
-    entity_antiqs ML_Context.check_antiquotation "" @{binding ML_antiquotation} #>
-    entity_antiqs (K JEdit.check_action) "isasystem" @{binding action});
+   (entity_antiqs no_check "" \<^binding>\<open>syntax\<close> #>
+    entity_antiqs Outer_Syntax.check_command "isacommand" \<^binding>\<open>command\<close> #>
+    entity_antiqs check_keyword "isakeyword" \<^binding>\<open>keyword\<close> #>
+    entity_antiqs check_keyword "isakeyword" \<^binding>\<open>element\<close> #>
+    entity_antiqs Method.check_name "" \<^binding>\<open>method\<close> #>
+    entity_antiqs Attrib.check_name "" \<^binding>\<open>attribute\<close> #>
+    entity_antiqs no_check "" \<^binding>\<open>fact\<close> #>
+    entity_antiqs no_check "" \<^binding>\<open>variable\<close> #>
+    entity_antiqs no_check "" \<^binding>\<open>case\<close> #>
+    entity_antiqs Document_Antiquotation.check "" \<^binding>\<open>antiquotation\<close> #>
+    entity_antiqs Document_Antiquotation.check_option "" \<^binding>\<open>antiquotation_option\<close> #>
+    entity_antiqs no_check "isasystem" \<^binding>\<open>setting\<close> #>
+    entity_antiqs check_system_option "isasystem" \<^binding>\<open>system_option\<close> #>
+    entity_antiqs no_check "" \<^binding>\<open>inference\<close> #>
+    entity_antiqs no_check "isasystem" \<^binding>\<open>executable\<close> #>
+    entity_antiqs no_check "isatool" \<^binding>\<open>tool\<close> #>
+    entity_antiqs ML_Context.check_antiquotation "" \<^binding>\<open>ML_antiquotation\<close> #>
+    entity_antiqs (K JEdit.check_action) "isasystem" \<^binding>\<open>action\<close>);
 
 end;
 
--- a/src/FOL/FOL.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/FOL/FOL.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -155,7 +155,7 @@
       fix y y'
       assume \<open>P(y)\<close> and \<open>P(y')\<close>
       with * have \<open>x = y\<close> and \<open>x = y'\<close>
-        by - (tactic "IntPr.fast_tac @{context} 1")+
+        by - (tactic "IntPr.fast_tac \<^context> 1")+
       then have \<open>y = y'\<close> by (rule subst)
     } note r' = this
     show \<open>\<forall>y y'. P(y) \<and> P(y') \<longrightarrow> y = y'\<close>
@@ -190,22 +190,22 @@
 (*Propositional rules*)
 lemmas [intro!] = refl TrueI conjI disjCI impI notI iffI
   and [elim!] = conjE disjE impCE FalseE iffCE
-ML \<open>val prop_cs = claset_of @{context}\<close>
+ML \<open>val prop_cs = claset_of \<^context>\<close>
 
 (*Quantifier rules*)
 lemmas [intro!] = allI ex_ex1I
   and [intro] = exI
   and [elim!] = exE alt_ex1E
   and [elim] = allE
-ML \<open>val FOL_cs = claset_of @{context}\<close>
+ML \<open>val FOL_cs = claset_of \<^context>\<close>
 
 ML \<open>
   structure Blast = Blast
   (
     structure Classical = Cla
     val Trueprop_const = dest_Const @{const Trueprop}
-    val equality_name = @{const_name eq}
-    val not_name = @{const_name Not}
+    val equality_name = \<^const_name>\<open>eq\<close>
+    val not_name = \<^const_name>\<open>Not\<close>
     val notE = @{thm notE}
     val ccontr = @{thm ccontr}
     val hyp_subst_tac = Hypsubst.blast_hyp_subst_tac
@@ -343,15 +343,15 @@
 ML \<open>
 (*intuitionistic simprules only*)
 val IFOL_ss =
-  put_simpset FOL_basic_ss @{context}
+  put_simpset FOL_basic_ss \<^context>
   addsimps @{thms meta_simps IFOL_simps int_ex_simps int_all_simps}
-  addsimprocs [@{simproc defined_All}, @{simproc defined_Ex}]
+  addsimprocs [\<^simproc>\<open>defined_All\<close>, \<^simproc>\<open>defined_Ex\<close>]
   |> Simplifier.add_cong @{thm imp_cong}
   |> simpset_of;
 
 (*classical simprules too*)
 val FOL_ss =
-  put_simpset IFOL_ss @{context}
+  put_simpset IFOL_ss \<^context>
   addsimps @{thms cla_simps cla_ex_simps cla_all_simps}
   |> simpset_of;
 \<close>
--- a/src/FOL/IFOL.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/FOL/IFOL.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -149,7 +149,7 @@
   apply (rule major [THEN spec])
   done
 
-text \<open>Duplicates the quantifier; for use with @{ML eresolve_tac}.\<close>
+text \<open>Duplicates the quantifier; for use with \<^ML>\<open>eresolve_tac\<close>.\<close>
 lemma all_dupE:
   assumes major: \<open>\<forall>x. P(x)\<close>
     and r: \<open>\<lbrakk>P(x); \<forall>x. P(x)\<rbrakk> \<Longrightarrow> R\<close>
@@ -442,7 +442,7 @@
   done
 
 text \<open>
-  Useful with @{ML eresolve_tac} for proving equalities from known
+  Useful with \<^ML>\<open>eresolve_tac\<close> for proving equalities from known
   equalities.
 
         a = b
@@ -499,7 +499,7 @@
 
 text \<open>
   Roy Dyckhoff has proved that \<open>conj_impE\<close>, \<open>disj_impE\<close>, and
-  \<open>imp_impE\<close> used with @{ML mp_tac} (restricted to atomic formulae) is
+  \<open>imp_impE\<close> used with \<^ML>\<open>mp_tac\<close> (restricted to atomic formulae) is
   COMPLETE for intuitionistic propositional logic.
 
   See R. Dyckhoff, Contraction-free sequent calculi for intuitionistic logic
@@ -608,7 +608,7 @@
 
 subsection \<open>Intuitionistic Reasoning\<close>
 
-setup \<open>Intuitionistic.method_setup @{binding iprover}\<close>
+setup \<open>Intuitionistic.method_setup \<^binding>\<open>iprover\<close>\<close>
 
 lemma impE':
   assumes 1: \<open>P \<longrightarrow> Q\<close>
--- a/src/FOL/ex/Intuitionistic.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/FOL/ex/Intuitionistic.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -37,56 +37,56 @@
 is intuitionstically equivalent to $P$.  [Andy Pitts]\<close>
 
 lemma \<open>\<not> \<not> (P \<and> Q) \<longleftrightarrow> \<not> \<not> P \<and> \<not> \<not> Q\<close>
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 lemma \<open>\<not> \<not> ((\<not> P \<longrightarrow> Q) \<longrightarrow> (\<not> P \<longrightarrow> \<not> Q) \<longrightarrow> P)\<close>
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 text \<open>Double-negation does NOT distribute over disjunction.\<close>
 
 lemma \<open>\<not> \<not> (P \<longrightarrow> Q) \<longleftrightarrow> (\<not> \<not> P \<longrightarrow> \<not> \<not> Q)\<close>
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 lemma \<open>\<not> \<not> \<not> P \<longleftrightarrow> \<not> P\<close>
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 lemma \<open>\<not> \<not> ((P \<longrightarrow> Q \<or> R) \<longrightarrow> (P \<longrightarrow> Q) \<or> (P \<longrightarrow> R))\<close>
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 lemma \<open>(P \<longleftrightarrow> Q) \<longleftrightarrow> (Q \<longleftrightarrow> P)\<close>
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 lemma \<open>((P \<longrightarrow> (Q \<or> (Q \<longrightarrow> R))) \<longrightarrow> R) \<longrightarrow> R\<close>
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 lemma
   \<open>(((G \<longrightarrow> A) \<longrightarrow> J) \<longrightarrow> D \<longrightarrow> E) \<longrightarrow> (((H \<longrightarrow> B) \<longrightarrow> I) \<longrightarrow> C \<longrightarrow> J)
     \<longrightarrow> (A \<longrightarrow> H) \<longrightarrow> F \<longrightarrow> G \<longrightarrow> (((C \<longrightarrow> B) \<longrightarrow> I) \<longrightarrow> D) \<longrightarrow> (A \<longrightarrow> C)
     \<longrightarrow> (((F \<longrightarrow> A) \<longrightarrow> B) \<longrightarrow> I) \<longrightarrow> E\<close>
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 
 subsection \<open>Lemmas for the propositional double-negation translation\<close>
 
 lemma \<open>P \<longrightarrow> \<not> \<not> P\<close>
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 lemma \<open>\<not> \<not> (\<not> \<not> P \<longrightarrow> P)\<close>
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 lemma \<open>\<not> \<not> P \<and> \<not> \<not> (P \<longrightarrow> Q) \<longrightarrow> \<not> \<not> Q\<close>
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 
 text \<open>The following are classically but not constructively valid.
   The attempt to prove them terminates quickly!\<close>
 lemma \<open>((P \<longrightarrow> Q) \<longrightarrow> P) \<longrightarrow> P\<close>
-apply (tactic \<open>IntPr.fast_tac @{context} 1\<close>)?
+apply (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)?
 apply (rule asm_rl) \<comment> \<open>Checks that subgoals remain: proof failed.\<close>
 oops
 
 lemma \<open>(P \<and> Q \<longrightarrow> R) \<longrightarrow> (P \<longrightarrow> R) \<or> (Q \<longrightarrow> R)\<close>
-apply (tactic \<open>IntPr.fast_tac @{context} 1\<close>)?
+apply (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)?
 apply (rule asm_rl) \<comment> \<open>Checks that subgoals remain: proof failed.\<close>
 oops
 
@@ -98,7 +98,7 @@
   \<open>((P \<longleftrightarrow> Q) \<longrightarrow> P \<and> Q \<and> R) \<and>
     ((Q \<longleftrightarrow> R) \<longrightarrow> P \<and> Q \<and> R) \<and>
     ((R \<longleftrightarrow> P) \<longrightarrow> P \<and> Q \<and> R) \<longrightarrow> P \<and> Q \<and> R\<close>
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 
 text \<open>de Bruijn formula with five predicates\<close>
@@ -108,7 +108,7 @@
     ((R \<longleftrightarrow> S) \<longrightarrow> P \<and> Q \<and> R \<and> S \<and> T) \<and>
     ((S \<longleftrightarrow> T) \<longrightarrow> P \<and> Q \<and> R \<and> S \<and> T) \<and>
     ((T \<longleftrightarrow> P) \<longrightarrow> P \<and> Q \<and> R \<and> S \<and> T) \<longrightarrow> P \<and> Q \<and> R \<and> S \<and> T\<close>
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 
 text \<open>
@@ -121,11 +121,11 @@
 lemma
   \<open>(\<forall>x. \<exists>y. \<forall>z. p(x) \<and> q(y) \<and> r(z)) \<longleftrightarrow>
     (\<forall>z. \<exists>y. \<forall>x. p(x) \<and> q(y) \<and> r(z))\<close>
-  by (tactic \<open>IntPr.best_dup_tac @{context} 1\<close>)  \<comment> \<open>SLOW\<close>
+  by (tactic \<open>IntPr.best_dup_tac \<^context> 1\<close>)  \<comment> \<open>SLOW\<close>
 
 text\<open>Problem 3.1\<close>
 lemma \<open>\<not> (\<exists>x. \<forall>y. mem(y,x) \<longleftrightarrow> \<not> mem(x,x))\<close>
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 text\<open>Problem 4.1: hopeless!\<close>
 lemma
@@ -138,80 +138,80 @@
 
 text\<open>\<open>\<not>\<not>\<close>1\<close>
 lemma \<open>\<not> \<not> ((P \<longrightarrow> Q) \<longleftrightarrow> (\<not> Q \<longrightarrow> \<not> P))\<close>
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 text\<open>\<open>\<not>\<not>\<close>2\<close>
 lemma \<open>\<not> \<not> (\<not> \<not> P \<longleftrightarrow> P)\<close>
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 text\<open>3\<close>
 lemma \<open>\<not> (P \<longrightarrow> Q) \<longrightarrow> (Q \<longrightarrow> P)\<close>
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 text\<open>\<open>\<not>\<not>\<close>4\<close>
 lemma \<open>\<not> \<not> ((\<not> P \<longrightarrow> Q) \<longleftrightarrow> (\<not> Q \<longrightarrow> P))\<close>
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 text\<open>\<open>\<not>\<not>\<close>5\<close>
 lemma \<open>\<not> \<not> ((P \<or> Q \<longrightarrow> P \<or> R) \<longrightarrow> P \<or> (Q \<longrightarrow> R))\<close>
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 text\<open>\<open>\<not>\<not>\<close>6\<close>
 lemma \<open>\<not> \<not> (P \<or> \<not> P)\<close>
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 text\<open>\<open>\<not>\<not>\<close>7\<close>
 lemma \<open>\<not> \<not> (P \<or> \<not> \<not> \<not> P)\<close>
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 text\<open>\<open>\<not>\<not>\<close>8. Peirce's law\<close>
 lemma \<open>\<not> \<not> (((P \<longrightarrow> Q) \<longrightarrow> P) \<longrightarrow> P)\<close>
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 text\<open>9\<close>
 lemma \<open>((P \<or> Q) \<and> (\<not> P \<or> Q) \<and> (P \<or> \<not> Q)) \<longrightarrow> \<not> (\<not> P \<or> \<not> Q)\<close>
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 text\<open>10\<close>
 lemma \<open>(Q \<longrightarrow> R) \<longrightarrow> (R \<longrightarrow> P \<and> Q) \<longrightarrow> (P \<longrightarrow> (Q \<or> R)) \<longrightarrow> (P \<longleftrightarrow> Q)\<close>
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 
 subsection\<open>11. Proved in each direction (incorrectly, says Pelletier!!)\<close>
 
 lemma \<open>P \<longleftrightarrow> P\<close>
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 text\<open>\<open>\<not>\<not>\<close>12. Dijkstra's law\<close>
 lemma \<open>\<not> \<not> (((P \<longleftrightarrow> Q) \<longleftrightarrow> R) \<longleftrightarrow> (P \<longleftrightarrow> (Q \<longleftrightarrow> R)))\<close>
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 lemma \<open>((P \<longleftrightarrow> Q) \<longleftrightarrow> R) \<longrightarrow> \<not> \<not> (P \<longleftrightarrow> (Q \<longleftrightarrow> R))\<close>
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 text\<open>13. Distributive law\<close>
 lemma \<open>P \<or> (Q \<and> R) \<longleftrightarrow> (P \<or> Q) \<and> (P \<or> R)\<close>
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 text\<open>\<open>\<not>\<not>\<close>14\<close>
 lemma \<open>\<not> \<not> ((P \<longleftrightarrow> Q) \<longleftrightarrow> ((Q \<or> \<not> P) \<and> (\<not> Q \<or> P)))\<close>
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 text\<open>\<open>\<not>\<not>\<close>15\<close>
 lemma \<open>\<not> \<not> ((P \<longrightarrow> Q) \<longleftrightarrow> (\<not> P \<or> Q))\<close>
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 text\<open>\<open>\<not>\<not>\<close>16\<close>
 lemma \<open>\<not> \<not> ((P \<longrightarrow> Q) \<or> (Q \<longrightarrow> P))\<close>
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 text\<open>\<open>\<not>\<not>\<close>17\<close>
 lemma \<open>\<not> \<not> (((P \<and> (Q \<longrightarrow> R)) \<longrightarrow> S) \<longleftrightarrow> ((\<not> P \<or> Q \<or> S) \<and> (\<not> P \<or> \<not> R \<or> S)))\<close>
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 text \<open>Dijkstra's ``Golden Rule''\<close>
 lemma \<open>(P \<and> Q) \<longleftrightarrow> P \<longleftrightarrow> Q \<longleftrightarrow> (P \<or> Q)\<close>
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 
 section \<open>Examples with quantifiers\<close>
@@ -219,47 +219,47 @@
 subsection \<open>The converse is classical in the following implications \dots\<close>
 
 lemma \<open>(\<exists>x. P(x) \<longrightarrow> Q) \<longrightarrow> (\<forall>x. P(x)) \<longrightarrow> Q\<close>
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 lemma \<open>((\<forall>x. P(x)) \<longrightarrow> Q) \<longrightarrow> \<not> (\<forall>x. P(x) \<and> \<not> Q)\<close>
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 lemma \<open>((\<forall>x. \<not> P(x)) \<longrightarrow> Q) \<longrightarrow> \<not> (\<forall>x. \<not> (P(x) \<or> Q))\<close>
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 lemma \<open>(\<forall>x. P(x)) \<or> Q \<longrightarrow> (\<forall>x. P(x) \<or> Q)\<close>
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 lemma \<open>(\<exists>x. P \<longrightarrow> Q(x)) \<longrightarrow> (P \<longrightarrow> (\<exists>x. Q(x)))\<close>
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 
 subsection \<open>The following are not constructively valid!\<close>
 text \<open>The attempt to prove them terminates quickly!\<close>
 
 lemma \<open>((\<forall>x. P(x)) \<longrightarrow> Q) \<longrightarrow> (\<exists>x. P(x) \<longrightarrow> Q)\<close>
-  apply (tactic \<open>IntPr.fast_tac @{context} 1\<close>)?
+  apply (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)?
   apply (rule asm_rl) \<comment> \<open>Checks that subgoals remain: proof failed.\<close>
   oops
 
 lemma \<open>(P \<longrightarrow> (\<exists>x. Q(x))) \<longrightarrow> (\<exists>x. P \<longrightarrow> Q(x))\<close>
-  apply (tactic \<open>IntPr.fast_tac @{context} 1\<close>)?
+  apply (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)?
   apply (rule asm_rl) \<comment> \<open>Checks that subgoals remain: proof failed.\<close>
   oops
 
 lemma \<open>(\<forall>x. P(x) \<or> Q) \<longrightarrow> ((\<forall>x. P(x)) \<or> Q)\<close>
-  apply (tactic \<open>IntPr.fast_tac @{context} 1\<close>)?
+  apply (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)?
   apply (rule asm_rl) \<comment> \<open>Checks that subgoals remain: proof failed.\<close>
   oops
 
 lemma \<open>(\<forall>x. \<not> \<not> P(x)) \<longrightarrow> \<not> \<not> (\<forall>x. P(x))\<close>
-  apply (tactic \<open>IntPr.fast_tac @{context} 1\<close>)?
+  apply (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)?
   apply (rule asm_rl) \<comment> \<open>Checks that subgoals remain: proof failed.\<close>
   oops
 
 text \<open>Classically but not intuitionistically valid.  Proved by a bug in 1986!\<close>
 lemma \<open>\<exists>x. Q(x) \<longrightarrow> (\<forall>x. Q(x))\<close>
-  apply (tactic \<open>IntPr.fast_tac @{context} 1\<close>)?
+  apply (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)?
   apply (rule asm_rl) \<comment> \<open>Checks that subgoals remain: proof failed.\<close>
   oops
 
@@ -283,7 +283,7 @@
 lemma
   \<open>(\<forall>x y. \<exists>z. \<forall>w. (P(x) \<and> Q(y) \<longrightarrow> R(z) \<and> S(w)))
     \<longrightarrow> (\<exists>x y. P(x) \<and> Q(y)) \<longrightarrow> (\<exists>z. R(z))\<close>
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 text\<open>21\<close>
 lemma \<open>(\<exists>x. P \<longrightarrow> Q(x)) \<and> (\<exists>x. Q(x) \<longrightarrow> P) \<longrightarrow> \<not> \<not> (\<exists>x. P \<longleftrightarrow> Q(x))\<close>
@@ -291,11 +291,11 @@
 
 text\<open>22\<close>
 lemma \<open>(\<forall>x. P \<longleftrightarrow> Q(x)) \<longrightarrow> (P \<longleftrightarrow> (\<forall>x. Q(x)))\<close>
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 text\<open>\<open>\<not>\<not>\<close>23\<close>
 lemma \<open>\<not> \<not> ((\<forall>x. P \<or> Q(x)) \<longleftrightarrow> (P \<or> (\<forall>x. Q(x))))\<close>
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 text\<open>24\<close>
 lemma
@@ -306,10 +306,10 @@
   Not clear why \<open>fast_tac\<close>, \<open>best_tac\<close>, \<open>ASTAR\<close> and
   \<open>ITER_DEEPEN\<close> all take forever.
 \<close>
-  apply (tactic \<open>IntPr.safe_tac @{context}\<close>)
+  apply (tactic \<open>IntPr.safe_tac \<^context>\<close>)
   apply (erule impE)
-  apply (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
-  apply (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  apply (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
+  apply (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
   done
 
 text\<open>25\<close>
@@ -319,7 +319,7 @@
       (\<forall>x. P(x) \<longrightarrow> (M(x) \<and> L(x))) \<and>
       ((\<forall>x. P(x) \<longrightarrow> Q(x)) \<or> (\<exists>x. P(x) \<and> R(x)))
     \<longrightarrow> (\<exists>x. Q(x) \<and> P(x))\<close>
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 text\<open>\<open>\<not>\<not>\<close>26\<close>
 lemma
@@ -335,7 +335,7 @@
     (\<forall>x. M(x) \<and> L(x) \<longrightarrow> P(x)) \<and>
     ((\<exists>x. R(x) \<and> \<not> Q(x)) \<longrightarrow> (\<forall>x. L(x) \<longrightarrow> \<not> R(x)))
   \<longrightarrow> (\<forall>x. M(x) \<longrightarrow> \<not> L(x))\<close>
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 text\<open>\<open>\<not>\<not>\<close>28. AMENDED\<close>
 lemma
@@ -343,21 +343,21 @@
       (\<not> \<not> (\<forall>x. Q(x) \<or> R(x)) \<longrightarrow> (\<exists>x. Q(x) \<and> S(x))) \<and>
       (\<not> \<not> (\<exists>x. S(x)) \<longrightarrow> (\<forall>x. L(x) \<longrightarrow> M(x)))
     \<longrightarrow> (\<forall>x. P(x) \<and> L(x) \<longrightarrow> M(x))\<close>
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 text\<open>29. Essentially the same as Principia Mathematica *11.71\<close>
 lemma
   \<open>(\<exists>x. P(x)) \<and> (\<exists>y. Q(y))
     \<longrightarrow> ((\<forall>x. P(x) \<longrightarrow> R(x)) \<and> (\<forall>y. Q(y) \<longrightarrow> S(y)) \<longleftrightarrow>
       (\<forall>x y. P(x) \<and> Q(y) \<longrightarrow> R(x) \<and> S(y)))\<close>
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 text\<open>\<open>\<not>\<not>\<close>30\<close>
 lemma
   \<open>(\<forall>x. (P(x) \<or> Q(x)) \<longrightarrow> \<not> R(x)) \<and>
       (\<forall>x. (Q(x) \<longrightarrow> \<not> S(x)) \<longrightarrow> P(x) \<and> R(x))
     \<longrightarrow> (\<forall>x. \<not> \<not> S(x))\<close>
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 text\<open>31\<close>
 lemma
@@ -365,7 +365,7 @@
       (\<exists>x. L(x) \<and> P(x)) \<and>
       (\<forall>x. \<not> R(x) \<longrightarrow> M(x))
   \<longrightarrow> (\<exists>x. L(x) \<and> M(x))\<close>
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 text\<open>32\<close>
 lemma
@@ -373,13 +373,13 @@
     (\<forall>x. S(x) \<and> R(x) \<longrightarrow> L(x)) \<and>
     (\<forall>x. M(x) \<longrightarrow> R(x))
   \<longrightarrow> (\<forall>x. P(x) \<and> M(x) \<longrightarrow> L(x))\<close>
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 text\<open>\<open>\<not>\<not>\<close>33\<close>
 lemma
   \<open>(\<forall>x. \<not> \<not> (P(a) \<and> (P(x) \<longrightarrow> P(b)) \<longrightarrow> P(c))) \<longleftrightarrow>
     (\<forall>x. \<not> \<not> ((\<not> P(a) \<or> P(x) \<or> P(c)) \<and> (\<not> P(a) \<or> \<not> P(b) \<or> P(c))))\<close>
-  apply (tactic \<open>IntPr.best_tac @{context} 1\<close>)
+  apply (tactic \<open>IntPr.best_tac \<^context> 1\<close>)
   done
 
 
@@ -389,7 +389,7 @@
     (\<forall>x. \<exists>y. G(x,y)) \<and>
     (\<forall>x y. J(x,y) \<or> G(x,y) \<longrightarrow> (\<forall>z. J(y,z) \<or> G(y,z) \<longrightarrow> H(x,z)))
   \<longrightarrow> (\<forall>x. \<exists>y. H(x,y))\<close>
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 text\<open>37\<close>
 lemma
@@ -402,13 +402,13 @@
 
 text\<open>39\<close>
 lemma \<open>\<not> (\<exists>x. \<forall>y. F(y,x) \<longleftrightarrow> \<not> F(y,y))\<close>
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 text\<open>40. AMENDED\<close>
 lemma
   \<open>(\<exists>y. \<forall>x. F(x,y) \<longleftrightarrow> F(x,x)) \<longrightarrow>
     \<not> (\<forall>x. \<exists>y. \<forall>z. F(z,y) \<longleftrightarrow> \<not> F(z,x))\<close>
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 text\<open>44\<close>
 lemma
@@ -416,37 +416,37 @@
     (\<exists>y. g(y) \<and> h(x,y) \<and> (\<exists>y. g(y) \<and> \<not> h(x,y)))) \<and>
     (\<exists>x. j(x) \<and> (\<forall>y. g(y) \<longrightarrow> h(x,y)))
     \<longrightarrow> (\<exists>x. j(x) \<and> \<not> f(x))\<close>
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 text\<open>48\<close>
 lemma \<open>(a = b \<or> c = d) \<and> (a = c \<or> b = d) \<longrightarrow> a = d \<or> b = c\<close>
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 text\<open>51\<close>
 lemma
   \<open>(\<exists>z w. \<forall>x y. P(x,y) \<longleftrightarrow> (x = z \<and> y = w)) \<longrightarrow>
     (\<exists>z. \<forall>x. \<exists>w. (\<forall>y. P(x,y) \<longleftrightarrow> y = w) \<longleftrightarrow> x = z)\<close>
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 text\<open>52\<close>
 text \<open>Almost the same as 51.\<close>
 lemma
   \<open>(\<exists>z w. \<forall>x y. P(x,y) \<longleftrightarrow> (x = z \<and> y = w)) \<longrightarrow>
     (\<exists>w. \<forall>y. \<exists>z. (\<forall>x. P(x,y) \<longleftrightarrow> x = z) \<longleftrightarrow> y = w)\<close>
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 text\<open>56\<close>
 lemma \<open>(\<forall>x. (\<exists>y. P(y) \<and> x = f(y)) \<longrightarrow> P(x)) \<longleftrightarrow> (\<forall>x. P(x) \<longrightarrow> P(f(x)))\<close>
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 text\<open>57\<close>
 lemma
   \<open>P(f(a,b), f(b,c)) \<and> P(f(b,c), f(a,c)) \<and>
     (\<forall>x y z. P(x,y) \<and> P(y,z) \<longrightarrow> P(x,z)) \<longrightarrow> P(f(a,b), f(a,c))\<close>
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 text\<open>60\<close>
 lemma \<open>\<forall>x. P(x,f(x)) \<longleftrightarrow> (\<exists>y. (\<forall>z. P(z,y) \<longrightarrow> P(z,f(x))) \<and> P(x,y))\<close>
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 end
--- a/src/FOL/ex/Locale_Test/Locale_Test1.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/FOL/ex/Locale_Test/Locale_Test1.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -162,8 +162,8 @@
 thm d1_def d2_def  (* should print as "D1(?x) <-> ..." and "D2(?x) <-> ..." *)
 
 ML \<open>
-  check_syntax @{context} @{thm d1_def} "D1(?x) \<longleftrightarrow> \<not> p2(p1(?x))";
-  check_syntax @{context} @{thm d2_def} "D2(?x) \<longleftrightarrow> \<not> p2(?x)";
+  check_syntax \<^context> @{thm d1_def} "D1(?x) \<longleftrightarrow> \<not> p2(p1(?x))";
+  check_syntax \<^context> @{thm d2_def} "D2(?x) \<longleftrightarrow> \<not> p2(?x)";
 \<close>
 
 end
@@ -175,8 +175,8 @@
   (* should print as "d1(?x) <-> ..." and "D2(?x) <-> ..." *)
 
 ML \<open>
-  check_syntax @{context} @{thm d1_def} "d1(?x) \<longleftrightarrow> \<not> p2(p3(?x))";
-  check_syntax @{context} @{thm d2_def} "D2(?x) \<longleftrightarrow> \<not> p2(?x)";
+  check_syntax \<^context> @{thm d1_def} "d1(?x) \<longleftrightarrow> \<not> p2(p3(?x))";
+  check_syntax \<^context> @{thm d2_def} "D2(?x) \<longleftrightarrow> \<not> p2(?x)";
 \<close>
 
 end
@@ -450,7 +450,7 @@
 interpretation int2?: semi \<open>(+)\<close>
   by unfold_locales  (* subsumed, thm int2.assoc not generated *)
 
-ML \<open>(Global_Theory.get_thms @{theory} "int2.assoc";
+ML \<open>(Global_Theory.get_thms \<^theory> "int2.assoc";
     raise Fail "thm int2.assoc was generated")
   handle ERROR _ => ([]:thm list);\<close>
 
--- a/src/FOL/ex/Miniscope.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/FOL/ex/Miniscope.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -68,7 +68,7 @@
 lemmas mini_simps = demorgans nnf_simps ex_simps all_simps
 
 ML \<open>
-val mini_ss = simpset_of (@{context} addsimps @{thms mini_simps});
+val mini_ss = simpset_of (\<^context> addsimps @{thms mini_simps});
 fun mini_tac ctxt =
   resolve_tac ctxt @{thms ccontr} THEN' asm_full_simp_tac (put_simpset mini_ss ctxt);
 \<close>
--- a/src/FOL/ex/Prolog.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/FOL/ex/Prolog.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -68,24 +68,24 @@
 \<close>
 
 schematic_goal \<open>rev(?x, a:b:c:Nil)\<close>
-apply (tactic \<open>prolog_tac @{context}\<close>)
+apply (tactic \<open>prolog_tac \<^context>\<close>)
 done
 
 schematic_goal \<open>rev(a:?x:c:?y:Nil, d:?z:b:?u)\<close>
-apply (tactic \<open>prolog_tac @{context}\<close>)
+apply (tactic \<open>prolog_tac \<^context>\<close>)
 done
 
 (*rev([a..p], ?w) requires 153 inferences *)
 schematic_goal \<open>rev(a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:p:Nil, ?w)\<close>
 apply (tactic \<open>
-  DEPTH_SOLVE (resolve_tac @{context} ([@{thm refl}, @{thm conjI}] @ @{thms rules}) 1)\<close>)
+  DEPTH_SOLVE (resolve_tac \<^context> ([@{thm refl}, @{thm conjI}] @ @{thms rules}) 1)\<close>)
 done
 
 (*?x has 16, ?y has 32;  rev(?y,?w) requires 561 (rather large) inferences
   total inferences = 2 + 1 + 17 + 561 = 581*)
 schematic_goal \<open>a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:p:Nil = ?x \<and> app(?x,?x,?y) \<and> rev(?y,?w)\<close>
 apply (tactic \<open>
-  DEPTH_SOLVE (resolve_tac @{context} ([@{thm refl}, @{thm conjI}] @ @{thms rules}) 1)\<close>)
+  DEPTH_SOLVE (resolve_tac \<^context> ([@{thm refl}, @{thm conjI}] @ @{thms rules}) 1)\<close>)
 done
 
 end
--- a/src/FOL/ex/Propositional_Cla.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/FOL/ex/Propositional_Cla.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -12,7 +12,7 @@
 text \<open>commutative laws of \<open>\<and>\<close> and \<open>\<or>\<close>\<close>
 
 lemma \<open>P \<and> Q \<longrightarrow> Q \<and> P\<close>
-  by (tactic "IntPr.fast_tac @{context} 1")
+  by (tactic "IntPr.fast_tac \<^context> 1")
 
 lemma \<open>P \<or> Q \<longrightarrow> Q \<or> P\<close>
   by fast
--- a/src/FOL/ex/Propositional_Int.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/FOL/ex/Propositional_Int.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -12,94 +12,94 @@
 text \<open>commutative laws of \<open>\<and>\<close> and \<open>\<or>\<close>\<close>
 
 lemma \<open>P \<and> Q \<longrightarrow> Q \<and> P\<close>
-  by (tactic "IntPr.fast_tac @{context} 1")
+  by (tactic "IntPr.fast_tac \<^context> 1")
 
 lemma \<open>P \<or> Q \<longrightarrow> Q \<or> P\<close>
-  by (tactic "IntPr.fast_tac @{context} 1")
+  by (tactic "IntPr.fast_tac \<^context> 1")
 
 
 text \<open>associative laws of \<open>\<and>\<close> and \<open>\<or>\<close>\<close>
 lemma \<open>(P \<and> Q) \<and> R \<longrightarrow> P \<and> (Q \<and> R)\<close>
-  by (tactic "IntPr.fast_tac @{context} 1")
+  by (tactic "IntPr.fast_tac \<^context> 1")
 
 lemma \<open>(P \<or> Q) \<or> R \<longrightarrow> P \<or> (Q \<or> R)\<close>
-  by (tactic "IntPr.fast_tac @{context} 1")
+  by (tactic "IntPr.fast_tac \<^context> 1")
 
 
 text \<open>distributive laws of \<open>\<and>\<close> and \<open>\<or>\<close>\<close>
 lemma \<open>(P \<and> Q) \<or> R \<longrightarrow> (P \<or> R) \<and> (Q \<or> R)\<close>
-  by (tactic "IntPr.fast_tac @{context} 1")
+  by (tactic "IntPr.fast_tac \<^context> 1")
 
 lemma \<open>(P \<or> R) \<and> (Q \<or> R) \<longrightarrow> (P \<and> Q) \<or> R\<close>
-  by (tactic "IntPr.fast_tac @{context} 1")
+  by (tactic "IntPr.fast_tac \<^context> 1")
 
 lemma \<open>(P \<or> Q) \<and> R \<longrightarrow> (P \<and> R) \<or> (Q \<and> R)\<close>
-  by (tactic "IntPr.fast_tac @{context} 1")
+  by (tactic "IntPr.fast_tac \<^context> 1")
 
 lemma \<open>(P \<and> R) \<or> (Q \<and> R) \<longrightarrow> (P \<or> Q) \<and> R\<close>
-  by (tactic "IntPr.fast_tac @{context} 1")
+  by (tactic "IntPr.fast_tac \<^context> 1")
 
 
 text \<open>Laws involving implication\<close>
 
 lemma \<open>(P \<longrightarrow> R) \<and> (Q \<longrightarrow> R) \<longleftrightarrow> (P \<or> Q \<longrightarrow> R)\<close>
-  by (tactic "IntPr.fast_tac @{context} 1")
+  by (tactic "IntPr.fast_tac \<^context> 1")
 
 lemma \<open>(P \<and> Q \<longrightarrow> R) \<longleftrightarrow> (P \<longrightarrow> (Q \<longrightarrow> R))\<close>
-  by (tactic "IntPr.fast_tac @{context} 1")
+  by (tactic "IntPr.fast_tac \<^context> 1")
 
 lemma \<open>((P \<longrightarrow> R) \<longrightarrow> R) \<longrightarrow> ((Q \<longrightarrow> R) \<longrightarrow> R) \<longrightarrow> (P \<and> Q \<longrightarrow> R) \<longrightarrow> R\<close>
-  by (tactic "IntPr.fast_tac @{context} 1")
+  by (tactic "IntPr.fast_tac \<^context> 1")
 
 lemma \<open>\<not> (P \<longrightarrow> R) \<longrightarrow> \<not> (Q \<longrightarrow> R) \<longrightarrow> \<not> (P \<and> Q \<longrightarrow> R)\<close>
-  by (tactic "IntPr.fast_tac @{context} 1")
+  by (tactic "IntPr.fast_tac \<^context> 1")
 
 lemma \<open>(P \<longrightarrow> Q \<and> R) \<longleftrightarrow> (P \<longrightarrow> Q) \<and> (P \<longrightarrow> R)\<close>
-  by (tactic "IntPr.fast_tac @{context} 1")
+  by (tactic "IntPr.fast_tac \<^context> 1")
 
 
 text \<open>Propositions-as-types\<close>
 
 \<comment> \<open>The combinator K\<close>
 lemma \<open>P \<longrightarrow> (Q \<longrightarrow> P)\<close>
-  by (tactic "IntPr.fast_tac @{context} 1")
+  by (tactic "IntPr.fast_tac \<^context> 1")
 
 \<comment> \<open>The combinator S\<close>
 lemma \<open>(P \<longrightarrow> Q \<longrightarrow> R) \<longrightarrow> (P \<longrightarrow> Q) \<longrightarrow> (P \<longrightarrow> R)\<close>
-  by (tactic "IntPr.fast_tac @{context} 1")
+  by (tactic "IntPr.fast_tac \<^context> 1")
 
 
 \<comment> \<open>Converse is classical\<close>
 lemma \<open>(P \<longrightarrow> Q) \<or> (P \<longrightarrow> R) \<longrightarrow> (P \<longrightarrow> Q \<or> R)\<close>
-  by (tactic "IntPr.fast_tac @{context} 1")
+  by (tactic "IntPr.fast_tac \<^context> 1")
 
 lemma \<open>(P \<longrightarrow> Q) \<longrightarrow> (\<not> Q \<longrightarrow> \<not> P)\<close>
-  by (tactic "IntPr.fast_tac @{context} 1")
+  by (tactic "IntPr.fast_tac \<^context> 1")
 
 
 text \<open>Schwichtenberg's examples (via T. Nipkow)\<close>
 
 lemma stab_imp: \<open>(((Q \<longrightarrow> R) \<longrightarrow> R) \<longrightarrow> Q) \<longrightarrow> (((P \<longrightarrow> Q) \<longrightarrow> R) \<longrightarrow> R) \<longrightarrow> P \<longrightarrow> Q\<close>
-  by (tactic "IntPr.fast_tac @{context} 1")
+  by (tactic "IntPr.fast_tac \<^context> 1")
 
 lemma stab_to_peirce:
   \<open>(((P \<longrightarrow> R) \<longrightarrow> R) \<longrightarrow> P) \<longrightarrow> (((Q \<longrightarrow> R) \<longrightarrow> R) \<longrightarrow> Q)
     \<longrightarrow> ((P \<longrightarrow> Q) \<longrightarrow> P) \<longrightarrow> P\<close>
-  by (tactic "IntPr.fast_tac @{context} 1")
+  by (tactic "IntPr.fast_tac \<^context> 1")
 
 lemma peirce_imp1:
   \<open>(((Q \<longrightarrow> R) \<longrightarrow> Q) \<longrightarrow> Q)
     \<longrightarrow> (((P \<longrightarrow> Q) \<longrightarrow> R) \<longrightarrow> P \<longrightarrow> Q) \<longrightarrow> P \<longrightarrow> Q\<close>
-  by (tactic "IntPr.fast_tac @{context} 1")
+  by (tactic "IntPr.fast_tac \<^context> 1")
 
 lemma peirce_imp2: \<open>(((P \<longrightarrow> R) \<longrightarrow> P) \<longrightarrow> P) \<longrightarrow> ((P \<longrightarrow> Q \<longrightarrow> R) \<longrightarrow> P) \<longrightarrow> P\<close>
-  by (tactic "IntPr.fast_tac @{context} 1")
+  by (tactic "IntPr.fast_tac \<^context> 1")
 
 lemma mints: \<open>((((P \<longrightarrow> Q) \<longrightarrow> P) \<longrightarrow> P) \<longrightarrow> Q) \<longrightarrow> Q\<close>
-  by (tactic "IntPr.fast_tac @{context} 1")
+  by (tactic "IntPr.fast_tac \<^context> 1")
 
 lemma mints_solovev: \<open>(P \<longrightarrow> (Q \<longrightarrow> R) \<longrightarrow> Q) \<longrightarrow> ((P \<longrightarrow> Q) \<longrightarrow> R) \<longrightarrow> R\<close>
-  by (tactic "IntPr.fast_tac @{context} 1")
+  by (tactic "IntPr.fast_tac \<^context> 1")
 
 lemma tatsuta:
   \<open>(((P7 \<longrightarrow> P1) \<longrightarrow> P10) \<longrightarrow> P4 \<longrightarrow> P5)
@@ -107,7 +107,7 @@
   \<longrightarrow> (P1 \<longrightarrow> P8) \<longrightarrow> P6 \<longrightarrow> P7
   \<longrightarrow> (((P3 \<longrightarrow> P2) \<longrightarrow> P9) \<longrightarrow> P4)
   \<longrightarrow> (P1 \<longrightarrow> P3) \<longrightarrow> (((P6 \<longrightarrow> P1) \<longrightarrow> P2) \<longrightarrow> P9) \<longrightarrow> P5\<close>
-  by (tactic "IntPr.fast_tac @{context} 1")
+  by (tactic "IntPr.fast_tac \<^context> 1")
 
 lemma tatsuta1:
   \<open>(((P8 \<longrightarrow> P2) \<longrightarrow> P9) \<longrightarrow> P3 \<longrightarrow> P10)
@@ -115,6 +115,6 @@
   \<longrightarrow> (((P6 \<longrightarrow> P1) \<longrightarrow> P2) \<longrightarrow> P9)
   \<longrightarrow> (((P7 \<longrightarrow> P1) \<longrightarrow> P10) \<longrightarrow> P4 \<longrightarrow> P5)
   \<longrightarrow> (P1 \<longrightarrow> P3) \<longrightarrow> (P1 \<longrightarrow> P8) \<longrightarrow> P6 \<longrightarrow> P7 \<longrightarrow> P5\<close>
-  by (tactic "IntPr.fast_tac @{context} 1")
+  by (tactic "IntPr.fast_tac \<^context> 1")
 
 end
--- a/src/FOL/ex/Quantifiers_Int.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/FOL/ex/Quantifiers_Int.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -10,91 +10,91 @@
 begin
 
 lemma \<open>(\<forall>x y. P(x,y)) \<longrightarrow> (\<forall>y x. P(x,y))\<close>
-  by (tactic "IntPr.fast_tac @{context} 1")
+  by (tactic "IntPr.fast_tac \<^context> 1")
 
 lemma \<open>(\<exists>x y. P(x,y)) \<longrightarrow> (\<exists>y x. P(x,y))\<close>
-  by (tactic "IntPr.fast_tac @{context} 1")
+  by (tactic "IntPr.fast_tac \<^context> 1")
 
 
 \<comment> \<open>Converse is false\<close>
 lemma \<open>(\<forall>x. P(x)) \<or> (\<forall>x. Q(x)) \<longrightarrow> (\<forall>x. P(x) \<or> Q(x))\<close>
-  by (tactic "IntPr.fast_tac @{context} 1")
+  by (tactic "IntPr.fast_tac \<^context> 1")
 
 lemma \<open>(\<forall>x. P \<longrightarrow> Q(x)) \<longleftrightarrow> (P \<longrightarrow> (\<forall>x. Q(x)))\<close>
-  by (tactic "IntPr.fast_tac @{context} 1")
+  by (tactic "IntPr.fast_tac \<^context> 1")
 
 
 lemma \<open>(\<forall>x. P(x) \<longrightarrow> Q) \<longleftrightarrow> ((\<exists>x. P(x)) \<longrightarrow> Q)\<close>
-  by (tactic "IntPr.fast_tac @{context} 1")
+  by (tactic "IntPr.fast_tac \<^context> 1")
 
 
 text \<open>Some harder ones\<close>
 
 lemma \<open>(\<exists>x. P(x) \<or> Q(x)) \<longleftrightarrow> (\<exists>x. P(x)) \<or> (\<exists>x. Q(x))\<close>
-  by (tactic "IntPr.fast_tac @{context} 1")
+  by (tactic "IntPr.fast_tac \<^context> 1")
 
 \<comment> \<open>Converse is false\<close>
 lemma \<open>(\<exists>x. P(x) \<and> Q(x)) \<longrightarrow> (\<exists>x. P(x)) \<and> (\<exists>x. Q(x))\<close>
-  by (tactic "IntPr.fast_tac @{context} 1")
+  by (tactic "IntPr.fast_tac \<^context> 1")
 
 
 text \<open>Basic test of quantifier reasoning\<close>
 
 \<comment> \<open>TRUE\<close>
 lemma \<open>(\<exists>y. \<forall>x. Q(x,y)) \<longrightarrow> (\<forall>x. \<exists>y. Q(x,y))\<close>
-  by (tactic "IntPr.fast_tac @{context} 1")
+  by (tactic "IntPr.fast_tac \<^context> 1")
 
 lemma \<open>(\<forall>x. Q(x)) \<longrightarrow> (\<exists>x. Q(x))\<close>
-  by (tactic "IntPr.fast_tac @{context} 1")
+  by (tactic "IntPr.fast_tac \<^context> 1")
 
 
 text \<open>The following should fail, as they are false!\<close>
 
 lemma \<open>(\<forall>x. \<exists>y. Q(x,y)) \<longrightarrow> (\<exists>y. \<forall>x. Q(x,y))\<close>
-  apply (tactic "IntPr.fast_tac @{context} 1")?
+  apply (tactic "IntPr.fast_tac \<^context> 1")?
   oops
 
 lemma \<open>(\<exists>x. Q(x)) \<longrightarrow> (\<forall>x. Q(x))\<close>
-  apply (tactic "IntPr.fast_tac @{context} 1")?
+  apply (tactic "IntPr.fast_tac \<^context> 1")?
   oops
 
 schematic_goal \<open>P(?a) \<longrightarrow> (\<forall>x. P(x))\<close>
-  apply (tactic "IntPr.fast_tac @{context} 1")?
+  apply (tactic "IntPr.fast_tac \<^context> 1")?
   oops
 
 schematic_goal \<open>(P(?a) \<longrightarrow> (\<forall>x. Q(x))) \<longrightarrow> (\<forall>x. P(x) \<longrightarrow> Q(x))\<close>
-  apply (tactic "IntPr.fast_tac @{context} 1")?
+  apply (tactic "IntPr.fast_tac \<^context> 1")?
   oops
 
 
 text \<open>Back to things that are provable \dots\<close>
 
 lemma \<open>(\<forall>x. P(x) \<longrightarrow> Q(x)) \<and> (\<exists>x. P(x)) \<longrightarrow> (\<exists>x. Q(x))\<close>
-  by (tactic "IntPr.fast_tac @{context} 1")
+  by (tactic "IntPr.fast_tac \<^context> 1")
 
 \<comment> \<open>An example of why exI should be delayed as long as possible\<close>
 lemma \<open>(P \<longrightarrow> (\<exists>x. Q(x))) \<and> P \<longrightarrow> (\<exists>x. Q(x))\<close>
-  by (tactic "IntPr.fast_tac @{context} 1")
+  by (tactic "IntPr.fast_tac \<^context> 1")
 
 schematic_goal \<open>(\<forall>x. P(x) \<longrightarrow> Q(f(x))) \<and> (\<forall>x. Q(x) \<longrightarrow> R(g(x))) \<and> P(d) \<longrightarrow> R(?a)\<close>
-  by (tactic "IntPr.fast_tac @{context} 1")
+  by (tactic "IntPr.fast_tac \<^context> 1")
 
 lemma \<open>(\<forall>x. Q(x)) \<longrightarrow> (\<exists>x. Q(x))\<close>
-  by (tactic "IntPr.fast_tac @{context} 1")
+  by (tactic "IntPr.fast_tac \<^context> 1")
 
 
 text \<open>Some slow ones\<close>
 
 \<comment> \<open>Principia Mathematica *11.53\<close>
 lemma \<open>(\<forall>x y. P(x) \<longrightarrow> Q(y)) \<longleftrightarrow> ((\<exists>x. P(x)) \<longrightarrow> (\<forall>y. Q(y)))\<close>
-  by (tactic "IntPr.fast_tac @{context} 1")
+  by (tactic "IntPr.fast_tac \<^context> 1")
 
 (*Principia Mathematica *11.55  *)
 lemma \<open>(\<exists>x y. P(x) \<and> Q(x,y)) \<longleftrightarrow> (\<exists>x. P(x) \<and> (\<exists>y. Q(x,y)))\<close>
-  by (tactic "IntPr.fast_tac @{context} 1")
+  by (tactic "IntPr.fast_tac \<^context> 1")
 
 (*Principia Mathematica *11.61  *)
 lemma \<open>(\<exists>y. \<forall>x. P(x) \<longrightarrow> Q(x,y)) \<longrightarrow> (\<forall>x. P(x) \<longrightarrow> (\<exists>y. Q(x,y)))\<close>
-  by (tactic "IntPr.fast_tac @{context} 1")
+  by (tactic "IntPr.fast_tac \<^context> 1")
 
 end
--- a/src/FOL/fologic.ML	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/FOL/fologic.ML	Fri Jan 04 23:22:53 2019 +0100
@@ -37,48 +37,48 @@
 structure FOLogic: FOLOGIC =
 struct
 
-val oT = Type(@{type_name o},[]);
+val oT = Type(\<^type_name>\<open>o\<close>,[]);
 
-val Trueprop = Const(@{const_name Trueprop}, oT-->propT);
+val Trueprop = Const(\<^const_name>\<open>Trueprop\<close>, oT-->propT);
 
 fun mk_Trueprop P = Trueprop $ P;
 
-fun dest_Trueprop (Const (@{const_name Trueprop}, _) $ P) = P
+fun dest_Trueprop (Const (\<^const_name>\<open>Trueprop\<close>, _) $ P) = P
   | dest_Trueprop t = raise TERM ("dest_Trueprop", [t]);
 
 
 (* Logical constants *)
 
-val not = Const (@{const_name Not}, oT --> oT);
-val conj = Const(@{const_name conj}, [oT,oT]--->oT);
-val disj = Const(@{const_name disj}, [oT,oT]--->oT);
-val imp = Const(@{const_name imp}, [oT,oT]--->oT)
-val iff = Const(@{const_name iff}, [oT,oT]--->oT);
+val not = Const (\<^const_name>\<open>Not\<close>, oT --> oT);
+val conj = Const(\<^const_name>\<open>conj\<close>, [oT,oT]--->oT);
+val disj = Const(\<^const_name>\<open>disj\<close>, [oT,oT]--->oT);
+val imp = Const(\<^const_name>\<open>imp\<close>, [oT,oT]--->oT)
+val iff = Const(\<^const_name>\<open>iff\<close>, [oT,oT]--->oT);
 
 fun mk_conj (t1, t2) = conj $ t1 $ t2
 and mk_disj (t1, t2) = disj $ t1 $ t2
 and mk_imp (t1, t2) = imp $ t1 $ t2
 and mk_iff (t1, t2) = iff $ t1 $ t2;
 
-fun dest_imp (Const(@{const_name imp},_) $ A $ B) = (A, B)
+fun dest_imp (Const(\<^const_name>\<open>imp\<close>,_) $ A $ B) = (A, B)
   | dest_imp  t = raise TERM ("dest_imp", [t]);
 
-fun dest_conj (Const (@{const_name conj}, _) $ t $ t') = t :: dest_conj t'
+fun dest_conj (Const (\<^const_name>\<open>conj\<close>, _) $ t $ t') = t :: dest_conj t'
   | dest_conj t = [t];
 
-fun dest_iff (Const(@{const_name iff},_) $ A $ B) = (A, B)
+fun dest_iff (Const(\<^const_name>\<open>iff\<close>,_) $ A $ B) = (A, B)
   | dest_iff  t = raise TERM ("dest_iff", [t]);
 
-fun eq_const T = Const (@{const_name eq}, [T, T] ---> oT);
+fun eq_const T = Const (\<^const_name>\<open>eq\<close>, [T, T] ---> oT);
 fun mk_eq (t, u) = eq_const (fastype_of t) $ t $ u;
 
-fun dest_eq (Const (@{const_name eq}, _) $ lhs $ rhs) = (lhs, rhs)
+fun dest_eq (Const (\<^const_name>\<open>eq\<close>, _) $ lhs $ rhs) = (lhs, rhs)
   | dest_eq t = raise TERM ("dest_eq", [t])
 
-fun all_const T = Const (@{const_name All}, [T --> oT] ---> oT);
+fun all_const T = Const (\<^const_name>\<open>All\<close>, [T --> oT] ---> oT);
 fun mk_all (Free (x, T), P) = all_const T $ absfree (x, T) P;
 
-fun exists_const T = Const (@{const_name Ex}, [T --> oT] ---> oT);
+fun exists_const T = Const (\<^const_name>\<open>Ex\<close>, [T --> oT] ---> oT);
 fun mk_exists (Free (x, T), P) = exists_const T $ absfree (x, T) P;
 
 
--- a/src/FOL/simpdata.ML	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/FOL/simpdata.ML	Fri Jan 04 23:22:53 2019 +0100
@@ -9,16 +9,16 @@
 
 fun mk_meta_eq th =
   (case Thm.concl_of th of
-    _ $ (Const(@{const_name eq},_)$_$_)   => th RS @{thm eq_reflection}
-  | _ $ (Const(@{const_name iff},_)$_$_) => th RS @{thm iff_reflection}
+    _ $ (Const(\<^const_name>\<open>eq\<close>,_)$_$_)   => th RS @{thm eq_reflection}
+  | _ $ (Const(\<^const_name>\<open>iff\<close>,_)$_$_) => th RS @{thm iff_reflection}
   | _ => error "conclusion must be a =-equality or <->");
 
 fun mk_eq th =
   (case Thm.concl_of th of
-    Const(@{const_name Pure.eq},_)$_$_ => th
-  | _ $ (Const(@{const_name eq},_)$_$_)   => mk_meta_eq th
-  | _ $ (Const(@{const_name iff},_)$_$_) => mk_meta_eq th
-  | _ $ (Const(@{const_name Not},_)$_)      => th RS @{thm iff_reflection_F}
+    Const(\<^const_name>\<open>Pure.eq\<close>,_)$_$_ => th
+  | _ $ (Const(\<^const_name>\<open>eq\<close>,_)$_$_)   => mk_meta_eq th
+  | _ $ (Const(\<^const_name>\<open>iff\<close>,_)$_$_) => mk_meta_eq th
+  | _ $ (Const(\<^const_name>\<open>Not\<close>,_)$_)      => th RS @{thm iff_reflection_F}
   | _  => th RS @{thm iff_reflection_T});
 
 (*Replace premises x=y, X<->Y by X==Y*)
@@ -33,14 +33,14 @@
       error("Premises and conclusion of congruence rules must use =-equality or <->");
 
 val mksimps_pairs =
-  [(@{const_name imp}, [@{thm mp}]), (@{const_name conj}, [@{thm conjunct1}, @{thm conjunct2}]),
-   (@{const_name All}, [@{thm spec}]), (@{const_name True}, []), (@{const_name False}, [])];
+  [(\<^const_name>\<open>imp\<close>, [@{thm mp}]), (\<^const_name>\<open>conj\<close>, [@{thm conjunct1}, @{thm conjunct2}]),
+   (\<^const_name>\<open>All\<close>, [@{thm spec}]), (\<^const_name>\<open>True\<close>, []), (\<^const_name>\<open>False\<close>, [])];
 
 fun mk_atomize pairs =
   let
     fun atoms th =
       (case Thm.concl_of th of
-         Const(@{const_name Trueprop},_) $ p =>
+         Const(\<^const_name>\<open>Trueprop\<close>,_) $ p =>
            (case head_of p of
               Const(a,_) =>
                 (case AList.lookup (op =) pairs a of
@@ -57,11 +57,11 @@
 structure Quantifier1 = Quantifier1
 (
   (*abstract syntax*)
-  fun dest_eq (Const (@{const_name eq}, _) $ s $ t) = SOME (s, t)
+  fun dest_eq (Const (\<^const_name>\<open>eq\<close>, _) $ s $ t) = SOME (s, t)
     | dest_eq _ = NONE
-  fun dest_conj (Const (@{const_name conj}, _) $ s $ t) = SOME (s, t)
+  fun dest_conj (Const (\<^const_name>\<open>conj\<close>, _) $ s $ t) = SOME (s, t)
     | dest_conj _ = NONE
-  fun dest_imp (Const (@{const_name imp}, _) $ s $ t) = SOME (s, t)
+  fun dest_imp (Const (\<^const_name>\<open>imp\<close>, _) $ s $ t) = SOME (s, t)
     | dest_imp _ = NONE
   val conj = FOLogic.conj
   val imp  = FOLogic.imp
@@ -87,7 +87,7 @@
 
 structure Splitter = Splitter
 (
-  val context = @{context}
+  val context = \<^context>
   val mk_eq = mk_eq
   val meta_eq_to_iff = @{thm meta_eq_to_iff}
   val iffD = @{thm iffD2}
@@ -121,7 +121,7 @@
 
 (*No simprules, but basic infastructure for simplification*)
 val FOL_basic_ss =
-  empty_simpset @{context}
+  empty_simpset \<^context>
   setSSolver (mk_solver "FOL safe" safe_solver)
   setSolver (mk_solver "FOL unsafe" unsafe_solver)
   |> Simplifier.set_subgoaler asm_simp_tac
--- a/src/FOLP/FOLP.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/FOLP/FOLP.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -56,8 +56,8 @@
     and r2: "!!y. y:Q ==> g(y):R"
   shows "?p : R"
   apply (rule excluded_middle [THEN disjE])
-   apply (tactic \<open>DEPTH_SOLVE (assume_tac @{context} 1 ORELSE
-       resolve_tac @{context} [@{thm r1}, @{thm r2}, @{thm major} RS @{thm mp}] 1)\<close>)
+   apply (tactic \<open>DEPTH_SOLVE (assume_tac \<^context> 1 ORELSE
+       resolve_tac \<^context> [@{thm r1}, @{thm r2}, @{thm major} RS @{thm mp}] 1)\<close>)
   done
 
 (*Double negation law*)
@@ -80,10 +80,10 @@
   apply (insert major)
   apply (unfold iff_def)
   apply (rule conjE)
-  apply (tactic \<open>DEPTH_SOLVE_1 (eresolve_tac @{context} @{thms impCE} 1 ORELSE
-      eresolve_tac @{context} [@{thm notE}, @{thm impE}] 1 THEN assume_tac @{context} 1 ORELSE
-      assume_tac @{context} 1 ORELSE
-      resolve_tac @{context} [@{thm r1}, @{thm r2}] 1)\<close>)+
+  apply (tactic \<open>DEPTH_SOLVE_1 (eresolve_tac \<^context> @{thms impCE} 1 ORELSE
+      eresolve_tac \<^context> [@{thm notE}, @{thm impE}] 1 THEN assume_tac \<^context> 1 ORELSE
+      assume_tac \<^context> 1 ORELSE
+      resolve_tac \<^context> [@{thm r1}, @{thm r2}] 1)\<close>)+
   done
 
 
@@ -135,7 +135,7 @@
   "?p2 : ~P | P"
   "?p3 : ~ ~ P <-> P"
   "?p4 : (~P --> P) <-> P"
-  apply (tactic \<open>ALLGOALS (Cla.fast_tac @{context} FOLP_cs)\<close>)
+  apply (tactic \<open>ALLGOALS (Cla.fast_tac \<^context> FOLP_cs)\<close>)
   done
 
 ML_file "simpdata.ML"
--- a/src/FOLP/IFOLP.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/FOLP/IFOLP.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -62,19 +62,19 @@
 syntax "_Proof" :: "[p,o]=>prop"    ("(_ /: _)" [51, 10] 5)
 
 parse_translation \<open>
-  let fun proof_tr [p, P] = Const (@{const_syntax Proof}, dummyT) $ P $ p
-  in [(@{syntax_const "_Proof"}, K proof_tr)] end
+  let fun proof_tr [p, P] = Const (\<^const_syntax>\<open>Proof\<close>, dummyT) $ P $ p
+  in [(\<^syntax_const>\<open>_Proof\<close>, K proof_tr)] end
 \<close>
 
 (*show_proofs = true displays the proof terms -- they are ENORMOUS*)
-ML \<open>val show_proofs = Attrib.setup_config_bool @{binding show_proofs} (K false)\<close>
+ML \<open>val show_proofs = Attrib.setup_config_bool \<^binding>\<open>show_proofs\<close> (K false)\<close>
 
 print_translation \<open>
   let
     fun proof_tr' ctxt [P, p] =
-      if Config.get ctxt show_proofs then Const (@{syntax_const "_Proof"}, dummyT) $ p $ P
+      if Config.get ctxt show_proofs then Const (\<^syntax_const>\<open>_Proof\<close>, dummyT) $ p $ P
       else P
-  in [(@{const_syntax Proof}, proof_tr')] end
+  in [(\<^const_syntax>\<open>Proof\<close>, proof_tr')] end
 \<close>
 
 
@@ -250,7 +250,7 @@
 
 ML \<open>
 local
-  fun discard_proof (Const (@{const_name Proof}, _) $ P $ _) = P;
+  fun discard_proof (Const (\<^const_name>\<open>Proof\<close>, _) $ P $ _) = P;
 in
 fun uniq_assume_tac ctxt =
   SUBGOAL
@@ -504,19 +504,19 @@
 schematic_goal pred1_cong: "p:a=a' ==> ?p:P(a) <-> P(a')"
   apply (rule iffI)
    apply (tactic \<open>
-     DEPTH_SOLVE (assume_tac @{context} 1 ORELSE eresolve_tac @{context} [@{thm subst}, @{thm ssubst}] 1)\<close>)
+     DEPTH_SOLVE (assume_tac \<^context> 1 ORELSE eresolve_tac \<^context> [@{thm subst}, @{thm ssubst}] 1)\<close>)
   done
 
 schematic_goal pred2_cong: "[| p:a=a';  q:b=b' |] ==> ?p:P(a,b) <-> P(a',b')"
   apply (rule iffI)
    apply (tactic \<open>
-     DEPTH_SOLVE (assume_tac @{context} 1 ORELSE eresolve_tac @{context} [@{thm subst}, @{thm ssubst}] 1)\<close>)
+     DEPTH_SOLVE (assume_tac \<^context> 1 ORELSE eresolve_tac \<^context> [@{thm subst}, @{thm ssubst}] 1)\<close>)
   done
 
 schematic_goal pred3_cong: "[| p:a=a';  q:b=b';  r:c=c' |] ==> ?p:P(a,b,c) <-> P(a',b',c')"
   apply (rule iffI)
    apply (tactic \<open>
-     DEPTH_SOLVE (assume_tac @{context} 1 ORELSE eresolve_tac @{context} [@{thm subst}, @{thm ssubst}] 1)\<close>)
+     DEPTH_SOLVE (assume_tac \<^context> 1 ORELSE eresolve_tac \<^context> [@{thm subst}, @{thm ssubst}] 1)\<close>)
   done
 
 lemmas pred_congs = pred1_cong pred2_cong pred3_cong
@@ -543,8 +543,8 @@
   assumes major: "p:(P|Q)-->S"
     and minor: "!!x y.[| x:P-->S; y:Q-->S |] ==> q(x,y):R"
   shows "?p:R"
-  apply (tactic \<open>DEPTH_SOLVE (assume_tac @{context} 1 ORELSE
-      resolve_tac @{context} [@{thm disjI1}, @{thm disjI2}, @{thm impI},
+  apply (tactic \<open>DEPTH_SOLVE (assume_tac \<^context> 1 ORELSE
+      resolve_tac \<^context> [@{thm disjI1}, @{thm disjI2}, @{thm impI},
         @{thm major} RS @{thm mp}, @{thm minor}] 1)\<close>)
   done
 
@@ -611,8 +611,8 @@
 structure Hypsubst = Hypsubst
 (
   (*Take apart an equality judgement; otherwise raise Match!*)
-  fun dest_eq (Const (@{const_name Proof}, _) $
-    (Const (@{const_name eq}, _)  $ t $ u) $ _) = (t, u);
+  fun dest_eq (Const (\<^const_name>\<open>Proof\<close>, _) $
+    (Const (\<^const_name>\<open>eq\<close>, _)  $ t $ u) $ _) = (t, u);
 
   val imp_intr = @{thm impI}
 
@@ -641,7 +641,7 @@
   "?p6 : P & ~P <-> False"
   "?p7 : ~P & P <-> False"
   "?p8 : (P & Q) & R <-> P & (Q & R)"
-  apply (tactic \<open>fn st => IntPr.fast_tac @{context} 1 st\<close>)+
+  apply (tactic \<open>fn st => IntPr.fast_tac \<^context> 1 st\<close>)+
   done
 
 schematic_goal disj_rews:
@@ -651,13 +651,13 @@
   "?p4 : False | P <-> P"
   "?p5 : P | P <-> P"
   "?p6 : (P | Q) | R <-> P | (Q | R)"
-  apply (tactic \<open>IntPr.fast_tac @{context} 1\<close>)+
+  apply (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)+
   done
 
 schematic_goal not_rews:
   "?p1 : ~ False <-> True"
   "?p2 : ~ True <-> False"
-  apply (tactic \<open>IntPr.fast_tac @{context} 1\<close>)+
+  apply (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)+
   done
 
 schematic_goal imp_rews:
@@ -667,7 +667,7 @@
   "?p4 : (True --> P) <-> P"
   "?p5 : (P --> P) <-> True"
   "?p6 : (P --> ~P) <-> ~P"
-  apply (tactic \<open>IntPr.fast_tac @{context} 1\<close>)+
+  apply (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)+
   done
 
 schematic_goal iff_rews:
@@ -676,13 +676,13 @@
   "?p3 : (P <-> P) <-> True"
   "?p4 : (False <-> P) <-> ~P"
   "?p5 : (P <-> False) <-> ~P"
-  apply (tactic \<open>IntPr.fast_tac @{context} 1\<close>)+
+  apply (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)+
   done
 
 schematic_goal quant_rews:
   "?p1 : (ALL x. P) <-> P"
   "?p2 : (EX x. P) <-> P"
-  apply (tactic \<open>IntPr.fast_tac @{context} 1\<close>)+
+  apply (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)+
   done
 
 (*These are NOT supplied by default!*)
@@ -691,7 +691,7 @@
   "?p2 : P & (Q | R) <-> P&Q | P&R"
   "?p3 : (Q | R) & P <-> Q&P | R&P"
   "?p4 : (P | Q --> R) <-> (P --> R) & (Q --> R)"
-  apply (tactic \<open>IntPr.fast_tac @{context} 1\<close>)+
+  apply (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)+
   done
 
 schematic_goal distrib_rews2:
@@ -699,17 +699,17 @@
   "?p2 : ((EX x. NORM(P(x))) --> Q) <-> (ALL x. NORM(P(x)) --> Q)"
   "?p3 : (EX x. NORM(P(x))) & NORM(Q) <-> (EX x. NORM(P(x)) & NORM(Q))"
   "?p4 : NORM(Q) & (EX x. NORM(P(x))) <-> (EX x. NORM(Q) & NORM(P(x)))"
-  apply (tactic \<open>IntPr.fast_tac @{context} 1\<close>)+
+  apply (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)+
   done
 
 lemmas distrib_rews = distrib_rews1 distrib_rews2
 
 schematic_goal P_Imp_P_iff_T: "p:P ==> ?p:(P <-> True)"
-  apply (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  apply (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
   done
 
 schematic_goal not_P_imp_P_iff_F: "p:~P ==> ?p:(P <-> False)"
-  apply (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  apply (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
   done
 
 end
--- a/src/FOLP/ex/Classical.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/FOLP/ex/Classical.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -10,14 +10,14 @@
 begin
 
 schematic_goal "?p : (P --> Q | R) --> (P-->Q) | (P-->R)"
-  by (tactic "fast_tac @{context} FOLP_cs 1")
+  by (tactic "fast_tac \<^context> FOLP_cs 1")
 
 (*If and only if*)
 schematic_goal "?p : (P<->Q) <-> (Q<->P)"
-  by (tactic "fast_tac @{context} FOLP_cs 1")
+  by (tactic "fast_tac \<^context> FOLP_cs 1")
 
 schematic_goal "?p : ~ (P <-> ~P)"
-  by (tactic "fast_tac @{context} FOLP_cs 1")
+  by (tactic "fast_tac \<^context> FOLP_cs 1")
 
 
 (*Sample problems from 
@@ -33,134 +33,134 @@
 text "Pelletier's examples"
 (*1*)
 schematic_goal "?p : (P-->Q)  <->  (~Q --> ~P)"
-  by (tactic "fast_tac @{context} FOLP_cs 1")
+  by (tactic "fast_tac \<^context> FOLP_cs 1")
 
 (*2*)
 schematic_goal "?p : ~ ~ P  <->  P"
-  by (tactic "fast_tac @{context} FOLP_cs 1")
+  by (tactic "fast_tac \<^context> FOLP_cs 1")
 
 (*3*)
 schematic_goal "?p : ~(P-->Q) --> (Q-->P)"
-  by (tactic "fast_tac @{context} FOLP_cs 1")
+  by (tactic "fast_tac \<^context> FOLP_cs 1")
 
 (*4*)
 schematic_goal "?p : (~P-->Q)  <->  (~Q --> P)"
-  by (tactic "fast_tac @{context} FOLP_cs 1")
+  by (tactic "fast_tac \<^context> FOLP_cs 1")
 
 (*5*)
 schematic_goal "?p : ((P|Q)-->(P|R)) --> (P|(Q-->R))"
-  by (tactic "fast_tac @{context} FOLP_cs 1")
+  by (tactic "fast_tac \<^context> FOLP_cs 1")
 
 (*6*)
 schematic_goal "?p : P | ~ P"
-  by (tactic "fast_tac @{context} FOLP_cs 1")
+  by (tactic "fast_tac \<^context> FOLP_cs 1")
 
 (*7*)
 schematic_goal "?p : P | ~ ~ ~ P"
-  by (tactic "fast_tac @{context} FOLP_cs 1")
+  by (tactic "fast_tac \<^context> FOLP_cs 1")
 
 (*8.  Peirce's law*)
 schematic_goal "?p : ((P-->Q) --> P)  -->  P"
-  by (tactic "fast_tac @{context} FOLP_cs 1")
+  by (tactic "fast_tac \<^context> FOLP_cs 1")
 
 (*9*)
 schematic_goal "?p : ((P|Q) & (~P|Q) & (P| ~Q)) --> ~ (~P | ~Q)"
-  by (tactic "fast_tac @{context} FOLP_cs 1")
+  by (tactic "fast_tac \<^context> FOLP_cs 1")
 
 (*10*)
 schematic_goal "?p : (Q-->R) & (R-->P&Q) & (P-->Q|R) --> (P<->Q)"
-  by (tactic "fast_tac @{context} FOLP_cs 1")
+  by (tactic "fast_tac \<^context> FOLP_cs 1")
 
 (*11.  Proved in each direction (incorrectly, says Pelletier!!)  *)
 schematic_goal "?p : P<->P"
-  by (tactic "fast_tac @{context} FOLP_cs 1")
+  by (tactic "fast_tac \<^context> FOLP_cs 1")
 
 (*12.  "Dijkstra's law"*)
 schematic_goal "?p : ((P <-> Q) <-> R)  <->  (P <-> (Q <-> R))"
-  by (tactic "fast_tac @{context} FOLP_cs 1")
+  by (tactic "fast_tac \<^context> FOLP_cs 1")
 
 (*13.  Distributive law*)
 schematic_goal "?p : P | (Q & R)  <-> (P | Q) & (P | R)"
-  by (tactic "fast_tac @{context} FOLP_cs 1")
+  by (tactic "fast_tac \<^context> FOLP_cs 1")
 
 (*14*)
 schematic_goal "?p : (P <-> Q) <-> ((Q | ~P) & (~Q|P))"
-  by (tactic "fast_tac @{context} FOLP_cs 1")
+  by (tactic "fast_tac \<^context> FOLP_cs 1")
 
 (*15*)
 schematic_goal "?p : (P --> Q) <-> (~P | Q)"
-  by (tactic "fast_tac @{context} FOLP_cs 1")
+  by (tactic "fast_tac \<^context> FOLP_cs 1")
 
 (*16*)
 schematic_goal "?p : (P-->Q) | (Q-->P)"
-  by (tactic "fast_tac @{context} FOLP_cs 1")
+  by (tactic "fast_tac \<^context> FOLP_cs 1")
 
 (*17*)
 schematic_goal "?p : ((P & (Q-->R))-->S) <-> ((~P | Q | S) & (~P | ~R | S))"
-  by (tactic "fast_tac @{context} FOLP_cs 1")
+  by (tactic "fast_tac \<^context> FOLP_cs 1")
 
 
 text "Classical Logic: examples with quantifiers"
 
 schematic_goal "?p : (ALL x. P(x) & Q(x)) <-> (ALL x. P(x))  &  (ALL x. Q(x))"
-  by (tactic "fast_tac @{context} FOLP_cs 1")
+  by (tactic "fast_tac \<^context> FOLP_cs 1")
 
 schematic_goal "?p : (EX x. P-->Q(x))  <->  (P --> (EX x. Q(x)))"
-  by (tactic "fast_tac @{context} FOLP_cs 1")
+  by (tactic "fast_tac \<^context> FOLP_cs 1")
 
 schematic_goal "?p : (EX x. P(x)-->Q)  <->  (ALL x. P(x)) --> Q"
-  by (tactic "fast_tac @{context} FOLP_cs 1")
+  by (tactic "fast_tac \<^context> FOLP_cs 1")
 
 schematic_goal "?p : (ALL x. P(x)) | Q  <->  (ALL x. P(x) | Q)"
-  by (tactic "fast_tac @{context} FOLP_cs 1")
+  by (tactic "fast_tac \<^context> FOLP_cs 1")
 
 
 text "Problems requiring quantifier duplication"
 
 (*Needs multiple instantiation of ALL.*)
 schematic_goal "?p : (ALL x. P(x)-->P(f(x)))  &  P(d)-->P(f(f(f(d))))"
-  by (tactic "best_tac @{context} FOLP_dup_cs 1")
+  by (tactic "best_tac \<^context> FOLP_dup_cs 1")
 
 (*Needs double instantiation of the quantifier*)
 schematic_goal "?p : EX x. P(x) --> P(a) & P(b)"
-  by (tactic "best_tac @{context} FOLP_dup_cs 1")
+  by (tactic "best_tac \<^context> FOLP_dup_cs 1")
 
 schematic_goal "?p : EX z. P(z) --> (ALL x. P(x))"
-  by (tactic "best_tac @{context} FOLP_dup_cs 1")
+  by (tactic "best_tac \<^context> FOLP_dup_cs 1")
 
 
 text "Hard examples with quantifiers"
 
 text "Problem 18"
 schematic_goal "?p : EX y. ALL x. P(y)-->P(x)"
-  by (tactic "best_tac @{context} FOLP_dup_cs 1")
+  by (tactic "best_tac \<^context> FOLP_dup_cs 1")
 
 text "Problem 19"
 schematic_goal "?p : EX x. ALL y z. (P(y)-->Q(z)) --> (P(x)-->Q(x))"
-  by (tactic "best_tac @{context} FOLP_dup_cs 1")
+  by (tactic "best_tac \<^context> FOLP_dup_cs 1")
 
 text "Problem 20"
 schematic_goal "?p : (ALL x y. EX z. ALL w. (P(x)&Q(y)-->R(z)&S(w)))      
     --> (EX x y. P(x) & Q(y)) --> (EX z. R(z))"
-  by (tactic "fast_tac @{context} FOLP_cs 1")
+  by (tactic "fast_tac \<^context> FOLP_cs 1")
 
 text "Problem 21"
 schematic_goal "?p : (EX x. P-->Q(x)) & (EX x. Q(x)-->P) --> (EX x. P<->Q(x))"
-  by (tactic "best_tac @{context} FOLP_dup_cs 1")
+  by (tactic "best_tac \<^context> FOLP_dup_cs 1")
 
 text "Problem 22"
 schematic_goal "?p : (ALL x. P <-> Q(x))  -->  (P <-> (ALL x. Q(x)))"
-  by (tactic "fast_tac @{context} FOLP_cs 1")
+  by (tactic "fast_tac \<^context> FOLP_cs 1")
 
 text "Problem 23"
 schematic_goal "?p : (ALL x. P | Q(x))  <->  (P | (ALL x. Q(x)))"
-  by (tactic "best_tac @{context} FOLP_dup_cs 1")
+  by (tactic "best_tac \<^context> FOLP_dup_cs 1")
 
 text "Problem 24"
 schematic_goal "?p : ~(EX x. S(x)&Q(x)) & (ALL x. P(x) --> Q(x)|R(x)) &   
      (~(EX x. P(x)) --> (EX x. Q(x))) & (ALL x. Q(x)|R(x) --> S(x))   
     --> (EX x. P(x)&R(x))"
-  by (tactic "fast_tac @{context} FOLP_cs 1")
+  by (tactic "fast_tac \<^context> FOLP_cs 1")
 
 text "Problem 25"
 schematic_goal "?p : (EX x. P(x)) &  
@@ -174,7 +174,7 @@
 schematic_goal "?u : ((EX x. p(x)) <-> (EX x. q(x))) &   
      (ALL x. ALL y. p(x) & q(y) --> (r(x) <-> s(y)))   
   --> ((ALL x. p(x)-->r(x)) <-> (ALL x. q(x)-->s(x)))"
-  by (tactic "fast_tac @{context} FOLP_cs 1")
+  by (tactic "fast_tac \<^context> FOLP_cs 1")
 
 text "Problem 27"
 schematic_goal "?p : (EX x. P(x) & ~Q(x)) &    
@@ -182,49 +182,49 @@
               (ALL x. M(x) & L(x) --> P(x)) &    
               ((EX x. R(x) & ~ Q(x)) --> (ALL x. L(x) --> ~ R(x)))   
           --> (ALL x. M(x) --> ~L(x))"
-  by (tactic "fast_tac @{context} FOLP_cs 1")
+  by (tactic "fast_tac \<^context> FOLP_cs 1")
 
 text "Problem 28.  AMENDED"
 schematic_goal "?p : (ALL x. P(x) --> (ALL x. Q(x))) &    
         ((ALL x. Q(x)|R(x)) --> (EX x. Q(x)&S(x))) &   
         ((EX x. S(x)) --> (ALL x. L(x) --> M(x)))   
     --> (ALL x. P(x) & L(x) --> M(x))"
-  by (tactic "fast_tac @{context} FOLP_cs 1")
+  by (tactic "fast_tac \<^context> FOLP_cs 1")
 
 text "Problem 29.  Essentially the same as Principia Mathematica *11.71"
 schematic_goal "?p : (EX x. P(x)) & (EX y. Q(y))   
     --> ((ALL x. P(x)-->R(x)) & (ALL y. Q(y)-->S(y))   <->      
          (ALL x y. P(x) & Q(y) --> R(x) & S(y)))"
-  by (tactic "fast_tac @{context} FOLP_cs 1")
+  by (tactic "fast_tac \<^context> FOLP_cs 1")
 
 text "Problem 30"
 schematic_goal "?p : (ALL x. P(x) | Q(x) --> ~ R(x)) &  
         (ALL x. (Q(x) --> ~ S(x)) --> P(x) & R(x))   
     --> (ALL x. S(x))"
-  by (tactic "fast_tac @{context} FOLP_cs 1")
+  by (tactic "fast_tac \<^context> FOLP_cs 1")
 
 text "Problem 31"
 schematic_goal "?p : ~(EX x. P(x) & (Q(x) | R(x))) &  
         (EX x. L(x) & P(x)) &  
         (ALL x. ~ R(x) --> M(x))   
     --> (EX x. L(x) & M(x))"
-  by (tactic "fast_tac @{context} FOLP_cs 1")
+  by (tactic "fast_tac \<^context> FOLP_cs 1")
 
 text "Problem 32"
 schematic_goal "?p : (ALL x. P(x) & (Q(x)|R(x))-->S(x)) &  
         (ALL x. S(x) & R(x) --> L(x)) &  
         (ALL x. M(x) --> R(x))   
     --> (ALL x. P(x) & M(x) --> L(x))"
-  by (tactic "best_tac @{context} FOLP_dup_cs 1")
+  by (tactic "best_tac \<^context> FOLP_dup_cs 1")
 
 text "Problem 33"
 schematic_goal "?p : (ALL x. P(a) & (P(x)-->P(b))-->P(c))  <->     
      (ALL x. (~P(a) | P(x) | P(c)) & (~P(a) | ~P(b) | P(c)))"
-  by (tactic "best_tac @{context} FOLP_dup_cs 1")
+  by (tactic "best_tac \<^context> FOLP_dup_cs 1")
 
 text "Problem 35"
 schematic_goal "?p : EX x y. P(x,y) -->  (ALL u v. P(u,v))"
-  by (tactic "best_tac @{context} FOLP_dup_cs 1")
+  by (tactic "best_tac \<^context> FOLP_dup_cs 1")
 
 text "Problem 36"
 schematic_goal
@@ -232,7 +232,7 @@
       (ALL x. EX y. G(x,y)) &  
       (ALL x y. J(x,y) | G(x,y) --> (ALL z. J(y,z) | G(y,z) --> H(x,z)))    
   --> (ALL x. EX y. H(x,y))"
-  by (tactic "fast_tac @{context} FOLP_cs 1")
+  by (tactic "fast_tac \<^context> FOLP_cs 1")
 
 text "Problem 37"
 schematic_goal "?p : (ALL z. EX w. ALL x. EX y.  
@@ -240,62 +240,62 @@
         (ALL x z. ~P(x,z) --> (EX y. Q(y,z))) &  
         ((EX x y. Q(x,y)) --> (ALL x. R(x,x)))   
     --> (ALL x. EX y. R(x,y))"
-  by (tactic "fast_tac @{context} FOLP_cs 1")
+  by (tactic "fast_tac \<^context> FOLP_cs 1")
 
 text "Problem 39"
 schematic_goal "?p : ~ (EX x. ALL y. F(y,x) <-> ~F(y,y))"
-  by (tactic "fast_tac @{context} FOLP_cs 1")
+  by (tactic "fast_tac \<^context> FOLP_cs 1")
 
 text "Problem 40.  AMENDED"
 schematic_goal "?p : (EX y. ALL x. F(x,y) <-> F(x,x)) -->   
               ~(ALL x. EX y. ALL z. F(z,y) <-> ~ F(z,x))"
-  by (tactic "fast_tac @{context} FOLP_cs 1")
+  by (tactic "fast_tac \<^context> FOLP_cs 1")
 
 text "Problem 41"
 schematic_goal "?p : (ALL z. EX y. ALL x. f(x,y) <-> f(x,z) & ~ f(x,x))   
           --> ~ (EX z. ALL x. f(x,z))"
-  by (tactic "best_tac @{context} FOLP_dup_cs 1")
+  by (tactic "best_tac \<^context> FOLP_dup_cs 1")
 
 text "Problem 44"
 schematic_goal "?p : (ALL x. f(x) -->                                     
               (EX y. g(y) & h(x,y) & (EX y. g(y) & ~ h(x,y))))  &        
               (EX x. j(x) & (ALL y. g(y) --> h(x,y)))                    
               --> (EX x. j(x) & ~f(x))"
-  by (tactic "fast_tac @{context} FOLP_cs 1")
+  by (tactic "fast_tac \<^context> FOLP_cs 1")
 
 text "Problems (mainly) involving equality or functions"
 
 text "Problem 48"
 schematic_goal "?p : (a=b | c=d) & (a=c | b=d) --> a=d | b=c"
-  by (tactic "fast_tac @{context} FOLP_cs 1")
+  by (tactic "fast_tac \<^context> FOLP_cs 1")
 
 text "Problem 50"
 (*What has this to do with equality?*)
 schematic_goal "?p : (ALL x. P(a,x) | (ALL y. P(x,y))) --> (EX x. ALL y. P(x,y))"
-  by (tactic "best_tac @{context} FOLP_dup_cs 1")
+  by (tactic "best_tac \<^context> FOLP_dup_cs 1")
 
 text "Problem 56"
 schematic_goal
  "?p : (ALL x. (EX y. P(y) & x=f(y)) --> P(x)) <-> (ALL x. P(x) --> P(f(x)))"
-  by (tactic "fast_tac @{context} FOLP_cs 1")
+  by (tactic "fast_tac \<^context> FOLP_cs 1")
 
 text "Problem 57"
 schematic_goal
 "?p : P(f(a,b), f(b,c)) & P(f(b,c), f(a,c)) &  
       (ALL x y z. P(x,y) & P(y,z) --> P(x,z))    -->   P(f(a,b), f(a,c))"
-  by (tactic "fast_tac @{context} FOLP_cs 1")
+  by (tactic "fast_tac \<^context> FOLP_cs 1")
 
 text "Problem 58  NOT PROVED AUTOMATICALLY"
 schematic_goal "?p : (ALL x y. f(x)=g(y)) --> (ALL x y. f(f(x))=f(g(y)))"
   supply f_cong = subst_context [where t = f]
-  by (tactic \<open>fast_tac @{context} (FOLP_cs addSIs [@{thm f_cong}]) 1\<close>)
+  by (tactic \<open>fast_tac \<^context> (FOLP_cs addSIs [@{thm f_cong}]) 1\<close>)
 
 text "Problem 59"
 schematic_goal "?p : (ALL x. P(x) <-> ~P(f(x))) --> (EX x. P(x) & ~P(f(x)))"
-  by (tactic "best_tac @{context} FOLP_dup_cs 1")
+  by (tactic "best_tac \<^context> FOLP_dup_cs 1")
 
 text "Problem 60"
 schematic_goal "?p : ALL x. P(x,f(x)) <-> (EX y. (ALL z. P(z,y) --> P(z,f(x))) & P(x,y))"
-  by (tactic "fast_tac @{context} FOLP_cs 1")
+  by (tactic "fast_tac \<^context> FOLP_cs 1")
 
 end
--- a/src/FOLP/ex/If.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/FOLP/ex/If.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -9,7 +9,7 @@
   assumes "!!x. x : P ==> f(x) : Q"  "!!x. x : ~P ==> g(x) : R"
   shows "?p : if(P,Q,R)"
 apply (unfold if_def)
-apply (tactic \<open>fast_tac @{context} (FOLP_cs addIs @{thms assms}) 1\<close>)
+apply (tactic \<open>fast_tac \<^context> (FOLP_cs addIs @{thms assms}) 1\<close>)
 done
 
 schematic_goal ifE:
@@ -19,7 +19,7 @@
   shows "?p : S"
 apply (insert 1)
 apply (unfold if_def)
-apply (tactic \<open>fast_tac @{context} (FOLP_cs addIs [@{thm 2}, @{thm 3}]) 1\<close>)
+apply (tactic \<open>fast_tac \<^context> (FOLP_cs addIs [@{thm 2}, @{thm 3}]) 1\<close>)
 done
 
 schematic_goal if_commute: "?p : if(P, if(Q,A,B), if(Q,C,D)) <-> if(Q, if(P,A,C), if(P,B,D))"
@@ -33,11 +33,11 @@
 ML \<open>val if_cs = FOLP_cs addSIs [@{thm ifI}] addSEs [@{thm ifE}]\<close>
 
 schematic_goal if_commute: "?p : if(P, if(Q,A,B), if(Q,C,D)) <-> if(Q, if(P,A,C), if(P,B,D))"
-apply (tactic \<open>fast_tac @{context} if_cs 1\<close>)
+apply (tactic \<open>fast_tac \<^context> if_cs 1\<close>)
 done
 
 schematic_goal nested_ifs: "?p : if(if(P,Q,R), A, B) <-> if(P, if(Q,A,B), if(R,A,B))"
-apply (tactic \<open>fast_tac @{context} if_cs 1\<close>)
+apply (tactic \<open>fast_tac \<^context> if_cs 1\<close>)
 done
 
 end
--- a/src/FOLP/ex/Intro.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/FOLP/ex/Intro.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -45,13 +45,13 @@
 
 schematic_goal "?p : (EX y. ALL x. J(y,x) <-> ~J(x,x))
         -->  ~ (ALL x. EX y. ALL z. J(z,y) <-> ~ J(z,x))"
-apply (tactic \<open>fast_tac @{context} FOLP_cs 1\<close>)
+apply (tactic \<open>fast_tac \<^context> FOLP_cs 1\<close>)
 done
 
 
 schematic_goal "?p : ALL x. P(x,f(x)) <->
         (EX y. (ALL z. P(z,y) --> P(z,f(x))) & P(x,y))"
-apply (tactic \<open>fast_tac @{context} FOLP_cs 1\<close>)
+apply (tactic \<open>fast_tac \<^context> FOLP_cs 1\<close>)
 done
 
 
--- a/src/FOLP/ex/Intuitionistic.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/FOLP/ex/Intuitionistic.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -31,39 +31,39 @@
 begin
 
 schematic_goal "?p : ~~(P&Q) <-> ~~P & ~~Q"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 schematic_goal "?p : ~~~P <-> ~P"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 schematic_goal "?p : ~~((P --> Q | R)  -->  (P-->Q) | (P-->R))"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 schematic_goal "?p : (P<->Q) <-> (Q<->P)"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 
 subsection \<open>Lemmas for the propositional double-negation translation\<close>
 
 schematic_goal "?p : P --> ~~P"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 schematic_goal "?p : ~~(~~P --> P)"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 schematic_goal "?p : ~~P & ~~(P --> Q) --> ~~Q"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 
 subsection \<open>The following are classically but not constructively valid\<close>
 
 (*The attempt to prove them terminates quickly!*)
 schematic_goal "?p : ((P-->Q) --> P)  -->  P"
-  apply (tactic \<open>IntPr.fast_tac @{context} 1\<close>)?
+  apply (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)?
   oops
 
 schematic_goal "?p : (P&Q-->R)  -->  (P-->R) | (Q-->R)"
-  apply (tactic \<open>IntPr.fast_tac @{context} 1\<close>)?
+  apply (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)?
   oops
 
 
@@ -71,74 +71,74 @@
 
 text "Problem ~~1"
 schematic_goal "?p : ~~((P-->Q)  <->  (~Q --> ~P))"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 text "Problem ~~2"
 schematic_goal "?p : ~~(~~P  <->  P)"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 text "Problem 3"
 schematic_goal "?p : ~(P-->Q) --> (Q-->P)"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 text "Problem ~~4"
 schematic_goal "?p : ~~((~P-->Q)  <->  (~Q --> P))"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 text "Problem ~~5"
 schematic_goal "?p : ~~((P|Q-->P|R) --> P|(Q-->R))"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 text "Problem ~~6"
 schematic_goal "?p : ~~(P | ~P)"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 text "Problem ~~7"
 schematic_goal "?p : ~~(P | ~~~P)"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 text "Problem ~~8.  Peirce's law"
 schematic_goal "?p : ~~(((P-->Q) --> P)  -->  P)"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 text "Problem 9"
 schematic_goal "?p : ((P|Q) & (~P|Q) & (P| ~Q)) --> ~ (~P | ~Q)"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 text "Problem 10"
 schematic_goal "?p : (Q-->R) --> (R-->P&Q) --> (P-->(Q|R)) --> (P<->Q)"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 text "11.  Proved in each direction (incorrectly, says Pelletier!!) "
 schematic_goal "?p : P<->P"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 text "Problem ~~12.  Dijkstra's law  "
 schematic_goal "?p : ~~(((P <-> Q) <-> R)  <->  (P <-> (Q <-> R)))"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 schematic_goal "?p : ((P <-> Q) <-> R)  -->  ~~(P <-> (Q <-> R))"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 text "Problem 13.  Distributive law"
 schematic_goal "?p : P | (Q & R)  <-> (P | Q) & (P | R)"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 text "Problem ~~14"
 schematic_goal "?p : ~~((P <-> Q) <-> ((Q | ~P) & (~Q|P)))"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 text "Problem ~~15"
 schematic_goal "?p : ~~((P --> Q) <-> (~P | Q))"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 text "Problem ~~16"
 schematic_goal "?p : ~~((P-->Q) | (Q-->P))"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 text "Problem ~~17"
 schematic_goal "?p : ~~(((P & (Q-->R))-->S) <-> ((~P | Q | S) & (~P | ~R | S)))"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)  \<comment> \<open>slow\<close>
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)  \<comment> \<open>slow\<close>
 
 
 subsection \<open>Examples with quantifiers\<close>
@@ -146,43 +146,43 @@
 text "The converse is classical in the following implications..."
 
 schematic_goal "?p : (EX x. P(x)-->Q)  -->  (ALL x. P(x)) --> Q"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 schematic_goal "?p : ((ALL x. P(x))-->Q) --> ~ (ALL x. P(x) & ~Q)"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 schematic_goal "?p : ((ALL x. ~P(x))-->Q)  -->  ~ (ALL x. ~ (P(x)|Q))"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 schematic_goal "?p : (ALL x. P(x)) | Q  -->  (ALL x. P(x) | Q)"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 schematic_goal "?p : (EX x. P --> Q(x)) --> (P --> (EX x. Q(x)))"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 
 text "The following are not constructively valid!"
 text "The attempt to prove them terminates quickly!"
 
 schematic_goal "?p : ((ALL x. P(x))-->Q) --> (EX x. P(x)-->Q)"
-  apply (tactic \<open>IntPr.fast_tac @{context} 1\<close>)?
+  apply (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)?
   oops
 
 schematic_goal "?p : (P --> (EX x. Q(x))) --> (EX x. P-->Q(x))"
-  apply (tactic \<open>IntPr.fast_tac @{context} 1\<close>)?
+  apply (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)?
   oops
 
 schematic_goal "?p : (ALL x. P(x) | Q) --> ((ALL x. P(x)) | Q)"
-  apply (tactic \<open>IntPr.fast_tac @{context} 1\<close>)?
+  apply (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)?
   oops
 
 schematic_goal "?p : (ALL x. ~~P(x)) --> ~~(ALL x. P(x))"
-  apply (tactic \<open>IntPr.fast_tac @{context} 1\<close>)?
+  apply (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)?
   oops
 
 (*Classically but not intuitionistically valid.  Proved by a bug in 1986!*)
 schematic_goal "?p : EX x. Q(x) --> (ALL x. Q(x))"
-  apply (tactic \<open>IntPr.fast_tac @{context} 1\<close>)?
+  apply (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)?
   oops
 
 
@@ -204,7 +204,7 @@
 text "Problem 20"
 schematic_goal "?p : (ALL x y. EX z. ALL w. (P(x)&Q(y)-->R(z)&S(w)))      
     --> (EX x y. P(x) & Q(y)) --> (EX z. R(z))"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 text "Problem 21"
 schematic_goal "?p : (EX x. P-->Q(x)) & (EX x. Q(x)-->P) --> ~~(EX x. P<->Q(x))" oops
@@ -212,21 +212,21 @@
 
 text "Problem 22"
 schematic_goal "?p : (ALL x. P <-> Q(x))  -->  (P <-> (ALL x. Q(x)))"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 text "Problem ~~23"
 schematic_goal "?p : ~~ ((ALL x. P | Q(x))  <->  (P | (ALL x. Q(x))))"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 text "Problem 24"
 schematic_goal "?p : ~(EX x. S(x)&Q(x)) & (ALL x. P(x) --> Q(x)|R(x)) &   
      (~(EX x. P(x)) --> (EX x. Q(x))) & (ALL x. Q(x)|R(x) --> S(x))   
     --> ~~(EX x. P(x)&R(x))"
 (*Not clear why fast_tac, best_tac, ASTAR and ITER_DEEPEN all take forever*)
-  apply (tactic "IntPr.safe_tac @{context}")
+  apply (tactic "IntPr.safe_tac \<^context>")
   apply (erule impE)
-   apply (tactic "IntPr.fast_tac @{context} 1")
-  apply (tactic "IntPr.fast_tac @{context} 1")
+   apply (tactic "IntPr.fast_tac \<^context> 1")
+  apply (tactic "IntPr.fast_tac \<^context> 1")
   done
 
 text "Problem 25"
@@ -235,72 +235,72 @@
         (ALL x. P(x) --> (M(x) & L(x))) &    
         ((ALL x. P(x)-->Q(x)) | (EX x. P(x)&R(x)))   
     --> (EX x. Q(x)&P(x))"
-  by (tactic "IntPr.best_tac @{context} 1")
+  by (tactic "IntPr.best_tac \<^context> 1")
 
 text "Problem 29.  Essentially the same as Principia Mathematica *11.71"
 schematic_goal "?p : (EX x. P(x)) & (EX y. Q(y))   
     --> ((ALL x. P(x)-->R(x)) & (ALL y. Q(y)-->S(y))   <->      
          (ALL x y. P(x) & Q(y) --> R(x) & S(y)))"
-  by (tactic "IntPr.fast_tac @{context} 1")
+  by (tactic "IntPr.fast_tac \<^context> 1")
 
 text "Problem ~~30"
 schematic_goal "?p : (ALL x. (P(x) | Q(x)) --> ~ R(x)) &  
         (ALL x. (Q(x) --> ~ S(x)) --> P(x) & R(x))   
     --> (ALL x. ~~S(x))"
-  by (tactic "IntPr.fast_tac @{context} 1")
+  by (tactic "IntPr.fast_tac \<^context> 1")
 
 text "Problem 31"
 schematic_goal "?p : ~(EX x. P(x) & (Q(x) | R(x))) &  
         (EX x. L(x) & P(x)) &  
         (ALL x. ~ R(x) --> M(x))   
     --> (EX x. L(x) & M(x))"
-  by (tactic "IntPr.fast_tac @{context} 1")
+  by (tactic "IntPr.fast_tac \<^context> 1")
 
 text "Problem 32"
 schematic_goal "?p : (ALL x. P(x) & (Q(x)|R(x))-->S(x)) &  
         (ALL x. S(x) & R(x) --> L(x)) &  
         (ALL x. M(x) --> R(x))   
     --> (ALL x. P(x) & M(x) --> L(x))"
-  by (tactic "IntPr.best_tac @{context} 1") \<comment> \<open>slow\<close>
+  by (tactic "IntPr.best_tac \<^context> 1") \<comment> \<open>slow\<close>
 
 text "Problem 39"
 schematic_goal "?p : ~ (EX x. ALL y. F(y,x) <-> ~F(y,y))"
-  by (tactic "IntPr.best_tac @{context} 1")
+  by (tactic "IntPr.best_tac \<^context> 1")
 
 text "Problem 40.  AMENDED"
 schematic_goal "?p : (EX y. ALL x. F(x,y) <-> F(x,x)) -->   
               ~(ALL x. EX y. ALL z. F(z,y) <-> ~ F(z,x))"
-  by (tactic "IntPr.best_tac @{context} 1") \<comment> \<open>slow\<close>
+  by (tactic "IntPr.best_tac \<^context> 1") \<comment> \<open>slow\<close>
 
 text "Problem 44"
 schematic_goal "?p : (ALL x. f(x) -->                                    
               (EX y. g(y) & h(x,y) & (EX y. g(y) & ~ h(x,y))))  &        
               (EX x. j(x) & (ALL y. g(y) --> h(x,y)))                    
               --> (EX x. j(x) & ~f(x))"
-  by (tactic "IntPr.best_tac @{context} 1")
+  by (tactic "IntPr.best_tac \<^context> 1")
 
 text "Problem 48"
 schematic_goal "?p : (a=b | c=d) & (a=c | b=d) --> a=d | b=c"
-  by (tactic "IntPr.best_tac @{context} 1")
+  by (tactic "IntPr.best_tac \<^context> 1")
 
 text "Problem 51"
 schematic_goal
     "?p : (EX z w. ALL x y. P(x,y) <->  (x=z & y=w)) -->   
      (EX z. ALL x. EX w. (ALL y. P(x,y) <-> y=w) <-> x=z)"
-  by (tactic "IntPr.best_tac @{context} 1") \<comment> \<open>60 seconds\<close>
+  by (tactic "IntPr.best_tac \<^context> 1") \<comment> \<open>60 seconds\<close>
 
 text "Problem 56"
 schematic_goal "?p : (ALL x. (EX y. P(y) & x=f(y)) --> P(x)) <-> (ALL x. P(x) --> P(f(x)))"
-  by (tactic "IntPr.best_tac @{context} 1")
+  by (tactic "IntPr.best_tac \<^context> 1")
 
 text "Problem 57"
 schematic_goal
     "?p : P(f(a,b), f(b,c)) & P(f(b,c), f(a,c)) &  
      (ALL x y z. P(x,y) & P(y,z) --> P(x,z))    -->   P(f(a,b), f(a,c))"
-  by (tactic "IntPr.best_tac @{context} 1")
+  by (tactic "IntPr.best_tac \<^context> 1")
 
 text "Problem 60"
 schematic_goal "?p : ALL x. P(x,f(x)) <-> (EX y. (ALL z. P(z,y) --> P(z,f(x))) & P(x,y))"
-  by (tactic "IntPr.best_tac @{context} 1")
+  by (tactic "IntPr.best_tac \<^context> 1")
 
 end
--- a/src/FOLP/ex/Nat.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/FOLP/ex/Nat.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -84,24 +84,24 @@
 ML \<open>
   val add_ss =
     FOLP_ss addcongs @{thms nat_congs}
-    |> fold (addrew @{context}) @{thms add_0 add_Suc}
+    |> fold (addrew \<^context>) @{thms add_0 add_Suc}
 \<close>
 
 schematic_goal add_assoc: "?p : (k+m)+n = k+(m+n)"
 apply (rule_tac n = k in induct)
-apply (tactic \<open>SIMP_TAC @{context} add_ss 1\<close>)
-apply (tactic \<open>ASM_SIMP_TAC @{context} add_ss 1\<close>)
+apply (tactic \<open>SIMP_TAC \<^context> add_ss 1\<close>)
+apply (tactic \<open>ASM_SIMP_TAC \<^context> add_ss 1\<close>)
 done
 
 schematic_goal add_0_right: "?p : m+0 = m"
 apply (rule_tac n = m in induct)
-apply (tactic \<open>SIMP_TAC @{context} add_ss 1\<close>)
-apply (tactic \<open>ASM_SIMP_TAC @{context} add_ss 1\<close>)
+apply (tactic \<open>SIMP_TAC \<^context> add_ss 1\<close>)
+apply (tactic \<open>ASM_SIMP_TAC \<^context> add_ss 1\<close>)
 done
 
 schematic_goal add_Suc_right: "?p : m+Suc(n) = Suc(m+n)"
 apply (rule_tac n = m in induct)
-apply (tactic \<open>ALLGOALS (ASM_SIMP_TAC @{context} add_ss)\<close>)
+apply (tactic \<open>ALLGOALS (ASM_SIMP_TAC \<^context> add_ss)\<close>)
 done
 
 (*mk_typed_congs appears not to work with FOLP's version of subst*)
--- a/src/FOLP/ex/Propositional_Cla.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/FOLP/ex/Propositional_Cla.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -12,106 +12,106 @@
 
 text "commutative laws of & and | "
 schematic_goal "?p : P & Q  -->  Q & P"
-  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
+  by (tactic \<open>Cla.fast_tac \<^context> FOLP_cs 1\<close>)
 
 schematic_goal "?p : P | Q  -->  Q | P"
-  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
+  by (tactic \<open>Cla.fast_tac \<^context> FOLP_cs 1\<close>)
 
 
 text "associative laws of & and | "
 schematic_goal "?p : (P & Q) & R  -->  P & (Q & R)"
-  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
+  by (tactic \<open>Cla.fast_tac \<^context> FOLP_cs 1\<close>)
 
 schematic_goal "?p : (P | Q) | R  -->  P | (Q | R)"
-  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
+  by (tactic \<open>Cla.fast_tac \<^context> FOLP_cs 1\<close>)
 
 
 text "distributive laws of & and | "
 schematic_goal "?p : (P & Q) | R  --> (P | R) & (Q | R)"
-  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
+  by (tactic \<open>Cla.fast_tac \<^context> FOLP_cs 1\<close>)
 
 schematic_goal "?p : (P | R) & (Q | R)  --> (P & Q) | R"
-  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
+  by (tactic \<open>Cla.fast_tac \<^context> FOLP_cs 1\<close>)
 
 schematic_goal "?p : (P | Q) & R  --> (P & R) | (Q & R)"
-  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
+  by (tactic \<open>Cla.fast_tac \<^context> FOLP_cs 1\<close>)
 
 
 schematic_goal "?p : (P & R) | (Q & R)  --> (P | Q) & R"
-  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
+  by (tactic \<open>Cla.fast_tac \<^context> FOLP_cs 1\<close>)
 
 
 text "Laws involving implication"
 
 schematic_goal "?p : (P-->R) & (Q-->R) <-> (P|Q --> R)"
-  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
+  by (tactic \<open>Cla.fast_tac \<^context> FOLP_cs 1\<close>)
 
 schematic_goal "?p : (P & Q --> R) <-> (P--> (Q-->R))"
-  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
+  by (tactic \<open>Cla.fast_tac \<^context> FOLP_cs 1\<close>)
 
 schematic_goal "?p : ((P-->R)-->R) --> ((Q-->R)-->R) --> (P&Q-->R) --> R"
-  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
+  by (tactic \<open>Cla.fast_tac \<^context> FOLP_cs 1\<close>)
 
 schematic_goal "?p : ~(P-->R) --> ~(Q-->R) --> ~(P&Q-->R)"
-  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
+  by (tactic \<open>Cla.fast_tac \<^context> FOLP_cs 1\<close>)
 
 schematic_goal "?p : (P --> Q & R) <-> (P-->Q)  &  (P-->R)"
-  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
+  by (tactic \<open>Cla.fast_tac \<^context> FOLP_cs 1\<close>)
 
 
 text "Propositions-as-types"
 
 (*The combinator K*)
 schematic_goal "?p : P --> (Q --> P)"
-  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
+  by (tactic \<open>Cla.fast_tac \<^context> FOLP_cs 1\<close>)
 
 (*The combinator S*)
 schematic_goal "?p : (P-->Q-->R)  --> (P-->Q) --> (P-->R)"
-  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
+  by (tactic \<open>Cla.fast_tac \<^context> FOLP_cs 1\<close>)
 
 
 (*Converse is classical*)
 schematic_goal "?p : (P-->Q) | (P-->R)  -->  (P --> Q | R)"
-  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
+  by (tactic \<open>Cla.fast_tac \<^context> FOLP_cs 1\<close>)
 
 schematic_goal "?p : (P-->Q)  -->  (~Q --> ~P)"
-  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
+  by (tactic \<open>Cla.fast_tac \<^context> FOLP_cs 1\<close>)
 
 
 text "Schwichtenberg's examples (via T. Nipkow)"
 
 schematic_goal stab_imp: "?p : (((Q-->R)-->R)-->Q) --> (((P-->Q)-->R)-->R)-->P-->Q"
-  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
+  by (tactic \<open>Cla.fast_tac \<^context> FOLP_cs 1\<close>)
 
 schematic_goal stab_to_peirce: "?p : (((P --> R) --> R) --> P) --> (((Q --> R) --> R) --> Q)  
               --> ((P --> Q) --> P) --> P"
-  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
+  by (tactic \<open>Cla.fast_tac \<^context> FOLP_cs 1\<close>)
 
 schematic_goal peirce_imp1: "?p : (((Q --> R) --> Q) --> Q)  
                --> (((P --> Q) --> R) --> P --> Q) --> P --> Q"
-  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
+  by (tactic \<open>Cla.fast_tac \<^context> FOLP_cs 1\<close>)
   
 schematic_goal peirce_imp2: "?p : (((P --> R) --> P) --> P) --> ((P --> Q --> R) --> P) --> P"
-  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
+  by (tactic \<open>Cla.fast_tac \<^context> FOLP_cs 1\<close>)
 
 schematic_goal mints: "?p : ((((P --> Q) --> P) --> P) --> Q) --> Q"
-  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
+  by (tactic \<open>Cla.fast_tac \<^context> FOLP_cs 1\<close>)
 
 schematic_goal mints_solovev: "?p : (P --> (Q --> R) --> Q) --> ((P --> Q) --> R) --> R"
-  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
+  by (tactic \<open>Cla.fast_tac \<^context> FOLP_cs 1\<close>)
 
 schematic_goal tatsuta: "?p : (((P7 --> P1) --> P10) --> P4 --> P5)  
           --> (((P8 --> P2) --> P9) --> P3 --> P10)  
           --> (P1 --> P8) --> P6 --> P7  
           --> (((P3 --> P2) --> P9) --> P4)  
           --> (P1 --> P3) --> (((P6 --> P1) --> P2) --> P9) --> P5"
-  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
+  by (tactic \<open>Cla.fast_tac \<^context> FOLP_cs 1\<close>)
 
 schematic_goal tatsuta1: "?p : (((P8 --> P2) --> P9) --> P3 --> P10)  
      --> (((P3 --> P2) --> P9) --> P4)  
      --> (((P6 --> P1) --> P2) --> P9)  
      --> (((P7 --> P1) --> P10) --> P4 --> P5)  
      --> (P1 --> P3) --> (P1 --> P8) --> P6 --> P7 --> P5"
-  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
+  by (tactic \<open>Cla.fast_tac \<^context> FOLP_cs 1\<close>)
 
 end
--- a/src/FOLP/ex/Propositional_Int.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/FOLP/ex/Propositional_Int.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -12,106 +12,106 @@
 
 text "commutative laws of & and | "
 schematic_goal "?p : P & Q  -->  Q & P"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 schematic_goal "?p : P | Q  -->  Q | P"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 
 text "associative laws of & and | "
 schematic_goal "?p : (P & Q) & R  -->  P & (Q & R)"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 schematic_goal "?p : (P | Q) | R  -->  P | (Q | R)"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 
 text "distributive laws of & and | "
 schematic_goal "?p : (P & Q) | R  --> (P | R) & (Q | R)"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 schematic_goal "?p : (P | R) & (Q | R)  --> (P & Q) | R"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 schematic_goal "?p : (P | Q) & R  --> (P & R) | (Q & R)"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 
 schematic_goal "?p : (P & R) | (Q & R)  --> (P | Q) & R"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 
 text "Laws involving implication"
 
 schematic_goal "?p : (P-->R) & (Q-->R) <-> (P|Q --> R)"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 schematic_goal "?p : (P & Q --> R) <-> (P--> (Q-->R))"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 schematic_goal "?p : ((P-->R)-->R) --> ((Q-->R)-->R) --> (P&Q-->R) --> R"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 schematic_goal "?p : ~(P-->R) --> ~(Q-->R) --> ~(P&Q-->R)"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 schematic_goal "?p : (P --> Q & R) <-> (P-->Q)  &  (P-->R)"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 
 text "Propositions-as-types"
 
 (*The combinator K*)
 schematic_goal "?p : P --> (Q --> P)"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 (*The combinator S*)
 schematic_goal "?p : (P-->Q-->R)  --> (P-->Q) --> (P-->R)"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 
 (*Converse is classical*)
 schematic_goal "?p : (P-->Q) | (P-->R)  -->  (P --> Q | R)"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 schematic_goal "?p : (P-->Q)  -->  (~Q --> ~P)"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 
 text "Schwichtenberg's examples (via T. Nipkow)"
 
 schematic_goal stab_imp: "?p : (((Q-->R)-->R)-->Q) --> (((P-->Q)-->R)-->R)-->P-->Q"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 schematic_goal stab_to_peirce: "?p : (((P --> R) --> R) --> P) --> (((Q --> R) --> R) --> Q)  
               --> ((P --> Q) --> P) --> P"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 schematic_goal peirce_imp1: "?p : (((Q --> R) --> Q) --> Q)  
                --> (((P --> Q) --> R) --> P --> Q) --> P --> Q"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
   
 schematic_goal peirce_imp2: "?p : (((P --> R) --> P) --> P) --> ((P --> Q --> R) --> P) --> P"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 schematic_goal mints: "?p : ((((P --> Q) --> P) --> P) --> Q) --> Q"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 schematic_goal mints_solovev: "?p : (P --> (Q --> R) --> Q) --> ((P --> Q) --> R) --> R"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 schematic_goal tatsuta: "?p : (((P7 --> P1) --> P10) --> P4 --> P5)  
           --> (((P8 --> P2) --> P9) --> P3 --> P10)  
           --> (P1 --> P8) --> P6 --> P7  
           --> (((P3 --> P2) --> P9) --> P4)  
           --> (P1 --> P3) --> (((P6 --> P1) --> P2) --> P9) --> P5"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 schematic_goal tatsuta1: "?p : (((P8 --> P2) --> P9) --> P3 --> P10)  
      --> (((P3 --> P2) --> P9) --> P4)  
      --> (((P6 --> P1) --> P2) --> P9)  
      --> (((P7 --> P1) --> P10) --> P4 --> P5)  
      --> (P1 --> P3) --> (P1 --> P8) --> P6 --> P7 --> P5"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 end
--- a/src/FOLP/ex/Quantifiers_Cla.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/FOLP/ex/Quantifiers_Cla.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -11,91 +11,91 @@
 begin
 
 schematic_goal "?p : (ALL x y. P(x,y))  -->  (ALL y x. P(x,y))"
-  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
+  by (tactic \<open>Cla.fast_tac \<^context> FOLP_cs 1\<close>)
 
 schematic_goal "?p : (EX x y. P(x,y)) --> (EX y x. P(x,y))"
-  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
+  by (tactic \<open>Cla.fast_tac \<^context> FOLP_cs 1\<close>)
 
 
 (*Converse is false*)
 schematic_goal "?p : (ALL x. P(x)) | (ALL x. Q(x)) --> (ALL x. P(x) | Q(x))"
-  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
+  by (tactic \<open>Cla.fast_tac \<^context> FOLP_cs 1\<close>)
 
 schematic_goal "?p : (ALL x. P-->Q(x))  <->  (P--> (ALL x. Q(x)))"
-  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
+  by (tactic \<open>Cla.fast_tac \<^context> FOLP_cs 1\<close>)
 
 
 schematic_goal "?p : (ALL x. P(x)-->Q)  <->  ((EX x. P(x)) --> Q)"
-  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
+  by (tactic \<open>Cla.fast_tac \<^context> FOLP_cs 1\<close>)
 
 
 text "Some harder ones"
 
 schematic_goal "?p : (EX x. P(x) | Q(x)) <-> (EX x. P(x)) | (EX x. Q(x))"
-  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
+  by (tactic \<open>Cla.fast_tac \<^context> FOLP_cs 1\<close>)
 
 (*Converse is false*)
 schematic_goal "?p : (EX x. P(x)&Q(x)) --> (EX x. P(x))  &  (EX x. Q(x))"
-  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
+  by (tactic \<open>Cla.fast_tac \<^context> FOLP_cs 1\<close>)
 
 
 text "Basic test of quantifier reasoning"
 (*TRUE*)
 schematic_goal "?p : (EX y. ALL x. Q(x,y)) -->  (ALL x. EX y. Q(x,y))"
-  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
+  by (tactic \<open>Cla.fast_tac \<^context> FOLP_cs 1\<close>)
 
 schematic_goal "?p : (ALL x. Q(x))  -->  (EX x. Q(x))"
-  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
+  by (tactic \<open>Cla.fast_tac \<^context> FOLP_cs 1\<close>)
 
 
 text "The following should fail, as they are false!"
 
 schematic_goal "?p : (ALL x. EX y. Q(x,y))  -->  (EX y. ALL x. Q(x,y))"
-  apply (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)?
+  apply (tactic \<open>Cla.fast_tac \<^context> FOLP_cs 1\<close>)?
   oops
 
 schematic_goal "?p : (EX x. Q(x))  -->  (ALL x. Q(x))"
-  apply (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)?
+  apply (tactic \<open>Cla.fast_tac \<^context> FOLP_cs 1\<close>)?
   oops
 
 schematic_goal "?p : P(?a) --> (ALL x. P(x))"
-  apply (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)?
+  apply (tactic \<open>Cla.fast_tac \<^context> FOLP_cs 1\<close>)?
   oops
 
 schematic_goal "?p : (P(?a) --> (ALL x. Q(x))) --> (ALL x. P(x) --> Q(x))"
-  apply (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)?
+  apply (tactic \<open>Cla.fast_tac \<^context> FOLP_cs 1\<close>)?
   oops
 
 
 text "Back to things that are provable..."
 
 schematic_goal "?p : (ALL x. P(x)-->Q(x)) & (EX x. P(x)) --> (EX x. Q(x))"
-  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
+  by (tactic \<open>Cla.fast_tac \<^context> FOLP_cs 1\<close>)
 
 
 (*An example of why exI should be delayed as long as possible*)
 schematic_goal "?p : (P --> (EX x. Q(x))) & P --> (EX x. Q(x))"
-  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
+  by (tactic \<open>Cla.fast_tac \<^context> FOLP_cs 1\<close>)
 
 schematic_goal "?p : (ALL x. P(x)-->Q(f(x))) & (ALL x. Q(x)-->R(g(x))) & P(d) --> R(?a)"
-  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
+  by (tactic \<open>Cla.fast_tac \<^context> FOLP_cs 1\<close>)
 
 schematic_goal "?p : (ALL x. Q(x))  -->  (EX x. Q(x))"
-  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
+  by (tactic \<open>Cla.fast_tac \<^context> FOLP_cs 1\<close>)
 
 
 text "Some slow ones"
 
 (*Principia Mathematica *11.53  *)
 schematic_goal "?p : (ALL x y. P(x) --> Q(y)) <-> ((EX x. P(x)) --> (ALL y. Q(y)))"
-  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
+  by (tactic \<open>Cla.fast_tac \<^context> FOLP_cs 1\<close>)
 
 (*Principia Mathematica *11.55  *)
 schematic_goal "?p : (EX x y. P(x) & Q(x,y)) <-> (EX x. P(x) & (EX y. Q(x,y)))"
-  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
+  by (tactic \<open>Cla.fast_tac \<^context> FOLP_cs 1\<close>)
 
 (*Principia Mathematica *11.61  *)
 schematic_goal "?p : (EX y. ALL x. P(x) --> Q(x,y)) --> (ALL x. P(x) --> (EX y. Q(x,y)))"
-  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
+  by (tactic \<open>Cla.fast_tac \<^context> FOLP_cs 1\<close>)
 
 end
--- a/src/FOLP/ex/Quantifiers_Int.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/FOLP/ex/Quantifiers_Int.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -11,91 +11,91 @@
 begin
 
 schematic_goal "?p : (ALL x y. P(x,y))  -->  (ALL y x. P(x,y))"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 schematic_goal "?p : (EX x y. P(x,y)) --> (EX y x. P(x,y))"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 
 (*Converse is false*)
 schematic_goal "?p : (ALL x. P(x)) | (ALL x. Q(x)) --> (ALL x. P(x) | Q(x))"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 schematic_goal "?p : (ALL x. P-->Q(x))  <->  (P--> (ALL x. Q(x)))"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 
 schematic_goal "?p : (ALL x. P(x)-->Q)  <->  ((EX x. P(x)) --> Q)"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 
 text "Some harder ones"
 
 schematic_goal "?p : (EX x. P(x) | Q(x)) <-> (EX x. P(x)) | (EX x. Q(x))"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 (*Converse is false*)
 schematic_goal "?p : (EX x. P(x)&Q(x)) --> (EX x. P(x))  &  (EX x. Q(x))"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 
 text "Basic test of quantifier reasoning"
 (*TRUE*)
 schematic_goal "?p : (EX y. ALL x. Q(x,y)) -->  (ALL x. EX y. Q(x,y))"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 schematic_goal "?p : (ALL x. Q(x))  -->  (EX x. Q(x))"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 
 text "The following should fail, as they are false!"
 
 schematic_goal "?p : (ALL x. EX y. Q(x,y))  -->  (EX y. ALL x. Q(x,y))"
-  apply (tactic \<open>IntPr.fast_tac @{context} 1\<close>)?
+  apply (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)?
   oops
 
 schematic_goal "?p : (EX x. Q(x))  -->  (ALL x. Q(x))"
-  apply (tactic \<open>IntPr.fast_tac @{context} 1\<close>)?
+  apply (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)?
   oops
 
 schematic_goal "?p : P(?a) --> (ALL x. P(x))"
-  apply (tactic \<open>IntPr.fast_tac @{context} 1\<close>)?
+  apply (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)?
   oops
 
 schematic_goal "?p : (P(?a) --> (ALL x. Q(x))) --> (ALL x. P(x) --> Q(x))"
-  apply (tactic \<open>IntPr.fast_tac @{context} 1\<close>)?
+  apply (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)?
   oops
 
 
 text "Back to things that are provable..."
 
 schematic_goal "?p : (ALL x. P(x)-->Q(x)) & (EX x. P(x)) --> (EX x. Q(x))"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 
 (*An example of why exI should be delayed as long as possible*)
 schematic_goal "?p : (P --> (EX x. Q(x))) & P --> (EX x. Q(x))"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 schematic_goal "?p : (ALL x. P(x)-->Q(f(x))) & (ALL x. Q(x)-->R(g(x))) & P(d) --> R(?a)"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 schematic_goal "?p : (ALL x. Q(x))  -->  (EX x. Q(x))"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 
 text "Some slow ones"
 
 (*Principia Mathematica *11.53  *)
 schematic_goal "?p : (ALL x y. P(x) --> Q(y)) <-> ((EX x. P(x)) --> (ALL y. Q(y)))"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 (*Principia Mathematica *11.55  *)
 schematic_goal "?p : (EX x y. P(x) & Q(x,y)) <-> (EX x. P(x) & (EX y. Q(x,y)))"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 (*Principia Mathematica *11.61  *)
 schematic_goal "?p : (EX y. ALL x. P(x) --> Q(x,y)) --> (ALL x. P(x) --> (EX y. Q(x,y)))"
-  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
+  by (tactic \<open>IntPr.fast_tac \<^context> 1\<close>)
 
 end
--- a/src/FOLP/hypsubst.ML	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/FOLP/hypsubst.ML	Fri Jan 04 23:22:53 2019 +0100
@@ -58,8 +58,8 @@
    assumption.  Returns the number of intervening assumptions, paried with
    the rule asm_rl (resp. sym). *)
 fun eq_var bnd =
-  let fun eq_var_aux k (Const(@{const_name Pure.all},_) $ Abs(_,_,t)) = eq_var_aux k t
-        | eq_var_aux k (Const(@{const_name Pure.imp},_) $ A $ B) =
+  let fun eq_var_aux k (Const(\<^const_name>\<open>Pure.all\<close>,_) $ Abs(_,_,t)) = eq_var_aux k t
+        | eq_var_aux k (Const(\<^const_name>\<open>Pure.imp\<close>,_) $ A $ B) =
               ((k, inspect_pair bnd (dest_eq A))
                       (*Exception Match comes from inspect_pair or dest_eq*)
                handle Match => eq_var_aux (k+1) B)
--- a/src/FOLP/simp.ML	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/FOLP/simp.ML	Fri Jan 04 23:22:53 2019 +0100
@@ -399,10 +399,10 @@
     else ();
 
 (* Skip the first n hyps of a goal, and return the rest in generalized form *)
-fun strip_varify(Const(@{const_name Pure.imp}, _) $ H $ B, n, vs) =
+fun strip_varify(Const(\<^const_name>\<open>Pure.imp\<close>, _) $ H $ B, n, vs) =
         if n=0 then subst_bounds(vs,H)::strip_varify(B,0,vs)
         else strip_varify(B,n-1,vs)
-  | strip_varify(Const(@{const_name Pure.all},_)$Abs(_,T,t), n, vs) =
+  | strip_varify(Const(\<^const_name>\<open>Pure.all\<close>,_)$Abs(_,T,t), n, vs) =
         strip_varify(t,n,Var(("?",length vs),T)::vs)
   | strip_varify  _  = [];
 
--- a/src/FOLP/simpdata.ML	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/FOLP/simpdata.ML	Fri Jan 04 23:22:53 2019 +0100
@@ -17,18 +17,18 @@
 (* Conversion into rewrite rules *)
 
 fun mk_eq th = case Thm.concl_of th of
-      _ $ (Const (@{const_name iff}, _) $ _ $ _) $ _ => th
-    | _ $ (Const (@{const_name eq}, _) $ _ $ _) $ _ => th
-    | _ $ (Const (@{const_name Not}, _) $ _) $ _ => th RS @{thm not_P_imp_P_iff_F}
+      _ $ (Const (\<^const_name>\<open>iff\<close>, _) $ _ $ _) $ _ => th
+    | _ $ (Const (\<^const_name>\<open>eq\<close>, _) $ _ $ _) $ _ => th
+    | _ $ (Const (\<^const_name>\<open>Not\<close>, _) $ _) $ _ => th RS @{thm not_P_imp_P_iff_F}
     | _ => make_iff_T th;
 
 
 val mksimps_pairs =
-  [(@{const_name imp}, [@{thm mp}]),
-   (@{const_name conj}, [@{thm conjunct1}, @{thm conjunct2}]),
-   (@{const_name "All"}, [@{thm spec}]),
-   (@{const_name True}, []),
-   (@{const_name False}, [])];
+  [(\<^const_name>\<open>imp\<close>, [@{thm mp}]),
+   (\<^const_name>\<open>conj\<close>, [@{thm conjunct1}, @{thm conjunct2}]),
+   (\<^const_name>\<open>All\<close>, [@{thm spec}]),
+   (\<^const_name>\<open>True\<close>, []),
+   (\<^const_name>\<open>False\<close>, [])];
 
 fun mk_atomize pairs =
   let fun atoms th =
@@ -78,9 +78,9 @@
 
 val auto_ss = empty_ss setauto (fn ctxt => ares_tac ctxt @{thms TrueI});
 
-val IFOLP_ss = auto_ss addcongs FOLP_congs |> fold (addrew @{context}) IFOLP_rews;
+val IFOLP_ss = auto_ss addcongs FOLP_congs |> fold (addrew \<^context>) IFOLP_rews;
 
 
 val FOLP_rews = IFOLP_rews @ @{thms cla_rews};
 
-val FOLP_ss = auto_ss addcongs FOLP_congs |> fold (addrew @{context}) FOLP_rews;
+val FOLP_ss = auto_ss addcongs FOLP_congs |> fold (addrew \<^context>) FOLP_rews;
--- a/src/HOL/BNF_Wellorder_Relation.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/BNF_Wellorder_Relation.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -22,7 +22,7 @@
 begin
 
 text\<open>The following context encompasses all this section. In other words,
-for the whole section, we consider a fixed well-order relation @{term "r"}.\<close>
+for the whole section, we consider a fixed well-order relation \<^term>\<open>r\<close>.\<close>
 
 (* context wo_rel  *)
 
--- a/src/HOL/Binomial.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Binomial.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -425,7 +425,7 @@
   by (simp add: gbinomial_binomial [symmetric] of_nat_gbinomial)
 
 setup
-  \<open>Sign.add_const_constraint (@{const_name gbinomial}, SOME @{typ "'a::field_char_0 \<Rightarrow> nat \<Rightarrow> 'a"})\<close>
+  \<open>Sign.add_const_constraint (\<^const_name>\<open>gbinomial\<close>, SOME \<^typ>\<open>'a::field_char_0 \<Rightarrow> nat \<Rightarrow> 'a\<close>)\<close>
 
 lemma gbinomial_mult_1:
   fixes a :: "'a::field_char_0"
@@ -622,7 +622,7 @@
 qed
 
 text \<open>Contributed by Manuel Eberl, generalised by LCP.
-  Alternative definition of the binomial coefficient as @{term "\<Prod>i<k. (n - i) / (k - i)"}.\<close>
+  Alternative definition of the binomial coefficient as \<^term>\<open>\<Prod>i<k. (n - i) / (k - i)\<close>.\<close>
 lemma gbinomial_altdef_of_nat: "a gchoose k = (\<Prod>i = 0..<k. (a - of_nat i) / of_nat (k - i) :: 'a)"
   for k :: nat and a :: "'a::field_char_0"
   by (simp add: prod_dividef gbinomial_prod_rev fact_prod_rev)
@@ -1142,7 +1142,7 @@
   finally show ?thesis ..
 qed
 
-text \<open>The number of nat lists of length \<open>m\<close> summing to \<open>N\<close> is @{term "(N + m - 1) choose N"}:\<close>
+text \<open>The number of nat lists of length \<open>m\<close> summing to \<open>N\<close> is \<^term>\<open>(N + m - 1) choose N\<close>:\<close>
 lemma card_length_sum_list_rec:
   assumes "m \<ge> 1"
   shows "card {l::nat list. length l = m \<and> sum_list l = N} =
--- a/src/HOL/Code_Numeral.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Code_Numeral.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -668,8 +668,8 @@
 
 setup \<open>
   fold (fn target =>
-    Numeral.add_code @{const_name Code_Numeral.Pos} I Code_Printer.literal_numeral target
-    #> Numeral.add_code @{const_name Code_Numeral.Neg} (~) Code_Printer.literal_numeral target)
+    Numeral.add_code \<^const_name>\<open>Code_Numeral.Pos\<close> I Code_Printer.literal_numeral target
+    #> Numeral.add_code \<^const_name>\<open>Code_Numeral.Neg\<close> (~) Code_Printer.literal_numeral target)
     ["SML", "OCaml", "Haskell", "Scala"]
 \<close>
 
--- a/src/HOL/Complete_Lattices.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Complete_Lattices.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -615,7 +615,7 @@
 
 end
 
-subsection \<open>Complete lattice on @{typ bool}\<close>
+subsection \<open>Complete lattice on \<^typ>\<open>bool\<close>\<close>
 
 instantiation bool :: complete_lattice
 begin
@@ -644,7 +644,7 @@
 instance bool :: complete_boolean_algebra
   by (standard, fastforce)
 
-subsection \<open>Complete lattice on @{typ "_ \<Rightarrow> _"}\<close>
+subsection \<open>Complete lattice on \<^typ>\<open>_ \<Rightarrow> _\<close>\<close>
 
 instantiation "fun" :: (type, Inf) Inf
 begin
@@ -763,7 +763,7 @@
   using assms by auto
 
 
-subsection \<open>Complete lattice on @{typ "_ set"}\<close>
+subsection \<open>Complete lattice on \<^typ>\<open>_ set\<close>\<close>
 
 instantiation "set" :: (type) complete_lattice
 begin
@@ -798,9 +798,9 @@
   by (simp add: Inter_eq)
 
 text \<open>
-  \<^medskip> A ``destruct'' rule -- every @{term X} in @{term C}
-  contains @{term A} as an element, but @{prop "A \<in> X"} can hold when
-  @{prop "X \<in> C"} does not!  This rule is analogous to \<open>spec\<close>.
+  \<^medskip> A ``destruct'' rule -- every \<^term>\<open>X\<close> in \<^term>\<open>C\<close>
+  contains \<^term>\<open>A\<close> as an element, but \<^prop>\<open>A \<in> X\<close> can hold when
+  \<^prop>\<open>X \<in> C\<close> does not!  This rule is analogous to \<open>spec\<close>.
 \<close>
 
 lemma InterD [elim, Pure.elim]: "A \<in> \<Inter>C \<Longrightarrow> X \<in> C \<Longrightarrow> A \<in> X"
@@ -808,7 +808,7 @@
 
 lemma InterE [elim]: "A \<in> \<Inter>C \<Longrightarrow> (X \<notin> C \<Longrightarrow> R) \<Longrightarrow> (A \<in> X \<Longrightarrow> R) \<Longrightarrow> R"
   \<comment> \<open>``Classical'' elimination rule -- does not require proving
-    @{prop "X \<in> C"}.\<close>
+    \<^prop>\<open>X \<in> C\<close>.\<close>
   unfolding Inter_eq by blast
 
 lemma Inter_lower: "B \<in> A \<Longrightarrow> \<Inter>A \<subseteq> B"
@@ -876,7 +876,7 @@
   by auto
 
 lemma INT_E [elim]: "b \<in> (\<Inter>x\<in>A. B x) \<Longrightarrow> (b \<in> B a \<Longrightarrow> R) \<Longrightarrow> (a \<notin> A \<Longrightarrow> R) \<Longrightarrow> R"
-  \<comment> \<open>"Classical" elimination -- by the Excluded Middle on @{prop "a\<in>A"}.\<close>
+  \<comment> \<open>"Classical" elimination -- by the Excluded Middle on \<^prop>\<open>a\<in>A\<close>.\<close>
   by auto
 
 lemma Collect_ball_eq: "{x. \<forall>y\<in>A. P x y} = (\<Inter>y\<in>A. {x. P x y})"
@@ -949,8 +949,8 @@
   by (unfold Union_eq) blast
 
 lemma UnionI [intro]: "X \<in> C \<Longrightarrow> A \<in> X \<Longrightarrow> A \<in> \<Union>C"
-  \<comment> \<open>The order of the premises presupposes that @{term C} is rigid;
-    @{term A} may be flexible.\<close>
+  \<comment> \<open>The order of the premises presupposes that \<^term>\<open>C\<close> is rigid;
+    \<^term>\<open>A\<close> may be flexible.\<close>
   by auto
 
 lemma UnionE [elim!]: "A \<in> \<Union>C \<Longrightarrow> (\<And>X. A \<in> X \<Longrightarrow> X \<in> C \<Longrightarrow> R) \<Longrightarrow> R"
@@ -1023,7 +1023,7 @@
 text \<open>
   Note the difference between ordinary syntax of indexed
   unions and intersections (e.g.\ \<open>\<Union>a\<^sub>1\<in>A\<^sub>1. B\<close>)
-  and their \LaTeX\ rendition: @{term"\<Union>a\<^sub>1\<in>A\<^sub>1. B"}.
+  and their \LaTeX\ rendition: \<^term>\<open>\<Union>a\<^sub>1\<in>A\<^sub>1. B\<close>.
 \<close>
 
 lemma disjoint_UN_iff: "disjnt A (\<Union>i\<in>I. B i) \<longleftrightarrow> (\<forall>i\<in>I. disjnt A (B i))"
@@ -1045,8 +1045,8 @@
   using Union_iff [of _ "B ` A"] by simp
 
 lemma UN_I [intro]: "a \<in> A \<Longrightarrow> b \<in> B a \<Longrightarrow> b \<in> (\<Union>x\<in>A. B x)"
-  \<comment> \<open>The order of the premises presupposes that @{term A} is rigid;
-    @{term b} may be flexible.\<close>
+  \<comment> \<open>The order of the premises presupposes that \<^term>\<open>A\<close> is rigid;
+    \<^term>\<open>b\<close> may be flexible.\<close>
   by auto
 
 lemma UN_E [elim!]: "b \<in> (\<Union>x\<in>A. B x) \<Longrightarrow> (\<And>x. x\<in>A \<Longrightarrow> b \<in> B x \<Longrightarrow> R) \<Longrightarrow> R"
--- a/src/HOL/Complete_Partial_Order.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Complete_Partial_Order.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -11,7 +11,7 @@
 
 subsection \<open>Monotone functions\<close>
 
-text \<open>Dictionary-passing version of @{const Orderings.mono}.\<close>
+text \<open>Dictionary-passing version of \<^const>\<open>Orderings.mono\<close>.\<close>
 
 definition monotone :: "('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> ('b \<Rightarrow> 'b \<Rightarrow> bool) \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> bool"
   where "monotone orda ordb f \<longleftrightarrow> (\<forall>x y. orda x y \<longrightarrow> ordb (f x) (f y))"
--- a/src/HOL/Conditionally_Complete_Lattices.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Conditionally_Complete_Lattices.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -170,8 +170,8 @@
 
 text \<open>
 
-To avoid name classes with the @{class complete_lattice}-class we prefix @{const Sup} and
-@{const Inf} in theorem names with c.
+To avoid name classes with the \<^class>\<open>complete_lattice\<close>-class we prefix \<^const>\<open>Sup\<close> and
+\<^const>\<open>Inf\<close> in theorem names with c.
 
 \<close>
 
--- a/src/HOL/Deriv.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Deriv.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -20,10 +20,10 @@
     ((\<lambda>y. ((f y - f (Lim F (\<lambda>x. x))) - f' (y - Lim F (\<lambda>x. x))) /\<^sub>R norm (y - Lim F (\<lambda>x. x))) \<longlongrightarrow> 0) F"
 
 text \<open>
-  Usually the filter @{term F} is @{term "at x within s"}.  @{term "(f has_derivative D)
-  (at x within s)"} means: @{term D} is the derivative of function @{term f} at point @{term x}
-  within the set @{term s}. Where @{term s} is used to express left or right sided derivatives. In
-  most cases @{term s} is either a variable or @{term UNIV}.
+  Usually the filter \<^term>\<open>F\<close> is \<^term>\<open>at x within s\<close>.  \<^term>\<open>(f has_derivative D)
+  (at x within s)\<close> means: \<^term>\<open>D\<close> is the derivative of function \<^term>\<open>f\<close> at point \<^term>\<open>x\<close>
+  within the set \<^term>\<open>s\<close>. Where \<^term>\<open>s\<close> is used to express left or right sided derivatives. In
+  most cases \<^term>\<open>s\<close> is either a variable or \<^term>\<open>UNIV\<close>.
 \<close>
 
 text \<open>These are the only cases we'll care about, probably.\<close>
@@ -60,7 +60,7 @@
     Global_Theory.add_thms_dynamic
       (\<^binding>\<open>derivative_eq_intros\<close>,
         fn context =>
-          Named_Theorems.get (Context.proof_of context) @{named_theorems derivative_intros}
+          Named_Theorems.get (Context.proof_of context) \<^named_theorems>\<open>derivative_intros\<close>
           |> map_filter eq_rule)
   end
 \<close>
@@ -510,7 +510,7 @@
 subsection \<open>Uniqueness\<close>
 
 text \<open>
-This can not generally shown for @{const has_derivative}, as we need to approach the point from
+This can not generally shown for \<^const>\<open>has_derivative\<close>, as we need to approach the point from
 all directions. There is a proof in \<open>Analysis\<close> for \<open>euclidean_space\<close>.
 \<close>
 
@@ -1107,7 +1107,7 @@
 
 subsection \<open>Local extrema\<close>
 
-text \<open>If @{term "0 < f' x"} then @{term x} is Locally Strictly Increasing At The Right.\<close>
+text \<open>If \<^term>\<open>0 < f' x\<close> then \<^term>\<open>x\<close> is Locally Strictly Increasing At The Right.\<close>
 
 lemma has_real_derivative_pos_inc_right:
   fixes f :: "real \<Rightarrow> real"
@@ -1273,10 +1273,10 @@
   by (force dest: lemma_interval_lt)
 
 text \<open>Rolle's Theorem.
-   If @{term f} is defined and continuous on the closed interval
+   If \<^term>\<open>f\<close> is defined and continuous on the closed interval
    \<open>[a,b]\<close> and differentiable on the open interval \<open>(a,b)\<close>,
-   and @{term "f a = f b"},
-   then there exists \<open>x0 \<in> (a,b)\<close> such that @{term "f' x0 = 0"}\<close>
+   and \<^term>\<open>f a = f b\<close>,
+   then there exists \<open>x0 \<in> (a,b)\<close> such that \<^term>\<open>f' x0 = 0\<close>\<close>
 theorem Rolle_deriv:
   fixes f :: "real \<Rightarrow> real"
   assumes "a < b"
@@ -1301,7 +1301,7 @@
   then show ?thesis
   proof cases
     case 1
-    \<comment> \<open>@{term f} attains its maximum within the interval\<close>
+    \<comment> \<open>\<^term>\<open>f\<close> attains its maximum within the interval\<close>
     then obtain l where der: "DERIV f x :> l"
       using derf differentiable_def real_differentiable_def by blast
     obtain d where d: "0 < d" and bound: "\<forall>y. \<bar>x - y\<bar> < d \<longrightarrow> a \<le> y \<and> y \<le> b"
@@ -1321,7 +1321,7 @@
     then show ?thesis
     proof cases
       case 1
-        \<comment> \<open>@{term f} attains its minimum within the interval\<close>
+        \<comment> \<open>\<^term>\<open>f\<close> attains its minimum within the interval\<close>
       then obtain l where der: "DERIV f x' :> l"
         using derf differentiable_def real_differentiable_def by blast 
       from lemma_interval [OF 1]
@@ -1335,7 +1335,7 @@
         by (metis has_derivative_unique has_field_derivative_def mult_zero_left)
     next
       case 2
-        \<comment> \<open>@{term f} is constant throughout the interval\<close>
+        \<comment> \<open>\<^term>\<open>f\<close> is constant throughout the interval\<close>
       then have fx': "f b = f x'" by (auto simp: fab)
       from dense [OF \<open>a < b\<close>] obtain r where r: "a < r" "r < b" by blast
       obtain d where d: "0 < d" and bound: "\<forall>y. \<bar>r - y\<bar> < d \<longrightarrow> a \<le> y \<and> y \<le> b"
--- a/src/HOL/Divides.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Divides.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -354,7 +354,7 @@
 lemmas zmod_eq_0D [dest!] = zmod_eq_0_iff [THEN iffD1]
 
 
-subsubsection \<open>Proving  @{term "a div (b * c) = (a div b) div c"}\<close>
+subsubsection \<open>Proving  \<^term>\<open>a div (b * c) = (a div b) div c\<close>\<close>
 
 (*The condition c>0 seems necessary.  Consider that 7 div ~6 = ~2 but
   7 div 2 div ~3 = 3 div ~3 = ~1.  The subcase (a div b) mod c = 0 seems
@@ -495,9 +495,9 @@
     by (auto simp add: split_pos_lemma [of concl: "\<lambda>x y. P y"] split_neg_lemma [of concl: "\<lambda>x y. P y"])
 qed auto
 
-text \<open>Enable (lin)arith to deal with @{const divide} and @{const modulo}
+text \<open>Enable (lin)arith to deal with \<^const>\<open>divide\<close> and \<^const>\<open>modulo\<close>
   when these are applied to some constant that is of the form
-  @{term "numeral k"}:\<close>
+  \<^term>\<open>numeral k\<close>:\<close>
 declare split_zdiv [of _ _ "numeral k", arith_split] for k
 declare split_zmod [of _ _ "numeral k", arith_split] for k
 
@@ -1257,7 +1257,7 @@
    "- numeral a div numeral b :: int" | "- numeral a mod numeral b :: int" |
    "- numeral a div - numeral b :: int" | "- numeral a mod - numeral b :: int") =
 \<open> let
-    val if_cong = the (Code.get_case_cong @{theory} @{const_name If});
+    val if_cong = the (Code.get_case_cong \<^theory> \<^const_name>\<open>If\<close>);
     fun successful_rewrite ctxt ct =
       let
         val thm = Simplifier.rewrite ctxt ct
--- a/src/HOL/Eisbach/Eisbach_Tools.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Eisbach/Eisbach_Tools.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -27,17 +27,17 @@
 
 val _ =
   Theory.setup
-   (setup_trace_method @{binding print_fact}
+   (setup_trace_method \<^binding>\<open>print_fact\<close>
       (Scan.lift (Scan.ahead Parse.not_eof) -- Attrib.thms)
       (fn ctxt => fn (tok, thms) =>
         (* FIXME proper formatting!? *)
         Token.unparse tok ^ ": " ^ commas (map (Thm.string_of_thm ctxt) thms)) #>
-    setup_trace_method @{binding print_term}
+    setup_trace_method \<^binding>\<open>print_term\<close>
       (Scan.lift (Scan.ahead Parse.not_eof) -- Args.term)
       (fn ctxt => fn (tok, t) =>
         (* FIXME proper formatting!? *)
         Token.unparse tok ^ ": " ^ Syntax.string_of_term ctxt t) #>
-    setup_trace_method @{binding print_type}
+    setup_trace_method \<^binding>\<open>print_type\<close>
       (Scan.lift (Scan.ahead Parse.not_eof) -- Args.typ)
       (fn ctxt => fn (tok, t) =>
         (* FIXME proper formatting!? *)
--- a/src/HOL/Eisbach/eisbach_rule_insts.ML	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Eisbach/eisbach_rule_insts.ML	Fri Jan 04 23:22:53 2019 +0100
@@ -199,7 +199,7 @@
 
 val _ =
   Theory.setup
-    (Attrib.setup @{binding "where"}
+    (Attrib.setup \<^binding>\<open>where\<close>
       (Scan.lift
         (Parse.and_list1 (Args.var -- (Args.$$$ "=" |-- Parse_Tools.name_term)) -- Parse.for_fixes)
         >> (fn args =>
@@ -211,7 +211,7 @@
 
 val _ =
   Theory.setup
-    (Attrib.setup @{binding "of"}
+    (Attrib.setup \<^binding>\<open>of\<close>
       (Scan.lift
         (Args.mode "unchecked" --
           (Scan.repeat (Scan.unless concl inst) --
--- a/src/HOL/Eisbach/match_method.ML	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Eisbach/match_method.ML	Fri Jan 04 23:22:53 2019 +0100
@@ -44,9 +44,9 @@
 val aconv_net = Item_Net.init (op aconv) single;
 
 val parse_match_kind =
-  Scan.lift @{keyword "conclusion"} >> K Match_Concl ||
-  Scan.lift (@{keyword "premises"} |-- Args.mode "local") >> Match_Prems ||
-  Scan.lift (@{keyword "("}) |-- Args.term --| Scan.lift (@{keyword ")"}) >>
+  Scan.lift \<^keyword>\<open>conclusion\<close> >> K Match_Concl ||
+  Scan.lift (\<^keyword>\<open>premises\<close> |-- Args.mode "local") >> Match_Prems ||
+  Scan.lift (\<^keyword>\<open>(\<close>) |-- Args.term --| Scan.lift (\<^keyword>\<open>)\<close>) >>
     (fn t => Match_Term (Item_Net.update t aconv_net)) ||
   Attrib.thms >> (fn thms => Match_Fact (fold Item_Net.update thms Thm.full_rules));
 
@@ -62,10 +62,10 @@
 
 val fixes =
   Parse.and_list1 (Scan.repeat1 (Parse.position bound_term) --
-    Scan.option (@{keyword "::"} |-- Parse.!!! Parse.typ)
+    Scan.option (\<^keyword>\<open>::\<close> |-- Parse.!!! Parse.typ)
     >> (fn (xs, T) => map (fn (x, pos) => ((x, T), pos)) xs)) >> flat;
 
-val for_fixes = Scan.optional (@{keyword "for"} |-- fixes) [];
+val for_fixes = Scan.optional (\<^keyword>\<open>for\<close> |-- fixes) [];
 
 fun pos_of dyn = Parse_Tools.the_parse_val dyn |> Binding.pos_of;
 
@@ -95,7 +95,7 @@
         else
           let val b = #1 (the opt_dyn)
           in error ("Cannot bind fact name in term match" ^ Position.here (pos_of b)) end)) --
-  Scan.lift (for_fixes -- (@{keyword "\<Rightarrow>"} |-- Parse.token Parse.text))
+  Scan.lift (for_fixes -- (\<^keyword>\<open>\<Rightarrow>\<close> |-- Parse.token Parse.text))
   >> (fn ((ctxt, ts), (fixes, body)) =>
     (case Token.get_value body of
       SOME (Token.Source src) =>
@@ -124,11 +124,11 @@
           fun drop_judgment_dummy t =
             (case t of
               Const (judgment, _) $
-                (Const (@{syntax_const "_type_constraint_"}, T) $
-                  Const (@{const_name Pure.dummy_pattern}, _)) =>
+                (Const (\<^syntax_const>\<open>_type_constraint_\<close>, T) $
+                  Const (\<^const_name>\<open>Pure.dummy_pattern\<close>, _)) =>
                 if judgment = Object_Logic.judgment_name ctxt then
-                    Const (@{syntax_const "_type_constraint_"}, T) $
-                      Const (@{const_name Pure.dummy_pattern}, propT)
+                    Const (\<^syntax_const>\<open>_type_constraint_\<close>, T) $
+                      Const (\<^const_name>\<open>Pure.dummy_pattern\<close>, propT)
                 else t
             | t1 $ t2 => drop_judgment_dummy t1 $ drop_judgment_dummy t2
             | Abs (a, T, b) => Abs (a, T, drop_judgment_dummy b)
@@ -400,7 +400,7 @@
 (*TODO: Preliminary analysis to see if we're trying to clear in a non-focus match?*)
 val _ =
   Theory.setup
-    (Attrib.setup @{binding "thin"}
+    (Attrib.setup \<^binding>\<open>thin\<close>
       (Scan.succeed
         (Thm.declaration_attribute (fn th => Context.mapping I (remove_focus_prem th))))
         "clear premise inside match method");
@@ -730,9 +730,9 @@
 
 val _ =
   Theory.setup
-    (Method.setup @{binding match}
+    (Method.setup \<^binding>\<open>match\<close>
       (parse_match_kind :--
-        (fn kind => Scan.lift @{keyword "in"} |-- Parse.enum1' "\<bar>" (parse_named_pats kind)) >>
+        (fn kind => Scan.lift \<^keyword>\<open>in\<close> |-- Parse.enum1' "\<bar>" (parse_named_pats kind)) >>
         (fn (matches, bodies) => fn ctxt =>
           CONTEXT_METHOD (fn using => Method.RUNTIME (fn (goal_ctxt, st) =>
             let
--- a/src/HOL/Eisbach/method_closure.ML	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Eisbach/method_closure.ML	Fri Jan 04 23:22:53 2019 +0100
@@ -239,12 +239,12 @@
 end;
 
 val _ =
-  Outer_Syntax.local_theory @{command_keyword method} "Eisbach method definition"
+  Outer_Syntax.local_theory \<^command_keyword>\<open>method\<close> "Eisbach method definition"
     (Parse.binding -- Parse.for_fixes --
-      ((Scan.optional (@{keyword "methods"} |-- Parse.!!! (Scan.repeat1 Parse.binding)) []) --
-        (Scan.optional (@{keyword "uses"} |-- Parse.!!! (Scan.repeat1 Parse.binding)) [])) --
-      (Scan.optional (@{keyword "declares"} |-- Parse.!!! (Scan.repeat1 Parse.binding)) []) --
-      Parse.!!! (@{keyword "="} |-- Parse.args1 (K true)) >>
+      ((Scan.optional (\<^keyword>\<open>methods\<close> |-- Parse.!!! (Scan.repeat1 Parse.binding)) []) --
+        (Scan.optional (\<^keyword>\<open>uses\<close> |-- Parse.!!! (Scan.repeat1 Parse.binding)) [])) --
+      (Scan.optional (\<^keyword>\<open>declares\<close> |-- Parse.!!! (Scan.repeat1 Parse.binding)) []) --
+      Parse.!!! (\<^keyword>\<open>=\<close> |-- Parse.args1 (K true)) >>
       (fn ((((name, vars), (methods, uses)), declares), src) =>
         #2 o method_cmd name vars uses declares methods src));
 
--- a/src/HOL/Enum.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Enum.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -52,7 +52,7 @@
 end
 
 
-subsection \<open>Implementations using @{class enum}\<close>
+subsection \<open>Implementations using \<^class>\<open>enum\<close>\<close>
 
 subsubsection \<open>Unbounded operations and quantifiers\<close>
 
@@ -241,7 +241,7 @@
   by (simp add: card_UNIV_def acc_bacc_eq)
 
 
-subsection \<open>Default instances for @{class enum}\<close>
+subsection \<open>Default instances for \<^class>\<open>enum\<close>\<close>
 
 lemma map_of_zip_enum_is_Some:
   assumes "length ys = length (enum :: 'a::enum list)"
@@ -566,7 +566,7 @@
 simproc_setup finite_1_eq ("x::finite_1") = \<open>
   fn _ => fn _ => fn ct =>
     (case Thm.term_of ct of
-      Const (@{const_name a\<^sub>1}, _) => NONE
+      Const (\<^const_name>\<open>a\<^sub>1\<close>, _) => NONE
     | _ => SOME (mk_meta_eq @{thm finite_1_eq}))
 \<close>
 
@@ -993,8 +993,8 @@
 
 instantiation finite_4 :: finite_distrib_lattice begin
 
-text \<open>@{term a\<^sub>1} $<$ @{term a\<^sub>2},@{term a\<^sub>3} $<$ @{term a\<^sub>4},
-  but @{term a\<^sub>2} and @{term a\<^sub>3} are incomparable.\<close>
+text \<open>\<^term>\<open>a\<^sub>1\<close> $<$ \<^term>\<open>a\<^sub>2\<close>,\<^term>\<open>a\<^sub>3\<close> $<$ \<^term>\<open>a\<^sub>4\<close>,
+  but \<^term>\<open>a\<^sub>2\<close> and \<^term>\<open>a\<^sub>3\<close> are incomparable.\<close>
 
 definition
   "x < y \<longleftrightarrow> (case (x, y) of
--- a/src/HOL/Euclidean_Division.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Euclidean_Division.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -761,7 +761,7 @@
 end
 
 
-subsection \<open>Euclidean division on @{typ nat}\<close>
+subsection \<open>Euclidean division on \<^typ>\<open>nat\<close>\<close>
 
 instantiation nat :: normalization_semidom
 begin
@@ -889,10 +889,10 @@
 ML \<open>
 structure Cancel_Div_Mod_Nat = Cancel_Div_Mod
 (
-  val div_name = @{const_name divide};
-  val mod_name = @{const_name modulo};
+  val div_name = \<^const_name>\<open>divide\<close>;
+  val mod_name = \<^const_name>\<open>modulo\<close>;
   val mk_binop = HOLogic.mk_binop;
-  val dest_plus = HOLogic.dest_bin @{const_name Groups.plus} HOLogic.natT;
+  val dest_plus = HOLogic.dest_bin \<^const_name>\<open>Groups.plus\<close> HOLogic.natT;
   val mk_sum = Arith_Data.mk_sum;
   fun dest_sum tm =
     if HOLogic.is_zero tm then []
@@ -1145,7 +1145,7 @@
     by (simp add: div_add1_eq [of m q k])
 qed
 
-text \<open>Antimonotonicity of @{const divide} in second argument\<close>
+text \<open>Antimonotonicity of \<^const>\<open>divide\<close> in second argument\<close>
 
 lemma div_le_mono2:
   "k div n \<le> k div m" if "0 < m" and "m \<le> n" for m n k :: nat
@@ -1408,7 +1408,7 @@
 qed
 
 
-subsection \<open>Euclidean division on @{typ int}\<close>
+subsection \<open>Euclidean division on \<^typ>\<open>int\<close>\<close>
 
 instantiation int :: normalization_semidom
 begin
--- a/src/HOL/Extraction.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Extraction.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -22,7 +22,7 @@
       Proofterm.rewrite_proof thy
         (RewriteHOLProof.rews,
          ProofRewriteRules.rprocs true @ [ProofRewriteRules.expand_of_class ctxt]) o
-      ProofRewriteRules.elim_vars (curry Const @{const_name default})
+      ProofRewriteRules.elim_vars (curry Const \<^const_name>\<open>default\<close>)
     end)
 \<close>
 
--- a/src/HOL/Fields.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Fields.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -942,7 +942,7 @@
 apply (simp add: less_imp_not_eq nonzero_minus_divide_right [symmetric])
 done
 
-text\<open>The last premise ensures that @{term a} and @{term b}
+text\<open>The last premise ensures that \<^term>\<open>a\<close> and \<^term>\<open>b\<close>
       have the same sign\<close>
 lemma divide_strict_left_mono:
   "[|b < a; 0 < c; 0 < a*b|] ==> c / a < c / b"
@@ -1268,7 +1268,7 @@
   finally show ?thesis .
 qed
 
-text\<open>For creating values between @{term u} and @{term v}.\<close>
+text\<open>For creating values between \<^term>\<open>u\<close> and \<^term>\<open>v\<close>.\<close>
 lemma scaling_mono:
   assumes "u \<le> v" "0 \<le> r" "r \<le> s"
     shows "u + r * (v - u) / s \<le> v"
--- a/src/HOL/Filter.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Filter.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -251,8 +251,8 @@
 
 subsubsection \<open>Finer-than relation\<close>
 
-text \<open>@{term "F \<le> F'"} means that filter @{term F} is finer than
-filter @{term F'}.\<close>
+text \<open>\<^term>\<open>F \<le> F'\<close> means that filter \<^term>\<open>F\<close> is finer than
+filter \<^term>\<open>F'\<close>.\<close>
 
 instantiation filter :: (type) complete_lattice
 begin
@@ -1395,7 +1395,7 @@
   unfolding filterlim_def
   by (rule order_trans[OF filtermap_Pair prod_filter_mono])
 
-subsection \<open>Limits to @{const at_top} and @{const at_bot}\<close>
+subsection \<open>Limits to \<^const>\<open>at_top\<close> and \<^const>\<open>at_bot\<close>\<close>
 
 lemma filterlim_at_top:
   fixes f :: "'a \<Rightarrow> ('b::linorder)"
@@ -1527,7 +1527,7 @@
     by eventually_elim (insert n, auto)
 qed
 
-subsection \<open>Setup @{typ "'a filter"} for lifting and transfer\<close>
+subsection \<open>Setup \<^typ>\<open>'a filter\<close> for lifting and transfer\<close>
 
 lemma filtermap_id [simp, id_simps]: "filtermap id = id"
 by(simp add: fun_eq_iff id_def filtermap_ident)
--- a/src/HOL/Finite_Set.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Finite_Set.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -777,7 +777,7 @@
 
 text \<open>
   A tempting alternative for the definiens is
-  @{term "if finite A then THE y. fold_graph f z A y else e"}.
+  \<^term>\<open>if finite A then THE y. fold_graph f z A y else e\<close>.
   It allows the removal of finiteness assumptions from the theorems
   \<open>fold_comm\<close>, \<open>fold_reindex\<close> and \<open>fold_distrib\<close>.
   The proofs become ugly. It is not worth the effort. (???)
@@ -787,7 +787,7 @@
   by (induct rule: finite_induct) auto
 
 
-subsubsection \<open>From @{const fold_graph} to @{term fold}\<close>
+subsubsection \<open>From \<^const>\<open>fold_graph\<close> to \<^term>\<open>fold\<close>\<close>
 
 context comp_fun_commute
 begin
@@ -868,7 +868,7 @@
 lemma (in -) fold_empty [simp]: "fold f z {} = z"
   by (auto simp: fold_def)
 
-text \<open>The various recursion equations for @{const fold}:\<close>
+text \<open>The various recursion equations for \<^const>\<open>fold\<close>:\<close>
 
 lemma fold_insert [simp]:
   assumes "finite A" and "x \<notin> A"
@@ -933,7 +933,7 @@
 
 end
 
-text \<open>Other properties of @{const fold}:\<close>
+text \<open>Other properties of \<^const>\<open>fold\<close>:\<close>
 
 lemma fold_image:
   assumes "inj_on g A"
@@ -1101,7 +1101,7 @@
 qed
 
 
-subsubsection \<open>Expressing set operations via @{const fold}\<close>
+subsubsection \<open>Expressing set operations via \<^const>\<open>fold\<close>\<close>
 
 lemma comp_fun_commute_const: "comp_fun_commute (\<lambda>_. f)"
   by standard rule
@@ -1356,9 +1356,9 @@
 
 text \<open>
   The traditional definition
-  @{prop "card A \<equiv> LEAST n. \<exists>f. A = {f i |i. i < n}"}
+  \<^prop>\<open>card A \<equiv> LEAST n. \<exists>f. A = {f i |i. i < n}\<close>
   is ugly to work with.
-  But now that we have @{const fold} things are easy:
+  But now that we have \<^const>\<open>fold\<close> things are easy:
 \<close>
 
 global_interpretation card: folding "\<lambda>_. Suc" 0
--- a/src/HOL/Fun.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Fun.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -856,16 +856,16 @@
 simproc_setup fun_upd2 ("f(v := w, x := y)") = \<open>fn _ =>
   let
     fun gen_fun_upd NONE T _ _ = NONE
-      | gen_fun_upd (SOME f) T x y = SOME (Const (@{const_name fun_upd}, T) $ f $ x $ y)
+      | gen_fun_upd (SOME f) T x y = SOME (Const (\<^const_name>\<open>fun_upd\<close>, T) $ f $ x $ y)
     fun dest_fun_T1 (Type (_, T :: Ts)) = T
-    fun find_double (t as Const (@{const_name fun_upd},T) $ f $ x $ y) =
+    fun find_double (t as Const (\<^const_name>\<open>fun_upd\<close>,T) $ f $ x $ y) =
       let
-        fun find (Const (@{const_name fun_upd},T) $ g $ v $ w) =
+        fun find (Const (\<^const_name>\<open>fun_upd\<close>,T) $ g $ v $ w) =
               if v aconv x then SOME g else gen_fun_upd (find g) T v w
           | find t = NONE
       in (dest_fun_T1 T, gen_fun_upd (find f) T x y) end
 
-    val ss = simpset_of @{context}
+    val ss = simpset_of \<^context>
 
     fun proc ctxt ct =
       let
--- a/src/HOL/GCD.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/GCD.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -1709,7 +1709,7 @@
 end
 
 
-subsection \<open>GCD and LCM on @{typ nat} and @{typ int}\<close>
+subsection \<open>GCD and LCM on \<^typ>\<open>nat\<close> and \<^typ>\<open>int\<close>\<close>
 
 instantiation nat :: gcd
 begin
@@ -1893,7 +1893,7 @@
 declare gcd_nat.simps [simp del]
 
 text \<open>
-  \<^medskip> @{term "gcd m n"} divides \<open>m\<close> and \<open>n\<close>.
+  \<^medskip> \<^term>\<open>gcd m n\<close> divides \<open>m\<close> and \<open>n\<close>.
   The conjunctions don't seem provable separately.
 \<close>
 
@@ -2368,7 +2368,7 @@
 qed
 
 
-subsection \<open>LCM properties on @{typ nat} and @{typ int}\<close>
+subsection \<open>LCM properties on \<^typ>\<open>nat\<close> and \<^typ>\<open>int\<close>\<close>
 
 lemma lcm_altdef_int [code]: "lcm a b = \<bar>a\<bar> * \<bar>b\<bar> div gcd a b"
   for a b :: int
@@ -2445,7 +2445,7 @@
   by auto
 
 
-subsection \<open>The complete divisibility lattice on @{typ nat} and @{typ int}\<close>
+subsection \<open>The complete divisibility lattice on \<^typ>\<open>nat\<close> and \<^typ>\<open>int\<close>\<close>
 
 text \<open>
   Lifting \<open>gcd\<close> and \<open>lcm\<close> to sets (\<open>Gcd\<close> / \<open>Lcm\<close>).
@@ -2670,7 +2670,7 @@
 qed simp_all
 
 
-subsection \<open>GCD and LCM on @{typ integer}\<close>
+subsection \<open>GCD and LCM on \<^typ>\<open>integer\<close>\<close>
 
 instantiation integer :: gcd
 begin
--- a/src/HOL/Groebner_Basis.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Groebner_Basis.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -10,9 +10,9 @@
 
 subsection \<open>Groebner Bases\<close>
 
-lemmas bool_simps = simp_thms(1-34) \<comment> \<open>FIXME move to @{theory HOL.HOL}\<close>
+lemmas bool_simps = simp_thms(1-34) \<comment> \<open>FIXME move to \<^theory>\<open>HOL.HOL\<close>\<close>
 
-lemma nnf_simps: \<comment> \<open>FIXME shadows fact binding in @{theory HOL.HOL}\<close>
+lemma nnf_simps: \<comment> \<open>FIXME shadows fact binding in \<^theory>\<open>HOL.HOL\<close>\<close>
   "(\<not>(P \<and> Q)) = (\<not>P \<or> \<not>Q)" "(\<not>(P \<or> Q)) = (\<not>P \<and> \<not>Q)"
   "(P \<longrightarrow> Q) = (\<not>P \<or> Q)"
   "(P = Q) = ((P \<and> Q) \<or> (\<not>P \<and> \<not> Q))" "(\<not> \<not>(P)) = P"
--- a/src/HOL/Groups.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Groups.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -167,8 +167,8 @@
 
 setup \<open>
   Reorient_Proc.add
-    (fn Const(@{const_name Groups.zero}, _) => true
-      | Const(@{const_name Groups.one}, _) => true
+    (fn Const(\<^const_name>\<open>Groups.zero\<close>, _) => true
+      | Const(\<^const_name>\<open>Groups.one\<close>, _) => true
       | _ => false)
 \<close>
 
@@ -179,10 +179,10 @@
   let
     fun tr' c = (c, fn ctxt => fn T => fn ts =>
       if null ts andalso Printer.type_emphasis ctxt T then
-        Syntax.const @{syntax_const "_constrain"} $ Syntax.const c $
+        Syntax.const \<^syntax_const>\<open>_constrain\<close> $ Syntax.const c $
           Syntax_Phases.term_of_typ ctxt T
       else raise Match);
-  in map tr' [@{const_syntax Groups.one}, @{const_syntax Groups.zero}] end
+  in map tr' [\<^const_syntax>\<open>Groups.one\<close>, \<^const_syntax>\<open>Groups.zero\<close>] end
 \<close> \<comment> \<open>show types that are presumably too general\<close>
 
 class plus =
--- a/src/HOL/Groups_Big.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Groups_Big.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -519,7 +519,7 @@
 
 end
 
-text \<open>Now: lots of fancy syntax. First, @{term "sum (\<lambda>x. e) A"} is written \<open>\<Sum>x\<in>A. e\<close>.\<close>
+text \<open>Now: lots of fancy syntax. First, \<^term>\<open>sum (\<lambda>x. e) A\<close> is written \<open>\<Sum>x\<in>A. e\<close>.\<close>
 
 syntax (ASCII)
   "_sum" :: "pttrn \<Rightarrow> 'a set \<Rightarrow> 'b \<Rightarrow> 'b::comm_monoid_add"  ("(3SUM (_/:_)./ _)" [0, 51, 10] 10)
@@ -528,7 +528,7 @@
 translations \<comment> \<open>Beware of argument permutation!\<close>
   "\<Sum>i\<in>A. b" \<rightleftharpoons> "CONST sum (\<lambda>i. b) A"
 
-text \<open>Instead of @{term"\<Sum>x\<in>{x. P}. e"} we introduce the shorter \<open>\<Sum>x|P. e\<close>.\<close>
+text \<open>Instead of \<^term>\<open>\<Sum>x\<in>{x. P}. e\<close> we introduce the shorter \<open>\<Sum>x|P. e\<close>.\<close>
 
 syntax (ASCII)
   "_qsum" :: "pttrn \<Rightarrow> bool \<Rightarrow> 'a \<Rightarrow> 'a"  ("(3SUM _ |/ _./ _)" [0, 0, 10] 10)
@@ -539,7 +539,7 @@
 
 print_translation \<open>
 let
-  fun sum_tr' [Abs (x, Tx, t), Const (@{const_syntax Collect}, _) $ Abs (y, Ty, P)] =
+  fun sum_tr' [Abs (x, Tx, t), Const (\<^const_syntax>\<open>Collect\<close>, _) $ Abs (y, Ty, P)] =
         if x <> y then raise Match
         else
           let
@@ -547,10 +547,10 @@
             val t' = subst_bound (x', t);
             val P' = subst_bound (x', P);
           in
-            Syntax.const @{syntax_const "_qsum"} $ Syntax_Trans.mark_bound_abs (x, Tx) $ P' $ t'
+            Syntax.const \<^syntax_const>\<open>_qsum\<close> $ Syntax_Trans.mark_bound_abs (x, Tx) $ P' $ t'
           end
     | sum_tr' _ = raise Match;
-in [(@{const_syntax sum}, K sum_tr')] end
+in [(\<^const_syntax>\<open>sum\<close>, K sum_tr')] end
 \<close>
 
 
@@ -938,7 +938,7 @@
 qed simp_all
 
 
-subsubsection \<open>Cardinality as special case of @{const sum}\<close>
+subsubsection \<open>Cardinality as special case of \<^const>\<open>sum\<close>\<close>
 
 lemma card_eq_sum: "card A = sum (\<lambda>x. 1) A"
 proof -
@@ -1134,7 +1134,7 @@
 translations \<comment> \<open>Beware of argument permutation!\<close>
   "\<Prod>i\<in>A. b" == "CONST prod (\<lambda>i. b) A"
 
-text \<open>Instead of @{term"\<Prod>x\<in>{x. P}. e"} we introduce the shorter \<open>\<Prod>x|P. e\<close>.\<close>
+text \<open>Instead of \<^term>\<open>\<Prod>x\<in>{x. P}. e\<close> we introduce the shorter \<open>\<Prod>x|P. e\<close>.\<close>
 
 syntax (ASCII)
   "_qprod" :: "pttrn \<Rightarrow> bool \<Rightarrow> 'a \<Rightarrow> 'a"  ("(4PROD _ |/ _./ _)" [0, 0, 10] 10)
--- a/src/HOL/Groups_List.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Groups_List.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -252,7 +252,7 @@
   "sum_list (map f [k..l]) = sum f (set [k..l])"
   by (simp add: sum_list_distinct_conv_sum_set)
 
-text \<open>General equivalence between @{const sum_list} and @{const sum}\<close>
+text \<open>General equivalence between \<^const>\<open>sum_list\<close> and \<^const>\<open>sum\<close>\<close>
 lemma (in monoid_add) sum_list_sum_nth:
   "sum_list xs = (\<Sum> i = 0 ..< length xs. xs ! i)"
   using interv_sum_list_conv_sum_set_nat [of "(!) xs" 0 "length xs"] by (simp add: map_nth)
@@ -327,7 +327,7 @@
 qed
 
 
-subsection \<open>Further facts about @{const List.n_lists}\<close>
+subsection \<open>Further facts about \<^const>\<open>List.n_lists\<close>\<close>
 
 lemma length_n_lists: "length (List.n_lists n xs) = length xs ^ n"
   by (induct n) (auto simp add: comp_def length_concat sum_list_triv)
--- a/src/HOL/HOL.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/HOL.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -45,11 +45,11 @@
 \<close>
 ML \<open>
   Plugin_Name.define_setup \<^binding>\<open>quickcheck\<close>
-   [@{plugin quickcheck_exhaustive},
-    @{plugin quickcheck_random},
-    @{plugin quickcheck_bounded_forall},
-    @{plugin quickcheck_full_exhaustive},
-    @{plugin quickcheck_narrowing}]
+   [\<^plugin>\<open>quickcheck_exhaustive\<close>,
+    \<^plugin>\<open>quickcheck_random\<close>,
+    \<^plugin>\<open>quickcheck_bounded_forall\<close>,
+    \<^plugin>\<open>quickcheck_full_exhaustive\<close>,
+    \<^plugin>\<open>quickcheck_narrowing\<close>]
 \<close>
 
 
@@ -68,7 +68,7 @@
 
 setup \<open>Axclass.class_axiomatization (\<^binding>\<open>type\<close>, [])\<close>
 default_sort type
-setup \<open>Object_Logic.add_base_sort @{sort type}\<close>
+setup \<open>Object_Logic.add_base_sort \<^sort>\<open>type\<close>\<close>
 
 axiomatization where fun_arity: "OFCLASS('a \<Rightarrow> 'b, type_class)"
 instance "fun" :: (type, type) type by (rule fun_arity)
@@ -129,7 +129,7 @@
 translations "\<exists>!x. P" \<rightleftharpoons> "CONST Ex1 (\<lambda>x. P)"
 
 print_translation \<open>
- [Syntax_Trans.preserve_binder_abs_tr' @{const_syntax Ex1} @{syntax_const "_Ex1"}]
+ [Syntax_Trans.preserve_binder_abs_tr' \<^const_syntax>\<open>Ex1\<close> \<^syntax_const>\<open>_Ex1\<close>]
 \<close> \<comment> \<open>to avoid eta-contraction of body\<close>
 
 
@@ -158,9 +158,9 @@
 syntax "_The" :: "[pttrn, bool] \<Rightarrow> 'a"  ("(3THE _./ _)" [0, 10] 10)
 translations "THE x. P" \<rightleftharpoons> "CONST The (\<lambda>x. P)"
 print_translation \<open>
-  [(@{const_syntax The}, fn _ => fn [Abs abs] =>
+  [(\<^const_syntax>\<open>The\<close>, fn _ => fn [Abs abs] =>
       let val (x, t) = Syntax_Trans.atomic_abs_tr' abs
-      in Syntax.const @{syntax_const "_The"} $ x $ t end)]
+      in Syntax.const \<^syntax_const>\<open>_The\<close> $ x $ t end)]
 \<close>  \<comment> \<open>To avoid eta-contraction of body\<close>
 
 nonterminal letbinds and letbind
@@ -833,7 +833,7 @@
 setup \<open>
   (*prevent substitution on bool*)
   let
-    fun non_bool_eq (@{const_name HOL.eq}, Type (_, [T, _])) = T <> @{typ bool}
+    fun non_bool_eq (\<^const_name>\<open>HOL.eq\<close>, Type (_, [T, _])) = T <> \<^typ>\<open>bool\<close>
       | non_bool_eq _ = false;
     fun hyp_subst_tac' ctxt =
       SUBGOAL (fn (goal, i) =>
@@ -866,7 +866,7 @@
 declare exE [elim!]
   allE [elim]
 
-ML \<open>val HOL_cs = claset_of @{context}\<close>
+ML \<open>val HOL_cs = claset_of \<^context>\<close>
 
 lemma contrapos_np: "\<not> Q \<Longrightarrow> (\<not> P \<Longrightarrow> Q) \<Longrightarrow> P"
   apply (erule swap)
@@ -890,7 +890,7 @@
   apply (rule prem)
    apply assumption
   apply (rule allI)+
-  apply (tactic \<open>eresolve_tac @{context} [Classical.dup_elim @{context} @{thm allE}] 1\<close>)
+  apply (tactic \<open>eresolve_tac \<^context> [Classical.dup_elim \<^context> @{thm allE}] 1\<close>)
   apply iprover
   done
 
@@ -899,8 +899,8 @@
   (
     structure Classical = Classical
     val Trueprop_const = dest_Const @{const Trueprop}
-    val equality_name = @{const_name HOL.eq}
-    val not_name = @{const_name Not}
+    val equality_name = \<^const_name>\<open>HOL.eq\<close>
+    val not_name = \<^const_name>\<open>Not\<close>
     val notE = @{thm notE}
     val ccontr = @{thm ccontr}
     val hyp_subst_tac = Hypsubst.blast_hyp_subst_tac
@@ -1240,7 +1240,7 @@
       | count_loose (s $ t) k = count_loose s k + count_loose t k
       | count_loose (Abs (_, _, t)) k = count_loose  t (k + 1)
       | count_loose _ _ = 0;
-    fun is_trivial_let (Const (@{const_name Let}, _) $ x $ t) =
+    fun is_trivial_let (Const (\<^const_name>\<open>Let\<close>, _) $ x $ t) =
       (case t of
         Abs (_, _, t') => count_loose t' 0 <= 1
       | _ => true);
@@ -1254,7 +1254,7 @@
           val ([t'], ctxt') = Variable.import_terms false [t] ctxt;
         in
           Option.map (hd o Variable.export ctxt' ctxt o single)
-            (case t' of Const (@{const_name Let},_) $ x $ f => (* x and f are already in normal form *)
+            (case t' of Const (\<^const_name>\<open>Let\<close>,_) $ x $ f => (* x and f are already in normal form *)
               if is_Free x orelse is_Bound x orelse is_Const x
               then SOME @{thm Let_def}
               else
@@ -1366,7 +1366,7 @@
 lemmas [cong] = imp_cong simp_implies_cong
 lemmas [split] = if_split
 
-ML \<open>val HOL_ss = simpset_of @{context}\<close>
+ML \<open>val HOL_ss = simpset_of \<^context>\<close>
 
 text \<open>Simplifies \<open>x\<close> assuming \<open>c\<close> and \<open>y\<close> assuming \<open>\<not> c\<close>.\<close>
 lemma if_cong:
@@ -1493,7 +1493,7 @@
   val rulify = @{thms induct_rulify'}
   val rulify_fallback = @{thms induct_rulify_fallback}
   val equal_def = @{thm induct_equal_def}
-  fun dest_def (Const (@{const_name induct_equal}, _) $ t $ u) = SOME (t, u)
+  fun dest_def (Const (\<^const_name>\<open>induct_equal\<close>, _) $ t $ u) = SOME (t, u)
     | dest_def _ = NONE
   fun trivial_tac ctxt = match_tac ctxt @{thms induct_trueI}
 )
@@ -1504,22 +1504,22 @@
 declaration \<open>
   fn _ => Induct.map_simpset (fn ss => ss
     addsimprocs
-      [Simplifier.make_simproc @{context} "swap_induct_false"
-        {lhss = [@{term "induct_false \<Longrightarrow> PROP P \<Longrightarrow> PROP Q"}],
+      [Simplifier.make_simproc \<^context> "swap_induct_false"
+        {lhss = [\<^term>\<open>induct_false \<Longrightarrow> PROP P \<Longrightarrow> PROP Q\<close>],
          proc = fn _ => fn _ => fn ct =>
           (case Thm.term_of ct of
             _ $ (P as _ $ @{const induct_false}) $ (_ $ Q $ _) =>
               if P <> Q then SOME Drule.swap_prems_eq else NONE
           | _ => NONE)},
-       Simplifier.make_simproc @{context} "induct_equal_conj_curry"
-        {lhss = [@{term "induct_conj P Q \<Longrightarrow> PROP R"}],
+       Simplifier.make_simproc \<^context> "induct_equal_conj_curry"
+        {lhss = [\<^term>\<open>induct_conj P Q \<Longrightarrow> PROP R\<close>],
          proc = fn _ => fn _ => fn ct =>
           (case Thm.term_of ct of
             _ $ (_ $ P) $ _ =>
               let
                 fun is_conj (@{const induct_conj} $ P $ Q) =
                       is_conj P andalso is_conj Q
-                  | is_conj (Const (@{const_name induct_equal}, _) $ _ $ _) = true
+                  | is_conj (Const (\<^const_name>\<open>induct_equal\<close>, _) $ _ $ _) = true
                   | is_conj @{const induct_true} = true
                   | is_conj @{const induct_false} = true
                   | is_conj _ = false
@@ -1597,7 +1597,7 @@
   val atomize_exL = @{thm atomize_exL};
   val atomize_conjL = @{thm atomize_conjL};
   val atomize_disjL = @{thm atomize_disjL};
-  val operator_names = [@{const_name HOL.disj}, @{const_name HOL.conj}, @{const_name Ex}];
+  val operator_names = [\<^const_name>\<open>HOL.disj\<close>, \<^const_name>\<open>HOL.conj\<close>, \<^const_name>\<open>Ex\<close>];
 );
 \<close>
 
@@ -1762,7 +1762,7 @@
 \<close>
 
 text \<open>
-  This setup ensures that a rewrite rule of the form @{term "NO_MATCH pat val \<Longrightarrow> t"}
+  This setup ensures that a rewrite rule of the form \<^term>\<open>NO_MATCH pat val \<Longrightarrow> t\<close>
   is only applied, if the pattern \<open>pat\<close> does not match the value \<open>val\<close>.
 \<close>
 
@@ -1838,18 +1838,18 @@
 setup \<open>
   Code_Preproc.map_pre (fn ctxt =>
     ctxt addsimprocs
-      [Simplifier.make_simproc @{context} "equal"
-        {lhss = [@{term HOL.eq}],
+      [Simplifier.make_simproc \<^context> "equal"
+        {lhss = [\<^term>\<open>HOL.eq\<close>],
          proc = fn _ => fn _ => fn ct =>
           (case Thm.term_of ct of
-            Const (_, Type (@{type_name fun}, [Type _, _])) => SOME @{thm eq_equal}
+            Const (_, Type (\<^type_name>\<open>fun\<close>, [Type _, _])) => SOME @{thm eq_equal}
           | _ => NONE)}])
 \<close>
 
 
 subsubsection \<open>Generic code generator foundation\<close>
 
-text \<open>Datatype @{typ bool}\<close>
+text \<open>Datatype \<^typ>\<open>bool\<close>\<close>
 
 code_datatype True False
 
@@ -1874,7 +1874,7 @@
     and "(P \<longrightarrow> True) \<longleftrightarrow> True"
   by simp_all
 
-text \<open>More about @{typ prop}\<close>
+text \<open>More about \<^typ>\<open>prop\<close>\<close>
 
 lemma [code nbe]:
   shows "(True \<Longrightarrow> PROP Q) \<equiv> PROP Q"
@@ -1905,14 +1905,14 @@
 lemma equal_itself_code [code]: "equal TYPE('a) TYPE('a) \<longleftrightarrow> True"
   by (simp add: equal)
 
-setup \<open>Sign.add_const_constraint (@{const_name equal}, SOME @{typ "'a::type \<Rightarrow> 'a \<Rightarrow> bool"})\<close>
+setup \<open>Sign.add_const_constraint (\<^const_name>\<open>equal\<close>, SOME \<^typ>\<open>'a::type \<Rightarrow> 'a \<Rightarrow> bool\<close>)\<close>
 
 lemma equal_alias_cert: "OFCLASS('a, equal_class) \<equiv> (((=) :: 'a \<Rightarrow> 'a \<Rightarrow> bool) \<equiv> equal)"
   (is "?ofclass \<equiv> ?equal")
 proof
   assume "PROP ?ofclass"
   show "PROP ?equal"
-    by (tactic \<open>ALLGOALS (resolve_tac @{context} [Thm.unconstrainT @{thm eq_equal}])\<close>)
+    by (tactic \<open>ALLGOALS (resolve_tac \<^context> [Thm.unconstrainT @{thm eq_equal}])\<close>)
       (fact \<open>PROP ?ofclass\<close>)
 next
   assume "PROP ?equal"
@@ -1920,7 +1920,7 @@
   qed (simp add: \<open>PROP ?equal\<close>)
 qed
 
-setup \<open>Sign.add_const_constraint (@{const_name equal}, SOME @{typ "'a::equal \<Rightarrow> 'a \<Rightarrow> bool"})\<close>
+setup \<open>Sign.add_const_constraint (\<^const_name>\<open>equal\<close>, SOME \<^typ>\<open>'a::equal \<Rightarrow> 'a \<Rightarrow> bool\<close>)\<close>
 
 setup \<open>Nbe.add_const_alias @{thm equal_alias_cert}\<close>
 
@@ -1933,7 +1933,7 @@
 
 setup \<open>
   Code.declare_case_global @{thm Let_case_cert} #>
-  Code.declare_undefined_global @{const_name undefined}
+  Code.declare_undefined_global \<^const_name>\<open>undefined\<close>
 \<close>
 
 declare [[code abort: undefined]]
@@ -1941,7 +1941,7 @@
 
 subsubsection \<open>Generic code generator target languages\<close>
 
-text \<open>type @{typ bool}\<close>
+text \<open>type \<^typ>\<open>bool\<close>\<close>
 
 code_printing
   type_constructor bool \<rightharpoonup>
@@ -2057,7 +2057,7 @@
 ML \<open>
   (* combination of (spec RS spec RS ...(j times) ... spec RS mp) *)
   local
-    fun wrong_prem (Const (@{const_name All}, _) $ Abs (_, _, t)) = wrong_prem t
+    fun wrong_prem (Const (\<^const_name>\<open>All\<close>, _) $ Abs (_, _, t)) = wrong_prem t
       | wrong_prem (Bound _) = true
       | wrong_prem _ = false;
     val filter_right = filter (not o wrong_prem o HOLogic.dest_Trueprop o hd o Thm.prems_of);
@@ -2068,7 +2068,7 @@
 
   local
     val nnf_ss =
-      simpset_of (put_simpset HOL_basic_ss @{context} addsimps @{thms simp_thms nnf_simps});
+      simpset_of (put_simpset HOL_basic_ss \<^context> addsimps @{thms simp_thms nnf_simps});
   in
     fun nnf_conv ctxt = Simplifier.rewrite (put_simpset nnf_ss ctxt);
   end
--- a/src/HOL/Hilbert_Choice.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Hilbert_Choice.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -26,9 +26,9 @@
   "SOME x. P" \<rightleftharpoons> "CONST Eps (\<lambda>x. P)"
 
 print_translation \<open>
-  [(@{const_syntax Eps}, fn _ => fn [Abs abs] =>
+  [(\<^const_syntax>\<open>Eps\<close>, fn _ => fn [Abs abs] =>
       let val (x, t) = Syntax_Trans.atomic_abs_tr' abs
-      in Syntax.const @{syntax_const "_Eps"} $ x $ t end)]
+      in Syntax.const \<^syntax_const>\<open>_Eps\<close> $ x $ t end)]
 \<close> \<comment> \<open>to avoid eta-contraction of body\<close>
 
 definition inv_into :: "'a set \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> ('b \<Rightarrow> 'a)" where
@@ -54,7 +54,7 @@
 
 text \<open>
   Easier to apply than \<open>someI\<close> because the conclusion has only one
-  occurrence of @{term P}.
+  occurrence of \<^term>\<open>P\<close>.
 \<close>
 lemma someI2: "P a \<Longrightarrow> (\<And>x. P x \<Longrightarrow> Q x) \<Longrightarrow> Q (SOME x. P x)"
   by (blast intro: someI)
@@ -560,7 +560,7 @@
 
 subsection \<open>Other Consequences of Hilbert's Epsilon\<close>
 
-text \<open>Hilbert's Epsilon and the @{term split} Operator\<close>
+text \<open>Hilbert's Epsilon and the \<^term>\<open>split\<close> Operator\<close>
 
 text \<open>Looping simprule!\<close>
 lemma split_paired_Eps: "(SOME x. P x) = (SOME (a, b). P (a, b))"
--- a/src/HOL/Inductive.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Inductive.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -270,8 +270,8 @@
 
 subsection \<open>Even Stronger Coinduction Rule, by Martin Coen\<close>
 
-text \<open>Weakens the condition @{term "X \<subseteq> f X"} to one expressed using both
-  @{term lfp} and @{term gfp}\<close>
+text \<open>Weakens the condition \<^term>\<open>X \<subseteq> f X\<close> to one expressed using both
+  \<^term>\<open>lfp\<close> and \<^term>\<open>gfp\<close>\<close>
 lemma coinduct3_mono_lemma: "mono f \<Longrightarrow> mono (\<lambda>x. f x \<union> X \<union> B)"
   by (iprover intro: subset_refl monoI Un_mono monoD)
 
@@ -312,7 +312,7 @@
 lemma def_coinduct3: "A \<equiv> gfp f \<Longrightarrow> mono f \<Longrightarrow> a \<in> X \<Longrightarrow> X \<subseteq> f (lfp (\<lambda>x. f x \<union> X \<union> A)) \<Longrightarrow> a \<in> A"
   by (auto intro!: coinduct3)
 
-text \<open>Monotonicity of @{term gfp}!\<close>
+text \<open>Monotonicity of \<^term>\<open>gfp\<close>!\<close>
 lemma gfp_mono: "(\<And>Z. f Z \<le> g Z) \<Longrightarrow> gfp f \<le> gfp g"
   by (rule gfp_upperbound [THEN gfp_least]) (blast intro: order_trans)
 
@@ -535,7 +535,7 @@
         val x = Syntax.free (fst (Name.variant "x" (Term.declare_term_frees cs Name.context)));
         val ft = Case_Translation.case_tr true ctxt [x, cs];
       in lambda x ft end
-  in [(@{syntax_const "_lam_pats_syntax"}, fun_tr)] end
+  in [(\<^syntax_const>\<open>_lam_pats_syntax\<close>, fun_tr)] end
 \<close>
 
 end
--- a/src/HOL/Int.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Int.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -430,7 +430,7 @@
 
 end
 
-text \<open>Comparisons involving @{term of_int}.\<close>
+text \<open>Comparisons involving \<^term>\<open>of_int\<close>.\<close>
 
 lemma of_int_eq_numeral_iff [iff]: "of_int z = (numeral n :: 'a::ring_char_0) \<longleftrightarrow> z = numeral n"
   using of_int_eq_iff by fastforce
@@ -493,7 +493,7 @@
 lemma nat_le_eq_zle: "0 < w \<or> 0 \<le> z \<Longrightarrow> nat w \<le> nat z \<longleftrightarrow> w \<le> z"
   by transfer (clarsimp, arith)
 
-text \<open>An alternative condition is @{term "0 \<le> w"}.\<close>
+text \<open>An alternative condition is \<^term>\<open>0 \<le> w\<close>.\<close>
 lemma nat_mono_iff: "0 < z \<Longrightarrow> nat w < nat z \<longleftrightarrow> w < z"
   by (simp add: nat_le_eq_zle linorder_not_le [symmetric])
 
@@ -669,7 +669,7 @@
 lemma measure_function_int[measure_function]: "is_measure (nat \<circ> abs)" ..
 
 
-subsection \<open>Lemmas about the Function @{term of_nat} and Orderings\<close>
+subsection \<open>Lemmas about the Function \<^term>\<open>of_nat\<close> and Orderings\<close>
 
 lemma negative_zless_0: "- (int (Suc n)) < (0 :: int)"
   by (simp add: order_less_le del: of_nat_Suc)
@@ -975,7 +975,7 @@
     by (cases "of_int b = 0") simp_all
 qed
 
-text \<open>The premise involving @{term Ints} prevents @{term "a = 1/2"}.\<close>
+text \<open>The premise involving \<^term>\<open>Ints\<close> prevents \<^term>\<open>a = 1/2\<close>.\<close>
 
 lemma Ints_double_eq_0_iff:
   fixes a :: "'a::ring_char_0"
@@ -1037,7 +1037,7 @@
 qed
 
 
-subsection \<open>@{term sum} and @{term prod}\<close>
+subsection \<open>\<^term>\<open>sum\<close> and \<^term>\<open>prod\<close>\<close>
 
 context semiring_1
 begin
@@ -1132,9 +1132,9 @@
     using Ints_nonzero_abs_ge1 [of x] by auto
     
 
-subsection \<open>The functions @{term nat} and @{term int}\<close>
+subsection \<open>The functions \<^term>\<open>nat\<close> and \<^term>\<open>int\<close>\<close>
 
-text \<open>Simplify the term @{term "w + - z"}.\<close>
+text \<open>Simplify the term \<^term>\<open>w + - z\<close>.\<close>
 
 lemma one_less_nat_eq [simp]: "Suc 0 < nat z \<longleftrightarrow> 1 < z"
   using zless_nat_conj [of 1 z] by auto
--- a/src/HOL/Isar_Examples/Higher_Order_Logic.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Isar_Examples/Higher_Order_Logic.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -490,7 +490,7 @@
 qed
 
 text \<open>
-  This means, the hypothetical predicate @{const classical} always holds
+  This means, the hypothetical predicate \<^const>\<open>classical\<close> always holds
   unconditionally (with all consequences).
 \<close>
 
--- a/src/HOL/Lattices.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Lattices.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -802,7 +802,7 @@
 qed
 
 
-subsection \<open>Lattice on @{typ bool}\<close>
+subsection \<open>Lattice on \<^typ>\<open>bool\<close>\<close>
 
 instantiation bool :: boolean_algebra
 begin
@@ -829,7 +829,7 @@
   by auto
 
 
-subsection \<open>Lattice on @{typ "_ \<Rightarrow> _"}\<close>
+subsection \<open>Lattice on \<^typ>\<open>_ \<Rightarrow> _\<close>\<close>
 
 instantiation "fun" :: (type, semilattice_sup) semilattice_sup
 begin
--- a/src/HOL/Lattices_Big.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Lattices_Big.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -478,7 +478,7 @@
   "MAX x. f"     \<rightleftharpoons> "CONST Max (CONST range (\<lambda>x. f))"
   "MAX x\<in>A. f"   \<rightleftharpoons> "CONST Max ((\<lambda>x. f) ` A)"
 
-text \<open>An aside: @{const Min}/@{const Max} on linear orders as special case of @{const Inf_fin}/@{const Sup_fin}\<close>
+text \<open>An aside: \<^const>\<open>Min\<close>/\<^const>\<open>Max\<close> on linear orders as special case of \<^const>\<open>Inf_fin\<close>/\<^const>\<open>Sup_fin\<close>\<close>
 
 lemma Inf_fin_Min:
   "Inf_fin = (Min :: 'a::{semilattice_inf, linorder} set \<Rightarrow> 'a)"
--- a/src/HOL/Library/AList.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Library/AList.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -13,8 +13,8 @@
 
 text \<open>
   The operations preserve distinctness of keys and
-  function @{term "clearjunk"} distributes over them. Since
-  @{term clearjunk} enforces distinctness of keys it can be used
+  function \<^term>\<open>clearjunk\<close> distributes over them. Since
+  \<^term>\<open>clearjunk\<close> enforces distinctness of keys it can be used
   to establish the invariant, e.g. for inductive proofs.
 \<close>
 
@@ -69,8 +69,8 @@
   by (induct al) auto
 
 text \<open>Note that the lists are not necessarily the same:
-        @{term "update k v (update k' v' []) = [(k', v'), (k, v)]"} and
-        @{term "update k' v' (update k v []) = [(k, v), (k', v')]"}.\<close>
+        \<^term>\<open>update k v (update k' v' []) = [(k', v'), (k, v)]\<close> and
+        \<^term>\<open>update k' v' (update k v []) = [(k, v), (k', v')]\<close>.\<close>
 
 lemma update_swap:
   "k \<noteq> k' \<Longrightarrow> map_of (update k v (update k' v' al)) = map_of (update k' v' (update k v al))"
@@ -223,7 +223,7 @@
       (if (fst p = k) then (k, f (snd p)) # ps else p # update_with_aux v k f ps)"
 
 text \<open>
-  The above @{term "delete"} traverses all the list even if it has found the key.
+  The above \<^term>\<open>delete\<close> traverses all the list even if it has found the key.
   This one does not have to keep going because is assumes the invariant that keys are distinct.
 \<close>
 qualified fun delete_aux :: "'key \<Rightarrow> ('key \<times> 'val) list \<Rightarrow> ('key \<times> 'val) list"
--- a/src/HOL/Library/Bit.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Library/Bit.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -87,7 +87,7 @@
   by (simp_all add: equal set_iff)
 
 
-subsection \<open>Type @{typ bit} forms a field\<close>
+subsection \<open>Type \<^typ>\<open>bit\<close> forms a field\<close>
 
 instantiation bit :: field
 begin
@@ -128,7 +128,7 @@
   unfolding plus_bit_def by (simp split: bit.split)
 
 
-subsection \<open>Numerals at type @{typ bit}\<close>
+subsection \<open>Numerals at type \<^typ>\<open>bit\<close>\<close>
 
 text \<open>All numerals reduce to either 0 or 1.\<close>
 
@@ -145,7 +145,7 @@
   by (simp only: numeral_Bit1 bit_add_self add_0_left)
 
 
-subsection \<open>Conversion from @{typ bit}\<close>
+subsection \<open>Conversion from \<^typ>\<open>bit\<close>\<close>
 
 context zero_neq_one
 begin
--- a/src/HOL/Library/Cancellation/cancel.ML	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Library/Cancellation/cancel.ML	Fri Jan 04 23:22:53 2019 +0100
@@ -49,15 +49,15 @@
     val t = Thm.term_of ct
     val ([t'], ctxt') = Variable.import_terms true [t] ctxt
     val pre_simplified_ct = Simplifier.full_rewrite (clear_simpset ctxt addsimps
-      Named_Theorems.get ctxt @{named_theorems cancelation_simproc_pre} addsimprocs
-      [@{simproc NO_MATCH}]) (Thm.cterm_of ctxt t');
+      Named_Theorems.get ctxt \<^named_theorems>\<open>cancelation_simproc_pre\<close> addsimprocs
+      [\<^simproc>\<open>NO_MATCH\<close>]) (Thm.cterm_of ctxt t');
     val t' = Thm.term_of (Thm.rhs_of pre_simplified_ct)
     val export = singleton (Variable.export ctxt' ctxt)
 
     val (t1,_) = Data.dest_bal t'
-    val sort_not_general_enough = ((fastype_of t1) = @{typ nat}) orelse
+    val sort_not_general_enough = ((fastype_of t1) = \<^typ>\<open>nat\<close>) orelse
         Sorts.of_sort (Sign.classes_of (Proof_Context.theory_of ctxt))
-         (fastype_of t1, @{sort "comm_ring_1"})
+         (fastype_of t1, \<^sort>\<open>comm_ring_1\<close>)
     val _ =
        if sort_not_general_enough
        then raise SORT_NOT_GENERAL_ENOUGH("type too precise, another simproc should do the job",
@@ -67,8 +67,8 @@
     fun add_pre_simplification thm = @{thm Pure.transitive} OF [pre_simplified_ct, thm]
     fun add_post_simplification thm =
       (let val post_simplified_ct = Simplifier.full_rewrite (clear_simpset ctxt addsimps
-              Named_Theorems.get ctxt @{named_theorems cancelation_simproc_post} addsimprocs
-              [@{simproc NO_MATCH}])
+              Named_Theorems.get ctxt \<^named_theorems>\<open>cancelation_simproc_post\<close> addsimprocs
+              [\<^simproc>\<open>NO_MATCH\<close>])
             (Thm.rhs_of thm)
         in @{thm Pure.transitive} OF [thm, post_simplified_ct] end)
   in
--- a/src/HOL/Library/Cancellation/cancel_data.ML	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Library/Cancellation/cancel_data.ML	Fri Jan 04 23:22:53 2019 +0100
@@ -32,12 +32,12 @@
 fun fast_mk_iterate_add (n, mset) =
   let val T = fastype_of mset
   in
-    Const (@{const_name "iterate_add"}, @{typ nat} --> T --> T) $ n $ mset
+    Const (\<^const_name>\<open>iterate_add\<close>, \<^typ>\<open>nat\<close> --> T --> T) $ n $ mset
   end;
 
 (*iterate_add is not symmetric, unlike multiplication over natural numbers.*)
 fun mk_iterate_add (t, u) =
-  (if fastype_of t = @{typ nat} then (t, u) else (u, t))
+  (if fastype_of t = \<^typ>\<open>nat\<close> then (t, u) else (u, t))
   |> fast_mk_iterate_add;
 
 (*Maps n to #n for n = 1, 2*)
@@ -45,7 +45,7 @@
   map (fn th => th RS sym) @{thms numeral_One numeral_2_eq_2 numeral_1_eq_Suc_0};
 
 val numeral_sym_ss =
-  simpset_of (put_simpset HOL_basic_ss @{context} addsimps numeral_syms);
+  simpset_of (put_simpset HOL_basic_ss \<^context> addsimps numeral_syms);
 
 fun mk_number 1 = HOLogic.numeral_const HOLogic.natT $ HOLogic.one_const
   | mk_number n = HOLogic.mk_number HOLogic.natT n;
@@ -56,16 +56,16 @@
     handle TERM _ => find_first_numeral (t::past) terms)
   | find_first_numeral _ [] = raise TERM("find_first_numeral", []);
 
-fun typed_zero T = Const (@{const_name "Groups.zero"}, T);
+fun typed_zero T = Const (\<^const_name>\<open>Groups.zero\<close>, T);
 fun typed_one T = HOLogic.numeral_const T $ HOLogic.one_const
-val mk_plus = HOLogic.mk_binop @{const_name Groups.plus};
+val mk_plus = HOLogic.mk_binop \<^const_name>\<open>Groups.plus\<close>;
 
 (*Thus mk_sum[t] yields t+0; longer sums don't have a trailing zero.*)
 fun mk_sum T [] = typed_zero T
   | mk_sum _ [t,u] = mk_plus (t, u)
   | mk_sum T (t :: ts) = mk_plus (t, mk_sum T ts);
 
-val dest_plus = HOLogic.dest_bin @{const_name Groups.plus} dummyT;
+val dest_plus = HOLogic.dest_bin \<^const_name>\<open>Groups.plus\<close> dummyT;
 
 
 (*** Other simproc items ***)
@@ -85,7 +85,7 @@
   | mk_prod _ [t] = t
   | mk_prod T (t :: ts) = if t = one then mk_prod T ts else mk_iterate_add (t, mk_prod T ts);
 
-val dest_iterate_add = HOLogic.dest_bin @{const_name iterate_add} dummyT;
+val dest_iterate_add = HOLogic.dest_bin \<^const_name>\<open>iterate_add\<close> dummyT;
 
 fun dest_iterate_adds t =
   let val (t,u) = dest_iterate_add t in
@@ -121,7 +121,7 @@
 
 fun dest_sum t = dest_summation (t, []);
 
-val rename_numerals = simplify (put_simpset numeral_sym_ss @{context}) o Thm.transfer @{theory};
+val rename_numerals = simplify (put_simpset numeral_sym_ss \<^context>) o Thm.transfer \<^theory>;
 
 (*Simplify \<open>iterate_add (Suc 0) n\<close>, \<open>iterate_add n (Suc 0)\<close>, \<open>n+0\<close>, and \<open>0+n\<close> to \<open>n\<close>*)
 val add_0s  = map rename_numerals @{thms monoid_add_class.add_0_left monoid_add_class.add_0_right};
@@ -130,7 +130,7 @@
 (*And these help the simproc return False when appropriate. We use the same list as the
 simproc for natural numbers, but adapted.*)
 fun contra_rules ctxt =
-  @{thms le_zero_eq}  @ Named_Theorems.get ctxt @{named_theorems cancelation_simproc_eq_elim};
+  @{thms le_zero_eq}  @ Named_Theorems.get ctxt \<^named_theorems>\<open>cancelation_simproc_eq_elim\<close>;
 
 fun simplify_meta_eq ctxt =
   Arith_Data.simplify_meta_eq
@@ -148,11 +148,11 @@
 val trans_tac = Numeral_Simprocs.trans_tac;
 
 val norm_ss1 =
-  simpset_of (put_simpset Numeral_Simprocs.num_ss @{context} addsimps
+  simpset_of (put_simpset Numeral_Simprocs.num_ss \<^context> addsimps
     numeral_syms @ add_0s @ mult_1s @ @{thms ac_simps iterate_add_simps});
 
 val norm_ss2 =
-  simpset_of (put_simpset Numeral_Simprocs.num_ss @{context} addsimps
+  simpset_of (put_simpset Numeral_Simprocs.num_ss \<^context> addsimps
     bin_simps @
     @{thms ac_simps});
 
@@ -161,7 +161,7 @@
   THEN ALLGOALS (simp_tac (put_simpset norm_ss2 ctxt));
 
 val mset_simps_ss =
-  simpset_of (put_simpset HOL_basic_ss @{context} addsimps bin_simps);
+  simpset_of (put_simpset HOL_basic_ss \<^context> addsimps bin_simps);
 
 fun numeral_simp_tac ctxt = ALLGOALS (simp_tac (put_simpset mset_simps_ss ctxt));
 
--- a/src/HOL/Library/Cancellation/cancel_simprocs.ML	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Library/Cancellation/cancel_simprocs.ML	Fri Jan 04 23:22:53 2019 +0100
@@ -19,31 +19,31 @@
 structure Eq_Cancel_Comm_Monoid_add = Cancel_Fun
  (open Cancel_Data
   val mk_bal   = HOLogic.mk_eq
-  val dest_bal = HOLogic.dest_bin @{const_name HOL.eq} dummyT
+  val dest_bal = HOLogic.dest_bin \<^const_name>\<open>HOL.eq\<close> dummyT
   val bal_add1 = @{thm iterate_add_eq_add_iff1} RS trans
   val bal_add2 = @{thm iterate_add_eq_add_iff2} RS trans
 );
 
 structure Eq_Cancel_Comm_Monoid_less = Cancel_Fun
  (open Cancel_Data
-  val mk_bal   = HOLogic.mk_binrel @{const_name Orderings.less}
-  val dest_bal = HOLogic.dest_bin @{const_name Orderings.less} dummyT
+  val mk_bal   = HOLogic.mk_binrel \<^const_name>\<open>Orderings.less\<close>
+  val dest_bal = HOLogic.dest_bin \<^const_name>\<open>Orderings.less\<close> dummyT
   val bal_add1 = @{thm iterate_add_less_iff1} RS trans
   val bal_add2 = @{thm iterate_add_less_iff2} RS trans
 );
 
 structure Eq_Cancel_Comm_Monoid_less_eq = Cancel_Fun
  (open Cancel_Data
-  val mk_bal   = HOLogic.mk_binrel @{const_name Orderings.less_eq}
-  val dest_bal = HOLogic.dest_bin @{const_name Orderings.less_eq} dummyT
+  val mk_bal   = HOLogic.mk_binrel \<^const_name>\<open>Orderings.less_eq\<close>
+  val dest_bal = HOLogic.dest_bin \<^const_name>\<open>Orderings.less_eq\<close> dummyT
   val bal_add1 = @{thm iterate_add_less_eq_iff1} RS trans
   val bal_add2 = @{thm iterate_add_less_eq_iff2} RS trans
 );
 
 structure Diff_Cancel_Comm_Monoid_less_eq = Cancel_Fun
  (open Cancel_Data
-  val mk_bal   = HOLogic.mk_binop @{const_name Groups.minus}
-  val dest_bal = HOLogic.dest_bin @{const_name Groups.minus} dummyT
+  val mk_bal   = HOLogic.mk_binop \<^const_name>\<open>Groups.minus\<close>
+  val dest_bal = HOLogic.dest_bin \<^const_name>\<open>Groups.minus\<close> dummyT
   val bal_add1 = @{thm iterate_add_add_eq1} RS trans
   val bal_add2 = @{thm iterate_add_diff_add_eq2} RS trans
 );
--- a/src/HOL/Library/Cardinality.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Library/Cardinality.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -36,9 +36,9 @@
 
 print_translation \<open>
   let
-    fun card_univ_tr' ctxt [Const (@{const_syntax UNIV}, Type (_, [T]))] =
-      Syntax.const @{syntax_const "_type_card"} $ Syntax_Phases.term_of_typ ctxt T
-  in [(@{const_syntax card}, card_univ_tr')] end
+    fun card_univ_tr' ctxt [Const (\<^const_syntax>\<open>UNIV\<close>, Type (_, [T]))] =
+      Syntax.const \<^syntax_const>\<open>_type_card\<close> $ Syntax_Phases.term_of_typ ctxt T
+  in [(\<^const_syntax>\<open>card\<close>, card_univ_tr')] end
 \<close>
 
 lemma card_prod [simp]: "CARD('a \<times> 'b) = CARD('a) * CARD('b)"
@@ -377,11 +377,11 @@
 subsection \<open>Code setup for sets\<close>
 
 text \<open>
-  Implement @{term "CARD('a)"} via @{term card_UNIV} and provide
-  implementations for @{term "finite"}, @{term "card"}, @{term "(\<subseteq>)"}, 
-  and @{term "(=)"}if the calling context already provides @{class finite_UNIV}
-  and @{class card_UNIV} instances. If we implemented the latter
-  always via @{term card_UNIV}, we would require instances of essentially all 
+  Implement \<^term>\<open>CARD('a)\<close> via \<^term>\<open>card_UNIV\<close> and provide
+  implementations for \<^term>\<open>finite\<close>, \<^term>\<open>card\<close>, \<^term>\<open>(\<subseteq>)\<close>, 
+  and \<^term>\<open>(=)\<close>if the calling context already provides \<^class>\<open>finite_UNIV\<close>
+  and \<^class>\<open>card_UNIV\<close> instances. If we implemented the latter
+  always via \<^term>\<open>card_UNIV\<close>, we would require instances of essentially all 
   element types, i.e., a lot of instantiation proofs and -- at run time --
   possibly slow dictionary constructions.
 \<close>
@@ -492,8 +492,8 @@
   Provide more informative exceptions than Match for non-rewritten cases.
   If generated code raises one these exceptions, then a code equation calls
   the mentioned operator for an element type that is not an instance of
-  @{class card_UNIV} and is therefore not implemented via @{term card_UNIV}.
-  Constrain the element type with sort @{class card_UNIV} to change this.
+  \<^class>\<open>card_UNIV\<close> and is therefore not implemented via \<^term>\<open>card_UNIV\<close>.
+  Constrain the element type with sort \<^class>\<open>card_UNIV\<close> to change this.
 \<close>
 
 lemma card_coset_error [code]:
--- a/src/HOL/Library/Code_Abstract_Nat.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Library/Code_Abstract_Nat.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -10,7 +10,7 @@
 
 text \<open>
   When natural numbers are implemented in another than the
-  conventional inductive @{term "0::nat"}/@{term Suc} representation,
+  conventional inductive \<^term>\<open>0::nat\<close>/\<^term>\<open>Suc\<close> representation,
   it is necessary to avoid all pattern matching on natural numbers
   altogether.  This is accomplished by this theory (up to a certain
   extent).
@@ -31,7 +31,7 @@
 subsection \<open>Preprocessors\<close>
 
 text \<open>
-  The term @{term "Suc n"} is no longer a valid pattern.  Therefore,
+  The term \<^term>\<open>Suc n\<close> is no longer a valid pattern.  Therefore,
   all occurrences of this term in a position where a pattern is
   expected (i.e.~on the left-hand side of a code equation) must be
   eliminated.  This can be accomplished -- as far as possible -- by
@@ -62,7 +62,7 @@
     val lhs_of = snd o Thm.dest_comb o fst o Thm.dest_comb o Thm.cprop_of;
     val rhs_of = snd o Thm.dest_comb o Thm.cprop_of;
     fun find_vars ct = (case Thm.term_of ct of
-        (Const (@{const_name Suc}, _) $ Var _) => [(cv, snd (Thm.dest_comb ct))]
+        (Const (\<^const_name>\<open>Suc\<close>, _) $ Var _) => [(cv, snd (Thm.dest_comb ct))]
       | _ $ _ =>
         let val (ct1, ct2) = Thm.dest_comb ct
         in 
@@ -97,7 +97,7 @@
 fun eqn_suc_base_preproc ctxt thms =
   let
     val dest = fst o Logic.dest_equals o Thm.prop_of;
-    val contains_suc = exists_Const (fn (c, _) => c = @{const_name Suc});
+    val contains_suc = exists_Const (fn (c, _) => c = \<^const_name>\<open>Suc\<close>);
   in
     if forall (can dest) thms andalso exists (contains_suc o dest) thms
       then thms |> perhaps_loop (remove_suc ctxt) |> (Option.map o map) Drule.zero_var_indexes
--- a/src/HOL/Library/Code_Binary_Nat.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Library/Code_Binary_Nat.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -10,8 +10,8 @@
 
 text \<open>
   When generating code for functions on natural numbers, the
-  canonical representation using @{term "0::nat"} and
-  @{term Suc} is unsuitable for computations involving large
+  canonical representation using \<^term>\<open>0::nat\<close> and
+  \<^term>\<open>Suc\<close> is unsuitable for computations involving large
   numbers.  This theory refines the representation of
   natural numbers for code generation to use binary
   numerals, which do not grow linear in size but logarithmic.
--- a/src/HOL/Library/Code_Lazy.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Library/Code_Lazy.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -60,7 +60,7 @@
   by (rule term_of_anything)
 
 text \<open>
-  The implementations of @{typ "_ lazy"} using language primitives cache forced values.
+  The implementations of \<^typ>\<open>_ lazy\<close> using language primitives cache forced values.
 
   Term reconstruction for lazy looks into the lazy value and reconstructs it to the depth it has been evaluated.
   This is not done for Haskell as we do not know of any portable way to inspect whether a lazy value
@@ -119,7 +119,7 @@
 code_reserved SML Lazy
 
 code_printing \<comment> \<open>For code generation within the Isabelle environment, we reuse the thread-safe
-  implementation of lazy from @{file "~~/src/Pure/Concurrent/lazy.ML"}\<close>
+  implementation of lazy from \<^file>\<open>~~/src/Pure/Concurrent/lazy.ML\<close>\<close>
   code_module Lazy \<rightharpoonup> (Eval) \<open>\<close> for constant undefined
 | type_constructor lazy \<rightharpoonup> (Eval) "_ Lazy.lazy"
 | constant delay \<rightharpoonup> (Eval) "Lazy.lazy"
@@ -220,7 +220,7 @@
 
 code_reserved Scala Lazy
 
-text \<open>Make evaluation with the simplifier respect @{term delay}s.\<close>
+text \<open>Make evaluation with the simplifier respect \<^term>\<open>delay\<close>s.\<close>
 
 lemma delay_lazy_cong: "delay f = delay f" by simp
 setup \<open>Code_Simp.map_ss (Simplifier.add_cong @{thm delay_lazy_cong})\<close>        
--- a/src/HOL/Library/Code_Prolog.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Library/Code_Prolog.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -13,8 +13,8 @@
 
 section \<open>Setup for Numerals\<close>
 
-setup \<open>Predicate_Compile_Data.ignore_consts [@{const_name numeral}]\<close>
+setup \<open>Predicate_Compile_Data.ignore_consts [\<^const_name>\<open>numeral\<close>]\<close>
 
-setup \<open>Predicate_Compile_Data.keep_functions [@{const_name numeral}]\<close>
+setup \<open>Predicate_Compile_Data.keep_functions [\<^const_name>\<open>numeral\<close>]\<close>
 
 end
--- a/src/HOL/Library/Code_Target_Nat.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Library/Code_Target_Nat.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -8,7 +8,7 @@
 imports Code_Abstract_Nat
 begin
 
-subsection \<open>Implementation for @{typ nat}\<close>
+subsection \<open>Implementation for \<^typ>\<open>nat\<close>\<close>
 
 context
 includes natural.lifting integer.lifting
@@ -163,8 +163,8 @@
   by (cases c) (simp add: nat_of_char_def integer_of_char_def integer_of_nat_eq_of_nat)
 
 lemma term_of_nat_code [code]:
-  \<comment> \<open>Use @{term Code_Numeral.nat_of_integer} in term reconstruction
-        instead of @{term Code_Target_Nat.Nat} such that reconstructed
+  \<comment> \<open>Use \<^term>\<open>Code_Numeral.nat_of_integer\<close> in term reconstruction
+        instead of \<^term>\<open>Code_Target_Nat.Nat\<close> such that reconstructed
         terms can be fed back to the code generator\<close>
   "term_of_class.term_of n =
    Code_Evaluation.App
--- a/src/HOL/Library/Code_Test.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Library/Code_Test.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -9,7 +9,7 @@
 keywords "test_code" :: diag
 begin
 
-subsection \<open>YXML encoding for @{typ Code_Evaluation.term}\<close>
+subsection \<open>YXML encoding for \<^typ>\<open>Code_Evaluation.term\<close>\<close>
 
 datatype (plugins del: code size "quickcheck") yxml_of_term = YXML
 
@@ -24,7 +24,7 @@
 definition yot_concat :: "yxml_of_term list \<Rightarrow> yxml_of_term"
   where [code del]: "yot_concat _ = YXML"
 
-text \<open>Serialise @{typ yxml_of_term} to native string of target language\<close>
+text \<open>Serialise \<^typ>\<open>yxml_of_term\<close> to native string of target language\<close>
 
 code_printing type_constructor yxml_of_term
   \<rightharpoonup>  (SML) "string"
@@ -55,7 +55,7 @@
 text \<open>
   Stripped-down implementations of Isabelle's XML tree with YXML encoding as
   defined in \<^file>\<open>~~/src/Pure/PIDE/xml.ML\<close>, \<^file>\<open>~~/src/Pure/PIDE/yxml.ML\<close>
-  sufficient to encode @{typ "Code_Evaluation.term"} as in
+  sufficient to encode \<^typ>\<open>Code_Evaluation.term\<close> as in
   \<^file>\<open>~~/src/Pure/term_xml.ML\<close>.
 \<close>
 
@@ -114,7 +114,7 @@
 where "yxml_string_of_body ts = foldr yxml_string_of_xml_tree ts yot_empty"
 
 text \<open>
-  Encoding @{typ Code_Evaluation.term} into XML trees as defined in
+  Encoding \<^typ>\<open>Code_Evaluation.term\<close> into XML trees as defined in
   \<^file>\<open>~~/src/Pure/term_xml.ML\<close>.
 \<close>
 
@@ -132,8 +132,8 @@
   "xml_of_term (Code_Evaluation.Const x ty) = [xml.tagged (STR ''0'') (Some x) (xml_of_typ ty)]"
   "xml_of_term (Code_Evaluation.App t1 t2)  = [xml.tagged (STR ''5'') None [xml.node (xml_of_term t1), xml.node (xml_of_term t2)]]"
   "xml_of_term (Code_Evaluation.Abs x ty t) = [xml.tagged (STR ''4'') (Some x) [xml.node (xml_of_typ ty), xml.node (xml_of_term t)]]"
-  \<comment> \<open>FIXME: @{const Code_Evaluation.Free} is used only in @{theory "HOL.Quickcheck_Narrowing"} to represent
-    uninstantiated parameters in constructors. Here, we always translate them to @{ML Free} variables.\<close>
+  \<comment> \<open>FIXME: \<^const>\<open>Code_Evaluation.Free\<close> is used only in \<^theory>\<open>HOL.Quickcheck_Narrowing\<close> to represent
+    uninstantiated parameters in constructors. Here, we always translate them to \<^ML>\<open>Free\<close> variables.\<close>
   "xml_of_term (Code_Evaluation.Free x ty)  = [xml.tagged (STR ''1'') (Some x) (xml_of_typ ty)]"
 by(simp_all add: xml_of_term_def xml_tree_anything)
 
--- a/src/HOL/Library/Complete_Partial_Order2.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Library/Complete_Partial_Order2.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -355,7 +355,7 @@
 (* apply cont_intro rules as intro and try to solve 
    the remaining of the emerging subgoals with simp *)
 fun cont_intro_tac ctxt =
-  REPEAT_ALL_NEW (resolve_tac ctxt (rev (Named_Theorems.get ctxt @{named_theorems cont_intro})))
+  REPEAT_ALL_NEW (resolve_tac ctxt (rev (Named_Theorems.get ctxt \<^named_theorems>\<open>cont_intro\<close>)))
   THEN_ALL_NEW (SOLVED' (simp_tac ctxt))
 
 fun cont_intro_simproc ctxt ct =
@@ -370,9 +370,9 @@
       | NONE => NONE
   in
     case Thm.term_of ct of
-      t as Const (@{const_name ccpo.admissible}, _) $ _ $ _ $ _ => mk_thm t
-    | t as Const (@{const_name mcont}, _) $ _ $ _ $ _ $ _ $ _ => mk_thm t
-    | t as Const (@{const_name monotone}, _) $ _ $ _ $ _ => mk_thm t
+      t as Const (\<^const_name>\<open>ccpo.admissible\<close>, _) $ _ $ _ $ _ => mk_thm t
+    | t as Const (\<^const_name>\<open>mcont\<close>, _) $ _ $ _ $ _ $ _ $ _ => mk_thm t
+    | t as Const (\<^const_name>\<open>monotone\<close>, _) $ _ $ _ $ _ => mk_thm t
     | _ => NONE
   end
   handle THM _ => NONE 
@@ -997,7 +997,7 @@
 
 end
 
-subsection \<open>@{term "(=)"} as order\<close>
+subsection \<open>\<^term>\<open>(=)\<close> as order\<close>
 
 definition lub_singleton :: "('a set \<Rightarrow> 'a) \<Rightarrow> bool"
 where "lub_singleton lub \<longleftrightarrow> (\<forall>a. lub {a} = a)"
@@ -1431,13 +1431,13 @@
 interpretation lfp: partial_function_definitions "(\<le>) :: _ :: complete_lattice \<Rightarrow> _" Sup
 by(rule complete_lattice_partial_function_definitions)
 
-declaration \<open>Partial_Function.init "lfp" @{term lfp.fixp_fun} @{term lfp.mono_body}
+declaration \<open>Partial_Function.init "lfp" \<^term>\<open>lfp.fixp_fun\<close> \<^term>\<open>lfp.mono_body\<close>
   @{thm lfp.fixp_rule_uc} @{thm lfp.fixp_induct_uc} NONE\<close>
 
 interpretation gfp: partial_function_definitions "(\<ge>) :: _ :: complete_lattice \<Rightarrow> _" Inf
 by(rule complete_lattice_partial_function_definitions_dual)
 
-declaration \<open>Partial_Function.init "gfp" @{term gfp.fixp_fun} @{term gfp.mono_body}
+declaration \<open>Partial_Function.init "gfp" \<^term>\<open>gfp.fixp_fun\<close> \<^term>\<open>gfp.mono_body\<close>
   @{thm gfp.fixp_rule_uc} @{thm gfp.fixp_induct_uc} NONE\<close>
 
 lemma insert_mono [partial_function_mono]:
--- a/src/HOL/Library/Countable.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Library/Countable.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -168,7 +168,7 @@
       let
         val ty_name =
           (case goal of
-            (_ $ Const (@{const_name Pure.type}, Type (@{type_name itself}, [Type (n, _)]))) => n
+            (_ $ Const (\<^const_name>\<open>Pure.type\<close>, Type (\<^type_name>\<open>itself\<close>, [Type (n, _)]))) => n
           | _ => raise Match)
         val typedef_info = hd (Typedef.get_info ctxt ty_name)
         val typedef_thm = #type_definition (snd typedef_info)
@@ -183,7 +183,7 @@
         val induct_thm = the (AList.lookup (op =) alist pred_name)
         val vars = rev (Term.add_vars (Thm.prop_of induct_thm) [])
         val insts = vars |> map (fn (_, T) => try (Thm.cterm_of ctxt)
-          (Const (@{const_name Countable.finite_item}, T)))
+          (Const (\<^const_name>\<open>Countable.finite_item\<close>, T)))
         val induct_thm' = Thm.instantiate' [] insts induct_thm
         val rules = @{thms finite_item.intros}
       in
--- a/src/HOL/Library/Countable_Set_Type.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Library/Countable_Set_Type.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -413,7 +413,7 @@
 apply (rule equal_intr_rule)
 by (transfer, simp)+
 
-subsubsection \<open>@{const cUnion}\<close>
+subsubsection \<open>\<^const>\<open>cUnion\<close>\<close>
 
 lemma cUNION_cimage: "cUNION (cimage f A) g = cUNION A (g \<circ> f)"
   by transfer simp
--- a/src/HOL/Library/DAList_Multiset.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Library/DAList_Multiset.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -202,7 +202,7 @@
 lemma mset_eq [code]: "HOL.equal (m1::'a::equal multiset) m2 \<longleftrightarrow> m1 \<subseteq># m2 \<and> m2 \<subseteq># m1"
   by (metis equal_multiset_def subset_mset.eq_iff)
 
-text \<open>By default the code for \<open><\<close> is @{prop"xs < ys \<longleftrightarrow> xs \<le> ys \<and> \<not> xs = ys"}.
+text \<open>By default the code for \<open><\<close> is \<^prop>\<open>xs < ys \<longleftrightarrow> xs \<le> ys \<and> \<not> xs = ys\<close>.
 With equality implemented by \<open>\<le>\<close>, this leads to three calls of  \<open>\<le>\<close>.
 Here is a more efficient version:\<close>
 lemma mset_less[code]: "xs \<subset># (ys :: 'a multiset) \<longleftrightarrow> xs \<subseteq># ys \<and> \<not> ys \<subseteq># xs"
--- a/src/HOL/Library/Disjoint_Sets.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Library/Disjoint_Sets.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -234,7 +234,7 @@
 subsection \<open>Partitions\<close>
 
 text \<open>
-  Partitions @{term P} of a set @{term A}. We explicitly disallow empty sets.
+  Partitions \<^term>\<open>P\<close> of a set \<^term>\<open>A\<close>. We explicitly disallow empty sets.
 \<close>
 
 definition partition_on :: "'a set \<Rightarrow> 'a set set \<Rightarrow> bool"
--- a/src/HOL/Library/Dlist.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Library/Dlist.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -25,7 +25,7 @@
   "list_of_dlist dxs = list_of_dlist dys \<Longrightarrow> dxs = dys"
   by (simp add: dlist_eq_iff)
 
-text \<open>Formal, totalized constructor for @{typ "'a dlist"}:\<close>
+text \<open>Formal, totalized constructor for \<^typ>\<open>'a dlist\<close>:\<close>
 
 definition Dlist :: "'a list \<Rightarrow> 'a dlist" where
   "Dlist xs = Abs_dlist (remdups xs)"
--- a/src/HOL/Library/Extended_Nat.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Library/Extended_Nat.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -33,7 +33,7 @@
 
 typedef enat = "UNIV :: nat option set" ..
 
-text \<open>TODO: introduce enat as coinductive datatype, enat is just @{const of_nat}\<close>
+text \<open>TODO: introduce enat as coinductive datatype, enat is just \<^const>\<open>of_nat\<close>\<close>
 
 definition enat :: "nat \<Rightarrow> enat" where
   "enat n = Abs_enat (Some n)"
@@ -537,7 +537,7 @@
           if u aconv t then (rev past @ terms)
           else find_first_t (t::past) u terms
 
-  fun dest_summing (Const (@{const_name Groups.plus}, _) $ t $ u, ts) =
+  fun dest_summing (Const (\<^const_name>\<open>Groups.plus\<close>, _) $ t $ u, ts) =
         dest_summing (t, dest_summing (u, ts))
     | dest_summing (t, ts) = t :: ts
 
@@ -546,7 +546,7 @@
   val find_first = find_first_t []
   val trans_tac = Numeral_Simprocs.trans_tac
   val norm_ss =
-    simpset_of (put_simpset HOL_basic_ss @{context}
+    simpset_of (put_simpset HOL_basic_ss \<^context>
       addsimps @{thms ac_simps add_0_left add_0_right})
   fun norm_tac ctxt = ALLGOALS (simp_tac (put_simpset norm_ss ctxt))
   fun simplify_meta_eq ctxt cancel_th th =
@@ -558,21 +558,21 @@
 structure Eq_Enat_Cancel = ExtractCommonTermFun
 (open Cancel_Enat_Common
   val mk_bal = HOLogic.mk_eq
-  val dest_bal = HOLogic.dest_bin @{const_name HOL.eq} @{typ enat}
+  val dest_bal = HOLogic.dest_bin \<^const_name>\<open>HOL.eq\<close> \<^typ>\<open>enat\<close>
   fun simp_conv _ _ = SOME @{thm enat_add_left_cancel}
 )
 
 structure Le_Enat_Cancel = ExtractCommonTermFun
 (open Cancel_Enat_Common
-  val mk_bal = HOLogic.mk_binrel @{const_name Orderings.less_eq}
-  val dest_bal = HOLogic.dest_bin @{const_name Orderings.less_eq} @{typ enat}
+  val mk_bal = HOLogic.mk_binrel \<^const_name>\<open>Orderings.less_eq\<close>
+  val dest_bal = HOLogic.dest_bin \<^const_name>\<open>Orderings.less_eq\<close> \<^typ>\<open>enat\<close>
   fun simp_conv _ _ = SOME @{thm enat_add_left_cancel_le}
 )
 
 structure Less_Enat_Cancel = ExtractCommonTermFun
 (open Cancel_Enat_Common
-  val mk_bal = HOLogic.mk_binrel @{const_name Orderings.less}
-  val dest_bal = HOLogic.dest_bin @{const_name Orderings.less} @{typ enat}
+  val mk_bal = HOLogic.mk_binrel \<^const_name>\<open>Orderings.less\<close>
+  val dest_bal = HOLogic.dest_bin \<^const_name>\<open>Orderings.less\<close> \<^typ>\<open>enat\<close>
   fun simp_conv _ _ = SOME @{thm enat_add_left_cancel_less}
 )
 \<close>
--- a/src/HOL/Library/Extended_Nonnegative_Real.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Library/Extended_Nonnegative_Real.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -408,7 +408,7 @@
           if u aconv t then (rev past @ terms)
           else find_first_t (t::past) u terms
 
-  fun dest_summing (Const (@{const_name Groups.plus}, _) $ t $ u, ts) =
+  fun dest_summing (Const (\<^const_name>\<open>Groups.plus\<close>, _) $ t $ u, ts) =
         dest_summing (t, dest_summing (u, ts))
     | dest_summing (t, ts) = t :: ts
 
@@ -417,7 +417,7 @@
   val find_first = find_first_t []
   val trans_tac = Numeral_Simprocs.trans_tac
   val norm_ss =
-    simpset_of (put_simpset HOL_basic_ss @{context}
+    simpset_of (put_simpset HOL_basic_ss \<^context>
       addsimps @{thms ac_simps add_0_left add_0_right})
   fun norm_tac ctxt = ALLGOALS (simp_tac (put_simpset norm_ss ctxt))
   fun simplify_meta_eq ctxt cancel_th th =
@@ -429,21 +429,21 @@
 structure Eq_Ennreal_Cancel = ExtractCommonTermFun
 (open Cancel_Ennreal_Common
   val mk_bal = HOLogic.mk_eq
-  val dest_bal = HOLogic.dest_bin @{const_name HOL.eq} @{typ ennreal}
+  val dest_bal = HOLogic.dest_bin \<^const_name>\<open>HOL.eq\<close> \<^typ>\<open>ennreal\<close>
   fun simp_conv _ _ = SOME @{thm ennreal_add_left_cancel}
 )
 
 structure Le_Ennreal_Cancel = ExtractCommonTermFun
 (open Cancel_Ennreal_Common
-  val mk_bal = HOLogic.mk_binrel @{const_name Orderings.less_eq}
-  val dest_bal = HOLogic.dest_bin @{const_name Orderings.less_eq} @{typ ennreal}
+  val mk_bal = HOLogic.mk_binrel \<^const_name>\<open>Orderings.less_eq\<close>
+  val dest_bal = HOLogic.dest_bin \<^const_name>\<open>Orderings.less_eq\<close> \<^typ>\<open>ennreal\<close>
   fun simp_conv _ _ = SOME @{thm ennreal_add_left_cancel_le}
 )
 
 structure Less_Ennreal_Cancel = ExtractCommonTermFun
 (open Cancel_Ennreal_Common
-  val mk_bal = HOLogic.mk_binrel @{const_name Orderings.less}
-  val dest_bal = HOLogic.dest_bin @{const_name Orderings.less} @{typ ennreal}
+  val mk_bal = HOLogic.mk_binrel \<^const_name>\<open>Orderings.less\<close>
+  val dest_bal = HOLogic.dest_bin \<^const_name>\<open>Orderings.less\<close> \<^typ>\<open>ennreal\<close>
   fun simp_conv _ _ = SOME @{thm ennreal_add_left_cancel_less}
 )
 \<close>
@@ -828,7 +828,7 @@
     by (cases a) (auto simp: top_ereal_def)
   done
 
-subsection \<open>Coercion from @{typ real} to @{typ ennreal}\<close>
+subsection \<open>Coercion from \<^typ>\<open>real\<close> to \<^typ>\<open>ennreal\<close>\<close>
 
 lift_definition ennreal :: "real \<Rightarrow> ennreal" is "sup 0 \<circ> ereal"
   by simp
@@ -1059,7 +1059,7 @@
   by (cases x rule: ennreal_cases)
      (auto simp: ennreal_of_nat_eq_real_of_nat ennreal_less_iff reals_Archimedean2)
 
-subsection \<open>Coercion from @{typ ennreal} to @{typ real}\<close>
+subsection \<open>Coercion from \<^typ>\<open>ennreal\<close> to \<^typ>\<open>real\<close>\<close>
 
 definition "enn2real x = real_of_ereal (enn2ereal x)"
 
@@ -1106,7 +1106,7 @@
 lemma enn2real_eq_1_iff[simp]: "enn2real x = 1 \<longleftrightarrow> x = 1"
   by (cases x) auto
 
-subsection \<open>Coercion from @{typ enat} to @{typ ennreal}\<close>
+subsection \<open>Coercion from \<^typ>\<open>enat\<close> to \<^typ>\<open>ennreal\<close>\<close>
 
 
 definition ennreal_of_enat :: "enat \<Rightarrow> ennreal"
@@ -1174,7 +1174,7 @@
 lemma ennreal_of_enat_eSuc[simp]: "ennreal_of_enat (eSuc x) = 1 + ennreal_of_enat x"
   by (cases x) (auto simp: eSuc_enat)
 
-subsection \<open>Topology on @{typ ennreal}\<close>
+subsection \<open>Topology on \<^typ>\<open>ennreal\<close>\<close>
 
 lemma enn2ereal_Iio: "enn2ereal -` {..<a} = (if 0 \<le> a then {..< e2ennreal a} else {})"
   using enn2ereal_nonneg
@@ -1774,7 +1774,7 @@
 lifting_forget ennreal.lifting
 
 
-subsection \<open>@{typ ennreal} theorems\<close>
+subsection \<open>\<^typ>\<open>ennreal\<close> theorems\<close>
 
 lemma neq_top_trans: fixes x y :: ennreal shows "\<lbrakk> y \<noteq> top; x \<le> y \<rbrakk> \<Longrightarrow> x \<noteq> top"
 by (auto simp: top_unique)
--- a/src/HOL/Library/Extended_Real.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Library/Extended_Real.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -13,9 +13,8 @@
 begin
 
 text \<open>
-  This should be part of @{theory "HOL-Library.Extended_Nat"} or @{theory
-  "HOL-Library.Order_Continuity"}, but then the AFP-entry \<open>Jinja_Thread\<close> fails, as it does overload
-  certain named from @{theory Complex_Main}.
+  This should be part of \<^theory>\<open>HOL-Library.Extended_Nat\<close> or \<^theory>\<open>HOL-Library.Order_Continuity\<close>, but then the AFP-entry \<open>Jinja_Thread\<close> fails, as it does overload
+  certain named from \<^theory>\<open>Complex_Main\<close>.
 \<close>
 
 lemma incseq_sumI2:
@@ -468,7 +467,7 @@
   by (cases rule: ereal2_cases[of a b]) auto
 
 
-subsubsection "Linear order on @{typ ereal}"
+subsubsection "Linear order on \<^typ>\<open>ereal\<close>"
 
 instantiation ereal :: linorder
 begin
@@ -2540,7 +2539,7 @@
   "A \<noteq> {} \<Longrightarrow> \<exists>f::nat \<Rightarrow> ereal. range f \<subseteq> g`A \<and> Sup (g ` A) = Sup (f ` UNIV)"
   using Sup_countable_SUP [of "g`A"] by auto
 
-subsection "Relation to @{typ enat}"
+subsection "Relation to \<^typ>\<open>enat\<close>"
 
 definition "ereal_of_enat n = (case n of enat n \<Rightarrow> ereal (real n) | \<infinity> \<Rightarrow> \<infinity>)"
 
@@ -2629,7 +2628,7 @@
   "A \<noteq> {} \<Longrightarrow> ereal_of_enat (SUP a\<in>A. f a) = (SUP a \<in> A. ereal_of_enat (f a))"
   using ereal_of_enat_Sup[of "f`A"] by auto
 
-subsection "Limits on @{typ ereal}"
+subsection "Limits on \<^typ>\<open>ereal\<close>"
 
 lemma open_PInfty: "open A \<Longrightarrow> \<infinity> \<in> A \<Longrightarrow> (\<exists>x. {ereal x<..} \<subseteq> A)"
   unfolding open_ereal_generated
--- a/src/HOL/Library/FSet.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Library/FSet.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -1207,7 +1207,7 @@
   including fset.lifting by transfer (auto intro: sum.reindex_cong subset_inj_on)
 
 setup \<open>
-BNF_LFP_Size.register_size_global @{type_name fset} @{const_name size_fset}
+BNF_LFP_Size.register_size_global \<^type_name>\<open>fset\<close> \<^const_name>\<open>size_fset\<close>
   @{thm size_fset_overloaded_def} @{thms size_fset_simps size_fset_overloaded_simps}
   @{thms fset_size_o_map}
 \<close>
--- a/src/HOL/Library/Finite_Lattice.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Library/Finite_Lattice.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -8,14 +8,14 @@
 
 text \<open>A non-empty finite lattice is a complete lattice.
 Since types are never empty in Isabelle/HOL,
-a type of classes @{class finite} and @{class lattice}
-should also have class @{class complete_lattice}.
+a type of classes \<^class>\<open>finite\<close> and \<^class>\<open>lattice\<close>
+should also have class \<^class>\<open>complete_lattice\<close>.
 A type class is defined
-that extends classes @{class finite} and @{class lattice}
-with the operators @{const bot}, @{const top}, @{const Inf}, and @{const Sup},
+that extends classes \<^class>\<open>finite\<close> and \<^class>\<open>lattice\<close>
+with the operators \<^const>\<open>bot\<close>, \<^const>\<open>top\<close>, \<^const>\<open>Inf\<close>, and \<^const>\<open>Sup\<close>,
 along with assumptions that define these operators
-in terms of the ones of classes @{class finite} and @{class lattice}.
-The resulting class is a subclass of @{class complete_lattice}.\<close>
+in terms of the ones of classes \<^class>\<open>finite\<close> and \<^class>\<open>lattice\<close>.
+The resulting class is a subclass of \<^class>\<open>complete_lattice\<close>.\<close>
 
 class finite_lattice_complete = finite + lattice + bot + top + Inf + Sup +
   assumes bot_def: "bot = Inf_fin UNIV"
@@ -24,8 +24,8 @@
   assumes Sup_def: "Sup A = Finite_Set.fold sup bot A"
 
 text \<open>The definitional assumptions
-on the operators @{const bot} and @{const top}
-of class @{class finite_lattice_complete}
+on the operators \<^const>\<open>bot\<close> and \<^const>\<open>top\<close>
+of class \<^class>\<open>finite_lattice_complete\<close>
 ensure that they yield bottom and top.\<close>
 
 lemma finite_lattice_complete_bot_least: "(bot::'a::finite_lattice_complete) \<le> x"
@@ -43,8 +43,8 @@
 instance finite_lattice_complete \<subseteq> bounded_lattice ..
 
 text \<open>The definitional assumptions
-on the operators @{const Inf} and @{const Sup}
-of class @{class finite_lattice_complete}
+on the operators \<^const>\<open>Inf\<close> and \<^const>\<open>Sup\<close>
+of class \<^class>\<open>finite_lattice_complete\<close>
 ensure that they yield infimum and supremum.\<close>
 
 lemma finite_lattice_complete_Inf_empty: "Inf {} = (top :: 'a::finite_lattice_complete)"
@@ -152,8 +152,8 @@
 subsection \<open>Finite Distributive Lattices\<close>
 
 text \<open>A finite distributive lattice is a complete lattice
-whose @{const inf} and @{const sup} operators
-distribute over @{const Sup} and @{const Inf}.\<close>
+whose \<^const>\<open>inf\<close> and \<^const>\<open>sup\<close> operators
+distribute over \<^const>\<open>Sup\<close> and \<^const>\<open>Inf\<close>.\<close>
 
 class finite_distrib_lattice_complete =
   distrib_lattice + finite_lattice_complete
@@ -203,19 +203,19 @@
 
 text \<open>A linear order is a distributive lattice.
 A type class is defined
-that extends class @{class linorder}
-with the operators @{const inf} and @{const sup},
+that extends class \<^class>\<open>linorder\<close>
+with the operators \<^const>\<open>inf\<close> and \<^const>\<open>sup\<close>,
 along with assumptions that define these operators
-in terms of the ones of class @{class linorder}.
-The resulting class is a subclass of @{class distrib_lattice}.\<close>
+in terms of the ones of class \<^class>\<open>linorder\<close>.
+The resulting class is a subclass of \<^class>\<open>distrib_lattice\<close>.\<close>
 
 class linorder_lattice = linorder + inf + sup +
   assumes inf_def: "inf x y = (if x \<le> y then x else y)"
   assumes sup_def: "sup x y = (if x \<ge> y then x else y)"
 
 text \<open>The definitional assumptions
-on the operators @{const inf} and @{const sup}
-of class @{class linorder_lattice}
+on the operators \<^const>\<open>inf\<close> and \<^const>\<open>sup\<close>
+of class \<^class>\<open>linorder_lattice\<close>
 ensure that they yield infimum and supremum
 and that they distribute over each other.\<close>
 
@@ -264,8 +264,8 @@
 instance finite_linorder_complete \<subseteq> complete_linorder ..
 
 text \<open>A (non-empty) finite linear order is a complete lattice
-whose @{const inf} and @{const sup} operators
-distribute over @{const Sup} and @{const Inf}.\<close>
+whose \<^const>\<open>inf\<close> and \<^const>\<open>sup\<close> operators
+distribute over \<^const>\<open>Sup\<close> and \<^const>\<open>Inf\<close>.\<close>
 
 instance finite_linorder_complete \<subseteq> finite_distrib_lattice_complete ..
 
--- a/src/HOL/Library/Finite_Map.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Library/Finite_Map.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -9,7 +9,7 @@
   abbrevs "(=" = "\<subseteq>\<^sub>f"
 begin
 
-subsection \<open>Auxiliary constants and lemmas over @{type map}\<close>
+subsection \<open>Auxiliary constants and lemmas over \<^type>\<open>map\<close>\<close>
 
 parametric_constant map_add_transfer[transfer_rule]: map_add_def
 parametric_constant map_of_transfer[transfer_rule]: map_of_def
@@ -1029,7 +1029,7 @@
 by transfer' (auto simp: set_of_map_def)
 
 
-subsection \<open>@{const size} setup\<close>
+subsection \<open>\<^const>\<open>size\<close> setup\<close>
 
 definition size_fmap :: "('a \<Rightarrow> nat) \<Rightarrow> ('b \<Rightarrow> nat) \<Rightarrow> ('a, 'b) fmap \<Rightarrow> nat" where
 [simp]: "size_fmap f g m = size_fset (\<lambda>(a, b). f a + g b) (fset_of_fmap m)"
@@ -1060,7 +1060,7 @@
   done
 
 setup \<open>
-BNF_LFP_Size.register_size_global @{type_name fmap} @{const_name size_fmap}
+BNF_LFP_Size.register_size_global \<^type_name>\<open>fmap\<close> \<^const_name>\<open>size_fmap\<close>
   @{thm size_fmap_overloaded_def} @{thms size_fmap_def size_fmap_overloaded_simps}
   @{thms fmap_size_o_map}
 \<close>
@@ -1431,7 +1431,7 @@
   fmfilter fmadd fmmap fmmap_keys fmcomp
   checking SML Scala Haskell? OCaml?
 
-\<comment> \<open>\<open>lifting\<close> through @{type fmap}\<close>
+\<comment> \<open>\<open>lifting\<close> through \<^type>\<open>fmap\<close>\<close>
 
 experiment begin
 
--- a/src/HOL/Library/Float.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Library/Float.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -639,7 +639,7 @@
 end
 
 
-subsection \<open>Lemmas for types @{typ real}, @{typ nat}, @{typ int}\<close>
+subsection \<open>Lemmas for types \<^typ>\<open>real\<close>, \<^typ>\<open>nat\<close>, \<^typ>\<open>int\<close>\<close>
 
 lemmas real_of_ints =
   of_int_add
--- a/src/HOL/Library/FuncSet.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Library/FuncSet.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -33,7 +33,7 @@
   where "compose A g f = (\<lambda>x\<in>A. g (f x))"
 
 
-subsection \<open>Basic Properties of @{term Pi}\<close>
+subsection \<open>Basic Properties of \<^term>\<open>Pi\<close>\<close>
 
 lemma Pi_I[intro!]: "(\<And>x. x \<in> A \<Longrightarrow> f x \<in> B x) \<Longrightarrow> f \<in> Pi A B"
   by (simp add: Pi_def)
@@ -72,7 +72,7 @@
   apply (simp add: Pi_def)
   apply auto
   txt \<open>Converse direction requires Axiom of Choice to exhibit a function
-  picking an element from each non-empty @{term "B x"}\<close>
+  picking an element from each non-empty \<^term>\<open>B x\<close>\<close>
   apply (drule_tac x = "\<lambda>u. SOME y. y \<in> B u" in spec)
   apply auto
   apply (cut_tac P = "\<lambda>y. y \<in> B x" in some_eq_ex)
@@ -156,7 +156,7 @@
   done
 
 
-subsection \<open>Composition With a Restricted Domain: @{term compose}\<close>
+subsection \<open>Composition With a Restricted Domain: \<^term>\<open>compose\<close>\<close>
 
 lemma funcset_compose: "f \<in> A \<rightarrow> B \<Longrightarrow> g \<in> B \<rightarrow> C \<Longrightarrow> compose A g f \<in> A \<rightarrow> C"
   by (simp add: Pi_def compose_def restrict_def)
@@ -173,7 +173,7 @@
   by (auto simp add: image_def compose_eq)
 
 
-subsection \<open>Bounded Abstraction: @{term restrict}\<close>
+subsection \<open>Bounded Abstraction: \<^term>\<open>restrict\<close>\<close>
 
 lemma restrict_cong: "I = J \<Longrightarrow> (\<And>i. i \<in> J =simp=> f i = g i) \<Longrightarrow> restrict f I = restrict g J"
   by (auto simp: restrict_def fun_eq_iff simp_implies_def)
@@ -223,8 +223,8 @@
 
 subsection \<open>Bijections Between Sets\<close>
 
-text \<open>The definition of @{const bij_betw} is in \<open>Fun.thy\<close>, but most of
-the theorems belong here, or need at least @{term Hilbert_Choice}.\<close>
+text \<open>The definition of \<^const>\<open>bij_betw\<close> is in \<open>Fun.thy\<close>, but most of
+the theorems belong here, or need at least \<^term>\<open>Hilbert_Choice\<close>.\<close>
 
 lemma bij_betwI:
   assumes "f \<in> A \<rightarrow> B"
--- a/src/HOL/Library/Function_Division.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Library/Function_Division.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -32,7 +32,7 @@
 text \<open>
   Unfortunately, we cannot lift this operations to algebraic type
   classes for division: being different from the constant
-  zero function @{term "f \<noteq> 0"} is too weak as precondition.
+  zero function \<^term>\<open>f \<noteq> 0\<close> is too weak as precondition.
   So we must introduce our own set of lemmas.
 \<close>
 
@@ -58,8 +58,8 @@
 
 text \<open>
   Another possibility would be a reformulation of the division type
-  classes to user a @{term zero_free} predicate rather than
-  a direct @{term "a \<noteq> 0"} condition.
+  classes to user a \<^term>\<open>zero_free\<close> predicate rather than
+  a direct \<^term>\<open>a \<noteq> 0\<close> condition.
 \<close>
 
 end
--- a/src/HOL/Library/Going_To_Filter.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Library/Going_To_Filter.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -20,26 +20,26 @@
     where "f going_to F \<equiv> f going_to F within UNIV"
 
 text \<open>
-  The \<open>going_to\<close> filter is, in a sense, the opposite of @{term filtermap}. 
+  The \<open>going_to\<close> filter is, in a sense, the opposite of \<^term>\<open>filtermap\<close>. 
   It corresponds to the intuition of, given a function $f: A \to B$ and a filter $F$ on the 
   range of $B$, looking at such values of $x$ that $f(x)$ approaches $F$. This can be 
-  written as @{term "f going_to F"}.
+  written as \<^term>\<open>f going_to F\<close>.
   
-  A classic example is the @{term "at_infinity"} filter, which describes the neigbourhood
+  A classic example is the \<^term>\<open>at_infinity\<close> filter, which describes the neigbourhood
   of infinity (i.\,e.\ all values sufficiently far away from the zero). This can also be written
-  as @{term "norm going_to at_top"}.
+  as \<^term>\<open>norm going_to at_top\<close>.
 
   Additionally, the \<open>going_to\<close> filter can be restricted with an optional `within' parameter.
   For instance, if one would would want to consider the filter of complex numbers near infinity
   that do not lie on the negative real line, one could write 
-  @{term "norm going_to at_top within - complex_of_real ` {..0}"}.
+  \<^term>\<open>norm going_to at_top within - complex_of_real ` {..0}\<close>.
 
   A third, less mathematical example lies in the complexity analysis of algorithms.
   Suppose we wanted to say that an algorithm on lists takes $O(n^2)$ time where $n$ is 
   the length of the input list. We can write this using the Landau symbols from the AFP,
-  where the underlying filter is @{term "length going_to at_top"}. If, on the other hand,
+  where the underlying filter is \<^term>\<open>length going_to at_top\<close>. If, on the other hand,
   we want to look the complexity of the algorithm on sorted lists, we could use the filter
-  @{term "length going_to at_top within {xs. sorted xs}"}.
+  \<^term>\<open>length going_to at_top within {xs. sorted xs}\<close>.
 \<close>
 
 lemma going_to_def: "f going_to F = filtercomap f F"
--- a/src/HOL/Library/IArray.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Library/IArray.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -188,7 +188,7 @@
 
 subsection \<open>Code Generation for Haskell\<close>
 
-text \<open>We map @{typ "'a iarray"}s in Isabelle/HOL to \<open>Data.Array.IArray.array\<close>
+text \<open>We map \<^typ>\<open>'a iarray\<close>s in Isabelle/HOL to \<open>Data.Array.IArray.array\<close>
   in Haskell.  Performance mapping to \<open>Data.Array.Unboxed.Array\<close> and
   \<open>Data.Array.Array\<close> is similar.\<close>
 
--- a/src/HOL/Library/Infinite_Set.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Library/Infinite_Set.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -214,7 +214,7 @@
 
 text \<open>
   Could be generalized to
-    @{prop "enumerate' S n = (SOME t. t \<in> s \<and> finite {s\<in>S. s < t} \<and> card {s\<in>S. s < t} = n)"}.
+    \<^prop>\<open>enumerate' S n = (SOME t. t \<in> s \<and> finite {s\<in>S. s < t} \<and> card {s\<in>S. s < t} = n)\<close>.
 \<close>
 
 primrec (in wellorder) enumerate :: "'a set \<Rightarrow> nat \<Rightarrow> 'a"
--- a/src/HOL/Library/LaTeXsugar.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Library/LaTeXsugar.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -112,13 +112,13 @@
     let
       val rhs_vars = Term.add_vars rhs [];
       fun dummy (v as Var (ixn as (_, T))) =
-            if member ((=) ) rhs_vars ixn then v else Const (@{const_name DUMMY}, T)
+            if member ((=) ) rhs_vars ixn then v else Const (\<^const_name>\<open>DUMMY\<close>, T)
         | dummy (t $ u) = dummy t $ dummy u
         | dummy (Abs (n, T, b)) = Abs (n, T, dummy b)
         | dummy t = t;
     in wrap $ (eq $ dummy lhs $ rhs) end
 in
-  Term_Style.setup @{binding dummy_pats} (Scan.succeed (K dummy_pats))
+  Term_Style.setup \<^binding>\<open>dummy_pats\<close> (Scan.succeed (K dummy_pats))
 end
 \<close>
 
@@ -145,7 +145,7 @@
 val style_eta_expand =
   (Scan.repeat Args.name) >> (fn xs => fn ctxt => fn t => fst (eta_expand [] t xs))
 
-in Term_Style.setup @{binding eta_expand} style_eta_expand end
+in Term_Style.setup \<^binding>\<open>eta_expand\<close> style_eta_expand end
 \<close>
 
 end
--- a/src/HOL/Library/Lub_Glb.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Library/Lub_Glb.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -45,7 +45,7 @@
   where "ubs R S = Collect (isUb R S)"
 
 
-subsection \<open>Rules about the Operators @{term leastP}, @{term ub} and @{term lub}\<close>
+subsection \<open>Rules about the Operators \<^term>\<open>leastP\<close>, \<^term>\<open>ub\<close> and \<^term>\<open>lub\<close>\<close>
 
 lemma leastPD1: "leastP P x \<Longrightarrow> P x"
   by (simp add: leastP_def)
@@ -118,7 +118,7 @@
   where "lbs R S = Collect (isLb R S)"
 
 
-subsection \<open>Rules about the Operators @{term greatestP}, @{term isLb} and @{term isGlb}\<close>
+subsection \<open>Rules about the Operators \<^term>\<open>greatestP\<close>, \<^term>\<open>isLb\<close> and \<^term>\<open>isGlb\<close>\<close>
 
 lemma greatestPD1: "greatestP P x \<Longrightarrow> P x"
   by (simp add: greatestP_def)
--- a/src/HOL/Library/Monad_Syntax.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Library/Monad_Syntax.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -11,7 +11,7 @@
 
 text \<open>
   We provide a convenient do-notation for monadic expressions
-  well-known from Haskell.  @{const Let} is printed
+  well-known from Haskell.  \<^const>\<open>Let\<close> is printed
   specially in do-expressions.
 \<close>
 
--- a/src/HOL/Library/Multiset.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Library/Multiset.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -31,7 +31,7 @@
 lemma multiset_eqI: "(\<And>x. count A x = count B x) \<Longrightarrow> A = B"
   using multiset_eq_iff by auto
 
-text \<open>Preservation of the representing set @{term multiset}.\<close>
+text \<open>Preservation of the representing set \<^term>\<open>multiset\<close>.\<close>
 
 lemma const0_in_multiset: "(\<lambda>a. 0) \<in> multiset"
   by (simp add: multiset_def)
@@ -1653,10 +1653,10 @@
 
 text \<open>
   A note on code generation: When defining some function containing a
-  subterm @{term "fold_mset F"}, code generation is not automatic. When
+  subterm \<^term>\<open>fold_mset F\<close>, code generation is not automatic. When
   interpreting locale \<open>left_commutative\<close> with \<open>F\<close>, the
-  would be code thms for @{const fold_mset} become thms like
-  @{term "fold_mset F z {#} = z"} where \<open>F\<close> is not a pattern but
+  would be code thms for \<^const>\<open>fold_mset\<close> become thms like
+  \<^term>\<open>fold_mset F z {#} = z\<close> where \<open>F\<close> is not a pattern but
   contains defined symbols, i.e.\ is not a code thm. Hence a separate
   constant with its own code thms needs to be introduced for \<open>F\<close>. See the image operator below.
 \<close>
@@ -1746,10 +1746,10 @@
   "{#e | x\<in>#M. P#}" \<rightharpoonup> "{#e. x \<in># {# x\<in>#M. P#}#}"
 
 text \<open>
-  This allows to write not just filters like @{term "{#x\<in>#M. x<c#}"}
-  but also images like @{term "{#x+x. x\<in>#M #}"} and @{term [source]
+  This allows to write not just filters like \<^term>\<open>{#x\<in>#M. x<c#}\<close>
+  but also images like \<^term>\<open>{#x+x. x\<in>#M #}\<close> and @{term [source]
   "{#x+x|x\<in>#M. x<c#}"}, where the latter is currently displayed as
-  @{term "{#x+x|x\<in>#M. x<c#}"}.
+  \<^term>\<open>{#x+x|x\<in>#M. x<c#}\<close>.
 \<close>
 
 lemma in_image_mset: "y \<in># {#f x. x \<in># M#} \<longleftrightarrow> y \<in> f ` set_mset M"
@@ -1965,7 +1965,7 @@
   qed
   then show "PROP ?P" "PROP ?Q" "PROP ?R"
   by (auto elim!: Set.set_insert)
-qed \<comment> \<open>TODO: maybe define @{const mset_set} also in terms of @{const Abs_multiset}\<close>
+qed \<comment> \<open>TODO: maybe define \<^const>\<open>mset_set\<close> also in terms of \<^const>\<open>Abs_multiset\<close>\<close>
 
 lemma elem_mset_set[simp, intro]: "finite A \<Longrightarrow> x \<in># mset_set A \<longleftrightarrow> x \<in> A"
   by (induct A rule: finite_induct) simp_all
@@ -3245,14 +3245,14 @@
 
 setup \<open>
   let
-    fun msetT T = Type (@{type_name multiset}, [T]);
-
-    fun mk_mset T [] = Const (@{const_abbrev Mempty}, msetT T)
+    fun msetT T = Type (\<^type_name>\<open>multiset\<close>, [T]);
+
+    fun mk_mset T [] = Const (\<^const_abbrev>\<open>Mempty\<close>, msetT T)
       | mk_mset T [x] =
-        Const (@{const_name add_mset}, T --> msetT T --> msetT T) $ x $
-          Const (@{const_abbrev Mempty}, msetT T)
+        Const (\<^const_name>\<open>add_mset\<close>, T --> msetT T --> msetT T) $ x $
+          Const (\<^const_abbrev>\<open>Mempty\<close>, msetT T)
       | mk_mset T (x :: xs) =
-        Const (@{const_name plus}, msetT T --> msetT T --> msetT T) $
+        Const (\<^const_name>\<open>plus\<close>, msetT T --> msetT T --> msetT T) $
           mk_mset T [x] $ mk_mset T xs
 
     fun mset_member_tac ctxt m i =
@@ -3267,7 +3267,7 @@
       resolve_tac ctxt @{thms nonempty_single}
 
     fun regroup_munion_conv ctxt =
-      Function_Lib.regroup_conv ctxt @{const_abbrev Mempty} @{const_name plus}
+      Function_Lib.regroup_conv ctxt \<^const_abbrev>\<open>Mempty\<close> \<^const_name>\<open>plus\<close>
         (map (fn t => t RS eq_reflection) (@{thms ac_simps} @ @{thms empty_neutral}))
 
     fun unfold_pwleq_tac ctxt i =
@@ -3358,13 +3358,13 @@
           in
             (case maps elems_for (all_values elem_T) @
                  (if maybe_opt then [Const (Nitpick_Model.unrep_mixfix (), elem_T)] else []) of
-              [] => Const (@{const_name zero_class.zero}, T)
+              [] => Const (\<^const_name>\<open>zero_class.zero\<close>, T)
             | ts =>
-                foldl1 (fn (s, t) => Const (@{const_name add_mset}, elem_T --> T --> T) $ s $ t)
+                foldl1 (fn (s, t) => Const (\<^const_name>\<open>add_mset\<close>, elem_T --> T --> T) $ s $ t)
                   ts)
           end
       | multiset_postproc _ _ _ _ t = t
-  in Nitpick_Model.register_term_postprocessor @{typ "'a multiset"} multiset_postproc end
+  in Nitpick_Model.register_term_postprocessor \<^typ>\<open>'a multiset\<close> multiset_postproc end
 \<close>
 
 
@@ -3513,8 +3513,8 @@
 qed
 
 text \<open>
-  Exercise for the casual reader: add implementations for @{term "(\<le>)"}
-  and @{term "(<)"} (multiset order).
+  Exercise for the casual reader: add implementations for \<^term>\<open>(\<le>)\<close>
+  and \<^term>\<open>(<)\<close> (multiset order).
 \<close>
 
 text \<open>Quickcheck generators\<close>
@@ -3865,7 +3865,7 @@
 lemma rel_mset_rel_mset': "rel_mset R M N = rel_mset' R M N"
   using rel_mset_imp_rel_mset' rel_mset'_imp_rel_mset by auto
 
-text \<open>The main end product for @{const rel_mset}: inductive characterization:\<close>
+text \<open>The main end product for \<^const>\<open>rel_mset\<close>: inductive characterization:\<close>
 lemmas rel_mset_induct[case_names empty add, induct pred: rel_mset] =
   rel_mset'.induct[unfolded rel_mset_rel_mset'[symmetric]]
 
@@ -3878,7 +3878,7 @@
   done
 
 setup \<open>
-  BNF_LFP_Size.register_size_global @{type_name multiset} @{const_name size_multiset}
+  BNF_LFP_Size.register_size_global \<^type_name>\<open>multiset\<close> \<^const_name>\<open>size_multiset\<close>
     @{thm size_multiset_overloaded_def}
     @{thms size_multiset_empty size_multiset_single size_multiset_union size_empty size_single
       size_union}
--- a/src/HOL/Library/Nat_Bijection.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Library/Nat_Bijection.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -12,7 +12,7 @@
   imports Main
 begin
 
-subsection \<open>Type @{typ "nat \<times> nat"}\<close>
+subsection \<open>Type \<^typ>\<open>nat \<times> nat\<close>\<close>
 
 text \<open>Triangle numbers: 0, 1, 3, 6, 10, 15, ...\<close>
 
@@ -28,7 +28,7 @@
 definition prod_encode :: "nat \<times> nat \<Rightarrow> nat"
   where "prod_encode = (\<lambda>(m, n). triangle (m + n) + m)"
 
-text \<open>In this auxiliary function, @{term "triangle k + m"} is an invariant.\<close>
+text \<open>In this auxiliary function, \<^term>\<open>triangle k + m\<close> is an invariant.\<close>
 
 fun prod_decode_aux :: "nat \<Rightarrow> nat \<Rightarrow> nat \<times> nat"
   where "prod_decode_aux k m =
@@ -98,7 +98,7 @@
   by (induct b) (simp_all add: prod_encode_def)
 
 
-subsection \<open>Type @{typ "nat + nat"}\<close>
+subsection \<open>Type \<^typ>\<open>nat + nat\<close>\<close>
 
 definition sum_encode :: "nat + nat \<Rightarrow> nat"
   where "sum_encode x = (case x of Inl a \<Rightarrow> 2 * a | Inr b \<Rightarrow> Suc (2 * b))"
@@ -137,7 +137,7 @@
   by (rule inj_sum_decode [THEN inj_eq])
 
 
-subsection \<open>Type @{typ "int"}\<close>
+subsection \<open>Type \<^typ>\<open>int\<close>\<close>
 
 definition int_encode :: "int \<Rightarrow> nat"
   where "int_encode i = sum_encode (if 0 \<le> i then Inl (nat i) else Inr (nat (- i - 1)))"
@@ -177,7 +177,7 @@
   by (rule inj_int_decode [THEN inj_eq])
 
 
-subsection \<open>Type @{typ "nat list"}\<close>
+subsection \<open>Type \<^typ>\<open>nat list\<close>\<close>
 
 fun list_encode :: "nat list \<Rightarrow> nat"
   where
--- a/src/HOL/Library/Nonpos_Ints.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Library/Nonpos_Ints.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -11,7 +11,7 @@
 subsection\<open>Non-positive integers\<close>
 text \<open>
   The set of non-positive integers on a ring. (in analogy to the set of non-negative
-  integers @{term "\<nat>"}) This is useful e.g. for the Gamma function.
+  integers \<^term>\<open>\<nat>\<close>) This is useful e.g. for the Gamma function.
 \<close>
 
 definition nonpos_Ints ("\<int>\<^sub>\<le>\<^sub>0") where "\<int>\<^sub>\<le>\<^sub>0 = {of_int n |n. n \<le> 0}"
--- a/src/HOL/Library/Numeral_Type.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Library/Numeral_Type.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -182,7 +182,7 @@
 
 text \<open>
   Unfortunately \<open>ring_1\<close> instance is not possible for
-  @{typ num1}, since 0 and 1 are not distinct.
+  \<^typ>\<open>num1\<close>, since 0 and 1 are not distinct.
 \<close>
 
 instantiation num1 :: "{comm_ring,comm_monoid_mult,numeral}"
@@ -317,7 +317,7 @@
 
 subsection \<open>Code setup and type classes for code generation\<close>
 
-text \<open>Code setup for @{typ num0} and @{typ num1}\<close>
+text \<open>Code setup for \<^typ>\<open>num0\<close> and \<^typ>\<open>num1\<close>\<close>
 
 definition Num0 :: num0 where "Num0 = Abs_num0 0"
 code_datatype Num0
@@ -365,7 +365,7 @@
 end
 
 
-text \<open>Code setup for @{typ "'a bit0"} and @{typ "'a bit1"}\<close>
+text \<open>Code setup for \<^typ>\<open>'a bit0\<close> and \<^typ>\<open>'a bit1\<close>\<close>
 
 declare
   bit0.Rep_inverse[code abstype]
@@ -477,11 +477,11 @@
   let
     fun mk_bintype n =
       let
-        fun mk_bit 0 = Syntax.const @{type_syntax bit0}
-          | mk_bit 1 = Syntax.const @{type_syntax bit1};
+        fun mk_bit 0 = Syntax.const \<^type_syntax>\<open>bit0\<close>
+          | mk_bit 1 = Syntax.const \<^type_syntax>\<open>bit1\<close>;
         fun bin_of n =
-          if n = 1 then Syntax.const @{type_syntax num1}
-          else if n = 0 then Syntax.const @{type_syntax num0}
+          if n = 1 then Syntax.const \<^type_syntax>\<open>num1\<close>
+          else if n = 0 then Syntax.const \<^type_syntax>\<open>num0\<close>
           else if n = ~1 then raise TERM ("negative type numeral", [])
           else
             let val (q, r) = Integer.div_mod n 2;
@@ -491,7 +491,7 @@
     fun numeral_tr [Free (str, _)] = mk_bintype (the (Int.fromString str))
       | numeral_tr ts = raise TERM ("numeral_tr", ts);
 
-  in [(@{syntax_const "_NumeralType"}, K numeral_tr)] end
+  in [(\<^syntax_const>\<open>_NumeralType\<close>, K numeral_tr)] end
 \<close>
 
 print_translation \<open>
@@ -499,10 +499,10 @@
     fun int_of [] = 0
       | int_of (b :: bs) = b + 2 * int_of bs;
 
-    fun bin_of (Const (@{type_syntax num0}, _)) = []
-      | bin_of (Const (@{type_syntax num1}, _)) = [1]
-      | bin_of (Const (@{type_syntax bit0}, _) $ bs) = 0 :: bin_of bs
-      | bin_of (Const (@{type_syntax bit1}, _) $ bs) = 1 :: bin_of bs
+    fun bin_of (Const (\<^type_syntax>\<open>num0\<close>, _)) = []
+      | bin_of (Const (\<^type_syntax>\<open>num1\<close>, _)) = [1]
+      | bin_of (Const (\<^type_syntax>\<open>bit0\<close>, _) $ bs) = 0 :: bin_of bs
+      | bin_of (Const (\<^type_syntax>\<open>bit1\<close>, _) $ bs) = 1 :: bin_of bs
       | bin_of t = raise TERM ("bin_of", [t]);
 
     fun bit_tr' b [t] =
@@ -511,12 +511,12 @@
             val i = int_of rev_digs;
             val num = string_of_int (abs i);
           in
-            Syntax.const @{syntax_const "_NumeralType"} $ Syntax.free num
+            Syntax.const \<^syntax_const>\<open>_NumeralType\<close> $ Syntax.free num
           end
       | bit_tr' b _ = raise Match;
   in
-   [(@{type_syntax bit0}, K (bit_tr' 0)),
-    (@{type_syntax bit1}, K (bit_tr' 1))]
+   [(\<^type_syntax>\<open>bit0\<close>, K (bit_tr' 0)),
+    (\<^type_syntax>\<open>bit1\<close>, K (bit_tr' 1))]
   end
 \<close>
 
--- a/src/HOL/Library/Open_State_Syntax.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Library/Open_State_Syntax.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -59,20 +59,20 @@
 notation scomp (infixl "\<circ>\<rightarrow>" 60)
 
 text \<open>
-  Given two transformations @{term f} and @{term g}, they may be
-  directly composed using the @{term "(\<circ>>)"} combinator, forming a
-  forward composition: @{prop "(f \<circ>> g) s = f (g s)"}.
+  Given two transformations \<^term>\<open>f\<close> and \<^term>\<open>g\<close>, they may be
+  directly composed using the \<^term>\<open>(\<circ>>)\<close> combinator, forming a
+  forward composition: \<^prop>\<open>(f \<circ>> g) s = f (g s)\<close>.
 
   After any yielding transformation, we bind the side result
   immediately using a lambda abstraction.  This is the purpose of the
-  @{term "(\<circ>\<rightarrow>)"} combinator: @{prop "(f \<circ>\<rightarrow> (\<lambda>x. g)) s = (let (x, s')
-  = f s in g s')"}.
+  \<^term>\<open>(\<circ>\<rightarrow>)\<close> combinator: \<^prop>\<open>(f \<circ>\<rightarrow> (\<lambda>x. g)) s = (let (x, s')
+  = f s in g s')\<close>.
 
-  For queries, the existing @{term "Let"} is appropriate.
+  For queries, the existing \<^term>\<open>Let\<close> is appropriate.
 
   Naturally, a computation may yield a side result by pairing it to
   the state from the left; we introduce the suggestive abbreviation
-  @{term return} for this purpose.
+  \<^term>\<open>return\<close> for this purpose.
 
   The most crucial distinction to Haskell is that we do not need to
   introduce distinguished type constructors for different kinds of
--- a/src/HOL/Library/Pattern_Aliases.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Library/Pattern_Aliases.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -14,8 +14,8 @@
   well for function definitions (see usage below). All features are packed into a @{command bundle}.
 
   The following caveats should be kept in mind:
-  \<^item> The translation expects a term of the form @{prop "f x y = rhs"}, where \<open>x\<close> and \<open>y\<close> are patterns
-    that may contain aliases. The result of the translation is a nested @{const Let}-expression on
+  \<^item> The translation expects a term of the form \<^prop>\<open>f x y = rhs\<close>, where \<open>x\<close> and \<open>y\<close> are patterns
+    that may contain aliases. The result of the translation is a nested \<^const>\<open>Let\<close>-expression on
     the right hand side. The code generator \<^emph>\<open>does not\<close> print Isabelle pattern aliases to target
     language pattern aliases.
   \<^item> The translation does not process nested equalities; only the top-level equality is translated.
@@ -26,13 +26,13 @@
     additionally introduced variables are bound using a ``fake quantifier'' that does not
     appear in the output.
   \<^item> To obtain reasonable induction principles in function definitions, the bundle also declares
-    a custom congruence rule for @{const Let} that only affects @{command fun}. This congruence
+    a custom congruence rule for \<^const>\<open>Let\<close> that only affects @{command fun}. This congruence
     rule might lead to an explosion in term size (although that is rare)! In some circumstances
     (using \<open>let\<close> to destructure tuples), the internal construction of functions stumbles over this
     rule and prints an error. To mitigate this, either
-    \<^item> activate the bundle locally (@{theory_text \<open>context includes ... begin\<close>}) or
-    \<^item> rewrite the \<open>let\<close>-expression to use \<open>case\<close>: @{term \<open>let (a, b) = x in (b, a)\<close>} becomes
-      @{term \<open>case x of (a, b) \<Rightarrow> (b, a)\<close>}.
+    \<^item> activate the bundle locally (\<^theory_text>\<open>context includes ... begin\<close>) or
+    \<^item> rewrite the \<open>let\<close>-expression to use \<open>case\<close>: \<^term>\<open>let (a, b) = x in (b, a)\<close> becomes
+      \<^term>\<open>case x of (a, b) \<Rightarrow> (b, a)\<close>.
   \<^item> The bundle also adds the @{thm Let_def} rule to the simpset.
 \<close>
 
@@ -84,7 +84,7 @@
   in fst (go t) end
 
 (* adapted from logic.ML *)
-fun fake_const T = Const (@{const_name fake_quant}, (T --> propT) --> propT);
+fun fake_const T = Const (\<^const_name>\<open>fake_quant\<close>, (T --> propT) --> propT);
 
 fun dependent_fake_name v t =
   let
@@ -97,14 +97,14 @@
 
 fun check_pattern_syntax t =
   case strip_all t of
-    (vars, @{const Trueprop} $ (Const (@{const_name HOL.eq}, _) $ lhs $ rhs)) =>
+    (vars, @{const Trueprop} $ (Const (\<^const_name>\<open>HOL.eq\<close>, _) $ lhs $ rhs)) =>
       let
-        fun go (Const (@{const_name as}, _) $ pat $ var, rhs) =
+        fun go (Const (\<^const_name>\<open>as\<close>, _) $ pat $ var, rhs) =
               let
                 val (pat', rhs') = go (pat, rhs)
                 val _ = if is_Free var then () else error "Right-hand side of =: must be a free variable"
                 val rhs'' =
-                  Const (@{const_name Let}, let_typ (fastype_of var) (fastype_of rhs)) $
+                  Const (\<^const_name>\<open>Let\<close>, let_typ (fastype_of var) (fastype_of rhs)) $
                     pat' $ lambda var rhs'
               in
                 (pat', rhs'')
@@ -126,15 +126,15 @@
 
 fun uncheck_pattern_syntax ctxt t =
   case strip_all t of
-    (vars, @{const Trueprop} $ (Const (@{const_name HOL.eq}, _) $ lhs $ rhs)) =>
+    (vars, @{const Trueprop} $ (Const (\<^const_name>\<open>HOL.eq\<close>, _) $ lhs $ rhs)) =>
       let
         (* restricted to going down abstractions; ignores eta-contracted rhs *)
-        fun go lhs (rhs as Const (@{const_name Let}, _) $ pat $ Abs (name, typ, t)) ctxt frees =
+        fun go lhs (rhs as Const (\<^const_name>\<open>Let\<close>, _) $ pat $ Abs (name, typ, t)) ctxt frees =
               if exists_subterm (fn t' => t' = pat) lhs then
                 let
                   val ([name'], ctxt') = Variable.variant_fixes [name] ctxt
                   val free = Free (name', typ)
-                  val subst = (pat, Const (@{const_name as}, as_typ typ) $ pat $ free)
+                  val subst = (pat, Const (\<^const_name>\<open>as\<close>, as_typ typ) $ pat $ free)
                   val lhs' = subst_once subst lhs
                   val rhs' = subst_bound (free, t)
                 in
@@ -199,10 +199,10 @@
   val actual =
     @{thm test_2.simps(1)}
     |> Thm.prop_of
-    |> Syntax.string_of_term @{context}
+    |> Syntax.string_of_term \<^context>
     |> YXML.content_of
   val expected = "test_2 (?y # (?y' # ?ys =: x') =: x) = x @ x' @ x'"
-in @{assert} (actual = expected) end
+in \<^assert> (actual = expected) end
 \<close>
 
 end
--- a/src/HOL/Library/Periodic_Fun.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Library/Periodic_Fun.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -13,10 +13,10 @@
   for some period $p$ and gets derived results like $f(x - p) = f(x)$ and $f(x + 2p) = f(x)$
   for free.
 
-  @{term g} and @{term gm} are ``plus/minus k periods'' functions. 
-  @{term g1} and @{term gn1} are ``plus/minus one period'' functions.
+  \<^term>\<open>g\<close> and \<^term>\<open>gm\<close> are ``plus/minus k periods'' functions. 
+  \<^term>\<open>g1\<close> and \<^term>\<open>gn1\<close> are ``plus/minus one period'' functions.
   This is useful e.g. if the period is one; the lemmas one gets are then 
-  @{term "f (x + 1) = f x"} instead of @{term "f (x + 1 * 1) = f x"} etc.
+  \<^term>\<open>f (x + 1) = f x\<close> instead of \<^term>\<open>f (x + 1 * 1) = f x\<close> etc.
 \<close>
 locale periodic_fun = 
   fixes f :: "('a :: {ring_1}) \<Rightarrow> 'b" and g gm :: "'a \<Rightarrow> 'a \<Rightarrow> 'a" and g1 gn1 :: "'a \<Rightarrow> 'a"
@@ -63,8 +63,8 @@
 
 
 text \<open>
-  Specialised case of the @{term periodic_fun} locale for periods that are not 1.
-  Gives lemmas @{term "f (x - period) = f x"} etc.
+  Specialised case of the \<^term>\<open>periodic_fun\<close> locale for periods that are not 1.
+  Gives lemmas \<^term>\<open>f (x - period) = f x\<close> etc.
 \<close>
 locale periodic_fun_simple = 
   fixes f :: "('a :: {ring_1}) \<Rightarrow> 'b" and period :: 'a
@@ -77,8 +77,8 @@
 
 
 text \<open>
-  Specialised case of the @{term periodic_fun} locale for period 1.
-  Gives lemmas @{term "f (x - 1) = f x"} etc.
+  Specialised case of the \<^term>\<open>periodic_fun\<close> locale for period 1.
+  Gives lemmas \<^term>\<open>f (x - 1) = f x\<close> etc.
 \<close>
 locale periodic_fun_simple' = 
   fixes f :: "('a :: {ring_1}) \<Rightarrow> 'b"
--- a/src/HOL/Library/Phantom_Type.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Library/Phantom_Type.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -23,11 +23,11 @@
 
 typed_print_translation \<open>
   let
-    fun phantom_tr' ctxt (Type (@{type_name fun}, [_, Type (@{type_name phantom}, [T, _])])) ts =
+    fun phantom_tr' ctxt (Type (\<^type_name>\<open>fun\<close>, [_, Type (\<^type_name>\<open>phantom\<close>, [T, _])])) ts =
           list_comb
-            (Syntax.const @{syntax_const "_Phantom"} $ Syntax_Phases.term_of_typ ctxt T, ts)
+            (Syntax.const \<^syntax_const>\<open>_Phantom\<close> $ Syntax_Phases.term_of_typ ctxt T, ts)
       | phantom_tr' _ _ _ = raise Match;
-  in [(@{const_syntax phantom}, phantom_tr')] end
+  in [(\<^const_syntax>\<open>phantom\<close>, phantom_tr')] end
 \<close>
 
 lemma of_phantom_inject [simp]:
--- a/src/HOL/Library/Predicate_Compile_Alternative_Defs.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Library/Predicate_Compile_Alternative_Defs.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -22,16 +22,16 @@
   "((A::bool) \<noteq> (B::bool)) = ((A \<and> \<not> B) \<or> (B \<and> \<not> A))"
 by fast
 
-setup \<open>Predicate_Compile_Data.ignore_consts [@{const_name Let}]\<close>
+setup \<open>Predicate_Compile_Data.ignore_consts [\<^const_name>\<open>Let\<close>]\<close>
 
 section \<open>Pairs\<close>
 
-setup \<open>Predicate_Compile_Data.ignore_consts [@{const_name fst}, @{const_name snd}, @{const_name case_prod}]\<close>
+setup \<open>Predicate_Compile_Data.ignore_consts [\<^const_name>\<open>fst\<close>, \<^const_name>\<open>snd\<close>, \<^const_name>\<open>case_prod\<close>]\<close>
 
 section \<open>Filters\<close>
 
 (*TODO: shouldn't this be done by typedef? *)
-setup \<open>Predicate_Compile_Data.ignore_consts [@{const_name Abs_filter}, @{const_name Rep_filter}]\<close>
+setup \<open>Predicate_Compile_Data.ignore_consts [\<^const_name>\<open>Abs_filter\<close>, \<^const_name>\<open>Rep_filter\<close>]\<close>
 
 section \<open>Bounded quantifiers\<close>
 
@@ -54,12 +54,12 @@
 
 section \<open>Setup for Numerals\<close>
 
-setup \<open>Predicate_Compile_Data.ignore_consts [@{const_name numeral}]\<close>
-setup \<open>Predicate_Compile_Data.keep_functions [@{const_name numeral}]\<close>
-setup \<open>Predicate_Compile_Data.ignore_consts [@{const_name Char}]\<close>
-setup \<open>Predicate_Compile_Data.keep_functions [@{const_name Char}]\<close>
+setup \<open>Predicate_Compile_Data.ignore_consts [\<^const_name>\<open>numeral\<close>]\<close>
+setup \<open>Predicate_Compile_Data.keep_functions [\<^const_name>\<open>numeral\<close>]\<close>
+setup \<open>Predicate_Compile_Data.ignore_consts [\<^const_name>\<open>Char\<close>]\<close>
+setup \<open>Predicate_Compile_Data.keep_functions [\<^const_name>\<open>Char\<close>]\<close>
 
-setup \<open>Predicate_Compile_Data.ignore_consts [@{const_name divide}, @{const_name modulo}, @{const_name times}]\<close>
+setup \<open>Predicate_Compile_Data.ignore_consts [\<^const_name>\<open>divide\<close>, \<^const_name>\<open>modulo\<close>, \<^const_name>\<open>times\<close>]\<close>
 
 section \<open>Arithmetic operations\<close>
 
@@ -95,57 +95,57 @@
   val ioi = Fun (Input, Fun (Output, Fun (Input, Bool)))
   val oii = Fun (Output, Fun (Input, Fun (Input, Bool)))
   val ooi = Fun (Output, Fun (Output, Fun (Input, Bool)))
-  val plus_nat = Core_Data.functional_compilation @{const_name plus} iio
-  val minus_nat = Core_Data.functional_compilation @{const_name "minus"} iio
+  val plus_nat = Core_Data.functional_compilation \<^const_name>\<open>plus\<close> iio
+  val minus_nat = Core_Data.functional_compilation \<^const_name>\<open>minus\<close> iio
   fun subtract_nat compfuns (_ : typ) =
     let
-      val T = Predicate_Compile_Aux.mk_monadT compfuns @{typ nat}
+      val T = Predicate_Compile_Aux.mk_monadT compfuns \<^typ>\<open>nat\<close>
     in
-      absdummy @{typ nat} (absdummy @{typ nat}
-        (Const (@{const_name "If"}, @{typ bool} --> T --> T --> T) $
-          (@{term "(>) :: nat => nat => bool"} $ Bound 1 $ Bound 0) $
-          Predicate_Compile_Aux.mk_empty compfuns @{typ nat} $
+      absdummy \<^typ>\<open>nat\<close> (absdummy \<^typ>\<open>nat\<close>
+        (Const (\<^const_name>\<open>If\<close>, \<^typ>\<open>bool\<close> --> T --> T --> T) $
+          (\<^term>\<open>(>) :: nat => nat => bool\<close> $ Bound 1 $ Bound 0) $
+          Predicate_Compile_Aux.mk_empty compfuns \<^typ>\<open>nat\<close> $
           Predicate_Compile_Aux.mk_single compfuns
-          (@{term "(-) :: nat => nat => nat"} $ Bound 0 $ Bound 1)))
+          (\<^term>\<open>(-) :: nat => nat => nat\<close> $ Bound 0 $ Bound 1)))
     end
   fun enumerate_addups_nat compfuns (_ : typ) =
-    absdummy @{typ nat} (Predicate_Compile_Aux.mk_iterate_upto compfuns @{typ "nat * nat"}
-    (absdummy @{typ natural} (@{term "Pair :: nat => nat => nat * nat"} $
-      (@{term "nat_of_natural"} $ Bound 0) $
-      (@{term "(-) :: nat => nat => nat"} $ Bound 1 $ (@{term "nat_of_natural"} $ Bound 0))),
-      @{term "0 :: natural"}, @{term "natural_of_nat"} $ Bound 0))
+    absdummy \<^typ>\<open>nat\<close> (Predicate_Compile_Aux.mk_iterate_upto compfuns \<^typ>\<open>nat * nat\<close>
+    (absdummy \<^typ>\<open>natural\<close> (\<^term>\<open>Pair :: nat => nat => nat * nat\<close> $
+      (\<^term>\<open>nat_of_natural\<close> $ Bound 0) $
+      (\<^term>\<open>(-) :: nat => nat => nat\<close> $ Bound 1 $ (\<^term>\<open>nat_of_natural\<close> $ Bound 0))),
+      \<^term>\<open>0 :: natural\<close>, \<^term>\<open>natural_of_nat\<close> $ Bound 0))
   fun enumerate_nats compfuns  (_ : typ) =
     let
-      val (single_const, _) = strip_comb (Predicate_Compile_Aux.mk_single compfuns @{term "0 :: nat"})
-      val T = Predicate_Compile_Aux.mk_monadT compfuns @{typ nat}
+      val (single_const, _) = strip_comb (Predicate_Compile_Aux.mk_single compfuns \<^term>\<open>0 :: nat\<close>)
+      val T = Predicate_Compile_Aux.mk_monadT compfuns \<^typ>\<open>nat\<close>
     in
-      absdummy @{typ nat} (absdummy @{typ nat}
-        (Const (@{const_name If}, @{typ bool} --> T --> T --> T) $
-          (@{term "(=) :: nat => nat => bool"} $ Bound 0 $ @{term "0::nat"}) $
-          (Predicate_Compile_Aux.mk_iterate_upto compfuns @{typ nat} (@{term "nat_of_natural"},
-            @{term "0::natural"}, @{term "natural_of_nat"} $ Bound 1)) $
-            (single_const $ (@{term "(+) :: nat => nat => nat"} $ Bound 1 $ Bound 0))))
+      absdummy \<^typ>\<open>nat\<close> (absdummy \<^typ>\<open>nat\<close>
+        (Const (\<^const_name>\<open>If\<close>, \<^typ>\<open>bool\<close> --> T --> T --> T) $
+          (\<^term>\<open>(=) :: nat => nat => bool\<close> $ Bound 0 $ \<^term>\<open>0::nat\<close>) $
+          (Predicate_Compile_Aux.mk_iterate_upto compfuns \<^typ>\<open>nat\<close> (\<^term>\<open>nat_of_natural\<close>,
+            \<^term>\<open>0::natural\<close>, \<^term>\<open>natural_of_nat\<close> $ Bound 1)) $
+            (single_const $ (\<^term>\<open>(+) :: nat => nat => nat\<close> $ Bound 1 $ Bound 0))))
     end
 in
-  Core_Data.force_modes_and_compilations @{const_name plus_eq_nat}
+  Core_Data.force_modes_and_compilations \<^const_name>\<open>plus_eq_nat\<close>
     [(iio, (plus_nat, false)), (oii, (subtract_nat, false)), (ioi, (subtract_nat, false)),
      (ooi, (enumerate_addups_nat, false))]
   #> Predicate_Compile_Fun.add_function_predicate_translation
-       (@{term "plus :: nat => nat => nat"}, @{term "plus_eq_nat"})
-  #> Core_Data.force_modes_and_compilations @{const_name minus_eq_nat}
+       (\<^term>\<open>plus :: nat => nat => nat\<close>, \<^term>\<open>plus_eq_nat\<close>)
+  #> Core_Data.force_modes_and_compilations \<^const_name>\<open>minus_eq_nat\<close>
        [(iio, (minus_nat, false)), (oii, (enumerate_nats, false))]
   #> Predicate_Compile_Fun.add_function_predicate_translation
-      (@{term "minus :: nat => nat => nat"}, @{term "minus_eq_nat"})
-  #> Core_Data.force_modes_and_functions @{const_name plus_eq_int}
-    [(iio, (@{const_name plus}, false)), (ioi, (@{const_name subtract}, false)),
-     (oii, (@{const_name subtract}, false))]
+      (\<^term>\<open>minus :: nat => nat => nat\<close>, \<^term>\<open>minus_eq_nat\<close>)
+  #> Core_Data.force_modes_and_functions \<^const_name>\<open>plus_eq_int\<close>
+    [(iio, (\<^const_name>\<open>plus\<close>, false)), (ioi, (\<^const_name>\<open>subtract\<close>, false)),
+     (oii, (\<^const_name>\<open>subtract\<close>, false))]
   #> Predicate_Compile_Fun.add_function_predicate_translation
-       (@{term "plus :: int => int => int"}, @{term "plus_eq_int"})
-  #> Core_Data.force_modes_and_functions @{const_name minus_eq_int}
-    [(iio, (@{const_name minus}, false)), (oii, (@{const_name plus}, false)),
-     (ioi, (@{const_name minus}, false))]
+       (\<^term>\<open>plus :: int => int => int\<close>, \<^term>\<open>plus_eq_int\<close>)
+  #> Core_Data.force_modes_and_functions \<^const_name>\<open>minus_eq_int\<close>
+    [(iio, (\<^const_name>\<open>minus\<close>, false)), (oii, (\<^const_name>\<open>plus\<close>, false)),
+     (ioi, (\<^const_name>\<open>minus\<close>, false))]
   #> Predicate_Compile_Fun.add_function_predicate_translation
-      (@{term "minus :: int => int => int"}, @{term "minus_eq_int"})
+      (\<^term>\<open>minus :: int => int => int\<close>, \<^term>\<open>minus_eq_int\<close>)
 end
 \<close>
 
@@ -244,7 +244,7 @@
 
 section \<open>Setup for String.literal\<close>
 
-setup \<open>Predicate_Compile_Data.ignore_consts [@{const_name String.Literal}]\<close>
+setup \<open>Predicate_Compile_Data.ignore_consts [\<^const_name>\<open>String.Literal\<close>]\<close>
 
 section \<open>Simplification rules for optimisation\<close>
 
--- a/src/HOL/Library/Quotient_Type.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Library/Quotient_Type.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -58,7 +58,7 @@
 end
 
 text \<open>The quotient type \<open>'a quot\<close> consists of all \emph{equivalence
-  classes} over elements of the base type @{typ 'a}.\<close>
+  classes} over elements of the base type \<^typ>\<open>'a\<close>.\<close>
 
 definition (in eqv) "quot = {{x. a \<sim> x} | a. True}"
 
--- a/src/HOL/Library/RBT_Impl.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Library/RBT_Impl.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -2017,7 +2017,7 @@
   ord.rbt_map_entry.simps
   ord.rbt_bulkload_def
 
-text \<open>More efficient implementations for @{term entries} and @{term keys}\<close>
+text \<open>More efficient implementations for \<^term>\<open>entries\<close> and \<^term>\<open>keys\<close>\<close>
 
 definition gen_entries :: 
   "(('a \<times> 'b) \<times> ('a, 'b) rbt) list \<Rightarrow> ('a, 'b) rbt \<Rightarrow> ('a \<times> 'b) list"
@@ -2050,24 +2050,24 @@
 text \<open>Restore original type constraints for constants\<close>
 setup \<open>
   fold Sign.add_const_constraint
-    [(@{const_name rbt_less}, SOME @{typ "('a :: order) \<Rightarrow> ('a, 'b) rbt \<Rightarrow> bool"}),
-     (@{const_name rbt_greater}, SOME @{typ "('a :: order) \<Rightarrow> ('a, 'b) rbt \<Rightarrow> bool"}),
-     (@{const_name rbt_sorted}, SOME @{typ "('a :: linorder, 'b) rbt \<Rightarrow> bool"}),
-     (@{const_name rbt_lookup}, SOME @{typ "('a :: linorder, 'b) rbt \<Rightarrow> 'a \<rightharpoonup> 'b"}),
-     (@{const_name is_rbt}, SOME @{typ "('a :: linorder, 'b) rbt \<Rightarrow> bool"}),
-     (@{const_name rbt_ins}, SOME @{typ "('a::linorder \<Rightarrow> 'b \<Rightarrow> 'b \<Rightarrow> 'b) \<Rightarrow> 'a \<Rightarrow> 'b \<Rightarrow> ('a,'b) rbt \<Rightarrow> ('a,'b) rbt"}),
-     (@{const_name rbt_insert_with_key}, SOME @{typ "('a::linorder \<Rightarrow> 'b \<Rightarrow> 'b \<Rightarrow> 'b) \<Rightarrow> 'a \<Rightarrow> 'b \<Rightarrow> ('a,'b) rbt \<Rightarrow> ('a,'b) rbt"}),
-     (@{const_name rbt_insert_with}, SOME @{typ "('b \<Rightarrow> 'b \<Rightarrow> 'b) \<Rightarrow> ('a :: linorder) \<Rightarrow> 'b \<Rightarrow> ('a,'b) rbt \<Rightarrow> ('a,'b) rbt"}),
-     (@{const_name rbt_insert}, SOME @{typ "('a :: linorder) \<Rightarrow> 'b \<Rightarrow> ('a,'b) rbt \<Rightarrow> ('a,'b) rbt"}),
-     (@{const_name rbt_del_from_left}, SOME @{typ "('a::linorder) \<Rightarrow> ('a,'b) rbt \<Rightarrow> 'a \<Rightarrow> 'b \<Rightarrow> ('a,'b) rbt \<Rightarrow> ('a,'b) rbt"}),
-     (@{const_name rbt_del_from_right}, SOME @{typ "('a::linorder) \<Rightarrow> ('a,'b) rbt \<Rightarrow> 'a \<Rightarrow> 'b \<Rightarrow> ('a,'b) rbt \<Rightarrow> ('a,'b) rbt"}),
-     (@{const_name rbt_del}, SOME @{typ "('a::linorder) \<Rightarrow> ('a,'b) rbt \<Rightarrow> ('a,'b) rbt"}),
-     (@{const_name rbt_delete}, SOME @{typ "('a::linorder) \<Rightarrow> ('a,'b) rbt \<Rightarrow> ('a,'b) rbt"}),
-     (@{const_name rbt_union_with_key}, SOME @{typ "('a::linorder \<Rightarrow> 'b \<Rightarrow> 'b \<Rightarrow> 'b) \<Rightarrow> ('a,'b) rbt \<Rightarrow> ('a,'b) rbt \<Rightarrow> ('a,'b) rbt"}),
-     (@{const_name rbt_union_with}, SOME @{typ "('b \<Rightarrow> 'b \<Rightarrow> 'b) \<Rightarrow> ('a::linorder,'b) rbt \<Rightarrow> ('a,'b) rbt \<Rightarrow> ('a,'b) rbt"}),
-     (@{const_name rbt_union}, SOME @{typ "('a::linorder,'b) rbt \<Rightarrow> ('a,'b) rbt \<Rightarrow> ('a,'b) rbt"}),
-     (@{const_name rbt_map_entry}, SOME @{typ "'a::linorder \<Rightarrow> ('b \<Rightarrow> 'b) \<Rightarrow> ('a,'b) rbt \<Rightarrow> ('a,'b) rbt"}),
-     (@{const_name rbt_bulkload}, SOME @{typ "('a \<times> 'b) list \<Rightarrow> ('a::linorder,'b) rbt"})]
+    [(\<^const_name>\<open>rbt_less\<close>, SOME \<^typ>\<open>('a :: order) \<Rightarrow> ('a, 'b) rbt \<Rightarrow> bool\<close>),
+     (\<^const_name>\<open>rbt_greater\<close>, SOME \<^typ>\<open>('a :: order) \<Rightarrow> ('a, 'b) rbt \<Rightarrow> bool\<close>),
+     (\<^const_name>\<open>rbt_sorted\<close>, SOME \<^typ>\<open>('a :: linorder, 'b) rbt \<Rightarrow> bool\<close>),
+     (\<^const_name>\<open>rbt_lookup\<close>, SOME \<^typ>\<open>('a :: linorder, 'b) rbt \<Rightarrow> 'a \<rightharpoonup> 'b\<close>),
+     (\<^const_name>\<open>is_rbt\<close>, SOME \<^typ>\<open>('a :: linorder, 'b) rbt \<Rightarrow> bool\<close>),
+     (\<^const_name>\<open>rbt_ins\<close>, SOME \<^typ>\<open>('a::linorder \<Rightarrow> 'b \<Rightarrow> 'b \<Rightarrow> 'b) \<Rightarrow> 'a \<Rightarrow> 'b \<Rightarrow> ('a,'b) rbt \<Rightarrow> ('a,'b) rbt\<close>),
+     (\<^const_name>\<open>rbt_insert_with_key\<close>, SOME \<^typ>\<open>('a::linorder \<Rightarrow> 'b \<Rightarrow> 'b \<Rightarrow> 'b) \<Rightarrow> 'a \<Rightarrow> 'b \<Rightarrow> ('a,'b) rbt \<Rightarrow> ('a,'b) rbt\<close>),
+     (\<^const_name>\<open>rbt_insert_with\<close>, SOME \<^typ>\<open>('b \<Rightarrow> 'b \<Rightarrow> 'b) \<Rightarrow> ('a :: linorder) \<Rightarrow> 'b \<Rightarrow> ('a,'b) rbt \<Rightarrow> ('a,'b) rbt\<close>),
+     (\<^const_name>\<open>rbt_insert\<close>, SOME \<^typ>\<open>('a :: linorder) \<Rightarrow> 'b \<Rightarrow> ('a,'b) rbt \<Rightarrow> ('a,'b) rbt\<close>),
+     (\<^const_name>\<open>rbt_del_from_left\<close>, SOME \<^typ>\<open>('a::linorder) \<Rightarrow> ('a,'b) rbt \<Rightarrow> 'a \<Rightarrow> 'b \<Rightarrow> ('a,'b) rbt \<Rightarrow> ('a,'b) rbt\<close>),
+     (\<^const_name>\<open>rbt_del_from_right\<close>, SOME \<^typ>\<open>('a::linorder) \<Rightarrow> ('a,'b) rbt \<Rightarrow> 'a \<Rightarrow> 'b \<Rightarrow> ('a,'b) rbt \<Rightarrow> ('a,'b) rbt\<close>),
+     (\<^const_name>\<open>rbt_del\<close>, SOME \<^typ>\<open>('a::linorder) \<Rightarrow> ('a,'b) rbt \<Rightarrow> ('a,'b) rbt\<close>),
+     (\<^const_name>\<open>rbt_delete\<close>, SOME \<^typ>\<open>('a::linorder) \<Rightarrow> ('a,'b) rbt \<Rightarrow> ('a,'b) rbt\<close>),
+     (\<^const_name>\<open>rbt_union_with_key\<close>, SOME \<^typ>\<open>('a::linorder \<Rightarrow> 'b \<Rightarrow> 'b \<Rightarrow> 'b) \<Rightarrow> ('a,'b) rbt \<Rightarrow> ('a,'b) rbt \<Rightarrow> ('a,'b) rbt\<close>),
+     (\<^const_name>\<open>rbt_union_with\<close>, SOME \<^typ>\<open>('b \<Rightarrow> 'b \<Rightarrow> 'b) \<Rightarrow> ('a::linorder,'b) rbt \<Rightarrow> ('a,'b) rbt \<Rightarrow> ('a,'b) rbt\<close>),
+     (\<^const_name>\<open>rbt_union\<close>, SOME \<^typ>\<open>('a::linorder,'b) rbt \<Rightarrow> ('a,'b) rbt \<Rightarrow> ('a,'b) rbt\<close>),
+     (\<^const_name>\<open>rbt_map_entry\<close>, SOME \<^typ>\<open>'a::linorder \<Rightarrow> ('b \<Rightarrow> 'b) \<Rightarrow> ('a,'b) rbt \<Rightarrow> ('a,'b) rbt\<close>),
+     (\<^const_name>\<open>rbt_bulkload\<close>, SOME \<^typ>\<open>('a \<times> 'b) list \<Rightarrow> ('a::linorder,'b) rbt\<close>)]
 \<close>
 
 hide_const (open) R B Empty entries keys fold gen_keys gen_entries
--- a/src/HOL/Library/RBT_Mapping.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Library/RBT_Mapping.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -113,25 +113,24 @@
 text \<open>
   This theory defines abstract red-black trees as an efficient
   representation of finite maps, backed by the implementation
-  in @{theory "HOL-Library.RBT_Impl"}.
+  in \<^theory>\<open>HOL-Library.RBT_Impl\<close>.
 \<close>
 
 subsection \<open>Data type and invariant\<close>
 
 text \<open>
-  The type @{typ "('k, 'v) RBT_Impl.rbt"} denotes red-black trees with
-  keys of type @{typ "'k"} and values of type @{typ "'v"}. To function
+  The type \<^typ>\<open>('k, 'v) RBT_Impl.rbt\<close> denotes red-black trees with
+  keys of type \<^typ>\<open>'k\<close> and values of type \<^typ>\<open>'v\<close>. To function
   properly, the key type musorted belong to the \<open>linorder\<close>
   class.
 
-  A value @{term t} of this type is a valid red-black tree if it
-  satisfies the invariant \<open>is_rbt t\<close>.  The abstract type @{typ
-  "('k, 'v) rbt"} always obeys this invariant, and for this reason you
-  should only use this in our application.  Going back to @{typ "('k,
-  'v) RBT_Impl.rbt"} may be necessary in proofs if not yet proven
+  A value \<^term>\<open>t\<close> of this type is a valid red-black tree if it
+  satisfies the invariant \<open>is_rbt t\<close>.  The abstract type \<^typ>\<open>('k, 'v) rbt\<close> always obeys this invariant, and for this reason you
+  should only use this in our application.  Going back to \<^typ>\<open>('k,
+  'v) RBT_Impl.rbt\<close> may be necessary in proofs if not yet proven
   properties about the operations must be established.
 
-  The interpretation function @{const "RBT.lookup"} returns the partial
+  The interpretation function \<^const>\<open>RBT.lookup\<close> returns the partial
   map represented by a red-black tree:
   @{term_type[display] "RBT.lookup"}
 
--- a/src/HOL/Library/Ramsey.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Library/Ramsey.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -154,11 +154,11 @@
 subsubsection \<open>Partitions of a Set\<close>
 
 definition part :: "nat \<Rightarrow> nat \<Rightarrow> 'a set \<Rightarrow> ('a set \<Rightarrow> nat) \<Rightarrow> bool"
-  \<comment> \<open>the function @{term f} partitions the @{term r}-subsets of the typically
-      infinite set @{term Y} into @{term s} distinct categories.\<close>
+  \<comment> \<open>the function \<^term>\<open>f\<close> partitions the \<^term>\<open>r\<close>-subsets of the typically
+      infinite set \<^term>\<open>Y\<close> into \<^term>\<open>s\<close> distinct categories.\<close>
   where "part r s Y f \<longleftrightarrow> (\<forall>X. X \<subseteq> Y \<and> finite X \<and> card X = r \<longrightarrow> f X < s)"
 
-text \<open>For induction, we decrease the value of @{term r} in partitions.\<close>
+text \<open>For induction, we decrease the value of \<^term>\<open>r\<close> in partitions.\<close>
 lemma part_Suc_imp_part:
   "\<lbrakk>infinite Y; part (Suc r) s Y f; y \<in> Y\<rbrakk> \<Longrightarrow> part r s (Y - {y}) (\<lambda>u. f (insert y u))"
   apply (simp add: part_def)
--- a/src/HOL/Library/Sum_of_Squares/sos_wrapper.ML	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Library/Sum_of_Squares/sos_wrapper.ML	Fri Jan 04 23:22:53 2019 +0100
@@ -71,7 +71,7 @@
         (Sum_of_Squares.Certificate (Positivstellensatz_Tools.read_cert ctxt cert)) ctxt
 
 val _ = Theory.setup
- (Method.setup @{binding sos}
+ (Method.setup \<^binding>\<open>sos\<close>
     (Scan.lift (Scan.option Parse.string)
       >> (fn arg => fn ctxt => SIMPLE_METHOD' (sos_tac ctxt arg)))
     "prove universal problems over the reals using sums of squares")
--- a/src/HOL/Library/Tree.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Library/Tree.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -100,7 +100,7 @@
   (heap l \<and> heap r \<and> (\<forall>x \<in> set_tree l \<union> set_tree r. m \<le> x))"
 
 
-subsection \<open>@{const map_tree}\<close>
+subsection \<open>\<^const>\<open>map_tree\<close>\<close>
 
 lemma eq_map_tree_Leaf[simp]: "map_tree f t = Leaf \<longleftrightarrow> t = Leaf"
 by (rule tree.map_disc_iff)
@@ -109,7 +109,7 @@
 by (cases t) auto
 
 
-subsection \<open>@{const size}\<close>
+subsection \<open>\<^const>\<open>size\<close>\<close>
 
 lemma size1_size: "size1 t = size t + 1"
 by (induction t) simp_all
@@ -133,7 +133,7 @@
 by (simp add: size1_size)
 
 
-subsection \<open>@{const set_tree}\<close>
+subsection \<open>\<^const>\<open>set_tree\<close>\<close>
 
 lemma eq_set_tree_empty[simp]: "set_tree t = {} \<longleftrightarrow> t = Leaf"
 by (cases t) auto
@@ -145,7 +145,7 @@
 by(induction t) auto
 
 
-subsection \<open>@{const subtrees}\<close>
+subsection \<open>\<^const>\<open>subtrees\<close>\<close>
 
 lemma neq_subtrees_empty[simp]: "subtrees t \<noteq> {}"
 by (cases t)(auto)
@@ -163,7 +163,7 @@
 by (metis Node_notin_subtrees_if)
 
 
-subsection \<open>@{const height} and @{const min_height}\<close>
+subsection \<open>\<^const>\<open>height\<close> and \<^const>\<open>min_height\<close>\<close>
 
 lemma eq_height_0[simp]: "height t = 0 \<longleftrightarrow> t = Leaf"
 by(cases t) auto
@@ -221,7 +221,7 @@
 qed simp
 
 
-subsection \<open>@{const complete}\<close>
+subsection \<open>\<^const>\<open>complete\<close>\<close>
 
 lemma complete_iff_height: "complete t \<longleftrightarrow> (min_height t = height t)"
 apply(induction t)
@@ -287,7 +287,7 @@
 using complete_if_size1_height size1_if_complete by blast
 
 
-subsection \<open>@{const balanced}\<close>
+subsection \<open>\<^const>\<open>balanced\<close>\<close>
 
 lemma balanced_subtreeL: "balanced (Node l x r) \<Longrightarrow> balanced l"
 by(simp add: balanced_def)
@@ -335,13 +335,13 @@
 qed
 
 
-subsection \<open>@{const wbalanced}\<close>
+subsection \<open>\<^const>\<open>wbalanced\<close>\<close>
 
 lemma wbalanced_subtrees: "\<lbrakk> wbalanced t; s \<in> subtrees t \<rbrakk> \<Longrightarrow> wbalanced s"
 using [[simp_depth_limit=1]] by(induction t arbitrary: s) auto
 
 
-subsection \<open>@{const ipl}\<close>
+subsection \<open>\<^const>\<open>ipl\<close>\<close>
 
 text \<open>The internal path length of a tree:\<close>
 
@@ -413,10 +413,10 @@
 done
 
 
-subsection \<open>@{const heap}\<close>
+subsection \<open>\<^const>\<open>heap\<close>\<close>
 
 
-subsection \<open>@{const mirror}\<close>
+subsection \<open>\<^const>\<open>mirror\<close>\<close>
 
 lemma mirror_Leaf[simp]: "mirror t = \<langle>\<rangle> \<longleftrightarrow> t = \<langle>\<rangle>"
 by (induction t) simp_all
--- a/src/HOL/Library/Tree_Multiset.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Library/Tree_Multiset.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -7,9 +7,7 @@
 begin
 
 text \<open>
-  Kept separate from theory @{theory "HOL-Library.Tree"} to avoid importing all of theory @{theory
-  "HOL-Library.Multiset"} into @{theory "HOL-Library.Tree"}. Should be merged if @{theory
-  "HOL-Library.Multiset"} ever becomes part of @{theory Main}.
+  Kept separate from theory \<^theory>\<open>HOL-Library.Tree\<close> to avoid importing all of theory \<^theory>\<open>HOL-Library.Multiset\<close> into \<^theory>\<open>HOL-Library.Tree\<close>. Should be merged if \<^theory>\<open>HOL-Library.Multiset\<close> ever becomes part of \<^theory>\<open>Main\<close>.
 \<close>
 
 fun mset_tree :: "'a tree \<Rightarrow> 'a multiset" where
--- a/src/HOL/Library/Tree_Real.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Library/Tree_Real.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -7,8 +7,8 @@
 begin
 
 text \<open>
-  This theory is separate from @{theory "HOL-Library.Tree"} because the former is discrete and
-  builds on @{theory Main} whereas this theory builds on @{theory Complex_Main}.
+  This theory is separate from \<^theory>\<open>HOL-Library.Tree\<close> because the former is discrete and
+  builds on \<^theory>\<open>Main\<close> whereas this theory builds on \<^theory>\<open>Complex_Main\<close>.
 \<close>
 
 
--- a/src/HOL/Library/Type_Length.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Library/Type_Length.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -24,9 +24,9 @@
 
 print_translation \<open>
   let
-    fun len_of_itself_tr' ctxt [Const (@{const_syntax Pure.type}, Type (_, [T]))] =
-      Syntax.const @{syntax_const "_type_length"} $ Syntax_Phases.term_of_typ ctxt T
-  in [(@{const_syntax len_of}, len_of_itself_tr')] end
+    fun len_of_itself_tr' ctxt [Const (\<^const_syntax>\<open>Pure.type\<close>, Type (_, [T]))] =
+      Syntax.const \<^syntax_const>\<open>_type_length\<close> $ Syntax_Phases.term_of_typ ctxt T
+  in [(\<^const_syntax>\<open>len_of\<close>, len_of_itself_tr')] end
 \<close>
 
 text \<open>Some theorems are only true on words with length greater 0.\<close>
--- a/src/HOL/Library/While_Combinator.thy	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Library/While_Combinator.thy	Fri Jan 04 23:22:53 2019 +0100
@@ -209,7 +209,7 @@
 
 
 text \<open>
- The proof rule for @{term while}, where @{term P} is the invariant.
+ The proof rule for \<^term>\<open>while\<close>, where \<^term>\<open>P\<close> is the invariant.
 \<close>
 
 theorem while_rule_lemma:
--- a/src/HOL/Library/adhoc_overloading.ML	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Library/adhoc_overloading.ML	Fri Jan 04 23:22:53 2019 +0100
@@ -19,7 +19,7 @@
 structure Adhoc_Overloading: ADHOC_OVERLOADING =
 struct
 
-val show_variants = Attrib.setup_config_bool @{binding show_variants} (K false);
+val show_variants = Attrib.setup_config_bool \<^binding>\<open>show_variants\<close> (K false);
 
 
 (* errors *)
@@ -233,12 +233,12 @@
   end;
 
 val _ =
-  Outer_Syntax.local_theory @{command_keyword adhoc_overloading}
+  Outer_Syntax.local_theory \<^command_keyword>\<open>adhoc_overloading\<close>
     "add adhoc overloading for constants / fixed variables"
     (Parse.and_list1 (Parse.const -- Scan.repeat Parse.term) >> adhoc_overloading_cmd true);
 
 val _ =
-  Outer_Syntax.local_theory @{command_keyword no_adhoc_overloading}
+  Outer_Syntax.local_theory \<^command_keyword>\<open>no_adhoc_overloading\<close>
     "delete adhoc overloading for constants / fixed variables"
     (Parse.and_list1 (Parse.const -- Scan.repeat Parse.term) >> adhoc_overloading_cmd false);
 
--- a/src/HOL/Library/case_converter.ML	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Library/case_converter.ML	Fri Jan 04 23:22:53 2019 +0100
@@ -21,7 +21,7 @@
 fun mk_abort msg t =
   let 
     val T = fastype_of t
-    val abort = Const (@{const_name missing_pattern_match}, HOLogic.literalT --> (HOLogic.unitT --> T) --> T)
+    val abort = Const (\<^const_name>\<open>missing_pattern_match\<close>, HOLogic.literalT --> (HOLogic.unitT --> T) --> T)
   in
     abort $ HOLogic.mk_literal msg $ absdummy HOLogic.unitT t
   end
--- a/src/HOL/Library/cconv.ML	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Library/cconv.ML	Fri Jan 04 23:22:53 2019 +0100
@@ -49,8 +49,8 @@
 
 val combination_thm =
   let
-    val fg = @{cprop "f :: 'a :: {} \<Rightarrow> 'b :: {} \<equiv> g"}
-    val st = @{cprop "s :: 'a :: {} \<equiv> t"}
+    val fg = \<^cprop>\<open>f :: 'a :: {} \<Rightarrow> 'b :: {} \<equiv> g\<close>
+    val st = \<^cprop>\<open>s :: 'a :: {} \<equiv> t\<close>
     val thm = Thm.combination (Thm.assume fg) (Thm.assume st)
       |> Thm.implies_intr st
       |> Thm.implies_intr fg
@@ -58,8 +58,8 @@
 
 fun abstract_rule_thm n =
   let
-    val eq = @{cprop "\<And>x :: 'a :: {}. (s :: 'a \<Rightarrow> 'b :: {}) x \<equiv> t x"}
-    val x = @{cterm "x :: 'a :: {}"}
+    val eq = \<^cprop>\<open>\<And>x :: 'a :: {}. (s :: 'a \<Rightarrow> 'b :: {}) x \<equiv> t x\<close>
+    val x = \<^cterm>\<open>x :: 'a :: {}\<close>
     val thm = eq
       |> Thm.assume
       |> Thm.forall_elim x
@@ -178,7 +178,7 @@
 fun prems_cconv 0 cv ct = cv ct
   | prems_cconv n cv ct =
       (case ct |> Thm.term_of of
-        (Const (@{const_name "Pure.imp"}, _) $ _) $ _ =>
+        (Const (\<^const_name>\<open>Pure.imp\<close>, _) $ _) $ _ =>
           ((if n = 1 then fun_cconv else I) o arg_cconv) (prems_cconv (n-1) cv) ct
       | _ =>  cv ct)
 
--- a/src/HOL/Library/code_lazy.ML	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Library/code_lazy.ML	Fri Jan 04 23:22:53 2019 +0100
@@ -84,10 +84,10 @@
   let
     val (name, _) = mk_name "lazy_" "" short_type_name lthy
     val freeT = HOLogic.unitT --> lazyT
-    val lazyT' = Type (@{type_name lazy}, [lazyT])
+    val lazyT' = Type (\<^type_name>\<open>lazy\<close>, [lazyT])
     val def = Logic.all_const freeT $ absdummy freeT (Logic.mk_equals (
       Free (name, (freeT --> eagerT)) $ Bound 0,
-      lazy_ctr $ (Const (@{const_name delay}, (freeT --> lazyT')) $ Bound 0)))
+      lazy_ctr $ (Const (\<^const_name>\<open>delay\<close>, (freeT --> lazyT')) $ Bound 0)))
     val (_, lthy') = Local_Theory.open_target lthy
     val ((t, (_, thm)), lthy') = Specification.definition NONE [] [] 
       ((Thm.def_binding (Binding.name name), []), def) lthy'
@@ -235,7 +235,7 @@
         val (result, lthy1) = (Typedef.add_typedef
             { overloaded=false }
             (binding, rev (Term.add_tfreesT eager_type []), Mixfix.NoSyn)
-            (Const (@{const_name "top"}, Type (@{type_name set}, [eager_type])))
+            (Const (\<^const_name>\<open>top\<close>, Type (\<^type_name>\<open>set\<close>, [eager_type])))
             NONE
             (fn ctxt => resolve_tac ctxt [@{thm UNIV_witness}] 1)
           o (Local_Theory.open_target #> snd)) lthy
@@ -270,9 +270,9 @@
       ctrs
 
     fun to_destr_eagerT typ = case typ of
-          Type (@{type_name "fun"}, [_, Type (@{type_name "fun"}, Ts)]) => 
-          to_destr_eagerT (Type (@{type_name "fun"}, Ts))
-        | Type (@{type_name "fun"}, [T, _]) => T
+          Type (\<^type_name>\<open>fun\<close>, [_, Type (\<^type_name>\<open>fun\<close>, Ts)]) => 
+          to_destr_eagerT (Type (\<^type_name>\<open>fun\<close>, Ts))
+        | Type (\<^type_name>\<open>fun\<close>, [T, _]) => T
         | _ => raise Match
     val (case', lthy4) = 
       let
@@ -299,7 +299,7 @@
         ({binding = binding, const = Const (Local_Theory.full_name lthy2 binding, T), thm = def_thm}, lthy2)
       end;
     
-    val lazy_datatype = Type (@{type_name lazy}, [lazy_type])
+    val lazy_datatype = Type (\<^type_name>\<open>lazy\<close>, [lazy_type])
     val Lazy_type = lazy_datatype --> eagerT
     val unstr_type = eagerT --> lazy_datatype
     
@@ -307,8 +307,8 @@
       if n > i then apply_bounds i (n-1) (term $ Bound (n-1))
       else term
     fun all_abs Ts t = Logic.list_all (map (pair Name.uu) Ts, t)
-    fun mk_force t = Const (@{const_name force}, lazy_datatype --> lazy_type) $ t
-    fun mk_delay t = Const (@{const_name delay}, (@{typ unit} --> lazy_type) --> lazy_datatype) $ t
+    fun mk_force t = Const (\<^const_name>\<open>force\<close>, lazy_datatype --> lazy_type) $ t
+    fun mk_delay t = Const (\<^const_name>\<open>delay\<close>, (\<^typ>\<open>unit\<close> --> lazy_type) --> lazy_datatype) $ t
 
     val lazy_ctr = all_abs [lazy_datatype]
       (Logic.mk_equals (Free (lazy_ctr_name, Lazy_type) $ Bound 0, Rep_lazy $ mk_force (Bound 0)))
@@ -316,13 +316,13 @@
 
     val lazy_sel = all_abs [eagerT]
       (Logic.mk_equals (Free (lazy_sel_name, unstr_type) $ Bound 0, 
-        mk_delay (Abs (Name.uu, @{typ unit}, Abs_lazy $ Bound 1))))
+        mk_delay (Abs (Name.uu, \<^typ>\<open>unit\<close>, Abs_lazy $ Bound 1))))
     val (lazy_sel_def, lthy6) = mk_def (lazy_sel_name, unstr_type, lazy_sel) lthy5
 
     fun mk_lazy_ctr (name, eager_ctr) =
       let
         val (_, ctrT) = dest_Const eager_ctr
-        fun to_lazy_ctrT (Type (@{type_name fun}, [T1, T2])) = T1 --> to_lazy_ctrT T2
+        fun to_lazy_ctrT (Type (\<^type_name>\<open>fun\<close>, [T1, T2])) = T1 --> to_lazy_ctrT T2
           | to_lazy_ctrT T = if T = eagerT then lazy_type else raise Match
         val lazy_ctrT = to_lazy_ctrT ctrT
         val argsT = binder_types ctrT
@@ -336,7 +336,7 @@
     val (lazy_case_def, lthy8) =
       let
         val (_, caseT) = dest_Const case'
-        fun to_lazy_caseT (Type (@{type_name fun}, [T1, T2])) =
+        fun to_lazy_caseT (Type (\<^type_name>\<open>fun\<close>, [T1, T2])) =
             if T1 = eagerT then lazy_type --> T2 else T1 --> to_lazy_caseT T2
         val lazy_caseT = to_lazy_caseT caseT
         val argsT = binder_types lazy_caseT
@@ -379,7 +379,7 @@
 
     val mk_Lazy_delay_eq =
       (#const lazy_ctr_def $ mk_delay (Bound 0), Rep_lazy $ (Bound 0 $ @{const Unity}))
-      |> mk_eq |> all_abs [@{typ unit} --> lazy_type]
+      |> mk_eq |> all_abs [\<^typ>\<open>unit\<close> --> lazy_type]
     val (Lazy_delay_thm, lthy8a) = mk_thm 
       ((Lazy_delay_eq_name, mk_Lazy_delay_eq), [#thm lazy_ctr_def, @{thm force_delay}])
       lthy8
@@ -406,7 +406,7 @@
         val n = length argsT
         val lhs = apply_bounds 0 n eager_ctr
         val rhs = #const lazy_ctr_def $ 
-          (mk_delay (Abs (Name.uu, @{typ unit}, apply_bounds 1 (n + 1) lazy_ctr)))
+          (mk_delay (Abs (Name.uu, \<^typ>\<open>unit\<close>, apply_bounds 1 (n + 1) lazy_ctr)))
       in
         (lhs, rhs) |> mk_eq |> all_abs argsT
       end
@@ -493,7 +493,7 @@
 
     val delay_dummy_thm = (pat_def_thm RS @{thm symmetric})
       |> Drule.infer_instantiate' lthy10
-         [SOME (Thm.cterm_of lthy10 (Const (@{const_name "Pure.dummy_pattern"}, HOLogic.unitT --> lazy_type)))]
+         [SOME (Thm.cterm_of lthy10 (Const (\<^const_name>\<open>Pure.dummy_pattern\<close>, HOLogic.unitT --> lazy_type)))]
       |> Thm.generalize (map (fst o dest_TFree) type_args, []) (Variable.maxidx_of lthy10 + 1);
 
     val ctr_post = delay_dummy_thm :: map (fn thm => thm RS @{thm sym}) ctrs_lazy_thms
@@ -552,7 +552,7 @@
 
       val ((code_eqs, nbe_eqs), pure) =
         ((case hd eqs |> fst |> Thm.prop_of of
-            Const (@{const_name Pure.eq}, _) $ _ $ _ =>
+            Const (\<^const_name>\<open>Pure.eq\<close>, _) $ _ $ _ =>
               (map (apfst (fn x => x RS @{thm meta_eq_to_obj_eq})) eqs, true)
          | _ => (eqs, false))
         |> apfst (List.partition snd))
@@ -600,7 +600,7 @@
           Syntax.pretty_term ctxt (#destr info),
           Pretty.str ":",
           Pretty.brk 1,
-          Syntax.pretty_typ ctxt (Type (@{type_name lazy}, [#lazyT info])),
+          Syntax.pretty_typ ctxt (Type (\<^type_name>\<open>lazy\<close>, [#lazyT info])),
           Pretty.str ")"
         ]
       ],
@@ -633,27 +633,27 @@
 
 
 val _ =
-  Outer_Syntax.command @{command_keyword code_lazy_type}
+  Outer_Syntax.command \<^command_keyword>\<open>code_lazy_type\<close>
     "make a lazy copy of the datatype and activate substitution"
     (Parse.binding >> (fn b => Toplevel.theory (Binding.name_of b |> code_lazy_type)));
 val _ =
-  Outer_Syntax.command @{command_keyword activate_lazy_type}
+  Outer_Syntax.command \<^command_keyword>\<open>activate_lazy_type\<close>
     "activate substitution on a specific (lazy) type"
     (Parse.binding >> (fn b => Toplevel.theory (Binding.name_of b |> activate_lazy_type)));
 val _ =
-  Outer_Syntax.command @{command_keyword deactivate_lazy_type}
+  Outer_Syntax.command \<^command_keyword>\<open>deactivate_lazy_type\<close>
     "deactivate substitution on a specific (lazy) type"
     (Parse.binding >> (fn b => Toplevel.theory (Binding.name_of b |> deactivate_lazy_type)));
 val _ =
-  Outer_Syntax.command @{command_keyword activate_lazy_types}
+  Outer_Syntax.command \<^command_keyword>\<open>activate_lazy_types\<close>
     "activate substitution on all (lazy) types"
     (pair (Toplevel.theory activate_lazy_types));
 val _ =
-  Outer_Syntax.command @{command_keyword deactivate_lazy_types}
+  Outer_Syntax.command \<^command_keyword>\<open>deactivate_lazy_types\<close>
     "deactivate substitution on all (lazy) type"
     (pair (Toplevel.theory deactivate_lazy_types));
 val _ =
-  Outer_Syntax.command @{command_keyword print_lazy_types}
+  Outer_Syntax.command \<^command_keyword>\<open>print_lazy_types\<close>
     "print the types that have been declared as lazy and their substitution state"
     (pair (Toplevel.theory (tap print_lazy_types)));
 
--- a/src/HOL/Library/code_test.ML	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Library/code_test.ML	Fri Jan 04 23:22:53 2019 +0100
@@ -41,11 +41,11 @@
 
 (* convert a list of terms into nested tuples and back *)
 
-fun mk_tuples [] = @{term "()"}
+fun mk_tuples [] = \<^term>\<open>()\<close>
   | mk_tuples [t] = t
   | mk_tuples (t :: ts) = HOLogic.mk_prod (t, mk_tuples ts)
 
-fun dest_tuples (Const (@{const_name Pair}, _) $ l $ r) = l :: dest_tuples r
+fun dest_tuples (Const (\<^const_name>\<open>Pair\<close>, _) $ l $ r) = l :: dest_tuples r
   | dest_tuples t = [t]
 
 
@@ -146,7 +146,7 @@
 
 (* driver invocation *)
 
-val overlord = Attrib.setup_config_bool @{binding "code_test_overlord"} (K false)
+val overlord = Attrib.setup_config_bool \<^binding>\<open>code_test_overlord\<close> (K false)
 
 fun with_overlord_dir name f =
   let
@@ -174,40 +174,40 @@
 
 (* term preprocessing *)
 
-fun add_eval (Const (@{const_name Trueprop}, _) $ t) = add_eval t
-  | add_eval (Const (@{const_name "HOL.eq"}, _) $ lhs $ rhs) = (fn acc =>
+fun add_eval (Const (\<^const_name>\<open>Trueprop\<close>, _) $ t) = add_eval t
+  | add_eval (Const (\<^const_name>\<open>HOL.eq\<close>, _) $ lhs $ rhs) = (fn acc =>
       acc
       |> add_eval rhs
       |> add_eval lhs
       |> cons rhs
       |> cons lhs)
-  | add_eval (Const (@{const_name "Not"}, _) $ t) = add_eval t
-  | add_eval (Const (@{const_name "Orderings.ord_class.less_eq"}, _) $ lhs $ rhs) = (fn acc =>
+  | add_eval (Const (\<^const_name>\<open>Not\<close>, _) $ t) = add_eval t
+  | add_eval (Const (\<^const_name>\<open>Orderings.ord_class.less_eq\<close>, _) $ lhs $ rhs) = (fn acc =>
       lhs :: rhs :: acc)
-  | add_eval (Const (@{const_name "Orderings.ord_class.less"}, _) $ lhs $ rhs) = (fn acc =>
+  | add_eval (Const (\<^const_name>\<open>Orderings.ord_class.less\<close>, _) $ lhs $ rhs) = (fn acc =>
       lhs :: rhs :: acc)
   | add_eval _ = I
 
-fun mk_term_of [] = @{term "None :: (unit \<Rightarrow> yxml_of_term) option"}
+fun mk_term_of [] = \<^term>\<open>None :: (unit \<Rightarrow> yxml_of_term) option\<close>
   | mk_term_of ts =
       let
         val tuple = mk_tuples ts
         val T = fastype_of tuple
       in
-        @{term "Some :: (unit \<Rightarrow> yxml_of_term) \<Rightarrow> (unit \<Rightarrow> yxml_of_term) option"} $
-          (absdummy @{typ unit} (@{const yxml_string_of_term} $
-            (Const (@{const_name Code_Evaluation.term_of}, T --> @{typ term}) $ tuple)))
+        \<^term>\<open>Some :: (unit \<Rightarrow> yxml_of_term) \<Rightarrow> (unit \<Rightarrow> yxml_of_term) option\<close> $
+          (absdummy \<^typ>\<open>unit\<close> (@{const yxml_string_of_term} $
+            (Const (\<^const_name>\<open>Code_Evaluation.term_of\<close>, T --> \<^typ>\<open>term\<close>) $ tuple)))
       end
 
 fun test_terms ctxt ts target =
   let
     val thy = Proof_Context.theory_of ctxt
 
-    fun term_of t = Sign.of_sort thy (fastype_of t, @{sort term_of})
+    fun term_of t = Sign.of_sort thy (fastype_of t, \<^sort>\<open>term_of\<close>)
 
     fun ensure_bool t =
       (case fastype_of t of
-        @{typ bool} => ()
+        \<^typ>\<open>bool\<close> => ()
       | _ =>
         error (Pretty.string_of
           (Pretty.block [Pretty.str "Test case not of type bool:", Pretty.brk 1,
@@ -219,7 +219,7 @@
     val eval = map mk_term_of evals
 
     val t =
-      HOLogic.mk_list @{typ "bool \<times> (unit \<Rightarrow> yxml_of_term) option"}
+      HOLogic.mk_list \<^typ>\<open>bool \<times> (unit \<Rightarrow> yxml_of_term) option\<close>
         (map HOLogic.mk_prod (ts ~~ eval))
 
     val result = dynamic_value_strict ctxt t target
@@ -261,13 +261,13 @@
 
     val T = fastype_of t
     val _ =
-      if Sign.of_sort (Proof_Context.theory_of ctxt) (T, @{sort term_of}) then ()
+      if Sign.of_sort (Proof_Context.theory_of ctxt) (T, \<^sort>\<open>term_of\<close>) then ()
       else error ("Type " ^ Syntax.string_of_typ ctxt T ^
-       " of term not of sort " ^ Syntax.string_of_sort ctxt @{sort term_of})
+       " of term not of sort " ^ Syntax.string_of_sort ctxt \<^sort>\<open>term_of\<close>)
 
     val t' =
-      HOLogic.mk_list @{typ "bool \<times> (unit \<Rightarrow> yxml_of_term) option"}
-        [HOLogic.mk_prod (@{term "False"}, mk_term_of [t])]
+      HOLogic.mk_list \<^typ>\<open>bool \<times> (unit \<Rightarrow> yxml_of_term) option\<close>
+        [HOLogic.mk_prod (\<^term>\<open>False\<close>, mk_term_of [t])]
 
     val result = dynamic_value_strict ctxt t' target
   in (case result of [(_, SOME [t])] => t | _ => error "Evaluation failed") end
@@ -484,7 +484,7 @@
 val ghcN = "GHC"
 val ISABELLE_GHC = "ISABELLE_GHC"
 
-val ghc_options = Attrib.setup_config_string @{binding code_test_ghc} (K "")
+val ghc_options = Attrib.setup_config_string \<^binding>\<open>code_test_ghc\<close> (K "")
 
 fun mk_driver_ghc ctxt path modules value_name =
   let
@@ -573,9 +573,9 @@
 (* command setup *)
 
 val _ =
-  Outer_Syntax.command @{command_keyword test_code}
+  Outer_Syntax.command \<^command_keyword>\<open>test_code\<close>
     "compile test cases to target languages, execute them and report results"
-      (Scan.repeat1 Parse.prop -- (@{keyword "in"} |-- Scan.repeat1 Parse.name)
+      (Scan.repeat1 Parse.prop -- (\<^keyword>\<open>in\<close> |-- Scan.repeat1 Parse.name)
         >> (fn (ts, targets) => Toplevel.keep (test_code_cmd ts targets o Toplevel.context_of)))
 
 val target_Scala = "Scala_eval"
--- a/src/HOL/Library/conditional_parametricity.ML	Fri Jan 04 21:49:06 2019 +0100
+++ b/src/HOL/Library/conditional_parametricity.ML	Fri Jan 04 23:22:53 2019 +0100
@@ -125,7 +125,7 @@
       let
         fun is_correct_rule t =
           (case t of
-            Const (@{const_name "HOL.Trueprop"}, _) $ (Const (@{const_name "Transfer.Rel"}, _) $
+            Const (\<^const_name>\<open>HOL.Trueprop\<close>, _) $ (Const (\<^const_name>\<open>Transfer.Rel\<close>, _) $
               _ $ Bound x' $ Bound y') => x = x' andalso y = y'
           | _ => false);
         val idx = find_index is_correct_rule (t |> Logic.strip_assums_hyp);
@@ -186,12 +186,12 @@
 
 fun step_tac' settings ctxt parametricity_thms (tm, i) =
   (case tm |> Logic.strip_assums_concl of
-    Const (@{const_name "HOL.Trueprop"}, _) $ (Const (rel, _) $ _ $ t $ u) =>
+    Const (\<^const_name>\<open>HOL.Trueprop\<close>, _) $ (Const (rel, _) $ _ $ t $ u) =>
     let
       val (arity_of_t, arity_of_u) = apply2 (strip_comb #> snd #> length) (t, u);
     in
       (case rel of
-        @{const_name "Transfer.Rel"} =>
+        \<^const_name>\<open>Transfer.Rel\<close> =>
           (case (head_of t, head_of u) of
             (Abs _, _) => rel_abs_tac ctxt
           | (_, Abs _) => rel_abs_tac ctxt
@@ -210,11 +210,11 @@
             else  error_tac' ctxt "Malformed term. Arities of t and u don't match."
           | _ => error_tac' ctxt
             "Unexpected format. Expected  (Abs _, _), (_, Abs _), (Const _, Const _) or (Bound _, Bound _).")
-         | @{const_name "Conditional_Parametricity.Rel_match"} =>
+         | \<^const_name>\<open>Conditional_Parametricity.Rel_match\<close> =>
              parametricity_thm_match_tac ctxt parametricity_thms arity_of_t
       | _ => error_tac' ctxt "Unexpected format. Expected Transfer.Rel or Rel_match marker." ) i
     end
-    | Const (@{const_name "HOL.Trueprop"}, _) $ (Const (@{const_name "Transfer.is_equality"}, _) $ _) =>
+    | Const (\<^const_name>\<open>HOL.Trueprop\<close>, _) $ (Const (\<^const_name>\<open>Transfer.is_equality\<close>, _) $ _) =>
         Transfer.eq_tac ctxt i
     | _ => error_tac' ctxt "Unexpected format. Not of form Const (HOL.Trueprop, _) $ _" i);
 
@@ -227,8 +227,8 @@
 (* Goal Generation  *)
 fun strip_boundvars_from_rel_match t =
   (case t of
-    (Tp as Const (@{const_name "HOL.Trueprop"}, _)) $
-      ((Rm as Const (@{const_name "Conditional_Parametricity.Rel_match"}, _)) $ R $ t $ t') =>
+    (Tp as Const (\<^const_name>\<open>HOL.Trueprop\<close>, _)) $
+      ((Rm as Const (\<^const_name>\<open>Conditional_Parametricity.Rel_match\<close>, _)) $ R $ t $ t') =>
         Tp $ (Rm $ apply_Var_to_bounds R $ t $ t')
   | _ => t);
 
@@ -251,9 +251,9 @@
     val u = subst_atomic_types ((map TVar tvars) ~~ new_frees) t;
     val T = fastype_of t;
     val U = fastype_of u;
-    val R = [T,U] ---> @{typ bool}
+    val R = [T,U] ---> \<^typ>\<open>bool\<close>
     val r = Var (("R", 2 * i), R);
-    val transfer_rel = Const (@{const_name "Transfer.Rel"}, [R,T,U] ---> @{typ bool});
+    val transfer_rel = Const (\<^const_name>\<open>Transfer.Rel\<close>, [R,T,U] ---> \<^typ>\<open>bool\<close>);
   in HOLogic.mk_Trueprop (transfer_rel $ r $ t $ u) end;
 
 fun mk_abs_helper T t =
@@ -294,14 +294,14 @@
   let
     val t =
       (case Thm.full_prop_of thm of
-        (Const (@{const_name "Pure.eq"}, _) $ t' $ _) => t'
+        (Const (\<^const_name>\<open>Pure.eq\<close>, _) $ t' $ _) => t'
       | _ => t