src/HOL/Tools/Predicate_Compile/predicate_compile_core.ML
changeset 39194 c8406125193b
parent 39193 0e505a4e500c
child 39201 234e6ef4ff67
equal deleted inserted replaced
39193:0e505a4e500c 39194:c8406125193b
  2304     val thy = ProofContext.theory_of ctxt
  2304     val thy = ProofContext.theory_of ctxt
  2305     fun get_case_rewrite t =
  2305     fun get_case_rewrite t =
  2306       if (is_constructor thy t) then let
  2306       if (is_constructor thy t) then let
  2307         val case_rewrites = (#case_rewrites (Datatype.the_info thy
  2307         val case_rewrites = (#case_rewrites (Datatype.the_info thy
  2308           ((fst o dest_Type o fastype_of) t)))
  2308           ((fst o dest_Type o fastype_of) t)))
  2309         in case_rewrites @ maps get_case_rewrite (snd (strip_comb t)) end
  2309         in fold (union Thm.eq_thm) (case_rewrites :: map get_case_rewrite (snd (strip_comb t))) [] end
  2310       else []
  2310       else []
  2311     val simprules = @{thm "unit.cases"} :: @{thm "prod.cases"} :: maps get_case_rewrite out_ts
  2311     val simprules = insert Thm.eq_thm @{thm "unit.cases"} (insert Thm.eq_thm @{thm "prod.cases"}
       
  2312       (fold (union Thm.eq_thm) (map get_case_rewrite out_ts) []))
  2312   (* replace TRY by determining if it necessary - are there equations when calling compile match? *)
  2313   (* replace TRY by determining if it necessary - are there equations when calling compile match? *)
  2313   in
  2314   in
  2314      (* make this simpset better! *)
  2315      (* make this simpset better! *)
  2315     asm_full_simp_tac (HOL_basic_ss' addsimps simprules) 1
  2316     asm_full_simp_tac (HOL_basic_ss' addsimps simprules) 1
  2316     THEN print_tac options "after prove_match:"
  2317     THEN print_tac options "after prove_match:"