What Is Cnf Form

In first-order logic, the conjunctive normal form can be pushed further to obtain the clausreal normal form of a logical formula, which can then be used to perform first-order resolution. In the automated verification of theorems based on solving, there is a CNF formula An important set of problems in computational complexity is to find associations with the variables of a Boolean formula expressed in conjunctive normal form so that the formula is true. 3-SAT is the problem of finding a satisfactory assignment to a Boolean formula expressed in CNF, so that each disjunction contains a maximum of 3 variables. This turned out to be NP-complete. However, the corresponding 2-SAT problem can be solved in linear time. CNF is a data directory that contains sample files saved in the DIMACS CNF file format. This format is used to define a Boolean expression written in conjunctive normal form and can be used as an example of the fidelity problem. Typical problems in this case concern formulas in “3CNF”: conjunctive normal form with no more than three variables per conjunction. Examples of such formulas that occur in practice can be very important, for example with 100,000 variables and 1,000,000 conjunctions. Informally, the skolem function g ( x ) {displaystyle g(x)} can be thought of as giving to the person who likes x {displaystyle x}, while f ( x ) {displaystyle f(x)} gives the animal (if any) that does not like x {displaystyle x}. The last 3rd line below is then like ” x {displaystyle x} does not like the animal f ( x ) {displaystyle f(x)}, or x {displaystyle x} is liked by g ( x ) {displaystyle g(x)}”. There are transformations in CNF that avoid exponential magnification by maintaining satisfaction rather than equivalence. [3] [4] These transformations are guaranteed to increase the size of the formula only linearly, but introduce new variables.

For example, the above formula can be converted to CNF using the variables Z 1, . , Z n {displaystyle Z_{1},ldots ,Z_{n}} are added as follows: The conjunctive normal form (CNF) is a conjunction of literal disjunctions. Each formula has an equivalent in CNF. If possible, spread a disjunction over conjunctions. The cnf_distribute/2 procedure carries out such a rewrite. The cnf_distribute_loop/2 procedure gives us as many paraphrases as possible. Converting a formula to CNF involves the use of logical equivalences such as the negative double distribution, De Morgan`s laws, and distributive law. Note that all logical formulas can be converted to conjunctive normal form by repeated application of the distributive law of disjunction on conjunction, so with proofs for formulas or for the structure of formulas, it is often convenient to assume that everything is in CNF. However, in some cases, conversion to CNF can lead to an exponential explosion of the formula. For example, logical formulas of the following form in the CNF form have 2n terms: There are different methods to convert any formula to CNF.

The following is one of the simplest. This is essentially the method shown in Doets. It consists of three steps: The three formulas above each correspond to the following three formulas, which are in conjunctive normal form: This formula contains 2 n {displaystyle 2^{n}} clauses; Each clause contains X i {displaystyle X_{i}} or Y i {displaystyle Y_{i}} for each i {displaystyle i}. For the sake of clarity, the disjunctive clauses are written in parentheses above. In the disjunctive normal form with sets of subjunctives in parentheses, the last case is the same, but the penultimate case is ( A ) ∨ ( B ) {displaystyle (A)lor (B)}. The constants true and false are identified by the empty conjunction and a clause consisting of the empty disjunction, but are usually written explicitly. [1] The following prolog code in this section implements the algorithm specified above. First, we set a set of operators that we need to represent the formulas of the proposition logic.

:-op(200, fy, ~). % negation:-op(0, yfx, (/)). :-op(400, xfy, (/)). % of conjunction (no ISO associativity, which is yfx): -op(0, yfx, (/)). :-op(500, xfy, (/)). % Disjunction (no ISO associativity, which is yfx):-op(600, xfy, =>). % Involvement:-op (700, xfy, ). % equivalence The conjunctive normal form (CNF) is an approach to Boolean logic that expresses formulas as conjunctions of sentences with an ET or AN OR. Any clause connected by a conjunction or AND must be literal or contain a disjunction or an OR operator. CNF is useful for automated theorem verification.

A formula in CNF can be converted into an equipifiable formula in “kCNF” (for k≥3) by having each conjunction of more than k variable X 1 ∨ ⋯ ∨ X k ∨ ⋯ ∨ X n {displaystyle X_{1}vee cdots vee vee X_{k}vee cdots vee vee vee X_{n}} by two conjunctions X 1 ∨ ⋯ ∨ X k − 1 ∨ Z {displaystyle X_{1}vee cdots vee X_{k-1}vee Z} and ¬ Z is replaced. ∨ X k ⋯ ∨ X n {displaystyle neg Zvee X_{k}cdots vee X_{n}} with Z of a new variable and repeat as often as necessary. Here is the CNF file that corresponds to the simple formula described above: Literals are seen in CNF as conjunctions of literal clauses and conjunctions that happen to have a single clause. It is possible to convert written instructions into CNF in another form, for example, .B. in disjunctive normal form. In Boolean logic, the conjunctive normal form (CNF) is a method of normalizing and normalizing logical formulas. As a normal form, it is useful in the automated verification of theorems. It is similar to the canonical sum of products used in circuit theory. A logical formula is considered to be in CNF only if it is a single conjunction of one or more disjunctions of one or more literals. Thus, all simple conjunctions are in CNF, but also all simple disjunctions are degenerated into CNF because they are a conjunction of a single clause.

As in the disjunctive normal form, the only proposition operators in CNF are and, or, and not. The not operator can only be used as part of a literal, which means that it can only be preceded by a statement variable. For example, all of the following formulas are included in CNF: An alternative translation, the Tseitin transformation, also contains the clauses Z i ∨ ¬ X i ∨ ¬ Y i {displaystyle Z_{i}vee neg X_{i}vee neg Y_{i}}. . . . .