diff -r d6585b32412b -r b57d926d1de2 src/HOL/MicroJava/BV/LBVComplete.thy --- a/src/HOL/MicroJava/BV/LBVComplete.thy Sun Mar 24 14:05:53 2002 +0100 +++ b/src/HOL/MicroJava/BV/LBVComplete.thy Sun Mar 24 14:06:21 2002 +0100 @@ -9,60 +9,60 @@ theory LBVComplete = LBVSpec + Typing_Framework: constdefs - contains_targets :: "['s steptype, 's certificate, 's option list, nat, nat] \ bool" - "contains_targets step cert phi pc n \ - \(pc',s') \ set (step pc (OK (phi!pc))). pc' \ pc+1 \ pc' < n \ cert!pc' = phi!pc'" + contains_targets :: "['s steptype, 's certificate, 's option list, nat] \ bool" + "contains_targets step cert phi pc \ + \(pc',s') \ set (step pc (OK (phi!pc))). pc' \ pc+1 \ pc' < length phi \ cert!pc' = phi!pc'" - fits :: "['s steptype, 's certificate, 's option list, nat] \ bool" - "fits step cert phi n \ \pc. pc < n \ - contains_targets step cert phi pc n \ - (cert!pc = None \ cert!pc = phi!pc)" + fits :: "['s steptype, 's certificate, 's option list] \ bool" + "fits step cert phi \ \pc. pc < length phi \ + contains_targets step cert phi pc \ + (cert!pc = None \ cert!pc = phi!pc)" - is_target :: "['s steptype, 's option list, nat, nat] \ bool" - "is_target step phi pc' n \ - \pc s'. pc' \ pc+1 \ pc < n \ (pc',s') \ set (step pc (OK (phi!pc)))" + is_target :: "['s steptype, 's option list, nat] \ bool" + "is_target step phi pc' \ + \pc s'. pc' \ pc+1 \ pc < length phi \ (pc',s') \ set (step pc (OK (phi!pc)))" - make_cert :: "['s steptype, 's option list, nat] \ 's certificate" - "make_cert step phi n \ - map (\pc. if is_target step phi pc n then phi!pc else None) [0..n(]" + make_cert :: "['s steptype, 's option list] \ 's certificate" + "make_cert step phi \ + map (\pc. if is_target step phi pc then phi!pc else None) [0..length phi(]" lemmas [simp del] = split_paired_Ex lemma make_cert_target: - "\ pc < n; is_target step phi pc n \ \ make_cert step phi n ! pc = phi!pc" + "\ pc < length phi; is_target step phi pc \ \ make_cert step phi ! pc = phi!pc" by (simp add: make_cert_def) lemma make_cert_approx: - "\ pc < n; make_cert step phi n ! pc \ phi!pc \ \ - make_cert step phi n ! pc = None" + "\ pc < length phi; make_cert step phi ! pc \ phi!pc \ \ + make_cert step phi ! pc = None" by (auto simp add: make_cert_def) lemma make_cert_contains_targets: - "pc < n \ contains_targets step (make_cert step phi n) phi pc n" + "pc < length phi \ contains_targets step (make_cert step phi) phi pc" proof (unfold contains_targets_def, clarify) fix pc' s' - assume "pc < n" + assume "pc < length phi" "(pc',s') \ set (step pc (OK (phi ! pc)))" "pc' \ pc+1" and - pc': "pc' < n" - hence "is_target step phi pc' n" by (auto simp add: is_target_def) - with pc' show "make_cert step phi n ! pc' = phi ! pc'" + pc': "pc' < length phi" + hence "is_target step phi pc'" by (auto simp add: is_target_def) + with pc' show "make_cert step phi ! pc' = phi!pc'" by (auto intro: make_cert_target) qed theorem fits_make_cert: - "fits step (make_cert step phi n) phi n" + "fits step (make_cert step phi) phi" by (auto dest: make_cert_approx simp add: fits_def make_cert_contains_targets) lemma fitsD: - "\ fits step cert phi n; (pc',s') \ set (step pc (OK (phi ! pc))); - pc' \ Suc pc; pc < n; pc' < n \ + "\ fits step cert phi; (pc',s') \ set (step pc (OK (phi ! pc))); + pc' \ Suc pc; pc < length phi; pc' < length phi \ \ cert!pc' = phi!pc'" by (auto simp add: fits_def contains_targets_def) lemma fitsD2: - "\ fits step cert phi n; pc < n; cert!pc = Some s \ + "\ fits step cert phi; pc < length phi; cert!pc = Some s \ \ cert!pc = phi!pc" by (auto simp add: fits_def) @@ -82,8 +82,9 @@ lemma stable_wtl: assumes stable: "stable (Err.le (Opt.le r)) step (map OK phi) pc" - assumes fits: "fits step cert phi n" + assumes fits: "fits step cert phi" assumes pc: "pc < length phi" + assumes bounded:"bounded step (length phi)" shows "wtl_inst cert f r step pc (phi!pc) \ Err" proof - from pc have [simp]: "map OK phi ! pc = OK (phi!pc)" by simp @@ -91,7 +92,10 @@ have "\(q,s')\set (step pc (OK (phi!pc))). s' \|r (map OK phi!q)" by (simp add: stable_def) - + have "merge cert f r pc (step pc (OK (phi ! pc))) (OK (cert ! Suc pc)) \ Err" + sorry + thus ?thesis by (simp add: wtl_inst_def) +qed lemma wtl_inst_mono: