Sun Yat-sen University, Guangzhou, 510275, China.
The Complexity and Expressive Power of Second-Order Extended Logic
Abstract
We study the expressive powers of SO-HORN∗, SO-HORNr and SO-HORN∗r on all finite structures. We show that SO-HORNr, SO-HORN∗r, FO(LFP) coincide with each other and SO-HORN∗ is proper sublogic of SO-HORNr. To prove this result, we introduce the notions of DATALOG∗ program, DATALOGr program and their stratified versions, S-DATALOG∗ program and S-DATALOGr program. It is shown that, on all structures, DATALOGr and S-DATALOGr are equivalent and DATALOG∗ is a proper sublogic of DATALOGr. SO-HORN∗ and SO-HORNr can be treated as the negations of DATALOG∗ and DATALOGr, respectively. We also show that SO-EHORNr logic which is an extended version of SO-HORN captures co-NP on all finite structures.
1 Introduction
Descriptive complexity is a bridge between complexity theory and mathematical logic. It uses logic systems to measure the resources that are necessary for some complexity classes. The first capture result is Fagin’s theorem. In 1974, Fagin showed that existential second-order logic(SO) captures NP on all finite structures. This is a seminal work that has been followed by many studies in the characterization of other complexity classes by means of logical systems, the research of NP-complete approximation problems from a descriptive point of view, and so on. Through the effort of many researchers in this area, almost every important complexity classes have their corresponding capture logic systems. First-order logic (FO) which is a very powerful logic in classic model theory is too weak when only consider finite structures. By augmenting some recursion operators, researchers got many powerful logic. FO(IFP), FO(PFP), FO(DTC) and FO(TC) are the logic that equip first-order logic with inflationary fixpoint operator, partial fixpoint operator, deterministic transitive closure operator and transitive closure operator, respectively. Immerman and Vardi both showed that FO(IFP) captures PTIME on ordered structures in 1986 and 1982, respectively. Abiteboul and Vainu showed that FO(PFP) captures PSPACE on ordered structures in 1983. Immerman showed that FO(DTC) and FO(TC) capture L and NL on ordered structures, respectively, in 1987. In[4], Grädel introduced SO-HORN logic which is a fragment of second-order logic and showed that SO-HORN captures PTIME on ordered structures. Whereas all these results are obtained on ordered structures, a very important open problem in descriptive complexity is that whether there is an effective logic captures PTIME on all structures. It turns out that if there is no such a logic, then . Due to the definition of SO-HORN, on all structures, it is closed under substructures and can not express some first-order definable properties. Grädel introduced another version of this logic in [6] which is called SO-HORN∗ in this paper. SO-HORN∗ allows first-order formula in it, but we show that it still is not expressive enough to capture PTIME on all structures. In[21], we defined SO-HORNr logic which is an revised version of SO-HORN and showed that it captures PTIME on ordered structures. We are interested in finding that whether this logic can be a candidate to capture PTIME on all finite structures. To study the expressive powers of these logic on all finite structures, we introduce the notions of DATALOG∗ program and DATALOGr program and their stratified versions (S-DATALOG∗, S-DATALOGr, respectively). In this paper, we show that SO-HORNr has the same expressive power as FO(LFP) which is a very powerful logic. We also study the expressive power of SO-EHORNr and prove that SO-EHORNr captures co-NP on all finite structures. This logic is an extended version of SO-HORN and has been shown that it can capture co-NP on ordered structures.
This paper is organized as follows: In section 2, we set up notations and terminologies. In section 3, we study the expressive powers of SO-HORN∗, SO-HORNr and SO-HORN∗r on all finite structures. We use DATALOG and S-DATALOG program as intermediate logic, and introduce the notions of DATALOG∗ program, DATALOGr program and their stratified versions. We show that SO-HORNr, SO-HORN∗r, FO(LFP) coincide with each other and SO-HORN∗ is a proper sublogic of SO-HORNr. In section 4, we use the normal forms of formulas to show that SO-EHORNr captures co-NP on all finite structures. We prove this result in two versions. Section 5 is the conclusion of this paper.
2 Preliminaries
We assume the reader has already some familiarity with mathematical logic and complexity theory. Nonetheless, we give a brief description of some basic definitions.
A vocabulary is a finite set of relation symbols and constant symbols . Each relation symbol is equipped with a natural number , its arity. We use lower-case Greek letters to denote a vocabulary. Given a vocabulary , a -structure is a tuple
where is the domain of , for each relation symbol of arity , and for each constant symbol , . From now on, we use calligraphic letters and capital letters to denote structures and the corresponding domains, respectively. We use to denote the cardinality of set and to denote a sequence or a tuple of elements (variables). A structure is finite if its domain is a finite set. Without otherwise specified, we restrict ourself to finite structures in this paper. Let denote the set of all finite -structures, and if is a logic, then denotes the set of all formulas of over the vocabulary . Given a formula , define
Let and be two logic, we use to denote the expressive power of is no less than that of , i.e. for any vocabulary and any , there exists such that . denotes that is strictly more expressive than , and denotes that has the same expressive power as .
Define , where is a vocabulary. A -structure is ordered if the reduct is an ordering (that is, , , and are interpreted by the ordering relation, successor relation, the least and the last element of the ordering, respectively.) Let denote the set of all ordered structures over . Given a formula , define
Let be a logic and be a complexity class, we say logic captures complexity class if the following two conditions are satisfied:
- 1)
-
The data complexity of is in .
-
•
For any vocabulary and any closed formula , the membership problem of is in .
-
•
- 2)
-
is expressible in .
-
•
For any vocabulary and any set , if the membership problem of is in , then such that .
-
•
We say captures on ordered structures if we only consider ordered structures and it satisfies:
- 1)
-
For any vocabulary and any closed formula , the membership problem of is in .
- 2)
-
For any vocabulary and any set , if the membership problem of is in , then such that .
We recall some notions and results of quantified Boolean formulas (QBF). A QBF formula has the form:
where and is a propositional CNF formula over Boolean variables. A literal or is called universal (resp. existential) if is (resp. ). If every clause in contains at most one positive literal (resp. positive existential literal) then is called a quantified Horn formula (QHORN) (resp. quantified extended Horn formula (QEHORN)). The evaluation problem for QBF is PSPACE-complete [9], for QHORN is in PTIME, whereas it remains PSPACE-complete for QEHORN. However, for each fixed , the evaluation problem for QEHORN formulas with prefix type (here are sequences of Boolean variables) is co-NP complete[1, 2].
3 Expressive powers of Horn logic
Definition 1
Second-order Horn logic, denoted by SO-HORN, is the set of second-order formulas of the form
where , are relation symbols and are Horn clauses with respect to , more precisely, each is an implication of the form
where
- 1)
-
each is an atomic formula ,
- 2)
-
each is either an atomic formula or a negated atomic formula where ,
- 3)
-
is either an atomic formula or the Boolean constant (for false).
-
•
If we replace condition 2) by
- 2’)
-
each is a first-order formula containing no ,
we denote this logic by SO-HORN∗.
-
•
If we replace condition 1) by
- 1’)
-
each is either an atomic formula or ,
we call this logic second-order revised Horn logic, denoted by SO-HORNr.
-
•
If we replace conditions 1), 2) by 1’), 2’), respectively, we denote this logic by SO-HORN∗r.
On ordered structures, Grädel[4, 6] showed that SO-HORN and SO-HORN∗ capture PTIME and we[21] showed that SO-HORN∗r captures PTIME. These four logic coincide with each other. On all structures, it turns out that SO-HORN is strictly less expressive than FO(LFP) which is a very powerful logic. It is not hard to see that the following holds from the definition above:
An important open problem in descriptive complexity is that whether there is an effective logic captures PTIME on all structures. We are interesting in finding the expressive powers of these Horn logic on all structures. At first, we give a lemma that is very useful. Let be a logic formula, we use to denote the formula obtained by replacing the formula by in .
Lemma 1
Every second-order formula is equivalent to a formula of the form where occurs free in , is an -ary relation symbol, is an -ary relation symbol and are all the different atomic formulas that occur in and over the relation symbol .
Proof
Given a structure and , write
then for any
(1) |
Set . Suppose , for any , and , by (1) it is easy to check that
(2) |
For any structure and ,
which completes the proof.
It turns out that SO-HORN collapses to its existential fragment ((SO)-HORN, i.e. the formulas where all the second-order quantifiers are existential[4]). In fact, many second-order formulas equal to the formulas that only have existential second-order prefix. We extend this result to a more general form in the following proposition.
Proposition 1
Every second-order formula of the form
(3) |
where and
- 1)
-
each is either an atomic formula or ,
- 2)
-
each is a second-order formula that does not contain ,
- 3)
-
is either an atomic formula or the Boolean constant (for false),
is equivalent to a formula of the form
(4) |
where
- 1)
-
each is either an atomic formula or ,
- 2)
-
each is some in (3) that does not contain ,
- 3)
-
is either an atomic formula , or the Boolean constant (for false).
Proof
This proof is adapted from that of Theorem 5 in [4]. It is suffice to prove for formulas of the form . For an arbitrary second-order prefix we can successively remove the innermost universal second-order quantifier. The main idea is that for any structure
Suppose that the arity of is and are new variables that don’t occur in , we only need to show that
The direction is easy. For the direction, suppose
The case that or is false at only one tuple is trivial. Let be the subset of that only the tuple is not in , we use to denote the corresponding relations such that . For the other cases, consider an arbitrary , set . We proceed to show that
Conversely, suppose that
then there exist and a clause such that
(5) |
and
(6) |
Since and , it follows that for each and ,
and
where and tuples of elements of . Because don’t occur in , by (5) we see that for each
-
•
If is in (6), then , contrary to
-
•
If is some where , there must be a such that , contrary to
By repeating use of lemma 1, is equivalent to a formula of the required form.
Corollary 1
SO-HORNr and SO-HORN∗r are both collapse to their existential fragments.
From now on, unless explicitly stated, we will restrict ourselves to the existential fragments of these logic defined above in the rest of this paper. To compare the expressive power of the four logic on all structures, we use DATALOG and S-DATALOG program as intermediate logic, and introduce the notion of DATALOGr program. For the detailed definition and semantics of DATALOG program and S-DATALOG program we refer the reader to [8].
Definition 2
A DATALOG program over a vocabulary is a finite set of rules of the form
where and
- (1)
-
each is either an atomic formula or a negated atomic formula or zero-ary relation symbol,
- (2)
-
is either an atomic formula or a zero-ary relation symbol where and only occur positively in each rule of .
constitute the body of the rule, is the head of the rule. Every relation symbols in the head of some rule of are intentional, all the other symbols are extensional. We use and to denote the set of intentional and extensional symbols(constant symbols are extensional symbols), respectively. We allow zero-ary relation symbols here to be able to compare the expressive power of DATALOG with other logic. A zero-ary relation has the Boolean value TRUE or FALSE. Let be a zero-ary relation symbol and be a structure, the interpretation of in is: “” means “”, “” means “”.
Example 1
This is a DATALOG program over the vocabulary where , and are constant symbols.
Instead of giving a detailed definition of the semantics of DATALOG programs, we present it briefly using an example. Given a DATALOG program and a -structure, we can apply all the rules of simultaneously to generate consecutive stages of the intentional symbols. Consider the above example, let , and be a -structure. Suppose and are known, and can be evaluated by
where iff . Because occurs only positively in the body of each rules, we can reach a fixed-point in polynomial many steps with respect to . Let denote the fixed-point. Then gives rise to a -structure
A DATALOG formula has the form where is an -ary intentional relation symbol and are variables that don’t occur in . Given a -structure and
If is a zero-ary relation symbol, then
In the above example, given ,
Definition 3
We define three extensions of DATALOG programs:
-
•
If we allow first-order formulas only over extensional symbols in the body of rules of a DATALOG program, we denote this logic program by DATALOG∗ program.
-
•
If we allow formulas of the form where is an intentional relation symbol in the body of rules of a DATALOG program, we denote this logic program by DATALOGr program.
-
•
If we allow both first-order formulas only over extensional symbols and formulas of the form where is an intentional relation symbol in the body of rules of a DATALOG program, we denote this logic program by DATALOG∗r program.
Example 2
This is a DATALOG∗r program over where , and is a first-order formula over .
Relation denotes the transitive closure of the graph defined by . denotes the set of vertices that can reach every vertex in this graph.
For a DATALOG ( DATALOG∗, DATALOGr, DATALOG∗r, respectively ) program , if there is a zero-ary relation symbol occurring in the body of some rules, e.g. , we replace every occurrences of by , where is a new relation symbol and is a new variable that do not occur in , and then add the rule in . Let denote the resulting DATALOG ( DATALOG∗, DATALOGr, DATALOG∗r, respectively ) program. It is easily check that the fixed-points of all common intentional relations of and coincide on all structures. So for technical reason, unless stated explicitly, we restrict that the zero-ary relation symbols only occur in the head of a rule.
It turns out that many first-order definable properties can not be defined by DATALOG formulas. DATALOG∗ and DATALOG∗r programs which are equipped with first-order formulas are more expressive than DATALOG programs. In the following we show that DATALOGr formulas is enough to express all first-order definable properties. We say a DATALOG ( DATALOG∗, DATALOGr, DATALOG∗r, respectively) formula is bounded if there exists a fixed number such that for all structures.
Proposition 2
Every first-order formula is equivalent to a bounded DATALOGr formula.
Proof
We assign every first-order formula an equivalent bounded DATALOGr formula . We prove this result by induction on the quantifier rank of .
With no loss of generality, suppose is in DNF form
where and each is a conjunction of atomic or negated atomic formulas. Assume are all the variables in ,
-
•
for each , set
-
•
set
It’s easily seen that and are equivalent. Suppose and are equivalent and is a new relation symbol not in ,
-
•
if , set
-
•
if , set
It is easy to check that and are equivalent. To prove is bounded, observe that each can reach its fixed-point in one step and can reach its fixed-point in two steps. Suppose the quantifier rank of is , can reach its fixed-point in steps.
Corollary 2
DATALOG DATALOG DATALOG∗r
Proof
Suppose is a DATALOG∗( DATALOG∗r ) formula over vocabulary and are the no atomic (or negated atomic) first-order formulas that occur in and over . Let be the corresponding DATALOGr formulas that equivalent to , respectively. Set
where denotes the logic program obtained by replacing each by in . The DATALOGr formula is equivalent to .
A DATALOG program is positive if no atomic occurs negatively in any rule of . M. Ajtai and Y. Gurevich[12] showed that a positive DATALOG formula is bounded if and only if it is equivalent to a (existential positive) first-order formula. For a DATALOG formula, if it is bounded then it equals to a first-order formula, but the converse is false. They find a DATALOG formula which is equivalent to a first-order formula but not bounded. We show that this statement is true for DATALOGr formulas.
Theorem 3.1
For any DATALOGr formula the following are equivalent:
- (i)
-
is equivalent to a first-order formula.
- (ii)
-
is equivalent to a bounded DATALOGr formula.
Proof
(i) (ii) is by Proposition 2. The proof for (ii) (i) is similar to that of Proposition 9.3.1 in [8], we give only the main ideas. Observing that given a DATALOGr formula and a fixed , the -th stage in the evaluation is expressible by a first-order formula. If is bounded then there exists an such that on all structures.
Remark 1
If a DATALOG formula is equivalent to a bounded DATALOG formula, then the DATALOG formula itself is bounded. But if a DATALOGr formula is equivalent to a bounded DATALOGr formula, itself is not necessary bounded. We give a counterexample. Consider an atomic formula , let and be two 2-ary relation symbols and be a constant symbol. Construct two first-order formulas and , where says that is a linear ordering relation and is the least element, says that is a successor relation. By Proposition 2, is equivalent to a DATALOGr formula , is equivalent to a DATALOGr formula , is equivalent to a DATALOGr formula and is equivalent to a DATALOGr formula . Set
and . The DATALOGr program says that if is a linear ordering relation, is the least element and is a successor relation, then it checks all elements one by one that whether they have the property . Otherwise, just let . The DATALOGr formula is equivalent to which is a first-order formula, but for a -structure where interpreted as a linear ordering relation, interpreted as the least element and interpreted as a successor relation, reach its fixed-point in more than steps.
Corollary 2 shows that DATALOG∗ programs is a sublogic of DATALOGr programs. In fact, it is proper. Before proving this result, we review stratified DATALOG program ( by short: S-DATALOG program ) which is more powerful than DATALOG program.
Definition 4
A stratified DATALOG program , denoted by S-DATALOG program , is a sequence of DATALOG programs over vocabularies , respectively, such that .
Given a S-DATALOG program and a -structure , we set
A S-DATALOG formula has the form where is an -ary intentional relation symbol of one of the constitutes and are variables that do not occur in .
Example 3
The following is an S-DATALOG program over the vocabulary where , , and .
For any -structure and ,
Definition 5
In Definition 4,
-
•
if is a sequence of DATALOG∗ programs, we denote this logic program by S-DATALOG∗ program,
-
•
if is a sequence of DATALOGr programs, we denote this logic program by S-DATALOGr program.
Proposition 3
S-DATALOG S-DATALOG∗
Proof
The main idea of the proof is that every first-order formula is equivalent to a S-DATALOG formula . So we can replace in S-DATALOG∗ program by and add to . The details are left to the reader.
Theorem 3.2
DATALOG S-DATALOG FO(LFP)
Proof
We prove by showing that DATALOG S-DATALOG FO(LFP) DATALOGr. The containment DATALOG S-DATALOGr is trivial. To prove S-DATALOG FO(LFP), we first consider the case when is a DATALOGr formula. For each intentional relation symbol in , we construct a first-order formula
By the semantics of DATALOGr, is equivalent to the FO(S-LFP) formula (for details of FO(S-LFP) we refer the reader to [8])
which is equivalent to a FO(LFP) formula. For an S-DATALOGr formula which over the program , we prove by induction on . For each formula we find an equivalent FO(LFP) formula as above. Suppose every formula , where is an intentional relation symbol of , has an equivalent FO(LFP) formula, we replace by the equivalent FO(LFP) formula in and deal with as a DATALOGr program.
To prove FO(LFP) DATALOGr, we use the normal form of FO(LFP) formulas. It has been shown that every FO(LFP) formula is equivalent to a formula of the form (Theorem 9.4.2, [8])
where is a first-order formula. Without loss of generality, we assume that is in DNF form
where and each is a conjunction of atomic or negated atomic formulas. By Proposition 2 we know that there is a DATALOGr formula such that and are equivalent. Set
where denotes the logic program obtained by replacing each by in . By the definition of FO(LFP) we know that occurs only positively in each , so is a DATALOGr program and is equivalent to .
P. Kolaitis[16] showed that S-DATALOG is equivalent to EFP, H. Ebbinghaus and J. Flum[8] showed that S-DATALOG is equivalent to BFP. Both EFP and BFP are proper subsets of FO(LFP). Combining Proposition 3 and Theorem 3.2 we conclude the following corollary.
Corollary 3
DATALOG DATALOGr
It is natural to try to relate Horn logic to Logic programs. First we prove a lemma that shows a property of SO-HORN formulas. We say a formula is closed under substructures if for any structure and any , implies . A formula is closed under extensions if for any structure and any , implies . The following lemma shows that adding a second-order quantifier does not change these preservation properties of a formula.
Lemma 2
If is a second-order formula closed under substructures (extensions), then both and are closed under substructures (extensions).
Proof
Given a structure and an -ary relation over , if , then we use to denote the reduct of to . Suppose that is closed under substructures, then for any structure and ,
If is closed under extensions, then for any structure and
Corollary 4
SO-HORN is closed under substructures.
Proof
It’s easily seen that for a SO-HORN formula where , the first-order part is closed under substructures. By Lemma 2, is closed under substructures.
For any formula , is closed under substructures if and only if is closed under extensions. M. Ajtai and Y. Gurevich[12] mentioned that DATALOG formulas are closed under extensions. The following proposition implies that, in a sense, DATALOG is equivalent to the negation of SO-HORN.
Proposition 4
For every SO-HORN ( SO-HORN∗, SO-HORNr, SO-HORN∗r, respectively ) formula over vocabulary we can find a DATALOG ( DATALOG∗, DATALOGr, DATALOG∗r, respectively ) formula over vocabulary such that and the following are satisfied:
-
•
If is a sentence, then is a zero-ary intentional relation symbol such that for any -structure
-
•
If is a formula with free variables , then is an -ary intentional relation symbol such that for any -structure and any
The converse of this statement is also true.
Proof
We give the proof only for the case of DATALOG and SO-HORN, the others follow by the same method. For every SO-HORN formula we construct a DATALOG formula which is equivalent to . Suppose has the form
where are the free variables in . Suppose are the variables that don’t occur in , we use
to denote the formula obtained by replacing each by , respectively. We construct as following:
-
•
for each clause in ,
-
–
if is an atomic formula , we add the following rule in ,
-
–
if is the Boolean constant , we add the following rule in ,
-
–
-
•
if no is the Boolean constant in , we add the following rule in ,
It’s easily seen that if is a sentence then is a zero-ary intentional relation symbol in . From the semantics of DATALOG program and SO-HORN logic we know that for any structure and , iff .
For the converse direction, given a DATALOG formula , we construct a SO-HORN formula such that and are equivalent. Remember that we assume no zero-ary relation symbol in the body of any rule of , so we can ignore the rules in where is a zero-ary relation symbol and in the following construction with no result affected. Let be the all no zero-ary intentional relation symbols and be the all free variables in . The prefix of is , the matrix of is obtained by
-
•
if is a zero-ary relation symbol,
-
–
if is a rule of , then we add the clause as a conjunct,
-
–
if is a rule of , then we add the clause as a conjunct,
-
–
-
•
if is an -ary relation symbol,
-
–
if is a rule of , then let be new variables that don’t occur in , we add and as a conjuncts,
-
–
if is a rule of and , then we add the clause as a conjunct.
-
–
This completes the proof.
From the above proposition and Corollary 2 we can conclude the following corollary.
Corollary 5
SO-HORN SO-HORN SO-HORN∗r
Proof
We show that every SO-HORN∗ (SO-HORN∗r) formula is equivalent to a SO-HORNr formula.
is a SO-HORN∗ (SO-HORN∗r) formula,
there exists a DATALOG∗ (DATALOG∗r) formula such that and are equivalent (by Proposition 4),
there exists a DATALOGr formula such that and are equivalent (by Corollary 2),
there exists a SO-HORNr formula such that and are equivalent (by Proposition 4).
To compare the expressive power of the several Horn logic defined above and DATALOG program, we define stratified versions of these Horn logic in the following.
Definition 6
For each number , SO-HORNs is defined inductively by
-
•
SO-HORN SO-HORN,
-
•
SO-HORNj+1 is the set of formulas of the form
where , are relation symbols and each is an implication of the form
where
- 1)
-
each is an atomic formula ,
- 2)
-
each is either a SO-HORNl formula or its negation where and don’t occur in ,
- 3)
-
is either a atomic formula or the Boolean constant (for false).
Set SO-HORNSO-HORNs.
If we replace SO-HORN by SO-HORN∗, we denote this logic by SO-HORN. And if we replace SO-HORN by SO-HORNr, and replace condition 1) by
- 1’)
-
each is either an atomic formula or , we denote this logic by SO-HORN.
Proposition 5
SO-HORN∞, SO-HORN, SO-HORN are equivalent to S-DATALOG, S-DATALOG∗, S-DATALOGr, respectively.
Proof
The proof is similar to that of Proposition 4. The details are left to the reader.
Corollary 6
SO-HORN SO-HORN FO(BFP)
From the results above we obtain our main theorem in the following.
Theorem 3.3
On all finite structures the followings are hold:
In [5] Grädel asked that whether SO-HORN captures the class of problems that are in P and closed under substructures. Using some results above and a technique that encode a graph into a tree which is exponentially larger than it, we show that if the answer is “Yes”, then the 3-COLORABILITY problem is in P, which implies that P=NP. So it seems that the answer is not “Yes” for this question. We ask that whether every problem that is expressible in FO(LFP) and closed under substructures is expressible by a SO-HORN formula. This question is equivalent to the question that whether every problem that is expressible in DATALOGr and closed under extensions is expressible by a DATALOG formula.
4 Expressive power of Extended Horn Logic
In [21] we introduced SO-EHORN and SO-EHORNr logic and proved that they capture co-NP on ordered structures. It is well known that captures NP[17], as a corollary, captures co-NP on all structures. So it is of interest to know whether SO-EHORNr captures co-NP on all structures. In this section, we show that SO-EHORN which implies that SO-EHORNr captures co-NP on all structures.
Definition 7
Second-order Extended Horn logic, denoted by SO-EHORN, is the set of second-order formulas of the form
where are relation symbols and are extended Horn clauses with respect to , more precisely, each is an implication of the form
where
- 1)
-
each is an atomic formula ,
- 2)
-
each is either an atomic formula or a negated atomic formula where ,
- 3)
-
is either an atomic formula or the Boolean constant (for False).
If we replace condition 1) by
- 1’)
-
each is either an atomic formula or ,
then we call the logic second-order Extended revised Horn Logic, denoted by SO-EHORNr.
By Lemma 2, we know that SO-EHORN is closed substructures. So it can not captures co-NP on all structures. But SO-EHORNr is more expressive, the following example shows that it can express some co-NP complete problem.
Example 4
The decision problem for the set is an unsatisfiable propositional CNF formula is co-NP complete. We can encode via the structure [15], where is the domain, and are two unary relations, and are two binary relations, and for any and means that is a clause, is a variable, variable occurs positively in clause and variable occurs negatively in clause , respectively.
For example, the CNF formula
can be encoded as
The following formula
means that for any valuation , where holds iff variable is true under this valuation, there exists a set of of clauses, such that any clause that doesn’t occur in is false under this valuation. is a SO-EHORNr formula and for any CNF formula , iff is unsatisfiable.
Theorem 4.1
SO-EHORN on all structures.
Proof
We give here two different proofs of this theorem.
#1. It is well known that every formula is equivalent to a formula of skolem normal form[4]
(7) |
where is a quantifier-free CNF formula. Let be a new -ary second-order relation symbol and be new variables that don’t occur in (7). It is easily seen that is equivalent to
Then (7) is equivalent to
Repeated application of Lemma 1 shows that the above formula is equivalent to
(8) |
where is an -ary second-order relation symbol. The left is the same as that of Theorem 7 in [21], just replace the formula by the formula (8) above.
#2. By (7) we know that every formula is equivalent to a formula of the form
(9) |
where is a quantifier-free formula. With no loss of generality, suppose is in CNF form. Let be a new -ary second-order relation symbol and be new variables that don’t occur in (9), then is equivalent to . So (9) is equivalent to
(10) |
It is easily seen that (10) is equivalent to a SO-EHORNr formula.
Corollary 7
SO-EHORNr captures co-NP on all structures.
Corollary 8
SO-EHORNr collapses to -EHORNr on all structures.
Proof
In the second proof of Theorem (4.1), we have proved more, namely that every formula is equivalent to a -EHORNr formula which implies that SO-EHORN-EHORNr.
5 Conclusion
In this paper, we showed that, on all finite structures, SO-HORNr, SO-HORN∗r, FO(LFP) coincide with each other and SO-HORN∗ is a proper sublogic of SO-HORNr. We introduced the notions of DATALOG∗ program and DATALOGr program and their stratified versions, S-DATALOG∗ program and S-DATALOGr program. We proved that DATALOGr and S-DATALOGr are equivalent and DATALOG∗ is a proper sublogic of DATALOGr. We also showed that SO-EHORNr which is an extended version of SO-HORN captures co-NP on all structures. We prove this this result in two versions. In the first version we improved the proof in [21] using the skolem normal forms of formulas. In the second version, we gave a straightforward proof using the normal form.
References
- [1] A. Flögel, M. Karpinski, and H. Kleine Büning. Subclasses of Quantified Boolean Formulas. In Lecture Notes in Computer Science, 553: 145-155, Springer, 1990.
- [2] A. Flögel. Resolution für quantifizierte Bool’sche Formeln. Dissertation, University Paderborn ,1993.
- [3] A. Chandra, D. Harel. Horn Clause Queries and Generalizations. J. Logic Programming 1 (1985), 1–15.
- [4] Erich Grädel. The expressive power of second order Horn logic. Proceedings of the 8th annual symposium on Theoretical aspects of computer science, p.466-477, February 1991, Hamburg.
- [5] E. Grädel. Capturing Complexity Classes by Fragments of Second-order Logic. Theoretical Computer Science, 101: 35-57, 1992.
- [6] Erich Grädel , P. G. Kolaitis, L. Libkin , M. Marx , J. Spencer , Moshe Y. Vardi , Y. Venema , Scott Weinstein. Finite Model Theory and Its Applications. Springer-Verlag New York, Inc., Secaucus, NJ, 2005.
- [7] Evgeny Dantsin, Thomas Eiter, Georg Gottlob, Andrei Voronkov. Complexity and Expressive Power of Logic Programming. ACM Computing Surveys, Vol. 33, No. 3, September 2001, pp. 374–425.
- [8] H.-D. Ebbinghaus, J. Flum. Finite Model Theory. Springer, 1999.
- [9] H. Kleine Büning, T. Lettmann. Propositional Logic: Deduction and Algorithms. Cambridge University Press, 1999.
- [10] Hans Kleine Büning, Xishun Zhao. On Models for Quantified Boolean Formulas. In Proc. of SAT’04, 2004.
- [11] H. Kleine Büning, Xishun Zhao. Computational Complexity of Quantified Boolean Formulas with Fixed Maximal Deficiency. Theoretical Computer Science, 407: 448-457, 2008.
- [12] Miklos Ajtai, Yuri Gurevich. Datalog vs first-order logic. Journal of Computer and System Sciences, Volume 49, Issue 3, December 1994, Pages 562-588.
- [13] N. Immerman. Relational Queries Computable in Polynomial Time. Inf. and Control 68 (1986), 86–104.
- [14] N. Immerman. Languages that Capture Complexity Classes. SIAM J. Comput. 16 (1987), 760–778.
- [15] N. Immerman. Descriptive Complexity. Springer-Verlag, New York, 1999.
- [16] P. Kolaitis. The Expressive Power of Stratified Logic Programs. Information and Computation archive Volume 90 , Issue 1, Pages: 50 - 66,1991.
- [17] R. Fagin. Generalized First-Order Spectra and Polynomial-Time Recognizable Sets. SIAM-AMS Proc. 7 (1974), 43–73.
- [18] S. Abiteboul , V. Vianu. Fixpoint extensions of first-order logic and datalog-like languages. Proceedings of the Fourth Annual Symposium on Logic in computer science, p.71-79, June 1989, California, United States
- [19] S. Abiteboul , V. Vianu. DATALOG extensions for database queries and updates. Journal of Computer and System Sciences 43,62-124,1991.
- [20] S. Abiteboul , R. Hull, V. Vianu. Foundations of Data Bases. Addison Wesley, 1995.
- [21] Shiguang Feng, Xishun Zhao. Complexity and Expressive Power of Second-Order Extended Horn Logic. Mathematical Logic Quarterly, under review.
- [22] Xishun Zhao, Hans Kleine Büning. Model-Equivalent Reductions. Lecture Notes in Computer Science, Volume 3569/2005, 355-370, Springer, 2005.
- [23] Y. Gurevich. Logic and the Challenge of Computer Science. Computer Science Press (1988), 1–57.