Boolean Satisfiability Decision Method Based on Linear Programming

By converting the Boolean propositional logical formula into 1-in-3-SAT problem and converting it into a linear programming problem, the problem in the prior art that it is difficult to determine the satisfactoryness of the Boolean propositional logical formula in polynomial time is solved, and fast and accurate judgment efficiency is achieved.

CN114091392BActive Publication Date: 2025-06-24CHONGQING INST OF GREEN & INTELLIGENT TECH CHINESE ACAD OF SCI +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111391168.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-19
Publication Date
2025-06-24
Estimated Expiration
2041-11-19

AI Technical Summary

Technical Problem

The prior art is difficult to quickly and accurately determine the satisfactoryness of the logical formula of varied element Boolean propositions within the polynomial time complexity, especially when dealing with complex problems of large scale.

Method used

By converting the Boolean propositional logical formula into an equally satisfyable 1-in-3-SAT problem and equivalently converting it into the optimal value size problem of linear programming, linear programming solutions are used to determine satisfactoriness.

Benefits of technology

It realizes the satisfactory ability of quickly determining the Boolean propositional logical formula within the polynomial time complexity, improves the judgment efficiency and saves energy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114091392B_ABST
    Figure CN114091392B_ABST
Patent Text Reader

Abstract

The present invention is a method for determining Boolean satisfiability based on linear programming, belonging to the field of logic circuits, and includes the following steps: S1: Extract a Boolean propositional logic formula; S2: Convert it into an equisatisfiable CNF Boolean logic formula; S3: Convert it into a 3-SAT problem in CNF form; S4: Convert it into a 1-in-3-SAT problem; S5: Equivalently convert it into an optimal value size problem of a linear programming; S6: Set the solution accuracy for the problem of solving the optimal value of the linear programming; S7: Solve the optimal value of the linear programming problem and determine the satisfiability of the Boolean propositional logic formula according to the size of the optimal value; S8: For the satisfiable Boolean propositional logic formula, recursively add constraints to the linear programming problem and solve it to obtain a solution to the satisfiable problem. The present invention realizes fast determination under polynomial time complexity, can improve the efficiency of determination, and save energy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a method for determining Boolean satisfiability based on linear programming, belonging to the field of logic circuits, and particularly relates to the determination of Boolean satisfiability based on linear programming. Background Art

[0002] In computer science and engineering, the problem of determining whether a given problem has a solution is often encountered. Usually, when there is a solution, an answer to the problem needs to be given. Such problems can be efficiently (polynomially) reduced to the problem of determining the satisfiability of Boolean propositional logic formulas. Therefore, if the satisfiability of Boolean propositional logic formulas can be determined quickly, relevant computer decision-making problems can be solved efficiently. However, the problem of determining the satisfiability of Boolean propositional logic formulas has been proven to be an NP-complete problem in theory. So far, there is no algorithm with polynomial time complexity that can determine the satisfiability of Boolean propositional logic formulas.

[0003] The traditional methods for determining the satisfiability of Boolean propositional logic formulas are divided into two major categories. One major category of methods is based on the DPLL technique, either using different heuristic search strategies and conflict-driven optimization to accelerate the determination speed, or using random algorithms to obtain a relatively high average determination speed. The other major category of methods is based on non-linear optimization, which transforms the satisfiability problem into a non-linear optimization problem and approximates the satisfiability by solving its optimal value.

[0004] These two major categories of methods each have their own advantages and disadvantages: The method based on the DPLL technique is a most classic search technique. Theoretically, the complete DPLL method can always determine whether a given Boolean propositional logic formula is satisfiable; however, its worst-case computational complexity is exponential, which makes it difficult to solve large-scale complex problems. The local DPLL method may have advantages in solving the solutions of large-scale satisfiable formulas. However, if the formula itself is unsatisfiable and has a large minimum unsatisfiable core, this method usually cannot give effective results. The method based on optimization once had an obvious advantage in efficiency. However, since the corresponding optimization problem is not convex, it is very likely to obtain a local optimal value. The results in this case are unreliable, and this type of method has gradually fallen into disuse.

[0005] However, in many fields, such as artificial intelligence, robotics, automated reasoning, logic programming, graph matching, network structure comparison, computer-aided manufacturing, computer graphics, computer system architecture design, electronic design automation, database systems, and scheduling optimization, etc., similar logical decision-making problems are inevitably encountered, as shown in reference [1].

