src/HOL/Tools/res_axioms.ML
changeset 23592 ba0912262b2c
parent 23352 356edb5eb1c4
child 24042 968f42fe6836
equal deleted inserted replaced
23591:d32a85385e17 23592:ba0912262b2c
   414 
   414 
   415 (*Converts an Isabelle theorem (intro, elim or simp format, even higher-order) into NNF.*)
   415 (*Converts an Isabelle theorem (intro, elim or simp format, even higher-order) into NNF.*)
   416 fun to_nnf th =
   416 fun to_nnf th =
   417     th |> transfer_to_ATP_Linkup
   417     th |> transfer_to_ATP_Linkup
   418        |> transform_elim |> zero_var_indexes |> freeze_thm
   418        |> transform_elim |> zero_var_indexes |> freeze_thm
   419        |> ObjectLogic.atomize_thm |> make_nnf |> strip_lambdas ~1;
   419        |> Conv.fconv_rule ObjectLogic.atomize |> make_nnf |> strip_lambdas ~1;
   420 
   420 
   421 (*Generate Skolem functions for a theorem supplied in nnf*)
   421 (*Generate Skolem functions for a theorem supplied in nnf*)
   422 fun skolem_of_nnf s th =
   422 fun skolem_of_nnf s th =
   423   map (skolem_of_def o assume o (cterm_of (theory_of_thm th))) (assume_skofuns s th);
   423   map (skolem_of_def o assume o (cterm_of (theory_of_thm th))) (assume_skofuns s th);
   424 
   424 
   638   >> (fn i => Thm.rule_attribute (fn _ => fn th => clausify_rule (th, i))));
   638   >> (fn i => Thm.rule_attribute (fn _ => fn th => clausify_rule (th, i))));
   639 
   639 
   640 
   640 
   641 (*** Converting a subgoal into negated conjecture clauses. ***)
   641 (*** Converting a subgoal into negated conjecture clauses. ***)
   642 
   642 
   643 val neg_skolemize_tac = EVERY' [rtac ccontr, ObjectLogic.atomize_tac, skolemize_tac];
   643 val neg_skolemize_tac = EVERY' [rtac ccontr, ObjectLogic.atomize_prems_tac, skolemize_tac];
   644 
   644 
   645 (*finish_cnf removes tautologies and functional reflexivity axioms, but by calling Thm.varifyT
   645 (*finish_cnf removes tautologies and functional reflexivity axioms, but by calling Thm.varifyT
   646   it can introduce TVars, which are useless in conjecture clauses.*)
   646   it can introduce TVars, which are useless in conjecture clauses.*)
   647 val no_tvars = null o term_tvars o prop_of;
   647 val no_tvars = null o term_tvars o prop_of;
   648 
   648