Module type Tseitin.S
The exposed interface of Tseitin's CNF conversion.
type combinator
=
|
And
|
Or
|
Not
type id
type t
= private
{
id : id;
view : view;
}
and view
=
|
True
|
Lit of atom
|
Comb of combinator * t list
The type of arbitrary boolean formulas. Arbitrary boolean formulas can be built using functions in this module, and then converted to a CNF, which is a list of clauses that only use atomic formulas.
val false_ : t
The
false
formula, i.e a formula that cannot be satisfied.
val and_ : t list -> t
Creates the conjunction of a list of formulas. An empty conjunction is always satisfied.
val or_ : t list -> t
Creates the disjunction of a list of formulas. An empty disjunction is never satisfied.
val imply_l : t list -> t -> t
val equiv : t -> t -> t
equiv p q
creates the boolena formula "p
is equivalent toq
".
val cnf : ?simplify:bool -> fresh:(unit -> atom) -> t -> atom list list
cnf f
returns a conjunctive normal form off
under the form: a list (which is a conjunction) of lists (which are disjunctions) of atomic formulas.- parameter fresh
used to generate fresh atoms to name formulas
- parameter simplify
if true (default) simplifiy formula
val pp : t CCFormat.printer
pp fmt f
prints the formula on the formatterfmt
.