[0006] In summary, fast and accurate logical decision-making technology has important scientific significance and practical value.

[0007] [1] Gi-Joon Nam, Sakallah, K.A., Rutenbar, R.A. (2002). A new FPGA detailed routing approach via search-based Boolean satisfiability[J]. IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems. 21(6): 674.

[0008] [2] Arora S, Barak B. Computational Complexity: A Modern Approach[B]. Beijing Book Publishing Company, Beijing Company, 2012.

[0009] [3] Schaefer, Thomas J. (1978). "The complexity of satisfiability problems"[C]. Proceedings of the 10th Annual ACM Symposium on Theory of Computing. San Diego, California. pp. 216 - 226. Summary of the Invention

[0010] In view of this, the present invention provides a method for determining Boolean satisfiability based on linear programming, which is used to solve the problem of the determination efficiency of the satisfiability of multi-variable and unstructured Boolean propositional logic formulas.

[0011] To achieve the above object, the present invention provides the following technical solutions:

[0012] A method for determining Boolean satisfiability based on linear programming, characterized by including the following steps:

[0013] S1: Analyze the actual engineering problem and extract the Boolean propositional logic formula;

[0014] S2: Convert the Boolean propositional logic formula into an equi-satisfiable CNF Boolean logic formula through the Conjunctive Normal Form; the specific process can refer to reference [2];

[0015] S3: Convert the CNF Boolean logic formula into an equisatisfiable form with each clause having exactly 3 literals, thus transforming the satisfiability problem (SAT) of the CNF Boolean logic formula into a 3-SAT problem in an equisatisfiable 3-CNF form. The specific process can be found in reference [2].

[0016] S4: Variant the 3-SAT problem in 3-CNF form according to the Schaefer structure, and convert it into an equisatisfiable 1-in-3-SAT problem. The specific process can be found in reference [3].

[0017] S5: Equivalently transform the 1-in-3-SAT problem into an optimal value size problem of a linear programming.

[0018] S6: Set the solution precision for the optimal value solving problem of the linear programming.

[0019] S7: Solve the optimal value of the linear programming problem, and determine the satisfiability of the Boolean propositional logic formula according to the size of the optimal value.

[0020] S8: For a satisfiable Boolean propositional logic formula, recursively add constraints to the linear programming problem and solve it to obtain a satisfiable assignment for the satisfiable problem.

[0021] Furthermore, the Boolean propositional logic formula consists of n Boolean variables X = (x1, x2,..., x n ), operators AND (connection, denoted by ∧), OR (separation, denoted by ∨), NOT (negation, denoted by ), and parentheses; the expression of the 1-in-3-SAT is in the form: S = ∧ i≤k (∨ j≤3 L i,j (X, U)), where k is the number of clauses in the expression of the 1-in-3-SAT, L i,j (X, U) is the j-th literal in the i-th clause, and U is the Boolean variable newly introduced for the construction of the Schaefer structure variant; when the number of clauses of the 3-SAT in 3-CNF form is m, the number of U is 6m, and the number of k is 5m; for any Boolean variable x i ∈X, if the negated literal appears in the expression of the 1-in-3-SAT then a new Boolean variable y i ∈Y needs to be introduced for replacement, and a clause connected by AND (x i ∧y i ) is added after the original 1-in-3-SAT expression, and k = k + 1, obtaining an expression of 1-in-3-SAT without negated literals S = ∧ i≤k (∨ j≤3L i,j (X, Y, U)).

[0022] Furthermore, the equivalent transformation process described in step S5 is specifically as follows:

[0023] S501: According to the satisfiability of the 1-in-3-SAT problem, it can be known that: a necessary and sufficient condition for S to be 1-in-3-SAT satisfiable is the following linear equation

[0024]

[0025] has a 0|1 solution;

[0026] S502: Rewrite the linear equation in step S501 into the form of A·V = I, where A is a k×t coefficient matrix with elements 0 or 1, V = [X, U, Y] T is a t-dimensional column vector, and I is a k-dimensional column vector with all elements being 1, where t is the total number of Boolean variables (X, Y, U);

[0027] S503: Let the t×t-dimensional matrix C = A T ·A, let c be the column vector composed of the diagonal elements of matrix C, randomly generate a matrix of undetermined variables Z = (Z i,j ) 1≤i≤t,1≤j≤t , let z be the column vector composed of the diagonal elements of matrix Z, then the equivalent condition for the linear equation in step S501 to have a 0|1 solution is that the optimal value of the linear programming problem is greater than 0:

