The Implementation of a Product Fuzzy DPLL Solver
Ivor Uhliarik
a
Department of Applied Informatics, Comenius University, Mlynsk
´
a dolina, 842 48 Bratislava, Slovakia
Keywords:
Fuzzy Logic, Product Logic, Automated Theorem Proving, DPLL, Satisfiability Solving.
Abstract:
The area of automated theorem proving in fuzzy logics has been revisited during the last decade with novel
approaches, mathematical foundations, and software. However, only a few of these are capable of dealing with
logics based on the product t-norm. The existing methods are usually based on (1) translations into satisfiability
modulo theories, (2) evolutionary algorithms, and (3) fuzzy extensions of classical-logic procedures, such as
the Davis-Putnam-Logemann-Loveland (DPLL) procedure. In this paper we present the results of our work on
the first DPLL-based solver for product propositional logic extended with the Monteiro-Baaz operator and
order (, P) operators. Our contribution consists of the refinement and completion of our previously proposed
deterministic algorithm and the working implementation of the solver. Comparing to other approaches, the
essential difference of ours lies in its self-containment—it is not based on translations into other systems,
which provides possibilities for feasible modifications or further optimizations. The solver yields answers
to the 1-satisfiability and validity problems, and is available for download and use as free and open-source
software.
1 INTRODUCTION AND
RELATED WORK
The three prominent fuzzy logics are based on the
G
¨
odel, Łukasiewicz, and product t-norms. To this
day, product fuzzy logic remains the least explored
in terms of automated theorem proving and applica-
tions. In spite of this, recent years have witnessed the
emerging of approaches that deal with product logic
not only on the propositional level (Guller, 2013; Brys
et al., 2013), but also with modal extensions (Vidal,
2016), description logics (Bobillo and Straccia, 2007;
B
´
ejar et al., 2013), and in fuzzy answer set program-
ming (Janssen et al., 2012; Alviano and Pe
˜
naloza,
2015).
In propositional logic, the field of automated the-
orem proving revolves around the task of proving the
satisfiability (SAT) or validity (VAL) of a formula by
a solver. One such solver (Vidal, 2016) is based on
satisfiability modulo theories. In addition to product
propositional logic, it is able to operate over any fuzzy
logic with a continuous t-norm by the Mostert-Shields
theorem (Mostert and Shields, 1957). The solver is
mature in the sense that it has been thoroughly de-
scribed, validated, evaluated, and its implementation
is available to the public.
a
https://orcid.org/0000-0002-0495-5467
A different kind of proposal for SAT solving in
product propositional logic (Guller, 2013) extends the
Davis-Putnam-Logemann-Loveland (DPLL) (Davis
et al., 1962) procedure known in Boolean logic to
the fuzzy case. The approach establishes an anal-
ogy to the branching and simplifying rules in classical
DPLL. In contrast to approaches relying on transla-
tions into other systems and their solvers, this proce-
dure could be used to develop a self-contained, trans-
parent solver—one with implementation flexible at
opting to use various kinds of rules as heuristics, or
even using machine learning techniques to guide the
DPLL tree traversal (Suttner and Ertel, 1990).
In this paper we present the next milestone of our
existing research. We choose to work with the product
fuzzy DPLL procedure described above. In the previ-
ous iteration (Uhliarik, 2019) we proposed the initial
version of the algorithm for performing an informed
search of the fuzzy DPLL tree. Herewith we propose
a refinement of the algorithm, making it simpler and
more efficient, and complete the previous contribution
by proposing a method to solve the unit contradiction
problem. Also, we introduce the working implemen-
tation of our approach.
One of the aspects of product logic that makes
it worthwhile to investigate is the embeddability of
Łukasiewicz and (extended) G
¨
odel logic within prod-
uct logic extended by the operator (Baaz et al.,
252
Uhliarik, I.
The Implementation of a Product Fuzzy DPLL Solver.
DOI: 10.5220/0010148802520263
In Proceedings of the 12th International Joint Conference on Computational Intelligence (IJCCI 2020), pages 252-263
ISBN: 978-989-758-475-6
Copyright
c
2020 by SCITEPRESS Science and Technology Publications, Lda. All rights reserved
1998). The idea to develop a solver around the prod-
uct t-norm that would be able to work uniformly with
the three logics and, by the Mostert-Shields theorem,
also all other continuous t-norm-based ones, is indeed
attractive. This is the reason we choose to work with
-extended product logic.
The rest of this paper is structured as follows. In
Section 2 we revisit the preliminary notions that are
necessary to understand later text. Section 3 describes
the algorithms performing the translation of formu-
lae into normal form and the informed search of the
DPLL tree. In the same section we also present our
full approach to applying the unit contradiction rule,
one of the fuzzy DPLL rules. Next, in Section 4 we
describe our implementation of the solver. Section 5
lays down the information resulting from the evalua-
tion of the implementation. Finally, we conclude the
paper in Section 6 and list future work.
2 PRELIMINARIES
In this section we introduce the concepts needed for
the understanding of later sections of this paper. We
define the syntax and semantics of -extended prod-
uct propositional logic, the order clausal form and its
elements, and the product fuzzy DPLL procedure.
2.1 Product Propositional Logic
This work is focused on dealing with product propo-
sitional logic extended with the Monteiro-Baaz op-
erator, interpreted by the standard product algebra ex-
tended with the operators P
P
P,
, and
:
Π
= ([0, 1], ,
,
, ·,
, ¬
¬
¬,P
P
P,
,
, 0, 1)
The connectives of the logic are ¬ (negation),
(conjunction), & (strong conjunction), (disjunc-
tion), (implication), (equivalence), P (equal-
ity), (strict order), and (delta)
1
, with the associ-
ated operations of ¬
¬
¬,
, ·,
,
, P
P
P,
, and
defined
as
x
y =
1 if x y,
y
x
else;
¬
¬
¬x =
1 if x = 0,
0 else;
xP
P
P y =
1 if x = y,
0 else;
x
y =
1 if x < y,
0 else;
x =
1 if x = 1,
0 else;
1
With the decreasing connective precedence: ¬, , &,
P, , , , , .
,
as the supremum and infimum operator on
[0, 1] respectively, and · as the algebraic product. The
equivalence connective in the expression x y is in-
terpreted as x
y
y
x. 0 and 1 are the symbols
representing the truth constants false and true, inter-
preted in the algebra as its absorbing and neutral ele-
ment.
The residuum operator
satisfies the residuation
principle w.r.t. operation ·; for any x Π
, the nega-
tion ¬
¬
¬ satisfies the condition ¬
¬
¬x = x
0, and
sat-
isfies the condition
x = xP
P
P 1.
To construct formulae we follow the convention
of (Guller, 2013; Uhliarik, 2019; Guller, 2020):
let PropAtom be the set of propositional atoms.
Order propositional formulae are constructed from
PropAtom, the truth constants 0 and 1, and the log-
ical connectives. Next, let OrdPropForm be the set
of all such formulae. Any subset of OrdPropForm is
called an order theory.
As in (Guller, 2013), we assume the valua-
tion of propositional atoms to be the mapping V :
PropAtom [0, 1] such that V (0) = 0 and V (1) =
1. For any formula ϕ OrdPropForm, the value
kϕk
V
[0, 1] of ϕ in V is defined recursively on
the structure of ϕ by the respective application of the
unary and binary operations corresponding to the con-
nectives in ϕ. More formally, the following applies
according to the structure of ϕ:
ϕ PropAtom, kϕk
V
= V (ϕ);
ϕ = ¬ϕ
1
, kϕk
V
= ¬
¬
¬kϕ
1
k
V
;
ϕ = ϕ
1
, kϕk
V
=
kϕ
1
k
V
;
ϕ = ϕ
1
ϕ
2
, kϕk
V
= kϕ
1
k
V
kϕ
2
k
V
,
{∧, &, , , P, ≺};
ϕ = ϕ
1
ϕ
2
, kϕk
V
= (kϕ
1
k
V
kϕ
2
k
V
)·
(kϕ
2
k
V
kϕ
1
k
V
).
The subject of the next sections will be the prob-
lem of satisfiability and validity (tautologicity) of for-
mulae. We can define these on a formal level us-
ing the concept of valuation. For the formula ϕ
OrdPropForm, we say ϕ has the model V (is true in
V ), or V |= ϕ iff kϕk
V
= 1. A formula is satisfiable
iff there exists some model of it, and is a tautology iff
every valuation is its model.
The theory T has the model V , or V |= T iff V |=
ϕ for all ϕ T . A theory is satisfiable iff it has a
model, and is valid iff every valuation is its model.
Finally, for two formulae ϕ, ϕ
0
OrdPropForm, ϕ
is equivalent to ϕ
0
, or ϕ ϕ
0
iff kϕk
V
= kϕ
0
k
V
for
every valuation V .
The Implementation of a Product Fuzzy DPLL Solver
253
2.2 Order Clausal Form
Automated theorem provers in classical propositional
logic are mostly known to require the input formu-
lae to be in a canonical form, usually the conjunc-
tive or disjunctive normal form. Such also applies to
the product propositional solver. To facilitate uniform
and efficient processing using the fuzzy extension of
the DPLL procedure over Π
, the input is expected
to be in the order clausal form. As in the case of
Boolean normal forms, there exists a method of trans-
lation of an arbitrary formula into this form, which
will be described in Section 3. Here we enumerate the
building blocks of the form, staying consistent with
its proposal (Guller, 2013), and we will refer to them
later in the text.
The set of propositional atoms PropAtoms and the
truth constants 0, 1 have already been defined.
The power of atom in the form a
n
is the n-th power
of atom a interpreted by the · operator.
The conjunction Cn is the set of powers of atoms
given in the form a
p
1
1
&. . . & a
p
n
n
, n 1. The atoms a
i
in the expression must be unique (cannot occur more
than once). PropConj is the set of all conjunctions.
The expression of the form ε
1
ε
2
where {P
, ≺} and ε
i
PropConj {0, 1} is called the order lit-
eral. More specifically, the literal associated with the
connective P is the equality literal and the strict
order literal. A literal is pure iff it does not contain
any of the constants 0, 1.
The set of literals l
1
··· l
n
is the order clause.
will denote the empty clause, and we refer to {l} as
the unit clause.
A set of clauses constructs the order clausal the-
ory. Further, an order clausal theory is {pure, unit} iff
it contains only {pure, unit} clauses.
A more comprehensive list of formal definitions
of terms may be found in (Guller, 2013, Sect. 3), to-
gether with the interpolation rules used to perform the
translation, the discussion of technical aspects, and
the complexity of the algorithm.
2.3 Product DPLL Procedure
The original DPLL procedure (Davis et al., 1962)
on classical propositional logic is a popular, well-
established backtracking search algorithm that solves
the satisfiability problem given a formula by attempt-
ing to find its model (or proving its unsatisfiability).
The procedure may be thought of as a tree-traversing
algorithm, where the tree is split into two branches
according to the possible valuations of literals. More-
over, the method uses two rules at each step to con-
strain the search space: unit propagation and pure lit-
eral elimination.
For the sake of visualizing analogy, the branching
step of DPLL may be written in the following form:
S
S {l}
S l}
(Branching rule)
for literal l occurring in theory S.
The core idea of the fuzzy extension of the pro-
cedure introduced by (Guller, 2013) and refined in
(Guller, 2020) lies in a similar kind of branching—
instead of assigning one of two truth values to a literal,
the branching is based on the valuation trichotomy of
atoms:
S
S {a P 0}
S {0 a, a 1}
S {a P 1}
for atom a occurring in theory S.
The search-space constraining rules in classi-
cal DPLL also have their product-logic counterparts
(Guller, 2020); however, in the latter case, the list of
applicable rules grows longer: there are thirteen rules
necessary for the procedure to be refutation-complete,
and four admissible rules that further constrain the
search space.
The main idea of using the rules to prove a prop-
erty (satisfiability, validity) of a theory is similar to
that of classical DPLL: the inference starts at the root
node of the tree, and the rules are recursively ap-
plied to split and simplify the tree. After the traver-
sal, the input theory is satisfiable iff there exists an
open branch. In the positive case, the model may be
calculated based on the path of traversal.
The papers (Guller, 2013; Guller, 2020) propose
and describe the product fuzzy DPLL rules, prove the
refutational soundness and completeness of the pro-
cedure, explore into detail the results of applying the
individual rules, and provide examples of proving the
satisfiability and validity of product propositional for-
mulae.
Before we list the rules of the procedure, we re-
call some of the concepts of (Guller, 2020) in order to
better grasp the following notation.
C is a guard iff either C = a P 0, C = 0 a, C =
a 1, or C = a P 1. Let S be an order propositional
clause. We denote guards(a) = {a P 0, 0 a, a
1, a P 1} and guards(S) = {C |C S is a guard}.
Atom a is fully guarded in theory T iff the theory con-
tains either the literal a P 0, the literal a P 1, or both
of the literals 0 a, a 1.
Next, we list the definitions of two auxiliary func-
tions. The function simplify in Definition 1 modifies
an expression by replacing the occurrences of atoms
with their truth constants and returns a simplified ex-
FCTA 2020 - 12th International Conference on Fuzzy Computation Theory and Applications
254
pression w.r.t. laws of the standard product algebra.
Definition 1. Auxiliary function simplify (Guller,
2020)
simplify(0, a, υ) = 0;
simplify(1, a, υ) = 1;
simplify(Cn, a, 0) =
0 if a atoms(Cn),
Cn else;
simplify(Cn, a, 1) =
1 if n
Cn = a
n
,
Cn a
n
if n
a
n
Cn 6= a
n
,
Cn else;
simplify(l, a, υ) = simplify(ε
1
, a, υ) simplify(ε
2
, a, υ)
if l = ε
1
ε
2
;
simplify(C, a, υ) = {simplify(l, a, υ)| l C}.
The auxiliary function returns the product of two
{conjunctions, literals}. For conjunctions of pow-
ers of atoms Cn
1
, Cn
2
, literals l
1
, l
2
, and expressions
ε (truth constants or conjunctions of powers) and µ
(truth constants or literals), the function is defined in
Definition 2.
Definition 2. Auxiliary function (Guller, 2020)
0 ε = ε 0 = 0;
1 ε = ε 1 = ε;
Cn
1
Cn
2
= {a
m+n
|a
m
Cn
1
, a
n
Cn
2
}
{a
n
|a
n
Cn
1
, a 6∈ atoms(Cn
2
)}
{a
n
|a
n
Cn
2
, a 6∈ atoms(Cn
1
)}
0 µ = µ 0 = 0;
1 µ = µ 1 = µ;
l
1
l
2
= (ε
1
ε
2
) (υ
1
υ
2
) if l
i
= ε
i
i
υ
i
,
=
P if
1
=
2
=P,
else.
For comprehensiveness, below we list the first
thirteen fuzzy product DPLL rules as defined in
(Guller, 2013; Guller, 2020) and briefly describe their
intuition.
(Unit contradiction rule) (1)
S
S {}
;
S is unit;
there exist 0 a
0
, . . . , 0 a
m
,
a
0
1, . . . , a
m
1 guards(S),
l
0
, . . . , l
n
S such that l
i
is pure order literal,
atoms(l
0
, . . . , l
n
) = {a
0
, . . . , a
m
};
there exist α
i
1, i = 0, . . . , n,
J
{ j | j m}, β
j
1, j J
, such that
n
i=0
l
α
i
i
jJ
(a
j
1)
β
j
is a contradiction.
Rule (1) derives iff a -product of powers of the
input pure order literals and guards a
j
1, j J
can
be found that would lead to a contradiction of the form
ε ε.
(Trichotomy branching rule) (2)
S
S {a P 0}
S {0 a, a 1}
S {a P 1}
;
a atoms(S).
The branching rule (2) splits the derivation into three
sub-cases of the trichotomy a P 00 aa 1a P
1.
(Pure trichotomy branching rule) (3)
S
(S {ϕ}) {l
1
}
(S {ϕ}) {C} {l
2
}
(S {ϕ}) {C} {l
3
}
;
ϕ = (l
1
C) S,C 6= ,
l
1
l
2
l
3
is a pure trichotomy.
Rule (3) is a branching rule splitting the derivation
into the three sub-cases of the trichotomy of pure lit-
erals l
1
, l
2
, and l
3
.
(Contradiction rule) (4)
S
(S {l C}) {C}
;
l C S, l is a contradiction.
The order literal l can be removed from the input or-
der clause l C if it is a contradiction.
(Tautology rule) (5)
S
S {l C}
;
l C S, l is a tautology.
The input order clause l C can be removed from S if
it is a tautology.
(0-simplification rule) (6)
S
(S {C}) {simplify(C, a, 0)}
;
a P 0 guards(S),C S,
a atoms(C), a P 0 6= C.
The Implementation of a Product Fuzzy DPLL Solver
255
If a P 0 guards(S) and the input order clause C con-
tains a, then C can be simplified.
(1-simplification rule) (7)
S
(S {C}) {simplify(C, a, 1)}
;
a P 1 guards(S),C S, a atoms(C), a P 1 6= C.
If a P 1 guards(S) and the input order clause C con-
tains a, then C can be simplified.
(0-contradiction rule) (8)
S
(S {a
α
0
0
&· ·· & a
α
n
n
P 0 C}) {C}
;
0 a
0
, . . . , 0 a
n
guards(S),
a
α
0
0
&· ·· & a
α
n
n
P 0 C S guards(S).
If 0 a
0
, . . . , 0 a
n
guards(S), a
α
0
0
&· ·· & a
α
n
n
P 0
is contradictory; it can be removed from the input or-
der clause and C can be derived. The 1-contradiction
rule is analogous.
(1-contradiction rule) (9)
S
(S {a
α
0
0
&· ·· & a
α
n
n
P 1 C}) {C}
;
a
i
1 guards(S), i n,
a
α
0
0
&· ·· & a
α
n
n
P 1 C S guards(S).
(0-consequence rule) (10)
S
S {0 a
α
0
0
&· ·· & a
α
n
n
C}
;
0 a
0
, . . . , 0 a
n
guards(S),
0 a
α
0
0
&· ·· & a
α
n
n
C S guards(S).
If 0 a
0
, . . . , 0 a
n
guards(S), then it must hold
that 0 a
α
0
0
&· ·· & a
α
n
n
. Therefore, the input order
clause 0 a
α
0
0
&· ·· & a
α
n
n
C is a consequence of the
guard(s) and may be removed.
(1-consequence rule) (11)
S
S {a
α
0
0
&· ·· & a
α
n
n
1 C}
;
a
i
1 guards(S),
i n, a
α
0
0
&· ·· & a
α
n
n
1 C S guards(S).
Analogous to rule (10).
(0-annihilation rule) (12)
S
S {a P 0}
;
a P 0 guards(S), a 6∈ atoms(S {a P 0}).
(1-annihilation rule) (13)
S
S {a P 1}
;
a P 1 guards(S), a 6∈ atoms(S {a P 1}).
If the atom a different from 0, 1 occurs in S only in the
guard a P 0 or a P 1, then this guard may be removed
from S.
In our previous work (Uhliarik, 2019) we pro-
posed a deterministic algorithm that uses these rules
to split and traverse the tree in an informed fash-
ion; however, it was still left open how to effectively
accomplish the application of the unit contradiction
rule. The contribution of this paper lies in (i) the revi-
sion of the algorithm, (ii) the proposal of an approach
to detect contradiction within the unit contradiction
rule, and (iii) the description and evaluation of our
concrete, working implementation of the solver. The
next section deals with (i) and (ii).
3 ALGORITHM
Given only the list of branching rules, a na
¨
ıve tree-
traversing algorithm would explore the whole search
space to determine the existence of a closed branch.
Simplification rules may help constrain the traversal,
but without a specification directing how to use these
rules, the na
¨
ıve algorithm could apply them eagerly,
which could lead to premature branching and ineffi-
cient traversal.
For this reason we proposed an algorithm in our
previous work (Uhliarik, 2019) that constructs and
traverses the product DPLL tree in order to prove the
(non-)satisfiability of an order clausal theory. The al-
gorithm uses the branching and simplifying rules of
the product fuzzy DPLL procedure (Guller, 2013) in
an informed way, based on our analysis of branch
properties after the application of individual rules.
However, during our later work on the implemen-
tation and testing of the solver, we discovered that the
traversal could be enhanced to further constrain the
search space. In this section we introduce the revision
of the algorithm. In addition to modifications, we try
FCTA 2020 - 12th International Conference on Fuzzy Computation Theory and Applications
256
to be more specific about the more complex steps of
the procedure.
3.1 Translation into Order Clausal
Form
We recall that the DPLL procedure constructs a tree
from the (non-empty) product order clausal theory.
The algorithm to translate any such theory into the
order clausal form is based on the application of in-
terpolation rules introduced in (Guller, 2013, Sect.
3) and shown in Alg. 1. For simplicity we consider
the input to be a single (complex) order propositional
formula—in the case of a set of formulae, the proce-
dure yields intuitive results for the -conjunction of
its elements in Π
without loss of generality. While
traversing the structure of the formula (represented as
a tree), its subformulae are matched by interpolation
rules and substituted with generated auxiliary atoms.
The crucial change is in line 3 of the algorithm.
Previously we considered the overall solver to prove
only the satisfiability of the input formula. For this,
the first step of the translation of formula ϕ was the
addition of the literal
e
a
0
P 1,
e
a
0
being the auxiliary
atom ϕ
e
a
0
. To enable checking for validity, the
first literal becomes
e
a
0
1 (and the result is assumed
negated).
The rest of the algorithm performs the standard
pre-order traversal of the formula structure. In every
step, the pair of subformula ψ and its associated auxil-
iary atom
e
a ψ is picked from the queue. The func-
tion Inter(
e
a , ψ) (omitted for brevity) processes
the pair by using an interpolation rule matching ψ ac-
cording to (Guller, 2013; Guller, 2020) and yields two
sets: the set nPairs of pairs of new auxiliary atoms and
subformulae of ψ, and the new clauses nClauses re-
sulting from applying the interpolation rule. The pairs
nPairs are further processed in next iterations, and the
clauses nClauses are added to the result.
For a visualization of performing the translation,
refer to (Guller, 2013, Table 6).
3.2 DPLL Inference
The algorithm accepts as input an order clausal the-
ory and uses the rules (1)–(13) to split the tree into
branches and simplify the theory. A branch is closed
when the empty clause is derived in its leaf, oth-
erwise the branch is open. A tree is closed iff all its
branches are closed, otherwise it is open. The theory
is satisfiable iff an open branch exists after the ex-
haustion of applicable rules (Guller, 2013, Theorem
4.2).
Input: Formula ϕ
Result: Order clausal theory S
ϕ
1 Function Translate(ϕ):
2 queue [(
e
a
0
, ϕ)];
3 S
ϕ
{
e
a
0
P 1} (SAT) or {
e
a
0
1} (VAL);
4 while queue not empty do
5
e
a , ψ pick pair from queue;
6 nPairs, nClauses Inter(
e
a , ψ);
7 foreach pair nPairs do
8 add pair to queue;
9 end
10 foreach clause nClauses do
11 add clause to S
ϕ
;
12 end
13 end
14 return S
ϕ
Algorithm 1: The translation of order propositional formula
into order clausal theory.
The intuition of the algorithm is depicted in a sim-
ple form by the flowchart in Figure 1 and described
more precisely by pseudo-code in Algs. 2–6.
Start
Is every atom
order guarded?
Trichotomy
branching
Contains
equality guard?
Reduction
Atoms in (0, 1)?
Derived ?
Closed
branch
Is unit?
Pure trichotomy
branching
Unit
contradiction
Contradictory?
Open
branch
yes
no
yes
no
no
yes
no
yes
no
yes
yes
no
Figure 1: Flowchart of the inference algorithm performing
the DPLL procedure.
The first steps depicted in Algs. 2 and 3 are the
same as in our previous work (Uhliarik, 2019), with
the exception that we will not concern ourselves with
finding the model related to an open branch. A non-
empty input theory S is first processed by the ini-
tial call to the Trichotomy(S) function (Alg. 2).
The function creates branches recursively according
to the content of S by using the trichotomy branch-
ing rule (2) as shown in Alg. 3. For each atom in S,
any missing order guards of the atom to make it fully
guarded (a P 0; 0 a, a 1; a P 1) are added to the
theory in the subsequent branches. Each branch s S
The Implementation of a Product Fuzzy DPLL Solver
257
is then simplified using the Reduce(s) function and
true is returned (S is satisfiable) if Reduce(S) returns
true (the branch could not be recursively closed). If
all branches have been closed, return f alse. Other-
wise we assume all atoms to be fully guarded and del-
egate satisfiability checking to the reduction of S.
Input: A non-empty order clausal theory S
Result: true iff S is satisfiable
1 return Trichotomy(S);
Algorithm 2: The initial step of the DPLL procedure.
1 Function Trichotomy(S):
2 foreach a atoms(S) where a is not fully
guarded do
3 S
0
split S using rule (2) over a;
4 foreach s S
0
do
5 s Reduce(s);
6 if s 6= then
7 return true;
8 end
9 end
10 if all s S
0
are closed then
11 return ;
12 end
13 end
14 return Reduce(S);
Algorithm 3: The Trichotomy function of the DPLL pro-
cedure.
The task of the Reduce(S) function is to apply
the simplification rules (4)–(13) that reduce the the-
ory by eliminating unnecessary clauses and literals.
The rules are applied consecutively until all equality
guards are resolved, returning f alse immediately af-
ter a closed branch is derived. Then the checking of
satisfiability is delegated to the PureTrichotomy(S)
function if all atoms are fully guarded, or the miss-
ing guards are supplemented by the Trichotomy(S)
function. This description contains a modification in
contrast to (Uhliarik, 2019) marked with (*): in addi-
tion to checking whether the reduction rules derive ,
it is important to handle the situation when the rules
(5) and (10)–(13) eliminate all clauses of the theory.
In such a case, the branch is open and the function
returns true.
The function PureTrichotomy(S) is described
in Alg. 5. To ensure all equality guards have been
cleared in S, we repeat the use of Reduce(S) at this
level of the tree. Afterward, the input theory is guar-
anteed to be pure and fully guarded. We handle unit
theories by passing them to UnitContradiction(S)
and return the negated result, as the function returns
true iff the theory is contradictory. Otherwise we pro-
1 Function Reduce(S):
2 while S contains equality guard do
3 S Application of rules (4)–(13)
consecutively. Return f alse if any of
the rules returns f alse. Return true
if any of the rules (5), (10)–(13)
return true (*);
4 end
5 if all atoms in S are fully guarded then
6 return PureTrichotomy(S);
7 end
8 return Trichotomy(S);
Algorithm 4: The Reduce function of the DPLL procedure.
ceed to the application of the pure trichotomy branch-
ing rule (3). The function iterates over every non-unit
clause and attempts to create at most three branches.
For the literal a, alternative literals b and c are gen-
erated that form the pure trichotomy a b c
2
. The
branching rule dictates that we create at most three
branches according to the pure trichotomy in ques-
tion (in each branch, only one of the literals is true).
If we proceeded to apply the branching rule (line 18)
by modifying only the clause at hand, the branching
would continue until all literals in all clauses have
been processed by UnitContradiction(S). There-
fore, we remove every occurrence of the counterpart
literals in S at this step, which significantly reduces
the search space. Before proceeding to create the
branches, we also use the simple look-ahead tech-
nique (lines 7–17) to check whether any of the literals
a, b, or c already appear in the theory and assume their
respective truth. In contrast to (Uhliarik, 2019), this
constrains the search space even further, as many pure
literal contradictions are eliminated at this level.
If a closed branch is derived after the removal of
counterpart literals, we return f alse, otherwise we re-
cursively call the PureTrichotomy function for ev-
ery branch. The iteration over literals in clauses is
unnecessary, as the branching here already modifies
the branched theories, so that in the worst case, every
literal is checked once.
The last function UnitContradiction(S) shown
in Alg. 6 uses the unit contradiction rule (1). For the-
ory S, the function returns true iff there exists a con-
tradictory -product of powers of literals, in which
case the branch is closed.
Note that at this step, if the branch remains open,
the theory is satisfiable and a valuation can be found,
e.g. using the partial valuation method described
in (Guller, 2013, Table 5). However, the current state
2
E.g. the concrete literal x y generates the counterpart
literals y x, x P y.
FCTA 2020 - 12th International Conference on Fuzzy Computation Theory and Applications
258
1 Function PureTrichotomy(S):
2 if S contains equality guard then return
Reduce(S);
3 if S is unit then return
UnitContradiction(S) == f alse;
4 S
0
S without unit clauses;
5 foreach clause c S
0
do
6 a first literal in c;
7 if a is in any unit clause of S then
8 remove clauses containing a in S;
9 add the unit clause {a} to S;
10 return PureTrichotomy(S);
11 end
12 b, c generated literals forming pure
trichotomy a b c;
13 if b or c is in any unit clause of S then
14 remove every occurrence of literal
a from clauses in S;
15 if derived then return f alse;
16 return PureTrichotomy(S);
17 end
18 S
1
, S
2
, S
3
split S using rule (3) over
a, b, c, removing occurrences of
negative literals from all clauses;
19 if derived in any of S
1
, S
2
, S
3
then
return f alse;
20 foreach S
00
{S
1
, S
2
, S
3
} do
21 if PureTrichotomy(S
00
) then
return true;
22 end
23 return f alse;
24 end
25 return f alse;
Algorithm 5: The PureTrichotomy function of the DPLL
procedure.
1 Function UnitContradiction(S):
2 if S is unit and rule (1) is applicable then
3 return true;
4 else
5 return f alse;
6 end
Algorithm 6: The UnitContradiction function of the
DPLL procedure.
of the solver and the scope of this paper does not cover
model-finding.
3.3 Unit Contradiction
In our previous work (Uhliarik, 2019) we described
the task of the unit contradiction rule (1) and analyzed
the approach of applying the rule on input theories.
The paper proposed an encoding of the theory as a
linear programming instance, but has not reached a
conclusion on how to find the solution to the problem.
In addition to the enhancements of the algorithm per-
forming DPLL described in Section 3.2, we fill the
gap by proposing a method to solve this part of the
procedure.
The applicability of the unit contradiction rule on
theory S is the problem of finding a contradictory
product of the form ε ε in S by using the operation
over pure order literals and the strict order guards
a
i
1. In other words, it is the task of choosing pow-
ers of literals such that their -product yields the con-
tradiction ε ε.
Example 1 (Uhliarik, 2019) illustrates this prob-
lem on the theory with fully guarded atoms a, b, and
the pure order literals {a
2
P b
3
, b a}. The boxed
literals (14), (15), (16) are associated with the re-
spective powers 1, 2, 1. By the -multiplication of
these powers of literals we obtain the contradiction
a
2
&b
3
a
2
&b
3
(17).
Example 1. Application of the unit contradiction rule
(Uhliarik, 2019)
0 a, 0 b, a 1, b 1
a
2
P b
3
, b a
a
2
P b
3
(14)
( b a )
2
(15)
b 1 (16)
a
2
&b
3
a
2
&b
3
— a contradiction (17)
Remark 1. To obtain a contradictory product, at
least one of the literals has to be strict order, accord-
ing to Definition 2 (operator ).
This problem can be solved using linear program-
ming (LP) with the representation of problems fol-
lowing our previous work (Uhliarik, 2019). For a unit
order clausal theory, let the variables of the LP prob-
lem represent its pure order literals and the guards
a
i
1, and the constraints represent the atoms. To
handle the commutativity of the equality operator P
P
P,
we encode each equality literal in the matrix twice,
once with the operands reversed. Then, let the coef-
ficients of the variables be equal to the difference of
powers of atoms appearing on the left- and right-side
of literals
3
. In the canonical form of linear programs
Ax = b, the matrix A is shown in Eq. 18,
3
E.g. given the literal a
2
&b
3
b
2
&c, the coefficient
for atom a is 2 0 = 2, for atom b it is 3 2 = 1, and for
atom c it is 0 1 = 1.
The Implementation of a Product Fuzzy DPLL Solver
259
A =
a
1,1
. . . a
1,2q
. . . a
1,2q+p
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
a
m,1
. . . a
m,2q
. . . a
m,2q+p
(18)
where the rows represent atoms, columns the literals;
a
i, j
being the difference of the power assigned to atom
at position i in literal at position j on the left and right
side of the literal; q is the number of equality liter-
als, p is the number of strict order literals (Uhliarik,
2019).
For the theory in Example 1 the coefficient matrix
is as shown in Eq. 19.
A
ex
=
2 2 1 1 0
3 3 1 0 1
(19)
The choice of powers of literals used in the oper-
ation must be such that in the resulting form ε ε
the difference of powers of atoms on the left- and
right-hand side are equal—the value of atoms in the
-product of literals must be equal to 0. Hence, we
consider the LP constraint bounds to be the vector b
in Eq. 20,
b = [
m
z
}| {
0, . . . , 0] (20)
where m is the number of atoms.
Since we assume any literal to be eligible with the
same weight, we represent the linear programming
objective function coefficients by the vector c shown
in Eq. 21,
c = [
2q+p
z }| {
1, . . . , 1] (21)
where q is the number of equality literals and p is the
number of strict order literals.
Finally, we seek to minimize the powers of liter-
als, so we assume the minimization objective.
With this configuration, however, the zero vector
is always the minimal solution for any theory, mean-
ing the solution is such where no literal is used in the
-product. This obviously cannot yield a contradic-
tion. To ensure we reject such solutions, we add an
additional constraint to only accept solutions such that
x 1. The matrix of coefficients A and the vector of
constraint bounds b then become A
0
(22) and b
0
(23),
A
0
=
a
1,1
. . . a
1,2q
. . . a
1,2q+p
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
a
m,1
. . . a
m,2q
. . . a
m,2q+p
1 . . . 1
(22)
b
0
= [
m+1
z }| {
0, . . . , 0] (23)
where m is the number of atoms, q the number of
equality literals and p the number of strict order lit-
erals. The type of constraint remains = (equality) for
the first m constraints, and changes to for the addi-
tional constraint.
As the variables in linear programming are by na-
ture continuous, the values of the solution might not
be integers. For the literals in Example 1, the solution
might be one such that the obtained powers of literals
(14), (15), (16) are 0.5, 1, and 0.5. This is equally
acceptable, as the intuitive interpretation using inte-
gers can be calculated by multiplying each power with
their least common multiple.
Remark 2. Throughout this paper we argue that one
of the advantages of our approach to solving satisfia-
bility in product propositional logic is its non-reliance
on translations into other systems, but our method of
handling unit contradiction does not uphold to this
statement. While this is true, our use of an external
linear programming solver is isolated to the applica-
tion of the unit contradiction rule. It is not necessar-
ily invoked in every problem instance. Despite this,
we find the use of an LP solver excessive and are con-
sidering a simpler, more direct approach for future
development.
4 IMPLEMENTATION
We have developed a working implementation of the
solver according to the algorithm proposed in Sec-
tion 3, which is available for download
4
and free to
use
5
.
The main software artifact prodfsat is a console
application that parses an input file containing product
propositional theories and outputs for each whether
the theory (a) is satisfiable and (b) its negation is sat-
isfiable (to determine whether it is valid).
The solver was developed using test-driven devel-
opment and the executable test suites are available in
the artifact prodfsat
tests. In addition to unit tests,
the solver is tested on a suite of sample theories con-
sisting of axioms and properties from (H
´
ajek, 2001),
(Guller, 2020), and a few custom examples.
In the rest of this section we describe the usage of
the main application and its features and limitations,
demonstrate the application on an example, and pro-
vide additional technical details.
4
https://git.uhliarik.com/ivor/prodfsat
5
Under the GNU General Public License v3.0 or later.
FCTA 2020 - 12th International Conference on Fuzzy Computation Theory and Applications
260
4.1 Application Usage
The console application accepts arguments according
to the following specification:
prodfsat [-s] [-p] [FILE]...
where:
the switches -s, -p enable the output of debug-
ging information related to input scanning and
parsing,
the list of positional arguments FILE... are the
files containing the input product propositional
theories.
The input is a plain-text file. The syntax the pro-
gram accepts is designed to be intuitive and versatile,
and follows the syntax and connective precedence of
Π
with the mapping shown in Table 1. Additionally,
atoms consist of alphanumeric characters, where the
first character must be alphabetic. The constants 0, 1
are straightforward, and powers of atoms must be pos-
itive integers. To override operator precedence, the
use of parentheses is supported as in the expression
"(-a && -b) == -(a || b)". The input may con-
tain a comment of the form "# ..." which is skipped
during parsing, but may only appear at the beginning
of a line. The appearance of two or more consecutive
newline characters acts as the separator of theories.
Note that the connective is not supported; its use as
in the expression x must be substituted with x P 1.
In Section 3.1 we’ve stated that we represent the
input theory as a single formula produced by the -
conjunction of the assumed theory’s elements. For
this reason, the last row of Table 1 lists the connec-
tive again, but instead with the lowest precedence;
commas and (single) newlines are treated as this case
of .
Table 1: The mapping of text strings to logical expressions.
Expression Text string Example
power "ˆ" "aˆ3"
¬ "-" "-a"
& "&" "a & 0"
P "=" "a = 0"
"<" "0 < a"
"&&" "0<a && a<1"
"v", "V", "||" "-a V --a"
"->", "-:" "a=1 -> a=0"
"<->", "==" "a&b == aVb"
(minprec) ",", \n "a<1, b<1"
We have pointed out throughout the paper that our
solver does not yet find the models in the sense of the
valuation of atoms. Any mentions of the construction
of models in the source code at the time of writing
instead refer to the listing of literals that are true in an
open branch.
4.2 Example
To demonstrate the application, we present an exam-
ple of proving the validity of the formula (24).
(0 c) &(a & c b &c) a b. (24)
We have encoded this formula into the text file
formula.txt in the following form:
(0 < c) & (a & c < b & c) -> a < b
Now we run the program using the filename as the
argument: prodfsat formula.txt
The application first informs us about the success-
ful parsing of the formula:
[info] Parsing result:
((0 < c & (a & c) < (b & c)) -> a < b)
Then, the program translates the formula into or-
der clausal form for solving the SAT problem and out-
puts this form, where each auxiliary atom is named
with an asterisk and its order number. The same is
written out for the VAL case (not shown).
6
[info] SAT: In clausal form:
(((*0) = (1)))
(((*1) < (*2)) V ((*1) = (*2))
...V ((*1 & *0) = (*2)))
(((*2) < (*1)) V ((*0) = (1)))
(((*1) = (*3 & *4)))
(((*5) < (*6)) V ((*2) = (0)))
(((*6) < (*5)) V ((*6) = (*5))
...V ((*2) = (1)))
(((0) < (*7)) V ((*3) = (0)))
(((*7) = (0)) V ((*3) = (1)))
(((*8) < (*9)) V ((*4) = (0)))
(((*9) < (*8)) V ((*9) = (*8))
...V ((*4) = (1)))
(((*5) = (a)))
(((*6) = (b)))
(((*7) = (c)))
(((*8) = (*10 & *11)))
(((*9) = (*12 & *13)))
(((*10) = (a)))
(((*11) = (c)))
(((*12) = (b)))
(((*13) = (c)))
6
The output of the program listed here has been aesthet-
ically modified.
The Implementation of a Product Fuzzy DPLL Solver
261
Finally, the application outputs the results of SAT
and VAL testing.
[info] Satisfiability: true
[info] Satisfied literals:
(*12) = (0)
(*11) = (0)
(*10) = (0)
(*1) = (0)
[info] Satisfiability of negation: false
We find that the formula is satisfiable (if every
atom has the value 0, the antecedent is false) and its
-negation is unsatisfiable (the formula is valid).
4.3 Technical Details
The application is implemented in the C++ language.
In the source code we utilize features of modern C++
standards up to C++20, for the purpose of straightfor-
ward representation (structured binding declaration of
tuple elements, list initialization), and to achieve effi-
cient memory handling (move semantics, mandatory
copy elision).
While the implementation strives to be operating-
system agnostic, it has only been tested in the Linux
environment. The complete list of build and runtime
dependencies, as well as the instructions to build the
project are documented on the project’s website.
5 EVALUATION
To validate the correctness of the implementation and
evaluate its performance, we have created the set of
69 test formulae originating in fuzzy logic literature
(H
´
ajek, 2001; Guller, 2020) and some of our custom
input. The formulae comprise the axioms of H
´
ajek’s
basic logic (8 formulae), the properties of basic logic
(49 formulae), product logic axioms and formulae
proved in Π (5 formulae); two examples from Guller,
and five examples created during development. The
tests formulated as inputs for our solver can be found
among the project’s source code, and the tests may
be executed by running the prodfsat tests program
(test suite Solving).
For every formula, both the satisfiability and va-
lidity checks have been performed. The samples from
(H
´
ajek, 2001) should all be tautologies, others are ei-
ther tautologies, only satisfiable, or unsatisfiable.
We have grouped the samples by the area of their
origin (e.g. BLConj consists of the properties of con-
junction in basic logic), which also reflects their sep-
aration inside the project’s test files, and measured
the runtime
7
required to prove (non-)satisfiability and
(non-)validity. To conduct the measuring, the exe-
cutable prodfsat tests was built using the default
release profile of the CMake build system version
3.18.0 and the compiler GCC version 10.1.0. The
measurements were recorded five times, each time af-
ter clearing the system’s cache. The results in mil-
liseconds are provided in Table 2, where SD stands
for standard deviation and NM is the mean normal-
ized by the size of group.
Table 2: Measurement of runtime of test samples in mil-
liseconds.
Group Size Mean SD NM
BLAxioms 8 709.2 43.51 88.65
BLConj 8 966.4 35.75 120.80
BLConstant 3 4.4 0.55 1.47
BLDisj 8 953.2 12.32 119.15
BLEquiv 9 1017.2 15.56 113.02
BLImpl 3 107.0 2.55 35.67
BLNegation 6 54.6 3.44 9.10
BLStrongConj 6 706.2 12.83 117.70
BLMisc 6 519.2 25.17 86.53
ProductLogic 5 115.4 2.51 23.08
Guller 2 234.6 4.56 117.30
Custom 5 135.2 6.14 27.04
Total 69 5587.4 90.03 80.98
As can be seen in Table 2, the average time of run-
ning the full suite of samples is 5.59 seconds, and the
average time to run a single pair of SAT and VAL
tests is 80.98 ms. The measurements of individual
test samples (omitted for brevity) would reveal that
the minimum runtime was in some cases (BL axiom
2 and 8, BL constant samples, etc.) as low as only a
few hundred microseconds.
We have yet to establish a set of benchmark tests
to be able to perform comparative empirical evalua-
tion with other existing approaches. The construc-
tion of such a benchmark is considered for future
work. The MNiBLoS solver (Vidal, 2016) mentioned
in Section 1 is the closest to our solution in its goals,
but for now, only the small intersection of the results
on BL axiom samples may be discussed.
In (Vidal, 2016, Sect. 4.2), the first set of measure-
ments has been conducted over the product general-
izations of BL axioms of the form (p
n
&q
n
) p
n
.
7
The measurements were conducted on a personal com-
puter with the CPU frequency of 3.31 GHz; the implemen-
tation is single-threaded.
FCTA 2020 - 12th International Conference on Fuzzy Computation Theory and Applications
262
With increasing n, it is shown that the runtime in-
creases polynomially. In these cases, our solution
is advantageous in the representation of powers of
atoms, as the increase of n does not change the behav-
ior of the solver, and the average runtime stays con-
stant. The runtime of MNiBLoS for these formulae
over different values of n is on average higher than
ours (our solution having the average runtime of 21
ms with BL axiom 3 and 119 ms with BL axiom 4),
but these differences are not representative, as they
were conducted on different machines, and the author
of MNiBLoS proposes a better set of tests that has yet
to be integrated and compared with our solution.
6 CONCLUSION AND FUTURE
WORK
In this paper we have presented the results of our
work, which included the refinement of our determin-
istic version of the product fuzzy DPLL algorithm and
proposed a method of applying the unit contradiction
rule. Also, we have reached the milestone of our re-
search by contributing the first working implementa-
tion of the solver of its kind.
However, there are still areas that could be im-
proved with future work. First, we seek to establish a
benchmark for performing more extensive compara-
tive evaluation with existing solutions. Moreover, we
would like to implement the admissible DPLL rules
to make the implementation yet more efficient. In ad-
dition to solving the SAT and VAL problems, in the
future versions of the implementation we will also at-
tempt to integrate solving the deduction (DED) prob-
lem and finding valuations for models.
ACKNOWLEDGEMENTS
This work was supported by the Slovak Re-
search and Development Agency under contract No.
APVV-19-0220 (ORBIS) and by the Slovak VEGA
agency under contract No. 1/0778/18 (KATO).
REFERENCES
Alviano, M. and Pe
˜
naloza, R. (2015). Fuzzy answer set
computation via satisfiability modulo theories. TPLP,
15(4-5):588–603.
Baaz, M., H
´
ajek, P.,
ˇ
Svejda, D., and Kraj
´
ı
ˇ
cek, J. (1998).
Embedding logics into product logic. Studia Logica,
61(1):35–47.
B
´
ejar, R., Alsinet, T., Bou, F., Barroso, D., Cerami, M.,
and Esteva, F. (2013). On the Implementation of a
Fuzzy DL Solver over Infinite-Valued Product Logic
with SMT Solvers. volume 8078.
Bobillo, F. and Straccia, U. (2007). A fuzzy description
logic with product t-norm. In 2007 IEEE International
Fuzzy Systems Conference, pages 1–6.
Brys, T., Drugan, M. M., Bosman, P. A., De Cock, M.,
and Now
´
e, A. (2013). Solving Satisfiability in Fuzzy
Logics by Mixing CMA-ES. In Proceedings of the
15th Annual Conference on Genetic and Evolutionary
Computation, GECCO ’13, pages 1125–1132, New
York, NY, USA. ACM.
Davis, M., Logemann, G., and Loveland, D. (1962). A Ma-
chine Program for Theorem-proving. Commun. ACM,
5(7):394–397.
Guller, D. (2013). A DPLL procedure for the proposi-
tional product logic. In Proceedings of the 5th Inter-
national Joint Conference on Computational Intelli-
gence - Volume 1: FCTA, (IJCCI 2013), pages 213–
224. INSTICC, SciTePress.
Guller, D. (2020). Technical Foundations of a DPLL Pro-
cedure for Propositional Product Logic. Submitted
manuscript in Journal of Applied Logics IfCoLoG
Journal of Logics and their Applications.
H
´
ajek, P. (2001). Metamathematics of Fuzzy Logic. Trends
in Logic. Springer.
Janssen, J., Schockaert, S., Vermeir, D., and De Cock, M.
(2012). Answer Set Programming for Continuous Do-
mains: A Fuzzy Logic Approach. Atlantis Computa-
tional Intelligence Systems. Atlantis Press.
Mostert, P. S. and Shields, A. L. (1957). On the structure
of semigroups on a compact manifold with boundary.
Annals of Mathematics, 65(1):117–143.
Suttner, C. and Ertel, W. (1990). Automatic acquisition
of search guiding heuristics. In Stickel, M. E., edi-
tor, 10th International Conference on Automated De-
duction, pages 470–484, Berlin, Heidelberg. Springer
Berlin Heidelberg.
Uhliarik, I. (2019). Foundations of a DPLL-Based Solver
for Fuzzy Answer Set Programs, pages 99–117.
Springer International Publishing, Cham.
Vidal, A. (2016). MNiBLoS: A SMT-based solver for con-
tinuous t-norm based logics and some of their modal
expansions. Information Sciences, 372:709 – 730.
The Implementation of a Product Fuzzy DPLL Solver
263