Book contents
- Frontmatter
- Contents
- Preface
- 1 Declarative programming in AnsProlog*: introduction and preliminaries
- 2 Simple modules for declarative programming with answer sets
- 3 Principles and properties of declarative programming with answer sets
- 4 Declarative problem solving and reasoning in AnsProlog*
- 5 Reasoning about actions and planning in AnsProlog*
- 6 Complexity, expressiveness, and other properties of AnsProlog* programs
- 7 Answer set computing algorithms
- 8 Query answering and answer set computing systems
- 9 Further extensions of and alternatives to AnsProlog*
- Appendix A Ordinals, lattices, and fixpoint theory
- Appendix B Turing machines
- Bibliography
- Index of notation
- Index of terms
4 - Declarative problem solving and reasoning in AnsProlog*
Published online by Cambridge University Press: 13 August 2009
- Frontmatter
- Contents
- Preface
- 1 Declarative programming in AnsProlog*: introduction and preliminaries
- 2 Simple modules for declarative programming with answer sets
- 3 Principles and properties of declarative programming with answer sets
- 4 Declarative problem solving and reasoning in AnsProlog*
- 5 Reasoning about actions and planning in AnsProlog*
- 6 Complexity, expressiveness, and other properties of AnsProlog* programs
- 7 Answer set computing algorithms
- 8 Query answering and answer set computing systems
- 9 Further extensions of and alternatives to AnsProlog*
- Appendix A Ordinals, lattices, and fixpoint theory
- Appendix B Turing machines
- Bibliography
- Index of notation
- Index of terms
Summary
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.
- Type
- Chapter
- Information
- Publisher: Cambridge University PressPrint publication year: 2003