src/HOLCF/IOA/meta_theory/RefCorrectness.ML
changeset 17233 41eee2e7b465
parent 14981 e73f8140af78
child 19360 f47412f922ab
equal deleted inserted replaced
17232:148c241d2492 17233:41eee2e7b465
     1 (*  Title:      HOLCF/IOA/meta_theory/RefCorrectness.ML
     1 (*  Title:      HOLCF/IOA/meta_theory/RefCorrectness.ML
     2     ID:         $Id$
     2     ID:         $Id$
     3     Author:     Olaf Müller
     3     Author:     Olaf Müller
     4 
       
     5 Correctness of Refinement Mappings in HOLCF/IOA.
       
     6 *)
     4 *)
     7 
       
     8 
     5 
     9 
     6 
    10 (* -------------------------------------------------------------------------------- *)
     7 (* -------------------------------------------------------------------------------- *)
    11 
     8 
    12 section "corresp_ex";
     9 section "corresp_ex";
   124 qed"mk_traceConc";
   121 qed"mk_traceConc";
   125 
   122 
   126 
   123 
   127 
   124 
   128 (* ------------------------------------------------------
   125 (* ------------------------------------------------------
   129                  Lemma 1 :Traces coincide  
   126                  Lemma 1 :Traces coincide
   130    ------------------------------------------------------- *)
   127    ------------------------------------------------------- *)
   131 Delsplits[split_if];
   128 Delsplits[split_if];
   132 Goalw [corresp_ex_def]
   129 Goalw [corresp_ex_def]
   133   "[|is_ref_map f C A; ext C = ext A|] ==>  \     
   130   "[|is_ref_map f C A; ext C = ext A|] ==>  \
   134 \        !s. reachable C s & is_exec_frag C (s,xs) --> \
   131 \        !s. reachable C s & is_exec_frag C (s,xs) --> \
   135 \            mk_trace C$xs = mk_trace A$(snd (corresp_ex A f (s,xs)))";
   132 \            mk_trace C$xs = mk_trace A$(snd (corresp_ex A f (s,xs)))";
   136 
   133 
   137 by (pair_induct_tac "xs" [is_exec_frag_def] 1);
   134 by (pair_induct_tac "xs" [is_exec_frag_def] 1);
   138 (* cons case *) 
   135 (* cons case *)
   139 by (safe_tac set_cs);
   136 by (safe_tac set_cs);
   140 by (asm_full_simp_tac (simpset() addsimps [mk_traceConc]) 1);
   137 by (asm_full_simp_tac (simpset() addsimps [mk_traceConc]) 1);
   141 by (forward_tac [reachable.reachable_n] 1);
   138 by (forward_tac [reachable.reachable_n] 1);
   142 by (assume_tac 1);
   139 by (assume_tac 1);
   143 by (eres_inst_tac [("x","y")] allE 1);
   140 by (eres_inst_tac [("x","y")] allE 1);
   144 by (Asm_full_simp_tac 1);
   141 by (Asm_full_simp_tac 1);
   145 by (asm_full_simp_tac (simpset() addsimps [move_subprop4] 
   142 by (asm_full_simp_tac (simpset() addsimps [move_subprop4]
   146                           addsplits [split_if]) 1);
   143                           addsplits [split_if]) 1);
   147 qed"lemma_1";
   144 qed"lemma_1";
   148 Addsplits[split_if];
   145 Addsplits[split_if];
   149 
   146 
   150 (* ------------------------------------------------------------------ *)
   147 (* ------------------------------------------------------------------ *)
   156 
   153 
   157 (* -------------------------------------------------- *)
   154 (* -------------------------------------------------- *)
   158 (*                   Lemma 2.1                        *)
   155 (*                   Lemma 2.1                        *)
   159 (* -------------------------------------------------- *)
   156 (* -------------------------------------------------- *)
   160 
   157 
   161 Goal 
   158 Goal
   162 "Finite xs --> \
   159 "Finite xs --> \
   163 \(!s .is_exec_frag A (s,xs) & is_exec_frag A (t,ys) & \ 
   160 \(!s .is_exec_frag A (s,xs) & is_exec_frag A (t,ys) & \
   164 \     t = laststate (s,xs) \
   161 \     t = laststate (s,xs) \
   165 \ --> is_exec_frag A (s,xs @@ ys))";
   162 \ --> is_exec_frag A (s,xs @@ ys))";
   166 
   163 
   167 by (rtac impI 1);
   164 by (rtac impI 1);
   168 by (Seq_Finite_induct_tac 1);
   165 by (Seq_Finite_induct_tac 1);
   179 
   176 
   180 
   177 
   181 Goalw [corresp_ex_def]
   178 Goalw [corresp_ex_def]
   182  "[| is_ref_map f C A |] ==>\
   179  "[| is_ref_map f C A |] ==>\
   183 \ !s. reachable C s & is_exec_frag C (s,xs) \
   180 \ !s. reachable C s & is_exec_frag C (s,xs) \
   184 \ --> is_exec_frag A (corresp_ex A f (s,xs))"; 
   181 \ --> is_exec_frag A (corresp_ex A f (s,xs))";
   185 
   182 
   186 by (Asm_full_simp_tac 1);
   183 by (Asm_full_simp_tac 1);
   187 by (pair_induct_tac "xs" [is_exec_frag_def] 1);
   184 by (pair_induct_tac "xs" [is_exec_frag_def] 1);
   188 (* main case *)
   185 (* main case *)
   189 by (safe_tac set_cs);
   186 by (safe_tac set_cs);
   219 (* -------------------------------------------------------------------------------- *)
   216 (* -------------------------------------------------------------------------------- *)
   220 
   217 
   221 
   218 
   222 Goalw [traces_def]
   219 Goalw [traces_def]
   223   "[| ext C = ext A; is_ref_map f C A |] \
   220   "[| ext C = ext A; is_ref_map f C A |] \
   224 \          ==> traces C <= traces A"; 
   221 \          ==> traces C <= traces A";
   225 
   222 
   226   by (simp_tac(simpset() addsimps [has_trace_def2])1);
   223   by (simp_tac(simpset() addsimps [has_trace_def2])1);
   227   by (safe_tac set_cs);
   224   by (safe_tac set_cs);
   228 
   225 
   229   (* give execution of abstract automata *)
   226   (* give execution of abstract automata *)
   230   by (res_inst_tac[("x","corresp_ex A f ex")] bexI 1);
   227   by (res_inst_tac[("x","corresp_ex A f ex")] bexI 1);
   231   
   228 
   232   (* Traces coincide, Lemma 1 *)
   229   (* Traces coincide, Lemma 1 *)
   233   by (pair_tac "ex" 1);
   230   by (pair_tac "ex" 1);
   234   by (etac (lemma_1 RS spec RS mp) 1);
   231   by (etac (lemma_1 RS spec RS mp) 1);
   235   by (REPEAT (atac 1));
   232   by (REPEAT (atac 1));
   236   by (asm_full_simp_tac (simpset() addsimps [executions_def,reachable.reachable_0]) 1);
   233   by (asm_full_simp_tac (simpset() addsimps [executions_def,reachable.reachable_0]) 1);
   237  
   234 
   238   (* corresp_ex is execution, Lemma 2 *)
   235   (* corresp_ex is execution, Lemma 2 *)
   239   by (pair_tac "ex" 1);
   236   by (pair_tac "ex" 1);
   240   by (asm_full_simp_tac (simpset() addsimps [executions_def]) 1);
   237   by (asm_full_simp_tac (simpset() addsimps [executions_def]) 1);
   241   (* start state *) 
   238   (* start state *)
   242   by (rtac conjI 1);
   239   by (rtac conjI 1);
   243   by (asm_full_simp_tac (simpset() addsimps [is_ref_map_def,corresp_ex_def]) 1);
   240   by (asm_full_simp_tac (simpset() addsimps [is_ref_map_def,corresp_ex_def]) 1);
   244   (* is-execution-fragment *)
   241   (* is-execution-fragment *)
   245   by (etac (lemma_2 RS spec RS mp) 1);
   242   by (etac (lemma_2 RS spec RS mp) 1);
   246   by (asm_full_simp_tac (simpset() addsimps [reachable.reachable_0]) 1);
   243   by (asm_full_simp_tac (simpset() addsimps [reachable.reachable_0]) 1);
   247 qed"trace_inclusion"; 
   244 qed"trace_inclusion";
   248 
   245 
   249 
   246 
   250 (* -------------------------------------------------------------------------------- *)
   247 (* -------------------------------------------------------------------------------- *)
   251 
   248 
   252 section "Corollary:  F A I R  T R A C E - I N C L U S I O N";
   249 section "Corollary:  F A I R  T R A C E - I N C L U S I O N";
   288   (* Traces coincide, Lemma 1 *)
   285   (* Traces coincide, Lemma 1 *)
   289   by (pair_tac "ex" 1);
   286   by (pair_tac "ex" 1);
   290   by (etac (lemma_1 RS spec RS mp) 1);
   287   by (etac (lemma_1 RS spec RS mp) 1);
   291   by (REPEAT (atac 1));
   288   by (REPEAT (atac 1));
   292   by (asm_full_simp_tac (simpset() addsimps [executions_def,reachable.reachable_0]) 1);
   289   by (asm_full_simp_tac (simpset() addsimps [executions_def,reachable.reachable_0]) 1);
   293  
   290 
   294   (* corresp_ex is execution, Lemma 2 *)
   291   (* corresp_ex is execution, Lemma 2 *)
   295   by (pair_tac "ex" 1);
   292   by (pair_tac "ex" 1);
   296   by (asm_full_simp_tac (simpset() addsimps [executions_def]) 1);
   293   by (asm_full_simp_tac (simpset() addsimps [executions_def]) 1);
   297   (* start state *) 
   294   (* start state *)
   298   by (rtac conjI 1);
   295   by (rtac conjI 1);
   299   by (asm_full_simp_tac (simpset() addsimps [is_ref_map_def,corresp_ex_def]) 1);
   296   by (asm_full_simp_tac (simpset() addsimps [is_ref_map_def,corresp_ex_def]) 1);
   300   (* is-execution-fragment *)
   297   (* is-execution-fragment *)
   301   by (etac (lemma_2 RS spec RS mp) 1);
   298   by (etac (lemma_2 RS spec RS mp) 1);
   302   by (asm_full_simp_tac (simpset() addsimps [reachable.reachable_0]) 1);
   299   by (asm_full_simp_tac (simpset() addsimps [reachable.reachable_0]) 1);
   318   by (pair_tac "ex" 1);
   315   by (pair_tac "ex" 1);
   319   by (etac (lemma_1 RS spec RS mp) 1);
   316   by (etac (lemma_1 RS spec RS mp) 1);
   320   by (simp_tac (simpset() addsimps [externals_def])1);
   317   by (simp_tac (simpset() addsimps [externals_def])1);
   321   by (SELECT_GOAL (auto_tac (claset(),simpset()))1);
   318   by (SELECT_GOAL (auto_tac (claset(),simpset()))1);
   322   by (asm_full_simp_tac (simpset() addsimps [executions_def,reachable.reachable_0]) 1);
   319   by (asm_full_simp_tac (simpset() addsimps [executions_def,reachable.reachable_0]) 1);
   323  
   320 
   324   (* corresp_ex is execution, Lemma 2 *)
   321   (* corresp_ex is execution, Lemma 2 *)
   325   by (pair_tac "ex" 1);
   322   by (pair_tac "ex" 1);
   326   by (asm_full_simp_tac (simpset() addsimps [executions_def]) 1);
   323   by (asm_full_simp_tac (simpset() addsimps [executions_def]) 1);
   327   (* start state *) 
   324   (* start state *)
   328   by (rtac conjI 1);
   325   by (rtac conjI 1);
   329   by (asm_full_simp_tac (simpset() addsimps [is_ref_map_def,corresp_ex_def]) 1);
   326   by (asm_full_simp_tac (simpset() addsimps [is_ref_map_def,corresp_ex_def]) 1);
   330   (* is-execution-fragment *)
   327   (* is-execution-fragment *)
   331   by (etac (lemma_2 RS spec RS mp) 1);
   328   by (etac (lemma_2 RS spec RS mp) 1);
   332   by (asm_full_simp_tac (simpset() addsimps [reachable.reachable_0]) 1);
   329   by (asm_full_simp_tac (simpset() addsimps [reachable.reachable_0]) 1);
   333 
   330 
   334  (* Fairness *)
   331  (* Fairness *)
   335 by Auto_tac;
   332 by Auto_tac;
   336 qed"fair_trace_inclusion2";
   333 qed"fair_trace_inclusion2";
   337 
       
   338 
       
   339 
       
   340 
       
   341