src/HOL/MicroJava/BV/LBVComplete.ML
author wenzelm
Tue, 30 May 2000 16:08:38 +0200
changeset 9000 c20d58286a51
parent 8442 96023903c2df
permissions -rw-r--r--
cleaned up;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
8388
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
     1
Goal "\\<forall> n. length (option_filter_n l P n) = length l";
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
     2
by (induct_tac "l" 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
     3
by Auto_tac;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
     4
qed_spec_mp "length_option_filter_n";
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
     5
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
     6
Goalw[is_approx_def] "\\<forall> n. is_approx (option_filter_n a P n) a";
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
     7
by (induct_tac "a" 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
     8
 by (Clarsimp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
     9
by (Clarsimp_tac 1);
8423
3c19160b6432 exhaust_tac -> cases_tac
nipkow
parents: 8394
diff changeset
    10
by (case_tac "P n" 1);
8388
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    11
 by (Clarsimp_tac 1);
8442
96023903c2df case_tac now subsumes both boolean and datatype cases;
wenzelm
parents: 8423
diff changeset
    12
 by (case_tac "na" 1);
8388
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    13
  by (Clarsimp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    14
 by (clarsimp_tac (claset(), simpset() addsimps [length_option_filter_n]) 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    15
 by (Force_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    16
by (Clarsimp_tac 1);
8442
96023903c2df case_tac now subsumes both boolean and datatype cases;
wenzelm
parents: 8423
diff changeset
    17
by (case_tac "na" 1);
8388
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    18
 by (Clarsimp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    19
by (force_tac (claset(), simpset() addsimps [length_option_filter_n]) 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    20
qed_spec_mp "is_approx_option_filter_n";
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    21
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    22
Goalw[option_filter_def] "is_approx (option_filter l P) l";
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    23
by (simp_tac (simpset() addsimps [is_approx_option_filter_n]) 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    24
qed "is_approx_option_filter";
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    25
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    26
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    27
Goal "\\<forall>n n'. n < length l \\<longrightarrow> P (n+n') \\<longrightarrow> option_filter_n l P n' ! n = Some (l!n)";
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    28
by (induct_tac "l" 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    29
 by (Simp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    30
by (Clarify_tac 1);
8442
96023903c2df case_tac now subsumes both boolean and datatype cases;
wenzelm
parents: 8423
diff changeset
    31
by (case_tac "n" 1);
8388
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    32
 by (Clarsimp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    33
by (Clarsimp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    34
qed_spec_mp "option_filter_n_Some";
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    35
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    36
Goalw [option_filter_def]
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    37
"\\<lbrakk>n < length l; P n\\<rbrakk> \\<Longrightarrow> option_filter l P ! n = Some (l!n)";
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    38
br option_filter_n_Some 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    39
 ba 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    40
by (Asm_simp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    41
qed "option_filter_Some";
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    42
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    43
Goal "\\<lbrakk>length ins < length phi;  pc < length ins\\<rbrakk> \\<Longrightarrow> \
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    44
\      contains_dead ins (option_filter phi (mdot ins)) phi pc";
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    45
by (asm_full_simp_tac (simpset() addsimps [contains_dead_def]) 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    46
br conjI 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    47
br conjI 2;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    48
by (ALLGOALS (Clarsimp_tac 
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    49
        THEN' (rtac option_filter_Some) 
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    50
        THEN' Asm_simp_tac 
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    51
        THEN' (clarsimp_tac (claset(), simpset() addsimps [mdot_def,maybe_dead_def]))));
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    52
qed "option_filter_contains_dead";
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    53
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    54
Goal "\\<lbrakk>length ins < length phi;  pc < length ins\\<rbrakk> \\<Longrightarrow> \
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    55
\      contains_targets ins (option_filter phi (mdot ins)) phi pc"; 
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    56
by (asm_full_simp_tac (simpset() addsimps [contains_targets_def]) 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    57
by (Clarsimp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    58
br conjI 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    59
by (ALLGOALS (Clarsimp_tac 
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    60
        THEN' (rtac option_filter_Some) 
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    61
        THEN' Asm_simp_tac 
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    62
        THEN' (asm_full_simp_tac (simpset() addsimps [mdot_def,is_target_def]))
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    63
        THEN' Force_tac));
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    64
qed "option_filter_contains_targets";
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    65
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    66
Goalw[fits_def, make_cert_def] "length ins < length phi \\<Longrightarrow> fits ins (make_cert ins phi) phi";
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    67
by (Clarsimp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    68
br conjI 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    69
 br is_approx_option_filter 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    70
by (Clarsimp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    71
br conjI 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    72
 br option_filter_contains_dead 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    73
  ba 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    74
 ba 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    75
br option_filter_contains_targets 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    76
 ba 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    77
ba 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    78
qed "fits_make_cert";
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    79
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    80
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    81
Goal "\\<exists>a'. a = rev a'"; 
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    82
by (induct_tac "a" 1); 
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    83
 by (Simp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    84
by (Clarsimp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    85
by (res_inst_tac [("x","a'@[a]")] exI 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    86
by (Simp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    87
qed "rev_surj";
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    88
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    89
Goal "\\<forall>n. n \\<le> length x \\<longrightarrow> (\\<exists>a b. x = a@b \\<and> length a = n)";
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    90
by (induct_tac "x" 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    91
 by (Simp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    92
by (Clarsimp_tac 1);
8442
96023903c2df case_tac now subsumes both boolean and datatype cases;
wenzelm
parents: 8423
diff changeset
    93
by (case_tac "n" 1);
8388
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    94
 by (Clarsimp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    95
by (Clarsimp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    96
by (smp_tac 1 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    97
by (Clarsimp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    98
by (res_inst_tac [("x","a#aa")] exI 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
    99
by (Simp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   100
qed_spec_mp "append_length_n";
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   101
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   102
Goal "\\<lbrakk>n < length x\\<rbrakk> \\<Longrightarrow> \\<exists>a b c. x = (rev a) @ b # c \\<and> length a = n";
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   103
by (subgoal_tac "n \\<le> length x" 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   104
 by (Asm_full_simp_tac 2);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   105
by (forward_tac [append_length_n] 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   106
by (Clarsimp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   107
by (cut_inst_tac [("xs","b")] neq_Nil_conv 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   108
by (Clarsimp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   109
by (cut_inst_tac [("a","a")] rev_surj 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   110
by (Clarsimp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   111
by (res_inst_tac [("x","a'")] exI 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   112
by (Clarsimp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   113
qed "rev_append_cons";
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   114
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   115
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   116
Goal "G \\<turnstile> b \\<preceq> NT \\<Longrightarrow> b = NT";
8442
96023903c2df case_tac now subsumes both boolean and datatype cases;
wenzelm
parents: 8423
diff changeset
   117
by (case_tac "b" 1);
96023903c2df case_tac now subsumes both boolean and datatype cases;
wenzelm
parents: 8423
diff changeset
   118
 by (case_tac "ref_ty" 2);
8388
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   119
by Auto_tac;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   120
qed "widen_NT";
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   121
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   122
Goal "G \\<turnstile> b \\<preceq> Class C \\<Longrightarrow> \\<exists>r. b = RefT r";
8442
96023903c2df case_tac now subsumes both boolean and datatype cases;
wenzelm
parents: 8423
diff changeset
   123
by (case_tac "b" 1);
8388
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   124
by Auto_tac;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   125
qed "widen_Class";
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   126
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   127
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   128
Goal "\\<forall>b. length a = length b \\<longrightarrow> (\\<forall>x\\<in>set (zip a b). x \\<in> widen G) = (G \\<turnstile> (map Some a) <=l (map Some b))";
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   129
by (induct_tac "a" 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   130
 by (Clarsimp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   131
by (Clarsimp_tac 1);
8442
96023903c2df case_tac now subsumes both boolean and datatype cases;
wenzelm
parents: 8423
diff changeset
   132
by (case_tac "b" 1);
8388
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   133
 by (Clarsimp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   134
by (Clarsimp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   135
qed_spec_mp "all_widen_is_sup_loc";
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   136
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   137
Goal "\\<lbrakk>fits ins cert phi; i = ins!pc; i = MI meth_inv; pc < length ins; \
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   138
 \     wf_prog wf_mb G; \
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   139
\      G \\<turnstile> (x, y) <=s s1; wtl_inst i G rT s1 s1' cert mpc pc\\<rbrakk> \
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   140
\       \\<Longrightarrow> \\<exists>s2'. wtl_inst i G rT (x, y) s2' cert mpc pc \\<and> \
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   141
\                ((G \\<turnstile> s2' <=s s1') \\<or> (\\<exists> s. cert ! (Suc pc) = Some s \\<and> (G \\<turnstile> s2' <=s s)))"; 
8442
96023903c2df case_tac now subsumes both boolean and datatype cases;
wenzelm
parents: 8423
diff changeset
   142
by (case_tac "meth_inv" 1); 
8388
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   143
by (Clarsimp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   144
by (cut_inst_tac [("x","x"),("n","length apTs")] rev_append_cons 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   145
 by (asm_full_simp_tac (simpset() addsimps [sup_state_length_fst]) 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   146
by (Clarify_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   147
by (subgoal_tac "length (rev aa) = length (rev apTs)" 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   148
 by (Asm_full_simp_tac 2);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   149
by (dres_inst_tac [("G","G"),("x","ba#c"),("i","y"),("j","ya"),("y","X#ST'")] sup_state_append_fst 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   150
back();
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   151
back();
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   152
by (clarsimp_tac (claset(), simpset() addsimps [sup_state_rev_fst,sup_state_Cons1]) 1);
8423
3c19160b6432 exhaust_tac -> cases_tac
nipkow
parents: 8394
diff changeset
   153
by (case_tac "X = NT" 1);
8388
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   154
 by (Clarsimp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   155
 by (res_inst_tac [("x","a")] exI 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   156
 by (res_inst_tac [("x","b")] exI 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   157
 by (Asm_full_simp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   158
 by (res_inst_tac [("x","aa")] exI 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   159
 by (asm_full_simp_tac (simpset() addsimps [widen_NT]) 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   160
by (Asm_full_simp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   161
by (strip_tac1 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   162
by (forward_tac [widen_Class] 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   163
by (Clarsimp_tac 1);
8442
96023903c2df case_tac now subsumes both boolean and datatype cases;
wenzelm
parents: 8423
diff changeset
   164
by (case_tac "r" 1);
8388
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   165
 by (Clarsimp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   166
 by (res_inst_tac [("x","a")] exI 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   167
 by (res_inst_tac [("x","b")] exI 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   168
 by (Clarsimp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   169
 by (res_inst_tac [("x","aa")] exI 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   170
 by (clarsimp_tac (claset(), simpset() addsimps [fits_def]) 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   171
by (Clarsimp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   172
bd subcls_widen_methd 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   173
  ba 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   174
 ba 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   175
by (Clarify_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   176
by (res_inst_tac [("x","rT'#c")] exI 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   177
by (res_inst_tac [("x","y")] exI 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   178
by (Asm_full_simp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   179
by (subgoal_tac "\\<exists>a b. cert ! Suc pc = Some (a, b) \\<and> G \\<turnstile> (rT' # c, y) <=s (a, b)" 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   180
 by (Clarsimp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   181
 by (res_inst_tac [("x","aa")] exI 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   182
 by (Asm_full_simp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   183
 by (clarsimp_tac (claset(), simpset() addsimps [sup_state_def, all_widen_is_sup_loc]) 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   184
 br sup_loc_trans 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   185
  ba 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   186
 ba 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   187
by (Clarsimp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   188
by (subgoal_tac "G \\<turnstile> (rT' # c, y) <=s (rT # ST', ya)" 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   189
 br sup_state_trans 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   190
  ba 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   191
 ba 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   192
by (clarsimp_tac (claset(), simpset() addsimps [sup_state_Cons1]) 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   193
qed "method_inv_pseudo_mono";
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   194
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   195
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   196
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   197
Goalw[sup_loc_def] "\\<forall> y n. (G \\<turnstile> b <=l y) \\<longrightarrow> n < length y \\<longrightarrow> y!n = Some t \\<longrightarrow> (\\<exists>t. b!n = Some t \\<and> (G \\<turnstile> (b!n) <=o (y!n)))";
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   198
by (induct_tac "b" 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   199
 by (Simp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   200
by (clarsimp_tac (claset(), simpset() addsimps [list_all2_Cons1]) 1);
8442
96023903c2df case_tac now subsumes both boolean and datatype cases;
wenzelm
parents: 8423
diff changeset
   201
by (case_tac "n" 1);
8388
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   202
 by (asm_full_simp_tac (simpset() addsimps [sup_ty_opt_some]) 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   203
by (smp_tac 1 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   204
by (Asm_full_simp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   205
qed_spec_mp "sup_loc_some";
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   206
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   207
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   208
Goalw[sup_state_def]
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   209
"\\<lbrakk>G \\<turnstile> (a, b) <=s (x, y); n < length y; y!n = Some t\\<rbrakk>\
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   210
\     \\<Longrightarrow> \\<exists>ts. b!n = Some ts \\<and> G \\<turnstile> (ts#a, b) <=s (t#x, y)";
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   211
by (Clarsimp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   212
by (datac sup_loc_some 2 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   213
by (Clarsimp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   214
qed "mono_load";
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   215
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   216
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   217
Goalw[sup_state_def] 
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   218
"\\<lbrakk>G \\<turnstile> (a, b) <=s (ts # ST', y); n < length y\\<rbrakk> \\<Longrightarrow> \
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   219
\ \\<exists> t a'. a = t#a' \\<and> G \\<turnstile> (a', b[n := Some t]) <=s (ST', y[n := Some ts])";
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   220
by (clarsimp_tac (claset(), simpset() addsimps [sup_loc_Cons2]) 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   221
by (forward_tac [map_hd_tl] 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   222
by (clarsimp_tac (claset(), simpset() addsimps [sup_loc_update]) 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   223
qed "mono_store"; 
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   224
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   225
Goal "(G \\<turnstile> xb \\<preceq> PrimT p) = (xb = PrimT p)";
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   226
by Safe_tac;
8442
96023903c2df case_tac now subsumes both boolean and datatype cases;
wenzelm
parents: 8423
diff changeset
   227
by (case_tac "xb" 1);
8388
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   228
by Auto_tac;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   229
bd widen_RefT 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   230
by Auto_tac;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   231
qed "PrimT_PrimT";
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   232
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   233
Goal "\\<lbrakk>wtl_inst i G rT s1 s1' cert mpc pc; \
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   234
\      fits ins cert phi; pc < length ins; wf_prog wf_mb G; \
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   235
\      G \\<turnstile> s2 <=s s1; i = ins!pc\\<rbrakk> \\<Longrightarrow> \
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   236
\     \\<exists> s2'. wtl_inst (ins!pc) G rT s2 s2' cert mpc pc \\<and> \
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   237
\      (G \\<turnstile> s2' <=s s1' \\<or> (\\<exists>s. cert!(Suc pc) = Some s \\<and> G \\<turnstile> s2' <=s s))"; 
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   238
by (cut_inst_tac [("z","s2")] surj_pair 1); 
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   239
by (Clarify_tac 1); 
8442
96023903c2df case_tac now subsumes both boolean and datatype cases;
wenzelm
parents: 8423
diff changeset
   240
by (case_tac "ins!pc" 1); 
96023903c2df case_tac now subsumes both boolean and datatype cases;
wenzelm
parents: 8423
diff changeset
   241
       by (case_tac "load_and_store" 1); 
8388
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   242
          by (Clarsimp_tac 1); 
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   243
          by (datac mono_load 2 1); 
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   244
          by (clarsimp_tac (claset(), simpset() addsimps [sup_state_length_snd]) 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   245
         by (clarsimp_tac (claset(), simpset() addsimps [sup_state_length_snd]) 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   246
         by (datac mono_store 1 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   247
         by (Clarsimp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   248
        by (clarsimp_tac (claset(), simpset() addsimps [sup_state_Cons1]) 1); 
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   249
       by (clarsimp_tac (claset(), simpset() addsimps [sup_state_Cons1]) 1); 
8442
96023903c2df case_tac now subsumes both boolean and datatype cases;
wenzelm
parents: 8423
diff changeset
   250
      by (case_tac "create_object" 1); 
8388
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   251
      by (clarsimp_tac (claset(), simpset() addsimps [sup_state_Cons1]) 1); 
8442
96023903c2df case_tac now subsumes both boolean and datatype cases;
wenzelm
parents: 8423
diff changeset
   252
     by (case_tac "manipulate_object" 1); 
8388
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   253
      by (clarsimp_tac (claset(), simpset() addsimps [sup_state_Cons2]) 1); 
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   254
      be widen_trans 1; 
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   255
      ba 1; 
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   256
     by (clarsimp_tac (claset(), simpset() addsimps [sup_state_Cons2]) 1); 
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   257
     br conjI 1; 
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   258
      be widen_trans 1; 
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   259
      ba 1; 
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   260
     be widen_trans 1; 
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   261
     ba 1; 
8442
96023903c2df case_tac now subsumes both boolean and datatype cases;
wenzelm
parents: 8423
diff changeset
   262
    by (case_tac "check_object" 1); 
8388
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   263
    by (clarsimp_tac (claset(), simpset() addsimps [sup_state_Cons2]) 1); 
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   264
    be widen_RefT2 1; 
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   265
    br method_inv_pseudo_mono 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   266
          ba 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   267
         by (Asm_full_simp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   268
        ba 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   269
       ba 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   270
      ba 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   271
     ba 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   272
    ba 1;   
8442
96023903c2df case_tac now subsumes both boolean and datatype cases;
wenzelm
parents: 8423
diff changeset
   273
   by (case_tac "meth_ret" 1);
8388
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   274
   by (clarsimp_tac (claset(), simpset() addsimps [sup_state_Cons2]) 1); 
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   275
   br conjI 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   276
    be widen_trans 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   277
    ba 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   278
   by (cut_inst_tac [("z","s1'")] surj_pair 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   279
   by (strip_tac1 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   280
   by (Clarsimp_tac 1);
8442
96023903c2df case_tac now subsumes both boolean and datatype cases;
wenzelm
parents: 8423
diff changeset
   281
  by (case_tac "op_stack" 1);
8388
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   282
     by (clarsimp_tac (claset(), simpset() addsimps [sup_state_Cons2]) 1); 
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   283
    by (clarsimp_tac (claset(), simpset() addsimps [sup_state_Cons2]) 1); 
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   284
   by (clarsimp_tac (claset(), simpset() addsimps [sup_state_Cons2]) 1); 
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   285
  by (clarsimp_tac (claset(), simpset() addsimps [sup_state_Cons2]) 1); 
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   286
 by (clarsimp_tac (claset(), simpset() addsimps [sup_state_Cons2]) 1); 
8442
96023903c2df case_tac now subsumes both boolean and datatype cases;
wenzelm
parents: 8423
diff changeset
   287
by (case_tac "branch" 1);
8388
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   288
 by (Clarsimp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   289
 bd sup_state_trans 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   290
  ba 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   291
 by (Clarsimp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   292
 by (cut_inst_tac [("z","s1'")] surj_pair 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   293
 by (Clarify_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   294
 by (Clarsimp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   295
by (clarsimp_tac (claset(), simpset() addsimps [sup_state_Cons2]) 1); 
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   296
br conjI 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   297
 br sup_state_trans 2;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   298
  ba 2;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   299
 ba 2;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   300
by (Clarsimp_tac 1);
8442
96023903c2df case_tac now subsumes both boolean and datatype cases;
wenzelm
parents: 8423
diff changeset
   301
by (case_tac "xa" 1);
8388
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   302
 by (clarsimp_tac (claset(), simpset() addsimps [PrimT_PrimT]) 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   303
by (Clarsimp_tac 1);
8442
96023903c2df case_tac now subsumes both boolean and datatype cases;
wenzelm
parents: 8423
diff changeset
   304
by (case_tac "xb" 1);
8388
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   305
by Auto_tac;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   306
bd widen_RefT 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   307
by Auto_tac;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   308
qed "wtl_inst_pseudo_mono";
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   309
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   310
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   311
Goal "\\<lbrakk>wtl_inst i G rT s1 s1' cert (Suc pc) pc; G \\<turnstile> s2 <=s s1\\<rbrakk> \\<Longrightarrow> \
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   312
\ \\<exists>s2'. wtl_inst i G rT s2 s2' cert (Suc pc) pc \\<and> (G \\<turnstile> s2' <=s s1')";
8442
96023903c2df case_tac now subsumes both boolean and datatype cases;
wenzelm
parents: 8423
diff changeset
   313
by (case_tac "i" 1);
96023903c2df case_tac now subsumes both boolean and datatype cases;
wenzelm
parents: 8423
diff changeset
   314
by (case_tac "branch" 8);
96023903c2df case_tac now subsumes both boolean and datatype cases;
wenzelm
parents: 8423
diff changeset
   315
by (case_tac "op_stack" 7);
96023903c2df case_tac now subsumes both boolean and datatype cases;
wenzelm
parents: 8423
diff changeset
   316
by (case_tac "meth_ret" 6);
96023903c2df case_tac now subsumes both boolean and datatype cases;
wenzelm
parents: 8423
diff changeset
   317
by (case_tac "meth_inv" 5);
96023903c2df case_tac now subsumes both boolean and datatype cases;
wenzelm
parents: 8423
diff changeset
   318
by (case_tac "check_object" 4);
96023903c2df case_tac now subsumes both boolean and datatype cases;
wenzelm
parents: 8423
diff changeset
   319
by (case_tac "manipulate_object" 3);
96023903c2df case_tac now subsumes both boolean and datatype cases;
wenzelm
parents: 8423
diff changeset
   320
by (case_tac "create_object" 2);
96023903c2df case_tac now subsumes both boolean and datatype cases;
wenzelm
parents: 8423
diff changeset
   321
by (case_tac "load_and_store" 1);
8388
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   322
by (TRYALL Asm_full_simp_tac);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   323
 by (pair_tac "s1'" 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   324
 by (clarsimp_tac (claset(), simpset() addsimps [sup_state_Cons2]) 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   325
 br widen_trans 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   326
  ba 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   327
 ba 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   328
by (pair_tac "s1'" 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   329
by (clarsimp_tac (claset(), simpset() addsimps [sup_state_Cons2]) 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   330
br sup_state_trans 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   331
 ba 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   332
ba 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   333
qed "wtl_inst_last_mono";
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   334
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   335
Goalw [wtl_inst_option_def] 
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   336
"\\<lbrakk>wtl_inst_option i G rT s1 s1' cert mpc pc; Suc pc = mpc; G \\<turnstile> s2 <=s s1\\<rbrakk> \\<Longrightarrow> \
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   337
\ \\<exists>s2'. wtl_inst_option i G rT s2 s2' cert mpc pc \\<and> (G \\<turnstile> s2' <=s s1')";
8442
96023903c2df case_tac now subsumes both boolean and datatype cases;
wenzelm
parents: 8423
diff changeset
   338
by (case_tac "cert!pc" 1);
8388
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   339
 by (Clarsimp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   340
 bd wtl_inst_last_mono 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   341
  ba 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   342
 by (Asm_full_simp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   343
by (Clarsimp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   344
bd sup_state_trans 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   345
 ba 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   346
by (Asm_full_simp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   347
by (dres_inst_tac [("s2.0","(a,b)")] wtl_inst_last_mono 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   348
 by (Simp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   349
by (Asm_full_simp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   350
qed "wtl_option_last_mono";
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   351
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   352
Goalw [wt_instr_def] 
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   353
     "\\<lbrakk>wt_instr (ins!pc) G rT phi max_pc pc; fits ins cert phi;\ 
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   354
\      pc < length ins; length ins = max_pc\\<rbrakk> \\<Longrightarrow> \ 
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   355
\     \\<exists> s. wtl_inst (ins!pc) G rT (phi!pc) s cert max_pc pc \\<and> G \\<turnstile> s <=s phi ! Suc pc";  
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   356
by (cut_inst_tac [("z","phi!pc")] surj_pair 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   357
by (strip_tac1 1);
8442
96023903c2df case_tac now subsumes both boolean and datatype cases;
wenzelm
parents: 8423
diff changeset
   358
by (case_tac "ins!pc" 1);
96023903c2df case_tac now subsumes both boolean and datatype cases;
wenzelm
parents: 8423
diff changeset
   359
by (case_tac "op_stack" 7);
96023903c2df case_tac now subsumes both boolean and datatype cases;
wenzelm
parents: 8423
diff changeset
   360
by (case_tac "check_object" 4);
96023903c2df case_tac now subsumes both boolean and datatype cases;
wenzelm
parents: 8423
diff changeset
   361
by (case_tac "manipulate_object" 3);
96023903c2df case_tac now subsumes both boolean and datatype cases;
wenzelm
parents: 8423
diff changeset
   362
by (case_tac "create_object" 2);
96023903c2df case_tac now subsumes both boolean and datatype cases;
wenzelm
parents: 8423
diff changeset
   363
by (case_tac "load_and_store" 1);
8388
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   364
               by (TRYALL (Asm_full_simp_tac THEN_MAYBE' Force_tac));
8442
96023903c2df case_tac now subsumes both boolean and datatype cases;
wenzelm
parents: 8423
diff changeset
   365
  by (case_tac "meth_inv" 1);
8388
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   366
  by (cut_inst_tac [("z","phi!(Suc pc)")] surj_pair 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   367
  by (strip_tac1 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   368
  by (Clarsimp_tac 1);
8423
3c19160b6432 exhaust_tac -> cases_tac
nipkow
parents: 8394
diff changeset
   369
  by (case_tac "X = NT" 1);
8388
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   370
   by (clarsimp_tac (claset(),simpset() addsimps [fits_def, contains_dead_def]) 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   371
   by (smp_tac 1 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   372
   by (Clarsimp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   373
   by (Force_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   374
  by (Asm_full_simp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   375
  by (strip_tac1 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   376
  by (res_inst_tac [("x","rT#ST'")] exI 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   377
  by (res_inst_tac [("x","y")] exI 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   378
  by (Asm_full_simp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   379
  by (res_inst_tac [("x","apTs")] exI 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   380
  by (clarsimp_tac (claset(),simpset() addsimps [fits_def, contains_dead_def]) 1);
8442
96023903c2df case_tac now subsumes both boolean and datatype cases;
wenzelm
parents: 8423
diff changeset
   381
 by (case_tac "meth_ret" 1);
8388
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   382
 by (asm_full_simp_tac (simpset() addsimps [fits_def, contains_dead_def]) 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   383
 by (cut_inst_tac [("z","phi!Suc pc")] surj_pair 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   384
 by (strip_tac1 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   385
 by (Clarsimp_tac 1);
8442
96023903c2df case_tac now subsumes both boolean and datatype cases;
wenzelm
parents: 8423
diff changeset
   386
by (case_tac "branch" 1);
8388
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   387
 by (asm_full_simp_tac (simpset() addsimps [fits_def, contains_dead_def, contains_targets_def]) 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   388
 by (cut_inst_tac [("z","phi!Suc pc")] surj_pair 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   389
 by (Force_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   390
by (asm_full_simp_tac (simpset() addsimps [fits_def, contains_targets_def]) 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   391
by (Force_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   392
qed "wt_instr_imp_wtl_inst";
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   393
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   394
Goalw [wtl_inst_option_def] 
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   395
     "\\<lbrakk>fits ins cert phi; pc < length ins; wt_instr (ins!pc) G rT phi max_pc pc; \
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   396
\      max_pc = length ins\\<rbrakk> \\<Longrightarrow> \ 
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   397
\     \\<exists> s. wtl_inst_option (ins!pc) G rT (phi!pc) s cert max_pc pc \\<and> G \\<turnstile> s <=s phi ! Suc pc";
8442
96023903c2df case_tac now subsumes both boolean and datatype cases;
wenzelm
parents: 8423
diff changeset
   398
by (case_tac "cert!pc" 1);
8388
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   399
 by (Clarsimp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   400
 bd wt_instr_imp_wtl_inst 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   401
    ba 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   402
   ba 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   403
  br refl 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   404
 by (Clarsimp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   405
by (Clarsimp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   406
by (forward_tac [wt_instr_imp_wtl_inst] 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   407
   ba 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   408
  ba 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   409
 by (Clarsimp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   410
by (clarsimp_tac (claset(), simpset() addsimps [fits_def, is_approx_def]) 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   411
by (eres_inst_tac [("x","pc")] allE 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   412
by (Clarsimp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   413
by Auto_tac;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   414
qed "wt_inst_imp_wtl_option";
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   415
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   416
Goal "\\<lbrakk>wtl_inst_list ins G rT s0 s' cert max_pc pc; \ 
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   417
\     ins \\<noteq> []; G \\<turnstile> s <=s s0; \ 
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   418
\     s \\<noteq> s0 \\<longrightarrow> cert ! pc = Some s0\\<rbrakk> \\<Longrightarrow> \ 
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   419
\     wtl_inst_list ins G rT s s' cert max_pc pc";  
8442
96023903c2df case_tac now subsumes both boolean and datatype cases;
wenzelm
parents: 8423
diff changeset
   420
by (case_tac "ins" 1); 
8388
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   421
 by (Clarify_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   422
by (Clarify_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   423
by (Asm_full_simp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   424
by (Clarify_tac 1);
8423
3c19160b6432 exhaust_tac -> cases_tac
nipkow
parents: 8394
diff changeset
   425
by (case_tac "list = []" 1);
8388
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   426
 by (Asm_full_simp_tac 1);
8423
3c19160b6432 exhaust_tac -> cases_tac
nipkow
parents: 8394
diff changeset
   427
 by (case_tac "s = s0" 1);
8388
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   428
  by (Force_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   429
 by (force_tac (claset(), simpset() addsimps [wtl_inst_option_def]) 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   430
by (force_tac (claset(), simpset() addsimps [wtl_inst_option_def]) 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   431
qed "wtl_inst_list_s";
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   432
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   433
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   434
Goal "\\<lbrakk>wtl_inst_list ins G rT s0 s' cert max_pc pc; \ 
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   435
\     ins \\<noteq> []; G \\<turnstile> s <=s s0; cert ! pc = Some s0\\<rbrakk> \\<Longrightarrow> \ 
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   436
\     wtl_inst_list ins G rT s s' cert max_pc pc"; 
8442
96023903c2df case_tac now subsumes both boolean and datatype cases;
wenzelm
parents: 8423
diff changeset
   437
by (case_tac "ins" 1); 
8388
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   438
 by (Clarify_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   439
by (force_tac (claset(), simpset() addsimps [wtl_inst_option_def]) 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   440
qed "wtl_inst_list_cert";
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   441
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   442
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   443
Goalw [wtl_inst_option_def]
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   444
"\\<lbrakk>wtl_inst_option i G rT s1 s1' cert mpc pc; \
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   445
\ fits ins cert phi; pc < length ins; wf_prog wf_mb G; \
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   446
\ G \\<turnstile> s2 <=s s1; i = ins!pc\\<rbrakk> \\<Longrightarrow> \
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   447
\ \\<exists> s2'. wtl_inst_option (ins!pc) G rT s2 s2' cert mpc pc \\<and> \
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   448
\        (G \\<turnstile> s2' <=s s1' \\<or> (\\<exists>s. cert!(Suc pc) = Some s \\<and> G \\<turnstile> s2' <=s s))";
8442
96023903c2df case_tac now subsumes both boolean and datatype cases;
wenzelm
parents: 8423
diff changeset
   449
by (case_tac "cert!pc" 1);
8388
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   450
 by (Asm_full_simp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   451
 by (datac wtl_inst_pseudo_mono 4 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   452
  by (Clarsimp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   453
 by (Clarsimp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   454
by (Clarsimp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   455
br conjI 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   456
 br sup_state_trans 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   457
  ba 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   458
 ba 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   459
by (thin_tac "G \\<turnstile> s1 <=s (a, b)" 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   460
by (thin_tac "G \\<turnstile> s2 <=s s1" 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   461
by (subgoal_tac "G \\<turnstile> (a,b) <=s (a,b)" 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   462
 by (datac wtl_inst_pseudo_mono 4 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   463
  by (Asm_full_simp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   464
 by (Asm_full_simp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   465
by (Simp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   466
qed "wtl_option_pseudo_mono";
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   467
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   468
Goal "((l @ a # list) ! length l) = a";
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   469
by (induct_tac "l" 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   470
by Auto_tac;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   471
qed "append_cons_length_nth";
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   472
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   473
Goal "\\<forall> pc. (\\<forall>pc'. pc' < length ins \\<longrightarrow> wt_instr (ins ! pc') G rT phi (pc+length ins) (pc+pc')) \\<longrightarrow>   \
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   474
\           wf_prog wf_mb G \\<longrightarrow> \
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   475
\           fits all_ins cert phi \\<longrightarrow> (\\<exists> l. pc = length l \\<and> l@ins=all_ins) \\<longrightarrow> pc < length all_ins \\<longrightarrow>\
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   476
\           (\\<forall> s. (G \\<turnstile> s <=s (phi!pc)) \\<longrightarrow> \
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   477
\           (\\<exists>s'. wtl_inst_list ins G rT s s' cert (pc+length ins) pc))";
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   478
by (induct_tac "ins" 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   479
 by (Simp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   480
by (Clarify_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   481
by (eres_inst_tac [("x","Suc (length l)")] allE 1); 
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   482
be impE 1; 
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   483
 by (Clarsimp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   484
 by (eres_inst_tac [("x","Suc pc'")] allE 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   485
 by (Asm_full_simp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   486
by (Clarify_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   487
be impE 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   488
 by (Asm_full_simp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   489
by (eres_inst_tac [("x","0")] allE 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   490
by (Asm_full_simp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   491
by (forw_inst_tac [("G","G"),("rT","rT"),("pc","length l"),
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   492
                   ("max_pc","Suc (length l + length list)")] wt_inst_imp_wtl_option 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   493
   by (Simp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   494
  by (asm_full_simp_tac (simpset() addsimps [nth_append]) 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   495
 by (Simp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   496
by (asm_full_simp_tac (simpset() addsimps [nth_append]) 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   497
by (Clarify_tac 1);
8423
3c19160b6432 exhaust_tac -> cases_tac
nipkow
parents: 8394
diff changeset
   498
by (case_tac "list = []" 1);
8388
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   499
 by (Clarsimp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   500
 bd wtl_option_last_mono 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   501
   br refl 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   502
  ba 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   503
 by (Clarsimp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   504
 by (dres_inst_tac [("a","(ac,bb)")] sup_state_trans 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   505
  ba 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   506
 by (Force_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   507
by (Clarsimp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   508
bd wtl_option_pseudo_mono 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   509
     ba 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   510
    by (Simp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   511
   ba 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   512
  ba 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   513
 by (simp_tac (simpset() addsimps [append_cons_length_nth]) 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   514
by (clarsimp_tac (claset(), simpset() addsimps [append_cons_length_nth]) 1);
8442
96023903c2df case_tac now subsumes both boolean and datatype cases;
wenzelm
parents: 8423
diff changeset
   515
by (case_tac "cert ! Suc (length l)" 1);
8388
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   516
 by (Clarsimp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   517
 by (dres_inst_tac [("a","(ac,bb)")] sup_state_trans 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   518
  ba 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   519
 by (Force_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   520
by (Clarsimp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   521
by (subgoal_tac "G \\<turnstile> (ac, bb) <=s phi ! Suc (length l)" 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   522
 by (thin_tac "G \\<turnstile> (ab, ba) <=s phi ! Suc (length l)" 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   523
 by (smp_tac 2 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   524
 by (Force_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   525
be disjE 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   526
 br sup_state_trans 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   527
  ba 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   528
 ba 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   529
by (clarsimp_tac (claset(), simpset() addsimps [fits_def, is_approx_def]) 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   530
by (eres_inst_tac [("x","Suc (length l)")] allE 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   531
be impE 1;
8442
96023903c2df case_tac now subsumes both boolean and datatype cases;
wenzelm
parents: 8423
diff changeset
   532
 by (case_tac "length list" 1);
8388
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   533
  by (Clarsimp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   534
 by (Clarsimp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   535
by (Clarsimp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   536
qed_spec_mp "wt_imp_wtl_inst_list"; 
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   537
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   538
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   539
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   540
Goalw[wt_method_def, wtl_method_def]
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   541
 "\\<lbrakk>wt_method G C pTs rT mxl ins phi; fits ins cert phi; wf_prog wf_mb G\\<rbrakk> \\<Longrightarrow> wtl_method G C pTs rT mxl ins cert";
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   542
by (Clarsimp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   543
by (cut_inst_tac [("pc","0")] wt_imp_wtl_inst_list 1);    
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   544
      by (Force_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   545
     ba 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   546
    ba 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   547
   by (Simp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   548
  by (Simp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   549
 by (clarsimp_tac (claset(), simpset() addsimps [wt_start_def]) 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   550
 ba 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   551
by (Asm_full_simp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   552
qed "fits_imp_wtl_method_complete";
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   553
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   554
Goal "\\<lbrakk>wt_method G C pTs rT mxl ins phi; wf_prog wf_mb G\\<rbrakk> \\<Longrightarrow> wtl_method G C pTs rT mxl ins (make_cert ins phi)";
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   555
by (subgoal_tac "fits ins (make_cert ins phi) phi" 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   556
 br fits_make_cert 2;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   557
 by (asm_full_simp_tac (simpset() addsimps [wt_method_def]) 2);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   558
br fits_imp_wtl_method_complete 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   559
  ba 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   560
 ba 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   561
ba 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   562
qed "wtl_method_complete";
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   563
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   564
Goalw[wt_jvm_prog_def, wfprg_def] "\\<lbrakk>wt_jvm_prog G Phi\\<rbrakk> \\<Longrightarrow> wfprg G";
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   565
by Auto_tac;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   566
qed "wt_imp_wfprg";
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   567
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   568
Goal "(a,b,c,d)\\<in>set l \\<longrightarrow> unique l \\<longrightarrow> (a',b',c',d') \\<in> set l \\<longrightarrow> a = a' \\<longrightarrow> b=b' \\<and> c=c' \\<and> d=d'";
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   569
by (induct_tac "l" 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   570
by Auto_tac;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   571
qed_spec_mp "unique_set";
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   572
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   573
Goal "(a,b,c,d)\\<in>set l \\<longrightarrow> unique l \\<longrightarrow> (\\<epsilon> (a',b',c',d'). (a',b',c',d') \\<in> set l \\<and> a'=a) = (a,b,c,d)";
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   574
by (auto_tac (claset(), simpset() addsimps [unique_set]));
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   575
qed_spec_mp "unique_epsilon";
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   576
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   577
Goal "\\<lbrakk>wt_jvm_prog G Phi\\<rbrakk> \\<Longrightarrow> wtl_jvm_prog G (make_Cert G Phi)";
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   578
by (forward_tac [wt_imp_wfprg] 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   579
by (asm_full_simp_tac (simpset() addsimps [wt_jvm_prog_def, 
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   580
    wtl_jvm_prog_def, wf_prog_def, wf_cdecl_def, wf_mdecl_def]) 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   581
by Auto_tac;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   582
bd bspec 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   583
 ba 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   584
by (Clarsimp_tac 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   585
bd bspec 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   586
back();
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   587
 ba 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   588
by (clarsimp_tac (claset(), simpset() addsimps [make_Cert_def, wfprg_def]) 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   589
bd wtl_method_complete 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   590
 ba 1;
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   591
by (asm_full_simp_tac (simpset() addsimps [unique_epsilon]) 1);
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   592
qed "wtl_complete";
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   593
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   594
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   595
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   596
b66d3c49cb8d completeness of the lightweight bytecode verifier
kleing
parents:
diff changeset
   597