Module Logtk.Cnf
Reduction to CNF and Simplifications
type term= TypedSTerm.ttype form= TypedSTerm.ttype type_= TypedSTerm.ttype lit= term SLiteral.t
exceptionError of stringexceptionNotCNF of form
val miniscope : ?distribute_exists:bool -> form -> formApply miniscoping transformation to the term.
- parameter distribute_exists
see whether ?X:(p(X)|q(X)) should be transformed into (?X: p(X) | ?X: q(X)). Default:
false
type options=|DistributeExistsif enabled, will distribute existential quantifiers over disjunctions. This can make skolem symbols smaller (smaller arity) but introduce more of them.
|DisableRenamingdisables formula renaming. Can re-introduce the worst-case exponential behavior of CNF.
|InitialProcessing of form -> formany processing, at the beginning, before CNF starts
|PostNNF of form -> formany processing that keeps negation at leaves, just after reduction to NNF. Its output must not break the NNF form (negation at root only).
|PostSkolem of form -> formtransformation applied just after skolemization. It must not break skolemization nor NNF (no quantifier, no non-leaf negation).
Options are used to tune the behavior of the CNF conversion.
type clause= lit listBasic clause representation, as list of literals
val clause_to_fo : ?ctx:Term.Conv.ctx -> clause -> Term.t SLiteral.t list
type f_statement= (term, term, type_) Statement.tA statement before CNF
type c_statement= (clause, term, type_) Statement.tA statement after CNF
val pp_f_statement : f_statement CCFormat.printerval pp_c_statement : c_statement CCFormat.printerval pp_fo_c_statement : (Term.t SLiteral.t list, Term.t, Type.t) Statement.t CCFormat.printerval is_clause : form -> boolval is_cnf : form -> bool
Main Interface
val cnf_of : ?opts:options list -> ?ctx:Skolem.ctx -> f_statement -> c_statement CCVector.ro_vectorTransform the statement into proper CNF; returns a list of statements, including type declarations for new Skolem symbols or formulas proxies. Options are used to tune the behavior.
val cnf_of_seq : ?opts:options list -> ?ctx:Skolem.ctx -> f_statement Sequence.t -> c_statement CCVector.ro_vectorval type_declarations : c_statement Sequence.t -> type_ Logtk.ID.Map.tCompute the types declared in the statement sequence
Conversions
val convert : c_statement Sequence.t -> Statement.clause_t CCVector.ro_vectorConverts statements based on
TypedSTerminto statements based onTermandType