[0028] Objective function: max c T ·z

[0029] Constraints:

[0030] where * represents the tensor product, and Z 0,0 is an undetermined variable.

[0031] Furthermore, the solution accuracy set in step S6 is: First, set the solution optimal value accuracy to where ε is a positive number artificially selected to be much smaller than k; then select a sufficiently small feasible solution accuracy δ.

[0032] Preferably, ε is taken as 0.1 and δ is taken as 0.001.

[0033] Furthermore, the determination of the satisfiability of the Boolean propositional logic formula according to the size of the optimal value in step S7 is specifically as follows:

[0034] S701: When the maximum value of the objective function obtained by the solution is less than then directly return the result - the Boolean propositional logic formula is unsatisfiable, and end;

[0035] S702: When the maximum value of the objective function obtained by solving is greater than then return the result - the Boolean propositional logic formula is satisfiable, and continue to execute step S8.

[0036] Further, the specific steps of step S8 are as follows:

[0037] S801: Set a sufficiently small positive number ρ;

[0038] S802: From the diagonal elements of the feasible solution Z @ select the diagonal element that is greater than ρ and the smallest, where i ≤ s ≤ t; @ s,s

[0039] S803: Add Z s,s = 1 as a constraint to the constraint conditions, and re-solve the linear programming problem. At the same time, let i = i + 1;

[0040] S804: Starting from i = 1, repeat the iteration of steps S802 to S803 until i = t;

[0041] S805: The diagonal elements of the feasible solution Z @ after the iteration is completed form a vector, and round it to the nearest integer, then this vector is a solution to the satisfiability problem.

[0042] Preferably, ρ is taken as 0.01.

[0043] The beneficial effects of the present invention are as follows: The present invention provides a method for determining Boolean satisfiability based on linear programming. By using the connection between the Schaefer - SAT problem and linear programming, the satisfiability problem of Boolean propositional logic formulas is transformed into an extreme value solving problem of linear programming, achieving fast determination under polynomial time complexity, improving efficiency and saving energy. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to illustrate the objectives and technical solutions of the present invention, the following drawings are provided for description:

[0045] Figure 1 is a flowchart of the method of the present invention;

[0046] Figure 2 is a schematic diagram of a Boolean logic circuit according to an embodiment of the present invention, where X = (X1, X2, X3, X4) is the input. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0047] ​Example: In electronic automatic design, a circuit loop is often described by an equivalent Boolean propositional logic formula, and then the logic circuit is tested by checking the satisfiability of the Boolean propositional logic formula.

[0048] In this example, assuming that it is necessary to determine the satisfiability problem of a logic circuit, we propose a "Boolean satisfiability determination method based on linear programming".

[0049] Next, the preferred examples of the present invention will be described in detail with reference to the accompanying drawings.

[0050] As Figure 1 shown, the steps of the present invention are as follows:

[0051] S1: Combine Figure 2 , analyze the satisfiability of the logic circuit, and extract the Boolean propositional logic formula as:

[0052] The described Boolean propositional logic formula consists of 4 Boolean variables X = (X1, X2, X3, X4), operators AND (connection, represented by ∧), OR (separation, represented by ∨), NOT (negation, represented by ) and parentheses.

[0053] S2: Through the conjunctive normal form (CNF), convert the Boolean propositional logic formula into an equisatisfiable CNF Boolean logic formula:

[0054] S3: Perform an equisatisfiable transformation on the CNF Boolean logic formula so that the number of literals in each clause is fixed at 3, and transform the satisfiability problem (SAT) of the CNF Boolean logic formula into a 3-SAT problem in 3-CNF form; written in 3-CNF form as:

[0055] S4: Variant the 3-SAT problem in 3-CNF form according to the Schaefer structure and transform it into a 1-in-3-SAT problem.

[0056] The obtained 1-in-3-SAT formula is:

[0057] If the negation form of the Boolean variable X appears, it is necessary to introduce a new Boolean variable Y for substitution, and add the same number of sentences AND connected with a (X ∨ Y) after the original Boolean logic formula to obtain a formula without negation The formula S = ∧ j≤K ∨ j≤3 L i,j (X, Y, U).

