Because of the wealth of the study of logic, it is often divided into two facets: mathematical logic and philosophical logic. The former is more relevant to our study of computer science and is further divided into a number of categories: propostional logic (or sentential logic, Boolean logic), predicate logic (including first-order, second-order, etc.), both of which are classical studies, and intuitionistic logic (whose most apparent feature is the absence of the law of excluded-middle, one of the constituents of classical logic), which is the modern trend. We shall always refer to the classical one in this thesis.
There are four theories intimately related to the study of logic: proof theory, model theory, set theory and recursion theory. Proof theory and model theory, respectively, represent the studies of the two most fundamental notions about logic — that of syntax and of semantics.
Set theory was proposed by the German mathematician Cantor. It is by and large considered the most fundamental theory in mathematics since the whole mathematics can be based on the notion of sets.
Finally, in the view point concerning theoretical computer science, recursion theory is usually considered part of computation theory, and hence is often called computability theory, with the other part of computation theory being (computational) complexity theory. The American mathematician Church proposed the so-called λ-calculus, which is one of the formal notions of computations, proved to be equivalent to other notions such as Turing machine.
1.2.1 Computational Problems
Logic is powerful in expressing statements in symbolic fashion since its expressibilty is its raison d’ˆetre. It has the ability to express all the mathematical statements and therefore it is natural to express computational problems in logic.
In computation theory, a problem is said to be in P if there is a deterministic Turing machine that decides it in polynomial time, whereas a problem is in NP if the same happens except for a nondeterministic Turing machine. The problem P = NP is well-known in this field.?
Essentially, every computational problem (which can be seen as a set of strings, i.e. a language) can be taken as one in graph theory, as the encoding of every string in it can be
regarded as the first row of the adjacency matrix of a graph.
According to Fagin [1], all the graph-theoretic problems in NP can be characterized as formulae in existential second-order logic. Moreover, Kolaitis and Vardi [2] showed the powerful zero-one law, which implies that the set of problems expressible in Horn existential second-order logic is only a restricted proper subset of P.
However, with an additional predicate symbolS which is interpreted as the successor func-tion in advance, the problems that are precisely in P can be characterized as Horn formulae in existential second-order logic. This result was independently discovered in [3, 4, 5, 7]. We shall later give another illustration of the requirement that the predicate symbol of successor function should be given in advance.
Chapter 2
Topics on Propositional Logic
Generally speaking, in the investigations of logic we quite often concern ourselves to those objects called logical statements. Informally, a logical statement is one that is declarative, i.e.
one that we can decide whether is true or false — the so-called truth value. For example,
1. “1 + 1 = 2,”
2. “J. K. Rowling is the author of the series of novels Harry Potter,” and 3. “D. E. Knuth is one of the greatest computer scientists ever,”
etc.
But more importantly, the truth value of a logical statement or, equivalently, whether it holds or not, should be independent of one’s own opinion, i.e. it should be clear and universally accepted. If we re-examine the three examples listed above, it should be clear that the first two are logical statements while the last is not in the sense that whether it is true depends on our own opinions (though almost all people of our time accept it with no doubt).
As mentioned earlier, we restrict our interest to classical logic, one feature of which is binary truth value (either true or false, or either 0 or 1 for another notation), whereas in modern logic there is one area called multivalued logic, in which truth values between 0 and 1 are allowed.
2.1 Preliminaries
Natural languages, such as everday English or Chinese, abound with plenty of connectives:
‘and,’ ‘or,’ ‘not,’ ‘but,’ ‘if . . . then,’ ‘if . . . then . . . else,’ ‘since,’ ‘unless,’ ‘while,’ etc. Actually, some of them are redundant, for example:
1. “Fried chicken is delicious but unhealthy.”: we could say “fried chicken is delicious and fried chicken is not healthy,” though that seems somewhat garrulous.
2. “If P = NP, then there are efficient algorithms to solve those NP-complete problems; else they are considered to be intractable.”: we could say “if P = NP, then there are efficient algorithms to solve NP-complete problems; else NP-complete problems are considered to be intractable.”
And at the same time, there is often temporal ordering with the usage of ‘and’:
1. “The police came in and the thief ran away.”
2. “The thief ran away and the police came in.”
In such statements, ‘and’ is in place of ‘and then.’
Moreover, we use ‘or’ sometimes in inclusive sense such as “that girl is slim or she is smart,”
in which one of both constituents of the statement is the case, and the case can be both; other times in exclusive sense such as “the manufacturer of this CPU is Intel or AMD,” in which one of both constituents of the statement is the case but it cannot be both. Occasionally, we even use ‘or’ to describe the situation resulted from that some criterion fails to hold, e.g. “you should hurry up or you would miss the bus.”
Moreover, some of them somewhat implicitly show our feelings about the events. For ex-ample, “that machine seems broken but it works,” in which the use of ‘but’ shows our surprise that the machine in question still works.
As we have seen, these examples illustrate the ambiguities and vagueness that often arise in our daily languages. What we need as a tool in studying mathematics as well as logic, is a formal and artificial language that contains preciseness and exactness while excluding those uncertainties.
Fortunately, for our purpose it is sufficient to use only a restricted part of the connetives mentioned above: ‘and,’ ‘or,’ ‘not,’ ‘if . . . then,’ and additionally ‘if and only if.’ In order to be precise, in logical statements we shall limit ourselves to the usage of the connectives just mentioned, and it is no loss with this restriction. In particular, we shall stipulate that
1. There is no temporal ordering with ‘and’;
2. There is no causal relation between the two statements connected by ‘or,’ it is merely used to indicate that one (or more) statement is the case;
3. ‘If . . . then’ is always used for implications; and finally 4. ‘If and only if’ is always used for bi-implications.