Definitional Conjunctive Normal Form.
Function or value | Description |
Full Usage:
defstep op (p, q) (fm, defs, n)
Parameters:
formula<prop> -> formula<prop> -> formula<prop>
-
The binary formula constructor received from maincnf.
p : formula<prop>
-
The left-hand sub-formula.
q : formula<prop>
-
The right-hand sub-formula.
fm : formula<prop>
-
The formula to be transformed.
defs : func<formula<prop>, (formula<prop> * formula<prop>)>
-
The definitions made so far.
n : bigint
-
The current variable index.
Returns: formula<prop> * func<formula<prop>, (formula<prop> * formula<prop>)> * bigint
The triple with the transformed formula, the augmented definitions
and a new variable index.
|
|
Full Usage:
maincnf (fm, defs, n)
Parameters:
formula<prop>
-
The formula to be transformed (supposed to be already in Prop.nenf).
defs : func<formula<prop>, (formula<prop> * formula<prop>)>
-
The definitions made so far.
n : bigint
-
The current variable index.
Returns: formula<prop> * func<formula<prop>, (formula<prop> * formula<prop>)> * bigint
The triple with the transformed formula, the augmented definitions
and a new variable index.
|
Example
val fm: obj
val defs: obj
val counter: obj
Evaluates to:
|
Example
Evaluates to
|
Function or value | Description |
|
Example
Evaluates to `(p \/ p_1) /\ p_1 /\ (p_1 \/ ~q) /\ (q \/ ~p \/ ~p_1)` .
|
Full Usage:
max_varindex pfx s n
Parameters:
string
-
The prefix to be checked.
s : string
-
The input variable name.
n : bigint
-
The value to compare.
Returns: bigint
If s is of the form pfx_m returns the larger between
m and n ; otherwise n .
|
Example
|
Full Usage:
mk_defcnf fn fm
Parameters:
formula<prop> * func<'a, 'b> * bigint -> formula<'c> * func<'d, ('e * formula<'c>)> * 'f
-
The specific definitional CNF procedure.
fm : formula<prop>
-
The input formula.
Returns: formula<'c> list list
The CNF result of fn in a set-of-sets representation.
|
Transforms a generic propositional formula
Example
Evaluates to [[`p`; `p_1`]; [`p_1`]; [`p_1`; `~q`]; [`q`; `~p`; `~p_1`]] .
|
Function or value | Description |
Full Usage:
andcnf (fm, defs, n)
Parameters:
formula<prop>
-
The formula to be transformed.
defs : func<formula<prop>, (formula<prop> * formula<prop>)>
-
The definitions made so far.
n : bigint
-
The current variable index.
Returns: formula<prop> * func<formula<prop>, (formula<prop> * formula<prop>)> * bigint
The triple with the transformed formula, the augmented definitions
and a new variable index.
|
|
It returns an equisatisfiable CNF of the input formula avoiding some redundant definitions. The optimization is obtained, when dealing with an iterated conjunction, by
Example
Evaluates to `(p \/ p_1) /\ (p_1 \/ r \/ ~q) /\ (q \/ ~p_1) /\ s /\ (~p_1 \/ ~r)` .
|
|
|
It returns an equisatisfiable CNF of the input formula in a set-of-sets representation avoiding some redundant definitions.
Example
Evaluates to [[`p`; `p_1`]; [`p_1`; `r`; `~q`]; [`q`; `~p_1`]; [`s`]; [`~p_1`; `~r`]] .
|
Full Usage:
orcnf (fm, defs, n)
Parameters:
formula<prop>
-
The formula to be transformed.
defs : func<formula<prop>, (formula<prop> * formula<prop>)>
-
The definitions made so far.
n : bigint
-
The current variable index.
Returns: formula<prop> * func<formula<prop>, (formula<prop> * formula<prop>)> * bigint
The triple with the transformed formula, the augmented definitions
and a new variable index.
|
|
Full Usage:
subcnf sfn op (p, q) (fm, defs, n)
Parameters:
'a * 'b * 'c -> 'd * 'b * 'c
-
The specific definitional CNF procedure.
op : 'd -> 'd -> 'e
-
The binary formula constructor received from sfn .
p : 'a
-
The left-hand sub-formula.
q : 'a
-
The right-hand sub-formula.
fm : 'f
-
The formula to be transformed.
defs : 'b
-
The definitions made so far.
n : 'c
-
The current variable index.
Returns: 'e * 'b * 'c
The triple with the transformed formula, the augmented definitions
and a new variable index.
|
|
Function or value | Description |
Full Usage:
andcnf3 (fm, defs, n)
Parameters:
formula<prop>
-
The formula to be transformed.
defs : func<formula<prop>, (formula<prop> * formula<prop>)>
-
The definitions made so far.
n : bigint
-
The current variable index.
Returns: formula<prop> * func<formula<prop>, (formula<prop> * formula<prop>)> * bigint
|
It keeps the optimization of putting the conjuncts in CNF separately, but removes the second optimization of leaving unchanged conjuncts that are already a disjunction of literals. In this way guarantees that the result is in 3-CNF. |
|
3-CNF means that each conjunct contains a disjunction of **at most** three literals. Example
Evaluates to `(a \/ p_2 \/ ~p_3) /\ (b \/ p_1 \/ ~p_2) /\ (c \/ d \/ ~p_1) /\ (p_1 \/ ~c) /\ (p_1 \/ ~d) /\ (p_2 \/ ~b) /\ (p_2 \/ ~p_1) /\ p_3 /\ (p_3 \/ ~a) /\ (p_3 \/ ~p_2) /\ s` .
|