$30
Instructions
OVERVIEW
In this milestone, you need to use clingo to find the stable models of 3 basic ASP programs.
Specifically, there are three problems in the attached template. Each problem contains an ASP
program and requires you to
1. use clingo to find all the stable models of the program,
2. fill in the input program, command line, and output in the tables in the given template, and
3. choose an option for the given question. (The 3 questions are given in the "My Assignment"
page.)
Step 1 - Prepare
Download the template below that includes 3 basic ASP programs.
[Template] 579 Project Milestone 2 -- Solutions to Basic Clingo Problems.docx
Step 2 - Use clingo to Complete the 3 Problems in the Template
There are 3 problems in this assignment. Each problem contains an ASP program and requires you
to (i) use clingo to find all the stable models of the program, and (ii) fill in the input program,
command line, and output in the table for that problem in the template you downloaded in Step 1.
Note that an example problem and its solution are shown in the end of this instruction. A detailed
guideline of turning an ASP program into the language of clingo is also given in this example.
Step 3 - Save Your Work
Once you have filled in all 3 tables in the template, you will need to save this template (with your
filled content) as a pdf file named "milestone2.pdf".
Step 4 - Answer Questions, One for Each Problem
Return to this assignment's main page to answer 3 Multi-Choice Single-Correct questions, one for
each problem.
Once you have answered to all 3 questions, you will need to save this page as a pdf file named
"Question.pdf".
Example Problem and Solution
Example Problem
Consider the ASP program below consisting of 3 propositional formulas.
(i) Find all the stable models of this program using clingo.
(ii) Fill in the following table. When writing down the command line, assume the clingo program is
saved in file “p0.txt” where 0 denotes the index of this example problem.
Input Program
Command Line
Output (truncated)
Guidelines
* The implication symbol <- in clingo is written as a colon followed by a hyphen “:-”.
* The disjunction in the head of an ASP rule (i.e., on the left of <- symbol) is written as comma “,” on
the left hand side of “:-”.
* The conjunction in the body of an ASP rule (i.e., on the right of <- symbol) is written as comma “,”
on the right hand side of “:-”.
* Every rule in clingo must end up with a period “.”.
* The fact r can be seen as rule “r <- T”, which is written as “r :- #true.” in clingo and can be simplified
as “r.”
* Your command line may be different depending on your OS. You may truncate your output if it’s
too long but make sure you don’t remove a part if it can support your answers to the Multi-Choice
Single-Correct questions you are going to answer.
Example Solution to the Table
Example Multi-Choice Single-Correct Question and Solution
Q: Which answer option below is a correct statement about this ASP program?
A. It has exactly 2 stable models.
B. It has no stable model.
C. The set of models of this program is the same as the set of stable models of this program.
D. It is unsatisfiable according to propositional logic.
The correct answer is A. It has exactly 2 stable models.
REVIEW CRITERIA
Each table is worth 3 points:
• input program (1 points),
• command line (1 point), and
• output (1 point)
• answer to each question (1 point).