src/HOL/Tools/Predicate_Compile/predicate_compile_aux.ML
changeset 35875 b0d24a74b06b
parent 35624 c4e29a0bb8c1
child 35879 99818df5b8f5
equal deleted inserted replaced
35874:bcfa6b4b21c6 35875:b0d24a74b06b
   397     val (premises, head) = Logic.strip_horn intro
   397     val (premises, head) = Logic.strip_horn intro
   398   in
   398   in
   399     Logic.list_implies (maps f premises, head)
   399     Logic.list_implies (maps f premises, head)
   400   end
   400   end
   401 
   401 
       
   402 fun map_concl f intro =
       
   403   let
       
   404     val (premises, head) = Logic.strip_horn intro
       
   405   in
       
   406     Logic.list_implies (premises, f head)
       
   407   end
       
   408 
       
   409 (* combinators to apply a function to all basic parts of nested products *)
       
   410 
       
   411 fun map_products f (Const ("Pair", T) $ t1 $ t2) =
       
   412   Const ("Pair", T) $ map_products f t1 $ map_products f t2
       
   413   | map_products f t = f t
   402 
   414 
   403 (* split theorems of case expressions *)
   415 (* split theorems of case expressions *)
   404 
   416 
   405 (*
   417 (*
   406 fun has_split_rule_cname @{const_name "nat_case"} = true
   418 fun has_split_rule_cname @{const_name "nat_case"} = true
   617     val intro''''' = map_term thy (maps_premises split_conj) intro''''
   629     val intro''''' = map_term thy (maps_premises split_conj) intro''''
   618   in
   630   in
   619     intro'''''
   631     intro'''''
   620   end
   632   end
   621 
   633 
       
   634 (* eta contract higher-order arguments *)
       
   635 
       
   636 
       
   637 fun eta_contract_ho_arguments thy intro =
       
   638   let
       
   639     fun f atom = list_comb (apsnd ((map o map_products) Envir.eta_contract) (strip_comb atom))
       
   640   in
       
   641     map_term thy (map_concl f o map_atoms f) intro
       
   642   end
       
   643 
       
   644 
   622 end;
   645 end;