# HG changeset patch # User wenzelm # Date 1452722826 -3600 # Node ID 8ffc4d0e652dd3c40fd474eacf725493b2fdd0a2 # Parent fae6233c5f37ca25ef5317e92b7b8a473d8721d4 isabelle update_cartouches -c -t; diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/HOLCF/Adm.thy --- a/src/HOL/HOLCF/Adm.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/HOLCF/Adm.thy Wed Jan 13 23:07:06 2016 +0100 @@ -2,7 +2,7 @@ Author: Franz Regensburger and Brian Huffman *) -section {* Admissibility and compactness *} +section \Admissibility and compactness\ theory Adm imports Cont @@ -10,7 +10,7 @@ default_sort cpo -subsection {* Definitions *} +subsection \Definitions\ definition adm :: "('a::cpo \ bool) \ bool" where @@ -29,14 +29,14 @@ lemma triv_admI: "\x. P x \ adm P" by (rule admI, erule spec) -subsection {* Admissibility on chain-finite types *} +subsection \Admissibility on chain-finite types\ -text {* For chain-finite (easy) types every formula is admissible. *} +text \For chain-finite (easy) types every formula is admissible.\ lemma adm_chfin [simp]: "adm (P::'a::chfin \ bool)" by (rule admI, frule chfin, auto simp add: maxinch_is_thelub) -subsection {* Admissibility of special formulae and propagation *} +subsection \Admissibility of special formulae and propagation\ lemma adm_const [simp]: "adm (\x. t)" by (rule admI, simp) @@ -53,7 +53,7 @@ "(\y. y \ A \ adm (\x. P x y)) \ adm (\x. \y\A. P x y)" by (fast intro: admI elim: admD) -text {* Admissibility for disjunction is hard to prove. It requires 2 lemmas. *} +text \Admissibility for disjunction is hard to prove. It requires 2 lemmas.\ lemma adm_disj_lemma1: assumes adm: "adm P" @@ -108,7 +108,7 @@ \ adm (\x. P x = Q x)" by (subst iff_conv_conj_imp, rule adm_conj) -text {* admissibility and continuity *} +text \admissibility and continuity\ lemma adm_below [simp]: "\cont (\x. u x); cont (\x. v x)\ \ adm (\x. u x \ v x)" @@ -124,7 +124,7 @@ lemma adm_not_below [simp]: "cont (\x. t x) \ adm (\x. t x \ u)" by (rule admI, simp add: cont2contlubE ch2ch_cont lub_below_iff) -subsection {* Compactness *} +subsection \Compactness\ definition compact :: "'a::cpo \ bool" where @@ -161,7 +161,7 @@ apply (erule (1) below_trans [OF is_ub_thelub]) done -text {* admissibility and compactness *} +text \admissibility and compactness\ lemma adm_compact_not_below [simp]: "\compact k; cont (\x. t x)\ \ adm (\x. k \ t x)" @@ -178,7 +178,7 @@ lemma compact_bottom [simp, intro]: "compact \" by (rule compactI, simp) -text {* Any upward-closed predicate is admissible. *} +text \Any upward-closed predicate is admissible.\ lemma adm_upward: assumes P: "\x y. \P x; x \ y\ \ P y" diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/HOLCF/Algebraic.thy --- a/src/HOL/HOLCF/Algebraic.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/HOLCF/Algebraic.thy Wed Jan 13 23:07:06 2016 +0100 @@ -2,7 +2,7 @@ Author: Brian Huffman *) -section {* Algebraic deflations *} +section \Algebraic deflations\ theory Algebraic imports Universal Map_Functions @@ -10,7 +10,7 @@ default_sort bifinite -subsection {* Type constructor for finite deflations *} +subsection \Type constructor for finite deflations\ typedef 'a fin_defl = "{d::'a \ 'a. finite_deflation d}" by (fast intro: finite_deflation_bottom) @@ -72,7 +72,7 @@ using finite_deflation_Rep_fin_defl by (rule finite_deflation_imp_compact) -subsection {* Defining algebraic deflations by ideal completion *} +subsection \Defining algebraic deflations by ideal completion\ typedef 'a defl = "{S::'a fin_defl set. below.ideal S}" by (rule below.ex_ideal) @@ -132,7 +132,7 @@ using defl_principal_def fin_defl_countable by (rule below.typedef_ideal_completion) -text {* Algebraic deflations are pointed *} +text \Algebraic deflations are pointed\ lemma defl_minimal: "defl_principal (Abs_fin_defl \) \ x" apply (induct x rule: defl.principal_induct, simp) @@ -147,7 +147,7 @@ lemma inst_defl_pcpo: "\ = defl_principal (Abs_fin_defl \)" by (rule defl_minimal [THEN bottomI, symmetric]) -subsection {* Applying algebraic deflations *} +subsection \Applying algebraic deflations\ definition cast :: "'a defl \ 'a \ 'a" @@ -215,7 +215,7 @@ lemma cast_strict2 [simp]: "cast\A\\ = \" by (rule cast.below [THEN bottomI]) -subsection {* Deflation combinators *} +subsection \Deflation combinators\ definition "defl_fun1 e p f = diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/HOLCF/Bifinite.thy --- a/src/HOL/HOLCF/Bifinite.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/HOLCF/Bifinite.thy Wed Jan 13 23:07:06 2016 +0100 @@ -2,7 +2,7 @@ Author: Brian Huffman *) -section {* Profinite and bifinite cpos *} +section \Profinite and bifinite cpos\ theory Bifinite imports Map_Functions "~~/src/HOL/Library/Countable" @@ -10,7 +10,7 @@ default_sort cpo -subsection {* Chains of finite deflations *} +subsection \Chains of finite deflations\ locale approx_chain = fixes approx :: "nat \ 'a \ 'a" @@ -43,7 +43,7 @@ end -subsection {* Omega-profinite and bifinite domains *} +subsection \Omega-profinite and bifinite domains\ class bifinite = pcpo + assumes bifinite: "\(a::nat \ 'a \ 'a). approx_chain a" @@ -51,7 +51,7 @@ class profinite = cpo + assumes profinite: "\(a::nat \ 'a\<^sub>\ \ 'a\<^sub>\). approx_chain a" -subsection {* Building approx chains *} +subsection \Building approx chains\ lemma approx_chain_iso: assumes a: "approx_chain a" @@ -102,7 +102,7 @@ using assms unfolding approx_chain_def by (simp add: lub_APP prod_map_ID finite_deflation_prod_map) -text {* Approx chains for countable discrete types. *} +text \Approx chains for countable discrete types.\ definition discr_approx :: "nat \ 'a::countable discr u \ 'a discr u" where "discr_approx = (\i. \(up\x). if to_nat (undiscr x) < i then up\x else \)" @@ -152,7 +152,7 @@ using chain_discr_approx lub_discr_approx finite_deflation_discr_approx by (rule approx_chain.intro) -subsection {* Class instance proofs *} +subsection \Class instance proofs\ instance bifinite \ profinite proof @@ -164,9 +164,9 @@ instance u :: (profinite) bifinite by standard (rule profinite) -text {* +text \ Types @{typ "'a \ 'b"} and @{typ "'a u \! 'b"} are isomorphic. -*} +\ definition "encode_cfun = (\ f. sfun_abs\(fup\f))" @@ -194,9 +194,9 @@ by - (rule exI) qed -text {* +text \ Types @{typ "('a * 'b) u"} and @{typ "'a u \ 'b u"} are isomorphic. -*} +\ definition "encode_prod_u = (\(up\(x, y)). (:up\x, up\y:))" diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/HOLCF/Cfun.thy --- a/src/HOL/HOLCF/Cfun.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/HOLCF/Cfun.thy Wed Jan 13 23:07:06 2016 +0100 @@ -3,7 +3,7 @@ Author: Brian Huffman *) -section {* The type of continuous functions *} +section \The type of continuous functions\ theory Cfun imports Cpodef Fun_Cpo Product_Cpo @@ -11,7 +11,7 @@ default_sort cpo -subsection {* Definition of continuous function type *} +subsection \Definition of continuous function type\ definition "cfun = {f::'a => 'b. cont f}" @@ -28,22 +28,22 @@ Rep_cfun ("(_\/_)" [999,1000] 999) -subsection {* Syntax for continuous lambda abstraction *} +subsection \Syntax for continuous lambda abstraction\ syntax "_cabs" :: "[logic, logic] \ logic" -parse_translation {* +parse_translation \ (* rewrite (_cabs x t) => (Abs_cfun (%x. t)) *) [Syntax_Trans.mk_binder_tr (@{syntax_const "_cabs"}, @{const_syntax Abs_cfun})]; -*} +\ -print_translation {* +print_translation \ [(@{const_syntax Abs_cfun}, fn _ => fn [Abs abs] => let val (x, t) = Syntax_Trans.atomic_abs_tr' abs in Syntax.const @{syntax_const "_cabs"} $ x $ t end)] -*} -- {* To avoid eta-contraction of body *} +\ \ \To avoid eta-contraction of body\ -text {* Syntax for nested abstractions *} +text \Syntax for nested abstractions\ syntax (ASCII) "_Lambda" :: "[cargs, logic] \ logic" ("(3LAM _./ _)" [1000, 10] 10) @@ -51,7 +51,7 @@ syntax "_Lambda" :: "[cargs, logic] \ logic" ("(3\ _./ _)" [1000, 10] 10) -parse_ast_translation {* +parse_ast_translation \ (* rewrite (LAM x y z. t) => (_cabs x (_cabs y (_cabs z t))) *) (* cf. Syntax.lambda_ast_tr from src/Pure/Syntax/syn_trans.ML *) let @@ -60,9 +60,9 @@ (Ast.unfold_ast @{syntax_const "_cargs"} (Ast.strip_positions pats), body) | Lambda_ast_tr asts = raise Ast.AST ("Lambda_ast_tr", asts); in [(@{syntax_const "_Lambda"}, K Lambda_ast_tr)] end; -*} +\ -print_ast_translation {* +print_ast_translation \ (* rewrite (_cabs x (_cabs y (_cabs z t))) => (LAM x y z. t) *) (* cf. Syntax.abs_ast_tr' from src/Pure/Syntax/syn_trans.ML *) let @@ -74,13 +74,13 @@ [Ast.Constant @{syntax_const "_Lambda"}, Ast.fold_ast @{syntax_const "_cargs"} xs, body]); in [(@{syntax_const "_cabs"}, K cabs_ast_tr')] end -*} +\ -text {* Dummy patterns for continuous abstraction *} +text \Dummy patterns for continuous abstraction\ translations "\ _. t" => "CONST Abs_cfun (\ _. t)" -subsection {* Continuous function space is pointed *} +subsection \Continuous function space is pointed\ lemma bottom_cfun: "\ \ cfun" by (simp add: cfun_def inst_fun_pcpo) @@ -97,7 +97,7 @@ lemmas Abs_cfun_strict = typedef_Abs_strict [OF type_definition_cfun below_cfun_def bottom_cfun] -text {* function application is strict in its first argument *} +text \function application is strict in its first argument\ lemma Rep_cfun_strict1 [simp]: "\\x = \" by (simp add: Rep_cfun_strict) @@ -105,13 +105,13 @@ lemma LAM_strict [simp]: "(\ x. \) = \" by (simp add: inst_fun_pcpo [symmetric] Abs_cfun_strict) -text {* for compatibility with old HOLCF-Version *} +text \for compatibility with old HOLCF-Version\ lemma inst_cfun_pcpo: "\ = (\ x. \)" by simp -subsection {* Basic properties of continuous functions *} +subsection \Basic properties of continuous functions\ -text {* Beta-equality for continuous functions *} +text \Beta-equality for continuous functions\ lemma Abs_cfun_inverse2: "cont f \ Rep_cfun (Abs_cfun f) = f" by (simp add: Abs_cfun_inverse cfun_def) @@ -119,25 +119,25 @@ lemma beta_cfun: "cont f \ (\ x. f x)\u = f u" by (simp add: Abs_cfun_inverse2) -text {* Beta-reduction simproc *} +text \Beta-reduction simproc\ -text {* +text \ Given the term @{term "(\ x. f x)\y"}, the procedure tries to construct the theorem @{term "(\ x. f x)\y == f y"}. If this theorem cannot be completely solved by the cont2cont rules, then - the procedure returns the ordinary conditional @{text beta_cfun} + the procedure returns the ordinary conditional \beta_cfun\ rule. The simproc does not solve any more goals that would be solved by - using @{text beta_cfun} as a simp rule. The advantage of the + using \beta_cfun\ as a simp rule. The advantage of the simproc is that it can avoid deeply-nested calls to the simplifier that would otherwise be caused by large continuity side conditions. - Update: The simproc now uses rule @{text Abs_cfun_inverse2} instead - of @{text beta_cfun}, to avoid problems with eta-contraction. -*} + Update: The simproc now uses rule \Abs_cfun_inverse2\ instead + of \beta_cfun\, to avoid problems with eta-contraction. +\ -simproc_setup beta_cfun_proc ("Rep_cfun (Abs_cfun f)") = {* +simproc_setup beta_cfun_proc ("Rep_cfun (Abs_cfun f)") = \ fn phi => fn ctxt => fn ct => let val dest = Thm.dest_comb; @@ -148,14 +148,14 @@ val rules = Named_Theorems.get ctxt @{named_theorems cont2cont}; val tac = SOLVED' (REPEAT_ALL_NEW (match_tac ctxt (rev rules))); in SOME (perhaps (SINGLE (tac 1)) tr) end -*} +\ -text {* Eta-equality for continuous functions *} +text \Eta-equality for continuous functions\ lemma eta_cfun: "(\ x. f\x) = f" by (rule Rep_cfun_inverse) -text {* Extensionality for continuous functions *} +text \Extensionality for continuous functions\ lemma cfun_eq_iff: "f = g \ (\x. f\x = g\x)" by (simp add: Rep_cfun_inject [symmetric] fun_eq_iff) @@ -163,7 +163,7 @@ lemma cfun_eqI: "(\x. f\x = g\x) \ f = g" by (simp add: cfun_eq_iff) -text {* Extensionality wrt. ordering for continuous functions *} +text \Extensionality wrt. ordering for continuous functions\ lemma cfun_below_iff: "f \ g \ (\x. f\x \ g\x)" by (simp add: below_cfun_def fun_below_iff) @@ -171,7 +171,7 @@ lemma cfun_belowI: "(\x. f\x \ g\x) \ f \ g" by (simp add: cfun_below_iff) -text {* Congruence for continuous function application *} +text \Congruence for continuous function application\ lemma cfun_cong: "\f = g; x = y\ \ f\x = g\y" by simp @@ -182,7 +182,7 @@ lemma cfun_arg_cong: "x = y \ f\x = f\y" by simp -subsection {* Continuity of application *} +subsection \Continuity of application\ lemma cont_Rep_cfun1: "cont (\f. f\x)" by (rule cont_Rep_cfun [OF cont_id, THEN cont2cont_fun]) @@ -197,7 +197,7 @@ lemmas monofun_Rep_cfun1 = cont_Rep_cfun1 [THEN cont2mono] lemmas monofun_Rep_cfun2 = cont_Rep_cfun2 [THEN cont2mono] -text {* contlub, cont properties of @{term Rep_cfun} in each argument *} +text \contlub, cont properties of @{term Rep_cfun} in each argument\ lemma contlub_cfun_arg: "chain Y \ f\(\i. Y i) = (\i. f\(Y i))" by (rule cont_Rep_cfun2 [THEN cont2contlubE]) @@ -205,7 +205,7 @@ lemma contlub_cfun_fun: "chain F \ (\i. F i)\x = (\i. F i\x)" by (rule cont_Rep_cfun1 [THEN cont2contlubE]) -text {* monotonicity of application *} +text \monotonicity of application\ lemma monofun_cfun_fun: "f \ g \ f\x \ g\x" by (simp add: cfun_below_iff) @@ -216,7 +216,7 @@ lemma monofun_cfun: "\f \ g; x \ y\ \ f\x \ g\y" by (rule below_trans [OF monofun_cfun_fun monofun_cfun_arg]) -text {* ch2ch - rules for the type @{typ "'a -> 'b"} *} +text \ch2ch - rules for the type @{typ "'a -> 'b"}\ lemma chain_monofun: "chain Y \ chain (\i. f\(Y i))" by (erule monofun_Rep_cfun2 [THEN ch2ch_monofun]) @@ -235,7 +235,7 @@ "\\x. chain (\i. S i x); \i. cont (\x. S i x)\ \ chain (\i. \ x. S i x)" by (simp add: chain_def cfun_below_iff) -text {* contlub, cont properties of @{term Rep_cfun} in both arguments *} +text \contlub, cont properties of @{term Rep_cfun} in both arguments\ lemma lub_APP: "\chain F; chain Y\ \ (\i. F i\(Y i)) = (\i. F i)\(\i. Y i)" @@ -248,7 +248,7 @@ lemmas lub_distribs = lub_APP lub_LAM -text {* strictness *} +text \strictness\ lemma strictI: "f\x = \ \ f\\ = \" apply (rule bottomI) @@ -256,14 +256,14 @@ apply (rule minimal [THEN monofun_cfun_arg]) done -text {* type @{typ "'a -> 'b"} is chain complete *} +text \type @{typ "'a -> 'b"} is chain complete\ lemma lub_cfun: "chain F \ (\i. F i) = (\ x. \i. F i\x)" by (simp add: lub_cfun lub_fun ch2ch_lambda) -subsection {* Continuity simplification procedure *} +subsection \Continuity simplification procedure\ -text {* cont2cont lemma for @{term Rep_cfun} *} +text \cont2cont lemma for @{term Rep_cfun}\ lemma cont2cont_APP [simp, cont2cont]: assumes f: "cont (\x. f x)" @@ -276,10 +276,10 @@ using t cont_Rep_cfun2 1 by (rule cont_apply) qed -text {* +text \ Two specific lemmas for the combination of LCF and HOL terms. These lemmas are needed in theories that use types like @{typ "'a \ 'b \ 'c"}. -*} +\ lemma cont_APP_app [simp]: "\cont f; cont g\ \ cont (\x. ((f x)\(g x)) s)" by (rule cont2cont_APP [THEN cont2cont_fun]) @@ -288,19 +288,19 @@ by (rule cont_APP_app [THEN cont2cont_fun]) -text {* cont2mono Lemma for @{term "%x. LAM y. c1(x)(y)"} *} +text \cont2mono Lemma for @{term "%x. LAM y. c1(x)(y)"}\ lemma cont2mono_LAM: "\\x. cont (\y. f x y); \y. monofun (\x. f x y)\ \ monofun (\x. \ y. f x y)" unfolding monofun_def cfun_below_iff by simp -text {* cont2cont Lemma for @{term "%x. LAM y. f x y"} *} +text \cont2cont Lemma for @{term "%x. LAM y. f x y"}\ -text {* +text \ Not suitable as a cont2cont rule, because on nested lambdas it causes exponential blow-up in the number of subgoals. -*} +\ lemma cont2cont_LAM: assumes f1: "\x. cont (\y. f x y)" @@ -312,10 +312,10 @@ from f2 show "cont f" by (rule cont2cont_lambda) qed -text {* +text \ This version does work as a cont2cont rule, since it has only a single subgoal. -*} +\ lemma cont2cont_LAM' [simp, cont2cont]: fixes f :: "'a::cpo \ 'b::cpo \ 'c::cpo" @@ -327,15 +327,15 @@ "(\y::'a::discrete_cpo. cont (\x. f x y)) \ cont (\x. \ y. f x y)" by (simp add: cont2cont_LAM) -subsection {* Miscellaneous *} +subsection \Miscellaneous\ -text {* Monotonicity of @{term Abs_cfun} *} +text \Monotonicity of @{term Abs_cfun}\ lemma monofun_LAM: "\cont f; cont g; \x. f x \ g x\ \ (\ x. f x) \ (\ x. g x)" by (simp add: cfun_below_iff) -text {* some lemmata for functions with flat/chfin domain/range types *} +text \some lemmata for functions with flat/chfin domain/range types\ lemma chfin_Rep_cfunR: "chain (Y::nat => 'a::cpo->'b::chfin) ==> !s. ? n. (LUB i. Y i)$s = Y n$s" @@ -348,9 +348,9 @@ lemma adm_chfindom: "adm (\(u::'a::cpo \ 'b::chfin). P(u\s))" by (rule adm_subst, simp, rule adm_chfin) -subsection {* Continuous injection-retraction pairs *} +subsection \Continuous injection-retraction pairs\ -text {* Continuous retractions are strict. *} +text \Continuous retractions are strict.\ lemma retraction_strict: "\x. f\(g\x) = x \ f\\ = \" @@ -387,7 +387,7 @@ "\\x. f\(g\x) = x; z \ \\ \ g\z \ \" by (erule contrapos_nn, rule injection_defined_rev) -text {* a result about functions with flat codomain *} +text \a result about functions with flat codomain\ lemma flat_eqI: "\(x::'a::flat) \ y; x \ \\ \ x = y" by (drule ax_flat, simp) @@ -405,7 +405,7 @@ apply (erule minimal [THEN monofun_cfun_arg, THEN flat_eqI]) done -subsection {* Identity and composition *} +subsection \Identity and composition\ definition ID :: "'a \ 'a" where @@ -434,13 +434,13 @@ lemma cfcomp_strict [simp]: "\ oo f = \" by (simp add: cfun_eq_iff) -text {* - Show that interpretation of (pcpo,@{text "_->_"}) is a category. +text \ + Show that interpretation of (pcpo,\_->_\) is a category. The class of objects is interpretation of syntactical class pcpo. The class of arrows between objects @{typ 'a} and @{typ 'b} is interpret. of @{typ "'a -> 'b"}. The identity arrow is interpretation of @{term ID}. - The composition of f and g is interpretation of @{text "oo"}. -*} + The composition of f and g is interpretation of \oo\. +\ lemma ID2 [simp]: "f oo ID = f" by (rule cfun_eqI, simp) @@ -451,7 +451,7 @@ lemma assoc_oo: "f oo (g oo h) = (f oo g) oo h" by (rule cfun_eqI, simp) -subsection {* Strictified functions *} +subsection \Strictified functions\ default_sort pcpo @@ -492,7 +492,7 @@ lemma strictify2 [simp]: "x \ \ \ strictify\f\x = f\x" by (simp add: strictify_conv_if) -subsection {* Continuity of let-bindings *} +subsection \Continuity of let-bindings\ lemma cont2cont_Let: assumes f: "cont (\x. f x)" @@ -514,8 +514,8 @@ using g by (simp add: prod_cont_iff) qed -text {* The simple version (suggested by Joachim Breitner) is needed if - the type of the defined term is not a cpo. *} +text \The simple version (suggested by Joachim Breitner) is needed if + the type of the defined term is not a cpo.\ lemma cont2cont_Let_simple [simp, cont2cont]: assumes "\y. cont (\x. g x y)" diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/HOLCF/Compact_Basis.thy --- a/src/HOL/HOLCF/Compact_Basis.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/HOLCF/Compact_Basis.thy Wed Jan 13 23:07:06 2016 +0100 @@ -2,7 +2,7 @@ Author: Brian Huffman *) -section {* A compact basis for powerdomains *} +section \A compact basis for powerdomains\ theory Compact_Basis imports Universal @@ -10,7 +10,7 @@ default_sort bifinite -subsection {* A compact basis for powerdomains *} +subsection \A compact basis for powerdomains\ definition "pd_basis = {S::'a compact_basis set. finite S \ S \ {}}" @@ -26,7 +26,7 @@ lemma Rep_pd_basis_nonempty [simp]: "Rep_pd_basis u \ {}" by (insert Rep_pd_basis [of u, unfolded pd_basis_def]) simp -text {* The powerdomain basis type is countable. *} +text \The powerdomain basis type is countable.\ lemma pd_basis_countable: "\f::'a pd_basis \ nat. inj f" proof - @@ -40,7 +40,7 @@ (* FIXME: why doesn't ".." or "by (rule exI)" work? *) qed -subsection {* Unit and plus constructors *} +subsection \Unit and plus constructors\ definition PDUnit :: "'a compact_basis \ 'a pd_basis" where @@ -91,7 +91,7 @@ apply (rule PDUnit, erule PDPlus [OF PDUnit]) done -subsection {* Fold operator *} +subsection \Fold operator\ definition fold_pd :: diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/HOLCF/Completion.thy --- a/src/HOL/HOLCF/Completion.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/HOLCF/Completion.thy Wed Jan 13 23:07:06 2016 +0100 @@ -2,13 +2,13 @@ Author: Brian Huffman *) -section {* Defining algebraic domains by ideal completion *} +section \Defining algebraic domains by ideal completion\ theory Completion imports Plain_HOLCF begin -subsection {* Ideals over a preorder *} +subsection \Ideals over a preorder\ locale preorder = fixes r :: "'a::type \ 'a \ bool" (infix "\" 50) @@ -52,7 +52,7 @@ lemma ex_ideal: "\A. A \ {A. ideal A}" by (fast intro: ideal_principal) -text {* The set of ideals is a cpo *} +text \The set of ideals is a cpo\ lemma ideal_UN: fixes A :: "nat \ 'a set" @@ -126,7 +126,7 @@ apply (erule (1) below_trans) done -subsection {* Lemmas about least upper bounds *} +subsection \Lemmas about least upper bounds\ lemma is_ub_thelub_ex: "\\u. S <<| u; x \ S\ \ x \ lub S" apply (erule exE, drule is_lub_lub) @@ -137,7 +137,7 @@ lemma is_lub_thelub_ex: "\\u. S <<| u; S <| x\ \ lub S \ x" by (erule exE, drule is_lub_lub, erule is_lubD2) -subsection {* Locale for ideal completion *} +subsection \Locale for ideal completion\ locale ideal_completion = preorder + fixes principal :: "'a::type \ 'b::cpo" @@ -179,12 +179,12 @@ "\i. Y i \ Y (Suc i) \ chain (\i. principal (Y i))" by (simp add: chainI principal_mono) -subsubsection {* Principal ideals approximate all elements *} +subsubsection \Principal ideals approximate all elements\ lemma compact_principal [simp]: "compact (principal a)" by (rule compactI2, simp add: principal_below_iff_mem_rep rep_lub) -text {* Construct a chain whose lub is the same as a given ideal *} +text \Construct a chain whose lub is the same as a given ideal\ lemma obtain_principal_chain: obtains Y where "\i. Y i \ Y (Suc i)" and "x = (\i. principal (Y i))" @@ -278,7 +278,7 @@ apply (drule (2) admD2, fast, simp) done -subsection {* Defining functions in terms of basis elements *} +subsection \Defining functions in terms of basis elements\ definition extension :: "('a::type \ 'c::cpo) \ 'b \ 'c" where diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/HOLCF/Cont.thy --- a/src/HOL/HOLCF/Cont.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/HOLCF/Cont.thy Wed Jan 13 23:07:06 2016 +0100 @@ -3,23 +3,23 @@ Author: Brian Huffman *) -section {* Continuity and monotonicity *} +section \Continuity and monotonicity\ theory Cont imports Pcpo begin -text {* +text \ Now we change the default class! Form now on all untyped type variables are of default class po -*} +\ default_sort po -subsection {* Definitions *} +subsection \Definitions\ definition - monofun :: "('a \ 'b) \ bool" -- "monotonicity" where + monofun :: "('a \ 'b) \ bool" \ "monotonicity" where "monofun f = (\x y. x \ y \ f x \ f y)" definition @@ -44,9 +44,9 @@ by (simp add: monofun_def) -subsection {* Equivalence of alternate definition *} +subsection \Equivalence of alternate definition\ -text {* monotone functions map chains to chains *} +text \monotone functions map chains to chains\ lemma ch2ch_monofun: "\monofun f; chain Y\ \ chain (\i. f (Y i))" apply (rule chainI) @@ -54,7 +54,7 @@ apply (erule chainE) done -text {* monotone functions map upper bound to upper bounds *} +text \monotone functions map upper bound to upper bounds\ lemma ub2ub_monofun: "\monofun f; range Y <| u\ \ range (\i. f (Y i)) <| f u" @@ -63,7 +63,7 @@ apply (erule ub_rangeD) done -text {* a lemma about binary chains *} +text \a lemma about binary chains\ lemma binchain_cont: "\cont f; x \ y\ \ range (\i::nat. f (if i = 0 then x else y)) <<| f y" @@ -75,7 +75,7 @@ apply (erule is_lub_bin_chain [THEN lub_eqI]) done -text {* continuity implies monotonicity *} +text \continuity implies monotonicity\ lemma cont2mono: "cont f \ monofun f" apply (rule monofunI) @@ -88,7 +88,7 @@ lemmas ch2ch_cont = cont2mono [THEN ch2ch_monofun] -text {* continuity implies preservation of lubs *} +text \continuity implies preservation of lubs\ lemma cont2contlubE: "\cont f; chain Y\ \ f (\i. Y i) = (\i. f (Y i))" @@ -118,26 +118,26 @@ by (rule thelubE) qed -subsection {* Collection of continuity rules *} +subsection \Collection of continuity rules\ named_theorems cont2cont "continuity intro rule" -subsection {* Continuity of basic functions *} +subsection \Continuity of basic functions\ -text {* The identity function is continuous *} +text \The identity function is continuous\ lemma cont_id [simp, cont2cont]: "cont (\x. x)" apply (rule contI) apply (erule cpo_lubI) done -text {* constant functions are continuous *} +text \constant functions are continuous\ lemma cont_const [simp, cont2cont]: "cont (\x. c)" using is_lub_const by (rule contI) -text {* application of functions is continuous *} +text \application of functions is continuous\ lemma cont_apply: fixes f :: "'a::cpo \ 'b::cpo \ 'c::cpo" and t :: "'a \ 'b" @@ -165,7 +165,7 @@ "\cont c; cont (\x. f x)\ \ cont (\x. c (f x))" by (rule cont_apply [OF _ _ cont_const]) -text {* Least upper bounds preserve continuity *} +text \Least upper bounds preserve continuity\ lemma cont2cont_lub [simp]: assumes chain: "\x. chain (\i. F i x)" and cont: "\i. cont (\x. F i x)" @@ -176,15 +176,15 @@ apply (simp add: diag_lub ch2ch_cont [OF cont] chain) done -text {* if-then-else is continuous *} +text \if-then-else is continuous\ lemma cont_if [simp, cont2cont]: "\cont f; cont g\ \ cont (\x. if b then f x else g x)" by (induct b) simp_all -subsection {* Finite chains and flat pcpos *} +subsection \Finite chains and flat pcpos\ -text {* Monotone functions map finite chains to finite chains. *} +text \Monotone functions map finite chains to finite chains.\ lemma monofun_finch2finch: "\monofun f; finite_chain Y\ \ finite_chain (\n. f (Y n))" @@ -193,13 +193,13 @@ apply (force simp add: max_in_chain_def) done -text {* The same holds for continuous functions. *} +text \The same holds for continuous functions.\ lemma cont_finch2finch: "\cont f; finite_chain Y\ \ finite_chain (\n. f (Y n))" by (rule cont2mono [THEN monofun_finch2finch]) -text {* All monotone functions with chain-finite domain are continuous. *} +text \All monotone functions with chain-finite domain are continuous.\ lemma chfindom_monofun2cont: "monofun f \ cont (f::'a::chfin \ 'b::cpo)" apply (erule contI2) @@ -210,7 +210,7 @@ apply (force simp add: max_in_chain_def) done -text {* All strict functions with flat domain are continuous. *} +text \All strict functions with flat domain are continuous.\ lemma flatdom_strict2mono: "f \ = \ \ monofun (f::'a::flat \ 'b::pcpo)" apply (rule monofunI) @@ -221,7 +221,7 @@ lemma flatdom_strict2cont: "f \ = \ \ cont (f::'a::flat \ 'b::pcpo)" by (rule flatdom_strict2mono [THEN chfindom_monofun2cont]) -text {* All functions with discrete domain are continuous. *} +text \All functions with discrete domain are continuous.\ lemma cont_discrete_cpo [simp, cont2cont]: "cont (f::'a::discrete_cpo \ 'b::cpo)" apply (rule contI) diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/HOLCF/ConvexPD.thy --- a/src/HOL/HOLCF/ConvexPD.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/HOLCF/ConvexPD.thy Wed Jan 13 23:07:06 2016 +0100 @@ -2,13 +2,13 @@ Author: Brian Huffman *) -section {* Convex powerdomain *} +section \Convex powerdomain\ theory ConvexPD imports UpperPD LowerPD begin -subsection {* Basis preorder *} +subsection \Basis preorder\ definition convex_le :: "'a pd_basis \ 'a pd_basis \ bool" (infix "\\" 50) where @@ -117,7 +117,7 @@ done -subsection {* Type definition *} +subsection \Type definition\ typedef 'a convex_pd ("('(_')\)") = "{S::'a pd_basis set. convex_le.ideal S}" @@ -150,7 +150,7 @@ using convex_principal_def pd_basis_countable by (rule convex_le.typedef_ideal_completion) -text {* Convex powerdomain is pointed *} +text \Convex powerdomain is pointed\ lemma convex_pd_minimal: "convex_principal (PDUnit compact_bot) \ ys" by (induct ys rule: convex_pd.principal_induct, simp, simp) @@ -162,7 +162,7 @@ by (rule convex_pd_minimal [THEN bottomI, symmetric]) -subsection {* Monadic unit and plus *} +subsection \Monadic unit and plus\ definition convex_unit :: "'a \ 'a convex_pd" where @@ -221,11 +221,11 @@ lemmas convex_plus_left_commute = convex_add.left_commute lemmas convex_plus_left_absorb = convex_add.left_idem -text {* Useful for @{text "simp add: convex_plus_ac"} *} +text \Useful for \simp add: convex_plus_ac\\ lemmas convex_plus_ac = convex_plus_assoc convex_plus_commute convex_plus_left_commute -text {* Useful for @{text "simp only: convex_plus_aci"} *} +text \Useful for \simp only: convex_plus_aci\\ lemmas convex_plus_aci = convex_plus_ac convex_plus_absorb convex_plus_left_absorb @@ -275,7 +275,7 @@ by (auto dest!: convex_pd.compact_imp_principal) -subsection {* Induction rules *} +subsection \Induction rules\ lemma convex_pd_induct1: assumes P: "adm P" @@ -304,7 +304,7 @@ done -subsection {* Monadic bind *} +subsection \Monadic bind\ definition convex_bind_basis :: @@ -376,7 +376,7 @@ by (induct xs, simp_all) -subsection {* Map *} +subsection \Map\ definition convex_map :: "('a \ 'b) \ 'a convex_pd \ 'b convex_pd" where @@ -467,7 +467,7 @@ by (rule finite_range_imp_finite_fixes) qed -subsection {* Convex powerdomain is bifinite *} +subsection \Convex powerdomain is bifinite\ lemma approx_chain_convex_map: assumes "approx_chain a" @@ -482,7 +482,7 @@ by (fast intro!: approx_chain_convex_map) qed -subsection {* Join *} +subsection \Join\ definition convex_join :: "'a convex_pd convex_pd \ 'a convex_pd" where @@ -513,9 +513,9 @@ by (induct xss rule: convex_pd_induct, simp_all) -subsection {* Conversions to other powerdomains *} +subsection \Conversions to other powerdomains\ -text {* Convex to upper *} +text \Convex to upper\ lemma convex_le_imp_upper_le: "t \\ u \ t \\ u" unfolding convex_le_def by simp @@ -555,7 +555,7 @@ upper_bind\(convex_to_upper\xss)\convex_to_upper" by (simp add: convex_join_def upper_join_def cfcomp_LAM eta_cfun) -text {* Convex to lower *} +text \Convex to lower\ lemma convex_le_imp_lower_le: "t \\ u \ t \\ u" unfolding convex_le_def by simp @@ -595,7 +595,7 @@ lower_bind\(convex_to_lower\xss)\convex_to_lower" by (simp add: convex_join_def lower_join_def cfcomp_LAM eta_cfun) -text {* Ordering property *} +text \Ordering property\ lemma convex_pd_below_iff: "(xs \ ys) = diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/HOLCF/Cpodef.thy --- a/src/HOL/HOLCF/Cpodef.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/HOLCF/Cpodef.thy Wed Jan 13 23:07:06 2016 +0100 @@ -2,21 +2,21 @@ Author: Brian Huffman *) -section {* Subtypes of pcpos *} +section \Subtypes of pcpos\ theory Cpodef imports Adm keywords "pcpodef" "cpodef" :: thy_goal begin -subsection {* Proving a subtype is a partial order *} +subsection \Proving a subtype is a partial order\ -text {* +text \ A subtype of a partial order is itself a partial order, if the ordering is defined in the standard way. -*} +\ -setup {* Sign.add_const_constraint (@{const_name Porder.below}, NONE) *} +setup \Sign.add_const_constraint (@{const_name Porder.below}, NONE)\ theorem typedef_po: fixes Abs :: "'a::po \ 'b::type" @@ -30,10 +30,10 @@ apply (erule (1) below_antisym) done -setup {* Sign.add_const_constraint (@{const_name Porder.below}, - SOME @{typ "'a::below \ 'a::below \ bool"}) *} +setup \Sign.add_const_constraint (@{const_name Porder.below}, + SOME @{typ "'a::below \ 'a::below \ bool"})\ -subsection {* Proving a subtype is finite *} +subsection \Proving a subtype is finite\ lemma typedef_finite_UNIV: fixes Abs :: "'a::type \ 'b::type" @@ -46,7 +46,7 @@ by (simp only: type_definition.Abs_image [OF type]) qed -subsection {* Proving a subtype is chain-finite *} +subsection \Proving a subtype is chain-finite\ lemma ch2ch_Rep: assumes below: "op \ \ \x y. Rep x \ Rep y" @@ -65,15 +65,15 @@ apply (simp add: type_definition.Rep_inject [OF type]) done -subsection {* Proving a subtype is complete *} +subsection \Proving a subtype is complete\ -text {* +text \ A subtype of a cpo is itself a cpo if the ordering is defined in the standard way, and the defining subset is closed with respect to limits of chains. A set is closed if and only if membership in the set is an admissible predicate. -*} +\ lemma typedef_is_lubI: assumes below: "op \ \ \x y. Rep x \ Rep y" @@ -122,9 +122,9 @@ thus "\x. range S <<| x" .. qed -subsubsection {* Continuity of \emph{Rep} and \emph{Abs} *} +subsubsection \Continuity of \emph{Rep} and \emph{Abs}\ -text {* For any sub-cpo, the @{term Rep} function is continuous. *} +text \For any sub-cpo, the @{term Rep} function is continuous.\ theorem typedef_cont_Rep: fixes Abs :: "'a::cpo \ 'b::cpo" @@ -140,11 +140,11 @@ apply (erule ch2ch_Rep [OF below]) done -text {* +text \ For a sub-cpo, we can make the @{term Abs} function continuous only if we restrict its domain to the defining subset by composing it with another continuous function. -*} +\ theorem typedef_cont_Abs: fixes Abs :: "'a::cpo \ 'b::cpo" @@ -157,7 +157,7 @@ unfolding cont_def is_lub_def is_ub_def ball_simps below by (simp add: type_definition.Abs_inverse [OF type f_in_A]) -subsection {* Proving subtype elements are compact *} +subsection \Proving subtype elements are compact\ theorem typedef_compact: fixes Abs :: "'a::cpo \ 'b::cpo" @@ -173,12 +173,12 @@ thus "adm (\x. k \ x)" by (unfold below) qed -subsection {* Proving a subtype is pointed *} +subsection \Proving a subtype is pointed\ -text {* +text \ A subtype of a cpo has a least element if and only if the defining subset has a least element. -*} +\ theorem typedef_pcpo_generic: fixes Abs :: "'a::cpo \ 'b::cpo" @@ -194,10 +194,10 @@ apply (rule z_least [OF type_definition.Rep [OF type]]) done -text {* +text \ As a special case, a subtype of a pcpo has a least element if the defining subset contains @{term \}. -*} +\ theorem typedef_pcpo: fixes Abs :: "'a::pcpo \ 'b::cpo" @@ -207,12 +207,12 @@ shows "OFCLASS('b, pcpo_class)" by (rule typedef_pcpo_generic [OF type below bottom_in_A], rule minimal) -subsubsection {* Strictness of \emph{Rep} and \emph{Abs} *} +subsubsection \Strictness of \emph{Rep} and \emph{Abs}\ -text {* +text \ For a sub-pcpo where @{term \} is a member of the defining subset, @{term Rep} and @{term Abs} are both strict. -*} +\ theorem typedef_Abs_strict: assumes type: "type_definition Rep Abs A" @@ -250,7 +250,7 @@ apply (simp add: type_definition.Rep_inject [OF type]) done -subsection {* Proving a subtype is flat *} +subsection \Proving a subtype is flat\ theorem typedef_flat: fixes Abs :: "'a::flat \ 'b::pcpo" @@ -265,7 +265,7 @@ apply (simp add: ax_flat) done -subsection {* HOLCF type definition package *} +subsection \HOLCF type definition package\ ML_file "Tools/cpodef.ML" diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/HOLCF/Cprod.thy --- a/src/HOL/HOLCF/Cprod.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/HOLCF/Cprod.thy Wed Jan 13 23:07:06 2016 +0100 @@ -2,7 +2,7 @@ Author: Franz Regensburger *) -section {* The cpo of cartesian products *} +section \The cpo of cartesian products\ theory Cprod imports Cfun @@ -10,7 +10,7 @@ default_sort cpo -subsection {* Continuous case function for unit type *} +subsection \Continuous case function for unit type\ definition unit_when :: "'a \ unit \ 'a" where @@ -22,7 +22,7 @@ lemma unit_when [simp]: "unit_when\a\u = a" by (simp add: unit_when_def) -subsection {* Continuous version of split function *} +subsection \Continuous version of split function\ definition csplit :: "('a \ 'b \ 'c) \ ('a * 'b) \ 'c" where @@ -39,7 +39,7 @@ csnd :: "'a \ 'b \ 'b" where "csnd \ Abs_cfun snd" -subsection {* Convert all lemmas to the continuous versions *} +subsection \Convert all lemmas to the continuous versions\ lemma csplit1 [simp]: "csplit\f\\ = f\\\\" by (simp add: csplit_def) diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/HOLCF/Deflation.thy --- a/src/HOL/HOLCF/Deflation.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/HOLCF/Deflation.thy Wed Jan 13 23:07:06 2016 +0100 @@ -2,7 +2,7 @@ Author: Brian Huffman *) -section {* Continuous deflations and ep-pairs *} +section \Continuous deflations and ep-pairs\ theory Deflation imports Plain_HOLCF @@ -10,7 +10,7 @@ default_sort cpo -subsection {* Continuous deflations *} +subsection \Continuous deflations\ locale deflation = fixes d :: "'a \ 'a" @@ -21,7 +21,7 @@ lemma below_ID: "d \ ID" by (rule cfun_belowI, simp add: below) -text {* The set of fixed points is the same as the range. *} +text \The set of fixed points is the same as the range.\ lemma fixes_eq_range: "{x. d\x = x} = range (\x. d\x)" by (auto simp add: eq_sym_conv idem) @@ -29,10 +29,10 @@ lemma range_eq_fixes: "range (\x. d\x) = {x. d\x = x}" by (auto simp add: eq_sym_conv idem) -text {* +text \ The pointwise ordering on deflation functions coincides with the subset ordering of their sets of fixed-points. -*} +\ lemma belowI: assumes f: "\x. d\x = x \ f\x = x" shows "d \ f" @@ -74,10 +74,10 @@ apply (simp add: deflation.belowI) done -text {* +text \ The composition of two deflations is equal to the lesser of the two (if they are comparable). -*} +\ lemma deflation_below_comp1: assumes "deflation f" @@ -99,7 +99,7 @@ by (simp only: deflation.belowD deflation.idem) -subsection {* Deflations with finite range *} +subsection \Deflations with finite range\ lemma finite_range_imp_finite_fixes: "finite (range f) \ finite {x. f x = x}" @@ -164,7 +164,7 @@ by standard simp_all -subsection {* Continuous embedding-projection pairs *} +subsection \Continuous embedding-projection pairs\ locale ep_pair = fixes e :: "'a \ 'b" and p :: "'b \ 'a" @@ -224,7 +224,7 @@ lemma compact_e_iff: "compact (e\x) \ compact x" by (rule iffI [OF compact_e_rev compact_e]) -text {* Deflations from ep-pairs *} +text \Deflations from ep-pairs\ lemma deflation_e_p: "deflation (e oo p)" by (simp add: deflation.intro e_p_below) @@ -321,7 +321,7 @@ end -subsection {* Uniqueness of ep-pairs *} +subsection \Uniqueness of ep-pairs\ lemma ep_pair_unique_e_lemma: assumes 1: "ep_pair e1 p" and 2: "ep_pair e2 p" @@ -355,7 +355,7 @@ "\ep_pair e p1; ep_pair e p2\ \ p1 = p2" by (fast intro: below_antisym elim: ep_pair_unique_p_lemma) -subsection {* Composing ep-pairs *} +subsection \Composing ep-pairs\ lemma ep_pair_ID_ID: "ep_pair ID ID" by standard simp_all diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/HOLCF/Discrete.thy --- a/src/HOL/HOLCF/Discrete.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/HOLCF/Discrete.thy Wed Jan 13 23:07:06 2016 +0100 @@ -2,7 +2,7 @@ Author: Tobias Nipkow *) -section {* Discrete cpo types *} +section \Discrete cpo types\ theory Discrete imports Cont @@ -10,7 +10,7 @@ datatype 'a discr = Discr "'a :: type" -subsection {* Discrete cpo class instance *} +subsection \Discrete cpo class instance\ instantiation discr :: (type) discrete_cpo begin @@ -23,7 +23,7 @@ end -subsection {* \emph{undiscr} *} +subsection \\emph{undiscr}\ definition undiscr :: "('a::type)discr => 'a" where diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/HOLCF/Domain.thy --- a/src/HOL/HOLCF/Domain.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/HOLCF/Domain.thy Wed Jan 13 23:07:06 2016 +0100 @@ -2,7 +2,7 @@ Author: Brian Huffman *) -section {* Domain package *} +section \Domain package\ theory Domain imports Representable Domain_Aux @@ -13,7 +13,7 @@ default_sort "domain" -subsection {* Representations of types *} +subsection \Representations of types\ lemma emb_prj: "emb\((prj\x)::'a) = cast\DEFL('a)\x" by (simp add: cast_DEFL) @@ -39,7 +39,7 @@ apply (rule monofun_cfun_arg [OF assms]) done -text {* Isomorphism lemmas used internally by the domain package: *} +text \Isomorphism lemmas used internally by the domain package:\ lemma domain_abs_iso: fixes abs and rep @@ -59,7 +59,7 @@ unfolding abs_def rep_def by (simp add: emb_prj_emb DEFL) -subsection {* Deflations as sets *} +subsection \Deflations as sets\ definition defl_set :: "'a::bifinite defl \ 'a set" where "defl_set A = {x. cast\A\x = x}" @@ -78,11 +78,11 @@ apply (auto simp add: cast.belowI cast.belowD) done -subsection {* Proving a subtype is representable *} +subsection \Proving a subtype is representable\ -text {* Temporarily relax type constraints. *} +text \Temporarily relax type constraints.\ -setup {* +setup \ fold Sign.add_const_constraint [ (@{const_name defl}, SOME @{typ "'a::pcpo itself \ udom defl"}) , (@{const_name emb}, SOME @{typ "'a::pcpo \ udom"}) @@ -90,7 +90,7 @@ , (@{const_name liftdefl}, SOME @{typ "'a::pcpo itself \ udom u defl"}) , (@{const_name liftemb}, SOME @{typ "'a::pcpo u \ udom u"}) , (@{const_name liftprj}, SOME @{typ "udom u \ 'a::pcpo u"}) ] -*} +\ lemma typedef_domain_class: fixes Rep :: "'a::pcpo \ udom" @@ -138,9 +138,9 @@ shows "DEFL('a::pcpo) = t" unfolding assms .. -text {* Restore original typing constraints. *} +text \Restore original typing constraints.\ -setup {* +setup \ fold Sign.add_const_constraint [(@{const_name defl}, SOME @{typ "'a::domain itself \ udom defl"}), (@{const_name emb}, SOME @{typ "'a::domain \ udom"}), @@ -148,11 +148,11 @@ (@{const_name liftdefl}, SOME @{typ "'a::predomain itself \ udom u defl"}), (@{const_name liftemb}, SOME @{typ "'a::predomain u \ udom u"}), (@{const_name liftprj}, SOME @{typ "udom u \ 'a::predomain u"})] -*} +\ ML_file "Tools/domaindef.ML" -subsection {* Isomorphic deflations *} +subsection \Isomorphic deflations\ definition isodefl :: "('a \ 'a) \ udom defl \ bool" where "isodefl d t \ cast\t = emb oo d oo prj" @@ -314,7 +314,7 @@ using isodefl_sfun [OF assms] unfolding isodefl_def by (simp add: emb_cfun_def prj_cfun_def cfcomp1 encode_cfun_map) -subsection {* Setting up the domain package *} +subsection \Setting up the domain package\ named_theorems domain_defl_simps "theorems like DEFL('a t) = t_defl$DEFL('a)" and domain_isodefl "theorems like isodefl d t ==> isodefl (foo_map$d) (foo_defl$t)" @@ -339,7 +339,7 @@ deflation_cfun_map deflation_sfun_map deflation_ssum_map deflation_sprod_map deflation_prod_map deflation_u_map -setup {* +setup \ fold Domain_Take_Proofs.add_rec_type [(@{type_name cfun}, [true, true]), (@{type_name "sfun"}, [true, true]), @@ -347,6 +347,6 @@ (@{type_name sprod}, [true, true]), (@{type_name prod}, [true, true]), (@{type_name "u"}, [true])] -*} +\ end diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/HOLCF/Domain_Aux.thy --- a/src/HOL/HOLCF/Domain_Aux.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/HOLCF/Domain_Aux.thy Wed Jan 13 23:07:06 2016 +0100 @@ -2,15 +2,15 @@ Author: Brian Huffman *) -section {* Domain package support *} +section \Domain package support\ theory Domain_Aux imports Map_Functions Fixrec begin -subsection {* Continuous isomorphisms *} +subsection \Continuous isomorphisms\ -text {* A locale for continuous isomorphisms *} +text \A locale for continuous isomorphisms\ locale iso = fixes abs :: "'a \ 'b" @@ -108,13 +108,13 @@ end -subsection {* Proofs about take functions *} +subsection \Proofs about take functions\ -text {* +text \ This section contains lemmas that are used in a module that supports the domain isomorphism package; the module contains proofs related to take functions and the finiteness predicate. -*} +\ lemma deflation_abs_rep: fixes abs and rep and d @@ -132,14 +132,14 @@ with chain have "d m \ d n" by (rule chain_mono) then have "d m\(d n\x) = d m\x" by (rule deflation_below_comp1 [OF defl defl]) - moreover from `m \ n` have "min m n = m" by simp + moreover from \m \ n\ have "min m n = m" by simp ultimately show ?thesis by simp next assume "n \ m" with chain have "d n \ d m" by (rule chain_mono) then have "d m\(d n\x) = d n\x" by (rule deflation_below_comp2 [OF defl defl]) - moreover from `n \ m` have "min m n = n" by simp + moreover from \n \ m\ have "min m n = n" by simp ultimately show ?thesis by simp qed @@ -164,18 +164,18 @@ assumes "chain t" and "(\n. t n) = ID" assumes "adm P" and "\n. P (t n\x)" shows "P x" proof - - from `chain t` have "chain (\n. t n\x)" by simp - from `adm P` this `\n. P (t n\x)` have "P (\n. t n\x)" by (rule admD) - with `chain t` `(\n. t n) = ID` show "P x" by (simp add: lub_distribs) + from \chain t\ have "chain (\n. t n\x)" by simp + from \adm P\ this \\n. P (t n\x)\ have "P (\n. t n\x)" by (rule admD) + with \chain t\ \(\n. t n) = ID\ show "P x" by (simp add: lub_distribs) qed -subsection {* Finiteness *} +subsection \Finiteness\ -text {* +text \ Let a ``decisive'' function be a deflation that maps every input to either itself or bottom. Then if a domain's take functions are all decisive, then all values in the domain are finite. -*} +\ definition decisive :: "('a::pcpo \ 'a) \ bool" @@ -252,9 +252,9 @@ shows "(\n. P (d n\x)) \ P x" using lub_ID_finite [OF assms] by metis -subsection {* Proofs about constructor functions *} +subsection \Proofs about constructor functions\ -text {* Lemmas for proving nchotomy rule: *} +text \Lemmas for proving nchotomy rule:\ lemma ex_one_bottom_iff: "(\x. P x \ x \ \) = P ONE" @@ -290,7 +290,7 @@ ex_up_bottom_iff ex_one_bottom_iff -text {* Rules for turning nchotomy into exhaust: *} +text \Rules for turning nchotomy into exhaust:\ lemma exh_casedist0: "\R; R \ P\ \ P" (* like make_elim *) by auto @@ -306,7 +306,7 @@ lemmas exh_casedists = exh_casedist1 exh_casedist2 exh_casedist3 -text {* Rules for proving constructor properties *} +text \Rules for proving constructor properties\ lemmas con_strict_rules = sinl_strict sinr_strict spair_strict1 spair_strict2 @@ -342,7 +342,7 @@ ssum_map_sinl' ssum_map_sinr' sprod_map_spair' u_map_up deflation_strict deflation_ID ID1 cfcomp2 -subsection {* ML setup *} +subsection \ML setup\ named_theorems domain_deflation "theorems like deflation a ==> deflation (foo_map$a)" and domain_map_ID "theorems like foo_map$ID = ID" diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/HOLCF/FOCUS/Buffer_adm.thy --- a/src/HOL/HOLCF/FOCUS/Buffer_adm.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/HOLCF/FOCUS/Buffer_adm.thy Wed Jan 13 23:07:06 2016 +0100 @@ -2,7 +2,7 @@ Author: David von Oheimb, TU Muenchen *) -section {* One-element buffer, proof of Buf_Eq_imp_AC by induction + admissibility *} +section \One-element buffer, proof of Buf_Eq_imp_AC by induction + admissibility\ theory Buffer_adm imports Buffer Stream_adm diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/HOLCF/FOCUS/FOCUS.thy --- a/src/HOL/HOLCF/FOCUS/FOCUS.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/HOLCF/FOCUS/FOCUS.thy Wed Jan 13 23:07:06 2016 +0100 @@ -2,7 +2,7 @@ Author: David von Oheimb, TU Muenchen *) -section {* Top level of FOCUS *} +section \Top level of FOCUS\ theory FOCUS imports Fstream diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/HOLCF/FOCUS/Fstream.thy --- a/src/HOL/HOLCF/FOCUS/Fstream.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/HOLCF/FOCUS/Fstream.thy Wed Jan 13 23:07:06 2016 +0100 @@ -6,7 +6,7 @@ TODO: integrate Fstreams.thy *) -section {* FOCUS flat streams *} +section \FOCUS flat streams\ theory Fstream imports "~~/src/HOL/HOLCF/Library/Stream" @@ -152,12 +152,12 @@ lemma slen_fscons_eq_rev: "(#x < enat (Suc (Suc n))) = (!a y. x ~= a~> y | #y < enat (Suc n))" apply (simp add: fscons_def2 slen_scons_eq_rev) -apply (tactic {* step_tac (put_claset HOL_cs @{context} addSEs @{thms DefE}) 1 *}) -apply (tactic {* step_tac (put_claset HOL_cs @{context} addSEs @{thms DefE}) 1 *}) -apply (tactic {* step_tac (put_claset HOL_cs @{context} addSEs @{thms DefE}) 1 *}) -apply (tactic {* step_tac (put_claset HOL_cs @{context} addSEs @{thms DefE}) 1 *}) -apply (tactic {* step_tac (put_claset HOL_cs @{context} addSEs @{thms DefE}) 1 *}) -apply (tactic {* step_tac (put_claset HOL_cs @{context} addSEs @{thms DefE}) 1 *}) +apply (tactic \step_tac (put_claset HOL_cs @{context} addSEs @{thms DefE}) 1\) +apply (tactic \step_tac (put_claset HOL_cs @{context} addSEs @{thms DefE}) 1\) +apply (tactic \step_tac (put_claset HOL_cs @{context} addSEs @{thms DefE}) 1\) +apply (tactic \step_tac (put_claset HOL_cs @{context} addSEs @{thms DefE}) 1\) +apply (tactic \step_tac (put_claset HOL_cs @{context} addSEs @{thms DefE}) 1\) +apply (tactic \step_tac (put_claset HOL_cs @{context} addSEs @{thms DefE}) 1\) apply (erule contrapos_np) apply (fast dest: not_Undef_is_Def [THEN iffD1] elim: DefE) done diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/HOLCF/FOCUS/Stream_adm.thy --- a/src/HOL/HOLCF/FOCUS/Stream_adm.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/HOLCF/FOCUS/Stream_adm.thy Wed Jan 13 23:07:06 2016 +0100 @@ -2,7 +2,7 @@ Author: David von Oheimb, TU Muenchen *) -section {* Admissibility for streams *} +section \Admissibility for streams\ theory Stream_adm imports "~~/src/HOL/HOLCF/Library/Stream" "~~/src/HOL/Library/Order_Continuity" diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/HOLCF/Fix.thy --- a/src/HOL/HOLCF/Fix.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/HOLCF/Fix.thy Wed Jan 13 23:07:06 2016 +0100 @@ -3,7 +3,7 @@ Author: Brian Huffman *) -section {* Fixed point operator and admissibility *} +section \Fixed point operator and admissibility\ theory Fix imports Cfun @@ -11,13 +11,13 @@ default_sort pcpo -subsection {* Iteration *} +subsection \Iteration\ primrec iterate :: "nat \ ('a::cpo \ 'a) \ ('a \ 'a)" where "iterate 0 = (\ F x. x)" | "iterate (Suc n) = (\ F x. F\(iterate n\F\x))" -text {* Derive inductive properties of iterate from primitive recursion *} +text \Derive inductive properties of iterate from primitive recursion\ lemma iterate_0 [simp]: "iterate 0\F\x = x" by simp @@ -34,19 +34,19 @@ "iterate m\F\(iterate n\F\x) = iterate (m + n)\F\x" by (induct m) simp_all -text {* The sequence of function iterations is a chain. *} +text \The sequence of function iterations is a chain.\ lemma chain_iterate [simp]: "chain (\i. iterate i\F\\)" by (rule chainI, unfold iterate_Suc2, rule monofun_cfun_arg, rule minimal) -subsection {* Least fixed point operator *} +subsection \Least fixed point operator\ definition "fix" :: "('a \ 'a) \ 'a" where "fix = (\ F. \i. iterate i\F\\)" -text {* Binder syntax for @{term fix} *} +text \Binder syntax for @{term fix}\ abbreviation fix_syn :: "('a \ 'a) \ 'a" (binder "\ " 10) where @@ -55,9 +55,9 @@ notation (ASCII) fix_syn (binder "FIX " 10) -text {* Properties of @{term fix} *} +text \Properties of @{term fix}\ -text {* direct connection between @{term fix} and iteration *} +text \direct connection between @{term fix} and iteration\ lemma fix_def2: "fix\F = (\i. iterate i\F\\)" unfolding fix_def by simp @@ -66,10 +66,10 @@ unfolding fix_def2 using chain_iterate by (rule is_ub_thelub) -text {* +text \ Kleene's fixed point theorems for continuous functions in pointed omega cpo's -*} +\ lemma fix_eq: "fix\F = F\(fix\F)" apply (simp add: fix_def2) @@ -116,7 +116,7 @@ lemma fix_eq5: "f = fix\F \ f\x = F\f\x" by (erule fix_eq4 [THEN cfun_fun_cong]) -text {* strictness of @{term fix} *} +text \strictness of @{term fix}\ lemma fix_bottom_iff: "(fix\F = \) = (F\\ = \)" apply (rule iffI) @@ -131,7 +131,7 @@ lemma fix_defined: "F\\ \ \ \ fix\F \ \" by (simp add: fix_bottom_iff) -text {* @{term fix} applied to identity and constant functions *} +text \@{term fix} applied to identity and constant functions\ lemma fix_id: "(\ x. x) = \" by (simp add: fix_strict) @@ -139,7 +139,7 @@ lemma fix_const: "(\ x. c) = c" by (subst fix_eq, simp) -subsection {* Fixed point induction *} +subsection \Fixed point induction\ lemma fix_ind: "\adm P; P \; \x. P x \ P (F\x)\ \ P (fix\F)" unfolding fix_def2 @@ -202,12 +202,12 @@ shows "P (fix\(Abs_cfun F)) (fix\(Abs_cfun G))" by (rule parallel_fix_ind, simp_all add: assms) -subsection {* Fixed-points on product types *} +subsection \Fixed-points on product types\ -text {* +text \ Bekic's Theorem: Simultaneous fixed points over pairs can be written in terms of separate fixed points. -*} +\ lemma fix_cprod: "fix\(F::'a \ 'b \ 'a \ 'b) = diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/HOLCF/Fixrec.thy --- a/src/HOL/HOLCF/Fixrec.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/HOLCF/Fixrec.thy Wed Jan 13 23:07:06 2016 +0100 @@ -9,7 +9,7 @@ keywords "fixrec" :: thy_decl begin -subsection {* Pattern-match monad *} +subsection \Pattern-match monad\ default_sort cpo @@ -46,13 +46,13 @@ "succeed\x \ fail" "fail \ succeed\x" by (simp_all add: succeed_def fail_def cont_Abs_match Abs_match_inject) -subsubsection {* Run operator *} +subsubsection \Run operator\ definition run :: "'a match \ 'a::pcpo" where "run = (\ m. sscase\\\(fup\ID)\(Rep_match m))" -text {* rewrite rules for run *} +text \rewrite rules for run\ lemma run_strict [simp]: "run\\ = \" unfolding run_def @@ -66,7 +66,7 @@ unfolding run_def succeed_def by (simp add: cont_Rep_match cont_Abs_match Abs_match_inverse) -subsubsection {* Monad plus operator *} +subsubsection \Monad plus operator\ definition mplus :: "'a match \ 'a match \ 'a match" where @@ -76,7 +76,7 @@ mplus_syn :: "['a match, 'a match] \ 'a match" (infixr "+++" 65) where "m1 +++ m2 == mplus\m1\m2" -text {* rewrite rules for mplus *} +text \rewrite rules for mplus\ lemma mplus_strict [simp]: "\ +++ m = \" unfolding mplus_def @@ -96,7 +96,7 @@ lemma mplus_assoc: "(x +++ y) +++ z = x +++ (y +++ z)" by (cases x, simp_all) -subsection {* Match functions for built-in types *} +subsection \Match functions for built-in types\ default_sort pcpo @@ -192,12 +192,12 @@ "match_FF\\\k = \" by (simp_all add: match_FF_def) -subsection {* Mutual recursion *} +subsection \Mutual recursion\ -text {* +text \ The following rules are used to prove unfolding theorems from fixed-point definitions of mutually recursive functions. -*} +\ lemma Pair_equalI: "\x \ fst p; y \ snd p\ \ (x, y) \ p" by simp @@ -216,22 +216,22 @@ "\f \ fix\(Abs_cfun F); cont F; adm P; P \; \x. P x \ P (F x)\ \ P f" by (simp add: fix_ind) -text {* lemma for proving rewrite rules *} +text \lemma for proving rewrite rules\ lemma ssubst_lhs: "\t = s; P s = Q\ \ P t = Q" by simp -subsection {* Initializing the fixrec package *} +subsection \Initializing the fixrec package\ ML_file "Tools/holcf_library.ML" ML_file "Tools/fixrec.ML" -method_setup fixrec_simp = {* +method_setup fixrec_simp = \ Scan.succeed (SIMPLE_METHOD' o Fixrec.fixrec_simp_tac) -*} "pattern prover for fixrec constants" +\ "pattern prover for fixrec constants" -setup {* +setup \ Fixrec.add_matchers [ (@{const_name up}, @{const_name match_up}), (@{const_name sinl}, @{const_name match_sinl}), @@ -242,7 +242,7 @@ (@{const_name TT}, @{const_name match_TT}), (@{const_name FF}, @{const_name match_FF}), (@{const_name bottom}, @{const_name match_bottom}) ] -*} +\ hide_const (open) succeed fail run diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/HOLCF/Fun_Cpo.thy --- a/src/HOL/HOLCF/Fun_Cpo.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/HOLCF/Fun_Cpo.thy Wed Jan 13 23:07:06 2016 +0100 @@ -3,13 +3,13 @@ Author: Brian Huffman *) -section {* Class instances for the full function space *} +section \Class instances for the full function space\ theory Fun_Cpo imports Adm begin -subsection {* Full function space is a partial order *} +subsection \Full function space is a partial order\ instantiation "fun" :: (type, below) below begin @@ -44,9 +44,9 @@ lemma fun_belowD: "f \ g \ f x \ g x" by (simp add: below_fun_def) -subsection {* Full function space is chain complete *} +subsection \Full function space is chain complete\ -text {* Properties of chains of functions. *} +text \Properties of chains of functions.\ lemma fun_chain_iff: "chain S \ (\x. chain (\i. S i x))" unfolding chain_def fun_below_iff by auto @@ -57,7 +57,7 @@ lemma ch2ch_lambda: "(\x. chain (\i. S i x)) \ chain S" by (simp add: chain_def below_fun_def) -text {* Type @{typ "'a::type => 'b::cpo"} is chain complete *} +text \Type @{typ "'a::type => 'b::cpo"} is chain complete\ lemma is_lub_lambda: "(\x. range (\i. Y i x) <<| f x) \ range Y <<| f" @@ -87,7 +87,7 @@ by simp qed -subsection {* Full function space is pointed *} +subsection \Full function space is pointed\ lemma minimal_fun: "(\x. \) \ f" by (simp add: below_fun_def) @@ -104,19 +104,19 @@ lemma lambda_strict: "(\x. \) = \" by (rule bottomI, rule minimal_fun) -subsection {* Propagation of monotonicity and continuity *} +subsection \Propagation of monotonicity and continuity\ -text {* The lub of a chain of monotone functions is monotone. *} +text \The lub of a chain of monotone functions is monotone.\ lemma adm_monofun: "adm monofun" by (rule admI, simp add: lub_fun fun_chain_iff monofun_def lub_mono) -text {* The lub of a chain of continuous functions is continuous. *} +text \The lub of a chain of continuous functions is continuous.\ lemma adm_cont: "adm cont" by (rule admI, simp add: lub_fun fun_chain_iff) -text {* Function application preserves monotonicity and continuity. *} +text \Function application preserves monotonicity and continuity.\ lemma mono2mono_fun: "monofun f \ monofun (\x. f x y)" by (simp add: monofun_def fun_below_iff) @@ -130,10 +130,10 @@ lemma cont_fun: "cont (\f. f x)" using cont_id by (rule cont2cont_fun) -text {* +text \ Lambda abstraction preserves monotonicity and continuity. - (Note @{text "(\x. \y. f x y) = f"}.) -*} + (Note \(\x. \y. f x y) = f\.) +\ lemma mono2mono_lambda: assumes f: "\y. monofun (\x. f x y)" shows "monofun f" @@ -143,7 +143,7 @@ assumes f: "\y. cont (\x. f x y)" shows "cont f" by (rule contI, rule is_lub_lambda, rule contE [OF f]) -text {* What D.A.Schmidt calls continuity of abstraction; never used here *} +text \What D.A.Schmidt calls continuity of abstraction; never used here\ lemma contlub_lambda: "(\x::'a::type. chain (\i. S i x::'b::cpo)) diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/HOLCF/IMP/HoareEx.thy --- a/src/HOL/HOLCF/IMP/HoareEx.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/HOLCF/IMP/HoareEx.thy Wed Jan 13 23:07:06 2016 +0100 @@ -7,11 +7,11 @@ theory HoareEx imports Denotational begin -text {* +text \ An example from the HOLCF paper by Mueller, Nipkow, Oheimb, Slotosch @{cite MuellerNvOS99}. It demonstrates fixpoint reasoning by showing the correctness of the Hoare rule for while-loops. -*} +\ type_synonym assn = "state => bool" @@ -24,7 +24,7 @@ apply (unfold hoare_valid_def) apply (simp (no_asm)) apply (rule fix_ind) - apply (simp (no_asm)) -- "simplifier with enhanced @{text adm}-tactic" + apply (simp (no_asm)) \ "simplifier with enhanced \adm\-tactic" apply (simp (no_asm)) apply (simp (no_asm)) apply blast diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/HOLCF/Library/Bool_Discrete.thy --- a/src/HOL/HOLCF/Library/Bool_Discrete.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/HOLCF/Library/Bool_Discrete.thy Wed Jan 13 23:07:06 2016 +0100 @@ -2,13 +2,13 @@ Author: Brian Huffman *) -section {* Discrete cpo instance for booleans *} +section \Discrete cpo instance for booleans\ theory Bool_Discrete imports HOLCF begin -text {* Discrete cpo instance for @{typ bool}. *} +text \Discrete cpo instance for @{typ bool}.\ instantiation bool :: discrete_cpo begin @@ -21,9 +21,9 @@ end -text {* +text \ TODO: implement a command to automate discrete predomain instances. -*} +\ instantiation bool :: predomain begin diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/HOLCF/Library/Char_Discrete.thy --- a/src/HOL/HOLCF/Library/Char_Discrete.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/HOLCF/Library/Char_Discrete.thy Wed Jan 13 23:07:06 2016 +0100 @@ -2,13 +2,13 @@ Author: Brian Huffman *) -section {* Discrete cpo instance for 8-bit char type *} +section \Discrete cpo instance for 8-bit char type\ theory Char_Discrete imports HOLCF begin -subsection {* Discrete cpo instance for @{typ nibble}. *} +subsection \Discrete cpo instance for @{typ nibble}.\ instantiation nibble :: discrete_cpo begin @@ -21,9 +21,9 @@ end -text {* +text \ TODO: implement a command to automate discrete predomain instances. -*} +\ instantiation nibble :: predomain begin @@ -54,7 +54,7 @@ end -subsection {* Discrete cpo instance for @{typ char}. *} +subsection \Discrete cpo instance for @{typ char}.\ instantiation char :: discrete_cpo begin @@ -67,9 +67,9 @@ end -text {* +text \ TODO: implement a command to automate discrete predomain instances. -*} +\ instantiation char :: predomain begin @@ -100,7 +100,7 @@ end -subsection {* Using chars with Fixrec *} +subsection \Using chars with Fixrec\ definition match_Char :: "char \ (nibble \ nibble \ 'a match) \ 'a match" where "match_Char = (\ c k. case c of Char a b \ k\a\b)" @@ -221,7 +221,7 @@ "match_NibbleF\c\k = (if c = NibbleF then k else Fixrec.fail)" by (simp add: match_NibbleF_def) -setup {* +setup \ Fixrec.add_matchers [ (@{const_name Char}, @{const_name match_Char}), (@{const_name Nibble0}, @{const_name match_Nibble0}), @@ -240,6 +240,6 @@ (@{const_name NibbleD}, @{const_name match_NibbleD}), (@{const_name NibbleE}, @{const_name match_NibbleE}), (@{const_name NibbleF}, @{const_name match_NibbleF}) ] -*} +\ end diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/HOLCF/Library/Defl_Bifinite.thy --- a/src/HOL/HOLCF/Library/Defl_Bifinite.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/HOLCF/Library/Defl_Bifinite.thy Wed Jan 13 23:07:06 2016 +0100 @@ -2,17 +2,17 @@ Author: Brian Huffman *) -section {* Algebraic deflations are a bifinite domain *} +section \Algebraic deflations are a bifinite domain\ theory Defl_Bifinite imports HOLCF "~~/src/HOL/Library/Infinite_Set" begin -subsection {* Lemmas about MOST *} +subsection \Lemmas about MOST\ default_sort type -subsection {* Eventually constant sequences *} +subsection \Eventually constant sequences\ definition eventually_constant :: "(nat \ 'a) \ bool" @@ -48,7 +48,7 @@ "eventually_constant (\i. S (Suc i)) \ eventually_constant (\i. S i)" by (rule eventually_constant_Suc_iff [THEN iffD1]) -subsection {* Limits of eventually constant sequences *} +subsection \Limits of eventually constant sequences\ definition eventual :: "(nat \ 'a) \ 'a" where @@ -120,7 +120,7 @@ apply simp done -subsection {* Constructing finite deflations by iteration *} +subsection \Constructing finite deflations by iteration\ default_sort cpo @@ -144,7 +144,7 @@ where "eventual_iterate f = eventual (\n. iterate n\f)" -text {* A pre-deflation is like a deflation, but not idempotent. *} +text \A pre-deflation is like a deflation, but not idempotent.\ locale pre_deflation = fixes f :: "'a \ 'a::cpo" @@ -301,7 +301,7 @@ interpret d: finite_deflation d by fact let ?e = "d oo f" interpret e: pre_deflation "d oo f" - using `finite_deflation d` f + using \finite_deflation d\ f by (rule pre_deflation_oo) let ?g = "eventual (\n. iterate n\?e)" show ?thesis @@ -338,7 +338,7 @@ apply (rule eventual_mono) apply (rule pre_deflation.eventually_constant_iterate [OF f]) apply (rule pre_deflation.eventually_constant_iterate [OF g]) -apply (rule monofun_cfun_arg [OF `f \ g`]) +apply (rule monofun_cfun_arg [OF \f \ g\]) done lemma cont2cont_eventual_iterate_oo: @@ -380,15 +380,15 @@ have "compact (d\x)" using d by (rule finite_deflation.compact) then have "compact x" - using `d\x = x` by simp + using \d\x = x\ by simp then have "compact (\i. f (Y i)\x)" - using `(\i. f (Y i)\x) = x` by simp + using \(\i. f (Y i)\x) = x\ by simp then have "\n. max_in_chain n (\i. f (Y i)\x)" by - (rule compact_imp_max_in_chain, simp add: fY, assumption) then obtain n where n: "max_in_chain n (\i. f (Y i)\x)" .. then have "f (Y n)\x = x" - using `(\i. f (Y i)\x) = x` fY by (simp add: maxinch_is_thelub) - with `d\x = x` have "?e (Y n)\x = x" + using \(\i. f (Y i)\x) = x\ fY by (simp add: maxinch_is_thelub) + with \d\x = x\ have "?e (Y n)\x = x" by (simp add: eventual_iterate_oo_fixed_iff [OF d below]) moreover have "?e (Y n)\x \ (\i. ?e (Y i)\x)" by (rule is_ub_thelub, simp add: eY) @@ -404,7 +404,7 @@ qed qed -subsection {* Intersection of algebraic deflations *} +subsection \Intersection of algebraic deflations\ default_sort bifinite @@ -545,7 +545,7 @@ lemma compact_meet_defl2: "compact b \ compact (meet_defl\a\b)" by (subst meet_defl.commute, rule compact_meet_defl1) -subsection {* Chain of approx functions on algebraic deflations *} +subsection \Chain of approx functions on algebraic deflations\ context bifinite_approx_chain begin @@ -587,7 +587,7 @@ end -subsection {* Algebraic deflations are a bifinite domain *} +subsection \Algebraic deflations are a bifinite domain\ instance defl :: (bifinite) bifinite proof @@ -599,7 +599,7 @@ by (fast intro: bifinite_approx_chain.defl_approx) qed -subsection {* Algebraic deflations are representable *} +subsection \Algebraic deflations are representable\ default_sort "domain" diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/HOLCF/Library/HOL_Cpo.thy --- a/src/HOL/HOLCF/Library/HOL_Cpo.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/HOLCF/Library/HOL_Cpo.thy Wed Jan 13 23:07:06 2016 +0100 @@ -2,7 +2,7 @@ Author: Brian Huffman *) -section {* Cpo class instances for all HOL types *} +section \Cpo class instances for all HOL types\ theory HOL_Cpo imports diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/HOLCF/Library/Int_Discrete.thy --- a/src/HOL/HOLCF/Library/Int_Discrete.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/HOLCF/Library/Int_Discrete.thy Wed Jan 13 23:07:06 2016 +0100 @@ -2,13 +2,13 @@ Author: Brian Huffman *) -section {* Discrete cpo instance for integers *} +section \Discrete cpo instance for integers\ theory Int_Discrete imports HOLCF begin -text {* Discrete cpo instance for @{typ int}. *} +text \Discrete cpo instance for @{typ int}.\ instantiation int :: discrete_cpo begin @@ -21,9 +21,9 @@ end -text {* +text \ TODO: implement a command to automate discrete predomain instances. -*} +\ instantiation int :: predomain begin diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/HOLCF/Library/List_Cpo.thy --- a/src/HOL/HOLCF/Library/List_Cpo.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/HOLCF/Library/List_Cpo.thy Wed Jan 13 23:07:06 2016 +0100 @@ -2,13 +2,13 @@ Author: Brian Huffman *) -section {* Lists as a complete partial order *} +section \Lists as a complete partial order\ theory List_Cpo imports HOLCF begin -subsection {* Lists are a partial order *} +subsection \Lists are a partial order\ instantiation list :: (po) po begin @@ -55,7 +55,7 @@ assumes 1: "P [] []" assumes 2: "\x y xs ys. \x \ y; xs \ ys; P xs ys\ \ P (x # xs) (y # ys)" shows "P xs ys" -using `xs \ ys` +using \xs \ ys\ proof (induct xs arbitrary: ys) case Nil thus ?case by (simp add: 1) next @@ -100,20 +100,20 @@ assumes 1: "P (\i. [])" assumes 2: "\A B. chain A \ chain B \ P B \ P (\i. A i # B i)" shows "P S" -using `chain S` +using \chain S\ proof (induct "S 0" arbitrary: S) case Nil - have "\i. S 0 \ S i" by (simp add: chain_mono [OF `chain S`]) + have "\i. S 0 \ S i" by (simp add: chain_mono [OF \chain S\]) with Nil have "\i. S i = []" by simp thus ?case by (simp add: 1) next case (Cons x xs) - have "\i. S 0 \ S i" by (simp add: chain_mono [OF `chain S`]) + have "\i. S 0 \ S i" by (simp add: chain_mono [OF \chain S\]) hence *: "\i. S i \ []" by (rule all_forward, insert Cons) auto have "chain (\i. hd (S i))" and "chain (\i. tl (S i))" - using `chain S` by simp_all + using \chain S\ by simp_all moreover have "P (\i. tl (S i))" - using `chain S` and `x # xs = S 0` [symmetric] + using \chain S\ and \x # xs = S 0\ [symmetric] by (simp add: Cons(1)) ultimately have "P (\i. hd (S i) # tl (S i))" by (rule 2) @@ -126,7 +126,7 @@ A B where "chain A" and "chain B" and "S = (\i. A i # B i)" using S by (induct rule: list_chain_induct) simp_all -subsection {* Lists are a complete partial order *} +subsection \Lists are a complete partial order\ lemma is_lub_Cons: assumes A: "range A <<| x" @@ -147,7 +147,7 @@ qed qed -subsection {* Continuity of list operations *} +subsection \Continuity of list operations\ lemma cont2cont_Cons [simp, cont2cont]: assumes f: "cont (\x. f x)" @@ -193,8 +193,8 @@ shows "cont (\x. case f x of [] \ g x | y # ys \ h x y ys)" using assms by (simp add: cont2cont_case_list prod_cont_iff) -text {* The simple version (due to Joachim Breitner) is needed if the - element type of the list is not a cpo. *} +text \The simple version (due to Joachim Breitner) is needed if the + element type of the list is not a cpo.\ lemma cont2cont_case_list_simple [simp, cont2cont]: assumes "cont (\x. f1 x)" @@ -202,7 +202,7 @@ shows "cont (\x. case l of [] \ f1 x | y # ys \ f2 x y ys)" using assms by (cases l) auto -text {* Lemma for proving continuity of recursive list functions: *} +text \Lemma for proving continuity of recursive list functions:\ lemma list_contI: fixes f :: "'a::cpo list \ 'b::cpo" @@ -233,7 +233,7 @@ done qed -text {* Continuity rule for map *} +text \Continuity rule for map\ lemma cont2cont_map [simp, cont2cont]: assumes f: "cont (\(x, y). f x y)" @@ -246,11 +246,11 @@ apply (induct_tac y, simp, simp) done -text {* There are probably lots of other list operations that also +text \There are probably lots of other list operations that also deserve to have continuity lemmas. I'll add more as they are -needed. *} +needed.\ -subsection {* Lists are a discrete cpo *} +subsection \Lists are a discrete cpo\ instance list :: (discrete_cpo) discrete_cpo proof @@ -259,7 +259,7 @@ by (induct xs arbitrary: ys, case_tac [!] ys, simp_all) qed -subsection {* Compactness and chain-finiteness *} +subsection \Compactness and chain-finiteness\ lemma compact_Nil [simp]: "compact []" apply (rule compactI2) @@ -298,7 +298,7 @@ by (rule compact_imp_max_in_chain) qed -subsection {* Using lists with fixrec *} +subsection \Using lists with fixrec\ definition match_Nil :: "'a::cpo list \ 'b match \ 'b match" @@ -320,10 +320,10 @@ "match_Cons\(x # xs)\k = k\x\xs" unfolding match_Cons_def by simp_all -setup {* +setup \ Fixrec.add_matchers [ (@{const_name Nil}, @{const_name match_Nil}), (@{const_name Cons}, @{const_name match_Cons}) ] -*} +\ end diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/HOLCF/Library/List_Predomain.thy --- a/src/HOL/HOLCF/Library/List_Predomain.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/HOLCF/Library/List_Predomain.thy Wed Jan 13 23:07:06 2016 +0100 @@ -2,19 +2,19 @@ Author: Brian Huffman *) -section {* Predomain class instance for HOL list type *} +section \Predomain class instance for HOL list type\ theory List_Predomain imports List_Cpo Sum_Cpo begin -subsection {* Strict list type *} +subsection \Strict list type\ domain 'a slist = SNil | SCons "'a" "'a slist" -text {* Polymorphic map function for strict lists. *} +text \Polymorphic map function for strict lists.\ -text {* FIXME: The domain package should generate this! *} +text \FIXME: The domain package should generate this!\ fixrec slist_map' :: "('a \ 'b) \ 'a slist \ 'b slist" where "slist_map'\f\SNil = SNil" @@ -60,9 +60,9 @@ apply (simp add: cfun_below_iff ep_pair.e_p_below) done -text {* +text \ Types @{typ "'a list u"}. and @{typ "'a u slist"} are isomorphic. -*} +\ fixrec encode_list_u where "encode_list_u\(up\[]) = SNil" | @@ -94,7 +94,7 @@ apply (case_tac "decode_list_u\y", simp, simp) done -subsection {* Lists are a predomain *} +subsection \Lists are a predomain\ definition list_liftdefl :: "udom u defl \ udom u defl" where "list_liftdefl = (\ a. udefl\(slist_defl\(u_liftdefl\a)))" @@ -129,7 +129,7 @@ end -subsection {* Configuring domain package to work with list type *} +subsection \Configuring domain package to work with list type\ lemma liftdefl_list [domain_defl_simps]: "LIFTDEFL('a::predomain list) = list_liftdefl\LIFTDEFL('a)" @@ -167,8 +167,8 @@ apply (simp add: slist_map'_slist_map' u_emb_bottom) done -setup {* +setup \ Domain_Take_Proofs.add_rec_type (@{type_name "list"}, [true]) -*} +\ end diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/HOLCF/Library/Nat_Discrete.thy --- a/src/HOL/HOLCF/Library/Nat_Discrete.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/HOLCF/Library/Nat_Discrete.thy Wed Jan 13 23:07:06 2016 +0100 @@ -2,13 +2,13 @@ Author: Brian Huffman *) -section {* Discrete cpo instance for naturals *} +section \Discrete cpo instance for naturals\ theory Nat_Discrete imports HOLCF begin -text {* Discrete cpo instance for @{typ nat}. *} +text \Discrete cpo instance for @{typ nat}.\ instantiation nat :: discrete_cpo begin @@ -21,9 +21,9 @@ end -text {* +text \ TODO: implement a command to automate discrete predomain instances. -*} +\ instantiation nat :: predomain begin diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/HOLCF/Library/Option_Cpo.thy --- a/src/HOL/HOLCF/Library/Option_Cpo.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/HOLCF/Library/Option_Cpo.thy Wed Jan 13 23:07:06 2016 +0100 @@ -2,13 +2,13 @@ Author: Brian Huffman *) -section {* Cpo class instance for HOL option type *} +section \Cpo class instance for HOL option type\ theory Option_Cpo imports HOLCF Sum_Cpo begin -subsection {* Ordering on option type *} +subsection \Ordering on option type\ instantiation option :: (below) below begin @@ -49,7 +49,7 @@ using assms unfolding below_option_def by (simp split: option.split_asm) -subsection {* Option type is a complete partial order *} +subsection \Option type is a complete partial order\ instance option :: (po) po proof @@ -106,7 +106,7 @@ apply (erule cpo_lubI) done -subsection {* Continuity of Some and case function *} +subsection \Continuity of Some and case function\ lemma cont_Some: "cont Some" by (intro contI is_lub_Some cpo_lubI) @@ -141,7 +141,7 @@ shows "cont (\x. case f x of None \ g x | Some a \ h x a)" using assms by (simp add: cont2cont_case_option prod_cont_iff) -text {* Simple version for when the element type is not a cpo. *} +text \Simple version for when the element type is not a cpo.\ lemma cont2cont_case_option_simple [simp, cont2cont]: assumes "cont (\x. f x)" @@ -149,7 +149,7 @@ shows "cont (\x. case z of None \ f x | Some a \ g x a)" using assms by (cases z) auto -text {* Continuity rule for map. *} +text \Continuity rule for map.\ lemma cont2cont_map_option [simp, cont2cont]: assumes f: "cont (\(x, y). f x y)" @@ -157,7 +157,7 @@ shows "cont (\x. map_option (\y. f x y) (g x))" using assms by (simp add: prod_cont_iff map_option_case) -subsection {* Compactness and chain-finiteness *} +subsection \Compactness and chain-finiteness\ lemma compact_None [simp]: "compact None" apply (rule compactI2) @@ -190,7 +190,7 @@ instance option :: (discrete_cpo) discrete_cpo by intro_classes (simp add: below_option_def split: option.split) -subsection {* Using option types with Fixrec *} +subsection \Using option types with Fixrec\ definition "match_None = (\ x k. case x of None \ k | Some a \ Fixrec.fail)" @@ -208,13 +208,13 @@ "match_Some\(Some a)\k = k\a" unfolding match_Some_def by simp_all -setup {* +setup \ Fixrec.add_matchers [ (@{const_name None}, @{const_name match_None}), (@{const_name Some}, @{const_name match_Some}) ] -*} +\ -subsection {* Option type is a predomain *} +subsection \Option type is a predomain\ definition "encode_option = (\ x. case x of None \ Inl () | Some a \ Inr a)" @@ -255,7 +255,7 @@ end -subsection {* Configuring domain package to work with option type *} +subsection \Configuring domain package to work with option type\ lemma liftdefl_option [domain_defl_simps]: "LIFTDEFL('a::predomain option) = LIFTDEFL(unit + 'a)" @@ -285,8 +285,8 @@ unfolding isodefl'_def liftemb_option_def liftprj_option_def liftdefl_eq by (simp add: cfcomp1 u_map_map encode_option_option_map) -setup {* +setup \ Domain_Take_Proofs.add_rec_type (@{type_name "option"}, [true]) -*} +\ end diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/HOLCF/Library/Stream.thy --- a/src/HOL/HOLCF/Library/Stream.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/HOLCF/Library/Stream.thy Wed Jan 13 23:07:06 2016 +0100 @@ -2,7 +2,7 @@ Author: Franz Regensburger, David von Oheimb, Borislav Gajanovic *) -section {* General Stream domain *} +section \General Stream domain\ theory Stream imports "../HOLCF" "~~/src/HOL/Library/Extended_Nat" diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/HOLCF/Library/Sum_Cpo.thy --- a/src/HOL/HOLCF/Library/Sum_Cpo.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/HOLCF/Library/Sum_Cpo.thy Wed Jan 13 23:07:06 2016 +0100 @@ -2,13 +2,13 @@ Author: Brian Huffman *) -section {* The cpo of disjoint sums *} +section \The cpo of disjoint sums\ theory Sum_Cpo imports HOLCF begin -subsection {* Ordering on sum type *} +subsection \Ordering on sum type\ instantiation sum :: (below, below) below begin @@ -54,7 +54,7 @@ \ R" by (cases x, safe elim!: sum_below_elims, auto) -subsection {* Sum type is a complete partial order *} +subsection \Sum type is a complete partial order\ instance sum :: (po, po) po proof @@ -128,7 +128,7 @@ apply (erule cpo_lubI) done -subsection {* Continuity of \emph{Inl}, \emph{Inr}, and case function *} +subsection \Continuity of \emph{Inl}, \emph{Inr}, and case function\ lemma cont_Inl: "cont Inl" by (intro contI is_lub_Inl cpo_lubI) @@ -175,7 +175,7 @@ shows "cont (\x. case h x of Inl a \ f x a | Inr b \ g x b)" using assms by (simp add: cont2cont_case_sum prod_cont_iff) -text {* Continuity of map function. *} +text \Continuity of map function.\ lemma map_sum_eq: "map_sum f g = case_sum (\a. Inl (f a)) (\b. Inr (g b))" by (rule ext, case_tac x, simp_all) @@ -187,7 +187,7 @@ shows "cont (\x. map_sum (\y. f x y) (\y. g x y) (h x))" using assms by (simp add: map_sum_eq prod_cont_iff) -subsection {* Compactness and chain-finiteness *} +subsection \Compactness and chain-finiteness\ lemma compact_Inl: "compact a \ compact (Inl a)" apply (rule compactI2) @@ -228,7 +228,7 @@ instance sum :: (discrete_cpo, discrete_cpo) discrete_cpo by intro_classes (simp add: below_sum_def split: sum.split) -subsection {* Using sum types with fixrec *} +subsection \Using sum types with fixrec\ definition "match_Inl = (\ x k. case x of Inl a \ k\a | Inr b \ Fixrec.fail)" @@ -246,13 +246,13 @@ "match_Inr\(Inr b)\k = k\b" unfolding match_Inr_def by simp_all -setup {* +setup \ Fixrec.add_matchers [ (@{const_name Inl}, @{const_name match_Inl}), (@{const_name Inr}, @{const_name match_Inr}) ] -*} +\ -subsection {* Disjoint sum is a predomain *} +subsection \Disjoint sum is a predomain\ definition "encode_sum_u = @@ -272,7 +272,7 @@ apply (rename_tac b, case_tac b, simp, simp) done -text {* A deflation combinator for making unpointed types *} +text \A deflation combinator for making unpointed types\ definition udefl :: "udom defl \ udom u defl" where "udefl = defl_fun1 (strictify\up) (fup\ID) ID" @@ -327,7 +327,7 @@ end -subsection {* Configuring domain package to work with sum type *} +subsection \Configuring domain package to work with sum type\ lemma liftdefl_sum [domain_defl_simps]: "LIFTDEFL('a::predomain + 'b::predomain) = @@ -365,8 +365,8 @@ apply (simp add: ssum_map_map u_emb_bottom) done -setup {* +setup \ Domain_Take_Proofs.add_rec_type (@{type_name "sum"}, [true, true]) -*} +\ end diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/HOLCF/Lift.thy --- a/src/HOL/HOLCF/Lift.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/HOLCF/Lift.thy Wed Jan 13 23:07:06 2016 +0100 @@ -2,7 +2,7 @@ Author: Olaf Mueller *) -section {* Lifting types of class type to flat pcpo's *} +section \Lifting types of class type to flat pcpo's\ theory Lift imports Discrete Up @@ -19,7 +19,7 @@ Def :: "'a \ 'a lift" where "Def x = Abs_lift (up\(Discr x))" -subsection {* Lift as a datatype *} +subsection \Lift as a datatype\ lemma lift_induct: "\P \; \x. P (Def x)\ \ P y" apply (induct y) @@ -32,7 +32,7 @@ old_rep_datatype "\::'a lift" Def by (erule lift_induct) (simp_all add: Def_def Abs_lift_inject inst_lift_pcpo) -text {* @{term bottom} and @{term Def} *} +text \@{term bottom} and @{term Def}\ lemma not_Undef_is_Def: "(x \ \) = (\y. x = Def y)" by (cases x) simp_all @@ -40,14 +40,13 @@ lemma lift_definedE: "\x \ \; \a. x = Def a \ R\ \ R" by (cases x) simp_all -text {* - For @{term "x ~= \"} in assumptions @{text defined} replaces @{text - x} by @{text "Def a"} in conclusion. *} +text \ + For @{term "x ~= \"} in assumptions \defined\ replaces \x\ by \Def a\ in conclusion.\ -method_setup defined = {* +method_setup defined = \ Scan.succeed (fn ctxt => SIMPLE_METHOD' (eresolve_tac ctxt @{thms lift_definedE} THEN' asm_simp_tac ctxt)) -*} +\ lemma DefE: "Def x = \ \ R" by simp @@ -62,7 +61,7 @@ by (induct y, simp, simp add: Def_below_Def) -subsection {* Lift is flat *} +subsection \Lift is flat\ instance lift :: (type) flat proof @@ -71,7 +70,7 @@ by (induct x) auto qed -subsection {* Continuity of @{const case_lift} *} +subsection \Continuity of @{const case_lift}\ lemma case_lift_eq: "case_lift \ f x = fup\(\ y. f (undiscr y))\(Rep_lift x)" apply (induct x, unfold lift.case) @@ -83,7 +82,7 @@ "\\y. cont (\x. f x y); cont g\ \ cont (\x. case_lift \ (f x) (g x))" unfolding case_lift_eq by (simp add: cont_Rep_lift) -subsection {* Further operations *} +subsection \Further operations\ definition flift1 :: "('a \ 'b::pcpo) \ ('a lift \ 'b)" (binder "FLIFT " 10) where diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/HOLCF/LowerPD.thy --- a/src/HOL/HOLCF/LowerPD.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/HOLCF/LowerPD.thy Wed Jan 13 23:07:06 2016 +0100 @@ -2,13 +2,13 @@ Author: Brian Huffman *) -section {* Lower powerdomain *} +section \Lower powerdomain\ theory LowerPD imports Compact_Basis begin -subsection {* Basis preorder *} +subsection \Basis preorder\ definition lower_le :: "'a pd_basis \ 'a pd_basis \ bool" (infix "\\" 50) where @@ -72,7 +72,7 @@ done -subsection {* Type definition *} +subsection \Type definition\ typedef 'a lower_pd ("('(_')\)") = "{S::'a pd_basis set. lower_le.ideal S}" @@ -105,7 +105,7 @@ using lower_principal_def pd_basis_countable by (rule lower_le.typedef_ideal_completion) -text {* Lower powerdomain is pointed *} +text \Lower powerdomain is pointed\ lemma lower_pd_minimal: "lower_principal (PDUnit compact_bot) \ ys" by (induct ys rule: lower_pd.principal_induct, simp, simp) @@ -117,7 +117,7 @@ by (rule lower_pd_minimal [THEN bottomI, symmetric]) -subsection {* Monadic unit and plus *} +subsection \Monadic unit and plus\ definition lower_unit :: "'a \ 'a lower_pd" where @@ -176,11 +176,11 @@ lemmas lower_plus_left_commute = lower_add.left_commute lemmas lower_plus_left_absorb = lower_add.left_idem -text {* Useful for @{text "simp add: lower_plus_ac"} *} +text \Useful for \simp add: lower_plus_ac\\ lemmas lower_plus_ac = lower_plus_assoc lower_plus_commute lower_plus_left_commute -text {* Useful for @{text "simp only: lower_plus_aci"} *} +text \Useful for \simp only: lower_plus_aci\\ lemmas lower_plus_aci = lower_plus_ac lower_plus_absorb lower_plus_left_absorb @@ -267,7 +267,7 @@ by (auto dest!: lower_pd.compact_imp_principal) -subsection {* Induction rules *} +subsection \Induction rules\ lemma lower_pd_induct1: assumes P: "adm P" @@ -297,7 +297,7 @@ done -subsection {* Monadic bind *} +subsection \Monadic bind\ definition lower_bind_basis :: @@ -369,7 +369,7 @@ by (induct xs, simp_all) -subsection {* Map *} +subsection \Map\ definition lower_map :: "('a \ 'b) \ 'a lower_pd \ 'b lower_pd" where @@ -460,7 +460,7 @@ by (rule finite_range_imp_finite_fixes) qed -subsection {* Lower powerdomain is bifinite *} +subsection \Lower powerdomain is bifinite\ lemma approx_chain_lower_map: assumes "approx_chain a" @@ -475,7 +475,7 @@ by (fast intro!: approx_chain_lower_map) qed -subsection {* Join *} +subsection \Join\ definition lower_join :: "'a lower_pd lower_pd \ 'a lower_pd" where diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/HOLCF/Map_Functions.thy --- a/src/HOL/HOLCF/Map_Functions.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/HOLCF/Map_Functions.thy Wed Jan 13 23:07:06 2016 +0100 @@ -2,13 +2,13 @@ Author: Brian Huffman *) -section {* Map functions for various types *} +section \Map functions for various types\ theory Map_Functions imports Deflation begin -subsection {* Map operator for continuous function space *} +subsection \Map operator for continuous function space\ default_sort cpo @@ -105,7 +105,7 @@ by (rule finite_range_imp_finite_fixes) qed -text {* Finite deflations are compact elements of the function space *} +text \Finite deflations are compact elements of the function space\ lemma finite_deflation_imp_compact: "finite_deflation d \ compact d" apply (frule finite_deflation_imp_deflation) @@ -115,7 +115,7 @@ apply (simp only: finite_deflation_cfun_map) done -subsection {* Map operator for product type *} +subsection \Map operator for product type\ definition prod_map :: "('a \ 'b) \ ('c \ 'd) \ 'a \ 'c \ 'b \ 'd" @@ -172,7 +172,7 @@ by (rule finite_subset, simp add: d1.finite_fixes d2.finite_fixes) qed -subsection {* Map function for lifted cpo *} +subsection \Map function for lifted cpo\ definition u_map :: "('a \ 'b) \ 'a u \ 'b u" @@ -218,7 +218,7 @@ by (rule finite_subset, simp add: d.finite_fixes) qed -subsection {* Map function for strict products *} +subsection \Map function for strict products\ default_sort pcpo @@ -299,7 +299,7 @@ by (rule finite_subset, simp add: d1.finite_fixes d2.finite_fixes) qed -subsection {* Map function for strict sums *} +subsection \Map function for strict sums\ definition ssum_map :: "('a \ 'b) \ ('c \ 'd) \ 'a \ 'c \ 'b \ 'd" @@ -383,7 +383,7 @@ by (rule finite_subset, simp add: d1.finite_fixes d2.finite_fixes) qed -subsection {* Map operator for strict function space *} +subsection \Map operator for strict function space\ definition sfun_map :: "('b \ 'a) \ ('c \ 'd) \ ('a \! 'c) \ ('b \! 'd)" @@ -461,7 +461,7 @@ then show "finite {f. sfun_map\d1\d2\f = f}" unfolding sfun_map_def sfun_eq_iff by (simp add: strictify_cancel - deflation_strict `deflation d1` `deflation d2`) + deflation_strict \deflation d1\ \deflation d2\) qed end diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/HOLCF/One.thy --- a/src/HOL/HOLCF/One.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/HOLCF/One.thy Wed Jan 13 23:07:06 2016 +0100 @@ -2,7 +2,7 @@ Author: Oscar Slotosch *) -section {* The unit domain *} +section \The unit domain\ theory One imports Lift @@ -17,7 +17,7 @@ definition ONE :: "one" where "ONE == Def ()" -text {* Exhaustion and Elimination for type @{typ one} *} +text \Exhaustion and Elimination for type @{typ one}\ lemma Exh_one: "t = \ \ t = ONE" unfolding ONE_def by (induct t) simp_all @@ -50,7 +50,7 @@ lemma compact_ONE: "compact ONE" by (rule compact_chfin) -text {* Case analysis function for type @{typ one} *} +text \Case analysis function for type @{typ one}\ definition one_case :: "'a::pcpo \ one \ 'a" where diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/HOLCF/Pcpo.thy --- a/src/HOL/HOLCF/Pcpo.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/HOLCF/Pcpo.thy Wed Jan 13 23:07:06 2016 +0100 @@ -2,21 +2,21 @@ Author: Franz Regensburger *) -section {* Classes cpo and pcpo *} +section \Classes cpo and pcpo\ theory Pcpo imports Porder begin -subsection {* Complete partial orders *} +subsection \Complete partial orders\ -text {* The class cpo of chain complete partial orders *} +text \The class cpo of chain complete partial orders\ class cpo = po + assumes cpo: "chain S \ \x. range S <<| x" begin -text {* in cpo's everthing equal to THE lub has lub properties for every chain *} +text \in cpo's everthing equal to THE lub has lub properties for every chain\ lemma cpo_lubI: "chain S \ range S <<| (\i. S i)" by (fast dest: cpo elim: is_lub_lub) @@ -24,7 +24,7 @@ lemma thelubE: "\chain S; (\i. S i) = l\ \ range S <<| l" by (blast dest: cpo intro: is_lub_lub) -text {* Properties of the lub *} +text \Properties of the lub\ lemma is_ub_thelub: "chain S \ S x \ (\i. S i)" by (blast dest: cpo intro: is_lub_lub [THEN is_lub_rangeD1]) @@ -78,14 +78,14 @@ apply (force elim!: is_ub_thelub) done -text {* the @{text "\"} relation between two chains is preserved by their lubs *} +text \the \\\ relation between two chains is preserved by their lubs\ lemma lub_mono: "\chain X; chain Y; \i. X i \ Y i\ \ (\i. X i) \ (\i. Y i)" by (fast elim: lub_below below_lub) -text {* the = relation between two chains is preserved by their lubs *} +text \the = relation between two chains is preserved by their lubs\ lemma lub_eq: "(\i. X i = Y i) \ (\i. X i) = (\i. Y i)" @@ -135,9 +135,9 @@ end -subsection {* Pointed cpos *} +subsection \Pointed cpos\ -text {* The class pcpo of pointed cpos *} +text \The class pcpo of pointed cpos\ class pcpo = cpo + assumes least: "\x. \y. x \ y" @@ -157,22 +157,22 @@ end -text {* Old "UU" syntax: *} +text \Old "UU" syntax:\ syntax UU :: logic translations "UU" => "CONST bottom" -text {* Simproc to rewrite @{term "\ = x"} to @{term "x = \"}. *} +text \Simproc to rewrite @{term "\ = x"} to @{term "x = \"}.\ -setup {* +setup \ Reorient_Proc.add (fn Const(@{const_name bottom}, _) => true | _ => false) -*} +\ simproc_setup reorient_bottom ("\ = x") = Reorient_Proc.proc -text {* useful lemmas about @{term \} *} +text \useful lemmas about @{term \}\ lemma below_bottom_iff [simp]: "(x \ \) = (x = \)" by (simp add: po_eq_conv) @@ -186,9 +186,9 @@ lemma lub_eq_bottom_iff: "chain Y \ (\i. Y i) = \ \ (\i. Y i = \)" by (simp only: eq_bottom_iff lub_below_iff) -subsection {* Chain-finite and flat cpos *} +subsection \Chain-finite and flat cpos\ -text {* further useful classes for HOLCF domains *} +text \further useful classes for HOLCF domains\ class chfin = po + assumes chfin: "chain Y \ \n. max_in_chain n Y" @@ -230,7 +230,7 @@ end -subsection {* Discrete cpos *} +subsection \Discrete cpos\ class discrete_cpo = below + assumes discrete_cpo [simp]: "x \ y \ x = y" @@ -239,7 +239,7 @@ subclass po proof qed simp_all -text {* In a discrete cpo, every chain is constant *} +text \In a discrete cpo, every chain is constant\ lemma discrete_chain_const: assumes S: "chain S" diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/HOLCF/Plain_HOLCF.thy --- a/src/HOL/HOLCF/Plain_HOLCF.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/HOLCF/Plain_HOLCF.thy Wed Jan 13 23:07:06 2016 +0100 @@ -2,15 +2,15 @@ Author: Brian Huffman *) -section {* Plain HOLCF *} +section \Plain HOLCF\ theory Plain_HOLCF imports Cfun Sfun Cprod Sprod Ssum Up Discrete Lift One Tr Fix begin -text {* +text \ Basic HOLCF concepts and types; does not include definition packages. -*} +\ hide_const (open) Filter.principal diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/HOLCF/Porder.thy --- a/src/HOL/HOLCF/Porder.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/HOLCF/Porder.thy Wed Jan 13 23:07:06 2016 +0100 @@ -2,7 +2,7 @@ Author: Franz Regensburger and Brian Huffman *) -section {* Partial orders *} +section \Partial orders\ theory Porder imports Main @@ -11,7 +11,7 @@ declare [[typedef_overloaded]] -subsection {* Type class for partial orders *} +subsection \Type class for partial orders\ class below = fixes below :: "'a \ 'a \ bool" @@ -70,7 +70,7 @@ context po begin -subsection {* Upper bounds *} +subsection \Upper bounds\ definition is_ub :: "'a set \ 'a \ bool" (infix "<|" 55) where "S <| x \ (\y\S. y \ x)" @@ -102,7 +102,7 @@ lemma is_ub_upward: "\S <| x; x \ y\ \ S <| y" unfolding is_ub_def by (fast intro: below_trans) -subsection {* Least upper bounds *} +subsection \Least upper bounds\ definition is_lub :: "'a set \ 'a \ bool" (infix "<<|" 55) where "S <<| x \ S <| x \ (\u. S <| u \ x \ u)" @@ -131,7 +131,7 @@ notation (ASCII) Lub (binder "LUB " 10) -text {* access to some definition as inference rule *} +text \access to some definition as inference rule\ lemma is_lubD1: "S <<| x \ S <| x" unfolding is_lub_def by fast @@ -145,12 +145,12 @@ lemma is_lub_below_iff: "S <<| x \ x \ u \ S <| u" unfolding is_lub_def is_ub_def by (metis below_trans) -text {* lubs are unique *} +text \lubs are unique\ lemma is_lub_unique: "\S <<| x; S <<| y\ \ x = y" unfolding is_lub_def is_ub_def by (blast intro: below_antisym) -text {* technical lemmas about @{term lub} and @{term is_lub} *} +text \technical lemmas about @{term lub} and @{term is_lub}\ lemma is_lub_lub: "M <<| x \ M <<| lub M" unfolding lub_def by (rule theI [OF _ is_lub_unique]) @@ -176,10 +176,10 @@ lemma lub_maximal: "\S <| x; x \ S\ \ lub S = x" by (rule is_lub_maximal [THEN lub_eqI]) -subsection {* Countable chains *} +subsection \Countable chains\ definition chain :: "(nat \ 'a) \ bool" where - -- {* Here we use countable chains and I prefer to code them as functions! *} + \ \Here we use countable chains and I prefer to code them as functions!\ "chain Y = (\i. Y i \ Y (Suc i))" lemma chainI: "(\i. Y i \ Y (Suc i)) \ chain Y" @@ -188,7 +188,7 @@ lemma chainE: "chain Y \ Y i \ Y (Suc i)" unfolding chain_def by fast -text {* chains are monotone functions *} +text \chains are monotone functions\ lemma chain_mono_less: "\chain Y; i < j\ \ Y i \ Y j" by (erule less_Suc_induct, erule chainE, erule below_trans) @@ -199,7 +199,7 @@ lemma chain_shift: "chain Y \ chain (\i. Y (i + j))" by (rule chainI, simp, erule chainE) -text {* technical lemmas about (least) upper bounds of chains *} +text \technical lemmas about (least) upper bounds of chains\ lemma is_lub_rangeD1: "range S <<| x \ S i \ x" by (rule is_lubD1 [THEN ub_rangeD]) @@ -220,7 +220,7 @@ "chain S \ range (\i. S (i + j)) <<| x = range S <<| x" by (simp add: is_lub_def is_ub_range_shift) -text {* the lub of a constant chain is the constant *} +text \the lub of a constant chain is the constant\ lemma chain_const [simp]: "chain (\i. c)" by (simp add: chainI) @@ -231,16 +231,16 @@ lemma lub_const [simp]: "(\i. c) = c" by (rule is_lub_const [THEN lub_eqI]) -subsection {* Finite chains *} +subsection \Finite chains\ definition max_in_chain :: "nat \ (nat \ 'a) \ bool" where - -- {* finite chains, needed for monotony of continuous functions *} + \ \finite chains, needed for monotony of continuous functions\ "max_in_chain i C \ (\j. i \ j \ C i = C j)" definition finite_chain :: "(nat \ 'a) \ bool" where "finite_chain C = (chain C \ (\i. max_in_chain i C))" -text {* results about finite chains *} +text \results about finite chains\ lemma max_in_chainI: "(\j. i \ j \ Y i = Y j) \ max_in_chain i Y" unfolding max_in_chain_def by fast @@ -336,7 +336,7 @@ apply simp done -text {* the maximal element in a chain is its lub *} +text \the maximal element in a chain is its lub\ lemma lub_chain_maxelem: "\Y i = c; \i. Y i \ c\ \ lub (range Y) = c" by (blast dest: ub_rangeD intro: lub_eqI is_lubI ub_rangeI) diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/HOLCF/Powerdomains.thy --- a/src/HOL/HOLCF/Powerdomains.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/HOLCF/Powerdomains.thy Wed Jan 13 23:07:06 2016 +0100 @@ -2,13 +2,13 @@ Author: Brian Huffman *) -section {* Powerdomains *} +section \Powerdomains\ theory Powerdomains imports ConvexPD Domain begin -subsection {* Universal domain embeddings *} +subsection \Universal domain embeddings\ definition "upper_emb = udom_emb (\i. upper_map\(udom_approx i))" definition "upper_prj = udom_prj (\i. upper_map\(udom_approx i))" @@ -31,7 +31,7 @@ unfolding convex_emb_def convex_prj_def by (simp add: ep_pair_udom approx_chain_convex_map) -subsection {* Deflation combinators *} +subsection \Deflation combinators\ definition upper_defl :: "udom defl \ udom defl" where "upper_defl = defl_fun1 upper_emb upper_prj upper_map" @@ -57,7 +57,7 @@ using ep_pair_convex finite_deflation_convex_map unfolding convex_defl_def by (rule cast_defl_fun1) -subsection {* Domain class instances *} +subsection \Domain class instances\ instantiation upper_pd :: ("domain") "domain" begin @@ -167,7 +167,7 @@ lemma DEFL_convex: "DEFL('a::domain convex_pd) = convex_defl\DEFL('a)" by (rule defl_convex_pd_def) -subsection {* Isomorphic deflations *} +subsection \Isomorphic deflations\ lemma isodefl_upper: "isodefl d t \ isodefl (upper_map\d) (upper_defl\t)" @@ -193,7 +193,7 @@ apply (simp add: convex_map_map) done -subsection {* Domain package setup for powerdomains *} +subsection \Domain package setup for powerdomains\ lemmas [domain_defl_simps] = DEFL_upper DEFL_lower DEFL_convex lemmas [domain_map_ID] = upper_map_ID lower_map_ID convex_map_ID @@ -202,11 +202,11 @@ lemmas [domain_deflation] = deflation_upper_map deflation_lower_map deflation_convex_map -setup {* +setup \ fold Domain_Take_Proofs.add_rec_type [(@{type_name "upper_pd"}, [true]), (@{type_name "lower_pd"}, [true]), (@{type_name "convex_pd"}, [true])] -*} +\ end diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/HOLCF/Product_Cpo.thy --- a/src/HOL/HOLCF/Product_Cpo.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/HOLCF/Product_Cpo.thy Wed Jan 13 23:07:06 2016 +0100 @@ -2,7 +2,7 @@ Author: Franz Regensburger *) -section {* The cpo of cartesian products *} +section \The cpo of cartesian products\ theory Product_Cpo imports Adm @@ -10,7 +10,7 @@ default_sort cpo -subsection {* Unit type is a pcpo *} +subsection \Unit type is a pcpo\ instantiation unit :: discrete_cpo begin @@ -27,7 +27,7 @@ by intro_classes simp -subsection {* Product type is a partial order *} +subsection \Product type is a partial order\ instantiation prod :: (below, below) below begin @@ -55,7 +55,7 @@ by (fast intro: below_trans) qed -subsection {* Monotonicity of \emph{Pair}, \emph{fst}, \emph{snd} *} +subsection \Monotonicity of \emph{Pair}, \emph{fst}, \emph{snd}\ lemma prod_belowI: "\fst p \ fst q; snd p \ snd q\ \ p \ q" unfolding below_prod_def by simp @@ -63,7 +63,7 @@ lemma Pair_below_iff [simp]: "(a, b) \ (c, d) \ a \ c \ b \ d" unfolding below_prod_def by simp -text {* Pair @{text "(_,_)"} is monotone in both arguments *} +text \Pair \(_,_)\ is monotone in both arguments\ lemma monofun_pair1: "monofun (\x. (x, y))" by (simp add: monofun_def) @@ -79,7 +79,7 @@ "chain X \ chain Y \ chain (\i. (X i, Y i))" by (rule chainI, simp add: chainE) -text {* @{term fst} and @{term snd} are monotone *} +text \@{term fst} and @{term snd} are monotone\ lemma fst_monofun: "x \ y \ fst x \ fst y" unfolding below_prod_def by simp @@ -102,12 +102,12 @@ obtains A B where "chain A" and "chain B" and "Y = (\i. (A i, B i))" proof - from `chain Y` show "chain (\i. fst (Y i))" by (rule ch2ch_fst) - from `chain Y` show "chain (\i. snd (Y i))" by (rule ch2ch_snd) + from \chain Y\ show "chain (\i. fst (Y i))" by (rule ch2ch_fst) + from \chain Y\ show "chain (\i. snd (Y i))" by (rule ch2ch_snd) show "Y = (\i. (fst (Y i), snd (Y i)))" by simp qed -subsection {* Product type is a cpo *} +subsection \Product type is a cpo\ lemma is_lub_Pair: "\range A <<| x; range B <<| y\ \ range (\i. (A i, B i)) <<| (x, y)" @@ -146,7 +146,7 @@ by simp qed -subsection {* Product type is pointed *} +subsection \Product type is pointed\ lemma minimal_prod: "(\, \) \ p" by (simp add: below_prod_def) @@ -172,7 +172,7 @@ lemma split_strict [simp]: "case_prod f \ = f \ \" unfolding split_def by simp -subsection {* Continuity of \emph{Pair}, \emph{fst}, \emph{snd} *} +subsection \Continuity of \emph{Pair}, \emph{fst}, \emph{snd}\ lemma cont_pair1: "cont (\x. (x, y))" apply (rule contI) @@ -252,22 +252,22 @@ shows "cont (\x. case_prod (f x) (g x))" using assms by (simp add: cont2cont_case_prod prod_cont_iff) -text {* The simple version (due to Joachim Breitner) is needed if - either element type of the pair is not a cpo. *} +text \The simple version (due to Joachim Breitner) is needed if + either element type of the pair is not a cpo.\ lemma cont2cont_split_simple [simp, cont2cont]: assumes "\a b. cont (\x. f x a b)" shows "cont (\x. case p of (a, b) \ f x a b)" using assms by (cases p) auto -text {* Admissibility of predicates on product types. *} +text \Admissibility of predicates on product types.\ lemma adm_case_prod [simp]: assumes "adm (\x. P x (fst (f x)) (snd (f x)))" shows "adm (\x. case f x of (a, b) \ P x a b)" unfolding case_prod_beta using assms . -subsection {* Compactness and chain-finiteness *} +subsection \Compactness and chain-finiteness\ lemma fst_below_iff: "fst (x::'a \ 'b) \ y \ x \ (y, snd x)" unfolding below_prod_def by simp diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/HOLCF/Representable.thy --- a/src/HOL/HOLCF/Representable.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/HOLCF/Representable.thy Wed Jan 13 23:07:06 2016 +0100 @@ -2,7 +2,7 @@ Author: Brian Huffman *) -section {* Representable domains *} +section \Representable domains\ theory Representable imports Algebraic Map_Functions "~~/src/HOL/Library/Countable" @@ -10,9 +10,9 @@ default_sort cpo -subsection {* Class of representable domains *} +subsection \Class of representable domains\ -text {* +text \ We define a ``domain'' as a pcpo that is isomorphic to some algebraic deflation over the universal domain; this is equivalent to being omega-bifinite. @@ -20,7 +20,7 @@ A predomain is a cpo that, when lifted, becomes a domain. Predomains are represented by deflations over a lifted universal domain type. -*} +\ class predomain_syn = cpo + fixes liftemb :: "'a\<^sub>\ \ udom\<^sub>\" @@ -63,16 +63,16 @@ by (simp add: cast_liftdefl_of cast_DEFL u_map_oo) qed -text {* +text \ Constants @{const liftemb} and @{const liftprj} imply class predomain. -*} +\ -setup {* +setup \ fold Sign.add_const_constraint [(@{const_name liftemb}, SOME @{typ "'a::predomain u \ udom u"}), (@{const_name liftprj}, SOME @{typ "udom u \ 'a::predomain u"}), (@{const_name liftdefl}, SOME @{typ "'a::predomain itself \ udom u defl"})] -*} +\ interpretation predomain: pcpo_ep_pair liftemb liftprj unfolding pcpo_ep_pair_def by (rule predomain_ep) @@ -86,7 +86,7 @@ lemmas emb_strict = domain.e_strict lemmas prj_strict = domain.p_strict -subsection {* Domains are bifinite *} +subsection \Domains are bifinite\ lemma approx_chain_ep_cast: assumes ep: "ep_pair (e::'a::pcpo \ 'b::bifinite) (p::'b \ 'a)" @@ -124,7 +124,7 @@ instance predomain \ profinite by standard (rule approx_chain_ep_cast [OF predomain_ep cast_liftdefl]) -subsection {* Universal domain ep-pairs *} +subsection \Universal domain ep-pairs\ definition "u_emb = udom_emb (\i. u_map\(udom_approx i))" definition "u_prj = udom_prj (\i. u_map\(udom_approx i))" @@ -161,7 +161,7 @@ unfolding sfun_emb_def sfun_prj_def by (simp add: ep_pair_udom approx_chain_sfun_map) -subsection {* Type combinators *} +subsection \Type combinators\ definition u_defl :: "udom defl \ udom defl" where "u_defl = defl_fun1 u_emb u_prj u_map" @@ -207,7 +207,7 @@ using ep_pair_sfun finite_deflation_sfun_map unfolding sfun_defl_def by (rule cast_defl_fun2) -text {* Special deflation combinator for unpointed types. *} +text \Special deflation combinator for unpointed types.\ definition u_liftdefl :: "udom u defl \ udom defl" where "u_liftdefl = defl_fun1 u_emb u_prj ID" @@ -221,9 +221,9 @@ by (rule cast_eq_imp_eq) (simp add: cast_u_liftdefl cast_liftdefl_of cast_u_defl) -subsection {* Class instance proofs *} +subsection \Class instance proofs\ -subsubsection {* Universal domain *} +subsubsection \Universal domain\ instantiation udom :: "domain" begin @@ -265,7 +265,7 @@ end -subsubsection {* Lifted cpo *} +subsubsection \Lifted cpo\ instantiation u :: (predomain) "domain" begin @@ -302,7 +302,7 @@ lemma DEFL_u: "DEFL('a::predomain u) = u_liftdefl\LIFTDEFL('a)" by (rule defl_u_def) -subsubsection {* Strict function space *} +subsubsection \Strict function space\ instantiation sfun :: ("domain", "domain") "domain" begin @@ -340,7 +340,7 @@ "DEFL('a::domain \! 'b::domain) = sfun_defl\DEFL('a)\DEFL('b)" by (rule defl_sfun_def) -subsubsection {* Continuous function space *} +subsubsection \Continuous function space\ instantiation cfun :: (predomain, "domain") "domain" begin @@ -380,7 +380,7 @@ "DEFL('a::predomain \ 'b::domain) = DEFL('a u \! 'b)" by (rule defl_cfun_def) -subsubsection {* Strict product *} +subsubsection \Strict product\ instantiation sprod :: ("domain", "domain") "domain" begin @@ -418,7 +418,7 @@ "DEFL('a::domain \ 'b::domain) = sprod_defl\DEFL('a)\DEFL('b)" by (rule defl_sprod_def) -subsubsection {* Cartesian product *} +subsubsection \Cartesian product\ definition prod_liftdefl :: "udom u defl \ udom u defl \ udom u defl" where "prod_liftdefl = defl_fun2 (u_map\prod_emb oo decode_prod_u) @@ -506,7 +506,7 @@ prod_liftdefl\LIFTDEFL('a)\LIFTDEFL('b)" by (rule liftdefl_prod_def) -subsubsection {* Unit type *} +subsubsection \Unit type\ instantiation unit :: "domain" begin @@ -539,7 +539,7 @@ end -subsubsection {* Discrete cpo *} +subsubsection \Discrete cpo\ instantiation discr :: (countable) predomain begin @@ -584,7 +584,7 @@ end -subsubsection {* Strict sum *} +subsubsection \Strict sum\ instantiation ssum :: ("domain", "domain") "domain" begin @@ -622,7 +622,7 @@ "DEFL('a::domain \ 'b::domain) = ssum_defl\DEFL('a)\DEFL('b)" by (rule defl_ssum_def) -subsubsection {* Lifted HOL type *} +subsubsection \Lifted HOL type\ instantiation lift :: (countable) "domain" begin diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/HOLCF/Sfun.thy --- a/src/HOL/HOLCF/Sfun.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/HOLCF/Sfun.thy Wed Jan 13 23:07:06 2016 +0100 @@ -2,7 +2,7 @@ Author: Brian Huffman *) -section {* The Strict Function Type *} +section \The Strict Function Type\ theory Sfun imports Cfun @@ -15,7 +15,7 @@ type_notation (ASCII) sfun (infixr "->!" 0) -text {* TODO: Define nice syntax for abstraction, application. *} +text \TODO: Define nice syntax for abstraction, application.\ definition sfun_abs :: "('a \ 'b) \ ('a \! 'b)" diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/HOLCF/Sprod.thy --- a/src/HOL/HOLCF/Sprod.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/HOLCF/Sprod.thy Wed Jan 13 23:07:06 2016 +0100 @@ -3,7 +3,7 @@ Author: Brian Huffman *) -section {* The type of strict products *} +section \The type of strict products\ theory Sprod imports Cfun @@ -11,7 +11,7 @@ default_sort pcpo -subsection {* Definition of strict product type *} +subsection \Definition of strict product type\ definition "sprod = {p::'a \ 'b. p = \ \ (fst p \ \ \ snd p \ \)}" @@ -25,7 +25,7 @@ sprod (infixr "**" 20) -subsection {* Definitions of constants *} +subsection \Definitions of constants\ definition sfst :: "('a ** 'b) \ 'a" where @@ -53,7 +53,7 @@ translations "\(CONST spair\x\y). t" == "CONST ssplit\(\ x y. t)" -subsection {* Case analysis *} +subsection \Case analysis\ lemma spair_sprod: "(seq\b\a, seq\a\b) \ sprod" by (simp add: sprod_def seq_conv_if) @@ -74,7 +74,7 @@ "\P \; \x y. \x \ \; y \ \\ \ P (:x, y:)\ \ P x" by (cases x, simp_all) -subsection {* Properties of \emph{spair} *} +subsection \Properties of \emph{spair}\ lemma spair_strict1 [simp]: "(:\, y:) = \" by (simp add: Rep_sprod_simps) @@ -124,7 +124,7 @@ lemma sprodE2: "(\x y. p = (:x, y:) \ Q) \ Q" by (cases p, simp only: inst_sprod_pcpo2, simp) -subsection {* Properties of \emph{sfst} and \emph{ssnd} *} +subsection \Properties of \emph{sfst} and \emph{ssnd}\ lemma sfst_strict [simp]: "sfst\\ = \" by (simp add: sfst_def cont_Rep_sprod Rep_sprod_strict) @@ -169,7 +169,7 @@ apply (simp add: below_sprod) done -subsection {* Compactness *} +subsection \Compactness\ lemma compact_sfst: "compact x \ compact (sfst\x)" by (rule compactI, simp add: sfst_below_iff) @@ -189,7 +189,7 @@ apply simp done -subsection {* Properties of \emph{ssplit} *} +subsection \Properties of \emph{ssplit}\ lemma ssplit1 [simp]: "ssplit\f\\ = \" by (simp add: ssplit_def) @@ -200,7 +200,7 @@ lemma ssplit3 [simp]: "ssplit\spair\z = z" by (cases z, simp_all) -subsection {* Strict product preserves flatness *} +subsection \Strict product preserves flatness\ instance sprod :: (flat, flat) flat proof diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/HOLCF/Ssum.thy --- a/src/HOL/HOLCF/Ssum.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/HOLCF/Ssum.thy Wed Jan 13 23:07:06 2016 +0100 @@ -3,7 +3,7 @@ Author: Brian Huffman *) -section {* The type of strict sums *} +section \The type of strict sums\ theory Ssum imports Tr @@ -11,7 +11,7 @@ default_sort pcpo -subsection {* Definition of strict sum type *} +subsection \Definition of strict sum type\ definition "ssum = @@ -29,7 +29,7 @@ ssum (infixr "++" 10) -subsection {* Definitions of constructors *} +subsection \Definitions of constructors\ definition sinl :: "'a \ ('a ++ 'b)" where @@ -56,9 +56,9 @@ prod_eq_iff below_prod_def Rep_ssum_strict Rep_ssum_sinl Rep_ssum_sinr -subsection {* Properties of \emph{sinl} and \emph{sinr} *} +subsection \Properties of \emph{sinl} and \emph{sinr}\ -text {* Ordering *} +text \Ordering\ lemma sinl_below [simp]: "(sinl\x \ sinl\y) = (x \ y)" by (simp add: Rep_ssum_simps seq_conv_if) @@ -72,7 +72,7 @@ lemma sinr_below_sinl [simp]: "(sinr\x \ sinl\y) = (x = \)" by (simp add: Rep_ssum_simps seq_conv_if) -text {* Equality *} +text \Equality\ lemma sinl_eq [simp]: "(sinl\x = sinl\y) = (x = y)" by (simp add: po_eq_conv) @@ -92,7 +92,7 @@ lemma sinr_inject: "sinr\x = sinr\y \ x = y" by (rule sinr_eq [THEN iffD1]) -text {* Strictness *} +text \Strictness\ lemma sinl_strict [simp]: "sinl\\ = \" by (simp add: Rep_ssum_simps) @@ -112,7 +112,7 @@ lemma sinr_defined: "x \ \ \ sinr\x \ \" by simp -text {* Compactness *} +text \Compactness\ lemma compact_sinl: "compact x \ compact (sinl\x)" by (rule compact_ssum, simp add: Rep_ssum_sinl) @@ -134,7 +134,7 @@ lemma compact_sinr_iff [simp]: "compact (sinr\x) = compact x" by (safe elim!: compact_sinr compact_sinrD) -subsection {* Case analysis *} +subsection \Case analysis\ lemma ssumE [case_names bottom sinl sinr, cases type: ssum]: obtains "p = \" @@ -158,7 +158,7 @@ lemma below_sinrD: "p \ sinr\x \ \y. p = sinr\y \ y \ x" by (cases p, rule_tac x="\" in exI, simp_all) -subsection {* Case analysis combinator *} +subsection \Case analysis combinator\ definition sscase :: "('a \ 'c) \ ('b \ 'c) \ ('a ++ 'b) \ 'c" where @@ -188,7 +188,7 @@ lemma sscase4 [simp]: "sscase\sinl\sinr\z = z" by (cases z, simp_all) -subsection {* Strict sum preserves flatness *} +subsection \Strict sum preserves flatness\ instance ssum :: (flat, flat) flat apply (intro_classes, clarify) diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/HOLCF/Tr.thy --- a/src/HOL/HOLCF/Tr.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/HOLCF/Tr.thy Wed Jan 13 23:07:06 2016 +0100 @@ -2,13 +2,13 @@ Author: Franz Regensburger *) -section {* The type of lifted booleans *} +section \The type of lifted booleans\ theory Tr imports Lift begin -subsection {* Type definition and constructors *} +subsection \Type definition and constructors\ type_synonym tr = "bool lift" @@ -24,7 +24,7 @@ FF :: "tr" where "FF = Def False" -text {* Exhaustion and Elimination for type @{typ tr} *} +text \Exhaustion and Elimination for type @{typ tr}\ lemma Exh_tr: "t = \ \ t = TT \ t = FF" unfolding FF_def TT_def by (induct t) auto @@ -37,7 +37,7 @@ "\P \; P TT; P FF\ \ P x" by (cases x) simp_all -text {* distinctness for type @{typ tr} *} +text \distinctness for type @{typ tr}\ lemma dist_below_tr [simp]: "TT \ \" "FF \ \" "TT \ FF" "FF \ TT" @@ -60,7 +60,7 @@ by (induct x) simp_all -subsection {* Case analysis *} +subsection \Case analysis\ default_sort pcpo @@ -83,7 +83,7 @@ by (simp_all add: tr_case_def TT_def FF_def) -subsection {* Boolean connectives *} +subsection \Boolean connectives\ definition trand :: "tr \ tr \ tr" where @@ -107,11 +107,11 @@ If2 :: "[tr, 'c, 'c] \ 'c" where "If2 Q x y = (If Q then x else y)" -text {* tactic for tr-thms with case split *} +text \tactic for tr-thms with case split\ lemmas tr_defs = andalso_def orelse_def neg_def tr_case_def TT_def FF_def -text {* lemmas about andalso, orelse, neg and if *} +text \lemmas about andalso, orelse, neg and if\ lemma andalso_thms [simp]: "(TT andalso y) = y" @@ -141,7 +141,7 @@ "neg\\ = \" by (simp_all add: neg_def TT_def FF_def) -text {* split-tac for If via If2 because the constant has to be a constant *} +text \split-tac for If via If2 because the constant has to be a constant\ lemma split_If2: "P (If2 Q x y) = ((Q = \ \ P \) \ (Q = TT \ P x) \ (Q = FF \ P y))" @@ -151,11 +151,11 @@ done (* FIXME unused!? *) -ML {* +ML \ fun split_If_tac ctxt = simp_tac (put_simpset HOL_basic_ss ctxt addsimps [@{thm If2_def} RS sym]) THEN' (split_tac ctxt [@{thm split_If2}]) -*} +\ subsection "Rewriting of HOLCF operations to HOL functions" @@ -189,7 +189,7 @@ apply (auto simp add: TT_def[symmetric] FF_def[symmetric]) done -subsection {* Compactness *} +subsection \Compactness\ lemma compact_TT: "compact TT" by (rule compact_chfin) diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/HOLCF/Tutorial/Domain_ex.thy --- a/src/HOL/HOLCF/Tutorial/Domain_ex.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/HOLCF/Tutorial/Domain_ex.thy Wed Jan 13 23:07:06 2016 +0100 @@ -2,43 +2,43 @@ Author: Brian Huffman *) -section {* Domain package examples *} +section \Domain package examples\ theory Domain_ex imports HOLCF begin -text {* Domain constructors are strict by default. *} +text \Domain constructors are strict by default.\ domain d1 = d1a | d1b "d1" "d1" lemma "d1b\\\y = \" by simp -text {* Constructors can be made lazy using the @{text "lazy"} keyword. *} +text \Constructors can be made lazy using the \lazy\ keyword.\ domain d2 = d2a | d2b (lazy "d2") lemma "d2b\x \ \" by simp -text {* Strict and lazy arguments may be mixed arbitrarily. *} +text \Strict and lazy arguments may be mixed arbitrarily.\ domain d3 = d3a | d3b (lazy "d2") "d2" lemma "P (d3b\x\y = \) \ P (y = \)" by simp -text {* Selectors can be used with strict or lazy constructor arguments. *} +text \Selectors can be used with strict or lazy constructor arguments.\ domain d4 = d4a | d4b (lazy d4b_left :: "d2") (d4b_right :: "d2") lemma "y \ \ \ d4b_left\(d4b\x\y) = x" by simp -text {* Mixfix declarations can be given for data constructors. *} +text \Mixfix declarations can be given for data constructors.\ domain d5 = d5a | d5b (lazy "d5") "d5" (infixl ":#:" 70) lemma "d5a \ x :#: y :#: z" by simp -text {* Mixfix declarations can also be given for type constructors. *} +text \Mixfix declarations can also be given for type constructors.\ domain ('a, 'b) lazypair (infixl ":*:" 25) = lpair (lazy lfst :: 'a) (lazy lsnd :: 'b) (infixl ":*:" 75) @@ -46,34 +46,34 @@ lemma "\p::('a :*: 'b). p \ lfst\p :*: lsnd\p" by (rule allI, case_tac p, simp_all) -text {* Non-recursive constructor arguments can have arbitrary types. *} +text \Non-recursive constructor arguments can have arbitrary types.\ domain ('a, 'b) d6 = d6 "int lift" "'a \ 'b u" (lazy "('a :*: 'b) \ ('b \ 'a)") -text {* +text \ Indirect recusion is allowed for sums, products, lifting, and the continuous function space. However, the domain package does not generate an induction rule in terms of the constructors. -*} +\ domain 'a d7 = d7a "'a d7 \ int lift" | d7b "'a \ 'a d7" | d7c (lazy "'a d7 \ 'a") - -- "Indirect recursion detected, skipping proofs of (co)induction rules" + \ "Indirect recursion detected, skipping proofs of (co)induction rules" -text {* Note that @{text d7.induct} is absent. *} +text \Note that \d7.induct\ is absent.\ -text {* +text \ Indirect recursion is also allowed using previously-defined datatypes. -*} +\ domain 'a slist = SNil | SCons 'a "'a slist" domain 'a stree = STip | SBranch "'a stree slist" -text {* Mutually-recursive datatypes can be defined using the @{text "and"} keyword. *} +text \Mutually-recursive datatypes can be defined using the \and\ keyword.\ domain d8 = d8a | d8b "d9" and d9 = d9a | d9b (lazy "d8") -text {* Non-regular recursion is not allowed. *} +text \Non-regular recursion is not allowed.\ (* domain ('a, 'b) altlist = ANil | ACons 'a "('b, 'a) altlist" -- "illegal direct recursion with different arguments" @@ -81,54 +81,54 @@ -- "illegal direct recursion with different arguments" *) -text {* +text \ Mutually-recursive datatypes must have all the same type arguments, not necessarily in the same order. -*} +\ domain ('a, 'b) list1 = Nil1 | Cons1 'a "('b, 'a) list2" and ('b, 'a) list2 = Nil2 | Cons2 'b "('a, 'b) list1" -text {* Induction rules for flat datatypes have no admissibility side-condition. *} +text \Induction rules for flat datatypes have no admissibility side-condition.\ domain 'a flattree = Tip | Branch "'a flattree" "'a flattree" lemma "\P \; P Tip; \x y. \x \ \; y \ \; P x; P y\ \ P (Branch\x\y)\ \ P x" -by (rule flattree.induct) -- "no admissibility requirement" +by (rule flattree.induct) \ "no admissibility requirement" -text {* Trivial datatypes will produce a warning message. *} +text \Trivial datatypes will produce a warning message.\ domain triv = Triv triv triv - -- "domain @{text Domain_ex.triv} is empty!" + \ "domain \Domain_ex.triv\ is empty!" lemma "(x::triv) = \" by (induct x, simp_all) -text {* Lazy constructor arguments may have unpointed types. *} +text \Lazy constructor arguments may have unpointed types.\ domain natlist = nnil | ncons (lazy "nat discr") natlist -text {* Class constraints may be given for type parameters on the LHS. *} +text \Class constraints may be given for type parameters on the LHS.\ domain ('a::predomain) box = Box (lazy 'a) domain ('a::countable) stream = snil | scons (lazy "'a discr") "'a stream" -subsection {* Generated constants and theorems *} +subsection \Generated constants and theorems\ domain 'a tree = Leaf (lazy 'a) | Node (left :: "'a tree") (right :: "'a tree") lemmas tree_abs_bottom_iff = iso.abs_bottom_iff [OF iso.intro [OF tree.abs_iso tree.rep_iso]] -text {* Rules about ismorphism *} +text \Rules about ismorphism\ term tree_rep term tree_abs thm tree.rep_iso thm tree.abs_iso thm tree.iso_rews -text {* Rules about constructors *} +text \Rules about constructors\ term Leaf term Node thm Leaf_def Node_def @@ -141,27 +141,27 @@ thm tree.inverts thm tree.injects -text {* Rules about case combinator *} +text \Rules about case combinator\ term tree_case thm tree.tree_case_def thm tree.case_rews -text {* Rules about selectors *} +text \Rules about selectors\ term left term right thm tree.sel_rews -text {* Rules about discriminators *} +text \Rules about discriminators\ term is_Leaf term is_Node thm tree.dis_rews -text {* Rules about monadic pattern match combinators *} +text \Rules about monadic pattern match combinators\ term match_Leaf term match_Node thm tree.match_rews -text {* Rules about take function *} +text \Rules about take function\ term tree_take thm tree.take_def thm tree.take_0 @@ -176,23 +176,23 @@ thm tree.reach thm tree.finite_induct -text {* Rules about finiteness predicate *} +text \Rules about finiteness predicate\ term tree_finite thm tree.finite_def thm tree.finite (* only generated for flat datatypes *) -text {* Rules about bisimulation predicate *} +text \Rules about bisimulation predicate\ term tree_bisim thm tree.bisim_def thm tree.coinduct -text {* Induction rule *} +text \Induction rule\ thm tree.induct -subsection {* Known bugs *} +subsection \Known bugs\ -text {* Declaring a mixfix with spaces causes some strange parse errors. *} +text \Declaring a mixfix with spaces causes some strange parse errors.\ (* domain xx = xx ("x y") -- "Inner syntax error: unexpected end of input" diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/HOLCF/Tutorial/Fixrec_ex.thy --- a/src/HOL/HOLCF/Tutorial/Fixrec_ex.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/HOLCF/Tutorial/Fixrec_ex.thy Wed Jan 13 23:07:06 2016 +0100 @@ -2,50 +2,50 @@ Author: Brian Huffman *) -section {* Fixrec package examples *} +section \Fixrec package examples\ theory Fixrec_ex imports HOLCF begin -subsection {* Basic @{text fixrec} examples *} +subsection \Basic \fixrec\ examples\ -text {* +text \ Fixrec patterns can mention any constructor defined by the domain package, as well as any of the following built-in constructors: Pair, spair, sinl, sinr, up, ONE, TT, FF. -*} +\ -text {* Typical usage is with lazy constructors. *} +text \Typical usage is with lazy constructors.\ fixrec down :: "'a u \ 'a" where "down\(up\x) = x" -text {* With strict constructors, rewrite rules may require side conditions. *} +text \With strict constructors, rewrite rules may require side conditions.\ fixrec from_sinl :: "'a \ 'b \ 'a" where "x \ \ \ from_sinl\(sinl\x) = x" -text {* Lifting can turn a strict constructor into a lazy one. *} +text \Lifting can turn a strict constructor into a lazy one.\ fixrec from_sinl_up :: "'a u \ 'b \ 'a" where "from_sinl_up\(sinl\(up\x)) = x" -text {* Fixrec also works with the HOL pair constructor. *} +text \Fixrec also works with the HOL pair constructor.\ fixrec down2 :: "'a u \ 'b u \ 'a \ 'b" where "down2\(up\x, up\y) = (x, y)" -subsection {* Examples using @{text fixrec_simp} *} +subsection \Examples using \fixrec_simp\\ -text {* A type of lazy lists. *} +text \A type of lazy lists.\ domain 'a llist = lNil | lCons (lazy 'a) (lazy "'a llist") -text {* A zip function for lazy lists. *} +text \A zip function for lazy lists.\ -text {* Notice that the patterns are not exhaustive. *} +text \Notice that the patterns are not exhaustive.\ fixrec lzip :: "'a llist \ 'b llist \ ('a \ 'b) llist" @@ -53,8 +53,8 @@ "lzip\(lCons\x\xs)\(lCons\y\ys) = lCons\(x, y)\(lzip\xs\ys)" | "lzip\lNil\lNil = lNil" -text {* @{text fixrec_simp} is useful for producing strictness theorems. *} -text {* Note that pattern matching is done in left-to-right order. *} +text \\fixrec_simp\ is useful for producing strictness theorems.\ +text \Note that pattern matching is done in left-to-right order.\ lemma lzip_stricts [simp]: "lzip\\\ys = \" @@ -62,7 +62,7 @@ "lzip\(lCons\x\xs)\\ = \" by fixrec_simp+ -text {* @{text fixrec_simp} can also produce rules for missing cases. *} +text \\fixrec_simp\ can also produce rules for missing cases.\ lemma lzip_undefs [simp]: "lzip\lNil\(lCons\y\ys) = \" @@ -70,14 +70,13 @@ by fixrec_simp+ -subsection {* Pattern matching with bottoms *} +subsection \Pattern matching with bottoms\ -text {* - As an alternative to using @{text fixrec_simp}, it is also possible +text \ + As an alternative to using \fixrec_simp\, it is also possible to use bottom as a constructor pattern. When using a bottom - pattern, the right-hand-side must also be bottom; otherwise, @{text - fixrec} will not be able to prove the equation. -*} + pattern, the right-hand-side must also be bottom; otherwise, \fixrec\ will not be able to prove the equation. +\ fixrec from_sinr_up :: "'a \ 'b\<^sub>\ \ 'b" @@ -85,18 +84,18 @@ "from_sinr_up\\ = \" | "from_sinr_up\(sinr\(up\x)) = x" -text {* +text \ If the function is already strict in that argument, then the bottom pattern does not change the meaning of the function. For example, in the definition of @{term from_sinr_up}, the first equation is actually redundant, and could have been proven separately by - @{text fixrec_simp}. -*} + \fixrec_simp\. +\ -text {* +text \ A bottom pattern can also be used to make a function strict in a certain argument, similar to a bang-pattern in Haskell. -*} +\ fixrec seq :: "'a \ 'b \ 'b" @@ -105,15 +104,15 @@ | "x \ \ \ seq\x\y = y" -subsection {* Skipping proofs of rewrite rules *} +subsection \Skipping proofs of rewrite rules\ -text {* Another zip function for lazy lists. *} +text \Another zip function for lazy lists.\ -text {* +text \ Notice that this version has overlapping patterns. The second equation cannot be proved as a theorem because it only applies when the first pattern fails. -*} +\ fixrec lzip2 :: "'a llist \ 'b llist \ ('a \ 'b) llist" @@ -121,13 +120,13 @@ "lzip2\(lCons\x\xs)\(lCons\y\ys) = lCons\(x, y)\(lzip2\xs\ys)" | (unchecked) "lzip2\xs\ys = lNil" -text {* +text \ Usually fixrec tries to prove all equations as theorems. The "unchecked" option overrides this behavior, so fixrec does not attempt to prove that particular equation. -*} +\ -text {* Simp rules can be generated later using @{text fixrec_simp}. *} +text \Simp rules can be generated later using \fixrec_simp\.\ lemma lzip2_simps [simp]: "lzip2\(lCons\x\xs)\lNil = lNil" @@ -141,17 +140,17 @@ by fixrec_simp+ -subsection {* Mutual recursion with @{text fixrec} *} +subsection \Mutual recursion with \fixrec\\ -text {* Tree and forest types. *} +text \Tree and forest types.\ domain 'a tree = Leaf (lazy 'a) | Branch (lazy "'a forest") and 'a forest = Empty | Trees (lazy "'a tree") "'a forest" -text {* +text \ To define mutually recursive functions, give multiple type signatures - separated by the keyword @{text "and"}. -*} + separated by the keyword \and\. +\ fixrec map_tree :: "('a \ 'b) \ ('a tree \ 'b tree)" @@ -182,25 +181,25 @@ *) -subsection {* Looping simp rules *} +subsection \Looping simp rules\ -text {* +text \ The defining equations of a fixrec definition are declared as simp rules by default. In some cases, especially for constants with no arguments or functions with variable patterns, the defining equations may cause the simplifier to loop. In these cases it will - be necessary to use a @{text "[simp del]"} declaration. -*} + be necessary to use a \[simp del]\ declaration. +\ fixrec repeat :: "'a \ 'a llist" where [simp del]: "repeat\x = lCons\x\(repeat\x)" -text {* +text \ We can derive other non-looping simp rules for @{const repeat} by - using the @{text subst} method with the @{text repeat.simps} rule. -*} + using the \subst\ method with the \repeat.simps\ rule. +\ lemma repeat_simps [simp]: "repeat\x \ \" @@ -212,11 +211,11 @@ "llist_case\z\f\(repeat\x) = f\x\(repeat\x)" by (subst repeat.simps, simp) -text {* +text \ For mutually-recursive constants, looping might only occur if all equations are in the simpset at the same time. In such cases it may - only be necessary to declare @{text "[simp del]"} on one equation. -*} + only be necessary to declare \[simp del]\ on one equation. +\ fixrec inf_tree :: "'a tree" and inf_forest :: "'a forest" @@ -225,7 +224,7 @@ | "inf_forest = Trees\inf_tree\(Trees\inf_tree\Empty)" -subsection {* Using @{text fixrec} inside locales *} +subsection \Using \fixrec\ inside locales\ locale test = fixes foo :: "'a \ 'a" diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/HOLCF/Tutorial/New_Domain.thy --- a/src/HOL/HOLCF/Tutorial/New_Domain.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/HOLCF/Tutorial/New_Domain.thy Wed Jan 13 23:07:06 2016 +0100 @@ -2,57 +2,57 @@ Author: Brian Huffman *) -section {* Definitional domain package *} +section \Definitional domain package\ theory New_Domain imports HOLCF begin -text {* +text \ UPDATE: The definitional back-end is now the default mode of the domain - package. This file should be merged with @{text Domain_ex.thy}. -*} + package. This file should be merged with \Domain_ex.thy\. +\ -text {* - Provided that @{text domain} is the default sort, the @{text new_domain} +text \ + Provided that \domain\ is the default sort, the \new_domain\ package should work with any type definition supported by the old domain package. -*} +\ domain 'a llist = LNil | LCons (lazy 'a) (lazy "'a llist") -text {* +text \ The difference is that the new domain package is completely definitional, and does not generate any axioms. The following type and constant definitions are not produced by the old domain package. -*} +\ thm type_definition_llist thm llist_abs_def llist_rep_def -text {* +text \ The new domain package also adds support for indirect recursion with user-defined datatypes. This definition of a tree datatype uses indirect recursion through the lazy list type constructor. -*} +\ domain 'a ltree = Leaf (lazy 'a) | Branch (lazy "'a ltree llist") -text {* +text \ For indirect-recursive definitions, the domain package is not able to generate a high-level induction rule. (It produces a warning message instead.) The low-level reach lemma (now proved as a theorem, no longer generated as an axiom) can be used to derive other induction rules. -*} +\ thm ltree.reach -text {* +text \ The definition of the take function uses map functions associated with each type constructor involved in the definition. A map function for the lazy list type has been generated by the new domain package. -*} +\ thm ltree.take_rews thm llist_map_def diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/HOLCF/Universal.thy --- a/src/HOL/HOLCF/Universal.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/HOLCF/Universal.thy Wed Jan 13 23:07:06 2016 +0100 @@ -2,15 +2,15 @@ Author: Brian Huffman *) -section {* A universal bifinite domain *} +section \A universal bifinite domain\ theory Universal imports Bifinite Completion "~~/src/HOL/Library/Nat_Bijection" begin -subsection {* Basis for universal domain *} +subsection \Basis for universal domain\ -subsubsection {* Basis datatype *} +subsubsection \Basis datatype\ type_synonym ubasis = nat @@ -77,7 +77,7 @@ apply (simp add: 2 node_gt1 node_gt2) done -subsubsection {* Basis ordering *} +subsubsection \Basis ordering\ inductive ubasis_le :: "nat \ nat \ bool" @@ -103,7 +103,7 @@ apply (erule (1) ubasis_le_trans) done -subsubsection {* Generic take function *} +subsubsection \Generic take function\ function ubasis_until :: "(ubasis \ bool) \ ubasis \ ubasis" @@ -195,7 +195,7 @@ done -subsection {* Defining the universal domain by ideal completion *} +subsection \Defining the universal domain by ideal completion\ typedef udom = "{S. udom.ideal S}" by (rule udom.ex_ideal) @@ -230,7 +230,7 @@ using udom_principal_def ubasis_countable by (rule udom.typedef_ideal_completion) -text {* Universal domain is pointed *} +text \Universal domain is pointed\ lemma udom_minimal: "udom_principal 0 \ x" apply (induct x rule: udom.principal_induct) @@ -244,7 +244,7 @@ by (rule udom_minimal [THEN bottomI, symmetric]) -subsection {* Compact bases of domains *} +subsection \Compact bases of domains\ typedef 'a compact_basis = "{x::'a::pcpo. compact x}" by auto @@ -285,16 +285,16 @@ unfolding compact_le_def Rep_compact_bot by simp -subsection {* Universality of \emph{udom} *} +subsection \Universality of \emph{udom}\ -text {* We use a locale to parameterize the construction over a chain -of approx functions on the type to be embedded. *} +text \We use a locale to parameterize the construction over a chain +of approx functions on the type to be embedded.\ locale bifinite_approx_chain = approx_chain approx for approx :: "nat \ 'a::bifinite \ 'a" begin -subsubsection {* Choosing a maximal element from a finite set *} +subsubsection \Choosing a maximal element from a finite set\ lemma finite_has_maximal: fixes A :: "'a compact_basis set" @@ -304,7 +304,7 @@ show ?case by simp next case (insert a A) - from `\x\A. \y\A. x \ y \ x = y` + from \\x\A. \y\A. x \ y \ x = y\ obtain x where x: "x \ A" and x_eq: "\y. \y \ A; x \ y\ \ x = y" by fast show ?case @@ -408,7 +408,7 @@ apply (simp add: choose_pos.simps) done -subsubsection {* Compact basis take function *} +subsubsection \Compact basis take function\ primrec cb_take :: "nat \ 'a compact_basis \ 'a compact_basis" where @@ -462,7 +462,7 @@ apply (rule inj_onI, simp add: Rep_compact_basis_inject) done -subsubsection {* Rank of basis elements *} +subsubsection \Rank of basis elements\ definition rank :: "'a compact_basis \ nat" @@ -541,7 +541,7 @@ lemma rank_lt_Un_rank_eq: "rank_lt x \ rank_eq x = rank_le x" unfolding rank_lt_def rank_eq_def rank_le_def by auto -subsubsection {* Sequencing basis elements *} +subsubsection \Sequencing basis elements\ definition place :: "'a compact_basis \ nat" @@ -590,7 +590,7 @@ lemma inj_place: "inj place" by (rule inj_onI, erule place_eqD) -subsubsection {* Embedding and projection on basis elements *} +subsubsection \Embedding and projection on basis elements\ definition sub :: "'a compact_basis \ 'a compact_basis" @@ -672,15 +672,15 @@ show ?case proof (rule linorder_cases) assume "place x < place y" then have "rank x < rank y" - using `x \ y` by (rule rank_place_mono) - with `place x < place y` show ?case + using \x \ y\ by (rule rank_place_mono) + with \place x < place y\ show ?case apply (case_tac "y = compact_bot", simp) apply (simp add: basis_emb.simps [of y]) apply (rule ubasis_le_trans [OF _ ubasis_le_lower [OF fin2]]) apply (rule less) apply (simp add: less_max_iff_disj) apply (erule place_sub_less) - apply (erule rank_less_imp_below_sub [OF `x \ y`]) + apply (erule rank_less_imp_below_sub [OF \x \ y\]) done next assume "place x = place y" @@ -688,7 +688,7 @@ thus ?case by (simp add: ubasis_le_refl) next assume "place x > place y" - with `x \ y` show ?case + with \x \ y\ show ?case apply (case_tac "x = compact_bot", simp add: ubasis_le_minimal) apply (simp add: basis_emb.simps [of x]) apply (rule ubasis_le_upper [OF fin2], simp) @@ -848,7 +848,7 @@ by (rule bifinite_approx_chain.ideal_completion) qed -subsubsection {* EP-pair from any bifinite domain into \emph{udom} *} +subsubsection \EP-pair from any bifinite domain into \emph{udom}\ context bifinite_approx_chain begin @@ -896,7 +896,7 @@ lemmas ep_pair_udom = bifinite_approx_chain.ep_pair_udom [unfolded bifinite_approx_chain_def] -subsection {* Chain of approx functions for type \emph{udom} *} +subsection \Chain of approx functions for type \emph{udom}\ definition udom_approx :: "nat \ udom \ udom" diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/HOLCF/Up.thy --- a/src/HOL/HOLCF/Up.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/HOLCF/Up.thy Wed Jan 13 23:07:06 2016 +0100 @@ -3,7 +3,7 @@ Author: Brian Huffman *) -section {* The type of lifted values *} +section \The type of lifted values\ theory Up imports Cfun @@ -11,7 +11,7 @@ default_sort cpo -subsection {* Definition of new type for lifting *} +subsection \Definition of new type for lifting\ datatype 'a u ("(_\<^sub>\)" [1000] 999) = Ibottom | Iup 'a @@ -19,7 +19,7 @@ "Ifup f Ibottom = \" | "Ifup f (Iup x) = f\x" -subsection {* Ordering on lifted cpo *} +subsection \Ordering on lifted cpo\ instantiation u :: (cpo) below begin @@ -41,7 +41,7 @@ lemma Iup_below [iff]: "(Iup x \ Iup y) = (x \ y)" by (simp add: below_up_def) -subsection {* Lifted cpo is a partial order *} +subsection \Lifted cpo is a partial order\ instance u :: (cpo) po proof @@ -60,7 +60,7 @@ by (auto split: u.split_asm intro: below_trans) qed -subsection {* Lifted cpo is a cpo *} +subsection \Lifted cpo is a cpo\ lemma is_lub_Iup: "range S <<| x \ range (\i. Iup (S i)) <<| Iup x" @@ -117,18 +117,18 @@ qed qed -subsection {* Lifted cpo is pointed *} +subsection \Lifted cpo is pointed\ instance u :: (cpo) pcpo by intro_classes fast -text {* for compatibility with old HOLCF-Version *} +text \for compatibility with old HOLCF-Version\ lemma inst_up_pcpo: "\ = Ibottom" by (rule minimal_up [THEN bottomI, symmetric]) -subsection {* Continuity of \emph{Iup} and \emph{Ifup} *} +subsection \Continuity of \emph{Iup} and \emph{Ifup}\ -text {* continuity for @{term Iup} *} +text \continuity for @{term Iup}\ lemma cont_Iup: "cont Iup" apply (rule contI) @@ -136,7 +136,7 @@ apply (erule cpo_lubI) done -text {* continuity for @{term Ifup} *} +text \continuity for @{term Ifup}\ lemma cont_Ifup1: "cont (\f. Ifup f x)" by (induct x, simp_all) @@ -166,7 +166,7 @@ qed simp qed (rule monofun_Ifup2) -subsection {* Continuous versions of constants *} +subsection \Continuous versions of constants\ definition up :: "'a \ 'a u" where @@ -181,7 +181,7 @@ "case l of (XCONST up :: 'a)\x \ t" => "CONST fup\(\ x. t)\l" "\(XCONST up\x). t" == "CONST fup\(\ x. t)" -text {* continuous versions of lemmas for @{typ "('a)u"} *} +text \continuous versions of lemmas for @{typ "('a)u"}\ lemma Exh_Up: "z = \ \ (\x. z = up\x)" apply (induct z) @@ -215,7 +215,7 @@ "\P \; \x. P (up\x)\ \ P x" by (cases x, simp_all) -text {* lifting preserves chain-finiteness *} +text \lifting preserves chain-finiteness\ lemma up_chain_cases: assumes Y: "chain Y" obtains "\i. Y i = \" @@ -247,7 +247,7 @@ apply (rule_tac p="\i. Y i" in upE, simp_all) done -text {* properties of fup *} +text \properties of fup\ lemma fup1 [simp]: "fup\f\\ = \" by (simp add: fup_def cont_Ifup1 cont_Ifup2 inst_up_pcpo cont2cont_LAM) diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/HOLCF/UpperPD.thy --- a/src/HOL/HOLCF/UpperPD.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/HOLCF/UpperPD.thy Wed Jan 13 23:07:06 2016 +0100 @@ -2,13 +2,13 @@ Author: Brian Huffman *) -section {* Upper powerdomain *} +section \Upper powerdomain\ theory UpperPD imports Compact_Basis begin -subsection {* Basis preorder *} +subsection \Basis preorder\ definition upper_le :: "'a pd_basis \ 'a pd_basis \ bool" (infix "\\" 50) where @@ -70,7 +70,7 @@ done -subsection {* Type definition *} +subsection \Type definition\ typedef 'a upper_pd ("('(_')\)") = "{S::'a pd_basis set. upper_le.ideal S}" @@ -103,7 +103,7 @@ using upper_principal_def pd_basis_countable by (rule upper_le.typedef_ideal_completion) -text {* Upper powerdomain is pointed *} +text \Upper powerdomain is pointed\ lemma upper_pd_minimal: "upper_principal (PDUnit compact_bot) \ ys" by (induct ys rule: upper_pd.principal_induct, simp, simp) @@ -115,7 +115,7 @@ by (rule upper_pd_minimal [THEN bottomI, symmetric]) -subsection {* Monadic unit and plus *} +subsection \Monadic unit and plus\ definition upper_unit :: "'a \ 'a upper_pd" where @@ -174,11 +174,11 @@ lemmas upper_plus_left_commute = upper_add.left_commute lemmas upper_plus_left_absorb = upper_add.left_idem -text {* Useful for @{text "simp add: upper_plus_ac"} *} +text \Useful for \simp add: upper_plus_ac\\ lemmas upper_plus_ac = upper_plus_assoc upper_plus_commute upper_plus_left_commute -text {* Useful for @{text "simp only: upper_plus_aci"} *} +text \Useful for \simp only: upper_plus_aci\\ lemmas upper_plus_aci = upper_plus_ac upper_plus_absorb upper_plus_left_absorb @@ -261,7 +261,7 @@ by (auto dest!: upper_pd.compact_imp_principal) -subsection {* Induction rules *} +subsection \Induction rules\ lemma upper_pd_induct1: assumes P: "adm P" @@ -290,7 +290,7 @@ done -subsection {* Monadic bind *} +subsection \Monadic bind\ definition upper_bind_basis :: @@ -362,7 +362,7 @@ by (induct xs, simp_all) -subsection {* Map *} +subsection \Map\ definition upper_map :: "('a \ 'b) \ 'a upper_pd \ 'b upper_pd" where @@ -453,7 +453,7 @@ by (rule finite_range_imp_finite_fixes) qed -subsection {* Upper powerdomain is bifinite *} +subsection \Upper powerdomain is bifinite\ lemma approx_chain_upper_map: assumes "approx_chain a" @@ -468,7 +468,7 @@ by (fast intro!: approx_chain_upper_map) qed -subsection {* Join *} +subsection \Join\ definition upper_join :: "'a upper_pd upper_pd \ 'a upper_pd" where diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/HOLCF/ex/Concurrency_Monad.thy --- a/src/HOL/HOLCF/ex/Concurrency_Monad.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/HOLCF/ex/Concurrency_Monad.thy Wed Jan 13 23:07:06 2016 +0100 @@ -6,10 +6,10 @@ imports HOLCF begin -text {* This file contains the concurrency monad example from - Chapter 7 of the author's PhD thesis. *} +text \This file contains the concurrency monad example from + Chapter 7 of the author's PhD thesis.\ -subsection {* State/nondeterminism monad, as a type synonym *} +subsection \State/nondeterminism monad, as a type synonym\ type_synonym ('s, 'a) N = "'s \ ('a u \ 's u)\" @@ -90,7 +90,7 @@ unfolding plusN_def by (simp add: eta_cfun) -subsection {* Resumption-state-nondeterminism monad *} +subsection \Resumption-state-nondeterminism monad\ domain ('s, 'a) R = Done (lazy "'a") | More (lazy "('s, ('s, 'a) R) N") @@ -129,7 +129,7 @@ by (simp add: mapN_def R.take_rews(2)) -subsection {* Map function *} +subsection \Map function\ fixrec mapR :: "('a \ 'b) \ ('s, 'a) R \ ('s, 'b) R" where "mapR\f\(Done\a) = Done\(f\a)" @@ -155,7 +155,7 @@ done -subsection {* Monadic bind function *} +subsection \Monadic bind function\ fixrec bindR :: "('s, 'a) R \ ('a \ ('s, 'b) R) \ ('s, 'b) R" where "bindR\(Done\x)\k = k\x" @@ -178,7 +178,7 @@ apply (simp_all add: mapN_mapN) done -subsection {* Zip function *} +subsection \Zip function\ fixrec zipR :: "('a \ 'b \ 'c) \ ('s, 'a) R \ ('s, 'b) R \ ('s, 'c) R" where zipR_Done_Done: @@ -203,7 +203,7 @@ abbreviation apR (infixl "\" 70) where "a \ b \ zipR\ID\a\b" -text {* Proofs that @{text zipR} satisfies the applicative functor laws: *} +text \Proofs that \zipR\ satisfies the applicative functor laws:\ lemma R_homomorphism: "Done\f \ Done\x = Done\(f\x)" by simp @@ -214,7 +214,7 @@ lemma R_interchange: "r \ Done\x = Done\(\ f. f\x) \ r" by (induct r, simp_all add: mapN_mapN) -text {* The associativity rule is the hard one! *} +text \The associativity rule is the hard one!\ lemma R_associativity: "Done\cfcomp \ r1 \ r2 \ r3 = r1 \ (r2 \ r3)" proof (induct r1 arbitrary: r2 r3) @@ -258,7 +258,7 @@ qed simp_all qed simp_all -text {* Other miscellaneous properties about @{text zipR}: *} +text \Other miscellaneous properties about \zipR\:\ lemma zipR_Done_left: shows "zipR\f\(Done\x)\r = mapR\(f\x)\r" @@ -358,7 +358,7 @@ apply (simp add: mapN_mapN mapN_plusN plusN_assoc) done -text {* Alternative proof using take lemma. *} +text \Alternative proof using take lemma.\ lemma fixes a :: "('s, 'a) R" and b :: "('s, 'b) R" and c :: "('s, 'c) R" @@ -398,7 +398,7 @@ by (simp add: zipR_Done_right mapR_zipR zipR_mapR_right gf) next case (More nC) - note H = `a = More\nA` `b = More\nB` `c = More\nC` + note H = \a = More\nA\ \b = More\nB\ \c = More\nC\ show ?P apply (simp only: H zipR_More_More) apply (simplesubst zipR_More_More [of f, symmetric]) diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/HOLCF/ex/Dnat.thy --- a/src/HOL/HOLCF/ex/Dnat.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/HOLCF/ex/Dnat.thy Wed Jan 13 23:07:06 2016 +0100 @@ -16,9 +16,9 @@ case n of dzero => x | dsucc $ m => f $ (h $ m $ f $ x))" -text {* +text \ \medskip Expand fixed point properties. -*} +\ lemma iterator_def2: "iterator = (LAM n f x. case n of dzero => x | dsucc$m => f$(iterator$m$f$x))" @@ -29,7 +29,7 @@ apply simp done -text {* \medskip Recursive properties. *} +text \\medskip Recursive properties.\ lemma iterator1: "iterator $ UU $ f $ x = UU" apply (subst iterator_def2) diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/HOLCF/ex/Domain_Proofs.thy --- a/src/HOL/HOLCF/ex/Domain_Proofs.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/HOLCF/ex/Domain_Proofs.thy Wed Jan 13 23:07:06 2016 +0100 @@ -2,7 +2,7 @@ Author: Brian Huffman *) -section {* Internal domain package proofs done manually *} +section \Internal domain package proofs done manually\ theory Domain_Proofs imports HOLCF @@ -21,9 +21,9 @@ (********************************************************************) -subsection {* Step 1: Define the new type combinators *} +subsection \Step 1: Define the new type combinators\ -text {* Start with the one-step non-recursive version *} +text \Start with the one-step non-recursive version\ definition foo_bar_baz_deflF :: @@ -42,7 +42,7 @@ unfolding foo_bar_baz_deflF_def by (simp add: split_def) -text {* Individual type combinators are projected from the fixed point. *} +text \Individual type combinators are projected from the fixed point.\ definition foo_defl :: "udom defl \ udom defl" where "foo_defl = (\ a. fst (fix\(foo_bar_baz_deflF\a)))" @@ -59,7 +59,7 @@ "baz_defl\a = snd (snd (fix\(foo_bar_baz_deflF\a)))" unfolding foo_defl_def bar_defl_def baz_defl_def by simp_all -text {* Unfold rules for each combinator. *} +text \Unfold rules for each combinator.\ lemma foo_defl_unfold: "foo_defl\a = ssum_defl\DEFL(one)\(sprod_defl\(u_defl\a)\(u_defl\(bar_defl\a)))" @@ -76,9 +76,9 @@ (********************************************************************) -subsection {* Step 2: Define types, prove class instances *} +subsection \Step 2: Define types, prove class instances\ -text {* Use @{text pcpodef} with the appropriate type combinator. *} +text \Use \pcpodef\ with the appropriate type combinator.\ pcpodef 'a foo = "defl_set (foo_defl\DEFL('a))" by (rule defl_set_bottom, rule adm_defl_set) @@ -89,7 +89,7 @@ pcpodef 'a baz = "defl_set (baz_defl\DEFL('a))" by (rule defl_set_bottom, rule adm_defl_set) -text {* Prove rep instance using lemma @{text typedef_rep_class}. *} +text \Prove rep instance using lemma \typedef_rep_class\.\ instantiation foo :: ("domain") "domain" begin @@ -196,7 +196,7 @@ end -text {* Prove DEFL rules using lemma @{text typedef_DEFL}. *} +text \Prove DEFL rules using lemma \typedef_DEFL\.\ lemma DEFL_foo: "DEFL('a foo) = foo_defl\DEFL('a)" apply (rule typedef_DEFL) @@ -213,7 +213,7 @@ apply (rule defl_baz_def) done -text {* Prove DEFL equations using type combinator unfold lemmas. *} +text \Prove DEFL equations using type combinator unfold lemmas.\ lemma DEFL_foo': "DEFL('a foo) = DEFL(one \ 'a\<^sub>\ \ ('a bar)\<^sub>\)" unfolding DEFL_foo DEFL_bar DEFL_baz domain_defl_simps @@ -229,9 +229,9 @@ (********************************************************************) -subsection {* Step 3: Define rep and abs functions *} +subsection \Step 3: Define rep and abs functions\ -text {* Define them all using @{text prj} and @{text emb}! *} +text \Define them all using \prj\ and \emb\!\ definition foo_rep :: "'a foo \ one \ ('a\<^sub>\ \ ('a bar)\<^sub>\)" where "foo_rep \ prj oo emb" @@ -251,7 +251,7 @@ definition baz_abs :: "('a foo convex_pd \ tr)\<^sub>\ \ 'a baz" where "baz_abs \ prj oo emb" -text {* Prove isomorphism rules. *} +text \Prove isomorphism rules.\ lemma foo_abs_iso: "foo_rep\(foo_abs\x) = x" by (rule domain_abs_iso [OF DEFL_foo' foo_abs_def foo_rep_def]) @@ -271,7 +271,7 @@ lemma baz_rep_iso: "baz_abs\(baz_rep\x) = x" by (rule domain_rep_iso [OF DEFL_baz' baz_abs_def baz_rep_def]) -text {* Prove isodefl rules using @{text isodefl_coerce}. *} +text \Prove isodefl rules using \isodefl_coerce\.\ lemma isodefl_foo_abs: "isodefl d t \ isodefl (foo_abs oo d oo foo_rep) t" @@ -287,12 +287,12 @@ (********************************************************************) -subsection {* Step 4: Define map functions, prove isodefl property *} +subsection \Step 4: Define map functions, prove isodefl property\ -text {* Start with the one-step non-recursive version. *} +text \Start with the one-step non-recursive version.\ -text {* Note that the type of the map function depends on which -variables are used in positive and negative positions. *} +text \Note that the type of the map function depends on which +variables are used in positive and negative positions.\ definition foo_bar_baz_mapF :: @@ -325,7 +325,7 @@ unfolding foo_bar_baz_mapF_def by (simp add: split_def) -text {* Individual map functions are projected from the fixed point. *} +text \Individual map functions are projected from the fixed point.\ definition foo_map :: "('a \ 'b) \ ('a foo \ 'b foo)" where "foo_map = (\ f. fst (fix\(foo_bar_baz_mapF\f)))" @@ -342,7 +342,7 @@ "baz_map\f = snd (snd (fix\(foo_bar_baz_mapF\f)))" unfolding foo_map_def bar_map_def baz_map_def by simp_all -text {* Prove isodefl rules for all map functions simultaneously. *} +text \Prove isodefl rules for all map functions simultaneously.\ lemma isodefl_foo_bar_baz: assumes isodefl_d: "isodefl d t" @@ -374,7 +374,7 @@ lemmas isodefl_bar = isodefl_foo_bar_baz [THEN conjunct2, THEN conjunct1] lemmas isodefl_baz = isodefl_foo_bar_baz [THEN conjunct2, THEN conjunct2] -text {* Prove map ID lemmas, using isodefl_DEFL_imp_ID *} +text \Prove map ID lemmas, using isodefl_DEFL_imp_ID\ lemma foo_map_ID: "foo_map\ID = ID" apply (rule isodefl_DEFL_imp_ID) @@ -399,7 +399,7 @@ (********************************************************************) -subsection {* Step 5: Define take functions, prove lub-take lemmas *} +subsection \Step 5: Define take functions, prove lub-take lemmas\ definition foo_bar_baz_takeF :: diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/HOLCF/ex/Focus_ex.thy --- a/src/HOL/HOLCF/ex/Focus_ex.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/HOLCF/ex/Focus_ex.thy Wed Jan 13 23:07:06 2016 +0100 @@ -181,8 +181,8 @@ done lemma lemma3: "def_g(g) --> is_g(g)" -apply (tactic {* simp_tac (put_simpset HOL_ss @{context} - addsimps [@{thm def_g_def}, @{thm lemma1}, @{thm lemma2}]) 1 *}) +apply (tactic \simp_tac (put_simpset HOL_ss @{context} + addsimps [@{thm def_g_def}, @{thm lemma1}, @{thm lemma2}]) 1\) apply (rule impI) apply (erule exE) apply (rule_tac x = "f" in exI) @@ -206,9 +206,9 @@ done lemma lemma4: "is_g(g) --> def_g(g)" -apply (tactic {* simp_tac (put_simpset HOL_ss @{context} +apply (tactic \simp_tac (put_simpset HOL_ss @{context} delsimps (@{thms HOL.ex_simps} @ @{thms HOL.all_simps}) - addsimps [@{thm lemma1}, @{thm lemma2}, @{thm def_g_def}]) 1 *}) + addsimps [@{thm lemma1}, @{thm lemma2}, @{thm def_g_def}]) 1\) apply (rule impI) apply (erule exE) apply (rule_tac x = "f" in exI) diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/HOLCF/ex/Letrec.thy --- a/src/HOL/HOLCF/ex/Letrec.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/HOLCF/ex/Letrec.thy Wed Jan 13 23:07:06 2016 +0100 @@ -2,7 +2,7 @@ Author: Brian Huffman *) -section {* Recursive let bindings *} +section \Recursive let bindings\ theory Letrec imports HOLCF diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/HOLCF/ex/Loop.thy --- a/src/HOL/HOLCF/ex/Loop.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/HOLCF/ex/Loop.thy Wed Jan 13 23:07:06 2016 +0100 @@ -2,7 +2,7 @@ Author: Franz Regensburger *) -section {* Theory for a loop primitive like while *} +section \Theory for a loop primitive like while\ theory Loop imports HOLCF diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/HOLCF/ex/Pattern_Match.thy --- a/src/HOL/HOLCF/ex/Pattern_Match.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/HOLCF/ex/Pattern_Match.thy Wed Jan 13 23:07:06 2016 +0100 @@ -2,7 +2,7 @@ Author: Brian Huffman *) -section {* An experimental pattern-matching notation *} +section \An experimental pattern-matching notation\ theory Pattern_Match imports HOLCF @@ -10,7 +10,7 @@ default_sort pcpo -text {* FIXME: Find a proper way to un-hide constants. *} +text \FIXME: Find a proper way to un-hide constants.\ abbreviation fail :: "'a match" where "fail \ Fixrec.fail" @@ -21,7 +21,7 @@ abbreviation run :: "'a match \ 'a" where "run \ Fixrec.run" -subsection {* Fatbar combinator *} +subsection \Fatbar combinator\ definition fatbar :: "('a \ 'b match) \ ('a \ 'b match) \ ('a \ 'b match)" where @@ -53,7 +53,7 @@ lemmas run_fatbar_simps [simp] = run_fatbar1 run_fatbar2 run_fatbar3 -subsection {* Bind operator for match monad *} +subsection \Bind operator for match monad\ definition match_bind :: "'a match \ ('a \ 'b match) \ 'b match" where "match_bind = (\ m k. sscase\(\ _. fail)\(fup\k)\(Rep_match m))" @@ -66,7 +66,7 @@ by (simp_all add: cont_Rep_match cont_Abs_match Rep_match_strict Abs_match_inverse) -subsection {* Case branch combinator *} +subsection \Case branch combinator\ definition branch :: "('a \ 'b match) \ ('b \ 'c) \ ('a \ 'c match)" where @@ -81,13 +81,13 @@ lemma branch_succeed [simp]: "branch succeed\r\x = succeed\(r\x)" by (simp add: branch_def) -subsection {* Cases operator *} +subsection \Cases operator\ definition cases :: "'a match \ 'a::pcpo" where "cases = Fixrec.run" -text {* rewrite rules for cases *} +text \rewrite rules for cases\ lemma cases_strict [simp]: "cases\\ = \" by (simp add: cases_def) @@ -98,7 +98,7 @@ lemma cases_succeed [simp]: "cases\(succeed\x) = x" by (simp add: cases_def) -subsection {* Case syntax *} +subsection \Case syntax\ nonterminal Case_pat and Case_syn and Cases_syn @@ -116,7 +116,7 @@ "_Case_syntax x ms" == "CONST cases\(ms\x)" "_Case2 m ms" == "m \ ms" -text {* Parsing Case expressions *} +text \Parsing Case expressions\ syntax "_pat" :: "'a" @@ -128,19 +128,19 @@ "_variable (_args x y) r" => "CONST csplit\(_variable x (_variable y r))" "_variable _noargs r" => "CONST unit_when\r" -parse_translation {* +parse_translation \ (* rewrite (_pat x) => (succeed) *) (* rewrite (_variable x t) => (Abs_cfun (%x. t)) *) [(@{syntax_const "_pat"}, fn _ => fn _ => Syntax.const @{const_syntax Fixrec.succeed}), Syntax_Trans.mk_binder_tr (@{syntax_const "_variable"}, @{const_syntax Abs_cfun})]; -*} +\ -text {* Printing Case expressions *} +text \Printing Case expressions\ syntax "_match" :: "'a" -print_translation {* +print_translation \ let fun dest_LAM (Const (@{const_syntax Rep_cfun},_) $ Const (@{const_syntax unit_when},_) $ t) = (Syntax.const @{syntax_const "_noargs"}, t) @@ -165,13 +165,13 @@ end; in [(@{const_syntax Rep_cfun}, K Case1_tr')] end; -*} +\ translations "x" <= "_match (CONST succeed) (_variable x)" -subsection {* Pattern combinators for data constructors *} +subsection \Pattern combinators for data constructors\ type_synonym ('a, 'b) pat = "'a \ 'b match" @@ -209,7 +209,7 @@ ONE_pat :: "(one, unit) pat" where "ONE_pat = (\ ONE. succeed\())" -text {* Parse translations (patterns) *} +text \Parse translations (patterns)\ translations "_pat (XCONST Pair x y)" => "CONST cpair_pat (_pat x) (_pat y)" "_pat (XCONST spair\x\y)" => "CONST spair_pat (_pat x) (_pat y)" @@ -220,12 +220,12 @@ "_pat (XCONST FF)" => "CONST FF_pat" "_pat (XCONST ONE)" => "CONST ONE_pat" -text {* CONST version is also needed for constructors with special syntax *} +text \CONST version is also needed for constructors with special syntax\ translations "_pat (CONST Pair x y)" => "CONST cpair_pat (_pat x) (_pat y)" "_pat (CONST spair\x\y)" => "CONST spair_pat (_pat x) (_pat y)" -text {* Parse translations (variables) *} +text \Parse translations (variables)\ translations "_variable (XCONST Pair x y) r" => "_variable (_args x y) r" "_variable (XCONST spair\x\y) r" => "_variable (_args x y) r" @@ -240,7 +240,7 @@ "_variable (CONST Pair x y) r" => "_variable (_args x y) r" "_variable (CONST spair\x\y) r" => "_variable (_args x y) r" -text {* Print translations *} +text \Print translations\ translations "CONST Pair (_match p1 v1) (_match p2 v2)" <= "_match (CONST cpair_pat p1 p2) (_args v1 v2)" @@ -318,7 +318,7 @@ by (simp_all add: branch_def ONE_pat_def) -subsection {* Wildcards, as-patterns, and lazy patterns *} +subsection \Wildcards, as-patterns, and lazy patterns\ definition wild_pat :: "'a \ unit match" where @@ -332,15 +332,15 @@ lazy_pat :: "('a \ 'b::pcpo match) \ ('a \ 'b match)" where "lazy_pat p = (\ x. succeed\(cases\(p\x)))" -text {* Parse translations (patterns) *} +text \Parse translations (patterns)\ translations "_pat _" => "CONST wild_pat" -text {* Parse translations (variables) *} +text \Parse translations (variables)\ translations "_variable _ r" => "_variable _noargs r" -text {* Print translations *} +text \Print translations\ translations "_" <= "_match (CONST wild_pat) _noargs" @@ -361,7 +361,7 @@ apply (cases "p\x", simp_all)+ done -subsection {* Examples *} +subsection \Examples\ term "Case t of (:up\(sinl\x), sinr\y:) \ (x, y)" @@ -369,9 +369,9 @@ term "\ t. Case t of (:up\(sinl\_), sinr\x:) \ x" -subsection {* ML code for generating definitions *} +subsection \ML code for generating definitions\ -ML {* +ML \ local open HOLCF_Library in infixr 6 ->>; @@ -586,7 +586,7 @@ end end -*} +\ (* Cut from HOLCF/Tools/domain_constructors.ML diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/HOLCF/ex/Powerdomain_ex.thy --- a/src/HOL/HOLCF/ex/Powerdomain_ex.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/HOLCF/ex/Powerdomain_ex.thy Wed Jan 13 23:07:06 2016 +0100 @@ -2,13 +2,13 @@ Author: Brian Huffman *) -section {* Powerdomain examples *} +section \Powerdomain examples\ theory Powerdomain_ex imports HOLCF begin -subsection {* Monadic sorting example *} +subsection \Monadic sorting example\ domain ordering = LT | EQ | GT @@ -43,7 +43,7 @@ done -subsection {* Picking a leaf from a tree *} +subsection \Picking a leaf from a tree\ domain 'a tree = Node (lazy "'a tree") (lazy "'a tree") | diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/Library/Poly_Deriv.thy --- a/src/HOL/Library/Poly_Deriv.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/Library/Poly_Deriv.thy Wed Jan 13 23:07:06 2016 +0100 @@ -183,7 +183,7 @@ { fix b assume "b \ as" - hence id2: "insert a as - {b} = insert a (as - {b})" using `a \ as` by auto + hence id2: "insert a as - {b} = insert a (as - {b})" using \a \ as\ by auto have "setprod f (insert a as - {b}) = f a * setprod f (as - {b})" unfolding id2 by (subst setprod.insert, insert insert, auto) diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/List.thy --- a/src/HOL/List.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/List.thy Wed Jan 13 23:07:06 2016 +0100 @@ -5399,7 +5399,7 @@ apply (case_tac xys, simp_all, blast) done -text{* By Mathias Fleury: *} +text\By Mathias Fleury:\ lemma lexn_transI: assumes "trans r" shows "trans (lexn r n)" unfolding trans_def diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/Multivariate_Analysis/Cauchy_Integral_Thm.thy --- a/src/HOL/Multivariate_Analysis/Cauchy_Integral_Thm.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/Multivariate_Analysis/Cauchy_Integral_Thm.thy Wed Jan 13 23:07:06 2016 +0100 @@ -6056,7 +6056,7 @@ apply (clarsimp simp del: divide_const_simps) apply (metis add.commute dist_commute le_less_trans mem_ball real_gt_half_sum w) done - --\Replacing @{term r} and the original (weak) premises\ + \\Replacing @{term r} and the original (weak) premises\ obtain r where "0 < r" and holfc: "f holomorphic_on cball z r" and w: "w \ ball z r" apply (rule that [of "(r + dist w z) / 2"]) apply (simp_all add: fh') diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/Multivariate_Analysis/Uniform_Limit.thy --- a/src/HOL/Multivariate_Analysis/Uniform_Limit.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/Multivariate_Analysis/Uniform_Limit.thy Wed Jan 13 23:07:06 2016 +0100 @@ -272,7 +272,7 @@ qed qed -text{*Alternative version, formulated as in HOL Light*} +text\Alternative version, formulated as in HOL Light\ corollary series_comparison_uniform: fixes f :: "_ \ nat \ _ :: banach" assumes g: "summable g" and le: "\n x. N \ n \ x \ A \ norm(f x n) \ g n" diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/Multivariate_Analysis/ex/Approximations.thy --- a/src/HOL/Multivariate_Analysis/ex/Approximations.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/Multivariate_Analysis/ex/Approximations.thy Wed Jan 13 23:07:06 2016 +0100 @@ -530,13 +530,13 @@ shows "\pi - pi_approx n\ \ inverse (2^(13*n - 2))" proof - from n have n': "even (3*n)" by simp - -- \We apply the Machin formula\ + \ \We apply the Machin formula\ from machin have "pi = 16 * arctan (1/5) - 4 * arctan (1/239::real)" by simp - -- \Taylor series expansion of the arctangent\ + \ \Taylor series expansion of the arctangent\ also from arctan_approx[OF _ _ n', of "1/5"] arctan_approx[OF _ _ n, of "1/239"] have "\ - pi_approx n \ {-4*((1/239)^(2*n+1) / (1-(1/239)^4))..16*(1/5)^(6*n+1) / (1-(1/5)^4)}" by (simp add: pi_approx_def) - -- \Coarsening the bounds to make them a bit nicer\ + \ \Coarsening the bounds to make them a bit nicer\ also have "-4*((1/239::real)^(2*n+1) / (1-(1/239)^4)) = -((13651919 / 815702160) / 57121^n)" by (simp add: power_mult power2_eq_square) (simp add: field_simps) also have "16*(1/5)^(6*n+1) / (1-(1/5::real)^4) = (125/39) / 15625^n" @@ -561,11 +561,11 @@ proof - def a \ "8295936325956147794769600190539918304 / 2626685325478320010006427764892578125 :: real" def b \ "8428294561696506782041394632 / 503593538783547230635598424135 :: real" - -- \The introduction of this constant prevents the simplifier from applying solvers that + \ \The introduction of this constant prevents the simplifier from applying solvers that we don't want. We want it to simply evaluate the terms to rational constants.}\ def eq \ "op = :: real \ real \ bool" - -- \Splitting the computation into several steps has the advantage that simplification can + \ \Splitting the computation into several steps has the advantage that simplification can be done in parallel\ have "abs (pi - pi_approx 6) \ inverse (2^76)" by (rule pi_approx') simp_all also have "pi_approx 6 = 16 * arctan_approx (3 * 6) (1 / 5) - 4 * arctan_approx 6 (1 / 239)" @@ -694,7 +694,7 @@ by (unfold a_def b_def c_def, simp, unfold eq_def, rule refl) also have [unfolded eq_def]: "eq (\ - c) ?pi''" by (unfold a_def b_def c_def, simp, unfold eq_def, rule refl) - -- \This is incredibly slow because the numerators and denominators are huge.\ + \ \This is incredibly slow because the numerators and denominators are huge.\ finally show ?thesis by (rule approx_coarsen) simp qed diff -r fae6233c5f37 -r 8ffc4d0e652d src/HOL/Topological_Spaces.thy --- a/src/HOL/Topological_Spaces.thy Wed Jan 13 23:02:28 2016 +0100 +++ b/src/HOL/Topological_Spaces.thy Wed Jan 13 23:07:06 2016 +0100 @@ -2506,7 +2506,7 @@ fix E assume "eventually E uniformity" with M obtain X where "\S\M. finite (X S) \ (\s\S. \x\X S. E (x, s))" by (metis totally_bounded_def) - with `finite M` show "\X. finite X \ (\s\\M. \x\X. E (x, s))" + with \finite M\ show "\X. finite X \ (\s\\M. \x\X. E (x, s))" by (intro exI[of _ "\S\M. X S"]) force qed