1 (* Title: HOL/IOA/example/Correctness.thy
5 header {* Correctness Proof *}
8 imports SimCorrectness Spec Impl
14 sim_relation :: "((nat * bool) * (nat set * bool)) set" where
15 "sim_relation = {qua. let c = fst qua; a = snd qua ;
17 used = fst a; c = snd a
19 (! l:used. l < k) & b=c}"
21 declare split_paired_Ex [simp del]
24 (* Idea: instead of impl_con_lemma do not rewrite impl_ioa, but derive
25 simple lemmas asig_of impl_ioa = impl_sig, trans_of impl_ioa = impl_trans
26 Idea: ?ex. move .. should be generally replaced by a step via a subst tac if desired,
27 as this can be done globally *)
30 "is_simulation sim_relation impl_ioa spec_ioa"
31 apply (simp (no_asm) add: is_simulation_def)
33 txt {* start states *}
35 apply (rule_tac x = " ({},False) " in exI)
36 apply (simp add: sim_relation_def starts_of_def spec_ioa_def impl_ioa_def)
39 apply (rule imp_conj_lemma)
40 apply (rename_tac k b used c k' b' a)
41 apply (induct_tac "a")
42 apply (simp_all (no_asm) add: sim_relation_def impl_ioa_def impl_trans_def trans_of_def)
45 apply (rule_tac x = "(used,True)" in exI)
47 apply (rule transition_is_ex)
48 apply (simp (no_asm) add: spec_ioa_def spec_trans_def trans_of_def)
50 apply (rule_tac x = " (used Un {k},False) " in exI)
51 apply (simp add: less_SucI)
52 apply (rule transition_is_ex)
53 apply (simp (no_asm) add: spec_ioa_def spec_trans_def trans_of_def)
56 apply (rule_tac x = " (used - {nat},c) " in exI)
58 apply (rule transition_is_ex)
59 apply (simp (no_asm) add: spec_ioa_def spec_trans_def trans_of_def)
64 "impl_ioa =<| spec_ioa"
65 apply (unfold ioa_implements_def)
67 apply (simp (no_asm) add: impl_sig_def spec_sig_def impl_ioa_def spec_ioa_def
68 asig_outputs_def asig_of_def asig_inputs_def)
69 apply (rule trace_inclusion_for_simulations)
70 apply (simp (no_asm) add: impl_sig_def spec_sig_def impl_ioa_def spec_ioa_def
71 externals_def asig_outputs_def asig_of_def asig_inputs_def)
72 apply (rule issimulation)