src/HOLCF/domain/theorems.ML
changeset 1829 5a3687398716
parent 1781 cc5f55a0fbd7
child 1834 c780a4f39454
equal deleted inserted replaced
1828:d022c10d2c08 1829:5a3687398716
   185 				rtac cases 1,
   185 				rtac cases 1,
   186 				UNTIL_SOLVED(fast_tac HOL_cs 1)];
   186 				UNTIL_SOLVED(fast_tac HOL_cs 1)];
   187 end;
   187 end;
   188 
   188 
   189 local 
   189 local 
   190   val when_app  = foldl (op `) (%%(dname^"_when"), map % (when_funs cons));
   190   fun bind_fun t = foldr mk_All ((if length cons = 1 then ["f"] 
   191   val when_appl = pg [ax_when_def] (mk_trp(when_app`%x_name===when_body cons 
   191 		  else mapn (fn n => K("f"^(string_of_int n))) 1 cons),t);
   192 		(fn (_,n)=> %(nth_elem(n-1,when_funs cons)))`(dc_rep`%x_name)))[
   192   fun bound_fun i _ = Bound (length cons - i);
       
   193   val when_app  = foldl (op `) (%%(dname^"_when"), mapn bound_fun 1 cons);
       
   194   val when_appl = pg [ax_when_def] (bind_fun(mk_trp(when_app`%x_name ===
       
   195 	     when_body cons (fn (m,n)=> bound_fun (n-m) 0)`(dc_rep`%x_name))))[
   193 				simp_tac HOLCF_ss 1];
   196 				simp_tac HOLCF_ss 1];
   194 in
   197 in
   195 val when_strict = pg [] (mk_trp(strict when_app)) [
   198 val when_strict = pg [] (bind_fun(mk_trp(strict when_app))) [
   196 			simp_tac(HOLCF_ss addsimps [when_appl,rep_strict]) 1];
   199 			simp_tac(HOLCF_ss addsimps [when_appl,rep_strict]) 1];
   197 val when_apps = let fun one_when n (con,args) = pg axs_con_def (lift_defined % 
   200 val when_apps = let fun one_when n (con,args) = pg axs_con_def 
   198    (nonlazy args, mk_trp(when_app`(con_app con args) ===
   201 		(bind_fun (lift_defined % (nonlazy args, 
   199 	 mk_cfapp(%(nth_elem(n,when_funs cons)),map %# args))))[
   202 		mk_trp(when_app`(con_app con args) ===
       
   203                        mk_cfapp(bound_fun n 0,map %# args)))))[
   200 		asm_simp_tac (HOLCF_ss addsimps [when_appl,ax_abs_iso]) 1];
   204 		asm_simp_tac (HOLCF_ss addsimps [when_appl,ax_abs_iso]) 1];
   201 	in mapn one_when 0 cons end;
   205 	in mapn one_when 1 cons end;
   202 end;
   206 end;
   203 val when_rews = when_strict::when_apps;
   207 val when_rews = when_strict::when_apps;
   204 
   208 
   205 (* ----- theorems concerning the constructors, discriminators and selectors - *)
   209 (* ----- theorems concerning the constructors, discriminators and selectors - *)
   206 
   210