src/HOLCF/IOA/meta_theory/Abstraction.ML
changeset 4577 674b0b354feb
parent 4559 8e604d885b54
child 4725 7edba45a6998
equal deleted inserted replaced
4576:be6b5edbca9f 4577:674b0b354feb
   363 
   363 
   364 
   364 
   365 (* ---------------------------------------------------------------- *)
   365 (* ---------------------------------------------------------------- *)
   366 (*             Localizing Temproal Strengthenings - 2               *)
   366 (*             Localizing Temproal Strengthenings - 2               *)
   367 (* ---------------------------------------------------------------- *)
   367 (* ---------------------------------------------------------------- *)
   368 (*
   368 
       
   369 
       
   370 (* ------------------ Box ----------------------------*)
       
   371 
       
   372 (* FIX: should be same as nil_is_Conc2 when all nils are turned to right side !! *)
       
   373 goal thy "(UU = x @@ y) = (((x::'a Seq)= UU) | (x=nil & y=UU))";
       
   374 by (Seq_case_simp_tac "x" 1);
       
   375 by Auto_tac;
       
   376 qed"UU_is_Conc";
       
   377 
       
   378 goal thy 
       
   379 "Finite s1 --> \
       
   380 \ (! ex. (s~=nil & s~=UU & ex2seq ex = s1 @@ s) --> (? ex'. s = ex2seq ex'))";
       
   381 by (rtac impI 1);
       
   382 by (Seq_Finite_induct_tac 1);
       
   383 (* main case *)
       
   384 by (Blast_tac 1);
       
   385 by (clarify_tac set_cs 1);
       
   386 by (pair_tac "ex" 1);
       
   387 by (Seq_case_simp_tac "y" 1);
       
   388 (* UU case *)
       
   389 by (clarify_tac set_cs 1);
       
   390 by (asm_full_simp_tac (simpset() addsimps [UU_is_Conc])1);
       
   391 by (hyp_subst_tac 1);
       
   392 by (Asm_full_simp_tac 1);
       
   393 (* nil case *)
       
   394 by (clarify_tac set_cs 1);
       
   395 by (asm_full_simp_tac (simpset() addsimps [nil_is_Conc])1);
       
   396 (* cons case *)
       
   397 by (pair_tac "aa" 1);
       
   398 auto();
       
   399 qed_spec_mp"ex2seqConc";
       
   400 
       
   401 (* important property of ex2seq: can be shiftet, as defined "pointwise" *)
       
   402 
       
   403 goalw thy [tsuffix_def,suffix_def]
       
   404 "!!s. tsuffix s (ex2seq ex) ==> ? ex'. s = (ex2seq ex')";
       
   405 auto();
       
   406 bd ex2seqConc 1;
       
   407 auto();
       
   408 qed"ex2seq_tsuffix";
       
   409 
       
   410 
       
   411 goal thy "(Map f`s = nil) = (s=nil)";
       
   412 by (Seq_case_simp_tac "s" 1);
       
   413 qed"Mapnil";
       
   414 
       
   415 goal thy "(Map f`s = UU) = (s=UU)";
       
   416 by (Seq_case_simp_tac "s" 1);
       
   417 qed"MapUU";
       
   418 
       
   419 
       
   420 (* important property of cex_absSeq: As it is a 1to1 correspondence, 
       
   421   properties carry over *)
       
   422 
       
   423 goalw thy [tsuffix_def,suffix_def,cex_absSeq_def]
       
   424 "!! s. tsuffix s t ==> tsuffix (cex_absSeq h s) (cex_absSeq h t)";
       
   425 auto();
       
   426 by (asm_full_simp_tac (simpset() addsimps [Mapnil])1);
       
   427 by (asm_full_simp_tac (simpset() addsimps [MapUU])1);
       
   428 by (res_inst_tac [("x","Map (%(s,a,t). (h s,a, h t))`s1")] exI 1);
       
   429 by (asm_full_simp_tac (simpset() addsimps [Map2Finite,MapConc])1);
       
   430 qed"cex_absSeq_tsuffix";
       
   431 
       
   432 
       
   433 goalw thy [temp_strengthening_def,state_strengthening_def, temp_sat_def,
       
   434 satisfies_def,Box_def]
       
   435 "!! h. [| temp_strengthening P Q h |]\
       
   436 \      ==> temp_strengthening ([] P) ([] Q) h";
       
   437 by (clarify_tac set_cs 1);
       
   438 by (forward_tac [ex2seq_tsuffix] 1);
       
   439 by (clarify_tac set_cs 1);
       
   440 by (dres_inst_tac [("h","h")] cex_absSeq_tsuffix 1);
       
   441 by (asm_full_simp_tac (simpset() addsimps [ex2seq_abs_cex])1);
       
   442 qed"strength_Box";
       
   443 
       
   444 
       
   445 (* ------------------ Init ----------------------------*)
       
   446 
   369 goalw thy [temp_strengthening_def,state_strengthening_def,
   447 goalw thy [temp_strengthening_def,state_strengthening_def,
   370 temp_sat_def,satisfies_def,Init_def]
   448 temp_sat_def,satisfies_def,Init_def,unlift_def]
   371 "!! h. [| state_strengthening P Q h |]\
   449 "!! h. [| state_strengthening P Q h |]\
   372 \      ==> temp_strengthening (Init P) (Init Q) h";
   450 \      ==> temp_strengthening (Init P) (Init Q) h";
   373 by (safe_tac set_cs);
   451 by (safe_tac set_cs);
   374 by (pair_tac "ex" 1);
   452 by (pair_tac "ex" 1);
   375 by (Seq_case_simp_tac "y" 1);
   453 by (Seq_case_simp_tac "y" 1);
   376 
   454 by (pair_tac "a" 1);
   377 
   455 qed"strength_Init";
   378 
   456 
   379 goalw thy [temp_strengthening_def,state_strengthening_def]
   457 
   380 "!! h. [| temp_strengthening P Q h |]\
   458 (* ------------------ Next ----------------------------*)
   381 \      ==> temp_strengthening ([] P) ([] Q) h";
   459 
   382 
   460 goal thy 
   383 goalw thy [temp_strengthening_def,state_strengthening_def]
   461 "(TL`(ex2seq (cex_abs h ex))=UU) = (TL`(ex2seq ex)=UU)";
       
   462 by (pair_tac "ex" 1);
       
   463 by (Seq_case_simp_tac "y" 1);
       
   464 by (pair_tac "a" 1);
       
   465 by (Seq_case_simp_tac "s" 1);
       
   466 by (pair_tac "a" 1);
       
   467 qed"TL_ex2seq_UU";
       
   468 
       
   469 goal thy 
       
   470 "(TL`(ex2seq (cex_abs h ex))=nil) = (TL`(ex2seq ex)=nil)";
       
   471 by (pair_tac "ex" 1);
       
   472 by (Seq_case_simp_tac "y" 1);
       
   473 by (pair_tac "a" 1);
       
   474 by (Seq_case_simp_tac "s" 1);
       
   475 by (pair_tac "a" 1);
       
   476 qed"TL_ex2seq_nil";
       
   477 
       
   478 (* FIX: put to Sequence Lemmas *)
       
   479 goal thy "Map f`(TL`s) = TL`(Map f`s)";
       
   480 by (Seq_induct_tac "s" [] 1);
       
   481 qed"MapTL";
       
   482 
       
   483 (* important property of cex_absSeq: As it is a 1to1 correspondence, 
       
   484   properties carry over *)
       
   485 
       
   486 goalw thy [cex_absSeq_def]
       
   487 "cex_absSeq h (TL`s) = (TL`(cex_absSeq h s))";
       
   488 by (simp_tac (simpset() addsimps [MapTL]) 1);
       
   489 qed"cex_absSeq_TL";
       
   490 
       
   491 (* important property of ex2seq: can be shiftet, as defined "pointwise" *)
       
   492 
       
   493 goal thy "!!ex. [| (snd ex)~=UU ; (snd ex)~=nil |] ==> (? ex'. TL`(ex2seq ex) = ex2seq ex')";
       
   494 by (pair_tac "ex" 1);
       
   495 by (Seq_case_simp_tac "y" 1);
       
   496 by (pair_tac "a" 1);
       
   497 auto();
       
   498 qed"TLex2seq";
       
   499 
       
   500 
       
   501 goal thy "(TL`(ex2seq ex)~=UU) = ((snd ex)~=UU)";
       
   502 by (pair_tac "ex" 1);
       
   503 by (Seq_case_simp_tac "y" 1);
       
   504 by (pair_tac "a" 1);
       
   505 by (Seq_case_simp_tac "s" 1);
       
   506 by (pair_tac "a" 1);
       
   507 qed"ex2seqUUTL";
       
   508 
       
   509 goal thy "(TL`(ex2seq ex)~=nil) = ((snd ex)~=nil)";
       
   510 by (pair_tac "ex" 1);
       
   511 by (Seq_case_simp_tac "y" 1);
       
   512 by (pair_tac "a" 1);
       
   513 by (Seq_case_simp_tac "s" 1);
       
   514 by (pair_tac "a" 1);
       
   515 qed"ex2seqnilTL";
       
   516 
       
   517 
       
   518 goalw thy [temp_strengthening_def,state_strengthening_def,
       
   519 temp_sat_def, satisfies_def,Next_def]
   384 "!! h. [| temp_strengthening P Q h |]\
   520 "!! h. [| temp_strengthening P Q h |]\
   385 \      ==> temp_strengthening (Next P) (Next Q) h";
   521 \      ==> temp_strengthening (Next P) (Next Q) h";
   386 
   522 by (asm_full_simp_tac (simpset() setloop split_tac [expand_if]) 1);
   387 *)
   523 by (safe_tac set_cs);
   388 
   524 by (asm_full_simp_tac (simpset() addsimps [TL_ex2seq_nil,TL_ex2seq_UU]) 1);
   389 (* ---------------------------------------------------------------- *)
   525 by (asm_full_simp_tac (simpset() addsimps [TL_ex2seq_nil,TL_ex2seq_UU]) 1);
   390 (*             Localizing Temproal Weakenings     - 2               *)
   526 by (asm_full_simp_tac (simpset() addsimps [TL_ex2seq_nil,TL_ex2seq_UU]) 1);
   391 (* ---------------------------------------------------------------- *)
   527 by (asm_full_simp_tac (simpset() addsimps [TL_ex2seq_nil,TL_ex2seq_UU]) 1);
   392 
   528 (* cons case *)
   393 (*
   529 by (asm_full_simp_tac (simpset() addsimps [TL_ex2seq_nil,TL_ex2seq_UU,
   394 goalw thy [temp_weakening_def,state_weakening_def,
   530         ex2seq_abs_cex,cex_absSeq_TL RS sym, ex2seqUUTL,ex2seqnilTL])1);
   395 temp_sat_def,satisfies_def,Init_def]
   531 bd TLex2seq 1;
       
   532 ba 1;
       
   533 auto();
       
   534 qed"strength_Next";
       
   535 
       
   536 
       
   537 
       
   538 (* ---------------------------------------------------------------- *)
       
   539 (*             Localizing Temporal Weakenings     - 2               *)
       
   540 (* ---------------------------------------------------------------- *)
       
   541 
       
   542 
       
   543 goal thy 
   396 "!! h. [| state_weakening P Q h |]\
   544 "!! h. [| state_weakening P Q h |]\
   397 \      ==> temp_weakening (Init P) (Init Q) h";
   545 \      ==> temp_weakening (Init P) (Init Q) h";
   398 by (safe_tac set_cs);
   546 by (asm_full_simp_tac (simpset() addsimps [temp_weakening_def2,
   399 by (pair_tac "ex" 1);
   547       state_weakening_def2, temp_sat_def,satisfies_def,Init_def,unlift_def])1);
   400 by (Seq_case_simp_tac "y" 1);
   548 by (safe_tac set_cs);
   401 
   549 by (pair_tac "ex" 1);
   402 
   550 by (Seq_case_simp_tac "y" 1);
   403 
   551 by (pair_tac "a" 1);
   404 goalw thy [temp_weakening_def,state_weakening_def]
   552 qed"weak_Init";
       
   553 
       
   554 
       
   555 (*
       
   556 
       
   557 (* analog to strengthening thm above, with analog lemmas used  *)
       
   558 
       
   559 goalw thy [state_weakening_def]
   405 "!! h. [| temp_weakening P Q h |]\
   560 "!! h. [| temp_weakening P Q h |]\
   406 \      ==> temp_weakening ([] P) ([] Q) h";
   561 \      ==> temp_weakening ([] P) ([] Q) h";
   407 
   562 by (asm_full_simp_tac (simpset() addsimps [temp_weakening_def2,
   408 goalw thy [temp_weakening_def,state_weakening_def]
   563          temp_sat_def,satisfies_def,Box_def])1);
       
   564 
       
   565 (* analog to strengthening thm above, with analog lemmas used  *)
       
   566 
       
   567 goalw thy [state_weakening_def]
   409 "!! h. [| temp_weakening P Q h |]\
   568 "!! h. [| temp_weakening P Q h |]\
   410 \      ==> temp_weakening (Next P) (Next Q) h";
   569 \      ==> temp_weakening (Next P) (Next Q) h";
       
   570 by (asm_full_simp_tac (simpset() addsimps [temp_weakening_def2,
       
   571          temp_sat_def,satisfies_def,Next_def])1);
   411 
   572 
   412 *)
   573 *)
   413 
   574 
   414 (* ---------------------------------------------------------------- *)
   575 (* ---------------------------------------------------------------- *)
   415 (*             Localizing Temproal Strengthenings - 3               *)
   576 (*             Localizing Temproal Strengthenings - 3               *)