src/HOL/Tools/Meson/meson.ML
changeset 46818 2a28e66e2e4c
parent 46503 186f4cab2ba0
child 46904 f30e941b4512
equal deleted inserted replaced
46817:90c8620852cf 46818:2a28e66e2e4c
    24   val choice_theorems : theory -> thm list
    24   val choice_theorems : theory -> thm list
    25   val skolemize_with_choice_theorems : Proof.context -> thm list -> thm -> thm
    25   val skolemize_with_choice_theorems : Proof.context -> thm list -> thm -> thm
    26   val skolemize : Proof.context -> thm -> thm
    26   val skolemize : Proof.context -> thm -> thm
    27   val extensionalize_conv : Proof.context -> conv
    27   val extensionalize_conv : Proof.context -> conv
    28   val extensionalize_theorem : Proof.context -> thm -> thm
    28   val extensionalize_theorem : Proof.context -> thm -> thm
    29   val is_fol_term: theory -> term -> bool
       
    30   val make_clauses_unsorted: Proof.context -> thm list -> thm list
    29   val make_clauses_unsorted: Proof.context -> thm list -> thm list
    31   val make_clauses: Proof.context -> thm list -> thm list
    30   val make_clauses: Proof.context -> thm list -> thm list
    32   val make_horns: thm list -> thm list
    31   val make_horns: thm list -> thm list
    33   val best_prolog_tac: (thm -> int) -> thm list -> tactic
    32   val best_prolog_tac: (thm -> int) -> thm list -> tactic
    34   val depth_prolog_tac: thm list -> tactic
    33   val depth_prolog_tac: thm list -> tactic
   455 fun higher_inst_const thy (c,T) =
   454 fun higher_inst_const thy (c,T) =
   456   case binder_types T of
   455   case binder_types T of
   457       [] => false (*not a function type, OK*)
   456       [] => false (*not a function type, OK*)
   458     | Ts => length (binder_types (Sign.the_const_type thy c)) <> length Ts;
   457     | Ts => length (binder_types (Sign.the_const_type thy c)) <> length Ts;
   459 
   458 
   460 (* Returns false if any Vars in the theorem mention type bool.
       
   461    Also rejects functions whose arguments are Booleans or other functions. *)
       
   462 fun is_fol_term thy t =
       
   463     Term.is_first_order [@{const_name all}, @{const_name All},
       
   464                          @{const_name Ex}] t andalso
       
   465     not (exists_subterm (fn Var (_, T) => has_bool T orelse has_fun T
       
   466                           | _ => false) t orelse
       
   467          has_bool_arg_const t orelse
       
   468          exists_Const (higher_inst_const thy) t orelse
       
   469          has_meta_conn t);
       
   470 
       
   471 fun rigid t = not (is_Var (head_of t));
   459 fun rigid t = not (is_Var (head_of t));
   472 
   460 
   473 fun ok4horn (Const (@{const_name Trueprop},_) $ (Const (@{const_name HOL.disj}, _) $ t $ _)) = rigid t
   461 fun ok4horn (Const (@{const_name Trueprop},_) $ (Const (@{const_name HOL.disj}, _) $ t $ _)) = rigid t
   474   | ok4horn (Const (@{const_name Trueprop},_) $ t) = rigid t
   462   | ok4horn (Const (@{const_name Trueprop},_) $ t) = rigid t
   475   | ok4horn _ = false;
   463   | ok4horn _ = false;