src/HOLCF/IOA/meta_theory/RefCorrectness.ML
changeset 3457 a8ab7c64817c
parent 3433 2de17c994071
child 3847 d5905b98291f
equal deleted inserted replaced
3456:fdb1768ebd3e 3457:a8ab7c64817c
    22 \      nil =>  nil   \
    22 \      nil =>  nil   \
    23 \    | x##xs => (flift1 (%pr. (@cex. move A cex (f s) (fst pr) (f (snd pr)))   \
    23 \    | x##xs => (flift1 (%pr. (@cex. move A cex (f s) (fst pr) (f (snd pr)))   \
    24 \                              @@ ((corresp_exC A f `xs) (snd pr)))   \
    24 \                              @@ ((corresp_exC A f `xs) (snd pr)))   \
    25 \                        `x) ))";
    25 \                        `x) ))";
    26 by (rtac trans 1);
    26 by (rtac trans 1);
    27 br fix_eq2 1;
    27 by (rtac fix_eq2 1);
    28 br corresp_exC_def 1;
    28 by (rtac corresp_exC_def 1);
    29 br 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);
    41 qed"corresp_exC_nil";
    41 qed"corresp_exC_nil";
    42 
    42 
    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 br 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 
   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 ba 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";
   163 "Finite xs --> \
   163 "Finite xs --> \
   164 \(!s .is_exec_frag A (s,xs) & is_exec_frag A (t,ys) & \ 
   164 \(!s .is_exec_frag A (s,xs) & is_exec_frag A (t,ys) & \ 
   165 \     t = laststate (s,xs) \
   165 \     t = laststate (s,xs) \
   166 \ --> is_exec_frag A (s,xs @@ ys))";
   166 \ --> is_exec_frag A (s,xs @@ ys))";
   167 
   167 
   168 br impI 1;
   168 by (rtac impI 1);
   169 by (Seq_Finite_induct_tac 1);
   169 by (Seq_Finite_induct_tac 1);
   170 (* base_case *)
   170 (* base_case *)
   171 by (fast_tac HOL_cs 1);
   171 by (fast_tac HOL_cs 1);
   172 (* main case *)
   172 (* main case *)
   173 by (safe_tac set_cs);
   173 by (safe_tac set_cs);
   191 (* main case *)
   191 (* main case *)
   192 by (safe_tac set_cs);
   192 by (safe_tac set_cs);
   193 by (res_inst_tac [("t","f y")]  lemma_2_1 1);
   193 by (res_inst_tac [("t","f y")]  lemma_2_1 1);
   194 
   194 
   195 (* Finite *)
   195 (* Finite *)
   196 be move_subprop2 1;
   196 by (etac move_subprop2 1);
   197 by (REPEAT (atac 1));
   197 by (REPEAT (atac 1));
   198 by (rtac conjI 1);
   198 by (rtac conjI 1);
   199 
   199 
   200 (* is_exec_frag *)
   200 (* is_exec_frag *)
   201 be  move_subprop1 1;
   201 by (etac move_subprop1 1);
   202 by (REPEAT (atac 1));
   202 by (REPEAT (atac 1));
   203 by (rtac conjI 1);
   203 by (rtac conjI 1);
   204 
   204 
   205 (* Induction hypothesis  *)
   205 (* Induction hypothesis  *)
   206 (* reachable_n looping, therefore apply it manually *)
   206 (* reachable_n looping, therefore apply it manually *)
   207 by (eres_inst_tac [("x","y")] allE 1);
   207 by (eres_inst_tac [("x","y")] allE 1);
   208 by (Asm_full_simp_tac 1);
   208 by (Asm_full_simp_tac 1);
   209 by (forward_tac [reachable.reachable_n] 1);
   209 by (forward_tac [reachable.reachable_n] 1);
   210 ba 1;
   210 by (assume_tac 1);
   211 by (Asm_full_simp_tac 1);
   211 by (Asm_full_simp_tac 1);
   212 (* laststate *)
   212 (* laststate *)
   213 be (move_subprop3 RS sym) 1;
   213 by (etac (move_subprop3 RS sym) 1);
   214 by (REPEAT (atac 1));
   214 by (REPEAT (atac 1));
   215 qed"lemma_2";
   215 qed"lemma_2";
   216 
   216 
   217 
   217 
   218 (* -------------------------------------------------------------------------------- *)
   218 (* -------------------------------------------------------------------------------- *)