src/HOL/Lex/AutoChopper.ML
changeset 2609 4370e5f0fa3f
parent 2056 93c093620c28
child 3842 b55686a7b22c
equal deleted inserted replaced
2608:450c9b682a92 2609:4370e5f0fa3f
    49 
    49 
    50 
    50 
    51 goal AutoChopper.thy
    51 goal AutoChopper.thy
    52 "! r erk l rst st ys yss zs::'a list. \
    52 "! r erk l rst st ys yss zs::'a list. \
    53 \    acc xs st erk r (l,rst) A = (ys#yss, zs) --> \
    53 \    acc xs st erk r (l,rst) A = (ys#yss, zs) --> \
    54 \    ys@flat(yss)@zs = (if acc_prefix A st xs then r@xs else erk@flat(l)@rst)";
    54 \    ys@concat(yss)@zs = (if acc_prefix A st xs then r@xs else erk@concat(l)@rst)";
    55 by (list.induct_tac "xs" 1);
    55 by (list.induct_tac "xs" 1);
    56  by (simp_tac (!simpset addcongs [conj_cong] setloop (split_tac [expand_if])) 1);
    56  by (simp_tac (!simpset addcongs [conj_cong] setloop (split_tac [expand_if])) 1);
    57 by (asm_simp_tac (!simpset setloop (split_tac [expand_if])) 1);
    57 by (asm_simp_tac (!simpset setloop (split_tac [expand_if])) 1);
    58 by (res_inst_tac [("p","acc list (start A) [] [] ([],list) A")] PairE 1);
    58 by (res_inst_tac [("p","acc list (start A) [] [] ([],list) A")] PairE 1);
    59 by (rename_tac "vss lrst" 1);  
    59 by (rename_tac "vss lrst" 1);  
   131 
   131 
   132 goal AutoChopper.thy
   132 goal AutoChopper.thy
   133  "! st erk r l rest ys yss zs. \
   133  "! st erk r l rest ys yss zs. \
   134 \   acc xs st erk r (l,rest) A = (ys#yss, zs) --> \
   134 \   acc xs st erk r (l,rest) A = (ys#yss, zs) --> \
   135 \     (if acc_prefix A st xs       \
   135 \     (if acc_prefix A st xs       \
   136 \      then acc(flat(yss)@zs)(start A) [] [] ([],flat(yss)@zs) A = (yss,zs) \
   136 \      then acc(concat(yss)@zs)(start A) [] [] ([],concat(yss)@zs) A = (yss,zs) \
   137 \      else (erk~=[] & (l,rest)=(yss,zs)) | (erk=[] & (l, rest)=(ys#yss,zs)))";
   137 \      else (erk~=[] & (l,rest)=(yss,zs)) | (erk=[] & (l, rest)=(ys#yss,zs)))";
   138 by (simp_tac (!simpset setloop (split_tac [expand_if])) 1);
   138 by (simp_tac (!simpset setloop (split_tac [expand_if])) 1);
   139 by (list.induct_tac "xs" 1);
   139 by (list.induct_tac "xs" 1);
   140  by (simp_tac (!simpset addcongs [conj_cong] setloop (split_tac [expand_if])) 1);
   140  by (simp_tac (!simpset addcongs [conj_cong] setloop (split_tac [expand_if])) 1);
   141  by (Fast_tac 1);
   141  by (Fast_tac 1);
   149 by (subgoal_tac "acc list (start A) [] [] ([],list) A = (yss,zs)" 1);
   149 by (subgoal_tac "acc list (start A) [] [] ([],list) A = (yss,zs)" 1);
   150  by (Asm_simp_tac 2);
   150  by (Asm_simp_tac 2);
   151  by (subgoal_tac "r@[a] ~= []" 2);
   151  by (subgoal_tac "r@[a] ~= []" 2);
   152   by (Fast_tac 2);
   152   by (Fast_tac 2);
   153  by (Simp_tac 2);
   153  by (Simp_tac 2);
   154 by (subgoal_tac "flat(yss) @ zs = list" 1);
   154 by (subgoal_tac "concat(yss) @ zs = list" 1);
   155  by (hyp_subst_tac 1);
   155  by (hyp_subst_tac 1);
   156  by (atac 1);
   156  by (atac 1);
   157 by (case_tac "yss = []" 1);
   157 by (case_tac "yss = []" 1);
   158  by (Asm_simp_tac 1);
   158  by (Asm_simp_tac 1);
   159  by (hyp_subst_tac 1);
   159  by (hyp_subst_tac 1);