# HG changeset patch # User nipkow # Date 1103711793 -3600 # Node ID 6356d2523f73d0271e131a2e794eeb7379a52f27 # Parent 7a91490c1b04db1bcf50b0a6fe3af9311e2776bd [ .. (] -> [ ..< ] diff -r 7a91490c1b04 -r 6356d2523f73 src/HOL/HoareParallel/OG_Syntax.thy --- a/src/HOL/HoareParallel/OG_Syntax.thy Mon Dec 20 18:25:22 2004 +0100 +++ b/src/HOL/HoareParallel/OG_Syntax.thy Wed Dec 22 11:36:33 2004 +0100 @@ -1,5 +1,6 @@ - -theory OG_Syntax = OG_Tactics + Quote_Antiquote: +theory OG_Syntax +imports OG_Tactics Quote_Antiquote +begin text{* Syntax for commands and for assertions and boolean expressions in commands @{text com} and annotated commands @{text ann_com}. *} @@ -71,7 +72,7 @@ "_prgs c q ps" \ "(Some c, q) # ps" "_PAR ps" \ "Parallel ps" - "_prg_scheme j i k c q" \ "(map (\i. (Some c, q)) [j..k(])" + "_prg_scheme j i k c q" \ "map (\i. (Some c, q)) [j..k. i\k \ k interfree_aux (com x, post x, c k) \ interfree_aux (c k, Q k, com x) - \ interfree_swap (x, map (\k. (c k, Q k)) [i..j(])" + \ interfree_swap (x, map (\k. (c k, Q k)) [i..i j. a\i \ i a\j \ j i\j \ interfree_aux (c i, Q i, c j)) - \ interfree (map (\k. (c k, Q k)) [a..b(])" + \ interfree (map (\k. (c k, Q k)) [a.. bool " ("[\] _" [0] 45) @@ -220,7 +220,7 @@ done lemma MapAnnMap: - "\k. i\k \ k \ (c k) (Q k) \ [\] map (\k. (Some (c k), Q k)) [i..j(]" + "\k. i\k \ k \ (c k) (Q k) \ [\] map (\k. (Some (c k), Q k)) [i.. 'b \ 'a com" ("(\_ :=/ _)" [70, 65] 61) @@ -42,7 +43,7 @@ "_prg_scheme" :: "['a, 'a, 'a, 'a] \ prgs" ("SCHEME [_ \ _ < _] _" [0,0,0,60] 57) translations - "_prg_scheme j i k c" \ "(map (\i. c) [j..k(])" + "_prg_scheme j i k c" \ "(map (\i. c) [j..i cptn))" apply(induct ys) apply(clarify) - apply(rule_tac x="map (\i. []) [0..length xs(]" in exI) + apply(rule_tac x="map (\i. []) [0.. bool) => 'a list => 'a list" rev :: "'a list => 'a list" zip :: "'a list => 'b list => ('a * 'b) list" - upt :: "nat => nat => nat list" ("(1[_../_'(])") + upt :: "nat => nat => nat list" ("(1[_.. 'a list" remove1 :: "'a => 'a list => 'a list" null:: "'a list => bool" @@ -74,7 +74,7 @@ "_LUpdate xs (_lupdbinds b bs)"== "_LUpdate (_LUpdate xs b) bs" "xs[i:=x]" == "list_update xs i x" - "[i..j]" == "[i..(Suc j)(]" + "[i..j]" == "[i..<(Suc j)]" syntax (xsymbols) @@ -193,8 +193,8 @@ theorems for @{text "xs = []"} and @{text "xs = z # zs"} *} primrec - upt_0: "[i..0(] = []" - upt_Suc: "[i..(Suc j)(] = (if i <= j then [i..j(] @ [j] else [])" + upt_0: "[i..<0] = []" + upt_Suc: "[i..<(Suc j)] = (if i <= j then [i.. (\(x, y) \ set (zip xs ys). P x y)" sublist_def: - "sublist xs A == map fst (filter (%p. snd p : A) (zip xs [0..size xs(]))" + "sublist xs A == map fst (filter (%p. snd p : A) (zip xs [0.. x # xs" @@ -619,7 +619,7 @@ lemma set_filter [simp]: "set (filter P xs) = {x. x : set xs \ P x}" by (induct xs) auto -lemma set_upt [simp]: "set[i..j(] = {k. i \ k \ k < j}" +lemma set_upt [simp]: "set[i.. k \ k < j}" apply (induct j, simp_all) apply (erule ssubst, auto) done @@ -1365,47 +1365,47 @@ subsubsection {* @{text upto} *} -lemma upt_rec: "[i..j(] = (if i [i..j(] = []" +lemma upt_conv_Nil [simp]: "j <= i ==> [i.. j <= i)" +lemma upt_eq_Nil_conv[simp]: "([i.. j <= i)" by(induct j)simp_all lemma upt_eq_Cons_conv: - "!!x xs. ([i..j(] = x#xs) = (i < j & i = x & [i+1..j(] = xs)" + "!!x xs. ([i.. [i..(Suc j)(] = [i..j(]@[j]" +lemma upt_Suc_append: "i <= j ==> [i..<(Suc j)] = [i.. [i..j(] = i # [Suc i..j(]" +lemma upt_conv_Cons: "i < j ==> [i.. [i..j+k(] = [i..j(]@[j..j+k(]" +lemma upt_add_eq_append: "i<=j ==> [i.. [i..j(] ! k = i + k" +lemma nth_upt [simp]: "i + k < j ==> [i.. take m [i..n(] = [i..i+m(]" +lemma take_upt [simp]: "!!i. i+m <= n ==> take m [i.. (map f [m..n(]) ! i = f(m+i)" +lemma nth_map_upt: "!!i. i < n-m ==> (map f [m.. 's certificate" "make_cert step phi B \ - map (\pc. if is_target step phi pc then phi!pc else B) [0..length phi(] @ [B]" + map (\pc. if is_target step phi pc then phi!pc else B) [0.. bool) \ 'a list \ bool" @@ -26,7 +26,7 @@ lemma [code]: "is_target step phi pc' = - list_ex (\pc. pc' \ pc+1 \ pc' mem (map fst (step pc (phi!pc)))) [0..length phi(]" + list_ex (\pc. pc' \ pc+1 \ pc' mem (map fst (step pc (phi!pc)))) [0..") defines phi_def: "\ \ map (\pc. if c!pc = \ then wtl (take pc ins) c 0 s0 else c!pc) - [0..length ins(]" + [0.. \ A" diff -r 7a91490c1b04 -r 6356d2523f73 src/HOL/MicroJava/BV/Typing_Framework_err.thy --- a/src/HOL/MicroJava/BV/Typing_Framework_err.thy Mon Dec 20 18:25:22 2004 +0100 +++ b/src/HOL/MicroJava/BV/Typing_Framework_err.thy Wed Dec 22 11:36:33 2004 +0100 @@ -22,7 +22,7 @@ "map_snd f \ map (\(x,y). (x, f y))" error :: "nat \ (nat \ 'a err) list" -"error n \ map (\x. (x,Err)) [0..n(]" +"error n \ map (\x. (x,Err)) [0.. (nat \ 's \ bool) \ 's step_type \ 's err step_type" "err_step n app step p t \