206 ML_prf {* val tac2 = asm_full_simp_tac (put_simpset ss @{context} addsimps [@{thm inv2_def}]) *} |
206 ML_prf {* val tac2 = asm_full_simp_tac (put_simpset ss @{context} addsimps [@{thm inv2_def}]) *} |
207 |
207 |
208 txt {* 10 - 7 *} |
208 txt {* 10 - 7 *} |
209 apply (tactic "EVERY1 [tac2,tac2,tac2,tac2]") |
209 apply (tactic "EVERY1 [tac2,tac2,tac2,tac2]") |
210 txt {* 6 *} |
210 txt {* 6 *} |
211 apply (tactic {* forward_tac [rewrite_rule [@{thm Impl.inv1_def}] |
211 apply (tactic {* forward_tac [rewrite_rule @{context} [@{thm Impl.inv1_def}] |
212 (@{thm raw_inv1} RS @{thm invariantE}) RS conjunct1] 1 *}) |
212 (@{thm raw_inv1} RS @{thm invariantE}) RS conjunct1] 1 *}) |
213 |
213 |
214 txt {* 6 - 5 *} |
214 txt {* 6 - 5 *} |
215 apply (tactic "EVERY1 [tac2,tac2]") |
215 apply (tactic "EVERY1 [tac2,tac2]") |
216 |
216 |
217 txt {* 4 *} |
217 txt {* 4 *} |
218 apply (tactic {* forward_tac [rewrite_rule [@{thm Impl.inv1_def}] |
218 apply (tactic {* forward_tac [rewrite_rule @{context} [@{thm Impl.inv1_def}] |
219 (@{thm raw_inv1} RS @{thm invariantE}) RS conjunct1] 1 *}) |
219 (@{thm raw_inv1} RS @{thm invariantE}) RS conjunct1] 1 *}) |
220 apply (tactic "tac2 1") |
220 apply (tactic "tac2 1") |
221 |
221 |
222 txt {* 3 *} |
222 txt {* 3 *} |
223 apply (tactic {* forward_tac [rewrite_rule [@{thm Impl.inv1_def}] |
223 apply (tactic {* forward_tac [rewrite_rule @{context} [@{thm Impl.inv1_def}] |
224 (@{thm raw_inv1} RS @{thm invariantE})] 1 *}) |
224 (@{thm raw_inv1} RS @{thm invariantE})] 1 *}) |
225 |
225 |
226 apply (tactic "tac2 1") |
226 apply (tactic "tac2 1") |
227 apply (tactic {* fold_goals_tac [rewrite_rule [@{thm Packet.hdr_def}] |
227 apply (tactic {* fold_goals_tac @{context} [rewrite_rule @{context} [@{thm Packet.hdr_def}] |
228 (@{thm Impl.hdr_sum_def})] *}) |
228 (@{thm Impl.hdr_sum_def})] *}) |
229 apply arith |
229 apply arith |
230 |
230 |
231 txt {* 2 *} |
231 txt {* 2 *} |
232 apply (tactic "tac2 1") |
232 apply (tactic "tac2 1") |
233 apply (tactic {* forward_tac [rewrite_rule [@{thm Impl.inv1_def}] |
233 apply (tactic {* forward_tac [rewrite_rule @{context} [@{thm Impl.inv1_def}] |
234 (@{thm raw_inv1} RS @{thm invariantE}) RS conjunct1] 1 *}) |
234 (@{thm raw_inv1} RS @{thm invariantE}) RS conjunct1] 1 *}) |
235 apply (intro strip) |
235 apply (intro strip) |
236 apply (erule conjE)+ |
236 apply (erule conjE)+ |
237 apply simp |
237 apply simp |
238 |
238 |
239 txt {* 1 *} |
239 txt {* 1 *} |
240 apply (tactic "tac2 1") |
240 apply (tactic "tac2 1") |
241 apply (tactic {* forward_tac [rewrite_rule [@{thm Impl.inv1_def}] |
241 apply (tactic {* forward_tac [rewrite_rule @{context} [@{thm Impl.inv1_def}] |
242 (@{thm raw_inv1} RS @{thm invariantE}) RS conjunct2] 1 *}) |
242 (@{thm raw_inv1} RS @{thm invariantE}) RS conjunct2] 1 *}) |
243 apply (intro strip) |
243 apply (intro strip) |
244 apply (erule conjE)+ |
244 apply (erule conjE)+ |
245 apply (tactic {* fold_goals_tac [rewrite_rule [@{thm Packet.hdr_def}] (@{thm Impl.hdr_sum_def})] *}) |
245 apply (tactic {* fold_goals_tac @{context} |
|
246 [rewrite_rule @{context} [@{thm Packet.hdr_def}] (@{thm Impl.hdr_sum_def})] *}) |
246 apply simp |
247 apply simp |
247 |
248 |
248 done |
249 done |
249 |
250 |
250 |
251 |
284 apply (tactic "asm_full_simp_tac (put_simpset ss @{context}) 1") |
285 apply (tactic "asm_full_simp_tac (put_simpset ss @{context}) 1") |
285 apply (simp (no_asm) add: inv3_def) |
286 apply (simp (no_asm) add: inv3_def) |
286 apply (intro strip, (erule conjE)+) |
287 apply (intro strip, (erule conjE)+) |
287 apply (rule imp_disjL [THEN iffD1]) |
288 apply (rule imp_disjL [THEN iffD1]) |
288 apply (rule impI) |
289 apply (rule impI) |
289 apply (tactic {* forward_tac [rewrite_rule [@{thm Impl.inv2_def}] |
290 apply (tactic {* forward_tac [rewrite_rule @{context} [@{thm Impl.inv2_def}] |
290 (@{thm raw_inv2} RS @{thm invariantE})] 1 *}) |
291 (@{thm raw_inv2} RS @{thm invariantE})] 1 *}) |
291 apply simp |
292 apply simp |
292 apply (erule conjE)+ |
293 apply (erule conjE)+ |
293 apply (rule_tac j = "count (ssent (sen s)) (~sbit (sen s))" and |
294 apply (rule_tac j = "count (ssent (sen s)) (~sbit (sen s))" and |
294 k = "count (rsent (rec s)) (sbit (sen s))" in le_trans) |
295 k = "count (rsent (rec s)) (sbit (sen s))" in le_trans) |
295 apply (tactic {* forward_tac [rewrite_rule [@{thm inv1_def}] |
296 apply (tactic {* forward_tac [rewrite_rule @{context} [@{thm inv1_def}] |
296 (@{thm raw_inv1} RS @{thm invariantE}) RS conjunct2] 1 *}) |
297 (@{thm raw_inv1} RS @{thm invariantE}) RS conjunct2] 1 *}) |
297 apply (simp add: hdr_sum_def Multiset.count_def) |
298 apply (simp add: hdr_sum_def Multiset.count_def) |
298 apply (rule add_le_mono) |
299 apply (rule add_le_mono) |
299 apply (rule countm_props) |
300 apply (rule countm_props) |
300 apply (simp (no_asm)) |
301 apply (simp (no_asm)) |
305 txt {* 1 *} |
306 txt {* 1 *} |
306 apply (tactic "tac3 1") |
307 apply (tactic "tac3 1") |
307 apply (intro strip, (erule conjE)+) |
308 apply (intro strip, (erule conjE)+) |
308 apply (rule imp_disjL [THEN iffD1]) |
309 apply (rule imp_disjL [THEN iffD1]) |
309 apply (rule impI) |
310 apply (rule impI) |
310 apply (tactic {* forward_tac [rewrite_rule [@{thm Impl.inv2_def}] |
311 apply (tactic {* forward_tac [rewrite_rule @{context} [@{thm Impl.inv2_def}] |
311 (@{thm raw_inv2} RS @{thm invariantE})] 1 *}) |
312 (@{thm raw_inv2} RS @{thm invariantE})] 1 *}) |
312 apply simp |
313 apply simp |
313 done |
314 done |
314 |
315 |
315 |
316 |
331 apply (tactic "EVERY1[tac4,tac4,tac4,tac4,tac4,tac4,tac4,tac4,tac4]") |
332 apply (tactic "EVERY1[tac4,tac4,tac4,tac4,tac4,tac4,tac4,tac4,tac4]") |
332 |
333 |
333 txt {* 2 b *} |
334 txt {* 2 b *} |
334 |
335 |
335 apply (intro strip, (erule conjE)+) |
336 apply (intro strip, (erule conjE)+) |
336 apply (tactic {* forward_tac [rewrite_rule [@{thm Impl.inv2_def}] |
337 apply (tactic {* forward_tac [rewrite_rule @{context} [@{thm Impl.inv2_def}] |
337 (@{thm raw_inv2} RS @{thm invariantE})] 1 *}) |
338 (@{thm raw_inv2} RS @{thm invariantE})] 1 *}) |
338 apply simp |
339 apply simp |
339 |
340 |
340 txt {* 1 *} |
341 txt {* 1 *} |
341 apply (tactic "tac4 1") |
342 apply (tactic "tac4 1") |
342 apply (intro strip, (erule conjE)+) |
343 apply (intro strip, (erule conjE)+) |
343 apply (rule ccontr) |
344 apply (rule ccontr) |
344 apply (tactic {* forward_tac [rewrite_rule [@{thm Impl.inv2_def}] |
345 apply (tactic {* forward_tac [rewrite_rule @{context} [@{thm Impl.inv2_def}] |
345 (@{thm raw_inv2} RS @{thm invariantE})] 1 *}) |
346 (@{thm raw_inv2} RS @{thm invariantE})] 1 *}) |
346 apply (tactic {* forward_tac [rewrite_rule [@{thm Impl.inv3_def}] |
347 apply (tactic {* forward_tac [rewrite_rule @{context} [@{thm Impl.inv3_def}] |
347 (@{thm raw_inv3} RS @{thm invariantE})] 1 *}) |
348 (@{thm raw_inv3} RS @{thm invariantE})] 1 *}) |
348 apply simp |
349 apply simp |
349 apply (erule_tac x = "m" in allE) |
350 apply (erule_tac x = "m" in allE) |
350 apply simp |
351 apply simp |
351 done |
352 done |