12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485(**************************************************************************)(* *)(* Alt-Ergo Zero *)(* *)(* Sylvain Conchon and Alain Mebsout *)(* Universite Paris-Sud 11 *)(* *)(* Copyright 2011. This file is distributed under the terms of the *)(* Apache Software License version 2.0 *)(* *)(**************************************************************************)(** Interfaces for Tseitin's CNF conversion *)moduletypeArg=sig(** Formulas
This defines what is needed of formulas in order to implement
Tseitin's CNF conversion.
*)typet(** Type of atomic formulas. *)valneg:t->t(** Negation of atomic formulas. *)valfresh:unit->t(** Generate fresh formulas (that are different from any other). *)valpp:Format.formatter->t->unit(** Print the given formula. *)endmoduletypeS=sig(** CNF conversion
This modules converts arbitrary boolean formulas into CNF.
*)typeatom(** The type of atomic formulas. *)typet(** 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. *)valf_true:t(** The [true] formula, i.e a formula that is always satisfied. *)valf_false:t(** The [false] formula, i.e a formula that cannot be satisfied. *)valmake_atom:atom->t(** [make_atom p] builds the boolean formula equivalent to the atomic formula [p]. *)valmake_not:t->t(** Creates the negation of a boolean formula. *)valmake_and:tlist->t(** Creates the conjunction of a list of formulas. An empty conjunction is always satisfied. *)valmake_or:tlist->t(** Creates the disjunction of a list of formulas. An empty disjunction is never satisfied. *)valmake_xor:t->t->t(** [make_xor p q] creates the boolean formula "[p] xor [q]". *)valmake_imply:t->t->t(** [make_imply p q] creates the boolean formula "[p] implies [q]". *)valmake_equiv:t->t->t(** [make_equiv p q] creates the boolena formula "[p] is equivalent to [q]". *)valmake_cnf:t->atomlistlist(** [make_cnf f] returns a conjunctive normal form of [f] under the form: a
list (which is a conjunction) of lists (which are disjunctions) of
atomic formulas. *)valpp:Format.formatter->t->unit(** [print fmt f] prints the formula on the formatter [fmt].*)end