equal
deleted
inserted
replaced
14 fun aval' :: "aexp \<Rightarrow> 'av st \<Rightarrow> 'av" where |
14 fun aval' :: "aexp \<Rightarrow> 'av st \<Rightarrow> 'av" where |
15 "aval' (N i) S = num' i" | |
15 "aval' (N i) S = num' i" | |
16 "aval' (V x) S = fun S x" | |
16 "aval' (V x) S = fun S x" | |
17 "aval' (Plus a1 a2) S = plus' (aval' a1 S) (aval' a2 S)" |
17 "aval' (Plus a1 a2) S = plus' (aval' a1 S) (aval' a2 S)" |
18 |
18 |
19 lemma aval'_sound: "s : \<gamma>\<^isub>s S \<Longrightarrow> aval a s : \<gamma>(aval' a S)" |
19 lemma aval'_correct: "s : \<gamma>\<^isub>s S \<Longrightarrow> aval a s : \<gamma>(aval' a S)" |
20 by (induction a) (auto simp: gamma_num' gamma_plus' \<gamma>_st_def) |
20 by (induction a) (auto simp: gamma_num' gamma_plus' \<gamma>_st_def) |
21 |
21 |
22 lemma gamma_Step_subcomm: fixes C1 C2 :: "'a::semilattice_sup acom" |
22 lemma gamma_Step_subcomm: fixes C1 C2 :: "'a::semilattice_sup acom" |
23 assumes "!!x e S. f1 x e (\<gamma>\<^isub>o S) \<subseteq> \<gamma>\<^isub>o (f2 x e S)" |
23 assumes "!!x e S. f1 x e (\<gamma>\<^isub>o S) \<subseteq> \<gamma>\<^isub>o (f2 x e S)" |
24 "!!b S. g1 b (\<gamma>\<^isub>o S) \<subseteq> \<gamma>\<^isub>o (g2 b S)" |
24 "!!b S. g1 b (\<gamma>\<^isub>o S) \<subseteq> \<gamma>\<^isub>o (g2 b S)" |
46 |
46 |
47 lemma strip_step'[simp]: "strip(step' S C) = strip C" |
47 lemma strip_step'[simp]: "strip(step' S C) = strip C" |
48 by(simp add: step'_def) |
48 by(simp add: step'_def) |
49 |
49 |
50 |
50 |
51 text{* Soundness: *} |
51 text{* Correctness: *} |
52 |
52 |
53 lemma step_step': "step (\<gamma>\<^isub>o S) (\<gamma>\<^isub>c C) \<le> \<gamma>\<^isub>c (step' S C)" |
53 lemma step_step': "step (\<gamma>\<^isub>o S) (\<gamma>\<^isub>c C) \<le> \<gamma>\<^isub>c (step' S C)" |
54 unfolding step_def step'_def |
54 unfolding step_def step'_def |
55 by(rule gamma_Step_subcomm) |
55 by(rule gamma_Step_subcomm) |
56 (auto simp: intro!: aval'_sound in_gamma_update split: option.splits) |
56 (auto simp: intro!: aval'_correct in_gamma_update split: option.splits) |
57 |
57 |
58 lemma AI_sound: "AI c = Some C \<Longrightarrow> CS c \<le> \<gamma>\<^isub>c C" |
58 lemma AI_correct: "AI c = Some C \<Longrightarrow> CS c \<le> \<gamma>\<^isub>c C" |
59 proof(simp add: CS_def AI_def) |
59 proof(simp add: CS_def AI_def) |
60 assume 1: "pfp (step' \<top>) (bot c) = Some C" |
60 assume 1: "pfp (step' \<top>) (bot c) = Some C" |
61 have pfp': "step' \<top> C \<le> C" by(rule pfp_pfp[OF 1]) |
61 have pfp': "step' \<top> C \<le> C" by(rule pfp_pfp[OF 1]) |
62 have 2: "step (\<gamma>\<^isub>o \<top>) (\<gamma>\<^isub>c C) \<le> \<gamma>\<^isub>c C" --"transfer the pfp'" |
62 have 2: "step (\<gamma>\<^isub>o \<top>) (\<gamma>\<^isub>c C) \<le> \<gamma>\<^isub>c C" --"transfer the pfp'" |
63 proof(rule order_trans) |
63 proof(rule order_trans) |