src/HOLCF/Lift3.ML
changeset 9248 e1dee89de037
parent 9245 428385c4bc50
child 10834 a7897aebbffc
equal deleted inserted replaced
9247:ad9f986616de 9248:e1dee89de037
     6 Class Instance lift::(term)pcpo
     6 Class Instance lift::(term)pcpo
     7 *)
     7 *)
     8 
     8 
     9 
     9 
    10 (* for compatibility with old HOLCF-Version *)
    10 (* for compatibility with old HOLCF-Version *)
    11 val prems = goal thy "UU = Undef";
    11 Goal "UU = Undef";
    12 by (simp_tac (HOL_ss addsimps [UU_def,UU_lift_def]) 1);
    12 by (simp_tac (HOL_ss addsimps [UU_def,UU_lift_def]) 1);
    13 qed "inst_lift_pcpo";
    13 qed "inst_lift_pcpo";
    14 
    14 
    15 (* ----------------------------------------------------------- *)
    15 (* ----------------------------------------------------------- *)
    16 (*           In lift.simps Undef is replaced by UU             *)
    16 (*           In lift.simps Undef is replaced by UU             *)
    84 by (rtac disjI2 1);
    84 by (rtac disjI2 1);
    85 by (rtac exI 1);
    85 by (rtac exI 1);
    86 by (Asm_simp_tac 1);
    86 by (Asm_simp_tac 1);
    87 qed"Lift_exhaust";
    87 qed"Lift_exhaust";
    88 
    88 
    89 val prems = goal thy 
    89 val prems = Goal "[| x = UU ==> P; ? a. x = Def a ==> P |] ==> P";
    90   "[| x = UU ==> P; ? a. x = Def a ==> P |] ==> P";
       
    91 by (cut_facts_tac [Lift_exhaust] 1);
    90 by (cut_facts_tac [Lift_exhaust] 1);
    92 by (fast_tac (HOL_cs addSEs prems) 1);
    91 by (fast_tac (HOL_cs addSEs prems) 1);
    93 qed"Lift_cases";
    92 qed"Lift_cases";
    94 
    93 
    95 Goal "(x~=UU)=(? y. x=Def y)";
    94 Goal "(x~=UU)=(? y. x=Def y)";
   101 (* For x~=UU in assumptions def_tac replaces x by (Def a) in conclusion *)
   100 (* For x~=UU in assumptions def_tac replaces x by (Def a) in conclusion *)
   102 val def_tac = etac (not_Undef_is_Def RS iffD1 RS exE) THEN' Asm_simp_tac;
   101 val def_tac = etac (not_Undef_is_Def RS iffD1 RS exE) THEN' Asm_simp_tac;
   103 
   102 
   104 bind_thm("Undef_eq_UU", inst_lift_pcpo RS sym);
   103 bind_thm("Undef_eq_UU", inst_lift_pcpo RS sym);
   105 
   104 
   106 val prems = goal thy "Def x = UU ==> R";
   105 Goal "Def x = UU ==> R";
   107 by (cut_facts_tac prems 1);
       
   108 by (asm_full_simp_tac (HOL_ss addsimps [Def_not_UU]) 1);
   106 by (asm_full_simp_tac (HOL_ss addsimps [Def_not_UU]) 1);
   109 qed "DefE";
   107 qed "DefE";
   110 
   108 
   111 val prems = goal thy "[| x = Def s; x = UU |] ==> R";
   109 Goal "[| x = Def s; x = UU |] ==> R";
   112 by (cut_facts_tac prems 1);
       
   113 by (fast_tac (HOL_cs addSDs [DefE]) 1);
   110 by (fast_tac (HOL_cs addSDs [DefE]) 1);
   114 qed"DefE2";
   111 qed"DefE2";
   115 
   112 
   116 Goal "Def x << Def y = (x = y)";
   113 Goal "Def x << Def y = (x = y)";
   117 by (stac (hd lift.inject RS sym) 1);
   114 by (stac (hd lift.inject RS sym) 1);
   149 by (assume_tac 1);
   146 by (assume_tac 1);
   150 qed"cont_Rep_CFun_app_app";
   147 qed"cont_Rep_CFun_app_app";
   151 
   148 
   152 
   149 
   153 (* continuity of if then else *)
   150 (* continuity of if then else *)
   154 val prems = goal thy "[| cont f1; cont f2 |] ==> \
   151 Goal "[| cont f1; cont f2 |] ==> cont (%x. if b then f1 x else f2 x)";
   155 \   cont (%x. if b then f1 x else f2 x)";
       
   156 by (cut_facts_tac prems 1);
       
   157 by (case_tac "b" 1);
   152 by (case_tac "b" 1);
   158 by (TRYALL (fast_tac (HOL_cs addss HOL_ss)));
   153 by Auto_tac;
   159 qed"cont_if";
   154 qed"cont_if";
   160 
   155