Given a propositional formula in conjunctive normal form (CNF), the satisfiability problem (SAT)  is finding an assignment to the variables of the formula that satisfies every clause. SAT is a core problem in theoretical computer science because of its central position in complexity theory . Moreover, numerous NP-hard practical problems have been successfully solved using SAT .
When there is no satisfying assignment it might still be useful to find a truth assignment that satisfies as many clauses as possible, this is the Boolean maximum satisfiability problem (MaxSAT), which is a famous generalization of SAT. There has been great advancements in developing efficient MaxSAT solvers in recent years [12, 9] and because of that, many practical NP-hard optimization problems have been efficiently solved using MaxSAT [6, 1].
The counterpart of SAT in fuzzy logic (and Łukasiewicz logic specifically) exists, although, less attention has been paid to developing efficient solvers for the problem. One of the recent attempts  consists of enhancing the start-of-the-art Covariance Matrix Adaptation Evolution Strategy (CMA-ES) algorithm. This was done by having multiple CMA-ES populations running in parallel and then recombining their distributions if this leads to improvements. Another recent finding  showed that a hillclimber approach outperformed CMA-ES on some problem classes. A different idea was recently proposed which involves encoding the formula as an Satisfiability Modulo Theories (SMT) program then employing flattening methods and CNF conversion algorithms to derive an equivalent Boolean CNF SAT instance .
In this paper, we shall focus on defining the MaxSAT problem for a particular class of Łukasiewicz formulas, called Ł-clausal forms. This type of formulas resembles CNF in the classical Boolean logic. In addition, -SAT, , for Ł-clausal forms has been shown to be NP-complete . First, we prove that MaxSAT for Ł-clausal forms is NP-complete. Second, we build a formula generator to produce benchmarks with selected properties. The aim is to provide insights into the relationship between the number of falsified clauses and the different input parameters of our model. Finally, we solve the MaxSAT instance by augmenting fresh variables to each clause then encode and solve the new formula as an SMT program using Z3111 Z3 is an SMT solver from Microsoft Research that appeared in 2007. It is used to check the satisfiability of logical formulas over one or more theories. Supported theories include bit-vectors, arrays, propositional logic, among others.
Z3 is an SMT solver from Microsoft Research that appeared in 2007. It is used to check the satisfiability of logical formulas over one or more theories. Supported theories include bit-vectors, arrays, propositional logic, among others.. Our experimental investigation showed that the number of falsified clauses increases exponentially as the frequency of occurrence of negated terms in the formula increases.
The paper is structured as follows. Firstly, we present some preliminaries and definitions regarding Ł-clausal forms and Lukasiewicz logic in general. Secondly, we define MaxSAT for Ł-clausal forms, prove that it is NP-complete and then introduce an algorithm to solve it. Thirdly, the generation and construction of Ł-clausal forms is presented. Finally, we report on empirical investigation regarding the cost of formulas generated with different parameter values.
The basic connectives of Łukasiewicz logic are defined in Table 1. We will be dealing with five operations, namely negation (), the strong and weak disjunction ( and respectively) and the strong and weak conjunction ( and respectively).
It is important to note that one can generalize Boolean CNF by replacing the Boolean negation with the Łukasiewicz negation and the Boolean disjunction with the strong disjunction. The resulting form is
and is referred to as simple Ł-clausal form.
It has been shown  that the satisfiability problem for any simple Ł-clausal form is solvable in linear time, contrary to its counterpart in Boolean logic which is NP-complete in the general case. In addition, the expressiveness of simple Ł-clausal forms is limited. That is, not every Łukasiewicz formula has an equivalent simple Ł-clausal form. To remedy this matter, Botfill et al. proposed another form called Ł-clausal forms (Definition 1), for which the 3-SAT problem is NP-complete222The proof involves reducing Boolean 3-SAT to the SAT problem for Ł-clausal forms..
Let be a set of variables. A literal is either a variable or . A term is a literal or an expression of the form , where are literals. An Ł-clause is disjunction of terms. An Ł-clausal form is a weak conjunction of Ł-clauses.
The authors also showed that 2-SAT is solvable in linear time for Ł-clausal forms. The difference between simple Ł-clausal forms and Ł-clausal forms is that in the latter, negations are allowed to be present above the literal level.
3 Maximizing the number of satisfied Ł-clauses
In Boolean MaxSAT, the problem can be stated in different ways. One definition is to find the cost (minimum number of falsified clauses). Another definition is to find an assignment that satisfies the maximum number of clauses (i.e., minimize the cost). In the Łukasiewicz version, we are going to go with the first problem definition.
Given a set of propositional clauses or Ł-clauses , is the maximum number of satisfiable clauses in by any assignment.
Now we prove that maximizing the number of satisfied Ł-clauses is NP-complete.
Given a set of Ł-clauses and an integer , deciding whether there exists an assignment that satisfies at least Ł-clauses is NP-complete.
It is easy to see that the problem is in NP. Indeed, given an assignment to the variables, we can check whether or not it satisfies at least clauses in polynomial time. For the completeness part, we reduce from Boolean Max-2-SAT (i.e., MaxSAT instances with at most two literals per clause, which is NP-complete ).
Let be a Boolean Max-2-SAT instance of clauses over variables . We will create a set of Ł-clauses such that if and only if . The construction of is as follows:
For each variable appearing in , add copies of the Ł-clause to .
For each clause , add one copy of the Ł-clause to .
Thus, , where such that are identical copies of , and .
Let and be the corresponding assignment. For every , the copies are satisfied, because evaluates every to either 0 or 1. Hence, clauses are satisfied in . In addition, since and are equivalent when restricted to 0 and 1, thus, if are the clauses that are satisfied in , then are satisfied in .
Let and be the corresponding assignment. Since there are copies of every and there is only one copy of every clause of the other type, then satisfies . Hence, every appearing in is evaluated to either 0 or 1. Let be the clauses that satisfies. Now, we have , and since are also satisfied in , then .
Therefore, if and only if and thus deciding whether there is an assignment that satisfies at least Ł-clausal forms is NP-complete. ∎
One way to solve MaxSAT for Ł-clausal forms is as follows. Given a set of Ł-clauses, replace each by , , where each is a new variable that does not appear in . A cardinality constraint is added to minimize the sum of . Augmenting each with a new variable ensures that is satisfied. Adding the cardinality constraint ensures that the minimum number of ’s are true and thus the maximum number of Ł-clauses are satisfied.
4 Construction of Ł-clausal forms
We have carried out a similar experiment to the one done by Bofill et al. in  on 3-valued Ł-clausal forms. The instances used were generated in the following manner: given the number of variables and the number of clauses , each clause is generated from three variables and picked uniformly at random. Then, one of the following eleven Ł-clauses is drawn uniformly at random , , , , , , , , , and . As can be seen in Figure 1, phase transition occurs from clauses to variables ratio 1.71 to 2.0.
Our model generates Ł-clausal forms with parameters , where is the number of Ł-clauses, is the number of variables, is the number of variables appearing in each Ł-clause and is the degree of absence of negated terms. The decision of whether or not to put a negated term in a clause is made as follows: Given , we generate a random integer , and if , then we add a negated term. The length of the negated term is a random integer between , where is the current length of the Ł-clause, i.e., we have literals left to add.
So, as increases, the number of negated terms in each clause decreases. For example, when approaches 1, the sum of the lengths of negated terms in each Ł-clause approaches , and when approaches , the sum approaches 0. In the next section, we will discuss the relationship between and the cost.
In this section, we introduce and discuss our findings. We are interested in the relationship between the cost and clauses to variables ratio, and . The results below are obtained from 3-valued, uniformly generated formulas at random. The machine has 16GB of RAM and an Intel® Xeon® E5-1650 (12MB Cache, 3.20GHz) processor. No time limits were set for any of the experiments.
First we discuss the relationship between the cost and . All formulas used have 50 variables, and to investigate the relationship over instances with different clauses to variables ratio, we generated three sets of formulas having 100, 150 and 200 Ł-clauses. As Figure 2 shows, a threshold phenomena between and the cost exists. When increases, the cost decreases exponentially regardless of the clauses to variables ratio.
A near linear relationship can be seen in Figure 3 between cost and the clauses to variables ratio, regardless of the degree of absence of negated terms (). The formulas used have 4 literals in each Ł-clause (), 50 variables, and degrees of absence of negated terms () of 1, 2, 5, 10, 15 and 20. As can be seen, the phase transition happens at earlier clauses to variables ratio as decreases. Moreover, the results show a near linear trend overall across the different values.
Finally, we explore the relationship between the number of literals in each clause () and the cost, illustrated in Figure 4. Our experiment was carried out on formulas with 50 variables, , and 200, 150, 100 and 50 Ł-clauses. A different value of is chosen and fixed for each subplot of Figure 4. The value of in all subplots ranges from 3 to 20. Regardless of the clauses to variables ratio or , the results show a decline in cost as increases. Moreover, it can be seen that the drop in cost becomes more apparent as increases from 2 to 10. This can be justified by the observation in Figure 2. The increase in gives more possibilities to satisfy each Ł-clause. However, as Figure 2 suggests, the cost increases exponentially as becomes lower, which takes precedence over the number of possibilities for satisfying Ł-clauses offered by higher values.
6 Conclusion and Future Work
In this paper, we have proved that maximizing the number of satisfied Ł-clauses is NP-complete by reduction from Max-2-SAT. Also, we have designed a formula generator for Ł-clausal forms with four essential parameters which is able to generate formulas having the same clauses to variables ratio but with different costs. Such a model is important for producing benchmarks that can be used to test solvers of Ł-clausal forms and study their properties. One important parameter is the degree of absence of negated terms, . As we have shown, with the increases in , the number of falsified Ł-clauses decreases exponentially.
We plan to extend our study to different types of formulas in Łukasiewicz logic, generated using different probability distributions (e.g., power law and exponential distributions). This is useful since formulas generated from applications tend to have non-uniform distributions when it comes to variable occurrences.
In classical Boolean logic, there have been various studies on predicting the satisfiability of instances at the phase transition [15, 16, 13]. All of them rely on generating polynomially-computable features to increase the accuracy of predicting the satisfiability. Thus, we will investigate how our model parameters can be used to learn the satisfiability of Ł-clausal forms generated near the phase transition area.
-  Roberto Asín Achá and Robert Nieuwenhuis. Curriculum-based course timetabling with sat and maxsat. Annals of Operations Research, 218(1):71–91, 2014.
-  Armin Biere, Marijn Heule, and Hans van Maaren. Handbook of satisfiability, volume 185. IOS press, 2009.
-  Miquel Bofill, Felip Manya, Amanda Vidal, and Mateu Villaret. Finding hard instances of satisfiability in lukasiewicz logics. In Multiple-Valued Logic (ISMVL), 2015 IEEE International Symposium on, pages 30–35. IEEE, 2015.
-  Tim Brys, Madalina M Drugan, Peter AN Bosman, Martine De Cock, and Ann Nowé. Local search and restart strategies for satisfiability solving in fuzzy logics. In Genetic and Evolutionary Fuzzy Systems (GEFS), 2013 IEEE International Workshop on, pages 52–59. IEEE, 2013.
Tim Brys, Madalina M Drugan, Peter AN Bosman, Martine De Cock, and Ann
Solving satisfiability in fuzzy logics by mixing cma-es.
Proceedings of the 15th annual conference on Genetic and evolutionary computation, pages 1125–1132. ACM, 2013.
-  Kerstin Bunte, Matti Järvisalo, Jeremias Berg, Petri Myllymäki, Jaakko Peltonen, and Samuel Kaski. Optimal neighborhood preserving visualization by maximum satisfiability. In AAAI, pages 1694–1700, 2014.
Stephen A Cook.
The complexity of theorem-proving procedures.
Proceedings of the third annual ACM symposium on Theory of computing, pages 151–158. ACM, 1971.
-  Leonardo De Moura and Nikolaj Bjørner. Z3: An efficient smt solver. In International conference on Tools and Algorithms for the Construction and Analysis of Systems, pages 337–340. Springer, 2008.
-  Mohamed El Halaby. Solving maxsat by successive calls to a sat solver. In Proceedings of SAI Intelligent Systems Conference, pages 428–452. Springer, 2016.
-  Michael R Garey, David S. Johnson, and Larry Stockmeyer. Some simplified np-complete graph problems. Theoretical computer science, 1(3):237–267, 1976.
-  Joao Marques-Silva. Practical applications of boolean satisfiability. In Discrete Event Systems, 2008. WODES 2008. 9th International Workshop on, pages 74–80. IEEE, 2008.
-  Antonio Morgado, Federico Heras, Mark Liffiton, Jordi Planes, and Joao Marques-Silva. Iterative and core-guided maxsat solving: A survey and assessment. Constraints, 18(4):478–534, 2013.
-  Eugene Nudelman, Kevin Leyton-Brown, Holger H Hoos, Alex Devkar, and Yoav Shoham. Understanding random sat: Beyond the clauses-to-variables ratio. In International Conference on Principles and Practice of Constraint Programming, pages 438–452. Springer, 2004.
-  Joan Ramon Soler and Felip Manyà. A bit-vector approach to satisfiability testing in finitely-valued logics. In Multiple-Valued Logic (ISMVL), 2016 IEEE 46th International Symposium on, pages 270–275. IEEE, 2016.
Improving sat-solving with machine learning.In Proceedings of the 2017 ACM SIGCSE Technical Symposium on Computer Science Education, pages 787–788. ACM, 2017.
-  Lin Xu, Holger H Hoos, and Kevin Leyton-Brown. Predicting satisfiability at the phase transition. In AAAI, 2012.