src/HOL/Tools/meson.ML
changeset 15965 f422f8283491
parent 15946 94e5f157ab09
child 15998 bc916036cf84
equal deleted inserted replaced
15964:f2074e12d1d4 15965:f422f8283491
   315 val nnf_ss = HOL_basic_ss addsimps Ex1_def::Ball_def::Bex_def::simp_thms;
   315 val nnf_ss = HOL_basic_ss addsimps Ex1_def::Ball_def::Bex_def::simp_thms;
   316 
   316 
   317 fun make_nnf th = th |> simplify nnf_ss
   317 fun make_nnf th = th |> simplify nnf_ss
   318                      |> check_no_bool |> make_nnf1
   318                      |> check_no_bool |> make_nnf1
   319 
   319 
   320 (*Pull existential quantifiers (Skolemization)*)
   320 (*Pull existential quantifiers to front. This accomplishes Skolemization for
       
   321   clauses that arise from a subgoal.*)
   321 fun skolemize th =
   322 fun skolemize th =
   322   if not (has_consts ["Ex"] (prop_of th)) then th
   323   if not (has_consts ["Ex"] (prop_of th)) then th
   323   else (skolemize (tryres(th, [choice, conj_exD1, conj_exD2,
   324   else (skolemize (tryres(th, [choice, conj_exD1, conj_exD2,
   324                               disj_exD, disj_exD1, disj_exD2])))
   325                               disj_exD, disj_exD1, disj_exD2])))
   325     handle THM _ =>
   326     handle THM _ =>
   329 
   330 
   330 
   331 
   331 (*Make clauses from a list of theorems, previously Skolemized and put into nnf.
   332 (*Make clauses from a list of theorems, previously Skolemized and put into nnf.
   332   The resulting clauses are HOL disjunctions.*)
   333   The resulting clauses are HOL disjunctions.*)
   333 fun make_clauses ths =
   334 fun make_clauses ths =
   334    (  sort_clauses (map (generalize o nodups) (foldr cnf [] ths)));
   335     (sort_clauses (map (generalize o nodups) (foldr cnf [] ths)));
   335 
   336 
   336 
   337 
   337 (*Convert a list of clauses to (contrapositive) Horn clauses*)
   338 (*Convert a list of clauses to (contrapositive) Horn clauses*)
   338 fun make_horns ths =
   339 fun make_horns ths =
   339     name_thms "Horn#"
   340     name_thms "Horn#"