open Ctypes

open Ctypes_zarith

(* This Types_generated module is an instantiation of the Types
   functor defined in the type_description.ml file. It's generated by
   a C program that Dune creates and runs behind the scenes. *)
module Types = Types_generated

module Functions (F : Ctypes.FOREIGN) = struct
  open F
  open Types

  let yices_version =
    foreign_value "yices_version" (ptr char)
  let yices_build_arch =
    foreign_value "yices_build_arch" (ptr char)
  let yices_build_mode =
    foreign_value "yices_build_mode" (ptr char)
  let yices_build_date =
    foreign_value "yices_build_date" (ptr char)
  let yices_has_mcsat =
    foreign "yices_has_mcsat"
      ((@->) void (returning sint))
  let yices_is_thread_safe =
    foreign "yices_is_thread_safe"
      ((@->) void (returning sint))
  let yices_init =
    foreign "yices_init"
      ((@->) void (returning void))
  let yices_exit =
    foreign "yices_exit"
      ((@->) void (returning void))
  let yices_reset =
    foreign "yices_reset"
      ((@->) void (returning void))
  let yices_free_string =
    foreign "yices_free_string"
      ((@->) (ptr char) (returning void))
  (* Need to find a way to get this without libffi: *)
  (* let yices_set_out_of_mem_callback = *)
  (*   Foreign.foreign "yices_set_out_of_mem_callback" *)
  (*     Ctypes.((@->) *)
  (*               (static_funptr *)
  (*                  ((@->) void (returning void))) *)
  (*               (returning void)) *)
  let yices_error_code =
    foreign "yices_error_code"
      ((@->) void (returning error_code_t))
  let yices_error_report =
    foreign "yices_error_report"
      ((@->) void
         (returning (ptr error_report_t)))
  let yices_clear_error =
    foreign "yices_clear_error"
      ((@->) void (returning void))
  let yices_print_error =
    foreign "yices_print_error"
      ((@->) (ptr _FILE) (returning sint))
  let yices_print_error_fd =
    foreign "yices_print_error_fd"
      ((@->) sint (returning sint))
  let yices_error_string =
    foreign "yices_error_string"
      ((@->) void (returning (ptr char)))
  let yices_init_term_vector =
    foreign "yices_init_term_vector"
      ((@->) (ptr term_vector_t)
         (returning void))
  let yices_init_type_vector =
    foreign "yices_init_type_vector"
      ((@->) (ptr type_vector_t)
         (returning void))
  let yices_delete_term_vector =
    foreign "yices_delete_term_vector"
      ((@->) (ptr term_vector_t)
         (returning void))
  let yices_delete_type_vector =
    foreign "yices_delete_type_vector"
      ((@->) (ptr type_vector_t)
         (returning void))
  let yices_reset_term_vector =
    foreign "yices_reset_term_vector"
      ((@->) (ptr term_vector_t)
         (returning void))
  let yices_reset_type_vector =
    foreign "yices_reset_type_vector"
      ((@->) (ptr type_vector_t)
         (returning void))
  let yices_bool_type =
    foreign "yices_bool_type"
      ((@->) void (returning type_t))
  let yices_int_type =
    foreign "yices_int_type"
      ((@->) void (returning type_t))
  let yices_real_type =
    foreign "yices_real_type"
      ((@->) void (returning type_t))
  let yices_bv_type =
    foreign "yices_bv_type"
      ((@->) uint (returning type_t))
  let yices_new_scalar_type =
    foreign "yices_new_scalar_type"
      ((@->) uint (returning type_t))
  let yices_new_uninterpreted_type =
    foreign "yices_new_uninterpreted_type"
      ((@->) void (returning type_t))
  let yices_tuple_type =
    foreign "yices_tuple_type"
      ((@->) uint
         ((@->) (ptr type_t) (returning type_t)))
  let yices_tuple_type1 =
    foreign "yices_tuple_type1"
      ((@->) type_t (returning type_t))
  let yices_tuple_type2 =
    foreign "yices_tuple_type2"
      ((@->) type_t ((@->) type_t (returning type_t)))
  let yices_tuple_type3 =
    foreign "yices_tuple_type3"
      ((@->) type_t
         ((@->) type_t
            ((@->) type_t (returning type_t))))
  let yices_function_type =
    foreign "yices_function_type"
      ((@->) uint
         ((@->) (ptr type_t)
            ((@->) type_t (returning type_t))))
  let yices_function_type1 =
    foreign "yices_function_type1"
      ((@->) type_t ((@->) type_t (returning type_t)))
  let yices_function_type2 =
    foreign "yices_function_type2"
      ((@->) type_t
         ((@->) type_t
            ((@->) type_t (returning type_t))))
  let yices_function_type3 =
    foreign "yices_function_type3"
      ((@->) type_t
         ((@->) type_t
            ((@->) type_t
               ((@->) type_t (returning type_t)))))
  let yices_type_is_bool =
    foreign "yices_type_is_bool"
      ((@->) type_t (returning sint))
  let yices_type_is_int =
    foreign "yices_type_is_int"
      ((@->) type_t (returning sint))
  let yices_type_is_real =
    foreign "yices_type_is_real"
      ((@->) type_t (returning sint))
  let yices_type_is_arithmetic =
    foreign "yices_type_is_arithmetic"
      ((@->) type_t (returning sint))
  let yices_type_is_bitvector =
    foreign "yices_type_is_bitvector"
      ((@->) type_t (returning sint))
  let yices_type_is_tuple =
    foreign "yices_type_is_tuple"
      ((@->) type_t (returning sint))
  let yices_type_is_function =
    foreign "yices_type_is_function"
      ((@->) type_t (returning sint))
  let yices_type_is_scalar =
    foreign "yices_type_is_scalar"
      ((@->) type_t (returning sint))
  let yices_type_is_uninterpreted =
    foreign "yices_type_is_uninterpreted"
      ((@->) type_t (returning sint))
  let yices_test_subtype =
    foreign "yices_test_subtype"
      ((@->) type_t ((@->) type_t (returning sint)))
  let yices_compatible_types =
    foreign "yices_compatible_types"
      ((@->) type_t ((@->) type_t (returning sint)))
  let yices_bvtype_size =
    foreign "yices_bvtype_size"
      ((@->) type_t (returning uint))
  let yices_scalar_type_card =
    foreign "yices_scalar_type_card"
      ((@->) type_t (returning uint))
  let yices_type_num_children =
    foreign "yices_type_num_children"
      ((@->) type_t (returning sint))
  let yices_type_child =
    foreign "yices_type_child"
      ((@->) type_t ((@->) sint (returning type_t)))
  let yices_type_children =
    foreign "yices_type_children"
      ((@->) type_t
         ((@->) (ptr type_vector_t)
            (returning sint)))
  let yices_true =
    foreign "yices_true"
      ((@->) void (returning term_t))
  let yices_false =
    foreign "yices_false"
      ((@->) void (returning term_t))
  let yices_constant =
    foreign "yices_constant"
      ((@->) type_t ((@->) sint (returning term_t)))
  let yices_new_uninterpreted_term =
    foreign "yices_new_uninterpreted_term"
      ((@->) type_t (returning term_t))
  let yices_new_variable =
    foreign "yices_new_variable"
      ((@->) type_t (returning term_t))
  let yices_application =
    foreign "yices_application"
      ((@->) term_t
         ((@->) uint
            ((@->) (ptr term_t) (returning term_t))))
  let yices_application1 =
    foreign "yices_application1"
      ((@->) term_t ((@->) term_t (returning term_t)))
  let yices_application2 =
    foreign "yices_application2"
      ((@->) term_t
         ((@->) term_t
            ((@->) term_t (returning term_t))))
  let yices_application3 =
    foreign "yices_application3"
      ((@->) term_t
         ((@->) term_t
            ((@->) term_t
               ((@->) term_t (returning term_t)))))
  let yices_ite =
    foreign "yices_ite"
      ((@->) term_t
         ((@->) term_t
            ((@->) term_t (returning term_t))))
  let yices_eq =
    foreign "yices_eq"
      ((@->) term_t ((@->) term_t (returning term_t)))
  let yices_neq =
    foreign "yices_neq"
      ((@->) term_t ((@->) term_t (returning term_t)))
  let yices_not =
    foreign "yices_not"
      ((@->) term_t (returning term_t))
  let yices_or =
    foreign "yices_or"
      ((@->) uint
         ((@->) (ptr term_t) (returning term_t)))
  let yices_and =
    foreign "yices_and"
      ((@->) uint
         ((@->) (ptr term_t) (returning term_t)))
  let yices_xor =
    foreign "yices_xor"
      ((@->) uint
         ((@->) (ptr term_t) (returning term_t)))
  let yices_or2 =
    foreign "yices_or2"
      ((@->) term_t ((@->) term_t (returning term_t)))
  let yices_and2 =
    foreign "yices_and2"
      ((@->) term_t ((@->) term_t (returning term_t)))
  let yices_xor2 =
    foreign "yices_xor2"
      ((@->) term_t ((@->) term_t (returning term_t)))
  let yices_or3 =
    foreign "yices_or3"
      ((@->) term_t
         ((@->) term_t
            ((@->) term_t (returning term_t))))
  let yices_and3 =
    foreign "yices_and3"
      ((@->) term_t
         ((@->) term_t
            ((@->) term_t (returning term_t))))
  let yices_xor3 =
    foreign "yices_xor3"
      ((@->) term_t
         ((@->) term_t
            ((@->) term_t (returning term_t))))
  let yices_iff =
    foreign "yices_iff"
      ((@->) term_t ((@->) term_t (returning term_t)))
  let yices_implies =
    foreign "yices_implies"
      ((@->) term_t ((@->) term_t (returning term_t)))
  let yices_tuple =
    foreign "yices_tuple"
      ((@->) uint
         ((@->) (ptr term_t) (returning term_t)))
  let yices_pair =
    foreign "yices_pair"
      ((@->) term_t ((@->) term_t (returning term_t)))
  let yices_triple =
    foreign "yices_triple"
      ((@->) term_t
         ((@->) term_t
            ((@->) term_t (returning term_t))))
  let yices_select =
    foreign "yices_select"
      ((@->) uint
         ((@->) term_t (returning term_t)))
  let yices_tuple_update =
    foreign "yices_tuple_update"
      ((@->) term_t
         ((@->) uint
            ((@->) term_t (returning term_t))))
  let yices_update =
    foreign "yices_update"
      ((@->) term_t
         ((@->) uint
            ((@->) (ptr term_t)
               ((@->) term_t (returning term_t)))))
  let yices_update1 =
    foreign "yices_update1"
      ((@->) term_t
         ((@->) term_t
            ((@->) term_t (returning term_t))))
  let yices_update2 =
    foreign "yices_update2"
      ((@->) term_t
         ((@->) term_t
            ((@->) term_t
               ((@->) term_t (returning term_t)))))
  let yices_update3 =
    foreign "yices_update3"
      ((@->) term_t
         ((@->) term_t
            ((@->) term_t
               ((@->) term_t
                  ((@->) term_t (returning term_t))))))
  let yices_distinct =
    foreign "yices_distinct"
      ((@->) uint
         ((@->) (ptr term_t) (returning term_t)))
  let yices_forall =
    foreign "yices_forall"
      ((@->) uint
         ((@->) (ptr term_t)
            ((@->) term_t (returning term_t))))
  let yices_exists =
    foreign "yices_exists"
      ((@->) uint
         ((@->) (ptr term_t)
            ((@->) term_t (returning term_t))))
  let yices_lambda =
    foreign "yices_lambda"
      ((@->) uint
         ((@->) (ptr term_t)
            ((@->) term_t (returning term_t))))
  let yices_zero =
    foreign "yices_zero"
      ((@->) void (returning term_t))
  let yices_int32 =
    foreign "yices_int32"
      ((@->) sint (returning term_t))
  let yices_int64 =
    foreign "yices_int64"
      ((@->) long (returning term_t))
  let yices_rational32 =
    foreign "yices_rational32"
      ((@->) sint
         ((@->) uint (returning term_t)))
  let yices_rational64 =
    foreign "yices_rational64"
      ((@->) long
         ((@->) ulong (returning term_t)))
  let yices_mpz =
    foreign "yices_mpz"
      ((@->) (lift_typ MPZ.t_ptr)
         (returning term_t))
  let yices_mpq =
    foreign "yices_mpq"
      ((@->) MPQ.t_ptr
         (returning term_t))
  let yices_parse_rational =
    foreign "yices_parse_rational"
      ((@->) (ptr char) (returning term_t))
  let yices_parse_float =
    foreign "yices_parse_float"
      ((@->) (ptr char) (returning term_t))
  let yices_add =
    foreign "yices_add"
      ((@->) term_t ((@->) term_t (returning term_t)))
  let yices_sub =
    foreign "yices_sub"
      ((@->) term_t ((@->) term_t (returning term_t)))
  let yices_neg =
    foreign "yices_neg"
      ((@->) term_t (returning term_t))
  let yices_mul =
    foreign "yices_mul"
      ((@->) term_t ((@->) term_t (returning term_t)))
  let yices_square =
    foreign "yices_square"
      ((@->) term_t (returning term_t))
  let yices_power =
    foreign "yices_power"
      ((@->) term_t
         ((@->) uint (returning term_t)))
  let yices_sum =
    foreign "yices_sum"
      ((@->) uint
         ((@->) (ptr term_t) (returning term_t)))
  let yices_product =
    foreign "yices_product"
      ((@->) uint
         ((@->) (ptr term_t) (returning term_t)))
  let yices_division =
    foreign "yices_division"
      ((@->) term_t ((@->) term_t (returning term_t)))
  let yices_idiv =
    foreign "yices_idiv"
      ((@->) term_t ((@->) term_t (returning term_t)))
  let yices_imod =
    foreign "yices_imod"
      ((@->) term_t ((@->) term_t (returning term_t)))
  let yices_divides_atom =
    foreign "yices_divides_atom"
      ((@->) term_t ((@->) term_t (returning term_t)))
  let yices_is_int_atom =
    foreign "yices_is_int_atom"
      ((@->) term_t (returning term_t))
  let yices_abs =
    foreign "yices_abs"
      ((@->) term_t (returning term_t))
  let yices_floor =
    foreign "yices_floor"
      ((@->) term_t (returning term_t))
  let yices_ceil =
    foreign "yices_ceil"
      ((@->) term_t (returning term_t))
  let yices_poly_int32 =
    foreign "yices_poly_int32"
      ((@->) uint
         ((@->) (ptr sint)
            ((@->) (ptr term_t) (returning term_t))))
  let yices_poly_int64 =
    foreign "yices_poly_int64"
      ((@->) uint
         ((@->) (ptr long)
            ((@->) (ptr term_t) (returning term_t))))
  let yices_poly_rational32 =
    foreign "yices_poly_rational32"
      ((@->) uint
         ((@->) (ptr sint)
            ((@->) (ptr uint)
               ((@->) (ptr term_t) (returning term_t)))))
  let yices_poly_rational64 =
    foreign "yices_poly_rational64"
      ((@->) uint
         ((@->) (ptr long)
            ((@->) (ptr ulong)
               ((@->) (ptr term_t) (returning term_t)))))
  let yices_poly_mpz =
    foreign "yices_poly_mpz"
      ((@->) uint
         ((@->) MPZ.t_ptr
            ((@->) (ptr term_t) (returning term_t))))
  let yices_poly_mpq =
    foreign "yices_poly_mpq"
      ((@->) uint
         ((@->) MPQ.t_ptr
            ((@->) (ptr term_t) (returning term_t))))
  let yices_arith_eq_atom =
    foreign "yices_arith_eq_atom"
      ((@->) term_t ((@->) term_t (returning term_t)))
  let yices_arith_neq_atom =
    foreign "yices_arith_neq_atom"
      ((@->) term_t ((@->) term_t (returning term_t)))
  let yices_arith_geq_atom =
    foreign "yices_arith_geq_atom"
      ((@->) term_t ((@->) term_t (returning term_t)))
  let yices_arith_leq_atom =
    foreign "yices_arith_leq_atom"
      ((@->) term_t ((@->) term_t (returning term_t)))
  let yices_arith_gt_atom =
    foreign "yices_arith_gt_atom"
      ((@->) term_t ((@->) term_t (returning term_t)))
  let yices_arith_lt_atom =
    foreign "yices_arith_lt_atom"
      ((@->) term_t ((@->) term_t (returning term_t)))
  let yices_arith_eq0_atom =
    foreign "yices_arith_eq0_atom"
      ((@->) term_t (returning term_t))
  let yices_arith_neq0_atom =
    foreign "yices_arith_neq0_atom"
      ((@->) term_t (returning term_t))
  let yices_arith_geq0_atom =
    foreign "yices_arith_geq0_atom"
      ((@->) term_t (returning term_t))
  let yices_arith_leq0_atom =
    foreign "yices_arith_leq0_atom"
      ((@->) term_t (returning term_t))
  let yices_arith_gt0_atom =
    foreign "yices_arith_gt0_atom"
      ((@->) term_t (returning term_t))
  let yices_arith_lt0_atom =
    foreign "yices_arith_lt0_atom"
      ((@->) term_t (returning term_t))
  let yices_bvconst_uint32 =
    foreign "yices_bvconst_uint32"
      ((@->) uint
         ((@->) uint (returning term_t)))
  let yices_bvconst_uint64 =
    foreign "yices_bvconst_uint64"
      ((@->) uint
         ((@->) ulong (returning term_t)))
  let yices_bvconst_int32 =
    foreign "yices_bvconst_int32"
      ((@->) uint
         ((@->) sint (returning term_t)))
  let yices_bvconst_int64 =
    foreign "yices_bvconst_int64"
      ((@->) uint
         ((@->) long (returning term_t)))
  let yices_bvconst_mpz =
    foreign "yices_bvconst_mpz"
      ((@->) uint
         ((@->) MPZ.t_ptr (returning term_t)))
  let yices_bvconst_zero =
    foreign "yices_bvconst_zero"
      ((@->) uint (returning term_t))
  let yices_bvconst_one =
    foreign "yices_bvconst_one"
      ((@->) uint (returning term_t))
  let yices_bvconst_minus_one =
    foreign "yices_bvconst_minus_one"
      ((@->) uint (returning term_t))
  let yices_bvconst_from_array =
    foreign "yices_bvconst_from_array"
      ((@->) uint
         ((@->) (ptr sint) (returning term_t)))
  let yices_parse_bvbin =
    foreign "yices_parse_bvbin"
      ((@->) (ptr char) (returning term_t))
  let yices_parse_bvhex =
    foreign "yices_parse_bvhex"
      ((@->) (ptr char) (returning term_t))
  let yices_bvadd =
    foreign "yices_bvadd"
      ((@->) term_t ((@->) term_t (returning term_t)))
  let yices_bvsub =
    foreign "yices_bvsub"
      ((@->) term_t ((@->) term_t (returning term_t)))
  let yices_bvneg =
    foreign "yices_bvneg"
      ((@->) term_t (returning term_t))
  let yices_bvmul =
    foreign "yices_bvmul"
      ((@->) term_t ((@->) term_t (returning term_t)))
  let yices_bvsquare =
    foreign "yices_bvsquare"
      ((@->) term_t (returning term_t))
  let yices_bvpower =
    foreign "yices_bvpower"
      ((@->) term_t
         ((@->) uint (returning term_t)))
  let yices_bvdiv =
    foreign "yices_bvdiv"
      ((@->) term_t ((@->) term_t (returning term_t)))
  let yices_bvrem =
    foreign "yices_bvrem"
      ((@->) term_t ((@->) term_t (returning term_t)))
  let yices_bvsdiv =
    foreign "yices_bvsdiv"
      ((@->) term_t ((@->) term_t (returning term_t)))
  let yices_bvsrem =
    foreign "yices_bvsrem"
      ((@->) term_t ((@->) term_t (returning term_t)))
  let yices_bvsmod =
    foreign "yices_bvsmod"
      ((@->) term_t ((@->) term_t (returning term_t)))
  let yices_bvnot =
    foreign "yices_bvnot"
      ((@->) term_t (returning term_t))
  let yices_bvnand =
    foreign "yices_bvnand"
      ((@->) term_t ((@->) term_t (returning term_t)))
  let yices_bvnor =
    foreign "yices_bvnor"
      ((@->) term_t ((@->) term_t (returning term_t)))
  let yices_bvxnor =
    foreign "yices_bvxnor"
      ((@->) term_t ((@->) term_t (returning term_t)))
  let yices_bvshl =
    foreign "yices_bvshl"
      ((@->) term_t ((@->) term_t (returning term_t)))
  let yices_bvlshr =
    foreign "yices_bvlshr"
      ((@->) term_t ((@->) term_t (returning term_t)))
  let yices_bvashr =
    foreign "yices_bvashr"
      ((@->) term_t ((@->) term_t (returning term_t)))
  let yices_bvand =
    foreign "yices_bvand"
      ((@->) uint
         ((@->) (ptr term_t) (returning term_t)))
  let yices_bvor =
    foreign "yices_bvor"
      ((@->) uint
         ((@->) (ptr term_t) (returning term_t)))
  let yices_bvxor =
    foreign "yices_bvxor"
      ((@->) uint
         ((@->) (ptr term_t) (returning term_t)))
  let yices_bvand2 =
    foreign "yices_bvand2"
      ((@->) term_t ((@->) term_t (returning term_t)))
  let yices_bvor2 =
    foreign "yices_bvor2"
      ((@->) term_t ((@->) term_t (returning term_t)))
  let yices_bvxor2 =
    foreign "yices_bvxor2"
      ((@->) term_t ((@->) term_t (returning term_t)))
  let yices_bvand3 =
    foreign "yices_bvand3"
      ((@->) term_t
         ((@->) term_t
            ((@->) term_t (returning term_t))))
  let yices_bvor3 =
    foreign "yices_bvor3"
      ((@->) term_t
         ((@->) term_t
            ((@->) term_t (returning term_t))))
  let yices_bvxor3 =
    foreign "yices_bvxor3"
      ((@->) term_t
         ((@->) term_t
            ((@->) term_t (returning term_t))))
  let yices_bvsum =
    foreign "yices_bvsum"
      ((@->) uint
         ((@->) (ptr term_t) (returning term_t)))
  let yices_bvproduct =
    foreign "yices_bvproduct"
      ((@->) uint
         ((@->) (ptr term_t) (returning term_t)))
  let yices_shift_left0 =
    foreign "yices_shift_left0"
      ((@->) term_t
         ((@->) uint (returning term_t)))
  let yices_shift_left1 =
    foreign "yices_shift_left1"
      ((@->) term_t
         ((@->) uint (returning term_t)))
  let yices_shift_right0 =
    foreign "yices_shift_right0"
      ((@->) term_t
         ((@->) uint (returning term_t)))
  let yices_shift_right1 =
    foreign "yices_shift_right1"
      ((@->) term_t
         ((@->) uint (returning term_t)))
  let yices_ashift_right =
    foreign "yices_ashift_right"
      ((@->) term_t
         ((@->) uint (returning term_t)))
  let yices_rotate_left =
    foreign "yices_rotate_left"
      ((@->) term_t
         ((@->) uint (returning term_t)))
  let yices_rotate_right =
    foreign "yices_rotate_right"
      ((@->) term_t
         ((@->) uint (returning term_t)))
  let yices_bvextract =
    foreign "yices_bvextract"
      ((@->) term_t
         ((@->) uint
            ((@->) uint (returning term_t))))
  let yices_bvconcat2 =
    foreign "yices_bvconcat2"
      ((@->) term_t ((@->) term_t (returning term_t)))
  let yices_bvconcat =
    foreign "yices_bvconcat"
      ((@->) uint
         ((@->) (ptr term_t) (returning term_t)))
  let yices_bvrepeat =
    foreign "yices_bvrepeat"
      ((@->) term_t
         ((@->) uint (returning term_t)))
  let yices_sign_extend =
    foreign "yices_sign_extend"
      ((@->) term_t
         ((@->) uint (returning term_t)))
  let yices_zero_extend =
    foreign "yices_zero_extend"
      ((@->) term_t
         ((@->) uint (returning term_t)))
  let yices_redand =
    foreign "yices_redand"
      ((@->) term_t (returning term_t))
  let yices_redor =
    foreign "yices_redor"
      ((@->) term_t (returning term_t))
  let yices_redcomp =
    foreign "yices_redcomp"
      ((@->) term_t ((@->) term_t (returning term_t)))
  let yices_bvarray =
    foreign "yices_bvarray"
      ((@->) uint
         ((@->) (ptr term_t) (returning term_t)))
  let yices_bitextract =
    foreign "yices_bitextract"
      ((@->) term_t
         ((@->) uint (returning term_t)))
  let yices_bveq_atom =
    foreign "yices_bveq_atom"
      ((@->) term_t ((@->) term_t (returning term_t)))
  let yices_bvneq_atom =
    foreign "yices_bvneq_atom"
      ((@->) term_t ((@->) term_t (returning term_t)))
  let yices_bvge_atom =
    foreign "yices_bvge_atom"
      ((@->) term_t ((@->) term_t (returning term_t)))
  let yices_bvgt_atom =
    foreign "yices_bvgt_atom"
      ((@->) term_t ((@->) term_t (returning term_t)))
  let yices_bvle_atom =
    foreign "yices_bvle_atom"
      ((@->) term_t ((@->) term_t (returning term_t)))
  let yices_bvlt_atom =
    foreign "yices_bvlt_atom"
      ((@->) term_t ((@->) term_t (returning term_t)))
  let yices_bvsge_atom =
    foreign "yices_bvsge_atom"
      ((@->) term_t ((@->) term_t (returning term_t)))
  let yices_bvsgt_atom =
    foreign "yices_bvsgt_atom"
      ((@->) term_t ((@->) term_t (returning term_t)))
  let yices_bvsle_atom =
    foreign "yices_bvsle_atom"
      ((@->) term_t ((@->) term_t (returning term_t)))
  let yices_bvslt_atom =
    foreign "yices_bvslt_atom"
      ((@->) term_t ((@->) term_t (returning term_t)))
  let yices_parse_type =
    foreign "yices_parse_type"
      ((@->) (ptr char) (returning type_t))
  let yices_parse_term =
    foreign "yices_parse_term"
      ((@->) (ptr char) (returning term_t))
  let yices_subst_term =
    foreign "yices_subst_term"
      ((@->) uint
         ((@->) (ptr term_t)
            ((@->) (ptr term_t)
               ((@->) term_t (returning term_t)))))
  let yices_subst_term_array =
    foreign "yices_subst_term_array"
      ((@->) uint
         ((@->) (ptr term_t)
            ((@->) (ptr term_t)
               ((@->) uint
                  ((@->) (ptr term_t)
                     (returning sint))))))
  let yices_set_type_name =
    foreign "yices_set_type_name"
      ((@->) type_t
         ((@->) (ptr char) (returning sint)))
  let yices_set_term_name =
    foreign "yices_set_term_name"
      ((@->) term_t
         ((@->) (ptr char) (returning sint)))
  let yices_remove_type_name =
    foreign "yices_remove_type_name"
      ((@->) (ptr char) (returning void))
  let yices_remove_term_name =
    foreign "yices_remove_term_name"
      ((@->) (ptr char) (returning void))
  let yices_get_type_by_name =
    foreign "yices_get_type_by_name"
      ((@->) (ptr char) (returning type_t))
  let yices_get_term_by_name =
    foreign "yices_get_term_by_name"
      ((@->) (ptr char) (returning term_t))
  let yices_clear_type_name =
    foreign "yices_clear_type_name"
      ((@->) type_t (returning sint))
  let yices_clear_term_name =
    foreign "yices_clear_term_name"
      ((@->) term_t (returning sint))
  let yices_get_type_name =
    foreign "yices_get_type_name"
      ((@->) type_t (returning (ptr char)))
  let yices_get_term_name =
    foreign "yices_get_term_name"
      ((@->) term_t (returning (ptr char)))
  let yices_type_of_term =
    foreign "yices_type_of_term"
      ((@->) term_t (returning type_t))
  let yices_term_is_bool =
    foreign "yices_term_is_bool"
      ((@->) term_t (returning sint))
  let yices_term_is_int =
    foreign "yices_term_is_int"
      ((@->) term_t (returning sint))
  let yices_term_is_real =
    foreign "yices_term_is_real"
      ((@->) term_t (returning sint))
  let yices_term_is_arithmetic =
    foreign "yices_term_is_arithmetic"
      ((@->) term_t (returning sint))
  let yices_term_is_bitvector =
    foreign "yices_term_is_bitvector"
      ((@->) term_t (returning sint))
  let yices_term_is_tuple =
    foreign "yices_term_is_tuple"
      ((@->) term_t (returning sint))
  let yices_term_is_function =
    foreign "yices_term_is_function"
      ((@->) term_t (returning sint))
  let yices_term_is_scalar =
    foreign "yices_term_is_scalar"
      ((@->) term_t (returning sint))
  let yices_term_bitsize =
    foreign "yices_term_bitsize"
      ((@->) term_t (returning uint))
  let yices_term_is_ground =
    foreign "yices_term_is_ground"
      ((@->) term_t (returning sint))
  let yices_term_is_atomic =
    foreign "yices_term_is_atomic"
      ((@->) term_t (returning sint))
  let yices_term_is_composite =
    foreign "yices_term_is_composite"
      ((@->) term_t (returning sint))
  let yices_term_is_projection =
    foreign "yices_term_is_projection"
      ((@->) term_t (returning sint))
  let yices_term_is_sum =
    foreign "yices_term_is_sum"
      ((@->) term_t (returning sint))
  let yices_term_is_bvsum =
    foreign "yices_term_is_bvsum"
      ((@->) term_t (returning sint))
  let yices_term_is_product =
    foreign "yices_term_is_product"
      ((@->) term_t (returning sint))
  let yices_term_constructor =
    foreign "yices_term_constructor"
      ((@->) term_t (returning term_constructor_t))
  let yices_term_num_children =
    foreign "yices_term_num_children"
      ((@->) term_t (returning sint))
  let yices_term_child =
    foreign "yices_term_child"
      ((@->) term_t ((@->) sint (returning term_t)))
  let yices_term_children =
    foreign "yices_term_children"
      ((@->) term_t ((@->) (ptr term_vector_t) (returning sint)))
  let yices_proj_index =
    foreign "yices_proj_index"
      ((@->) term_t (returning sint))
  let yices_proj_arg =
    foreign "yices_proj_arg"
      ((@->) term_t (returning term_t))
  let yices_bool_const_value =
    foreign "yices_bool_const_value"
      ((@->) term_t
         ((@->) (ptr sint) (returning sint)))
  let yices_bv_const_value =
    foreign "yices_bv_const_value"
      ((@->) term_t
         ((@->) (ptr sint) (returning sint)))
  let yices_scalar_const_value =
    foreign "yices_scalar_const_value"
      ((@->) term_t
         ((@->) (ptr sint) (returning sint)))
  let yices_rational_const_value =
    foreign "yices_rational_const_value"
      ((@->) term_t
         ((@->) MPQ.t_ptr (returning sint)))
  let yices_sum_component =
    foreign "yices_sum_component"
      ((@->) term_t
         ((@->) sint
            ((@->) MPQ.t_ptr
               ((@->) (ptr term_t) (returning sint)))))
  let yices_bvsum_component =
    foreign "yices_bvsum_component"
      ((@->) term_t
         ((@->) sint
            ((@->) (ptr sint)
               ((@->) (ptr term_t) (returning sint)))))
  let yices_product_component =
    foreign "yices_product_component"
      ((@->) term_t
         ((@->) sint
            ((@->) (ptr term_t)
               ((@->) (ptr uint)
                  (returning sint)))))
  let yices_num_terms =
    foreign "yices_num_terms"
      ((@->) void (returning uint))
  let yices_num_types =
    foreign "yices_num_types"
      ((@->) void (returning uint))
  let yices_incref_term =
    foreign "yices_incref_term"
      ((@->) term_t (returning sint))
  let yices_decref_term =
    foreign "yices_decref_term"
      ((@->) term_t (returning sint))
  let yices_incref_type =
    foreign "yices_incref_type"
      ((@->) type_t (returning sint))
  let yices_decref_type =
    foreign "yices_decref_type"
      ((@->) type_t (returning sint))
  let yices_num_posref_terms =
    foreign "yices_num_posref_terms"
      ((@->) void (returning uint))
  let yices_num_posref_types =
    foreign "yices_num_posref_types"
      ((@->) void (returning uint))
  let yices_garbage_collect =
    foreign "yices_garbage_collect"
      ((@->) (ptr term_t)
         ((@->) uint
            ((@->) (ptr type_t)
               ((@->) uint
                  ((@->) sint (returning void))))))
  let yices_new_config =
    foreign "yices_new_config"
      ((@->) void
         (returning (ptr ctx_config_t)))
  let yices_free_config =
    foreign "yices_free_config"
      ((@->) (ptr ctx_config_t)
         (returning void))
  let yices_set_config =
    foreign "yices_set_config"
      ((@->) (ptr ctx_config_t)
         ((@->) (ptr char)
            ((@->) (ptr char)
               (returning sint))))
  let yices_default_config_for_logic =
    foreign "yices_default_config_for_logic"
      ((@->) (ptr ctx_config_t)
         ((@->) (ptr char) (returning sint)))
  let yices_new_context =
    foreign "yices_new_context"
      ((@->) (ptr ctx_config_t)
         (returning (ptr context_t)))
  let yices_free_context =
    foreign "yices_free_context"
      ((@->) (ptr context_t) (returning void))
  let yices_context_status =
    foreign "yices_context_status"
      ((@->) (ptr context_t) (returning smt_status_t))
  let yices_reset_context =
    foreign "yices_reset_context"
      ((@->) (ptr context_t) (returning void))
  let yices_push =
    foreign "yices_push"
      ((@->) (ptr context_t) (returning sint))
  let yices_pop =
    foreign "yices_pop"
      ((@->) (ptr context_t) (returning sint))
  let yices_context_enable_option =
    foreign "yices_context_enable_option"
      ((@->) (ptr context_t)
         ((@->) (ptr char) (returning sint)))
  let yices_context_disable_option =
    foreign "yices_context_disable_option"
      ((@->) (ptr context_t)
         ((@->) (ptr char) (returning sint)))
  let yices_assert_formula =
    foreign "yices_assert_formula"
      ((@->) (ptr context_t)
         ((@->) term_t (returning sint)))
  let yices_assert_formulas =
    foreign "yices_assert_formulas"
      ((@->) (ptr context_t)
         ((@->) uint
            ((@->) (ptr term_t) (returning sint))))
  let yices_check_context =
    foreign "yices_check_context"
      ((@->) (ptr context_t)
         ((@->) (ptr param_t) (returning smt_status_t)))
  let yices_check_context_with_assumptions =
    foreign "yices_check_context_with_assumptions"
      ((@->) (ptr context_t)
         ((@->) (ptr param_t)
            ((@->) uint
               ((@->) (ptr term_t)
                  (returning smt_status_t)))))
  let yices_check_context_with_model =
    foreign "yices_check_context_with_model"
      ((@->) (ptr context_t)
         ((@->) (ptr param_t)
            ((@->) (ptr model_t)
               ((@->) uint
                  ((@->) (ptr term_t)
                     (returning smt_status_t))))))
  let yices_check_context_with_model_and_hint =
    foreign "yices_check_context_with_model_and_hint"
      ((@->) (ptr context_t)
         ((@->) (ptr param_t)
            ((@->) (ptr model_t)
               ((@->) uint
                  ((@->) (ptr term_t)
                     ((@->) uint
                        (returning smt_status_t)))))))
  let yices_mcsat_set_fixed_var_order =
    foreign "yices_mcsat_set_fixed_var_order"
      ((@->) (ptr context_t)
         ((@->) uint
            ((@->) (ptr term_t)
               (returning smt_status_t))))
  let yices_mcsat_set_initial_var_order =
    foreign "yices_mcsat_set_initial_var_order"
      ((@->) (ptr context_t)
         ((@->) uint
            ((@->) (ptr term_t)
               (returning smt_status_t))))

  (* Hand-written *)
  let yices_check_context_with_interpolation =
    foreign "yices_check_context_with_interpolation"
      ((@->) (ptr interpolation_context_t)
         ((@->) (ptr param_t)
            ((@->) sint
               (returning smt_status_t))))
  
  let yices_assert_blocking_clause =
    foreign "yices_assert_blocking_clause"
      ((@->) (ptr context_t) (returning sint))
  let yices_stop_search =
    foreign "yices_stop_search"
      ((@->) (ptr context_t) (returning void))
  let yices_new_param_record =
    foreign "yices_new_param_record"
      ((@->) void (returning (ptr param_t)))
  let yices_default_params_for_context =
    foreign "yices_default_params_for_context"
      ((@->) (ptr context_t)
         ((@->) (ptr param_t) (returning void)))
  let yices_set_param =
    foreign "yices_set_param"
      ((@->) (ptr param_t)
         ((@->) (ptr char)
            ((@->) (ptr char)
               (returning sint))))
  let yices_free_param_record =
    foreign "yices_free_param_record"
      ((@->) (ptr param_t) (returning void))
  let yices_get_unsat_core =
    foreign "yices_get_unsat_core"
      ((@->) (ptr context_t)
         ((@->) (ptr term_vector_t)
            (returning sint)))
  let yices_get_model_interpolant =
    foreign "yices_get_model_interpolant"
      ((@->) (ptr context_t)
         (returning term_t))
  let yices_get_model =
    foreign "yices_get_model"
      ((@->) (ptr context_t)
         ((@->) sint (returning (ptr model_t))))
  let yices_free_model =
    foreign "yices_free_model"
      ((@->) (ptr model_t) (returning void))
  let yices_new_model =
    foreign "yices_new_model"
      ((@->) void (returning (ptr model_t)))
  let yices_model_from_map =
    foreign "yices_model_from_map"
      ((@->) uint
         ((@->) (ptr term_t)
            ((@->) (ptr term_t)
               (returning (ptr model_t)))))

  let yices_model_set_bool =
    foreign "yices_model_set_bool"
      ((@->) (ptr model_t)
         ((@->) term_t
            ((@->) sint
               (returning sint))))
  let yices_model_set_int32 =
    foreign "yices_model_set_int32"
      ((@->) (ptr model_t)
         ((@->) term_t
            ((@->) sint
               (returning sint))))
  let yices_model_set_int64 =
    foreign "yices_model_set_int64"
      ((@->) (ptr model_t)
         ((@->) term_t
            ((@->) long
               (returning sint))))
  let yices_model_set_rational32 =
    foreign "yices_model_set_rational32"
      ((@->) (ptr model_t)
         ((@->) term_t
            ((@->) sint
               ((@->) uint
                  (returning sint)))))
  let yices_model_set_rational64 =
    foreign "yices_model_set_rational64"
      ((@->) (ptr model_t)
         ((@->) term_t
            ((@->) long
               ((@->) ulong
                  (returning sint)))))
  let yices_model_set_mpz =
    foreign "yices_model_set_mpz"
      ((@->) (ptr model_t)
         ((@->) term_t
            ((@->) MPZ.t_ptr
               (returning sint))))
  let yices_model_set_mpq =
    foreign "yices_model_set_mpq"
      ((@->) (ptr model_t)
         ((@->) term_t
            ((@->) MPQ.t_ptr
               (returning sint))))
  let yices_model_set_algebraic_number =
    foreign "yices_model_set_algebraic_number"
      ((@->) (ptr model_t)
                ((@->) term_t
                   ((@->) (ptr Libpoly.AlgebraicNumber.t)
                      (returning sint))))

  let yices_model_set_bv_int32 =
    foreign "yices_model_set_bv_int32"
      ((@->) (ptr model_t)
         ((@->) term_t
            ((@->) sint
               (returning sint))))
  let yices_model_set_bv_int64 =
    foreign "yices_model_set_bv_int64"
      ((@->) (ptr model_t)
         ((@->) term_t
            ((@->) long
               (returning sint))))
  let yices_model_set_bv_uint32 =
    foreign "yices_model_set_bv_uint32"
      ((@->) (ptr model_t)
         ((@->) term_t
            ((@->) uint
               (returning sint))))
  let yices_model_set_bv_uint64 =
    foreign "yices_model_set_bv_uint64"
      ((@->) (ptr model_t)
         ((@->) term_t
            ((@->) ulong
               (returning sint))))
  let yices_model_set_bv_mpz =
    foreign "yices_model_set_bv_mpz"
      ((@->) (ptr model_t)
         ((@->) term_t
            ((@->) MPZ.t_ptr
               (returning sint))))
  let yices_model_set_bv_from_array =
    foreign "yices_model_set_bv_from_array"
      ((@->) (ptr model_t)
         ((@->) term_t
            ((@->) uint
               ((@->) (ptr sint)
                  (returning sint)))))

  let yices_model_collect_defined_terms =
    foreign "yices_model_collect_defined_terms"
      ((@->) (ptr model_t)
         ((@->) (ptr term_vector_t)
            (returning void)))
  let yices_check_formula =
    foreign "yices_check_formula"
      ((@->) term_t
         ((@->) (ptr char)
            ((@->) (ptr (ptr model_t))
               ((@->) (ptr char)
                  (returning smt_status_t)))))
  let yices_check_formulas =
    foreign "yices_check_formulas"
      ((@->) (ptr term_t)
         ((@->) uint
            ((@->) (ptr char)
               ((@->) (ptr (ptr model_t))
                  ((@->) (ptr char)
                     (returning smt_status_t))))))
  let yices_has_delegate =
    foreign "yices_has_delegate"
      ((@->) (ptr char)
         (returning sint))
  let yices_export_formula_to_dimacs =
    foreign "yices_export_formula_to_dimacs"
      ((@->) term_t
         ((@->) (ptr char)
            ((@->) sint
               ((@->) (ptr smt_status_t)
                  (returning sint)))))
  let yices_export_formulas_to_dimacs =
    foreign "yices_export_formulas_to_dimacs"
      ((@->) (ptr term_t)
         ((@->) uint
            ((@->) (ptr char)
               ((@->) sint
                  ((@->) (ptr smt_status_t)
                     (returning sint))))))
  let yices_get_bool_value =
    foreign "yices_get_bool_value"
      ((@->) (ptr model_t)
         ((@->) term_t
            ((@->) (ptr sint) (returning sint))))
  let yices_get_int32_value =
    foreign "yices_get_int32_value"
      ((@->) (ptr model_t)
         ((@->) term_t
            ((@->) (ptr sint) (returning sint))))
  let yices_get_int64_value =
    foreign "yices_get_int64_value"
      ((@->) (ptr model_t)
         ((@->) term_t
            ((@->) (ptr long) (returning sint))))
  let yices_get_rational32_value =
    foreign "yices_get_rational32_value"
      ((@->) (ptr model_t)
         ((@->) term_t
            ((@->) (ptr sint)
               ((@->) (ptr uint)
                  (returning sint)))))
  let yices_get_rational64_value =
    foreign "yices_get_rational64_value"
      ((@->) (ptr model_t)
         ((@->) term_t
            ((@->) (ptr long)
               ((@->) (ptr ulong)
                  (returning sint)))))
  let yices_get_double_value =
    foreign "yices_get_double_value"
      ((@->) (ptr model_t)
         ((@->) term_t
            ((@->) (ptr double)
               (returning sint))))
  let yices_get_mpz_value =
    foreign "yices_get_mpz_value"
      ((@->) (ptr model_t)
         ((@->) term_t
            ((@->) MPZ.t_ptr
               (returning sint))))
  let yices_get_mpq_value =
    foreign "yices_get_mpq_value"
      ((@->) (ptr model_t)
         ((@->) term_t
            ((@->) MPQ.t_ptr
               (returning sint))))
  let yices_get_algebraic_number_value =
    foreign "yices_get_algebraic_number_value"
      ((@->) (ptr model_t)
         ((@->) term_t
            ((@->) (ptr Libpoly.AlgebraicNumber.t)
               (returning sint))))
  let yices_get_bv_value =
    foreign "yices_get_bv_value"
      ((@->) (ptr model_t)
         ((@->) term_t
            ((@->) (ptr sint) (returning sint))))
  let yices_get_scalar_value =
    foreign "yices_get_scalar_value"
      ((@->) (ptr model_t)
         ((@->) term_t
            ((@->) (ptr sint) (returning sint))))
  let yices_init_yval_vector =
    foreign "yices_init_yval_vector"
      ((@->) (ptr yval_vector_t)
         (returning void))
  let yices_delete_yval_vector =
    foreign "yices_delete_yval_vector"
      ((@->) (ptr yval_vector_t)
         (returning void))
  let yices_reset_yval_vector =
    foreign "yices_reset_yval_vector"
      ((@->) (ptr yval_vector_t)
         (returning void))
  let yices_get_value =
    foreign "yices_get_value"
      ((@->) (ptr model_t)
         ((@->) term_t
            ((@->) (ptr yval_t) (returning sint))))
  let yices_val_is_int32 =
    foreign "yices_val_is_int32"
      ((@->) (ptr model_t)
         ((@->) (ptr yval_t) (returning sint)))
  let yices_val_is_int64 =
    foreign "yices_val_is_int64"
      ((@->) (ptr model_t)
         ((@->) (ptr yval_t) (returning sint)))
  let yices_val_is_rational32 =
    foreign "yices_val_is_rational32"
      ((@->) (ptr model_t)
         ((@->) (ptr yval_t) (returning sint)))
  let yices_val_is_rational64 =
    foreign "yices_val_is_rational64"
      ((@->) (ptr model_t)
         ((@->) (ptr yval_t) (returning sint)))
  let yices_val_is_integer =
    foreign "yices_val_is_integer"
      ((@->) (ptr model_t)
         ((@->) (ptr yval_t) (returning sint)))
  let yices_val_bitsize =
    foreign "yices_val_bitsize"
      ((@->) (ptr model_t)
         ((@->) (ptr yval_t) (returning uint)))
  let yices_val_tuple_arity =
    foreign "yices_val_tuple_arity"
      ((@->) (ptr model_t)
         ((@->) (ptr yval_t) (returning uint)))
  let yices_val_mapping_arity =
    foreign "yices_val_mapping_arity"
      ((@->) (ptr model_t)
         ((@->) (ptr yval_t) (returning uint)))
  let yices_val_function_arity =
    foreign "yices_val_function_arity"
      ((@->) (ptr model_t)
         ((@->) (ptr yval_t) (returning uint)))
  let yices_val_function_type =
    foreign "yices_val_function_type"
      ((@->) (ptr model_t)
         ((@->) (ptr yval_t) (returning type_t)))
  let yices_val_get_bool =
    foreign "yices_val_get_bool"
      ((@->) (ptr model_t)
         ((@->) (ptr yval_t)
            ((@->) (ptr sint) (returning sint))))
  let yices_val_get_int32 =
    foreign "yices_val_get_int32"
      ((@->) (ptr model_t)
         ((@->) (ptr yval_t)
            ((@->) (ptr sint) (returning sint))))
  let yices_val_get_int64 =
    foreign "yices_val_get_int64"
      ((@->) (ptr model_t)
         ((@->) (ptr yval_t)
            ((@->) (ptr long) (returning sint))))
  let yices_val_get_rational32 =
    foreign "yices_val_get_rational32"
      ((@->) (ptr model_t)
         ((@->) (ptr yval_t)
            ((@->) (ptr sint)
               ((@->) (ptr uint)
                  (returning sint)))))
  let yices_val_get_rational64 =
    foreign "yices_val_get_rational64"
      ((@->) (ptr model_t)
         ((@->) (ptr yval_t)
            ((@->) (ptr long)
               ((@->) (ptr ulong)
                  (returning sint)))))
  let yices_val_get_double =
    foreign "yices_val_get_double"
      ((@->) (ptr model_t)
         ((@->) (ptr yval_t)
            ((@->) (ptr double)
               (returning sint))))
  let yices_val_get_mpz =
    foreign "yices_val_get_mpz"
      ((@->) (ptr model_t)
         ((@->) (ptr yval_t)
            ((@->) MPZ.t_ptr
               (returning sint))))
  let yices_val_get_mpq =
    foreign "yices_val_get_mpq"
      ((@->) (ptr model_t)
         ((@->) (ptr yval_t)
            ((@->) MPQ.t_ptr
               (returning sint))))
  let yices_val_get_algebraic_number =
    foreign "yices_val_get_algebraic_number"
      ((@->) (ptr model_t)
         ((@->) (ptr yval_t)
            ((@->) (ptr Libpoly.AlgebraicNumber.t)
               (returning sint))))
  let yices_val_get_bv =
    foreign "yices_val_get_bv"
      ((@->) (ptr model_t)
         ((@->) (ptr yval_t)
            ((@->) (ptr sint) (returning sint))))
  let yices_val_get_scalar =
    foreign "yices_val_get_scalar"
      ((@->) (ptr model_t)
         ((@->) (ptr yval_t)
            ((@->) (ptr sint)
               ((@->) (ptr type_t) (returning sint)))))
  let yices_val_expand_tuple =
    foreign "yices_val_expand_tuple"
      ((@->) (ptr model_t)
         ((@->) (ptr yval_t)
            ((@->) (ptr yval_t) (returning sint))))
  let yices_val_expand_function =
    foreign "yices_val_expand_function"
      ((@->) (ptr model_t)
         ((@->) (ptr yval_t)
            ((@->) (ptr yval_t)
               ((@->) (ptr yval_vector_t)
                  (returning sint)))))
  let yices_val_expand_mapping =
    foreign "yices_val_expand_mapping"
      ((@->) (ptr model_t)
         ((@->) (ptr yval_t)
            ((@->) (ptr yval_t)
               ((@->) (ptr yval_t) (returning sint)))))
  let yices_formula_true_in_model =
    foreign "yices_formula_true_in_model"
      ((@->) (ptr model_t)
         ((@->) term_t (returning sint)))
  let yices_formulas_true_in_model =
    foreign "yices_formulas_true_in_model"
      ((@->) (ptr model_t)
         ((@->) uint
            ((@->) (ptr term_t) (returning sint))))
  let yices_get_value_as_term =
    foreign "yices_get_value_as_term"
      ((@->) (ptr model_t)
         ((@->) term_t (returning term_t)))
  let yices_term_array_value =
    foreign "yices_term_array_value"
      ((@->) (ptr model_t)
         ((@->) uint
            ((@->) (ptr term_t)
               ((@->) (ptr term_t) (returning sint)))))
  let yices_model_term_support =
    foreign "yices_model_term_support"
      ((@->) (ptr model_t)
         ((@->) term_t
            ((@->) (ptr term_vector_t)
               (returning sint))))
  let yices_model_term_array_support =
    foreign "yices_model_term_array_support"
      ((@->) (ptr model_t)
         ((@->) uint
            ((@->) (ptr term_t)
               ((@->) (ptr term_vector_t)
                  (returning sint)))))
  let yices_implicant_for_formula =
    foreign "yices_implicant_for_formula"
      ((@->) (ptr model_t)
         ((@->) term_t
            ((@->) (ptr term_vector_t)
               (returning sint))))
  let yices_implicant_for_formulas =
    foreign "yices_implicant_for_formulas"
      ((@->) (ptr model_t)
         ((@->) uint
            ((@->) (ptr term_t)
               ((@->) (ptr term_vector_t)
                  (returning sint)))))
  let yices_generalize_model =
    foreign "yices_generalize_model"
      ((@->) (ptr model_t)
         ((@->) term_t
            ((@->) uint
               ((@->) (ptr term_t)
                  ((@->) yices_gen_mode_t
                     ((@->) (ptr term_vector_t)
                        (returning sint)))))))
  let yices_generalize_model_array =
    foreign "yices_generalize_model_array"
      ((@->) (ptr model_t)
         ((@->) uint
            ((@->) (ptr term_t)
               ((@->) uint
                  ((@->) (ptr term_t)
                     ((@->) yices_gen_mode_t
                        ((@->) (ptr term_vector_t)
                           (returning sint))))))))
  let yices_pp_type =
    foreign "yices_pp_type"
      ((@->) (ptr _FILE)
         ((@->) type_t
            ((@->) uint
               ((@->) uint
                  ((@->) uint (returning sint))))))
  let yices_pp_term =
    foreign "yices_pp_term"
      ((@->) (ptr _FILE)
         ((@->) term_t
            ((@->) uint
               ((@->) uint
                  ((@->) uint (returning sint))))))
  let yices_pp_term_array =
    foreign "yices_pp_term_array"
      ((@->) (ptr _FILE)
         ((@->) uint
            ((@->) (ptr term_t)
               ((@->) uint
                  ((@->) uint
                     ((@->) uint
                        ((@->) sint (returning sint))))))))
  let yices_print_model =
    foreign "yices_print_model"
      ((@->) (ptr _FILE)
         ((@->) (ptr model_t) (returning void)))
  let yices_pp_model =
    foreign "yices_pp_model"
      ((@->) (ptr _FILE)
         ((@->) (ptr model_t)
            ((@->) uint
               ((@->) uint
                  ((@->) uint (returning sint))))))
  let yices_print_term_values =
    foreign "yices_print_term_values"
      ((@->) (ptr _FILE)
         ((@->) (ptr model_t)
            ((@->) uint
               ((@->) (ptr term_t)
                  (returning sint)))))
  let yices_pp_term_values =
    foreign "yices_pp_term_values"
      ((@->) (ptr _FILE)
         ((@->) (ptr model_t)
            ((@->) uint
               ((@->) (ptr term_t)
                  ((@->) uint
                     ((@->) uint
                        ((@->) uint
                           (returning sint))))))))
  let yices_pp_type_fd =
    foreign "yices_pp_type_fd"
      ((@->) sint
         ((@->) type_t
            ((@->) uint
               ((@->) uint
                  ((@->) uint (returning sint))))))
  let yices_pp_term_fd =
    foreign "yices_pp_term_fd"
      ((@->) sint
         ((@->) term_t
            ((@->) uint
               ((@->) uint
                  ((@->) uint (returning sint))))))
  let yices_pp_term_array_fd =
    foreign "yices_pp_term_array_fd"
      ((@->) sint
         ((@->) uint
            ((@->) (ptr term_t)
               ((@->) uint
                  ((@->) uint
                     ((@->) uint
                        ((@->) sint (returning sint))))))))
  let yices_print_model_fd =
    foreign "yices_print_model_fd"
      ((@->) sint
         ((@->) (ptr model_t) (returning sint)))
  let yices_pp_model_fd =
    foreign "yices_pp_model_fd"
      ((@->) sint
         ((@->) (ptr model_t)
            ((@->) uint
               ((@->) uint
                  ((@->) uint (returning sint))))))
  let yices_print_term_values_fd =
    foreign "yices_print_term_values_fd"
      ((@->) sint
         ((@->) (ptr model_t)
            ((@->) uint
               ((@->) (ptr term_t)
                  (returning sint)))))
  let yices_pp_term_values_fd =
    foreign "yices_pp_term_values_fd"
      ((@->) sint
         ((@->) (ptr model_t)
            ((@->) uint
               ((@->) (ptr term_t)
                  ((@->) uint
                     ((@->) uint
                        ((@->) uint (returning sint))))))))
  let yices_type_to_string =
    foreign "yices_type_to_string"
      ((@->) type_t
         ((@->) uint
            ((@->) uint
               ((@->) uint
                  (returning (ptr char))))))
  let yices_term_to_string =
    foreign "yices_term_to_string"
      ((@->) term_t
         ((@->) uint
            ((@->) uint
               ((@->) uint
                  (returning (ptr char))))))
  let yices_model_to_string =
    foreign "yices_model_to_string"
      ((@->) (ptr model_t)
         ((@->) uint
            ((@->) uint
               ((@->) uint
                  (returning (ptr char))))))

end
