Download The dnf simplification procedure

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Laws of Form wikipedia , lookup

Propositional calculus wikipedia , lookup

Rewriting wikipedia , lookup

Structure (mathematical logic) wikipedia , lookup

Quasi-set theory wikipedia , lookup

Transcript
The dnf simplification procedure
Intermediate Logic
September 13, 2011
The disjunctive normal form theorem gives rise to deep analysis of truth
functional logic. The purpose of these notes is to extend the procedure from our
constructive proof of the theorem in ways that make this analysis perspicuous.
First observe a basic property of the disjunctive normal form. Since formulas
in dnf are disjunctions, they are implied by each of their clauses. This is clear
since for a disjunction to be true it suffices that any one of its disjuncts be
true. For that reason, disjunctions are often easy to “understand”: they display
essentially a list of mutually independent ways for them to be true. Among
disjunctions, dnf formulas are especially transparent in meaning. For each of
their disjuncts is a conjunction of literals. To know the conditions under which
a dnf formula is true, then, one need only examine it. The dnf theorem thus
provides a way to paraphrase any formula whatever into one that “wears its
meaning on its sleeve.” One of the tasks of logic is the study of the logical
relationships among statements, but an equally important one is to clarify the
meanings of individual statements, and the dnf theorem is our best tool for
this latter task.
The procedure described in the constructive proof of the dnf theorem typically produces a formula longer than the original one. The result is a formula
that is simpler to understand and simpler to evaluate but syntactically more
complex. There are a number of easy ways to simplify dnf formulas in the syntactic sense, though, and in them lies the dnf theorem’s full strength. Specifically, if a dnf formula is satisfiable, then the following transformations result
in an equivalent formula:
1. if a literal and its negation appear in the same clause, drop that clause
2. if a literal occurs more than once in a clause, drop all but one of its
occurrences
3. if a clause implies the rest of the formula, drop that clause
4. drop any literal the rest of whose clause implies the entire formula
Thus the dnf formula
(¬p∧¬s)∨(¬p∧¬q)∨(¬p∧p)∨(¬s∧q∧¬s)∨(¬s∧q∧¬q)∨(¬s∧q∧p)∨(¬r∧¬p∧¬s)∨(¬p∧p∧s)
1
yields to the following simplification:
(¬p ∧ ¬s) ∨ (¬p ∧ ¬q) ∨ (¬p ∧ p) ∨ (¬s ∧ q ∧ ¬s) ∨ (¬s ∧ q ∧ ¬q) ∨ (¬s ∧ q ∧ p) ∨ (¬r ∧ ¬p ∧ ¬s) ∨ (¬p ∧ p
(¬p ∧ ¬s) ∨ (¬p ∧ ¬q) ∨ (¬s ∧ q ∧ ¬s) ∨ (¬s ∧ q ∧ p) ∨ (¬r ∧ ¬p ∧ ¬s) (rule 1)
(¬p ∧ ¬s) ∨ (¬p ∧ ¬q) ∨ (¬s ∧ q) ∨ (¬s ∧ q ∧ p) ∨ (¬r ∧ ¬p ∧ ¬s) (rule 2)
(¬p ∧ ¬s) ∨ (¬p ∧ ¬q) ∨ (¬s ∧ q) ∨ (¬r ∧ ¬p ∧ ¬s) (rule 3)
(¬p ∧ ¬q) ∨ (¬s ∧ q) ∨ (¬r ∧ ¬p ∧ ¬s) (rule 3)
(¬p ∧ ¬q) ∨ (¬s ∧ q) ∨ (¬p ∧ ¬s) (rule 4)
Let us verify that these transformation rules do in fact result in equivalent
formulas. The first transformation is just an instance of the third, for an unsatisfiable formula implies every formula and so an unsatisfiable clause certainly
implies the rest of its formula. To see that this more general transformation
is legitimate, consider that the clause that implies the rest of the formula says
nothing about what it takes for the formula to be true that the rest of the formula doesn’t already say. Equivalently, consider the column C1 of truth-values
beneath the clause and the column C2 of truth-values underneath the rest of the
formula in the formula’s truth table: In any row where there is a T in C1 there
is a T in C2 , so by the definition of disjunction the column beneath the whole
formula will be identical to C2 Another case of the third transformation rule
deserves mention because of its relative ease of implementation: If one clause
implies another, then the first can be dropped. This follows immediately since
implying a disjunct is merely a specific way to imply an entire disjunction. Notice that this special case of rule 3 applied in the progression from the third to
the fourth line in the above example.
The second and fourth transformations apply to literals rather than to
clauses, but the same ideas underlie their justifications. For the second, observe that since dnf clauses are conjunctions, repeated occurrences of a literal
in a clause do not affect the column of truth-values beneath the clause. Finally,
the legitimacy of the fourth transformation can be derived thus: Suppose l is
a literal in the clause C of dnf formula Φ and that C 0 is C with l deleted. If
C 0 implies Φ, then C 0 ∨ Φ is another dnf formula equivalent to Φ. But C 0 ∨ Φ
has among its clauses C, which clearly implies C 0 and so can be dropped by the
special case of rule 3 discussed above. The result is just Φ with l deleted from
C.
Simplification according to these transformation rules can go along way.
The result of such simplifications still is in dnf and so still enjoys perspicuity
of meaning, but in addition it will often be shorter than the formula in the
full language of ∨, ∧, ¬, ⊃, and ≡ with which one began. A question of great
practical value is whether or not these transformations suffice to get to the
simplest possible dnf equivalent of a formula. It turns out that they do not,
that if one is after the shortest possible equivalent sometimes one must expand
a formula before dropping some of its clauses so that other of its clauses can be
dropped in addition or instead. This process will be described in another note.
The precise statement made above about the transformation rules was that
they lead to equivalent formulas when applied to satisfiable dnf formulas. This
2
caveat was necessary because of an anomalous case where successive applications
of the first transformation results in the erasure of the entire formula. One is
then not left with an equivalent formula because one is not left with any formula
whatever. This only ever happens when the original formula is unsatisfiable, for
no satisfiable formula is equivalent to a single conjunction that contains a literal and its negation. Observe also that this always happens when the original
formula is unsatisfiable. To see why, observe that no unsatisfiable formula is
equivalent to a dnf formula with a satisfiable clause. For whatever interpretation satisfies such a clause also would satisfy the entire formula. Therefore, if
a formula is unsatisfiable, then any dnf equivalent of it will be a disjunction
of unsatisfiable clauses. But clauses are conjuncts and therefore unsatisfiable if,
and only if, they contain some literal and its negation. Therefore, all clauses of
any dnf equivalent of any unsatisfiable formula can be dropped by successive
applications of rule 1.
This last observation can be turned into a convenient test for validity. Since
the negation of a valid formula is unsatisfiable, one way to determine if a formula
is valid is to put its negation into dnf by the procedure from the proof of the
dnf theorem and then to apply simplification rule 1 as much as possible. If
the result is the erasure of every clause, then the original formula is valid.
This way of testing for validity is in a sense nicer than the use of truth-tables,
because it is less boring. Its advantage over the latter is not merely aesthetic,
though, and will be evident in systems that extend truth-functional logic. In
important examples of such systems, no analogue to truth-tables exist, but the
dnf simplification procedure can be extended very naturally.
3