The conjunctive normal form of a logical function. Disjunctive and conjunctive perfect normal forms

Plain conjunction called conjunction one or several variables, for it is each variable meet not more one times (or itself, or her negation).

For example, is a simple conjunction,

Diauncutive normal form (DNF) called disjunction simple conjunctions.

For example, the expression is the DNF.

Perfect diauncutive normal form (SDNF) called such. diauncutive normal the form, w. which in eVERY conjunction enter everything variables this list (or ourselves, or them denial), moreover in one and tom sameorder.

For example, the expression is the DNF, but not SDNF. Expression is a CDNF.

Similar definitions (with the replacement of conjunction for disjunction and vice versa) are true for the PFF and SCPF. We give accurate wording.

Plain disjunction called disjunction one or several variables, for it is each variable included not more one times (or itself, or her negation). For example, the expression is simple disjunction,

Conjunctive normal form (KNF) called conjunction simple disjunctions (for example, the expression - the PFF).

A perfect conjunctive normal form (SCPF) is called such a QFF, in which every simple disjunction includes all variables of this list (either themselves, or their denial), and in the same manner.

For example, expression is SKPF.

We present the transition algorithms from one form to another. Naturally, in specific cases (with a certain creative approach), the use of algorithms is more time consuming than simple transformations that use a specific type of this form:

a) Transition from the DNF to the KNF

The algorithm of this transition is as follows: put over the DNF two denials and with the help of the de Morgan rules (not a touching upper denial) give the DNF denial again to the DNF. At the same time, it is necessary to disclose brackets using the absorption rule (or Blake rules). The denial of the obtained DNF (again according to the rule de Morgan) immediately gives us the CNF:

Note that the CNF can be obtained from the initial expression, if you make w. for brackets;

b) transition from the KNF to the DNF

This transition is carried out by simple disclosure of the brackets (with again, the absorption rule is used)

Thus, they received the DNF.

The reverse transition (from the SDNF to the DNF) is associated with the problem of minimizing the DNF. This will be told in Section. 5, here we will show how to simplify the DNF (or SDNF) according to Blake rule. Such a DNF is called abbreviated DNF;

c) reduction of the DNF (or SDNF) rule Blake

The application of this rule consists of two parts:

If there are foundations among the disjoint terms in the DNF , then add a conception to all the disjunction TO 1 TO 2. We do this operation several times (can be sequentially, you can simultaneously) for all possible pairs of terms, and then, apply usual absorption;

If the term added already was already kept in the DNF, it can be discarded at all, for example,

or

Of course, the abbreviated DNF is not determined by the sole, but they all contain the same number of letters (for example, there is a DNF After applying to it, Blake's rules can be reached to the DNF, equivalent to this):

c) Transition from DNF to SDNF

If in some simple conjunction lacks a variable, for example, z., insert the expression into it, after which we reveal the brackets (with the recurring disjunctive terms do not write). For example:

d) transition from the KNF to SKFF

This transition is carried out in a manner similar to the previous one: if there is not enough variable in simple disjunction (for example, z., I add expression to it (this does not change the disjunction itself), after which we reveal brackets using the distribution law):

Thus, SKFF was obtained from the PFF.

Note that the minimum or abbreviated PFF is usually obtained from the corresponding DNF.

The conjunctive normal form is convenient for automatic proof by theorems. Any boolean formula can be given to the PFF. To do this, you can use: the law of double denial, de Morgana law, distribution.

