#!/usr/bin/env python # coding: utf-8 # # Learning ASP from Examples # # This directory collects notebooks with exercises to learn Answer Set Programming from examples. # You can browse through the directory by clicking on the folder symbol at the left side of this window. # # These exercises belong to the tutorial "Easy Answer Set Programming" of the course [Answer Set Solving in Practice](https://teaching.potassco.org) of the University of Potsdam. # # The environment of the notebooks is described in the file ``environment.ipynb`` at the top directory. # # The directory ``without-variables`` is about programs without variables, and # the directory ``with-variables`` is a about programs with variables. # # Every exercise consists of around 8 pairs of logic programs. # You can see the answer sets of the first program, and # your task is to find the answer sets of the second program # (note that answer sets are the same as stable models). # # You can take these exercises as puzzles where you learn from the first program, # and then you apply this knowledge to find the answer sets of the second program. # # To correct your solution, run ``clingo`` on the second program to obtain its answer sets. # For this, simply click on the cell and then either click the button ``Run`` or press ``Ctrl+Enter``. # The commands for ``clingo`` use option ``-V0`` to print a short output, and # option ``0`` to enumerate all answer sets.