mirror of
https://github.com/c-cube/sidekick.git
synced 2025-12-06 03:05:31 -05:00
39 lines
1.2 KiB
OCaml
39 lines
1.2 KiB
OCaml
(* Copyright 2014 Guillaume Bury *)
|
|
|
|
module Make(Dummy: sig end) : sig
|
|
(** Fonctor to make a pure SAT Solver module with built-in literals. *)
|
|
|
|
type atom
|
|
(** Abstract type for atoms, i.e boolean literals. *)
|
|
|
|
type res = Sat | Unsat
|
|
(** Type of results returned by the solve function. *)
|
|
|
|
val new_atom : unit -> atom
|
|
(** [new_atom ()] returns a fresh literal. *)
|
|
|
|
val neg : atom -> atom
|
|
(** [neg a] returns the negation of a literal. Involutive, i.e [neg (neg a) = a]. *)
|
|
|
|
val hash : atom -> int
|
|
val equal : atom -> atom -> bool
|
|
val compare : atom -> atom -> int
|
|
(** Usual hash and comparison functions. For now, directly uses Pervasives and Hashtbl builtins. *)
|
|
|
|
val print_atom : Format.formatter -> atom -> unit
|
|
(** Print the atom on the given formatter. *)
|
|
|
|
val iter_atoms : (atom -> unit) -> unit
|
|
(** Allows iteration over all atoms created (even if unused). *)
|
|
|
|
val solve : unit -> res
|
|
(** Returns the satisfiability status of the current set of assumptions. *)
|
|
|
|
val eval : atom -> bool
|
|
(** Return the current assignement of the literals. *)
|
|
|
|
val assume : atom list list -> unit
|
|
(** Add a list of clauses to the set of assumptions. *)
|
|
|
|
end
|
|
|