src/HOLCF/IOA/meta_theory/RefCorrectness.ML
changeset 4098 71e05eb27fb6
parent 4034 5bb30bedbdc2
child 4559 8e604d885b54
equal deleted inserted replaced
4097:ddd1c18121e0 4098:71e05eb27fb6
    25 \                        `x) ))";
    25 \                        `x) ))";
    26 by (rtac trans 1);
    26 by (rtac trans 1);
    27 by (rtac fix_eq2 1);
    27 by (rtac fix_eq2 1);
    28 by (rtac corresp_exC_def 1);
    28 by (rtac corresp_exC_def 1);
    29 by (rtac beta_cfun 1);
    29 by (rtac beta_cfun 1);
    30 by (simp_tac (!simpset addsimps [flift1_def]) 1);
    30 by (simp_tac (simpset() addsimps [flift1_def]) 1);
    31 qed"corresp_exC_unfold";
    31 qed"corresp_exC_unfold";
    32 
    32 
    33 goal thy "(corresp_exC A f`UU) s=UU";
    33 goal thy "(corresp_exC A f`UU) s=UU";
    34 by (stac corresp_exC_unfold 1);
    34 by (stac corresp_exC_unfold 1);
    35 by (Simp_tac 1);
    35 by (Simp_tac 1);
    43 goal thy "(corresp_exC A f`(at>>xs)) s = \
    43 goal thy "(corresp_exC A f`(at>>xs)) s = \
    44 \          (@cex. move A cex (f s) (fst at) (f (snd at)))  \
    44 \          (@cex. move A cex (f s) (fst at) (f (snd at)))  \
    45 \          @@ ((corresp_exC A f`xs) (snd at))";
    45 \          @@ ((corresp_exC A f`xs) (snd at))";
    46 by (rtac trans 1);
    46 by (rtac trans 1);
    47 by (stac corresp_exC_unfold 1);
    47 by (stac corresp_exC_unfold 1);
    48 by (asm_full_simp_tac (!simpset addsimps [Cons_def,flift1_def]) 1);
    48 by (asm_full_simp_tac (simpset() addsimps [Cons_def,flift1_def]) 1);
    49 by (Simp_tac 1);
    49 by (Simp_tac 1);
    50 qed"corresp_exC_cons";
    50 qed"corresp_exC_cons";
    51 
    51 
    52 
    52 
    53 Addsimps [corresp_exC_UU,corresp_exC_nil,corresp_exC_cons];
    53 Addsimps [corresp_exC_UU,corresp_exC_nil,corresp_exC_cons];
    75 goal thy
    75 goal thy
    76    "!!f. [|is_ref_map f C A; reachable C s; (s,a,t):trans_of C|] ==>\
    76    "!!f. [|is_ref_map f C A; reachable C s; (s,a,t):trans_of C|] ==>\
    77 \    is_exec_frag A (f s,@x. move A x (f s) a (f t))";
    77 \    is_exec_frag A (f s,@x. move A x (f s) a (f t))";
    78 by (cut_inst_tac [] move_is_move 1);
    78 by (cut_inst_tac [] move_is_move 1);
    79 by (REPEAT (assume_tac 1));
    79 by (REPEAT (assume_tac 1));
    80 by (asm_full_simp_tac (!simpset addsimps [move_def]) 1);
    80 by (asm_full_simp_tac (simpset() addsimps [move_def]) 1);
    81 qed"move_subprop1";
    81 qed"move_subprop1";
    82 
    82 
    83 goal thy
    83 goal thy
    84    "!!f. [|is_ref_map f C A; reachable C s; (s,a,t):trans_of C|] ==>\
    84    "!!f. [|is_ref_map f C A; reachable C s; (s,a,t):trans_of C|] ==>\
    85 \    Finite ((@x. move A x (f s) a (f t)))";
    85 \    Finite ((@x. move A x (f s) a (f t)))";
    86 by (cut_inst_tac [] move_is_move 1);
    86 by (cut_inst_tac [] move_is_move 1);
    87 by (REPEAT (assume_tac 1));
    87 by (REPEAT (assume_tac 1));
    88 by (asm_full_simp_tac (!simpset addsimps [move_def]) 1);
    88 by (asm_full_simp_tac (simpset() addsimps [move_def]) 1);
    89 qed"move_subprop2";
    89 qed"move_subprop2";
    90 
    90 
    91 goal thy
    91 goal thy
    92    "!!f. [|is_ref_map f C A; reachable C s; (s,a,t):trans_of C|] ==>\
    92    "!!f. [|is_ref_map f C A; reachable C s; (s,a,t):trans_of C|] ==>\
    93 \    laststate (f s,@x. move A x (f s) a (f t)) = (f t)";
    93 \    laststate (f s,@x. move A x (f s) a (f t)) = (f t)";
    94 by (cut_inst_tac [] move_is_move 1);
    94 by (cut_inst_tac [] move_is_move 1);
    95 by (REPEAT (assume_tac 1));
    95 by (REPEAT (assume_tac 1));
    96 by (asm_full_simp_tac (!simpset addsimps [move_def]) 1);
    96 by (asm_full_simp_tac (simpset() addsimps [move_def]) 1);
    97 qed"move_subprop3";
    97 qed"move_subprop3";
    98 
    98 
    99 goal thy
    99 goal thy
   100    "!!f. [|is_ref_map f C A; reachable C s; (s,a,t):trans_of C|] ==>\
   100    "!!f. [|is_ref_map f C A; reachable C s; (s,a,t):trans_of C|] ==>\
   101 \     mk_trace A`((@x. move A x (f s) a (f t))) = \
   101 \     mk_trace A`((@x. move A x (f s) a (f t))) = \
   102 \       (if a:ext A then a>>nil else nil)";
   102 \       (if a:ext A then a>>nil else nil)";
   103 
   103 
   104 by (cut_inst_tac [] move_is_move 1);
   104 by (cut_inst_tac [] move_is_move 1);
   105 by (REPEAT (assume_tac 1));
   105 by (REPEAT (assume_tac 1));
   106 by (asm_full_simp_tac (!simpset addsimps [move_def]) 1);
   106 by (asm_full_simp_tac (simpset() addsimps [move_def]) 1);
   107 qed"move_subprop4";
   107 qed"move_subprop4";
   108 
   108 
   109 
   109 
   110 (* ------------------------------------------------------------------ *)
   110 (* ------------------------------------------------------------------ *)
   111 (*                   The following lemmata contribute to              *)
   111 (*                   The following lemmata contribute to              *)
   118 (*   Lemma 1.1: Distribution of mk_trace and @@        *)
   118 (*   Lemma 1.1: Distribution of mk_trace and @@        *)
   119 (* --------------------------------------------------- *)
   119 (* --------------------------------------------------- *)
   120 
   120 
   121 
   121 
   122 goal thy "mk_trace C`(ex1 @@ ex2)= (mk_trace C`ex1) @@ (mk_trace C`ex2)";
   122 goal thy "mk_trace C`(ex1 @@ ex2)= (mk_trace C`ex1) @@ (mk_trace C`ex2)";
   123 by (simp_tac (!simpset addsimps [mk_trace_def,filter_act_def,
   123 by (simp_tac (simpset() addsimps [mk_trace_def,filter_act_def,
   124                                  FilterConc,MapConc]) 1);
   124                                  FilterConc,MapConc]) 1);
   125 qed"mk_traceConc";
   125 qed"mk_traceConc";
   126 
   126 
   127 
   127 
   128 
   128 
   136 \            mk_trace C`xs = mk_trace A`(snd (corresp_ex A f (s,xs)))";
   136 \            mk_trace C`xs = mk_trace A`(snd (corresp_ex A f (s,xs)))";
   137 
   137 
   138 by (pair_induct_tac "xs" [is_exec_frag_def] 1);
   138 by (pair_induct_tac "xs" [is_exec_frag_def] 1);
   139 (* cons case *) 
   139 (* cons case *) 
   140 by (safe_tac set_cs);
   140 by (safe_tac set_cs);
   141 by (asm_full_simp_tac (!simpset addsimps [mk_traceConc]) 1);
   141 by (asm_full_simp_tac (simpset() addsimps [mk_traceConc]) 1);
   142 by (forward_tac [reachable.reachable_n] 1);
   142 by (forward_tac [reachable.reachable_n] 1);
   143 by (assume_tac 1);
   143 by (assume_tac 1);
   144 by (eres_inst_tac [("x","y")] allE 1);
   144 by (eres_inst_tac [("x","y")] allE 1);
   145 by (Asm_full_simp_tac 1);
   145 by (Asm_full_simp_tac 1);
   146 by (asm_full_simp_tac (!simpset addsimps [move_subprop4] 
   146 by (asm_full_simp_tac (simpset() addsimps [move_subprop4] 
   147                           setloop split_tac [expand_if] ) 1);
   147                           setloop split_tac [expand_if] ) 1);
   148 qed"lemma_1";
   148 qed"lemma_1";
   149 
   149 
   150 
   150 
   151 (* ------------------------------------------------------------------ *)
   151 (* ------------------------------------------------------------------ *)
   222 
   222 
   223 goalw thy [traces_def]
   223 goalw thy [traces_def]
   224   "!!f. [| ext C = ext A; is_ref_map f C A |] \
   224   "!!f. [| ext C = ext A; is_ref_map f C A |] \
   225 \          ==> traces C <= traces A"; 
   225 \          ==> traces C <= traces A"; 
   226 
   226 
   227   by (simp_tac(!simpset addsimps [has_trace_def2])1);
   227   by (simp_tac(simpset() addsimps [has_trace_def2])1);
   228   by (safe_tac set_cs);
   228   by (safe_tac set_cs);
   229 
   229 
   230   (* give execution of abstract automata *)
   230   (* give execution of abstract automata *)
   231   by (res_inst_tac[("x","corresp_ex A f ex")] bexI 1);
   231   by (res_inst_tac[("x","corresp_ex A f ex")] bexI 1);
   232   
   232   
   233   (* Traces coincide, Lemma 1 *)
   233   (* Traces coincide, Lemma 1 *)
   234   by (pair_tac "ex" 1);
   234   by (pair_tac "ex" 1);
   235   by (etac (lemma_1 RS spec RS mp) 1);
   235   by (etac (lemma_1 RS spec RS mp) 1);
   236   by (REPEAT (atac 1));
   236   by (REPEAT (atac 1));
   237   by (asm_full_simp_tac (!simpset addsimps [executions_def,reachable.reachable_0]) 1);
   237   by (asm_full_simp_tac (simpset() addsimps [executions_def,reachable.reachable_0]) 1);
   238  
   238  
   239   (* corresp_ex is execution, Lemma 2 *)
   239   (* corresp_ex is execution, Lemma 2 *)
   240   by (pair_tac "ex" 1);
   240   by (pair_tac "ex" 1);
   241   by (asm_full_simp_tac (!simpset addsimps [executions_def]) 1);
   241   by (asm_full_simp_tac (simpset() addsimps [executions_def]) 1);
   242   (* start state *) 
   242   (* start state *) 
   243   by (rtac conjI 1);
   243   by (rtac conjI 1);
   244   by (asm_full_simp_tac (!simpset addsimps [is_ref_map_def,corresp_ex_def]) 1);
   244   by (asm_full_simp_tac (simpset() addsimps [is_ref_map_def,corresp_ex_def]) 1);
   245   (* is-execution-fragment *)
   245   (* is-execution-fragment *)
   246   by (etac (lemma_2 RS spec RS mp) 1);
   246   by (etac (lemma_2 RS spec RS mp) 1);
   247   by (asm_full_simp_tac (!simpset addsimps [reachable.reachable_0]) 1);
   247   by (asm_full_simp_tac (simpset() addsimps [reachable.reachable_0]) 1);
   248 qed"trace_inclusion"; 
   248 qed"trace_inclusion"; 
   249 
   249 
   250 
   250 
   251 
   251 
   252 
   252