Tutorial: Complexity of Many-Valued Logics Reiner H¨ahnle Chalmers University of Technology, Dept. of Computing Science S-41296 Gothenburg, Sweden,
[email protected] 1. Members of and logical constants are L0 -formulas.
1 Introduction
2. If 2 , () = r > 0, and '1 ; : : : ; 'r are L0 formulas, then also ('1 ; : : : ; 'r ) is an L0 -formula.
Like in the case of classical logic and other non-standard logics, a variety of complexity-related questions can be asked in the context of many-valued logic. Some questions, such as the complexity of the sets of satisfiable and valid formulas in various logics, are completely standard; others, such as the maximal size of representations of many-valued connectives, only make sense in a many-valued context. In this overview I concentrate mainly on two kinds of complexity problems related to many-valued logics: in Section 6 I discuss the complexity of the membership problem in various languages, such as the satisfiable, respectively, the valid formulas in some well-known logics. Two basic proof techniques are presented in some detail: a reduction of many-valued logic to mixed integer programming and a reduction to classical logic. I do not mention results on complexity of algorithms, in particular, of constructing decision diagrams, because they are a quickly moving target. Instead, in Section 7, I discuss the size of representations of many-valued connectives and quantifiers, because this has a direct impact on the complexity of many kinds of deduction systems. I consider results on both propositional and firstorder logic throughout the article. The following Section 2 sets up a framework, in which a wide class of many-valued logics can be discussed. This is followed by three brief sections that introduce into Signed Logics, Mixed Integer Programming, and Polynomial Expressions, respectively. I tried to make this article self-contained.
The concrete signature usually is not relevant, and then we omit it from the index. Example 1. Throughout this article, 0 is a logical constant, all connectives of the form :x are unary, while !x , _, ^, x , x are binary ones. The language L0 of classical propositional logic contains the connectives 0; ^; !. The language L0Ł of Łukasiewicz logic contains the connectives 0; Ł ; !Ł . The language LG0 of G¨odel logic contains the connectives 0; ^; !G . The language L0 of product logic contains the connectives 0; ; ! . We say negation to the connectives :x , implication to !x , conjunction to ^, disjunction to _, product to x , and sum to x . This can be qualified with a language, for ex-
ample, when one says “Łukasiewicz implication”, the connective !Ł is meant, etc. A propositional matrix A0 = hN; (A )2 i for a propositional language L0 = h; i consists of a non-empty set of truth values N and a collection (A )2 of operations on N such that A : N () ! N for each 2 . jN j denotes the cardinality of N . A pair L0 = hL0 ; A0 i, where L0 is a propositional language and A0 is a matrix for L0 , is called (N -valued) propositional logic. Example 2. For each n 2 let n = f0; n 1 1 ; : : : ; nn 12 ; 1g be the truth value set of cardinality n consisting of equidistant rational numbers. With [0; 1℄ we denote the closed real unit interval. In the following, let N be either [0; 1℄ or n for some n. In all logics considered below, A0 = 0, A^ = min, and A_ = max. Moreover, implication is always defined as A!x (i; j ) = supfk j A x (i; k ) j g with the help of product. This process is called residuation. In classical propositional logic L0 , n = 2 (hence, N = f0; 1g). If residuation is based on ^, the usual definitions result. In Łukasiewicz logic [36] L0Ł , A Ł (i; j ) = maxf0; i + j 1g. In G¨odel logic [23] L0G , A^ = A G = min. In
2 A Framework for Many-Valued Logic 2.1 Propositional Logic As usual, a countably infinite set of propositional variables = fp; q; r; : : : g is a propositional signature. Let be a finite set of operator names, called connectives; the arity of 2 is a non-negative integer given by a function . Connectives with arity 0 are called logical constants. Given a propositional language L0 = h; i and a signature , the set of L0 -formulas is defined inductively as usual: 1
product logic [32] L0 , A = (multiplication). Product logic is only defined for N = [0; 1℄, because none of the sets n is closed under A .
a possibly empty family of function symbols disjoint from P , and assigns an arity to each member of P [ F . Let Term be the set of -terms, defined inductively as usual over a countably infinite set of object (or individual) variables Var = fx0 ; x1 ; : : : g:
In fuzzy theory one considers frequently 0 and x as primitive operators, in algebraic treatments :, and ! or . The base is not really relevant, for example, in each of the logics above, negation and conjunction connectives are obtained by: (1) (2)
:x '
' ^x
for for
1. Members of Var and terms.
2 F with ( ) = 0 are -
2. If f 2 F , (f ) = r > 0, and t1 ; : : : then f (t1 ; : : : ; tr ) is a -term.
' !x 0 ' x (' !x )
; tr are -terms,
At = fp(t1 ; : : : ; tr ) j p 2 P ; (p) = r; ti 2 Term g is the set of atoms, Term0 is the set of variable-free terms. A first-order language is a triple L = h; ; i, where h; i is a propositional language and is a finite set of first-order quantifiers.
An N -valued matrix A0 is called functionally complete, if every m-ary function f : N m ! N can be defined using operators from A0 alone. The matrix of classical logic is functionally complete. None of the other matrices is functionally complete. A propositional interpretation I determines the truth value of each variable in a given signature , hence it is simply a mapping I : ! N . For each propositional many-valued logic L0 its matrix A0 uniquely determines the extension of any -interpretation to a propositional valuation function on L0 (denoted with the same symbol): (3)
Example 4. All of the propositional languages L0x defined in Example 1 are extended to first-order languages Lx by adding the quantifier set = f8; 9g. The set of L -formulas of a first-order language L over a first-order signature is inductively defined: 1. The atoms over are L -formulas.
2. If 2 , () = r > 0, and '1 ; : : : ; 'r are L formulas, then also ('1 ; : : : ; 'r ) is an L -formula.
I(('1 ; : : : ; 'r )) = A (I('1 ); : : : ; I('r )) :
Let D be any subset of N and a set of L0 -formulas. We say that is D-satisfiable, if there is a -interpretation I such that I(') 2 D for all ' 2 . Such an I is called D-model of , in symbolic notation I j=D . The set is D-valid, if all -interpretations are D-models of , in symbols j=D . We usually write j=D ' instead of j=D f'g. Finally, a formula ' is a D-consequence of if every D-model of is a D-model of ', in symbols j=D '. The well-known duality between satisfiability and validity known from classical logic, extends as follows: ' is Dvalid iff it is not N nD-satisfiable. D = ; is not excluded for technical reasons; obviously, no formula is ;-satisfiable. The notions of D-validity and -satisfiability are due to [35]. In many cases, the set D is considered to be fixed in a given many-valued logic. It is then called the set of designated truth values, and one writes “satisfiable” instead of “D-satisfiable”, “j=” instead of “j=D ”, etc.
2 , ' 2 L , and x 2 Var, then (x)' is an L -formula and ' is the scope of (x)'.
3. If
A variable x 2 Var occurs bound in a formula ', if ' contains a subformula of the form (x) . It occurs free, if there is an occurrence of x in ' that is not in the scope of a subformula of the form (x) . If L = h; ; i is a first-order language, then a firstorder matrix is a triple A = hN; (A )2 ; (Q )2 i, where hN; (A )2 i is a propositional matrix for h; i and Q : P + (N ) ! N for each 2 , where P + (N ) are the non-empty subsets of N . Q is called the distribution function of the quantifier . A pair L = hL; Ai, where L is a first-order language and A is a first-order matrix for L, is called (N -valued) first-order logic. Example 5. From each first-order language Lx of Example 4 one obtains a first-order logic Lx over N = [0; 1℄ or N = n with distribution functions Q8 = inf , Q9 = sup. It would not do to have only rational numbers as truth values, because the rationals are not closed under inf and sup. The reader may check that L is classical first-order logic.
Example 3. For the logics of Example 2 the usual choice for the designated truth values is D = f1g. These are examples of valid formulas in each of the logics of Example 2: (' !x ) !x (( !x ) !x (' !x )), (' x ) !x '.
2.2 First-Order Logic
Given a first-order signature
,
a first-order structure
M = hD; Ii fixes a non-empty set D, the domain of dis-
A first-order signature is a triple hP ; F ; i, where P is a non-empty family of predicate symbols, F
course, and the meaning of function and predicate symbols via an interpretation I that maps each function symbol 2
2 F of arity r into a function I(f ) : Dr ! D, and each predicate symbol p 2 P of arity r into a function I(p) : Dr ! N . Observe that for F = ; and P con-
define existential and W universal quantifiers 9 and 8, where vM; j= (9x)' iff d2D (vM; xd j= ') and similar for 8.1 More generally, whenever N is a complete lattice with operations u and t, universal and existential quantifiers and can be defined as above, and they are characterized by F Q (S ) = i2S i, respectively, by Q (S ) = i2S i, see [60, 5, 29]. Here, we take a more general stance. The idea of considering distributions of values is encountered in two-valued logic as well: generalized two-valued quantifiers are obtained from Q : 2D ! ftrue; falseg based on the distribution fd 2 D j vM; xd (') = trueg. The present notion of a many-valued quantifier is due to [49, Chapter IV], but appears implicitly already in [42].
f
taining only 0-ary predicate symbols I reduces to a propositional interpretation. Like in the propositional case, for each first-order logic L its matrix A uniquely determines for any first-order structure M a valuation function on arbitrary terms and L formulas. In addition, one must specify the meaning of object variables that might occur within formulas. This is done as usual with a variable assignment : Var ! D. For given M and , the first-order valuation function vM; maps terms into D and L -formulas into N . For t 2 Term , one writes tM; instead of vM; (t). The definition is by induction: xM; = (x); x 2 Var f (t1 ; : : : ; tr )M; = ; M; I(f )(tM 1 ; : : : ; tr ); f 2 F ; (f ) = r
F
2.3 McNaughton’s Theorem ;i Denote with Iip11;::: ;::: ;prr an interpretation that fixes I(pj ) = ij for 1 j r. Any propositional formula ' over r variables, say, p1 ; : : : ; pr , determines for any given logic in a natural way a function f' : N r ! N via f' (i1 ; : : : ; ir ) = ;ir 0 Iip11;::: ;::: ;pr (') for all i1 ; : : : ; ir 2 N . Each LŁ -formula ', in particular, determines for Łukasiewicz logic a function f' : [0; 1℄r ! [0; 1℄. It is easy to prove (or see [18, 3.1.8]) that for every ' 2 L0Ł over r variables, f' has the following properties: 1. f' is continuous; 2. there is a finite set P of linear polynomials with integral coefficients in r variables over [0; 1℄ such that for each ~{ 2 [0; 1℄r , there is a polynomial P 2 P with f' (~{) = P (~{). McNaughton [40] showed that, conversely, for every function f : [0; 1℄r ! [0; 1℄ satisfying the above properties, there is a formula ' of Łukasiewicz logic such that f = f' . McNaughton originally gave an indirect argument, but as shown in [44], the formula ' can be effectively constructed from f .
vM; (p(t1 ; : : : ; tr )) = ; M; I(p)(tM 1 ; : : : ; tr ); p 2 P ; (p) = r vM; (('1 ; : : : ; 'r )) = A (vM; ('1 ); : : : ; vM; ('r )); 2 ; () = r vM; ((x)') = Q (fvM; xd (') j d 2 Dg); 2 The expression fvM; xd (') j d 2 Dg above is the distribution of ' at x.
Satisfaction is defined analogously to the propositional case, with the exception that the presence of assignments gives rise to one more concept, just as in classical logic. Let D be any subset of N and a set of L -formulas. We say that is D-satisfiable if there is a first-order structure M over and a variable assignment such that vM; (') 2 D for all ' 2 , for short write M; j=D . When M; j=D for all variable assignments , is said to be D-true in M, for short M j=D , and M is called D-model of . The formula set is D-valid if it is true in all first-order -structures, in symbols j=D . Logical consequence is defined as before, that is, j=D ' iff every D-model of is a D-model of '. The conventions about dropping D when it is obvious and identifying f'g with ' are as above.
3 Mixed Integer Programming It is well-known (see, for example, [33, 34]) that propositional classical formulas in conjunctive normal form correspond to certain 0-1 integer programs. More precisely, given a set of classical disjunctive clauses over the signature one transforms each clause of the form C = p1 _ _pk _:pk+1 _ _:pk+m into a linear inequation
Example 6. For the logics of Example 5 the usual choice for the designated truth values is D = f1g. Here are some examples of formulas that are valid in each of these logics: (8x)(' !x ) !x (' !x (8x) ), whenever x not free in ', (8x)(' !x ) !x ((9x)' !x ), whenever x not free in .
(4)
Pk
i=1 pi
Pm
j =k+1 pj
1 m
Here, the variables from are interpreted as function variables ranging over f0; 1g. It is easy to see that the resulting set of inequations is solvable iff is satisfiable: recall that A_ (i; j ) = maxfi; j g and A: (i) = 1 i, so clause C is satisfiable iff fC 1 iff (4) holds.
The semantics of quantifiers in many-valued logic is not straightforward. In logics having disjunction- and conjunction-like connectives _ and ^, these can be used to
1 In abuse of notation, the symbol junction as well.
3
_ is used to denote meta-level dis-
This is an MIP-representation of Ł , where x and y are argument variables, i is output variable and z is an additional variable with type f0; 1g: to justify this claim, set first z = 0. Then the polynomial P1 (x; y ) = i = x + y is defined by (i) and (ii), inequations (iii) and (v) are trivially satisfied, and (iv) determines the area in which P1 equals Ł. The case z = 1 is similar. An MIP-representation of :Ł is straightforward:
McNaughton’s theorem suggests that this embedding of logic into integer programming can be generalized to cover Łukasiewicz logic (after all, a McNaughton function is defined by linear polynomials) and, indeed, it turns out to be possible [25, 28]. To aid the presentation of this result, let us recall some facts and definitions about Mixed Integer Programming (MIP). With the expression linear inequation I mean in the following always a term of the form a1 p1 + + am pm , where a1 p1 + + am pm is a linear polynomial over variables fp1 ; : : : ; pm g and integral coefficients fa1 ; : : : ; am ; g. The type of the variables can be any truth value set N as defined in Example 2. The expression a1 p1 + + am pm is called linear term.
x i x + i
Theorem 3 [28]. 1. If '(p~) is a formula of an MIP-representable logic then there is an MIP J' with argup and output variable y whose feasiment variables ~ ble solutions restricted to (p~; y ) are the function f' (p~). Moreover, the size of J' is linear in the size of '. 2. Let J be an MIP over variables . Then there is a formula 'J 2 L0Ł which is satisfiable iff J is feasible. Part 1 does not require integrity of coefficients of the associated functions f' in a crucial way, hence it works for logics corresponding to generalized McNaughton functions with possibly non-integral coefficients. To determine the algebraic and logical counterpart of this class of functions is ongoing research. Non-continuous (but linear) connectives, such as G¨odel implication and negation, can easily be handled by MIPs with strict inequalities. The connectives of product logic, on the other hand, lead outside MIP and into non-linear programming.
Only the feasibility part of (M)IPs/LPs is required, cost functions are not considered in the following. Definition 2. Let M [0; 1℄k . M is a MIP-representable
set if there is an MIP J over variables 0 = fx1 ; : : : ; xk g with type [0; 1℄ and variables 00 with type f0; 1g such that M = f~x j ~x is feasible solution of J for some : 00 ! f0; 1gg. A many-valued logic is MIP-representable iff for all its connectives 2 the function A , is an MIPrepresentable subset of [0; 1℄()+1 . The variable in a relational MIP-representation of a function that holds the function value is called output variable, the variables that hold the function arguments are called argument variables.
4 Signed Logic Signed logics are characterized by having capability for semantic reflexion: elements of their semantic domain can be directly expressed by syntactical entities: signs. Semantic reflexion does, in principle, not depend on the presence of signs. For example, it is easy to express in classical logic that a formula evaluates to a certain truth value. Consider the formula (1 $ (p _ :p)) ^ (' $ 1) that first defines the logical constant 1, and then says that ' always evaluates to truth value 1. In signed logics there is a separate syntactic category for truth values (called signs). Instead of ' $ 1 one writes 1:', etc. In classical logic, the difference between signed and unsigned formulas is only notational. In non-classical logics, however, truth values may not definable or only at great cost. Therefore, signed logics are used in various deductive approaches to reasoning in non-classical logics, in particular, many-valued logics [50, 24, 5]. In general, one takes
All finite-valued logics are MIP-representable, simply because A is a finite subset of [0; 1℄()+1 . It is more interesting that Łukasiewicz logic is MIP-representable. Consider the following MIP:
x + y + x y + x + y x y +
z i z + i z z z + i
0 0 0 1 0
2 The adjective integer is justified, because the elements of N can without loss of generality assumed to be of the form 0; 1; : : : ; n 1 .
f
1 1
All other connectives are definable with Ł and :Ł . Now McNaughton’s Theorem can be strengthened to provide a direct link between MIP-representable logics and MIP:
Definition 1. Let J be a finite set of linear inequations and K a linear term. Let be the set of variables occurring in J and K . Assume the type N of each variable is finite. Then hJ; K i is a bounded integer program (IP) with cost function K .2 If the type of variables is either f0; 1g or [0; 1℄, then one has a bounded 0-1 mixed integer program (MIP). When all variables in run over infinite N , the result is a bounded linear program (LP). A variable assignment : ! [0; 1℄ that respects the type of each variable and such that all inequations in J (the MIP, resulting from replacing each x 2 with (x) in J) are satisfied is called a feasible solution of hJ; K i. A variable assignment such that the value of K is minimal among all feasible solutions is called an optimal solution. hJ; K i is feasible iff there are feasible solutions.
(i) (ii) (iii) (iv) (v)
g
4
If N is equipped with an ordering, there is a natural notion of a Horn formula. Recall that in classical logic a CNF formula is a Horn formula iff each clause contains at most one positive literal. Signed atoms are, in general, neither positive nor negative in any sense, but a natural notion of polarity is present in regular signs (7): literals of the form "i:p are positive while literals of the form "i:p are negative. With this convention, a regular Horn formula is defined exactly as in the classical case.
truth value sets as signs, because this can speed up proof search exponentially [24]. Definition 4. A signed formula of an N -valued logic L is an expression of the form S :', where S N , and ' 2 L. Satisfiability, validity, and consequence of signed formulas are defined with D-satisfiability, etc., by identifying j=S ' with j= S :'. If ' is atomic, S :' is called signed atom. If S is a singleton, one has a monosigned formula. A signed formula S :' is an implicit disjunction over the statements I(') = i for all i 2 S . This additional level in the language leads to more compact syntactic characterizations of connectives and quantififers. Not every subset of N is necessarily admitted as a sign. Several systems of signs are considered, for example: (5) (6) (7)
Smono Sfull Sregular
= = =
5 Polynomial Expressions Decision diagrams (DD) are a family of data structures originally developed for efficient representation and manipulation of Boolean formulas, but now successfully used for many purposes in computer science, in particular in circuit design tools [15]. Many-valued decision diagrams can be computed with the help of a generalized Shannon expansion:
ffig j i 2 N g P +(N ) fN g f"i j i 2 N; "i 6= N g [ f"i j i 2 N; "i = 6 Ng
The last is the set of non-trivial order filters of N and their complements that are generated by single elements. It is defined for any partially ordered set of truth values. For totally ordered N , these are exactly the prime ideals/filters and their complements and were called regular sign in [24]. The name is kept for the present, more general, definition. A signed conjunctive V normalWform (CNF) formula has M Jk S :p , in which the the form (8x1 ) (8xr ) k=1 l=1 kl kl Skl :pkl are signed atoms and fx1 ; : : : ; xt g are the free variables in the scope. For any 1 k M , the expression (8)
(9)
'
8 switch p > > > > < case 0 :
case n 1 1 > > > > :
case
'fp=0g; : 'fp= n 1 1 g;
1:
'fp=1g
It is based on an (n + 1)-ary switch connective in nvalued logic with the following semantics:
Aswitch(i; j0 ; : : : ; jn 1 ) =
(8y1) (8ym)(Sk1 :pk1 _ _ SkJk :pkJk )
8 j0 > > < > > :
if i = 0 if i = n 1 1
j1
jn
1
if i = 1
If n = 2, the usual if-then-else connective and the Shannon expansion, on which binary decision diagrams are based, is obtained. Write (9) as f0g:p ^ 'fp=0g_ _ f1g:p ^ 'fp=1g. If, in addition, we write a signed atom of the form fig:p as pi , “^” as “”, and “_” as “+”, then we obtain for n = 2, for example,
where fy1 ; : : : ; ym g are the free variables in the scope, is a signed clause. Like in classical logic, the quantifier prefix is often not written explicitly and a signed CNF formula is identified with the set of its clauses. Any signed formula in any finite-valued first-order logic has an at most polynomially larger signed CNF, which is satisfiability equivalent [26]. Signed CNF formulas are generic or “logic-free” in the sense that their syntax and semantics are fixed and independent of any logic. Signed CNF formulas do not contain any many-valued connective and are simply a generic and flexible language for denoting many-valued interpretations. Regular CNF formulas are signed CNF formulas, where all occurring signs are regular (7). Regular CNF formulas are a natural formalism whose syntactical expressivity is between classical CNF and bounded IP. Many combinatorial optimization problems can be formulated easily as Regular CNF instances, and there is experimental evidence that a regular logic problem formulation can be more efficiently solvable than a classical one [12].
p!q
p1 (1 ! q) + p0 (0 ! q) p1 (q1 (1 ! 1) + q0 (1 ! 0)) + p0 (q1 (0 ! 1) + q0 (0 ! 0)) p1 q 1 1 + p 1 q 0 0 + p0 q 1 1 + p 0 q 0 1 Assume fp1 ; : : : ; pk g are the variables occurring in a
formula. In switching theory [53], a polynomial expression as above is known as sum-of-products expression or SOP, the products pi11 pikk are called minterm, and the coefficients 0, 1 discriminant. Many readers will have realized that an SOP is also a disjunctive normal form (DNF). 5
Replacing disjunction “+” with exclusive or “” yields an exclusive-or-of-products expression or ESOP, which is of great practical value [53]. In the two-valued case, the Shannon expansion yields SOP expressions. In this case, p ^ q 0 iff p q p _ q, so one obtains ESOP expressions in the same way. There are many kinds of polynomial representations. Most of them, for example, general SOPs and ESOPs are not canonical (that is, there is more than one (E)SOP that represents the same function). On the other hand, certain restrictions of (E)SOPs are canonical, for example, positive polarity Reed-Muller (PPRM) expressions [53]. Polynomial expressions can be immediately realized with two-level networks. In the many-valued case one may, of course, consider arbitrary signed atoms S :p in minterms. Written pS , they are known in logic design under the name set literal or universal literal [51, 20].
Co-NP-completeness of VALL0 was shown by Mundici Ł [43]. The polynomial embedding of MIP-representable logics described in Section 3 also yields NP-easiness of G¨odel logic and of the extension of Łukasiewicz logic that is characterized by piecewise linear functions with rational coefficients (discussed at the end of Section 3). In [31] also the complexity of the sets N nf0g-SATL and N nf0g-VALL is considered. While the decision problems of propositional infinitevalued Łukasiewicz, G¨odel and product logic have the same complexity as two-valued logic, the situation changes drastically in the first-order case: Theorem 6. VALLG is 1 -complete and VALL is 2 -complete, whenever L 2 fLŁ ; L g, if N = [0; 1℄. The proofs are rather technical and must be omitted (they can be found in [31]). 2 -completeness of LŁ was first shown in [55, 48]. An embedding of LŁ into LG [31] can be used to show 2 -completeness of the latter. 1 -easiness follows from the existence of a complete first-order axiomatization [31]. Surprisingly, VALLG is not recursively enumerable anymore, for example, over the truth value set 1 j n 2 INg [ f0g [8]. So the order type of N = f n+1 the truth value set can drastically change the complexity of infinite-valued first-order logic. The complexity of deciding logical consequence depends on the availability and form of deduction theorems for a given logic. In the following theorem 'm stands for ' x x ' (m copies of '). Theorem 7. Let L0 be any of the logics of Example 2. if is any set of L0 -formulas and '; 2 L0 , then [fg j= ' iff j= m ! ' for some m 2 IN.
6 Satisfiability and Validity Given an N -valued (propositional or first-order) logic L, a truth value set D N , denote with D-SATL the Dsatisfiable formulas, with D-VALL the D-valid formulas of L. Further, let SATL =f1g-SATL and VALL =f1g-VALL . Theorem 5. SATL is NP-complete, VALL is co-NP-complete for L 2 fL0 ; L0G ; LŁ0 ; L0 g and any choice of N .
Proof. (Sketch) For L0 this is, of course, Cook’s Theorem. For hardness of the problems associated to a logic L0 2 0 fLG; L0Ł ; L0 g, first observe that by virtue of equations (1), (2) one may assume that L0 L0 . Now it is sufficient to define for each ' 2 L0 an L0 -formula ' that restricts L0 interpretations of ' to values in f0; 1g. Then ' 2 SATL0 iff 0 0 ' ^ ' 2 SAT V L . In the case of LŁ , for example, one can use ' = p occurs in ' (p _ :p), in the other logics similar formulas work. For finite-valued logics, NP-, respectively, co-NP-easyness is straightforward, so assume N = [0; 1℄ for the remaining cases. SATL0 =SATL0 =SATL0G is shown by giving straightforward polynomial-size embeddings of the latter two into the first, see [31]. VALL0G [7]: assume there is an interpretation I of ' 2 L0G over variables p1 ; : : : ; pm such that I(') < 1. There is a trivial order-isomorphism o mapping I(p1 ); : : : ; I(pm ) into m + 2 = f0; m1+1 ; : : : ; mm+1 ; 1g, All G¨odel operations f have the property that f (i1 ; : : : ; i(f ) ) 2 fi1 ; : : : ; i(f ) g[ f0; 1g, hence, o(I)(') < 1; now it suffices to guess such an interpretation over m + 2 and check that o(I)(') < 1, which can obviously be done in polynomial time. VALL0 : there is a polynomial embedding of L0 into L0Ł , see [7]. VALL0 , SATL0 : an immediate consequence of TheoŁ Ł rem 3(1).
For classical logic, this is a well-known result (and m = For Łukasiewicz logic the theorem was proven in [47] and improved in [17, 3] by giving a concrete upper bound for the number m, depending on , ', (an exponent in the number of variable occurrences in the formulas). For G¨odel logic, again m = 1 is sufficient, that is, the classical deduction theorem holds for G¨odel logic. More general results are in [31]. More fine-grained investigations were made into the complexity of satisfiability problems associated with signed CNF formulas (8). Let CNF-SAT be the set of satisfiable propositional signed CNF formulas, let 2-CNF-SAT be the restriction of CNF-SAT, where signed clauses contain exactly two signed atoms, and let HORN-SAT be the satisfiable regular Horn formulas. If the truth value set N , together with a partial order, is fixed, this is denoted with CNF-SATN , 2-CNF-SATN , and HORN-SATN . Similar to the classical case, CNF-SAT is NP-complete, but some of its sub-classes are polynomially solvable. NPhardness of CNF-SAT is trivial, because classical SAT is
1).
6
consistent regular literals of the form "i : p and "j : p with j i are also classically inconsistent. If these clauses are not added, then only literals of the form "j : p and "j : p are classically inconsistent. Let N N be the set of truth values that occur as value of signs in literals of , and let N (p) N be the set of truth values that occur as value of signs in literals of with the propositional variable p. Assume, without loss of generality, N (p) = fi1 ; i2 ; : : : ; im(p) g and i1 i2 im(p) under the order associated with N . Now define 0 (p) = f"i(j +1) : p _ "ij : p j 1 jS< m(p)g for each propositional variable p 2 , and 0 = p2 0 (p). The clauses of 0 are tautologies under many-valued semantics and capture the difference between classical and regular logic. It is obvious that if we add 0 to , then all regular inconsistencies can be classically detected. Moreover, the size of 0 is in O(j j), although it may take O(j j log j j) time to compute 0 . The results for regular HORN-SAT and 2-CNF-SAT follow now from the observation that the clauses in 0 are in the intersection of classical HORN-SAT and 2-CNF-SAT. Similar techniques can be used for non-linear orderings: If N is a finite lattice, regular HORN-SAT is decidable in time linear in the length of the formula and polynomial in the cardinality of N via a reduction to classical HORN-SAT [9]. For distributive lattices, the more precise bound j j jN j2 was found independently in [57], which contains also some results on decidable first-order fragments of regular CNF formulas. A closer inspection of the proofs in the cited papers yields immediately that all regular HORN-SATN versions have linear complexity. If the partial order of N is no lattice, then regular Horn formulas need to be based on signs that have the form "S = fi 2 N j there is j 2 S such that i j g, where S N . This more general notion of regular HORN-SAT is still decidable in time linear in the length of the formula, but exponential in the cardinality of N provided that N possesses a maximal element [9]. If N is infinite, then regular HORN-SAT is decidable provided that N is a locally finite lattice, that is, every sublattice generated by a finite subset is finite [9]. A set of on-line (that is: incremental) algorithms for Horn formulas with numerical uncertainties has been proposed and studied in [4]. The resulting complexities are (at most cubic) polynomials, also in the infinite-valued case. On the CNF level, some authors used many-valued semantics to approximate classical propositional consequence. In some cases this lead to polynomial decision procedures and results of this kind were used in knowledge representation [46]. An overview of related results is [16]. The NP-complete satisfiability problems for regular formulas and Regular-DPL exhibit the phase transition phenomena encountered in many decision procedures for NP-
the same as CNF-SATf0;1g up to notation; NP-easiness of the problem CNF-SAT for all finite N is straightforward, see above. Further results are summarized in Table 1 (NPC means NP-complete, all N are finite) and are discussed in [11, 13]. Table 1. Complexity of signed SAT problems CNF 2-CNF HORN classical NPC linear [22] linear [19] monosigned NPC linear [38] — regular, N totally ord. regular, N distr. lattice, signs of form "i and "i
regular, N lattice, signs of form "i and "i regular, N lattice, signs of form "i and #i regular (arbitrary) signed (arbitrary)
NPC NPC
j
j
log j
j
j
j
log j
[13]
[27, 13]
NPC [10]
j
j
N2
jj
j
[57]
NPC
NPC
polynomial [9]
NPC
polynomial [10]
—
NPC
NPC
NPC
NPC [37]
— —
2-CNF-SATN for any jN j 3 and, hence, 2-CNF-SAT was shown to be NP-hard in [37, 38] (in contrast to classical 2-CNF-SAT that can be solved in linear time) by embedding the 3-colorability problem of graphs. A direct embedding of classical CNF-SAT into 2-CNF-SAT is given in [9]. Even regular 2-CNF-SAT is NP-complete, which can be shown by embedding (general) 2-CNF-SAT into regular 2-CNF-SAT [10]. Under certain restrictions, however, membership in regular 2-CNF-SAT can be checked in polynomial time: for formulas over totally ordered truth value sets [13] gives a j j log j j procedure via an embedding into classical 2-CNF-SAT (see also below). A result for the more general case when N is a lattice and all occurring signs are of the form "i or #i is in [10]. A linear-time procedure for solving monosigned 2-CNF-SAT is described in [38]. If N is totally ordered, the problem of deciding whether a regular Horn formula is satisfiable can be solved in time linear in j j in case jN j is fixed, and in j j log j j time, otherwise [27, 13]. An algorithm for a particular subclass of regular Horn formulas appeared before in [21]. Many of these results can be proven via a reduction to classical logic: as an example, reduce regular CNF-SAT to classical SAT [13]. We define a mapping Æ from instances of regular CNF-SAT over a signature to satisfiability equivalent instances Æ of SAT. The signature of Æ is Æ = f"i : p j i 2 N; p 2 g, and Æ is formed by (i) the clauses of over signature Æ ; i.e., the clauses of with a classical interpretation, and (ii) an additional set of clauses 0 ensuring that two in7
one needs to do is to characterize the distributions that are mapped to one of the truth values that occur in the sign of a quantified formula.
complete problems [41]: (i) there is a sharp increase (phase transition) of the percentage of unsatisfiable random CNF-SAT instances around a certain point when the ratio v between the number of clauses and the number v of variables is varied; (ii) there is an easy-hard-easy pattern in the computational difficulty of solving problem instances as v is varied—the hard instances tend to be found near the crossover point [39, 14, 12]. Satisfiability in propositional infinite-valued Łukasiewicz logic with standard temporal operators of LTL [56] is undecidable [59], although SATL0 is NP-complete and Ł satisfiability of LTL alone is PSPACE-complete. An informal explanation for this surprising result is the following: Łukasiewicz sum provides capability to add numbers, while temporal logic provides “registers” (worlds) for storing them and the temporal operators allow conditional jumps to different register contents. This is all it takes to simulate a suitable universal computation mechanism.
Theorem 9 [30]. Let (Q ) 1 (S ) = f; 6= I N j Q (I ) 2 S g; then a signed quantified formula S :(x)'(x) is satisfiable iff (10)
I 2(Q ) 1 (S ) i2I
fig:'( i ) ^
^
t2Term0
I :'(t)
Each disjunct in this representation says that the distribution of ' at x is I : the first conjunction assures that at least the elements of I occur in the distribution, the second conjunction says that at most the elements of I occur. It must be stressed that monosigned first-order representations are much more complicated, even for simple quantifiers. A tableau rule is obtained from (10) in a standard way by replacing the second, infinite, conjunction with a nondeterministic guess for I :'(t), with t 2 Term0 arbitrary. A CNF representation is obtained by duality: a W V compute 0” S and replace “not DNF representation for S VW with “ S 0 ” using de Morgan’s rules. The size of representations and tableau/sequent rules for many-valued operators is closely related to the deterministic complexity of decision problems, because the size of rules determines the size of sequent/tableau proofs, which in turn yield upper bounds of the complexity of VAL and SAT. Representations (Theorem 8) and expansions (Section 5) do also determine the size of various normal forms for many-valued logic formulas in an essential way. In [50, 60, 24, 5] the following results on the maximal size of signed CNF-/DNF-representations of finite-valued connectives are stated and proven:
Theorem 8 [30]. Let S be one of the sets of signs (5)– (7) for an n-valued logic L0 , S 2 S , and let ' = S :('1 ; : : : ; 'm ) (m 1) be a signed L0 -formula. I is an arbitrary n-valued -interpretation. Then there are numbers M1 ; M2 nm , index sets I1 , : : : , IM1 , J1 , : : : , JM2 f1; : : : ; mg, and signs Srs ; Skl 2 S with 1 r M1 ; 1 k M2 and s 2 Ir ; l 2 Jk such that ' is satisfiable by I iff WM1 V r=1 s2Ir Srs :'s is satisfiable by I iff VM2 W : ' S kl l is satisfiable by I. k=1 l2Jk The first characterization is called a signed DNF representation of ', the second a signed CNF representation of '.
n = jN j; r = ()
The relevance of this theorem comes from the fact that a DNF representation of a formula S :('1 ; : : : ; 'm ) gives rise to a generalized tableau rule:
monosigned general
S :('1 ; : : : ; 'm ) .. .. ..
^
is satisfiable, where the i are new Skolem constants.
7 Representations
.. . S1s.:'s ..
_
All bounds are tight.
The
DNF nr nr 1
r-ary
rŁ serves in the proof of all cases; rŁ(p1 ; : : : ; pr ) p1 Ł Ł pr .
.. . SM1.s :'s ..
CNF 1 1
nr nr
Łukasiewicz sum it is defined as
These results can used to prove that any signed formula
' of any finite-valued logic can be translated into a signed CNF with size in O(nR j'j), where R = maxf() j 2 ; occurs in 'g [26]. For logics defined by distributive
It is a routine task to build generic tableau-based deduction systems for generic finite-valued logics, which are at the same time decision procedures. CNF representations lead to sequent calculi and to signed CNF computation procedures. Recall that the semantics of a first-order quantifier in many-valued logic is defined via a distribution function Q : P + (N ) ! N . Similar as in the propositional case, one may obtain a representation of a signed quantified formula in terms of certain signed instances. Informally, what
lattices, up to exponentially better results are possible by using the dual space representations. General complexity results for the latter and many concrete examples are in [58]. The branching factor of signed tableau rules for quantifiers (the number of disjuncts in Theorem 9) is at most 2n 2. For the dual sequent rules the slightly better bound 2n 1 can be obtained [5], which is sharp as well. 8
A slightly different question is to ask how many different signs are needed in general to build a sound and complete signed tableau or sequent calculus for a given n-valued logic. It is shown in [6] for families of signs fulfilling a certain condition (including (5)–(7)) that this number is logarithmic in n (and the bound is tight). One of the results relating to infinite-valued Łukasiewicz logic is that every L0Ł -formula over just one variable can be polynomially translated into a regular signed atom with respect to the natural order on N = [0; 1℄ [45]. The complexity of McNaughton functions in one variable is investigated in [1, 2]. In [43] it is shown that a L0Ł -formula ' is valid in 2 infinite-valued L0Ł iff it is valid in (2(2j'j) + 1)-valued L0Ł . This bound was later improved to (2j'j + 1) values [3, 17]. An analog result is established for logical consequence. Space complexity of various kinds of MDDs (Section 5) is discussed, for example, in [52], where further pointers to the literature can be found. In fact, every known kind of MDD has exponential worst-case space complexity. Increased space complexity is frequently traded in for more efficient computation in practice. The worst-case, best-case and relative space complexity of various kinds of polynomial representations of finitevalued functions is investigated in many papers, for example, [54].
[9] B. Beckert, R. H¨ahnle, and F. Many´a. Transformations between signed and classical clause logic. In Proc. 29th International Symposium on Multiple-Valued Logics, Freiburg, Germany, pages 248–255. IEEE CS Press, Los Alamitos, May 1999. [10] B. Beckert, R. H¨ahnle, and F. Many´a. On the regular 2SAT problem. In Proc. 30th International Symposium on Multiple-Valued Logics, Portland/OR, USA, pages 331–336. IEEE CS Press, Los Alamitos, May 2000. [11] B. Beckert, R. H¨ahnle, and F. Many´a. The SAT problem of signed CNF formulas. In D. Basin, M. D’Agostino, D. Gabbay, S. Matthews, and L. Vigan`o, editors, Labelled Deduction, pages 61–82. Kluwer, Dordrecht, May 2000. [12] R. B´ejar. Systematic and Local Search Algorithms for Regular-SAT. PhD thesis, Facultat de Ci`encies, Universitat Aut`onoma de Barcelona, 2000. [13] R. B´ejar, R. H¨ahnle, and F. Many´a. A modular reduction of regular logic to classical logic. To appear, 2001. [14] R. B´ejar and F. Many`a. Phase transitions in the regular random 3-SAT problem. In Z. W. Ra´s and A. Skowron, editors, Proc. International Symposium on Methodologies for Intelligent Systems, Warsaw, Poland, number 1609 in LNCS, pages 292–300. Springer-Verlag, 1999. [15] J. Burch, E. Clarke, K. McMillan, and D. Dill. Sequential circuit verification using symbolic model checking. In Proc. 27th ACM/IEEE Design Automation Conference (DAC), pages 46–51. ACM Press, 1990.
References
[16] M. Cadoli and M. Schaerf. On the complexity of entailment in propositional multivalued logics. Annals of Math. and Artificial Intelligence, 18(1):29–50, 1996.
[1] S. Aguzzoli. The complexity of McNaughton functions of one variable. Advances in Appl. Math., 21(1):58–77, 1998.
[17] A. Ciabattoni. Proof Theoretic Techniques in Many-Valued Logics. PhD thesis, University of Milan, Italy, Jan. 2000.
[2] S. Aguzzoli. Geometric and Proof Theoretic Issues in Łukasiewicz Propositional Logics. PhD thesis, University of Siena, Italy, Feb. 1999.
[18] R. L. O. Cignoli, I. M. L. D’Ottaviano, and D. Mundici. Algebraic Foundations of Many-Valued Reasoning. Kluwer, Dordrecht, Nov. 1999.
[3] S. Aguzzoli and A. Ciabattoni. Finiteness in infinite-valued logic. J. of Logic, Language and Information, 9(1):5–29, 2000.
[19] W. Dowling and J. Gallier. Linear-time algorithms for testing the satisfiability of propositional Horn formulæ. J. of Logic Programming, 3:267–284, 1984.
[4] G. Ausiello and R. Giaccio. On-line algorithms for satisfiability problems with uncertainty. Theoretical Computer Science, 171(1–2):3–24, Jan. 1997.
[20] G. W. Dueck and J. T. Butler. Multiple-valued logic operations with universal literals. In Proc. 24th International Symposium on Multiple-Valued Logic, Boston/MA, pages 73–79. IEEE CS Press, Los Alamitos, May 1994.
[5] M. Baaz and C. G. Ferm¨uller. Resolution-based theorem proving for many-valued logics. J. of Symbolic Computation, 19(4):353–391, Apr. 1995. [6] M. Baaz, C. G. Ferm¨uller, G. Salzer, and R. Zach. Labeled calculi and finite-valued logics. Studia Logica, 61(1):7–33, 1998. Many-valued logics.
[21] G. Escalada-Imaz and F. Many`a. The satisfiability problem for multiple-valued Horn formulæ. In Proc. International Symposium on Multiple-Valued Logics, Boston/MA, USA, pages 250–256. IEEE CS Press, Los Alamitos, 1994.
[7] M. Baaz, P. H´ajek, D. Svejda, and J. Kraj´ıc´ ek. Embedding logics into product logic. Studia Logica, 61(1):35–47, July 1998.
[22] S. Even, A. Itai, and A. Shamir. On the complexity of timetable and multicommodity flow problems. SIAM J. of Computing, 5(4):691–703, 1976.
[8] M. Baaz, A. Leitsch, and R. Zach. Incompleteness of a firstorder G¨odel logic and some temporal logics of programs. In H. Kleine B¨uning, editor, Selected Papers from Computer Science Logic’95, Paderborn, Germany, volume 1092 of LNCS, pages 1–15. Springer-Verlag, 1996.
[23] K. G¨odel. Zum intuitionistischen Aussagenkalk¨ul. Anzeiger Akademie der Wissenschaften Wien, mathematischnaturwiss. Klasse, 32:65–66, 1932. [24] R. H¨ahnle. Automated Deduction in Multiple-Valued Logics. Oxford University Press, 1994.
9
[25] R. H¨ahnle. Many-valued logic and mixed integer programming. Annals of Math. and Artificial Intelligence, 12(3,4):231–264, Dec. 1994.
[44] D. Mundici. A constructive proof of McNaughton’s Theorem in infinite-valued logic. J. of Symbolic Logic, 59(2):596–602, June 1994.
[26] R. H¨ahnle. Short conjunctive normal forms in finitely-valued logics. J. of Logic and Computation, 4(6):905–927, 1994.
[45] D. Mundici and N. Olivetti. Resolution and model building in the infinite-valued calculus of Łukasiewicz. Theoretical Computer Science, 200(1–2):335–366, 1998.
[27] R. H¨ahnle. Exploiting data dependencies in many-valued logics. J. of Applied Non-Classical Logics, 6(1):49–69, 1996.
[46] P. F. Patel-Schneider. A decidable first-order logic for knowledge representation. J. of Automated Reasoning, 6:361–388, 1990.
[28] R. H¨ahnle. Proof theory of many-valued logic—linear optimization—logic design: Connections and interactions. Soft Computing, 1(3):107–119, Sept. 1997.
[47] W. A. Pogorzelski. The deduction theorem for Łukasiewicz many-valued propositional calculi. Studia Logica, 15:7–23, 1964.
[29] R. H¨ahnle. Commodious axiomatization of quantifiers in multiple-valued logic. Studia Logica, 61(1):101–121, 1998.
[48] M. E. Ragaz. Arithmetische Klassifikation von Formelmengen der unendlichwertigen Logik. PhD thesis, ETH Z¨urich, 1981.
[30] R. H¨ahnle. Tableaux for many-valued logics. In M. D’Agostino, D. Gabbay, R. H¨ahnle, and J. Posegga, editors, Handbook of Tableau Methods, pages 529–580. Kluwer, Dordrecht, 1999.
[49] J. B. Rosser and A. R. Turquette. North-Holland, Amsterdam, 1952.
Many-Valued Logics.
[31] P. H´ajek. Metamathematics of Fuzzy Logic, volume 4 of Trends in Logic: Studia Logica Library. Kluwer Academic Publishers, Dordrecht, 1998.
[50] G. Rousseau. Sequents in many valued logic I/II. Fundamenta Mathematicæ, LX:23–33, 1967, LXVII:125–131, 1970.
[32] P. H´ajek, L. Godo, and F. Esteva. A complete many-valued logic with product conjunction. Arch. Math. Logic, 35:191– 208, 1996.
[51] T. Sasao. Multiple-valued decomposition of generalized Boolean functions and the complexity of programmable logic arrays. IEEE Transactions on Computers, C-30:635– 643, Sept. 1981.
[33] J. N. Hooker. A quantitative approach to logical inference. Decision Support Systems, 4:45–69, 1988.
[52] T. Sasao. Logic synthesis with EXOR gates. In T. Sasao, editor, Logic Synthesis and Optimization, chapter 12, pages 259–286. Kluwer, Norwell/MA, USA, 1993.
[34] R. G. Jeroslow. Logic-Based Decision Support. Mixed Integer Model Formulation. Elsevier, Amsterdam, 1988.
[53] T. Sasao. Switching Theory for Logic Synthesis. Kluwer, Norwell/MA, USA, 1999.
[35] V. G. Kirin. Gentzen’s method of the many-valued propositional calculi. Zeitschrift f. math. Logik u. Grundlagen d. Math., 12:317–332, 1966.
[54] T. Sasao and J. T. Butler. Comparison of the worst and best sum-of-products expressions for multiple-valued functions. In Proc. 27th International Symposium on Multiple-Valued Logic, Nova Scotia, Canada, pages 55–60. IEEE CS Press, Los Alamitos, May 1997.
[36] J. Łukasiewicz and A. Tarski. Untersuchungen u¨ ber den Aussagenkalk¨ul. C. R. des S´eances de la Societ´e des Sciences et des Lettres de Varsovie, Classe III, 23:1–21, 1930. [37] F. Many`a. Proof Procedures for Multiple-Valued Propositional Logics. PhD thesis, Facultat de Ci`encies, Universitat Aut`onoma de Barcelona, 1996.
[55] B. Scarpellini. Die Nichtaxiomatisierbarkeit des unendlichwertigen Pr¨adikatenkalk¨uls von Łukasiewicz. J. of Symbolic Logic, 27(2):159–170, June 1962.
[38] F. Many`a. The 2-SAT problem in signed CNF formulas. Multiple-Valued Logic., 5, 2000.
[56] A. Sistla and E. Clarke. The complexity of propositional linear temporal logics. J. of the ACM, 32(3):733–749, 1985.
[39] F. Many`a, R. B´ejar, and G. Escalada-Imaz. The satisfiability problem in regular CNF-formulas. Soft Computing, 2(3):116–123, Sept. 1998.
[57] V. Sofronie-Stokkermans. On translation of finitely-valued logics to classical first-order logic. In H. Prade, editor, Proc. 13th European Conference on Artificial Intelligence, Brighton, pages 410–411. John Wiley & Sons, 1998.
[40] R. McNaughton. A theorem about infinite-valued sentential logic. J. of Symbolic Logic, 16(1):1–13, 1951.
[58] V. Sofronie-Stokkermans. Automated theorem proving by resolution for finitely-valued logics based on distributive lattices with operators. Multiple-Valued Logic, 2000.
[41] D. Mitchell, B. Selman, and H. Levesque. Hard and easy distributions of SAT problems. In Proc. of AAAI-92, San Jose, CA, pages 459–465, 1992.
[59] H. Wagner. Nonaxiomatizability and undecidability of an infinite-valued temporal logic. Multiple-Valued Logic, 2(1):47–58, 1997.
[42] A. Mostowski. Proofs of non-deducibility in intuitionistic functional calculus. J. of Symbolic Logic, 13(4):204–207, Dec. 1948.
[60] R. Zach. Proof theory of finite-valued logics. Master’s thesis, Institut f¨ur Algebra und Diskrete Mathematik, TU Wien, Sept. 1993. Also Technical Report TUW-E185.2-Z.1-93.
[43] D. Mundici. Satisfiability in many-valued sentential logic is NP-complete. Theoretical Computer Science, 52:145–153, 1987.
10