To save content items to your account,
please confirm that you agree to abide by our usage policies.
If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account.
Find out more about saving content to .
To save content items to your Kindle, first ensure no-reply@cambridge.org
is added to your Approved Personal Document E-mail List under your Personal Document Settings
on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part
of your Kindle email address below.
Find out more about saving to your Kindle.
Note you can select to save to either the @free.kindle.com or @kindle.com variations.
‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi.
‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.
Our aim in the previous section was to present Gödel's first incompleteness theorem in the context of recursion theory. Much as this “modern” approach is valuable for showing the links between unprovability and uncomputability, it has obscured the simplicity of Gödel's ingenious idea (as it was carried out in his original paper (1931)).
What he had accomplished in that paper, through arithmetization of formulas and proofs, was to build a sentence of arithmetic, ℱ, that said “I am not a theorem”. One can easily prove, metamathematically, that such an ℱ is undecidable, if arithmetic is ω-consistent.
To see this at the intuitive level, let us replace ω-consistency by correctness. Then surely ℱ is not provable, for if it is, then it is a theorem, and hence false (contradicting correctness).
On the other hand, we have just concluded that ℱ is true! Hence, ¬ℱ is false, and therefore not provable either (by correctness).
This simple application of the “liar's paradox” is at the heart of the first incompleteness theorem.
Imagine now that the arithmetization is actually carried out within (some) formal arithmetic, and that with some effort we have managed to embed into formal arithmetic the metamathematical argument that leads to the assertion “if arithmetic is consistent, then ⊬ ℱ”. The quoted statement is formalized by “Con → ℱ”, where “Con” is some (formal) sentence that says that arithmetic is consistent.
In Chapter 4 we formulated several knowledge representation and problem solving domains using AnsProlog* and focused on the program development aspect. In this chapter we consider reasoning about actions in a dynamic world and its application to plan verification, simple planning, planning with various kinds of domain constraints, observation assimilation and explanation, and diagnosis. We do a detailed and systematic formulation – in AnsProlog* – of the above issues starting from the simplest reasoning about action scenarios and gradually increasing its expressiveness by adding features such as causal constraints, and parallel execution of actions. We also prove properties of our AnsProlog* formulations using the results in Chapter 3.
Our motivation behind the choice of a detailed formulation of this domain is twofold. (i) Reasoning about actions captures both major issues of this book: knowledge representation and declarative problem solving. To reason about actions we need to formulate the frame problem whose intuitive meaning is that objects in the worlds do not normally change their properties. Formalizing this has been one of the benchmark problems of knowledge representation and reasoning formalisms. We show how AnsProlog* is up to this task. Reasoning about actions also forms the ground work for planning with actions, an important problem solving task. We present AnsProlog encodings of planning such that the answer sets each encode a plan. (ii) Our second motivation is in regard to the demonstration of the usefulness of the results in Chapter 3.
This appendix is based on [Pap94] and it is recommended that the reader refer to that for detailed exposition on Turing machines, and computational complexity.
Intuitively, a deterministic Turing machine (DTM) is an automata bundled with a semi-infinite tape with a cursor to read from and write to. So, like an automata, there is a state and state transitions are based on the current state and what the cursor points to on the tape. But in addition to the state transition, there is an accompanying transition that dictates if the symbol in the tape location pointed to by the cursor should be overwritten and if the cursor should move to the left or right – by one cell – of its current position. Special symbols mark the beginning of the tape (>), the end of the input on the tape (⊔), and the output of the computation (‘halt’, ‘yes’, ‘no’). We now give a formal definition of DTMs.
Definition 151 A DTM is a quadruple M = (S, Σ, δ, s0) where S is a finite set of nonfinal states that includes s0 the initial state, Σ is a finite alphabet of symbols including the special symbols > and ⊔, and δ is a transition function that maps S × Σ to S ∪ {halt, yes, no} × Σ × {←, →, –}
Intuitively, δ is the control (or the program) of the machine that dictates how the machine behaves.
Both volumes in this series are about what mathematicians, especially logicians, call the “foundations” (of mathematics) – that is, the tools of the axiomatic method, an assessment of their effectiveness, and two major examples of application of these tools, namely, in the development of number theory and set theory.
There have been, in hindsight, two main reasons for writing this volume. One was the existence of notes I wrote for my lectures in mathematical logic and computability that had been accumulating over the span of several years and badly needed sorting out. The other was the need to write a small section on logic, “A Bit of Logic” as I originally called it, that would bootstrap my volume on set theory on which I had been labouring for a while. Well, one thing led to another, and a 30 or so page section that I initially wrote for the latter purpose grew to become a self-standing volume of some 300 pages. You see, this material on logic is a good story and, as with all good stories, one does get carried away wanting to tell more.
I decided to include what many people will consider, I should hope, as being the absolutely essential topics in proof, model, and recursion theory – “absolutely essential” in the context of courses taught near the upper end of undergraduate, and at the lower end of graduate curricula in mathematics, computer science, or philosophy. But no more. This is the substance of Chapter I; hence its title “Basic Logic”.
In this chapter we discuss three query answering and answer set computing systems: Smodels, dlv and PROLOG. Both Smodels and dlv are answer set computing systems and allow an input language with features and constructs not in AnsProlog*. While the Smodels system extends AnsProlog⊥ and AnsProlog⊥, ¬, the dlv system extends AnsProlog⊥,or and AnsProlog⊥,or,¬. We describe the syntax and semantics of the input language of Smodels and dlv and present several programs in their syntax. This chapter can be thought of as a quick introduction to programming in Smodels and dlv, not a full-fledged manual. At the time of writing this, both Smodels and dlv were evolving systems and readers are recommended to visit their corresponding web sites for the latest features.
After describing the Smodels and dlv systems with several small example programs, we consider several medium and large size applications and encode them using one or the other. In particular, we consider encoding of combinatorial auctions together with logical preference criteria, planning with durative actions and resources, resource constraint project scheduling, and specification and verification of active databases.
Finally, we give a brief introduction to the PROLOG interpreter and its approach to answering queries with respect to AnsProlog programs. We present conditions for AnsProlog programs and queries for which the PROLOG interpreter is sound and complete. We illustrate these conditions through several examples.
Smodels
The Smodels system is meant for computing the answer sets of AnsProlog⊥ and AnsProlog⊥,¬ programs and allows certain extensions to them.
In this chapter we formulate several knowledge representation and problem solving domains using AnsProlog*. Our focus in this chapter is on program development. We start with three well known problems from the literature of constraint satisfaction, and automated reasoning: placing queens on a chess board, determining who owns the zebra, and finding tile covering in a mutilated chess board. We show several encodings of these problems using AnsProlog*. We then discuss a general methodology for representing constraint satisfaction problems (CSPs) and show how to extend it to dynamic CSPs. We then present encodings of several combinatorial graph problems such as k-colorability, Hamiltonian circuit, and k-clique. After discussing these problem solving examples, we present a general methodology of reasoning with prioritized defaults, and show how reasoning with inheritance hierarchies is a special case of this.
Three well-known problem solving tasks
A well-known methodology for declarative problem solving is the generate and test methodology whereby possible solutions to the problem are generated and non-solutions are eliminated by testing. This is similar to the common way of showing that a problem is in the class NP, where it is shown that after the non-deterministic choice the testing can be done in polynomial time. The ‘generate’ part in an AnsProlog* formulation of a problem solving task is achieved by enumerating the possibilities, and the ‘test’ part is achieved by having constraints that eliminate the possibilities that violate the test conditions. Thus the answer sets of the resulting program correspond to solutions of the given problem.
Earlier in Chapter 3 we discussed several results and properties of AnsProlog* programs that are useful in analyzing and step-by-step building of these programs. In this chapter we consider some broader properties that help answer questions such as: (a) how difficult is it to compute answer sets of various sub-classes of AnsProlog*? (b) how expressive are the various sub-classes of AnsProlog*? (c) does the use of AnsProlog* lead to compact representation or can it be compiled to a more tractable representation? and (d) what is the relationship between AnsProlog* and other knowledge representation formalisms?
The answers to these questions are important in many ways. For example, if we know the complexity of a problem that we want to solve then the answer to (a) will tell us which particular subset of AnsProlog* will be most efficient, and the answer to (b) will tell us the most restricted subset that we can use to represent that problem. With respect to (c) we will discuss results that show that AnsProlog* leads to a compact representation. This clarifies the misconception that since many AnsProlog* classes belong to a higher complexity class, they are not very useful. For specifications where AnsProlog* leads to (exponentially) compact representation the fact that they are computationally harder is canceled out and they become preferable because compact representation means that the programmer has to write less. So the burden is shifted from the programmer to the computer, which is often desirable.
In this chapter we present several small AnsProlog* programs corresponding to several declarative problem solving modules or knowledge representation and reasoning aspects. Although in general we may have intermingling of the declarative problem solving, and the knowledge representation and reasoning aspects, they can be differentiated as follows.
Normally a problem solving task is to find solutions of a problem. A declarative way to do that is to declaratively enumerate the possible solutions and the tests such that the answer sets of the resulting program correspond to the solutions of the problem. The declarative problem solving modules that we consider in this chapter include modules that enforce simple constraints, modules that enumerate interpretations with respect to a set of atoms, modules that uniquely choose from a set of possibilities, modules that encode propositional satisfiability, modules that represent closed first-order queries, modules that check satisfiability of quantified boolean formulas with up to two quantifiers, modules that assign a linear ordering between a set of objects, modules that can represent various aggregations of facts (such as minimization, maximization, sum and average), modules that encode classical disjunction conclusions, modules that encode exclusive-or conclusions, and modules that encode cardinality and weight constraints.
By knowledge representation and reasoning aspects we mean representing particular benchmark aspects of nonmonotonic and common-sense reasoning that we want to be encoded by AnsProlog* programs.
So far in the book we have considered sub-classes of AnsProlog* which have been well-studied in the literature and two additional extensions AnsPrologsm and AnsPrologdlv which are the input language of the answer set computing systems Smodels and dlv. There have been several additional proposals for extending AnsProlog*, which are not that well-studied. Also, there have been many alternative proposals to characterize programs in the syntax of AnsProlog* and its sub-classes. In this chapter we give a brief overview of the above two aspects.
Some of the extensions that we consider are: (i) enriching the rules by allowing not in the head of rules, (ii) allowing nesting in the head and body of rules; (iii) allowing additional operators such as knowledge and belief operators; (iv) enriching the framework by allowing abduction; (v) allowing explicit specification of intent to use domain closure and its impact on the universal query problem; (vi) allowing set constructs; and (vii) allowing specification preferences between rules of a program.
In regard to alternative characterizations of programs in the syntax of AnsProlog* and its sub-classes, we focus mostly on AnsProlog and AnsProlog¬ syntax, and the well-founded semantics. In the process we define notions such as the 3-valued stable models, and stable classes which are related to both the well-founded characterization and the answer sets. We also briefly discuss the framework of argumentation which can be used in defining both answer sets and the well-founded characterization of programs in AnsProlog syntax.
Logic is the science of reasoning. Mathematical logic applies to mathematical reasoning – the art and science of writing down deductions. This volume is about the form, meaning, use, and limitations of logical deductions, also called proofs. While the user of mathematical logic will practise the various proof techniques with a view of applying them in everyday mathematical practice, the student of the subject will also want to know about the power and limitations of the deductive apparatus.We will find that there are some inherent limitations in the quest to discover truth by purely formal – that is, syntactic – techniques. In the process we will also discover a close affinity between formal proofs and computations that persists all the way up to and including issues of limitations: Not only is there a remarkable similarity between the types of respective limitations (computations vs. uncomputable functions, and proofs vs. unprovable, but “true”, sentences), but, in a way, you cannot have one type of limitation without having the other.
The modern use of the term mathematical logic encompasses (at least) the areas of proof theory (it studies the structure, properties, and limitations of proofs), model theory (it studies the interplay between syntax and meaning – or semantics – by looking at the algebraic structures where formal languages are interpreted), recursion theory (or computability, which studies the properties and limitations of algorithmic processes), and set theory.
In this chapter we discuss four algorithms for computing answer sets of ground AnsProlog* programs. The first three algorithms compute answer sets of ground AnsProlog programs while the fourth algorithm computes answer sets of ground AnsPrologor programs. In Chapter 8 we will discuss several implemented systems that compute answer sets and use algorithms from this chapter.
Recall that for ground AnsProlog and AnsPrologor programs π answer sets are finite sets of atoms and are subsets of HBMπ. In other words answer sets are particular (Herbrand) interpretations of π which satisfy additional properties. Intuitively, for an answer set A of π all atoms in A are viewed as true with respect to A, and all atoms not in A are viewed as false with respect to A. Most answer set computing algorithms – including the algorithms in this chapter – search in the space of partial interpretations, where in a partial interpretation some atoms have the truth value true, some others have the truth value false and the remaining are considered to be neither true nor false. In the first three algorithms in this chapter the partial interpretations are 3-valued and are referred to as 3-valued interpretations, while in the fourth algorithm the partial interpretation that is used is 4-valued. Recall that we introduced 3-valued interpretations in Section 6.6.9, and that in 3-valued interpretations the atoms which are neither true not false have the truth value unknown.
In this chapter we present several fundamental results that are useful in analyzing and step-by-step building of AnsProlog* Programs, viewed both as stand alone programs and as functions. To analyze AnsProlog* programs we define and describe several properties such as categoricity (presence of unique answer sets), coherence (presence of at least one answer set), computability (answer set computation being recursive), filter-abducibility (abductive assimilation of observations using filtering), language independence (independence between answer sets of a program and the language), language tolerance (preservation of the meaning of a program with respect to the original language when the language is enlarged), compilabity to first-order theory, amenabity to removal of or, and restricted monotonicity (exhibition of monotonicity with respect to a select set of literals).
We also define several subclasses of AnsProlog* programs such as stratified, locally stratified, acyclic, tight, signed, head cycle free and several conditions on AnsProlog* rules such as well-moded and state results about which AnsProlog* programs have what properties. We present several results that relate answer sets of an AnsProlog* program to its rules. We develop the notion of splitting and show how the notions of stratification, local stratification, and splitting can be used in step-by-step computation of answer sets.
For step-by-step building of AnsProlog* programs we develop the notion of conservative extension – where a program preserves its original meaning after additional rules are added to it, and present conditions for programs that exhibit this property.