Book contents
- Frontmatter
- Dedication
- Contents
- Preface
- 1 Logic-Based Approach to Agent Design
- 2 Answer Set Prolog (ASP)
- 3 Roots of Answer Set Prolog
- 4 Creating a Knowledge Base
- 5 Representing Defaults
- 6 The Answer-Set Programming Paradigm
- 7 Algorithms for Computing Answer Sets
- 8 Modeling Dynamic Domains
- 9 Planning Agents
- 10 Diagnostic Agents
- 11 Probabilistic Reasoning
- 12 The Prolog Programming Language
- Appendix A ASP Solver Quick-Start
- Appendix B Aspide
- Appendix C Introduction to SPARC
- Appendix D Code
- Bibliography
- Index
Appendix A - ASP Solver Quick-Start
Published online by Cambridge University Press: 05 July 2014
- Frontmatter
- Dedication
- Contents
- Preface
- 1 Logic-Based Approach to Agent Design
- 2 Answer Set Prolog (ASP)
- 3 Roots of Answer Set Prolog
- 4 Creating a Knowledge Base
- 5 Representing Defaults
- 6 The Answer-Set Programming Paradigm
- 7 Algorithms for Computing Answer Sets
- 8 Modeling Dynamic Domains
- 9 Planning Agents
- 10 Diagnostic Agents
- 11 Probabilistic Reasoning
- 12 The Prolog Programming Language
- Appendix A ASP Solver Quick-Start
- Appendix B Aspide
- Appendix C Introduction to SPARC
- Appendix D Code
- Bibliography
- Index
Summary
What follows is a very brief, operational introduction to two currently existing ASP solvers, clingo and DLV Since the field is developing rapidly, we recommend that users of this information learn about the most current versions of these solvers. To find DLV, go to http://www.dlvsystem.com. To find clingo,goto http://potassco.sourceforge.net/.For quick access to the manuals, just search online for DLV manual or clingo manual.
To find all answer sets of a given program, type
clingo 0 program_name
or
dlv -n=0 program_name
The 0 tells the programs to return all answer sets. If you omit the parameter when calling clingo, the program will return only one answer set; DLV will return all answer sets. Changing the number will return the corresponding number of answer sets. Both systems use – and :– instead of ¬ and ←, respectively. Epistemic disjunction or is denoted by ∣.
Often we may want to limit what a solver will output when it prints answer sets because complete sets can be large and we may only be interested in a few predicates. When using clingo, it is useful to learn the #show commands. For example, if you had a program with predicate mother(X, Y), and you included the following line in your program:
#show mother/2.
clingo would output only those atoms of the answer sets that are formed by predicate mother.
- Type
- Chapter
- Information
- Knowledge Representation, Reasoning, and the Design of Intelligent AgentsThe Answer-Set Programming Approach, pp. 307 - 309Publisher: Cambridge University PressPrint publication year: 2014