[0058] Therefore, the 1-in-3-SAT formula is further rewritten as: (Y1 ∨ U1 ∨ U2) ∧ (X2 ∨ U2 ∨ U3) ∧ (X4 ∨ U4) ∧ (U1 ∨ U3 ∨ U5) ∧ (U2 ∨ U4 ∨ U6) ∧ (X2 ∨ U7 ∨ U8) ∧ (X3 ∨ U8 ∨ U9) ∧ (X5 ∨ U 10 ) ∧ (U7 ∨ U9 ∨ U 11 ) ∧ (U8 ∨ U 10 ∨ U 12 ) ∧ (X2 ∨ U 13 ∨ U 14 ) ∧ (X3 ∨ U 14 ∨ U 15 ) ∧ (Y5 ∨ U 16 ) ∧ (U 13 ∨ U 15 ∨ U 17 ) ∧ (U 14 ∨ U 16 ∨ U 18 ) ∧ (Y1 ∨ X1) ∧ (Y5 ∨ X5).

[0059] Among them, k = 17 is the number of sentences in this expression, L i,j (X, Y, U) is the j-th literal in the i-th sentence, U = (U1,..., U 18 ) is the newly introduced Boolean variable; at this time, the number of sentences of 3-SAT in CNF form is 3, the number of U is 18, the number of Y is 2, and the total number of Boolean variables is 25.

[0060] S5: Equivalently transform the 1-in-3-SAT problem into an optimal value size problem of a linear programming.

[0061] S501: Establish a system of linear equations according to the satisfiability of the 1-in-3-SAT problem.

[0062] S502: Rewrite the linear equation in step S501 into the form of A·V = I, where A is a 17×25 coefficient matrix with elements being 0 or 1, V = [X, Y, U] T is a 25-dimensional column vector, and I is a 17-dimensional column vector with all elements being 1;

[0063]

[0064] S503: Let the 25×25 matrix C = A T ·A, let c be the column vector composed of the diagonal elements of the matrix C, and randomly generate a matrix of undetermined variables Z = (Z i,j) 1≤i≤25,1≤j≤25 Let \(z\) be the column vector composed of the diagonal elements of matrix \(Z\). Then the equivalent linear programming problem of the linear equation in step S501 is as follows:

