# HG changeset patch # User nipkow # Date 1090510651 -7200 # Node ID 277b3a4da3411bbb85fec2ea7c8ec4b5ceb79ba2 # Parent 279c2daaf5171e33828bee6b9ad8625137a091b7 Modified \ syntax a little. diff -r 279c2daaf517 -r 277b3a4da341 src/HOL/Finite_Set.thy --- a/src/HOL/Finite_Set.thy Thu Jul 22 12:55:36 2004 +0200 +++ b/src/HOL/Finite_Set.thy Thu Jul 22 17:37:31 2004 +0200 @@ -765,25 +765,29 @@ written @{text"\x\A. e"}. *} syntax - "_setsum" :: "idt => 'a set => 'b => 'b::comm_monoid_add" ("(3\_:_. _)" [0, 51, 10] 10) + "_setsum" :: "idt => 'a set => 'b => 'b::comm_monoid_add" ("(3SUM _:_. _)" [0, 51, 10] 10) syntax (xsymbols) "_setsum" :: "idt => 'a set => 'b => 'b::comm_monoid_add" ("(3\_\_. _)" [0, 51, 10] 10) syntax (HTML output) "_setsum" :: "idt => 'a set => 'b => 'b::comm_monoid_add" ("(3\_\_. _)" [0, 51, 10] 10) -translations - "\i:A. b" == "setsum (%i. b) A" -- {* Beware of argument permutation! *} + +translations -- {* Beware of argument permutation! *} + "SUM i:A. b" == "setsum (%i. b) A" + "\i\A. b" == "setsum (%i. b) A" text{* Instead of @{term"\x\{x. P}. e"} we introduce the shorter @{text"\x|P. e"}. *} syntax - "_qsetsum" :: "idt \ bool \ 'a \ 'a" ("(3SUM _ | / _./ _)" [0,0,10] 10) + "_qsetsum" :: "idt \ bool \ 'a \ 'a" ("(3SUM _ |/ _./ _)" [0,0,10] 10) syntax (xsymbols) "_qsetsum" :: "idt \ bool \ 'a \ 'a" ("(3\_ | (_)./ _)" [0,0,10] 10) syntax (HTML output) "_qsetsum" :: "idt \ bool \ 'a \ 'a" ("(3\_ | (_)./ _)" [0,0,10] 10) -translations "\x|P. t" => "setsum (%x. t) {x. P}" +translations + "SUM x|P. t" => "setsum (%x. t) {x. P}" + "\x|P. t" => "setsum (%x. t) {x. P}" print_translation {* let @@ -894,8 +898,8 @@ done lemma setsum_Sigma: "finite A ==> ALL x:A. finite (B x) ==> - (\x:A. (\y:B x. f x y)) = - (\z:(SIGMA x:A. B x). f (fst z) (snd z))" + (\x\A. (\y\B x. f x y)) = + (\z\(SIGMA x:A. B x). f (fst z) (snd z))" apply (subst Sigma_def) apply (subst setsum_UN_disjoint) apply assumption @@ -911,8 +915,8 @@ done lemma setsum_cartesian_product: "finite A ==> finite B ==> - (\x:A. (\y:B. f x y)) = - (\z:A <*> B. f (fst z) (snd z))" + (\x\A. (\y\B. f x y)) = + (\z\A <*> B. f (fst z) (snd z))" by (erule setsum_Sigma, auto); lemma setsum_addf: "setsum (%x. f x + g x) A = (setsum f A + setsum g A)" @@ -936,7 +940,7 @@ by (induct set: Finites) auto lemma setsum_constant_nat: - "finite A ==> (\x: A. y) = (card A) * y" + "finite A ==> (\x\A. y) = (card A) * y" -- {* Generalized to any @{text comm_semiring_1_cancel} in @{text IntDef} as @{text setsum_constant}. *} by (erule finite_induct, auto) @@ -1047,7 +1051,7 @@ lemma card_SigmaI [rule_format,simp]: "finite A ==> (ALL a:A. finite (B a)) --> - card (SIGMA x: A. B x) = (\a: A. card (B a))" + card (SIGMA x: A. B x) = (\a\A. card (B a))" apply (erule finite_induct, auto) apply (subst SigmaI_insert, assumption) apply (subst card_Un_disjoint) diff -r 279c2daaf517 -r 277b3a4da341 src/HOL/UNITY/Comp/Alloc.thy --- a/src/HOL/UNITY/Comp/Alloc.thy Thu Jul 22 12:55:36 2004 +0200 +++ b/src/HOL/UNITY/Comp/Alloc.thy Thu Jul 22 17:37:31 2004 +0200 @@ -52,8 +52,8 @@ (*spec (1)*) system_safety :: 'a systemState program set "system_safety == - Always {s. (\\i: lessThan Nclients. (tokens o giv o sub i o client)s) - <= NbT + (\\i: lessThan Nclients. (tokens o rel o sub i o client)s)}" + Always {s. (SUM i: lessThan Nclients. (tokens o giv o sub i o client)s) + <= NbT + (SUM i: lessThan Nclients. (tokens o rel o sub i o client)s)}" (*spec (2)*) system_progress :: 'a systemState program set @@ -111,8 +111,8 @@ "alloc_safety == (INT i : lessThan Nclients. Increasing (sub i o allocRel)) guarantees - Always {s. (\\i: lessThan Nclients. (tokens o sub i o allocGiv)s) - <= NbT + (\\i: lessThan Nclients. (tokens o sub i o allocRel)s)}" + Always {s. (SUM i: lessThan Nclients. (tokens o sub i o allocGiv)s) + <= NbT + (SUM i: lessThan Nclients. (tokens o sub i o allocRel)s)}" (*spec (8)*) alloc_progress :: 'a allocState_d program set diff -r 279c2daaf517 -r 277b3a4da341 src/HOL/UNITY/Comp/AllocBase.thy --- a/src/HOL/UNITY/Comp/AllocBase.thy Thu Jul 22 12:55:36 2004 +0200 +++ b/src/HOL/UNITY/Comp/AllocBase.thy Thu Jul 22 17:37:31 2004 +0200 @@ -71,13 +71,13 @@ declare setsum_cong [cong] lemma bag_of_sublist_lemma: - "(\i: A Int lessThan k. {#if ii: A Int lessThan k. {#f i#})" + "(\i\ A Int lessThan k. {#if ii\ A Int lessThan k. {#f i#})" by (rule setsum_cong, auto) lemma bag_of_sublist: "bag_of (sublist l A) = - (\i: A Int lessThan (length l). {# l!i #})" + (\i\ A Int lessThan (length l). {# l!i #})" apply (rule_tac xs = l in rev_induct, simp) apply (simp add: sublist_append Int_insert_right lessThan_Suc nth_append bag_of_sublist_lemma add_ac) @@ -101,7 +101,7 @@ lemma bag_of_sublist_UN_disjoint [rule_format]: "[| finite I; ALL i:I. ALL j:I. i~=j --> A i Int A j = {} |] ==> bag_of (sublist l (UNION I A)) = - (\i:I. bag_of (sublist l (A i)))" + (\i\I. bag_of (sublist l (A i)))" apply (simp del: UN_simps add: UN_simps [symmetric] add: bag_of_sublist) apply (subst setsum_UN_disjoint, auto) diff -r 279c2daaf517 -r 277b3a4da341 src/HOL/UNITY/Comp/AllocImpl.thy --- a/src/HOL/UNITY/Comp/AllocImpl.thy Thu Jul 22 12:55:36 2004 +0200 +++ b/src/HOL/UNITY/Comp/AllocImpl.thy Thu Jul 22 17:37:31 2004 +0200 @@ -353,7 +353,7 @@ lemma alloc_refinement_lemma: "!!f::nat=>nat. (\i \ lessThan n. {s. f i \ g i s}) - \ {s. (\x \ lessThan n. f x) \ (\x: lessThan n. g x s)}" + \ {s. (SUM x: lessThan n. f x) \ (SUM x: lessThan n. g x s)}" apply (induct_tac "n") apply (auto simp add: lessThan_Suc) done