src/HOL/hologic.ML
changeset 21219 e1063a0e6dfd
parent 21173 663a7b39894c
child 21455 b6be1d1b66c5
equal deleted inserted replaced
21218:38013c3a77a2 21219:e1063a0e6dfd
    36   val exists_const: typ -> term
    36   val exists_const: typ -> term
    37   val choice_const: typ -> term
    37   val choice_const: typ -> term
    38   val Collect_const: typ -> term
    38   val Collect_const: typ -> term
    39   val mk_eq: term * term -> term
    39   val mk_eq: term * term -> term
    40   val dest_eq: term -> term * term
    40   val dest_eq: term -> term * term
    41   val dest_eq_typ: term -> (term * term) * typ
       
    42   val mk_all: string * typ * term -> term
    41   val mk_all: string * typ * term -> term
    43   val list_all: (string * typ) list * term -> term
    42   val list_all: (string * typ) list * term -> term
    44   val mk_exists: string * typ * term -> term
    43   val mk_exists: string * typ * term -> term
    45   val mk_Collect: string * typ * term -> term
    44   val mk_Collect: string * typ * term -> term
    46   val class_eq: string
    45   val class_eq: string
   154 fun mk_eq (t, u) = eq_const (fastype_of t) $ t $ u;
   153 fun mk_eq (t, u) = eq_const (fastype_of t) $ t $ u;
   155 
   154 
   156 fun dest_eq (Const ("op =", _) $ lhs $ rhs) = (lhs, rhs)
   155 fun dest_eq (Const ("op =", _) $ lhs $ rhs) = (lhs, rhs)
   157   | dest_eq t = raise TERM ("dest_eq", [t])
   156   | dest_eq t = raise TERM ("dest_eq", [t])
   158 
   157 
   159 fun dest_eq_typ (Const ("op =", T) $ lhs $ rhs) = ((lhs, rhs), domain_type T)
       
   160   | dest_eq_typ t = raise TERM ("dest_eq_typ", [t])
       
   161 
       
   162 fun all_const T = Const ("All", [T --> boolT] ---> boolT);
   158 fun all_const T = Const ("All", [T --> boolT] ---> boolT);
   163 fun mk_all (x, T, P) = all_const T $ absfree (x, T, P);
   159 fun mk_all (x, T, P) = all_const T $ absfree (x, T, P);
   164 fun list_all (xs, t) = fold_rev (fn (x, T) => fn P => all_const T $ Abs (x, T, P)) xs t;
   160 fun list_all (xs, t) = fold_rev (fn (x, T) => fn P => all_const T $ Abs (x, T, P)) xs t;
   165 
   161 
   166 fun exists_const T = Const ("Ex", [T --> boolT] ---> boolT);
   162 fun exists_const T = Const ("Ex", [T --> boolT] ---> boolT);