Skip to main content Accessibility help
×
Hostname: page-component-848d4c4894-2xdlg Total loading time: 0 Render date: 2024-06-13T22:22:49.377Z Has data issue: false hasContentIssue false

Appendix A - ASP Solver Quick-Start

Published online by Cambridge University Press:  05 July 2014

Michael Gelfond
Affiliation:
Texas Tech University
Get access

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 Agents
The Answer-Set Programming Approach
, pp. 307 - 309
Publisher: Cambridge University Press
Print publication year: 2014

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

Save book to Kindle

To save this book to your Kindle, first ensure coreplatform@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.

Find out more about the Kindle Personal Document Service.

  • ASP Solver Quick-Start
  • Michael Gelfond, Texas Tech University, Yulia Kahl
  • Book: Knowledge Representation, Reasoning, and the Design of Intelligent Agents
  • Online publication: 05 July 2014
  • Chapter DOI: https://doi.org/10.1017/CBO9781139342124.014
Available formats
×

Save book to Dropbox

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 Dropbox.

  • ASP Solver Quick-Start
  • Michael Gelfond, Texas Tech University, Yulia Kahl
  • Book: Knowledge Representation, Reasoning, and the Design of Intelligent Agents
  • Online publication: 05 July 2014
  • Chapter DOI: https://doi.org/10.1017/CBO9781139342124.014
Available formats
×

Save book to Google Drive

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 Google Drive.

  • ASP Solver Quick-Start
  • Michael Gelfond, Texas Tech University, Yulia Kahl
  • Book: Knowledge Representation, Reasoning, and the Design of Intelligent Agents
  • Online publication: 05 July 2014
  • Chapter DOI: https://doi.org/10.1017/CBO9781139342124.014
Available formats
×