equal
deleted
inserted
replaced
364 |
364 |
365 (* Set constants tend to pull in too many irrelevant facts. We limit the damage |
365 (* Set constants tend to pull in too many irrelevant facts. We limit the damage |
366 by treating them more or less as if they were built-in but add their |
366 by treating them more or less as if they were built-in but add their |
367 axiomatization at the end. *) |
367 axiomatization at the end. *) |
368 val set_consts = [@{const_name Collect}, @{const_name Set.member}] |
368 val set_consts = [@{const_name Collect}, @{const_name Set.member}] |
369 val set_thms = @{thms Collect_mem_eq mem_Collect_eq} |
369 val set_thms = @{thms Collect_mem_eq mem_Collect_eq Collect_cong} |
370 |
370 |
371 fun add_pconsts_in_term thy is_built_in_const also_skolems pos = |
371 fun add_pconsts_in_term thy is_built_in_const also_skolems pos = |
372 let |
372 let |
373 val flip = Option.map not |
373 val flip = Option.map not |
374 (* We include free variables, as well as constants, to handle locales. For |
374 (* We include free variables, as well as constants, to handle locales. For |
775 accepts |> filter_out (member Thm.eq_thm_prop ths o snd) |
775 accepts |> filter_out (member Thm.eq_thm_prop ths o snd) |
776 |> take (max_relevant - length add) |
776 |> take (max_relevant - length add) |
777 |> chop special_fact_index |
777 |> chop special_fact_index |
778 in bef @ add @ after end |
778 in bef @ add @ after end |
779 fun insert_special_facts accepts = |
779 fun insert_special_facts accepts = |
|
780 (* FIXME: get rid of "ext" here once it is treated as a helper *) |
780 [] |> could_benefit_from_ext is_built_in_const accepts ? cons @{thm ext} |
781 [] |> could_benefit_from_ext is_built_in_const accepts ? cons @{thm ext} |
781 |> add_set_const_thms accepts |
782 |> add_set_const_thms accepts |
782 |> insert_into_facts accepts |
783 |> insert_into_facts accepts |
783 in |
784 in |
784 facts |> map_filter (pair_consts_fact thy is_built_in_const fudge) |
785 facts |> map_filter (pair_consts_fact thy is_built_in_const fudge) |