Arxiv:2101.05597V3 [Cs.CC] 24 May 2021 P = NP .[5] 2
Total Page:16
File Type:pdf, Size:1020Kb
NECESSARY AND SUFFICIENT CONDITION FOR SATISFIABILITY OF A BOOLEAN FORMULA IN CNF AND ITS IMPLICATIONS ON P VERSUS NP PROBLEM MANOJ KUMAR∗ Abstract. Boolean satisfiability problem has applications in various fields. An efficient algo- rithm to solve satisfiability problem can be used to solve many other problems efficiently. The input of satisfiability problem is a finite set of clauses. In this paper, properties of clauses have been stud- ied. A type of clauses have been defined, called fully populated clauses, which contains each variable exactly once. A relationship between two unequal fully populated clauses has been defined, called sibling clauses. It has been found that, if one fully populated clause is false, for a truth assignment, then all it's sibling clauses will be true for the same truth assignment. Which leads to the necessary and sufficient condition for satisfiability of a boolean formula, in CNF. The necessary and sufficient condition has been used to develop a novel algorithm to solve boolean satisfiability problem in poly- nomial time, which implies, P equals NP. Further, some optimisations have been provided that can be integrated with the algorithm for better performance. Key words. Boolean Satisfiability Problem, Polynomial Time, P vs NP, Non Polynomial Time AMS subject classifications. 68Q01, 68Q25, 03E75 1. Introduction. Boolean Satisfiability problem is a NP-complete problem.[5] It implies, all other NP-complete problems can be reduced to Boolean Satisfiability problem. So, if there exist an algorithm that can solve Boolean Satisfiability problem in polynomial time, then every other NP-complete problem can be solved in polyno- mial time. It has lead to formulation of P versus NP problem defined by Stephen Cook in [2]. History and importance of P versus NP problem has been discussed in detail in [2]. In August, 2020, in [1], an efficient dynamical-system approach to solve Boolean satisfiability problems have been presented. But also, in [1], it has been stated, "Although these analytical and numerical results do not settle the famous P vs. NP question, they show that appropriately designed physical systems are very useful tools for new avenues of research in constraint satisfaction problems.", which implies, non- existence of an polynomial time algorithm to solve boolean satisfiability problem, till August, 2020. In this paper, properties of clauses have been studied, novel relationships have been defined among clauses, and a necessary and sufficient condition has been estab- lished that determine satisfiability of any boolean formula in CNF, which has been used to develop a polynomial time algorithm to solve boolean satisfiability problem. Which implies, that, boolean satisfiability problem belongs to P class, which implies, arXiv:2101.05597v3 [cs.CC] 24 May 2021 P = NP .[5] 2. Boolean Satisfiability Problem. As defined in [5], For the given clauses C1;C2;C3 :::Cp, we need to find whether conjuction of the given clauses is satisfiable or not. 3. Terminology used. The terms literal, boolean variable, clause are used with same meaning as defined in [3]. A boolean formula in CNF is a conjuction of clauses. It can be represented as a finite set of clauses. [3] A set of boolean variables is called a variable set. ∗Assistant Professor in Computer Application, Government College of Teacher Education, Dharamshala, Dist. Kangra, Himachal Pradesh, India. ([email protected]) 1 4. Notations used. The notations, representing basic relations between sets have been used as defined in [4]. 4.1. Variable cases. Let a variable, X, can be assigned values x1, x2 and x3, independently, then, it is written as: 8 x <> 1 X = x2 > :x3 5. Tautology Clause. A clause, which evaluates to true for every valuation, is called a tautology clause. If a clause contains a complemented pair of literals, it is a tautology.[3] In other words, If 9x 2 T j:x 2 T , then T is a taulogy clause. 5.1. Significance of tautology clause in satisfiability problem. As a tau- tology clause always evaluates to true, that is represented by 1 in boolean algebra. Let F is a boolean formula in CNF, which containins a tautology clause, we can write (5.1) F = C1 ^ T where T is a tautology clause. =) F = C1 ^ 1 by using Identity property of Boolean algebra, (5.2) =) F = C1 Hence, The tautology clause has no effect on satisfiablity of a boolean formula, So, It can be ignored while solving satisfiability problem. 5.2. Non-Tautology Clause. A clause which is not a tautology is called a non-tautology clause. Lemma 5.1. If N is a non-tautology clause, then 8x 2 N =):x2 = N. Proof. Given that, N is not a tautology clause. Let, for the sake of contradiction, 9x 2 Nj:x 2 N =) N is a tautology clause(from definition), which is not true. So, our assumption is wrong. Hence, 8x 2 N =):x2 = N Lemma 5.2. If C is a clause, with n literals, such that, 9xi 2 C j xi = 1(true) then C = 1(true) Proof. Given that, C is a clause, by definition, C is a disjunction of literals, so, we can write, C = (x1 _ x2 _···_ xi _···_ xn) also, given that, xi = 1, so we can write, C = (x1 _ x2 _···_ 1 _···_ xn) by using dominance law of boolean algebra, =) C = 1 Hence proved. 2 Lemma 5.3. If C is a clause, with n literals, such that, C = 0(false) then xi = 08xi 2 C Proof. Given that, C is a clause, by definition, C is a disjunction of literals, so, we can write, C = (x1 _ x2 _···_ xn) also, given that, C = 0(false) Suppose, for the sake of contradiction, xi = 1 for some xi 2 C. Using Lemma 5.2, we get, C = 1 which is a contradiction, Therefore, the assumption, xi = 1 is not true, hence, (5.3) xi = 0 8xi 2 C Hence proved. Theorem 5.4. If C and D are clauses, such that, D ⊆ C and C = 0 then D = 0 Proof. Given that, D ⊆ C and (5.4) C = 0 using Lemma 5.3, (5.5) xi = 0 8xi 2 C As D ⊆ C, (5.6) 8x 2 D =) x 2 C From (5.5) and (5.6) we have, xj = 0 8xj 2 D We can write, D = (0 _ 0 _ 0 _···_ 0) (5.7) =) D = 0 Hence proved. 3 6. Clause over a variable set. A non-tautology clause, C, is called a clause over a variable set, V , if, (8x)(x 2 C or :x 2 C =) x 2 V ) For e.g. clauses, C1 = fx1; x2g and C2 = fx1; x2; x3g are clauses over variable set, V = fx1; x2; x3g 6.1. Fully Populated Clause over a variable set. A non-tautology clause, Cfull, is called a fully populated clause over a variable set, V , if (8x)(x 2 V , x 2 Cfull or :x 2 Cfull) For e.g. clause C = fx1; :x2g is a fully populated clause over variable set, V = fx1; x2g Lemma 6.1. If C is a clause over a variable set, V , then, 9Vsub ⊆ V , such that, C is a fully populated clause over Vsub. Proof. Given that, C is a clause over a variable set, V , from definition, (6.1) =) (8x)(x 2 C or :x 2 C =) x 2 V ) We define a variable set, (6.2) Vsub = fxjx 2 C or :x 2 Cg =) (8x)(x 2 Vsub , x 2 C or :x 2 C) also, from (6.1) and (6.2) 8x 2 Vsub =) x 2 V =) Vsub ⊆ V Hence, 9Vsub ⊆ V , such that, C is a fully populated clause over variable set, Vsub. Lemma 6.2. If C is a fully populated clause over a variable set, V , then 8D ⊆ C, 9Vsub ⊆ V , such that, D is a fully populated clause over variable set Vsub Proof. Given that, C is a fully populated clause over a variable set, V =) (8x)(x 2 V , x 2 C or :x 2 C) Suppose, D ⊆ C =) 8x 2 D =) x 2 C =) (8x)(x 2 D or :x 2 D =) x 2 V ) =) D is a clause over V . From Lemma 6.1, 9Vsub ⊆ V , such that, D is a fully populated clause over Vsub Hence, 8D ⊆ C, 9Vsub ⊆ V , such that, D is a fully populated clause over Vsub Theorem 6.3. For any given valuation to a variable set, V , there exist a fully populated clause, say Ck, over V , such that, Ck = 0(false) 4 Proof. Let, the variable set, V , is given by, V = fx1; x2; : : : ; xng where ( 0 xi = 8xi 2 V 1 Let, each xi has been assigned any of the values given above. Now, we define a clause, Ck, depending upon the valuation assigned above, ( :xi if xi = 1 Ck = fyjy = 8xi 2 V g xi if xi = 0 =) (8x)(x 2 V , x 2 Ck or :x 2 Ck) =) Ck is a fully populated clause. and, By putting values assigned for variables in V , in Ck, we get, xi = 0 8xi 2 Ck =) Ck = 0(false) Hence, for any given valuation to the variable set, V , there exists a fully populated clause, Ck, such that, Ck = 0(false) Theorem 6.4. For a given set of variables, V , with n variables, there exist 2n fully populated clauses. Proof. For a given set of variables, V , with n variables, we can write a fully populated clause in the general form, given by, C = fx1; x2; : : : ; xng where ( xi xi = :xi i.e. each xi can be assigned a value in two ways, independently.