[0065] Objective function: \(\max c\ T \cdot z

[0066] Constraints:

[0067] where, \(\otimes\) represents the tensor product, and \(Z 0,0 is a variable to be determined.

[0068] S6: Set the solution accuracy for solving the optimal value problem of the linear programming.

[0069] First, set the solution accuracy of the optimal value as Then select a sufficiently small feasible solution accuracy \(\delta\) and take 0.001.

[0070] S7: Solve the optimal value of the linear programming problem, and determine the satisfiability of the Boolean propositional logic formula according to the size of the optimal value.

[0071] If the maximum value of the objective function obtained by the solution is 17, then return the result - the Boolean propositional logic formula is satisfiable, and continue to execute step S8.

[0072] S8: For \(A\cdot V = I\), recursively add constraints to the linear programming problem and solve it to obtain a \(0|1\) solution \((0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0)\) of \(A\cdot V = I\), and this point also corresponds to a satisfiable assignment of the circuit logic.

[0073] Finally, it should be noted that the above preferred embodiments are only used to illustrate the technical solutions of the present invention rather than to limit them. Although the present invention has been described in detail through the above preferred embodiments, those skilled in the art should understand that various changes can be made in form and details without departing from the scope defined by the claims of the present invention.

Claims

1. A method for determining the satisfiability of a Boolean logic circuit based on linear programming, characterized in that, The method comprises the following steps: S1: Analyze the logical circuit problem in the actual project, and extract the Boolean propositional logic formula of the Boolean logic circuit; S2: Convert the Boolean propositional logic formula of the Boolean logic circuit into an equisatisfiable CNF Boolean logic formula through conjunctive normal form; S3: Perform an equisatisfiable transformation on the CNF Boolean logic formula with the number of literals in each clause fixed at 3, and transform the satisfiability problem SAT of the CNF Boolean logic formula into a 3-SAT problem in 3-CNF form; S4: Variant the 3-SAT problem in CNF form according to the Schaefer structure and transform it into a 1-in-3-SAT problem; S5: Equivalently transform the 1-in-3-SAT problem into an optimal value size problem of a linear programming; S6: Set the solution accuracy for solving the optimal value problem of the linear programming; S7: Solve the optimal value of the linear programming problem, and determine the satisfiability of the Boolean propositional logic formula according to the size of the optimal value; S8: For the satisfiable Boolean propositional logic formula, recursively add constraints to the linear programming problem and solve it to obtain the solution of the satisfiability problem of the Boolean logic circuit, which is used to determine whether there is a satisfiability problem in the Boolean logic circuit; The specific equivalent transformation process described in step S5 is as follows: S501: According to the satisfiability of the 1-in-3-SAT problem, it can be known that: S is a necessary and sufficient condition for 1-in-3-SAT to be satisfiable is the following linear equation There is a 0|1 solution; S502: Rewrite the linear equation in step S501 into the form of A·V = I, where A is a k×t coefficient matrix with elements being 0 or 1, V = [X, U, Y] T is a t-dimensional column vector, and I is a k-dimensional column vector with all elements being 1, where t is the total number of Boolean variables (X, Y, U); S503: Let the t×t dimensional matrix C = A T ·A, and let c be the column vector composed of the diagonal elements of matrix C. Randomly generate a matrix of undetermined variables Z = (Z i,j ). 1≤i≤t,1≤j≤t , and let z be the column vector composed of the diagonal elements of matrix Z. Then the equivalent condition for the linear equation in step S501 to have a 0|1 solution is that the optimal value of the linear programming problem is greater than 0: Objective function: max c T ·z Constraints: where * denotes the tensor product, and Z 0,0 is a variable to be determined.

2. The method for determining the satisfiability of a Boolean logic circuit based on linear programming according to claim 1, wherein The described Boolean propositional logic formula consists of n Boolean variables X = (x1, x2, …, x n ), connected by the operator AND, denoted by ∧, separated by OR, denoted by ∨, negated by NOT, denoted by , and formed by parentheses; the expression of the 1-in-3-SAT is in the form: S = ∧ i≤k (∨ j≤3 L i,j (X, U)), where k is the number of clauses in the expression of the 1-in-3-SAT, and L i,j (X, U) is the j-th literal in the i-th clause, and U is the newly introduced Boolean variable for constructing the Schaefer structure variant; when the number of clauses of the 3-SAT in CNF form is m, the number of U is 6m, and the number of k is 5m; for any Boolean variable x i ∈X, if the negated literal appears in the expression of the 1-in-3-SAT , then a new Boolean variable y i ∈Y needs to be introduced for replacement, and a clause connected by AND (x i ∧y i ) is added after the original expression of the 1-in-3-SAT, and k = k + 1, to obtain the expression of the 1-in-3-SAT without negated literals S = ∧ i≤k (∨ j≤3 L i,j (X, Y, U)).

3. The method for determining the satisfiability of a Boolean logic circuit based on linear programming according to claim 1, characterized in that The solution accuracy described in step S6 is set as follows: First, set the solution optimal value accuracy as where ε is a positive number artificially selected to be much smaller than k; Then select a sufficiently small feasible solution solving accuracy δ.

4. The method for determining the satisfiability of a Boolean logic circuit based on linear programming according to claim 1, characterized in that, The specific determination of the satisfiability of the Boolean propositional logic formula according to the size of the optimal value described in step S7 is as follows: S701: When the maximum value of the objective function obtained by solving is less than return the result - the Boolean propositional logic formula is unsatisfiable, and end; S702: When the maximum value of the objective function obtained by the solution is greater than then return the result - the Boolean propositional logic formula is satisfiable, and continue to execute step S8.

5. The method for determining the satisfiability of a Boolean logic circuit based on linear programming according to claim 1, characterized in that The specific step S8 is as follows: S801: Set a sufficiently small positive number ρ; S802: From the feasible solution of Z @ Among the diagonal elements of @ s,s >ρ and the smallest diagonal element, where i≤s≤t; S803: Add Z s,s = 1 as a constraint to the constraint conditions, and re-solve the linear programming problem. At the same time, let i = i + 1; S804: Starting from i = 1, repeatedly execute the iteration of steps S802 to S803 until i = t; S805: Form a vector from the diagonal elements of the feasible solution Z @ after iteration is completed, and round it to the nearest integer. Then this vector is a solution to the satisfiability problem.

Citation Information

Patent Citations

  • Algebraic-based fast logic decision-making method

    CN107945275A

  • An efficient decision-making method based on a binary field

    CN108984473A