Encyclopedic YouTube.

  • 1 / 5

    Formulas in the PFF:

    ¬ A ∧ (B ∨ C), (\\ DisplayStyle \\ NEG A \\ WEDGE (B \\ Vee C),) (A ∨ B) ∧ (¬ B ∨ C ∨ ¬ D) ∧ (D ∨ ¬ E), (\\ DisplayStyle (A \\ VEE B) \\ WEDGE (\\ NEG B \\ Vee C \\ Vee \\ NEG D) \\ WEDGE ( D \\ Vee \\ NEG E),) A ∧ b. (\\ DisplayStyle A \\ Wedge B.)

    Formulas not in the PFF:

    ¬ (B ∨ C), (\\ DisplayStyle \\ NEG (B \\ Vee C),) (A ∧ B) ∨ C, (\\ DisplayStyle (A \\ WEDGE B) \\ Vee C,) A ∧ (B ∨ (D ∧ E)). (\\ DisplayStyle A \\ WEDGE (B \\ Vee (D \\ Wedge E)).)

    But these 3 formulas are not equivalent to the following formulas in the PBF:

    ¬ B ∧ ¬ C, (\\ displaystyle \\ NEG B \\ Wedge \\ NEG C,) (A ∨ C) ∧ (B ∨ C), (\\ DisplayStyle (A \\ Vee C) \\ WEDGE (B \\ Vee C),) A ∧ (B ∨ D) ∧ (B ∨ E). (\\ DisplayStyle A \\ Wedge (B \\ Vee D) \\ WEDGE (B \\ Vee E).)

    Construction of the CNF.

    Algorithm for the construction of the Ukrainian PBF

    1) get rid of all logical operations contained in the formula, replacing them with the main: conjunction, disjunction, denial. This can be done using the equivalent formulas:

    A → B \u003d ¬ A ∨ B, (\\ DisplayStyle A \\ Rightarrow B \u003d \\ NEG A \\ VEE B,) A ↔ B \u003d (¬ A ∨ B) ∧ (A ∨ ¬ B). (\\ DisplayStyle A \\ Leftrightarrow B \u003d (\\ NEG A \\ VEE B) \\ Wedge (A \\ Vee \\ NEG B).)

    2) Replace the negation sign relating to the entire expression, negation signs relating to certain variable statements on the basis of formulas:

    ¬ (a ∨ b) \u003d ¬ a ∧ ¬ b, (\\ displaystyle \\ NEG (A \\ Vee B) \u003d \\ NEG A \\ WEDGE \\ NEG B,) ¬ (a ∧ b) \u003d ¬ A ∨ ¬ b. (\\ DisplayStyle \\ NEG (A \\ WEDGE B) \u003d \\ NEG A \\ Vee \\ NEG B.)

    3) get rid of dual negation signs.

    4) Apply, if necessary, to conjunction and disjunction operations of distribution properties and absorption formulas.

    An example of constructing the CNF.

    Let's give the PFF formula

    F \u003d (x → y) ∧ ((¬ y → z) → ¬ x). (\\ DisplayStyle F \u003d (X \\ Rightarrow y) \\ WEDGE ((\\ NEG Y \\ Rightarrow z) \\ Rightarrow \\ NEG X).)

    We transform formula F (\\ DisplayStyle F) to a formula that does not contain → (\\ DISPLAYSTYLE \\ RIGHTARROW):

    F \u003d (¬ x ∨ y) ∧ (¬ (¬ y → z) ∨ ¬ x) \u003d (¬ x ∨ y) ∧ (¬ (¬ ¬ y ∨ z) ∨ ¬ x). (\\ DisplayStyle F \u003d (\\ NEG X \\ VEE Y) \\ Wedge (\\ NEG (\\ NEG Y \\ Rightarrow z) \\ vee \\ neg x) \u003d (\\ NEG X \\ VEE y) \\ WEDGE (\\ NEG (\\ NEG \\ In the resulting formula, we will transferring denial to variables and reduce the double denials:

    F \u003d (¬ x ∨ y) ∧ ((¬ y ∧ ¬ z) ∨ ¬ x). (\\ DisplayStyle F \u003d (\\ NEG X \\ VEE Y) \\ Wedge (((\\ NEG Y \\ Wedge \\ NEG Z) \\ Vee \\ NEG X).)

    For example, the following formula is recorded in 2-KPF:

    (A ∨ B) ∧ (¬ B ∨ C) ∧ (B ∨ ¬ C). (\\ DisplayStyle (A \\ Lor B) \\ Land (\\ NEG B \\ LOR C) \\ Land (B \\ Lor \\ NEG C).)

    Diajunctive and conjunctive normal forms of algebra of statements.

    For each function of the logic of statements, you can draw up a truth table. The inverse task is also always solvable. We introduce several definitions.Elementary conjunctions

    (conjuncts) are called conjunctions of variables or their denials in which each variable is not more one time.

    disjunctive normal form

    (DNF) is called a formula having a type of disjunction of elementary conjunctions. Elementary disjunctions

    (disjoint) They are called disjunction of variables with or without denying. Conjunctive normal form

    (KNF) is called a formula that has the type of conjunction of elementary disjunctions. For each function, the statement algebra can find many disjunctive and conjunctive normal forms.

    Algorithm for building DNF:

    1. Go to Boolean operations using the formulas of equivalent transformations.

    {!LANG-00a8f0d6f9f2e188291654be3e33481e!}

    2. Go to formulas with close negations, that is, to the formula in which denials are not higher than above variables - to apply de Morgan laws.

    3. Disclosure brackets - apply distribution laws.

    4. Repeating components take one time - the law of idempotency.

    5. Apply the laws of absorption and semi-absorption.

    Example 6.Find the DNF formula :.

    In the Algebra of Bul Fair the principle of duality. It consists in the following.

    The function is called dual to the function, if. Those. To find a function, dual to a given one, it is necessary to build the denial of the function from the negation of the arguments.

    Example 7.Find a function, dual to.

    Among the elementary functions of the algebra of logic 1 dual 0 and vice versa, x dual, dual, dual and vice versa.

    If in the formula F 1 representing the function all conjunctions replace

    on disjunction, disjunction on conjunction, 1 to 0, 0 to 1, we obtain the Formula F *, representing the function *, dual.

    The conjunctive normal form (KNF) is a dual concept for the DNF, so it is easy to build according to the scheme:

    Example 8.Find the CNF formulas :.

    Taking advantage of the result of Example 6, we have

    Perfect disjunctive and perfect conjunctive normal forms.In each of the types of normal forms (disjunctive and conjunctitive), you can select the class of perfect forms of SDNF and SCFF.

    Perfect elementary conjunction is a logical product of all variables with or without denying or without them, and each variable enters the product only once.

    All DNF can be brought to the SDNF splitting of conjunctions that contain not all variables, i.e. Appendix for the missing variable x i multiplies with the use of the Distribution Law

    Example 9.Find SDNF for DNF Example 6

    Perfect elementary disjunction It is called the logical sum of all variables with or without dedication, and each variable is in the amount of only once.

    All KNFs can be brought to SCPF, adding a member of conjunction, which does not contain any variable x i with conjunction and applying a distributional law

    Example 10.Bring the KNF to SCPF:

    To build the SCFF, you can use the scheme

    Example 11.Find SKFF for formula of Example 6.

    Any function has a SDNF and, moreover, the only one. Each function has SCPF and, moreover, the only one.

    Because SDNF and SCFF are definitely defined by formulas, they can be built on the truth table of the formula.

    To build a SDNF, it is necessary to highlight the lines in which f takes the value 1 and record perfect elementary conjunctions for them. If the value of the variable in the desired row of the truth table is one, then in perfect conjunct it is taken without negation, if zero is denied. Then the perfect conjuncts (their number is equal to the number of units in the table) are connected by the signs of disjunction.

    To build SCFF on the truth table, it is necessary to highlight the rows in it, where F \u003d 0, and record perfect elementary disjunctions, after which it is combined by the conjunction signs. If in the desired row of the truth table (F \u003d 0) the value of the variable corresponds to zero, then in perfect disjoint it is taken without negative, if one is denial.

    Example 12.Find SDNF and SCPF on the truth table for formula of Example 6.

    Table 14 shows only the final value F \u003d 10101101. In the justice of this statement, it should be seen independently by building a detailed truth table.

    Table 14.

    X. y. Z.

    Definition 1.Conjunctive single-wing (elementary conjunction) From variables, the conjunction of these variables or their denials is called.

    for example- Elementary conjunction.

    Definition 2.Disjunctive single-sided (elementary disjunction)from variables, the disjunction of these variables or their denials is called.

    for example- ElementaryDesjunction.

    Definition 3.The formula is equivalent to this formula, the algebra of statements and is a disjunction of elementary conjunctive universions, is called disjunctive normal form (DNF) of this formula.

    For example, - DNF.

    Definition 4.The formula is equivalent to this formula of the algebra of statements and is the conjunction of elementary disjunctive homorals, is called conjunctive normal form (PFF) of this formula.

    for example- KNF.

    For each formula, the statement algebra can find many disjunctive and conjunctive normal forms.

    Algorithm for building normal forms

      With the help of equivalence, logic algebra replace all the main objectives available in the formula: conjunction, disjunction, denial:

      Get rid of dual negation signs.

      Apply, if necessary, to conjunction operations and disjunction properties of distribution and absorption formulas.

    2.6. Perfect disjunctive and perfect conjunctive normal forms

    Any Boolean feature can have many presentations in the form of DNF and the PFF. A special place among these ideas is occupied by the perfect DNF (SDNF) and the perfect CNFs (SCPF).

    Definition 1. Perfect disjunctive normal form (SDNF) is a DNF, in which each conjunctivation is unrocked with each variable from the rush exactly once, and it is either itself or its denial.

    Constructive SDNF for each formula of the statement algebra given to the DNF can be defined as follows:

    Definition 2. Perfect disjunctive normal form(SDNF) The formulas of the statement algebra are called its DNF, which has the following properties:

    Definition 3. Perfect conjunctive normal form (SKPF) is a QNF, in which each variable is unrocked with each variable, which is smoothly different, and it is either herself or its denying.

    Constructive SCFF for each formula of the statement algebra given to the PFF can be defined as follows.

    Definition 4. Perfect conjunctive normal form(SKFF) This formula of the algebra of statements is called its KNF, which satisfies the following properties.

    Theorem 1.Each Boolean feature from variables is not identically false, can be represented in the SDNF, and moreover.

    Ways to find SDNF.

    1st way

    2nd way

      we highlight the lines where the formula accepts value 1;

      we constitute a disjunction of conjunctions, provided that if the variable is in conjunction with the value 1, then write this variable if with a value of 0, then its denial. We get a SDNF.

    Theorem 2.Each Boolean feature from variables is not identically true, can be represented in SCFF, and more than one.

    Ways to find SCFF

    1st way - With the help of equivalent transformations:

    2nd way - With the help of truth tables:

      we highlight the lines, where the formula accepts the value 0;

      we compose a conjunction of disjunction provided that if the variable is in disjunction with a value of 0, then write this variable if with a value of 1, then its denial. We get SKFF.

    Example 1. Build a PFF function.

    Decision

    Let us exclude the ligament "" by the laws of transformation of variables:

    \u003d / laws de Morgan and double denial / \u003d

    / Distribution laws / \u003d

    Example 2. Bring to the DNF formula.

    Decision

    Express the logical operations ICRESS, and:

    \u003d / Rependitress denial to variables and reduce double denials / \u003d

    \u003d / Distribution law.

    Example 3. Write down the formula in the DNF and SDNF.

    Decision

    Using the laws of logic, we present this formula to the form containing only the disjunction of elementary conjunctions. The resulting formula will be the desired DNF:

    To build a SDNF to make a table of truth for this formula:

    We mark those table lines in which the formula (the last column) takes the value 1. For each such line, we repel the formula that is true on the set of variables ,, this line:

    row 1 :;

    line 3 :;

    row 5:.

    The disjunction of these three formulas will take value 1 only on sets of variables in lines 1, 3, 5, and therefore will be the desired perfect disjunctive normal form (SDNF):

    Example 4. Bring the formula to SCPF in two ways:

    a) with the help of equivalent transformations;

    b) using the truth table.

    Decision:

    We transform the second elementary disjunction:

    The formula has the form:

    b) make a table of truth for this formula:

    We mark the table lines in which the formula (the last column) takes the value of 0. For each such line, we repel the formula that is true on the set of variables ,, of this string:

    line 2 :;

    row 6:.

    The conjunction of these two formulas will take value 0 only on sets of variables in lines 2 and 6, and therefore, it will be the desired perfect conjunctive normal form (SKFF):

    Questions and tasks for self-decisions

    1. With the help of equivalent transformations, bring the formula to the DNF:

    2. With the help of equivalent transformations, bring the formula to the PFF:

    3. With the help of a second distribution law, convert the DNF in the PFF:

    but) ;

    4. Convert the DNF specified in SDNF:

    5. Convert the specified CNFs in SKFF:

    6. For given logical formulas, build a SDNF and SCPF in two ways: using equivalent transformations and using the truth table.

    b) ;

    Simple disjunction (eng. inclusive disjunction) or dysyunkt (Eng. Disjunct) is called a disjunction of one or more variables or their denials, and each variable is not more than once.

    Simple disjunction

    • fullif each variable (or denying it) is in exactly once;
    • monotonnaif it does not contain the denying variables.

    Conjunctive Normal Form, CNF (English. Conjunctive Normal Form, CNF) The normal form in which Boolean feature has the type of conjunction of several simple disjuncts.

    An example of the KNF: $ F (x, y) \u003d (X \\ LOR Y) \\ Land (Y \\ Lor \\ NEG (Z)) $

    SKFF

    Perfect conjunctive normal form, SKFF (Eng. Perfect Conjunctive Normal Form, PCNF) is such a PFF that satisfies the conditions:

    • it has no identical simple disjunction
    • each simple disjuncture complete

    SCPF example: $ f (x, y, z) \u003d (X \\ LOR \\ NEG (Y) \\ Lor z) \\ Land (x \\ Lor Y \\ Lor \\ NEG (z)) $

    Theorem: For any boolean function $ F (\\ vec (x)) $, not equal to the identical unit, there is a SCFF, which is specifying.

    Evidence: Since the inversion of the function $ \\ NEG (F) (\\ VEC x) $ is equal to one on those sets on which $ F (\\ VEC x) $ is zero, then the SDNF for $ \\ NEG (F) (\\ VEC x) $ Record as follows:

    $ \\ NEG (F) (\\ VEC x) \u003d \\ Bigvee \\ Limits_ (f (x ^ (\\ sigma_ (1)), x ^ (\\ sigma_ (2)), ..., x ^ (\\ sigma_ (n ))) \u003d 0) (x_ (1) ^ (\\ sigma_ (1)) \\ wedge x_ (2) ^ (\\ sigma_ (2)) \\ WEDGE ... \\ WEDGE X_ (n) ^ (\\ Sigma_ (N ))) $, where $ \\ sigma_ (i) $ denotes the presence or absence of negation at $ x_ (i) $

    Find the inversion of the left and right part of the expression:

    $ F (\\ VEC x) \u003d \\ NEG ((\\ BigVee \\ Limits_ (F (x ^ (\\ sigma_ (1)), x ^ (\\ sigma_ (2)), ..., x ^ (\\ sigma_ (n ))) \u003d 0) (x_ (1) ^ (\\ sigma_ (1)) \\ wedge x_ (2) ^ (\\ sigma_ (2)) \\ WEDGE ... \\ WEDGE X_ (n) ^ (\\ Sigma_ (n ))))) $

    Using twice to the expression obtained in the right part, the de Morgan rule, we obtain: $ F (\\ VEC x) \u003d \\ BigWedge \\ Limits_ (F (x ^ (\\ Sigma_1), x ^ (\\ Sigma_2), \\ Dots, x ^ (\\ Last expression and is SKPF. Since SCFF is obtained from a SDNF, which can be constructed for any function that is not equal to the identical zero, the theorem is proved.

    Algorithm for constructing SCFF on the truth table

    In the truth table, we note those sets of variables on which the function value is $ 0 $.

    • For each marked set, write to the disjunction of all variables according to the following rule: if the value of a certain variable is $ 0 $, then in the disjunction we turn on the variable itself, otherwise it is denied.
    • All obtained disjunctions are associated with conjunction operations.
    • An example of building SCFF for median

    one). In the truth table, we note those sets of variables on which the function value is $ 0 $.

    X.

    y. $ \\ Langle X, Y, Z \\ Rangle $ z. 2). For each recorded set, recording the conjunction of all variables by the following rule: if the value of a certain variable is $ 0 $, then in disjunction we turn on the variable itself, otherwise it is denied.
    0 0 0 0
    0 0 1 0
    0 1 0 0
    0 1 1 1
    1 0 0 0
    1 0 1 1
    1 1 0 1
    1 1 1 1

    $ (X \\ Lor Y \\ Lor Z) $

    y. $ \\ Langle X, Y, Z \\ Rangle $ z. 2). For each recorded set, recording the conjunction of all variables by the following rule: if the value of a certain variable is $ 0 $, then in disjunction we turn on the variable itself, otherwise it is denied.
    0 0 0 0 $ (X \\ Lor Y \\ Lor \\ NEG (Z)) $
    0 0 1 0 $ (X \\ Lor \\ NEG (Y) \\ Lor Z) $
    0 1 0 0 $ (\\ NEG (X) \\ Lor Y \\ Lor z) $
    0 1 1 1
    1 0 0 0 3). All obtained disjunctions are associated with conjunction operations.
    1 0 1 1
    1 1 0 1
    1 1 1 1

    $ \\ Langle X, Y, Z \\ Rangle \u003d (X \\ Lor Y \\ Lor z) \\ Land (\\ NEG (X) \\ LOR Y \\ LOR Z) \\ Land (X \\ Lor \\ NEG (Y) \\ Lor Z) \\ Land (X \\ Lor Y \\ Lor \\ NEG (Z)) $

    Examples of SCPF for some functions

    {!LANG-3a7557f24522228bd8a642f999b91bd8!}

    Pierce arrow: $ x \\ downarrow y \u003d (\\ NEG (X) \\ LOR (Y)) \\ Land ((x) \\ Lor \\ NEG (Y)) \\ Land (\\ NEG (X) \\ LOR \\ NEG (Y) ) $

    Excluding or: $ X \\ Oplus Y \\ Oplus Z \u003d (\\ NEG (X) \\ LOR \\ NEG (Y) \\ LOR Z) \\ Land (\\ NEG (X) \\ Lor Y \\ Lor \\ NEG (Z)) \\ Land (X \\ LOR \\ NEG (Y) \\ LOR \\ NEG (Z)) \\ Land (X \\ Lor Y \\ Lor Z) $