NP trees and Carnap`s modal logic

NP Trees and Carnap’s Modal Logic*
Georg Gottlob
Institut fir Informationssysteme
Technische Universit at Wien
Paniglgasse 16, A-1040 Wien, Austria;
Internet: gottlobOvexpert dbai .tuvien. ac .a t
.
Abstract
by a polynomial-time oracle Turing machine making
O(1ogn) calls to an oracle set in N P , first defined by
Papadimitriou and Zachos [24], has attracted much
interest [16, 15, 28, 1, 14, 13, 26, 11, 6, 31.
Note that in the definition of such bounded-query
classes, oracle queries are assumed to be adaptive in
the sense that (the form of) each query may depend
on the results of all previous queries.
Turing machines with bounded access to oracle
queries define complexity classes based on mainly
quantitative criteria. Some of these classes, however,
can be equivalently expressed by specifying in a more
qualitative fashion some restrictions of adaptiveness,
i.e., limitations on how oracle queries may depend
on each other. A good example is again the class
PNPIO(logn)]. It was shown that this class can
equivalently be defined as the class of all languages accepted by a polynomial-time Turing machine making
one round of parallel queries to N P oracles (see [28]).
Parallelism here means that first all queries are formulated and only then is each query executed. In particular, this means that none of the queries depends on
the result of any other query.
In this paper we investigate more sophisticated dependencies between oracle queries. We are thus not
only interested in describing how many oracle queries
may depend on each other, but also in specifying how
they depend on each other. We shall study problems
and complexity classes defined by interdependent oracle queries where the way how oracle queries depend
on each other is specified by directed graphs.
We first define the concept of N P DAGS. An N P
DAG is a directed acyclic graph G whose nodes are
parametric queries to a SAT oracle. An arc NI
N2
between two nodes of such a DAG expresses that the
(definitive) form of the query Na depends on the outcome of the query NI. Our model of parametric query
to an oracle for SAT is particularly simple. A para-
We consider problems and complexity classes definable by interdependent queries to an oracle in N P .
How the queries depend on each other is specified by a
directed graph G.We first study the class of problems
where G is a general dag and show that this class coincides with A;. We then consider the class where G is
a tree. Our main result states that this class is identical to PNPIO(logn)], the class of problems solvable in
polynomial time with a logarithmic number of queries
to an oracle in N P . Using this result we show that the
following problems are all PNP[O(logn)] complete:
validity-checking of formulas in Carnap’s modal logic,
checking whether a formula is almost surely valid over
finite structures in modal logics K , T, and S4, and
checking whether a formula belongs to the stable set
of beliefs generated by a propositional theory.
1
Introduction and Overview
This paper introduces a theory of interdependent
queries to N P oracles and applies it to solve previously open complexity problems in Artificial Intelligence and Modal Logic.
Recently several complexity classes have been defined by bounding the number of queries that an
oracle Turing machine of a certain type may issue
to an oracle for some given language. In particular, classes defined by subpolynomial bounds have
been studied and shown to be useful, since many of
them have interesting formal properties and possess
natural complete problems. For instance, the class
PNP[O(logn)] consisting of all languages accepted
-
‘This is an extended abstract. The full version (including all
proofs and much more material) is available via email/ftp from
the author.
0272-542W93$03.00 0 1993 IEEE
42
metric query N is a SAT instance which, in addition to
regular propositional variables, contains special variables whose truth values depend on the result of the
oracle queries at the immediate predecessor nodes of
N . Each N P DAG has a distinguished node which is
called the result node. The problem DAGS(SAT) consists of deciding whether the result node of a given
N P DAG evaluates to i m e . The complexity class
D A G S ( N P ) contains all decision problems that are
polynomially transformable into DAGS(SAT). We
show that the problem DAGS(SAT) is A; complete,
hence the class D A G S ( N P ) is identical to A;.
The problem DAGS(SAT) and the corresponding
complexity class D A G S ( N P ) can be refined by imposing certain graph-topological constraints on the
underlying N P DAGs (such as requiring that the DAG
be a tree, a multitree, etc.).
In order to link graph-theoretically defined complexity classes and bounded query classes, we introduce the notion of an admissible weighting function.
Each admissible weighting function v assigns weights
to each node of a DAG G and a total weight W v ( G )(a
positive integer) t o G itself. Roughly speaking, W v ( G )
is a measure of the degree of intricacy of G . We prove
that if v is an admissible weighting function, then each
N P DAG G with n nodes can be solved in polynomial
time with [log Wv(G)l 1 adaptive queries to an N P
oracle.
The subclass of N P DAGs we further investigate
in the present paper is the class of N P trees, i.e., N P
DAGs that are trees. N P trees naturally occur in several applications. In the context of such applications
the problem TREES(SAT), i.e., checking whether the
result node of an N P tree evaluates to true, has
been implicitly considered [9, 17, 19, 23, 271, and it
has been noted that the problem is PNPIO(logn)]hard [9] and in A; [23,9, 271. It was left open whether
TREES(SAT) is complete for one of these classes or
possibly for some intermediate class.
Here we show that TREES(SAT) is PNPIO(logn)]
complete, and hence that the corresponding graphtheoretically defined class T R E E S ( N P ) coincides
with PNPIO(logn)]. By proving this result, we immediately yield new and better algorithms for solving
TREES(SAT) and the related application problems,
necessitating only a logarithmic number of queries to
an oracle for SAT. The difficult part of the proof is
membership in PNP[O(log n)]. Unfortunately, the
method of admissible weighting functions cannot be
directly applied to N P trees to yield the desired upper bound because all admissible weighting functions
become exponential on trees, thus giving merely A[
as upper bound. However, by introducing a new treerestructuring technique, we are able to polynomially
transform each N P tree into an equivalent N P DAG
of logarithmic depth having polynomial weight under a particular admissible weighting function. Thus,
the output N P DAG of this transformation can be
solved in polynomial time with a logarithmic number
of queries to a SAT oracle.
As a first application of our completeness result, we
show that validity checking of formulas in Carnap’s
modal logic is PNP[O(logn)] complete. Carnap’s
modal logic [2] is a nonstandard modal logic which
differs substantially from the better-known Lewis systems. In Carnap’s modal logic a subformula 040 of
a formula 9 evaluates to true if II, is a consistent formula, and a subformula OII, evaluates to true iff $ is
valid. Each modal subformula of 4 is evaluated independently of its context in 4.
The structure of N P trees is reflected in Carnap’s
modal logic by the parsing trees of modal formulas. Carnap’s logic is an interesting example of a
PNP[O(logn)]-complete problem. Most previously
known “natural” complete problems for this class involve numeric issues such as optimality or parity. Furthermore, Carnap’s logic may serve as a prototypical
problem for determining the complexity of other relevant problems by mutual polynomial transformations.
In particular, by use of Carnap’s modal logic, we can
easily solve two previously open complexity problems
which implicitly involve N P trees:
+
0
0
Zero-One Laws for Modal Logics. Halpern
and Kapron [9] have recently studied zero-one
laws for various (standard) modal logics. In
particular, they have charaterized the formulas which are valid with probability 1 on finite
Kripke structures for several modal logics (such
formulas are called almost surely valid). The
following problems were left open: what is the
precise complexity of determining almost-sure
structure validity of formulas in the modal logics K , T and S4. By characterization results
of Halpern and Kapron and our complexity result for Carnap’s logic, it follows that all these
problems are PNPIO(logn)] complete.
The Membership Problem for Stable Sets.
Stable sets play an important role in artificial
intelligence and epistemic logic (25, 20, 10, 171.
Stable sets are deductively closed sets of formulas of propositional logic augmented by an operator L which expresses belief or knowledge. If
T is a classical propositional theory, then the
43
stable set st(T) generated by T contains, in addition to all logical consequences of T , all introspective epistemic beliefs that an ideally rational agent adopts on the grounds of T . For
example, if p E T , then L p E st(T),since if one
believes in p , then one also believes to believe in
p . The membership problem for stable sets consists of deciding whether a formula 4 belongs to
st(T). Various algorithms for solving this problem have been described [lo, 17, 19, 23, 221, the
best of which requiring a polynomial number of
calls to an N P oracle. In this paper we show
that the membership problem for stable sets is
PNPIO(log n)] complete; hence it is solvable in
polynomial time with a logarithmic number of
calls to an oracle in N P . Our proof is via a simple relationship between the membership problem and validity checking of formulas in Carnap’s logic.
string at node N depend on the oracle answers of N ’ s
immediate predecessor nodes. Thus a directed arc
( N 1 , N z ) in an N P DAG symbolizes that the oracle
query at node N2 depends on the oracle answer at
node N I . We call N I an input node for N2. An oracle
query at a node N can be evaluated as soon as the
queries of all input nodes for N have been evaluated.
Each N P DAG has a unique distinguished node called
the result node. An N P DAG is positively answered
iff the oracle query at its result node is positively answered.
Definition 2.1 The Problem DAGS(SAT) is defined
as follows.
INSTANCE: triple ( V a r , G , F R ) given b y
0
0
The full version of the paper also considers other
classes of N P dags as well as cyclic NP-graphs
and generalizes the results to higher levels of the
polynomial-time hierarchy.
2
a set of propositional variables V a r =
. . ,V n } , called the linking variables;
a directed acyclic graph G = ( V , E ) , the nodes V =
{ F l , . . . ,F,,} representing propositional formulas. Different nodes may represent the same formula and we
identify the name F; of a node with the name of
the formula that is represented b y the node. Each
propositional formula Fi, in addition to zero or more
uprivate” propositional variables not appearing in any
other node, contains the followang linking variables:
{ v j I ( F j , F i ) E E}.
a distinguished terminal node F R , for some R E
{ 1,. . . ,n } , called the result node.
{VI,.
NPDAGs
0
We define classical propositional logic over the language C based on a countable set of propositional variables and the connectives 1,A , V, +, E,and @ (the
latter denoting exclusive disjunction), and the symbols T, and I,where T is a constant for truth and I
a constant for falsity.
A truth value assignment maps each propositional
variable to a truth value from { t r u e , f a l s e } . The truth
values true and f a l s e will be identified throughout the
paper with the numbers 1 and 0 respectively.
We use the following conventions on directed acyclic
graphs (DAGS). We divide a DAG into levels as follows. Level 0, the bottom level, consists of all vertices
with no incoming edges. Level i 1 consists of all vertices whose incoming edges connect only to levels 5 i
and to at least one vertex of level i. Nodes without
outgoing edges are called terminal nodes. The depth
of a DAG is equal to the number of its levels minus
one. In other terms, the depth coincides with the maximum level number. The level of a node a is denoted
by level(a). The depth of a DAG G is denoted by
depth(G).
Intuitively, an N P DAG consists of an acyclic network (circuit) of nodes, each representing a parametric
query to an N P oracle, such that parts of the query
QUESTION: Does FR evaluate to true under the following (inductively defined) truth value assignment U
to the propositional variables V I , . . . ,U,, ? u ( v i ) is true
if the formula F,! i s satisfiable, where F,! is obtained
from Fi b y replacing each propositional linking variable vj occurring in F, b y T i f u ( v j ) = true and b y I
if u ( v j ) = f a l s e . Otherwise u ( q ) is false. (This definition assigns an unambiguous value to each v; representing a bottom node and inductively to each other
vj .)
A n N P DAG is an instance of DAGS(SAT).
+
The class D A G S ( N P ) consists of all decision problems which are problems polynomially transformable to
DAGS(SAT).
N o t a t i o n : If N is a node, then the linking variable
for N is also referred to as [ N I .
Many well-known problems can be easily transformed into DAGS(SAT).
E x a m p l e 2.1 The PNPIO(logn)] complete problem
PARITY(SAT) consists of deciding whether the number of positive S A T instances from a set of m given
44
where
S A T instances is odd (cf. [,U]).
W e show that
P A R I T Y ( S A T ) can be computed b y a N P DAG;
i.e., it can be polynomially transformed into the
problem D A G S ( S A T ) . To see this, just translate
each PARITY(SAT)-instance consisting of m S A T instances into an N P DAG whose m bottom nodes are
the m SAT instances F1 . . . ,F, and an additional
node FR = V I v2 . . .@U, encodes the parity function
over the oracle answers for F 1 , . . . ,F m . FR is the result node and the graph G of the DAGS(SAT)-instance
has as edges (F1,F R ) ,. . . , (F,, F R ) . Note that this
graph is a tree of depth 1.
to be 0 .
A weighting function v is polynomial-time computable
iff f o r each graph the weight of each node under v and
the total weight can be computed in polynomial time.
( W e assume binary representation f o r integers.)
The following definition introduces a ‘particular
weighting function w .
Theorem 2.1 D A G S ( S A T ) is A; complete.
D e f i n i t i o n 2.3 For any directed acyclic graph G =
( V , E ) , the weighting function w is defined b y Va E
v : w(a) = 214.
PROOF. Membership in A[ is obvious. Hardness can be shown by a simple transformation from
the known A;-complete problem M S A ( S A T ) (see [28,
151). The problem M S A ( S A T ) consists of checking
whether the lexicographically maximum truth value
assignment 4 to the variables (PI,.
. . ,pn)of a satisfiable Boolean formula F ( p 1 , . . . lpn) assigns 1 to p,,.
Given such an instance of M S A ( S A T ) , define an N P
DAG D as follows. D has as nodes the formulas
F l , . . . ,F,,, where
P r o p o s i t i o n 2.1 w is admissible and polynomial
time computable.
The next theorem is a useful tool for computing upper complexity bounds to restrictions of D A G S ( S A T ) .
Theorem 2.3 Let v be any admissible and polynomial time computable weighting function. A n y instance CS = ( V a r , G ,F R ) of the D A G S ( S A T ) problem can be decided in polynomial tame with at most
[logW,(G)1 + 1 queries to an NPoracle.
>
Fi = F( [FI]1 . . ‘ 1 [Fi- 11i Ti pi+1 1 . . P’, 1
where F ( T ~. ., . ,T,,) denotes the propositional formula
resulting from F by uniformly replacing each pi by
T; and where each [Fi] is the linking variable corresponding to node F, and each pj is a private variable
occurring only in formula F;. It is easy to see that
for 1 <_ i <_ n , Fi evaluates to exactly the truth value
taken by pi in the maximum satisfying truth value assignment to F . To know if p,, is assigned 1 in that
assignment, it is thus sufficient to choose F,, as the
result node.
PROOF. (Sketch) Let V a r = { V I , . . . , v , , } , and
let V = { F l , . . . ,F,,}. The instance 3 determines in
a unique way a solution truth-value assignment U to
each linking variable vi such that a ( v i ) = 1 iff node
Fi is positively answered and .(vi) = 0 iff Fi is negatively answered. The total solution weight t o is defined by t u =
( a ( v i ) x v ( F i ) ) ,i.e., tu is the sum
of all weights at positive nodes. We will solve 3 by determining t u with [logW,(G)] N P queries and then
make one additional query which correctly guesses U
and returns the desired value a ( v , ) .
The following claim can be shown (+ full paper).
C L A I M : For any integer s, the question whether
t , > s holds can be decided with a single call to an
N P oracle.
Now, since we know that tu 5 W , ( G ) , t , can be
computed by using a binary search technique invoking
no more than [logW,(G)] oracle queries of the form
‘ t o > s?’. Once tu is computed, the N P DAG instance
CS can be solved in polynomial time with one single
additional oracle call: the N P oracle guesses a truth
value assignment 4 to all private propositional variables, computes the corresponding truth value assignment 4* to all linking variables in polynomial time,
Corollary 2.2 D A G S ( N P ) = A;
The above theorem and its corollary are closely related to a recent result independently found by M .
Vardi and reported in [9].
D e f i n i t i o n 2.2 Let G = (V,E ) be a directed graph.
For each node a E V , a t denotes the set of all nodes
reachable b y a directed path of length >_ 1 from a .
A weighting function f o r G is a mapping from V to
the set of all natural numbers.
A weighting function v is admissible z f f f o r each node
a € V,
4.) >
CbEB
v ( b ) is defined
The total weight W , ( G ) of G under a weighting function v is defined b y
4b)l
&at
45
and checks that ~ ~ = l d * ( xv v~( F) i ) = t , . It can be
seen that for such an assignment 4, it must hold that
4* = U. Moreover, the oracle checks that + * ( v , ) = 1
in order to assure that the result node effectively evaluates to true under U. The problem is thus solvabe
with [logWv(G)l 1 oracle queries. o
an output port o u t ( H ) which can be connected b y
directed edges to other nodes. The value available at
the output port is c o m b ( H ) .
an input port' i n p ( H , U ) f o r each linking variable
U occurring an some node of H .
a linking variable w . A s with regular nodes, a
linking variable w is associated to each hypernode H .
We will often refer to this variable as [HI.
+
3
NP trees
The concept of hypernode generalizes the concept
of regular node. Each regular node F can be viewed as
a singleton hypernode Fh with nodes(Fh) = { F } and
comb(Fh) = [ F ] ,whose input ports exactly correspond
to the linking variables occurring in F .
An N P hypertree is a tree of hypernodes, such that
each input port i n p ( H , [NI) of each node is linked by
an incoming edge to the output port of the corresponding node N. If H is a hypernode of a hypertree and
if N E n o d e s ( H ) , then the corresponding linking variable [NIappears only in comb(H) (if at all) and is not
allowed to appear in any other hypernode of the tree.
Each hypertree has a distinguished singleton terminal
hypernode as result node.
Just as the concept of hypernode is a generalization
of the concept of regular node, the concept of N P hypertree is a generalization of the concept of N P tree.
Each N P tree T corresponds to an N P hypertree by
replacing each of T's nodes with an equivalent singleton hypernode. Let us call this hypertree H Y P ( T ) .
A hypertree is positively solved if, after bottom-up
evaluation of all hypernodes by evaluating the SAT instances in the obvious manner, the result node yields
value 1(= t r u e ) . Otherwise it is negatively solved.
Two hypertrees are equivalent iff they are either both
positively solved or both negatively solved.
We now show how N P hypertrees can be flattened
by fusing hypernodes. The main principle of the fusion
operation defined below and illustrated in Fig. 2 is the
simulation of oracle answers.
An N P tree is an N P DAG which is a tree. Note
that the directed edges of an N P tree point from the
bottom to the top of the tree.
Definition 3.1 The problem TREES(SAT) is the
problem DAGS(SAT) restricted to N P trees. The
class T R E E S ( N P ) consists of all decision problems which are problems polynomially transformable
to TREES(SAT).
Our main result is that TREES(SAT) is complete for PNPIO(logn)] and hence T R E E S ( N P ) =
PNPIO(logn)]. We cannot obtain the logarithmic
upper bound by applying Theorem 2.3 with weighting function w directly, since N P trees with n nodes
may have branches of length O ( n ) , and hence w assigns weights that are exponential in n . (For the same
reason, we cannot obtain a logarithmic upper bound
by applying any other admissible weighting function
directly to the given N P tree.) Therefore, we will
proceed as follows. We will first transform a given
N P tree T with n nodes into an equivalent N P DAG
D ( T ) whose depth does not exceed logn and that has
low weights for weighting function w . We will then
apply Theorem 2.3 with w to D ( T ) . As an intermediate step between T and D ( T ) we will group together
certain nodes of T and some new nodes to form hypernodes. Intuitively, a hypernode represents a set of
nodes whose queries can be answered in parallel.
Definition 3.3 Let T be an N P hypertree containing
two hypernodes K and H such that H is an input node
for K (i.e., K has an input port for [HI) and K is a
singleton hypernode and neither H nor K is the result
node of T . Then the fusion of H and K is a hypernode
H d K such that:
Definition 3.2 A hypernode H (see Fig. 1 ) is a
structure with the following components
a set n o d e s ( H ) of nodes F , 1 . . .F,,, each consisting of a Boolean formula (SAT-instance). None of
these formulas depends on any other in the same hypernode; i.e., no F,, E n o d e s ( H ) contains a linking
variable representing a F,, E n o d e s ( H ) .
a Boolean formula comb(H) built from the propositional linking variables 0 ~ 1 ,... ,U,, representing the
nodes in n o d e s ( H ) and some other (auxiliary) propositional variables.
nodes(H d K ) = n o d e s ( H ) U { K - , K + } , where
K - and K + are obtained from the unique node in
n o d e s ( K ) b y replacing [HI b y I and T, respectively.
'Note that the input and output ports in the above definition serve mainly for the graphical representationand could be
omitted from the formal definition of hypemode.
46
H
Figure 1: A hypernode
0
0
C O ~ (d
H K ) = (C
c m b ( H ) ) A (([IC-]A T C ) V
( [ K + ]A c ) ) , where c is a new propositional variable
not occurring anywhere else.2
Consider the following algorithm SQUEEZE that
transforms any given N P tree T into a low-depth N P
hypertree S Q ( T ) .
The ports of H d K are as prescribed in Definition 3.2.
ALGORITHM SQUEEZE
INPUT: N P tree T ;
OUTPUT: N P hypertree S Q ( T ) ;
BEGIN
The N P hypertree T(H d K ) is obtained from T b y
eliminating H and K and inserting the hypernode
H d K , and b y replacing all occurrences of the linking
variable [ K ]in T b y the new linking variable [ H dK ] ,
and by duly adjusting the connecting edges.
T + HYP(T);
level(G) for each hypernode G in T ;
WHILE T has a bad hypernode
DO
BEGIN
K t badhypemode(”);
H t the unique input hypernode for T
at level l e v e l ( K ) - 1;
T c T(H d K ) ;
recompute level(G) for each hypernode G in T;
END
RETURN T;
END.
determine
Lemma 3.1 T is equivalent to T ( H d K ) .
Theorem 3.2 TREES(SAT) is PNPIO(logn)] complete.
PROOF. (Sketch) Hardness for PNP[O(logn)] follows immediately from the fact that the well-known
PNP[O(logn)] complete problem PARITY(SAT) can
be polynomially transformed into TREES(SAT) (see
Example 2.1).
Membership. Given any hypertree T , a bad hypernode of T is a hypernode K different from any bottom
node and from the result node such that K is located
at some level 1 and there is only one input hypernode
H for K located a t level 1 - 1. (However, a bad hypernode K located a t level 1 may have several input
hypernodes at levels 5 1 - 2.) Our aim is to eliminate bad hypernodes K by performing fusions of type
H d K.
Assume that the function badhypernodefl) returns
a bad hypernode of T located at the lowest possible
level whenever T has a bad hypernode.
Let T be a hypertree with n nodes. We are able to
show the following facts about SQUEEZE and about
SQ(T):
Fact 1. Each time the algorithm selects a bad hypernode, this bad hypernode is a singleton hypernode.
Fact 2. The algorithm SQUEEZE terminates and
the result S Q ( T ) is equivalent to T .
Fact 3. The total number of hypernodes in S Q ( T )
does not exceed n .
Fact 4. d e p t h ( S Q ( T ) ) 5 rlognl.
Fact 5. Each linking variable v occurs in at most one
hypernode of S Q ( T ) . Moreover, if v occurs at
all in a hypernode G of S Q ( T ) , it occurs either
in comb(G) or in at most two nodes of G.
z c is used in order to avoid an exponential growth of the
comb formula after repeated fusions.
41
U’ is U where [K] is replaced by [Hq Kl
Figure 2: A fusion
the occurrences of the linking variable [GI in higherlevel nodes by c m b ( G ) (recall that [GI can occur in at
most two higher-level nodes). Create an arc between
each node E and each node F whenever [E]occurs in
F . Clearly, the resulting DAG D ( T ) is equivalent to
SQ(T) and hence to T .
By the 5 facts from abovewe are able to show that
the following crucial property holds for D ( T ) . For
each node F of D ( T ) , ( F 1 15 2rlognl.
But this m e m s that weighting function w assigns at
most weight 2’riogn1 to each node in in D ( T ) . Hence,
the total weight W , ( D ( T ) ) is not greater than 2n x
22r10gn1.We can now apply Theorem 2.3, according to
which D ( T ) can be answered by [log W ,
(D(T))1+ 1 5
[ l o g 2 + l o g n + 2 [ l o g n l l , which is O(logn), queries to
an N P oracle.
Clearly all constructions in this proof, in particular the computation of SQ(T) from T by S Q U E E Z E
and the computation of D ( T ) from SQ(T), are feasible in polynomial time. The problem is thus solvable in polynomial time with a logarithmic number of
queries to an N P oracle. This proves membership in
PNP[O(logn)]. 0
Corollary 3.3 T R E E S ( N P ) = PNPIO(logn)].
Applications of NP trees
4
We now transform the hypertree SQ(T) into a DAG
D ( T ) by dissolving hypernodes and reconverting them
into sets of regular nodes as follows: For each hypernode G , replace G by the nodes nodes(G). Replace
4.1
Carnap’s Modal Logic
In 1947 the philosopher and logician Rudolf Carnap
published “Meaning and Necessity” , a study containing a new approach to semantics and modal logic [2].
Carnap’s (propositional) modal logic, which we will
call C here, extends the classical propositional calculus by a necessity operator 0 and a possibility operator
0. The syntax of C formulas is the same as that of
formulas in standard systems of propositional modal
logic (see, e.g. [12] or [4]). Let us write t=c 4 if formula d is valid in logic C . We give a formal definition
of
An occurrence of a subformula +y in a modal
formula 4 is strict if the occurence is not in the scope
of a modal operator.
h.
Definition 4.1 For any modal formula 4 , let us denote b y d+ the formula obtained from d b y replacing
each strict occurence of subformulas of the f o r m 04 or
04 b y true if h 3 and b y false otherwise. Validity
in logic C is inductively defined as follows.
0
0
48
If d is a classical ~ r o ~ o s i t i o formula
na~
then
d is propositiona11y “lid.
4 iff $+ is a tautology.
If d = 04 then
If 4 = 04 then h4 iff $J+ is satisfiable.
q5 iRd+ 2s a tautology.
In all other cases,
d zfl
Intuitively, 0 can be considered as a strong provability operator that expresses the metapredicate
within the object language. 0 4 is valid (and provable)
if 4 is provable. On the other hand, if 4 is not provable, then 104 is valid (and provable). Accordingly,
in Carnap’s logic each modal formula 4 of type O$J or
O$J is determinate; i.e., it either holds that
4 or
that
14.Examples of valid formulas of C are Op,
0 - p , - U p , oq + O r . Note that these formulas are
not valid in any standard system of modal logic. Note
that in C , as usual, can be considered a shorthand
for -07.
yield PNP [O(log n)]-completeness results. In particular, their results, reformulated in our terminology,
state that for modal logics K and T, a formula 4 is
4, while the problem of
almost surely valid iff
almost sure validity in S4 formulas is polynomially
reconductable to validity checking in Carnap’s modal
logic. By these characterizations and by our Theorem 3.2 we therefore get a precise complexity characterization of almost-sure structure validity in the
modal logics K , T, and S4, thus solving the open
questions in [9].
Theorem 4.2 Deciding almost sure structure validity for modal logics K , T, and S4 is PNPIO(logn)]
Theorem 4.1 Given a modal formula 4, deciding if
4
is ~ N P [ ~ ( l o g ncomplete.
)l
complete.
The proof of this theorem is given in the full paper. It exploits the rather obvious similarity between
NP trees and the syntactic tree determined by a C
formula and its modal subformulas. We believe that
the validity problem for logic C is an interesting example of a PNPIO(logn)] complete problem both because of its simplicity and because the definition of
does not involve any numerical property such as parity
or optimality. Note that almost all previously known
problems complete for this class involve in their definition such numerical properties. An exception is the
Boolean closure of NP, which, however, corresponds
to the fragment of Carnap’s logic having modal nesting depth 1.
4.2
4.3
The Membership Problem for Stable
Sets
For an informal description of this problem, as well
as for references, see Section 1. Epistemic formulas are
expressed in the language C L of classical propositional
logic extended by a modal belief operator L . Stable
sets are formally defined as follows.
Definition 4.2 A theory T C L is stable if T satisfies the following three conditions:
Cn(T) = T ; i.e., T is closed under proposiconsequence.
Zero-One Laws for Modal Logic
In analogy to the well-known zero-one laws established by Glebskii et al.[7] and, independently, by Fagin [5], zero-one laws for structure validity in modal
logics K , T, S4, and S5 have recently been established
and studied by Halpern and Kapron [9]. Roughly,
these laws state that each modal formula 4 is either
true in almost all Kripke structures of the appropriate
type (in which case 4 is called almost-surely valid), or
false in all such Kripke structures.
For K , T and S4, Halpern and Kapron have derived Dp as lower bound and A[ as upper bound
but have left open the exact complexity classification.
They report, however, a proof by Stockmeyer showing that the problems are PNPIO(logn)] hard for K
(Positive Introspection) For every
then L4 E T .
4
E
CL, if
(Negative Introspection) For every
then -L4 E T .
4
E
CL, if
The membership problem f o r stable sets is formulated as follows. Given a finite objective (i.e., nonmodal) theory A and a formula 4 E CL,is 4 an element of s t ( A ) , the unique stable set whose objective formulas are the propositional consequences of
A? The membership problem for stable sets is an important problem of epistemic reasoning and has been
dealt with extensively in the literature; it also plays
an essential role in autoepistemic reasoning [18, 221.
Different algorithms have been proposed by Halpern
and Moses [lo], Marek and Truszczyriki [17, 18, 191,
and Niemela [21, 23, 221. The best of these algorithms
make a polynomial number of calls to an NP oracle, thus providing A[ as upper bound. It was open
whether this bound could be improved.
By the following result we are able to relate the
membership problem for stable sets to Carnap’s logic.
Let A be a finite objective theory and let 4 E CL be
anfd T. PNPIO(logn)] hardness for S, is shown in
a later version of [9]. Still, completeness for this class
remained an open problem in [9]. Yet, in the same
paper, Halpern and Kapron provide some very important characterizations of almost-sure structure validity which, together with our Theorem 3.2 immediately
49
skeptical reasoning in AEL is II; hard. The latter
was already shown by the author via a more direct
proof [8]; nontheless, we believe that our embedding
of N P graphs is instructive and offers new insights
into the nature of autoepistemic logic.
The second generalization extends our results
to higher classes of the polynomial-time hierarchy.
In particular, we define the problems DAGS(Bk),
TREES(Bk), and GRAPHS(Bk) for specific oracle sets
Bk in I$ and show that these problems are complete
a formula. Let f o r m ( A ) denote the objective formula
obtained by forming the conjunction of all sentences
in A and by taking T if A is empty. From A and
4 we construct in polynomial time a modal formula
by the following recursive rule. 4A is obtained
from 4 by replacing each strict subformula A+ with
O(fmm(A) + + A ) . On the other hand, if
is a
formula of modal logic C , then let +L denote the formula obtained from by replacing each occurrence of
0 with L.
+
+
for Aftl, P’L[O(logn)]
Theorem 4.3 1 . ) For each finite theory A c II: and
formula 4 E LL,4 E s t ( A ) i f f h( f o r m ( A )-, d A ) .
2.) f f 4 is a modal formula, then h 4 i f f 4~ E
St(0).
A C K N O W L E D G M E N T S . Part of this work was
done while the author was visiting the Department of
Mathematics at the ETH Zurich. The author thanks
Prof. Erwin Engeler and his group for offering a stimulating working environment. The author is also grateful to Richard Beigel, who helped in the initial developments of this work, in particular by suggesting the
use of simulated oracle queries; to Joe Halpern, who
pointed out the relationship to zero-one laws, to Bob
Bach, Marco Cadoli, Thomas Eiter, Marco Schaerf,
Ulrich Neumerkel, Franz Puntigam and Helmut Veith,
who commented on an early version of the manuscript;
and to Klaus Dethloff and Klaus Wagner, who provided useful references.
This theorem shows that there are bidirectional
polynomial time reductions between the membership
problem for stable sets and the problem of validity
checking in C. This gives us a precise complexity characterization of the former problem:
Theorem 4.4 The membership problem f o r stable
sets is ~ N P [ ~ ( l o g ncomplete.
)l
5
and IIftl, respectively.
Further Results
References
In the full paper, we further illustrate the use of
theorem 2.3 by considering classes of N P dags of low
(i.e., logarithmic or polylogarithmic) depth and proving complexity results for these clas?. In particular,
we show that for each a 2 0, LOG’DAGS(NP) =
PNP[O(logitln)], where L O G i D A G S ( N P ) denotes the class of all problems polynomially reducible
to N P DAGS whose depth is bounded by log’(n).
Furthermore, in the full paper, in addition to the results presented here, we generalize our main complexity results in two ways. First, we drop the requirement
of acyclicity from N P dags, thus yielding N P graphs.
An NP graph is a directed graph of interdependent
SAT queries. Since such a graph may have oscillating
behaviour, we restrict ourselves t o stable solutions. An
instance of the problem GRAPHS(SAT) consists of an
N P graph; the instance is positively solved iff the result node of the graph evaluates to true for each stable
solution. We prove that the problem GRAPHS(SAT)
is IIg complete. As an application, we show that N P
graphs can be easily expressed in autoepistemic logic
(AEL) and we exhibit a simple polynomial transformation from GRAPHS(SAT) to the problem of skeptical reasoning in AEL. This immediately shows that
[l] R. Beigel. Bounded Queries to SAT and the
Boolean Hierarchy. Theoretical Computer Science,
84(2): 199-223, 1991.
[2] R. Carnap. Meaning and Necessity. The University of Chicago Press, 1947.
[3] Jorge Castro and Carlos Seara. The Q-operator
and the Low Hierarchy. Report LSI-92-16-R,
Univ. Politkcnica de Catalunya, 1992.
[4] B. Chellas. Modal Logic, an Introduction. Cambridge Univ. Press, 1980.
[5] R. Fagin. Probabilities on Finite Models. Journal
of Symbolic Logic, 41( 1):50-58, 1976.
[6] W. Gasarch, Lane A. Hemachandra, and Albrecht
Hoene. On Checking Versus Evaluation of Multiple Queries. In B. Rovan, editor, Mathematical
Foundations of Computer Science, Springer LNCS
Nr. 452, pp. 261-268, 1990.
[7] Y.V. Glebskii, D.I. Kogan, M.I. Liogon’kii, and
V.A. Talanov. The Difference and the Truth-Table
Hierarchies for NP. Kibernetika, 2:17-28, 1969.
50
G . Gottlob. Complexity Results for Nonmonotonic
Logics. The Journal of Logic and Computation,
2:3:397-425, June 1992.
[21] I. Niemela. Decision Procedure for Autoepistemic
Logic. In Proceedings of 9th Conference on Automated Deduction CADE-88, pages 676-684, 1988.
J.Y. Halpern and B. Kapron. Zero-One Laws for
Modal Logic. In Proc. of the Seventh Annual IEEE
Symposium on Logic in Computer Science, 1992.
Full version: Tech Report RJ 8836 (79218), 1992,
IBM Research Division, Almaden Research Center. An updated version which takes into account
the work of the present paper will appear in Annals
of Pure and Applied Logic.
[22] I. Niemela. On the Decidability and Complexity
of Autoepistemic Reasoning. Fundamenta Informaticae, 17:117-155, 1992.
[23] I. Niemela. Towards Automatic Autoepistemic
Reasoning. In Proc. Europ. Workshop on Logics in
A I , Amsterdam, September 1990, Springer, 1991.
[24] C.H. Papadimitriou and S. Zachos. Two Remarks
on the Power of Counting. In Proc. 6th GI Conf.
on Theoretical Computer Science, pages 269-276,
Springer Verlag, 1983.
[lo] J.Y. Halpern and Y. Moses. Towards a Theory of Knowledge and Ignorance: Preliminary Report. In Proc. Non-Monotonic Reasoning Workshop A A A I , pages 125-143, 1984. Reprinted in
Logics and Models of Concurrent Systems K. Apt
editor, Springer Verlag, 1985, pp.459-476 .
[25] R.C. Stalnaker. A Note on Nonmonotonic Modal
Logic. 1980. Manuscript, Dept of Philosophy, Corne11 Univ.
[ll] L. Hemachandra. The Strong Exponential Hierarchy Collapses. Journal of Computer and System
Sciences, 39:299-322, 1989.
[26] U . Schoning and K. Wagner. Collapsing Oracle Hierarchies, Census Functions, and Logarithmically Many Queries. In B. Rovan, editor,
Mathematical Foundations of Computer Science,
pages 91-97, Springer, 1990.
[12] G.E. Huges and M.J. Cresswell. A n Introduction
to Modal Logic. Methuen London, 1978.
[13] Jim Kadin. PNP[o(logn)l and Sparse TuringComplete Sets for N P . Journal of Computer and
System Sciences, 39:282-298, 1989.
[27] G. Schwarz and M. Truszczyriski. Nonmonotonic
Reasoning is Sometimes Easier. In Proc. 3rd Kurt
Goedel Colloquium, B m o , August 1993, Springer,
1993. To appear.
[14] J . Kobler, U . Schoening, and K.W. Wagner. The
Difference and the Truth-Table Hierarchies for NP.
R.A.I.R.0, 211419-435, 1987.
[28] Klaus Wagner. Bounded Query Classes. SIAM
J . Comp., 19(5):833-846, 1990.
[15] M. Krentel. Generalizations of OptP to the Polynomial Hierarchy. Theoretical Computer Science,
1992.
[16] Mark Krentel. The Complexity of Optimization
Problems. Journal of Computer and System Sciences, 36:490-509, 1988.
[17] W . Marek. Stable Theories in Autoepistemic
Logic.
Fundamenta Informaticae, 12:243-254,
1989.
[18] W . Marek and M. Truszczyriski. Autoepistemic
Logic. Journal of the A C M , 38(3):588-619,1991.
[19] W . Marek and M. Truszczyriski. Nonmonotonic Logics and Context-Dependent Reasonings.
Springer, 1993. To appear.
[20] R.C. Moore. Semantical Considerations on Nonmonotonic Logics. Artificial Intelligence, 25:7594, 1985.
51