Summary
It is shown that any recognition problem solved by a polynomial time-bounded nondeterministic Turing machine can be "reduced" to the problem of determining whether a given propositional formula is a tautology. Here "reduced" means, roughly speaking, that the first problem can be solved deterministically in polynomial time provided an oracle is available for solving the second. From this notion of reducible, polynomial degrees of difficulty are defined, and it is shown that the problem of determining tautologyhood has the same polynomial degree as the problem of determining whether the first of two given graphs is isomorphic to a subgraph of the second. Other examples are discussed. A method of measuring the complexity of proof procedures for the predicate calculus is introduced and discussed.
Throughout this paper, a set of strings means a set of strings on some fixed, large, finite alphabet . This alphabet is large enough to include symbols for all sets described here. All Turing machines are deterministic recognition devices, unless the contrary is explicitly stated.
1 Tautologies and Polynomial Reducibility
Let us fix a formalism for the propositional calculus in which formulas are written as strings on . Since we will require infinitely many proposition symbols (atoms), each such symbol will consist of a member of followed by a number in binary notation to distinguish that symbol. Thus a formula of length n can only have about distinct function and predicate symbols. The logical connectives are (and), (or), and (not).
The set of tautologies (denoted by {tautologies}) is a certain recursive set of strings on this alphabet, and we are interested in the problem of finding a good lower bound on its possible recognition times. We provide no such lower bound here, but theorem 1 will give evidence that {tautologies} is a difficult set to recognize, since many apparently difficult problems can be reduced to determining tautologyhood. By reduced we mean, roughly speaking, that if tautologyhood could be decided instantly (by an "oracle") then these problems could be decided in polynomial time. In order to make this notion precise, we introduce query machines, which are like Turing machines with oracles in [1].
A query machine is a multitape Turing machine with a distinguished tape called the query tape, and three distinguished states called the query state, yes state, and no state, respectively. If M is a query machine and T is a set of strings, then a T-computation of M is a computation of M in which initially M is in the initial state and has an input string w on its input tape, and each time M assumes the query state there is a string u on the query tape, and the next state M assumes is the yes state if and the no state if . We think of an "oracle", which knows T, placing M in the yes state or no state.
Definition
A set S of strings is P-reducible (P for polynomial) to a set T of strings iff there is some query machine M and a polynomial Q(n) such that for each input string w, the T-computation of M with input w halts within steps ( is the length of w), and ends in an accepting state iff .
It is not hard to see that P-reducibility is a transitive relation. Thus the relation E on sets of strings, given by iff each of and is P-reducible to the other, is an equivalence relation. The equivalence class containing a set will be denoted by (the polynomial degree of difficulty of ).
Definition: We will denote by , where denotes the zero function.
Thus is the class of sets recognizable in polynomial time. was discussed in [2], p. 5, and is the string analog of Cabham's class of functions [3].
We now define the following special sets of strings.
- The subgraph problem is the problem given two finite undirected graphs, determine whether the first is isomorphic to a subgraph of the second. A graph can be represented by a string on the alphabet by listing the successive rows of its adjacency matrix, separated by *'s. We let {subgraph pairs} denote the set of strings such that is isomorphic to a subgraph of .
- The graph isomorphism problem will be represented by the set, denoted by {isomorphic graphpairs}, of all strings such that is isomorphic to .
- The set {Primes} is the set of all binary notations for prime numbers.
- The set {DNF tautologies} is the set of strings representing tautologies in disjunctive normal form.
- The set consists of those tautologies in disjunctive normal form in which each disjunct has at most three conjuncts (each of which is an atom or negation of an atom).
Theorem 1: If a set of strings is accepted by some nondeterministic Turing machine within polynomial time, then is P-reducible to {DNF tautologies}.
Corollary: Each of the sets in definitions 1)-5) is P-reducible to {DNF tautologies}.
This is because each set, or its complement, is accepted in polynomial time by some nondeterministic Turing machine.
Proof of the theorem: Suppose a nondeterministic Turing machine accepts a set of strings within time , where is a polynomial. Given an input for , we will construct a proposition formula in conjunctive normal form such that is satisfiable iff accepts . Thus is easily put in disjunctive normal form (using De Morgan's laws), and is a tautology if and only if . Since the whole construction can be carried out in time bounded by a polynomial in (the length of ), the theorem will be proved.
We may as well assume the Turing machine has only one tape, which is infinite to the right but has a left-most square. Let us number the squares from left to right . Let us fix an input to of length , and suppose . Then there is a computation of with input that ends in an accepting state within steps. The formula will be built from many different proposition symbols, whose intended meanings, listed below, refer to such a computation.
Suppose the tape alphabet for is , and the set of states is . Notice that since the computation has at most steps, no tape square beyond number is scanned.
Proposition symbols:
is true iff tape square number at step contains the symbol .
The formula is a conjunctive B\&C\&D\&E\&F\&G\&H\&I formed as follows. Notice is in conjunctive normal form.
B will assert that at each step t, one and only one square is scanned. B is a conjunction , where asserts that at time t one and only one square is scanned:
For and , asserts that at square s and time t there is one and only one symbol. C is the conjunction of all the .
D asserts that for each t there is one and only one state.
E asserts the initial conditions are satisfied:
where , is the initial state and is the blank symbol.
F, G, and H assert that for each time t the values of the P's, Q's and S's are updated properly. For example, G is the conjunction over all t, i, j of , where asserts that if at time t the machine is in state scanning symbol , then at time the machine is in state , where is the state given by the transition function for M.
Finally, the formula I asserts that the machine reaches an accepting state at some time. The machine M should be modified so that it continues to compute in some trivial fashion after reaching an accepting state, so that will be satisfied.
It is now straightforward to verify that has all the properties asserted in the first paragraph of the proof.
Theorem 2: The following sets are P-reducible to each other in pairs (and hence each has the same polynomial degree of difficulty): {tautologies}, {DNF tautologies}, , {subgraph pairs}.
Remark: We have not been able to add either {primes} or {isomorphic graph pairs} to the above list. To show {tautologies} is P-reducible to {primes} would seem to require some deep results in number theory, while showing {tautologies} is P-reducible to {isomorphic graph pairs} would probably upset a conjecture of Corneil's [4] from which he deduces that the graph isomorphism problem can be solved in polynomial time.
Incidently, it not hard to see from the Davis-Putnam procedure [5] that the set , consisting of all DNF tautologies with at most two conjuncts per disjunct, is in . Hence cannot be added to the list in theorem 2 (unless all sets in the list are in ).
Proof of theorem 2: By the corollary to theorem 1, each of the sets is P-reducible to {DNF tautologies}. Since obviously {DNF tautologies} is P-reducible to {tautologies}, it remains to show {DNF tautologies} is P-reducible to and is P-reducible to {subgraph pairs}.
To show {DNF tautologies} is P-reducible to , let A be a proposition formula in disjunctive normal form. Say , where , and each is an atom or negation of an atom, and . Then A is a tautology if and only if is a tautology where
where P is a new atom. Since we have reduced the number of conjuncts in , this process may be repeated until eventually a formula is found with at most three conjuncts per disjunct. Clearly the entire process is bounded in time by a polynomial in the length of A.
It remains to show is P-reducible to {subgraph pairs}. Suppose A is a formula in disjunctive normal form with three conjuncts per disjunct. Thus , where
C_i = R_{i1} \& R_{i2} \& R_{i3}, and each R_{ij} is an atom or a negation of an atom. Now let G_1 be the complete graph with vertices {v_1, v_2, ..., v_k}, and let G_2 be the graph with vertices {u_{ij}}, 1 \leq i \leq k, 1 \leq j \leq 3, such that u_{ij} is connected by an edge to u_{rs} if and only if i \neq r and the two literals (R_{ij}, R_{rs}) do not form an opposite pair (that is they are neither of the form (P, \neg P) nor of the form (\neg P, P)). Thus there is a falsifying truth assignment to the formula A iff there is a graph homomorphism such that for each i, for some j. (The homomorphism tells for each i which of R_{i1}, R_{i2}, R_{i3} should be falsified, and the selective lack of edges in G_2 guarantees that the resulting truth assignment is consistently specified).
In order to guarantee that a one-one homomorphism has the property that for each i, for some j, we modify G_1 and G_2 as follows. We select graphs H_1, H_2, ..., H_k which are sufficiently distinct from each other that if G'_1 is formed from G_1 by attaching H_i to v_i, 1 \leq i \leq k, and G'_2 is formed from G_2 by attaching H_i to each of u_{i1} and u_{i2} and u_{i3}, 1 \leq i \leq k, then every one-one homomorphism has the property just stated. It is not hard to see such a construction can be carried out in polynomial time. Then G'_1 can be embedded in G'_2 if and only if A \notin D_3. This completes the proof of theorem 2.
2 Discussion
Theorem 1 and its corollary give strong evidence that it is not easy to determine whether a given proposition formula is a tautology, even if the formula is in normal disjunctive form. Theorems 1 and 2 together suggest that it is fruitless to search for a polynomial decision procedure for the subgraph problem, since success would bring polynomial decision procedures to many other apparently intractible problems. Of course the same remark applies to any combinatorial problem to which {tautologies} is P-reducible.
Furthermore, the theorems suggest that {tautologies} is a good candidate for an interesting set not in , and I feel it is worth spending considerable effort trying to prove this conjecture. Such a proof would be a major breakthrough in complexity theory.
In view of the apparent complexity of {DNF tautologies}, it is interesting to examine the Davis-Putnam procedure [5]. This procedure was designed to determine whether a given formula in conjunctive normal form is satisfiable, but of course the "dual" procedure determines whether a given formula in disjunctive normal form is a tautology. I have not yet been able to find a series of examples showing the procedure (treated sympathetically to avoid certain pitfalls) must require more than polynomial time. Nor have I found an interesting upper bound for the time required.
If we let strings represent natural numbers, (or k-tuples of natural numbers) using m-adic or other suitable notation, then the notions in the preceding sections can be made to apply to sets of numbers (or k-place relations on numbers). It is not hard to see that the set of relations accepted in polynomial time by some nondeterministic Turing machine is precisely the set of relations of the form
(1) where , is the dyadic length of z, and is an relation, ( is the class of extended positive rudimentary relations of Bennett [6]). If we remove the bound on the quantifier in formula (1), the class would become the class of recursively enumerable sets. Thus if is the analog of the class of r.e. sets, then determining tautologyhood is the analog of the halting problem; since, according to theorem 1, {tautologies} has the complete degree just as the halting problem has the complete r.e. degree. Unfortunately, the diagonal argument which shows the halting problem is not recursive apparently cannot be adapted to show {tautologies} is not in .
3 The Predicate Calculus
Formulas in the predicate calculus are represented by strings in a manner similar to the propositional calculus. In addition to the symbols for the latter, we need the quantifier symbols and , and symbols for forming an infinite list of individual variables, and infinite lists of function and predicate symbols of each order (of course the underlying alphabet is still finite).
Suppose Q is a procedure which operates on the above formulas and which terminates on a given input formula A iff A is unsatisfiable. Since there is no decision procedure for satisfiability in the predicate calculus, it follows that there is no recursive function T such that if A is unsatisfiable, then Q will terminate within T(n) steps, where n is the length of A. How then does one appraise the efficiency of the procedure?
We will take the following approach. Most automatic theorem provers depend on the Herbrand theorem, which states briefly that a formula A is unsatisfiable if and only if some conjunction of substitution instances of the functional form fn(A) of A is truth functionally inconsistent. Suppose we order the terms in the Herbrand universe of fn(A) according to rank, and then order in a natural way the substitution instances of fn(A) from the Herbrand universe. The ordering should be such that in general substitution instances which use terms with greater rank follow substitution instances which use terms of lesser rank. Let be these substitution instances in order.
Definition: If A is unsatisfiable, then is the least k such that is truth-functionally inconsistent. If A is satisfiable, then is undefined.
Now let Q be the procedure which, given A, computes the sequence and for each i, tests whether is truth-functionally consistent. If the answer is ever no, the procedure terminates successfully. Then clearly there is a recursive T(k) such that for all k and all formulas A, if the length of and , then Q will terminate within T(k) steps. We suggest that the function T(k) is a measure of the efficiency of Q.
For convenience, all procedures in this section will be realized on single tape Turing machines, which we shall call simply machines.
Definition: Given a machine and recursive function , we will say is of type Q and runs within time provided that when starts with a predicate formula A written on its tape, then halts if and only if A is unsatisfiable, and for all k, if and , then halts within steps. In this case we will also say that is of type Q. Here is the length of A.
The reason for the condition instead of , is that with the latter condition, finding a lower bound for would be nearly equivalent to finding a lower bound for the decision problem for the propositional calculus. In particular, theorem 3A would become obvious and trivial.
Theorem 3: A) For any of type Q,
is unbounded.
B) There is a of type Q such that
Outline of proof: A). Given any machine M, one can construct a predicate formula which is satisfiable if and only if M never halts when starting on a blank tape. This is done along the lines described in Wang [7] in the proof which reduces the halting problem to the decision problem for the predicate calculus. Further, if M halts in s steps, then
Thus, if, contrary to (2), , then a modification of could verify in only
steps that M halted in s steps (provided , where m is the length of ). A diagonal argument (see [8] p. 153) shows that this is impossible in general.
B) The machine operates in time by following the procedure outlined at the beginning of this section. Note that the formula has length , since we can assume .
Theorem 4: If the set S of strings is accepted by a nondeterministic machine within time , and if is an honest (i.e. real-time countable) function of type Q, then there is a constant K so S can be recognized by a deterministic machine within time .
Proof: Suppose is a nondeterministic machine which accepts S in time . Let be a nondeterministic machine which simulates for exactly steps and then halts, unless accepts the input, in which case computes forever. Thus for all strings w, if then there is a computation for which with input w fails to halt, and if , then with input w halts within steps for all computations. Now given w of length n, we may construct a formula of length such that is satisfiable if and only if accepts w. ( is constructed in a way similar to in the proof of 1A). Further, if halts within steps for all possible computations, then
Thus, a deterministic machine M can be constructed to determine whether by presenting with input . If no result appears within steps, then , and otherwise .
4 More Discussion:
There is a large gap between the lower bound of for time functions given in theorem 3A and a possible
given in 3B. However, there are reasons for the gap. For example, if we could improve the result in 3B and find a bounded by a polynomial in k, then by theorem 4 we could simulate a nondeterministic time bounded machine deterministically in time for some polynomial p. This is contrary to experience which indicates deterministic simulation of a nondeterministic time bounded machine requires time in general.
On the other hand, if we could push up the lower bound given in theorem 3A and show
is unbounded, then we could conclude {Tautologies} , since otherwise the general Herbrand proof procedure would provide a smaller than . Thus such an improvement in 3A would require a major breakthrough in complexity theory.
The field of mechanical theorem proving badly needs a basis for comparing and evaluating the dozens of procedures which appear in the literature. Performance of a procedure on examples by computer is a good criterion, but not sufficient (unless the procedure proves useful in some practical way). A theoretical complexity criterion is needed which will bring out fundamental limitations and suggest new goals to pursue.
The criterion suggested here (the function ) is probably too crude. For example, it might be better to make a function of several variables, of which one is , and another might be the minimum number of substitution instances of needed to form a contradiction (note that in general not all of are needed.)
may be a crude measure, but it does provide a basis for discussion, and, I hope, will stimulate progress toward finding better complexity measures for theorem provers.