src/HOLCF/IOA/meta_theory/RefCorrectness.ML
changeset 6161 bc2a76ce1ea3
parent 5132 24f992a25adc
child 7229 6773ba0c36d5
equal deleted inserted replaced
6160:32c0b8f57bb7 6161:bc2a76ce1ea3
    60 (* ------------------------------------------------------------------ *)
    60 (* ------------------------------------------------------------------ *)
    61 
    61 
    62 section"properties of move";
    62 section"properties of move";
    63 
    63 
    64 Goalw [is_ref_map_def]
    64 Goalw [is_ref_map_def]
    65    "!!f. [|is_ref_map f C A; reachable C s; (s,a,t):trans_of C|] ==>\
    65    "[|is_ref_map f C A; reachable C s; (s,a,t):trans_of C|] ==>\
    66 \     move A (@x. move A x (f s) a (f t)) (f s) a (f t)";
    66 \     move A (@x. move A x (f s) a (f t)) (f s) a (f t)";
    67 
    67 
    68 by (subgoal_tac "? ex. move A ex (f s) a (f t)" 1);
    68 by (subgoal_tac "? ex. move A ex (f s) a (f t)" 1);
    69 by (Asm_full_simp_tac 2);
    69 by (Asm_full_simp_tac 2);
    70 by (etac exE 1);
    70 by (etac exE 1);
    71 by (rtac selectI 1);
    71 by (rtac selectI 1);
    72 by (assume_tac 1);
    72 by (assume_tac 1);
    73 qed"move_is_move";
    73 qed"move_is_move";
    74 
    74 
    75 Goal
    75 Goal
    76    "!!f. [|is_ref_map f C A; reachable C s; (s,a,t):trans_of C|] ==>\
    76    "[|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
    83 Goal
    84    "!!f. [|is_ref_map f C A; reachable C s; (s,a,t):trans_of C|] ==>\
    84    "[|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
    91 Goal
    92    "!!f. [|is_ref_map f C A; reachable C s; (s,a,t):trans_of C|] ==>\
    92    "[|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
    99 Goal
   100    "!!f. [|is_ref_map f C A; reachable C s; (s,a,t):trans_of C|] ==>\
   100    "[|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));
   129 (* ------------------------------------------------------
   129 (* ------------------------------------------------------
   130                  Lemma 1 :Traces coincide  
   130                  Lemma 1 :Traces coincide  
   131    ------------------------------------------------------- *)
   131    ------------------------------------------------------- *)
   132 Delsplits[split_if];
   132 Delsplits[split_if];
   133 Goalw [corresp_ex_def]
   133 Goalw [corresp_ex_def]
   134   "!!f.[|is_ref_map f C A; ext C = ext A|] ==>  \     
   134   "[|is_ref_map f C A; ext C = ext A|] ==>  \     
   135 \        !s. reachable C s & is_exec_frag C (s,xs) --> \
   135 \        !s. reachable C s & is_exec_frag C (s,xs) --> \
   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 *) 
   178 (* ----------------------------------------------------------- *)
   178 (* ----------------------------------------------------------- *)
   179 
   179 
   180 
   180 
   181 
   181 
   182 Goalw [corresp_ex_def]
   182 Goalw [corresp_ex_def]
   183  "!!f.[| is_ref_map f C A |] ==>\
   183  "[| is_ref_map f C A |] ==>\
   184 \ !s. reachable C s & is_exec_frag C (s,xs) \
   184 \ !s. reachable C s & is_exec_frag C (s,xs) \
   185 \ --> is_exec_frag A (corresp_ex A f (s,xs))"; 
   185 \ --> is_exec_frag A (corresp_ex A f (s,xs))"; 
   186 
   186 
   187 by (Asm_full_simp_tac 1);
   187 by (Asm_full_simp_tac 1);
   188 by (pair_induct_tac "xs" [is_exec_frag_def] 1);
   188 by (pair_induct_tac "xs" [is_exec_frag_def] 1);
   219 
   219 
   220 (* -------------------------------------------------------------------------------- *)
   220 (* -------------------------------------------------------------------------------- *)
   221 
   221 
   222 
   222 
   223 Goalw [traces_def]
   223 Goalw [traces_def]
   224   "!!f. [| ext C = ext A; is_ref_map f C A |] \
   224   "[| 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 
   258 Goalw [fin_often_def] "(~inf_often P s) = fin_often P s";
   258 Goalw [fin_often_def] "(~inf_often P s) = fin_often P s";
   259 by Auto_tac;
   259 by Auto_tac;
   260 qed"fininf";
   260 qed"fininf";
   261 
   261 
   262 
   262 
   263 Goal 
   263 Goal "is_wfair A W (s,ex) = \
   264 "is_wfair A W (s,ex) = \
       
   265 \ (fin_often (%x. ~Enabled A W (snd x)) ex --> inf_often (%x. fst x :W) ex)";
   264 \ (fin_often (%x. ~Enabled A W (snd x)) ex --> inf_often (%x. fst x :W) ex)";
   266 by (asm_full_simp_tac (simpset() addsimps [is_wfair_def,fin_often_def])1);
   265 by (asm_full_simp_tac (simpset() addsimps [is_wfair_def,fin_often_def])1);
   267 by Auto_tac;
   266 by Auto_tac;
   268 qed"WF_alt";
   267 qed"WF_alt";
   269 
   268 
   270 Goal  
   269 Goal "[|is_wfair A W (s,ex); inf_often (%x. Enabled A W (snd x)) ex; \
   271 "!! ex. [|is_wfair A W (s,ex); inf_often (%x. Enabled A W (snd x)) ex; \
       
   272 \         en_persistent A W|] \
   270 \         en_persistent A W|] \
   273 \   ==> inf_often (%x. fst x :W) ex";
   271 \   ==> inf_often (%x. fst x :W) ex";
   274 by (dtac persistent 1);
   272 by (dtac persistent 1);
   275 by (assume_tac 1);
   273 by (assume_tac 1);
   276 by (asm_full_simp_tac (simpset() addsimps [WF_alt])1);
   274 by (asm_full_simp_tac (simpset() addsimps [WF_alt])1);