src/HOL/Tools/meson.ML
changeset 38606 3003ddbd46d9
parent 38099 e3bb96b83807
child 38608 01ed56c46259
equal deleted inserted replaced
38605:970ee38495e4 38606:3003ddbd46d9
   525 (*The simplification removes defined quantifiers and occurrences of True and False.
   525 (*The simplification removes defined quantifiers and occurrences of True and False.
   526   nnf_ss also includes the one-point simprocs,
   526   nnf_ss also includes the one-point simprocs,
   527   which are needed to avoid the various one-point theorems from generating junk clauses.*)
   527   which are needed to avoid the various one-point theorems from generating junk clauses.*)
   528 val nnf_simps =
   528 val nnf_simps =
   529   @{thms simp_implies_def Ex1_def Ball_def Bex_def if_True if_False if_cancel
   529   @{thms simp_implies_def Ex1_def Ball_def Bex_def if_True if_False if_cancel
   530          if_eq_cancel cases_simp}
   530          if_eq_cancel cases_simp (* TODO: mem_def_raw Collect_def_raw *)}
       
   531 (* TODO:  @ [@{lemma "{} = (%x. False)" by (rule ext) auto}] *)
   531 val nnf_extra_simps = @{thms split_ifs ex_simps all_simps simp_thms}
   532 val nnf_extra_simps = @{thms split_ifs ex_simps all_simps simp_thms}
   532 
   533 
   533 val nnf_ss =
   534 val nnf_ss =
   534   HOL_basic_ss addsimps nnf_extra_simps
   535   HOL_basic_ss addsimps nnf_extra_simps
   535     addsimprocs [defALL_regroup,defEX_regroup, @{simproc neq}, @{simproc let_simp}];
   536     addsimprocs [defALL_regroup,defEX_regroup, @{simproc neq}, @{simproc let_simp}];
   537 val presimplify =
   538 val presimplify =
   538   rewrite_rule (map safe_mk_meta_eq nnf_simps)
   539   rewrite_rule (map safe_mk_meta_eq nnf_simps)
   539   #> simplify nnf_ss
   540   #> simplify nnf_ss
   540 
   541 
   541 fun make_nnf ctxt th = case prems_of th of
   542 fun make_nnf ctxt th = case prems_of th of
   542     [] => th |> presimplify
   543     [] => th |> presimplify |> make_nnf1 ctxt
   543              |> make_nnf1 ctxt
       
   544   | _ => raise THM ("make_nnf: premises in argument", 0, [th]);
   544   | _ => raise THM ("make_nnf: premises in argument", 0, [th]);
   545 
   545 
   546 (*Pull existential quantifiers to front. This accomplishes Skolemization for
   546 (*Pull existential quantifiers to front. This accomplishes Skolemization for
   547   clauses that arise from a subgoal.*)
   547   clauses that arise from a subgoal.*)
   548 fun skolemize1 ctxt th =
   548 fun skolemize1 ctxt th =