src/HOL/Tools/Groebner_Basis/misc.ML
author immler@in.tum.de
Sat, 04 Apr 2009 20:22:39 +0200
changeset 30874 34927a1e0ae8
parent 25252 833abbc3e733
permissions -rw-r--r--
reverted to explicitly check the presence of a refutation (compare to 479a2fce65e6); simplified handling of errors in remote script

(*  Title:      HOL/Tools/Groebner_Basis/misc.ML
    ID:         $Id$
    Author:     Amine Chaieb, TU Muenchen

Very basic stuff for cterms.
*)

structure Misc =
struct

fun is_comb ct =
  (case Thm.term_of ct of
    _ $ _ => true
  | _ => false);

val concl = Thm.cprop_of #> Thm.dest_arg;

fun is_binop ct ct' =
  (case Thm.term_of ct' of
    c $ _ $ _ => term_of ct aconv c
  | _ => false);

fun dest_binop ct ct' =
  if is_binop ct ct' then Thm.dest_binop ct'
  else raise CTERM ("dest_binop: bad binop", [ct, ct'])

fun inst_thm inst = Thm.instantiate ([], inst);

end;