Domain-Dependent Knowledge in Answer Set Programming

This page contains the source codes presented in the paper "Domain-Dependent Knowledge in ASP". The codes are changed frequently and you might experience some problems because I keep changing the predicate names to better reflect the role they play in the program. Please contact me if you have any questions and comments. To avoid conflicts with built-in predicates in SMODELS, some of the predicates in the source files have different names than what we have in the paper, for example, 'isand' and 'isor' stand for 'and' and 'or', respectively. Currently, I am testing a new set of rules. They will be posted soon. 

Overview
  1. Requirement: SMODELS and LPARSE
  2. The SICSTUS-Prolog translator (translate.pl) from domain in B into its logic program encoding. Download is translate.pl.
  3. Implementation of GOLOG+HTN constructs: axioms, formula, htn, and axs-trans
  4. Examples
  5. The AIPS 2002 Elevator Domain
  6. The Elevator Domain from the original GOLOG paper
  7. The AIPS 2002 Block Domain

1. Examples of GOLOG constructs as programs.

The command line:   lparse <example-file> actheory axioms axs-trans formula | smodels
where <example-file> is the name of the file containing the action theory and the programs which need to be instantiated. Add 'htn' to the command line if you also use the htn-construct. Add 'formula' to the command line if you use formulas in your representation.

axioms Rules for reasoning about actions and their effects
axs-trans Trans-Rules for the ALGOL-like constructs
formula Rules for evaluating formula
htn Rules for HTN constructs
zero Example 1 A simple `if-then-else' program
one Example 2 Non-deterministic choice of actions
two Example 3 More on `if' and non-deterministic choice of actions
three Example 4 A simple `while' construct
four Example 5 More on `while'
actheory The action theory used in Example 1 - Example 5 (Result of translate on actheory.pl)

2. Encoding of the elevator example (AIPS-2000 planning competition) and some of its instances.

The command line:  

     a>   lparse -c length=?? -c p=?? -c n=?? <problem-file> elevator2 g_elevator2_control axioms axs-trans formula | smodels

     b>   lparse -c length=?? -c p=?? -c n=?? <problem-file> elevator2 g_elevator2_nocontrol axioms | smodels

where <problem-file> is the name of the file containing the initial state description. The constants length, p, and n are the (maximal) length of the plan, the number of passengers, and the number of floors, respectively. <a> is used for running the program with control knowledge. <b> is used for running the program without control knowledge.

 

elevator2.pl Action theory for the elevator domain (Translated from the file domain.pddl)
g_elevator2_control A simple program for control the elevator
g_elevator2_nocontrol Goal encoding for the elevator domain (no control knowledge)
s1-0.smo Problem 1 One person and two floors (s1-0)
s2-0.smo Problem 2 Two persons and four floors (s2-0)
s3-0.smo Problem 3 Three persons and six floors (s3-0)
s4-0.smo Problem 4 Four persons and eight floors (s4-0)
s5-0.smo Problem 5 Five persons and ten floors (s5-0)
result Sample output of SMODELS for the  AIPS-planning competition domain (elevator2).

sX-0.smo is generated from the translation of sX-0 + elevator2.pl using translate.pl.

3. Encoding of the elevator example in the original GOLOG paper and some of its instances.

The command line:  

     a>   lparse -c length=?? <problem-file> elp_ct axioms axs-trans formula | smodels

     b>   lparse -c length=?? <problem-file> goal_elp axioms | smodels

where <problem-file> is the name of the file containing the initial state description. The constants length is the (maximal) length of the plan. <a> is used for running the program with control knowledge. <b> is used for running the program without control knowledge.

 
elevator.pl Action theory for the elevator domain (From the GOLOG paper)
elp_ct Goal - with control knowledge
goal_elp Goal - without control knowledge
elp1.smo Problem 1: Two persons, six floors
elp2.smo Problem 2: Three persons, six floors
elp3.smo Problem 3: Four persons, six floors
elp4.smo Problem 4: Five persons, six floors
Result file Sample output of SMODELS for the  elevator domain

elpX.smo is generated from elevator.pl - with changes in the initial state - by using translate.pl.

4. Encoding of the block world domain. The action theory, the control knowledge, and the result are described in detail in this report. To reduce the size of the grounded programs (after lparse) instead of holds(fluentName(a1,...,an),T) we write holds(fluentName,a1,...,an,T) and do not use the translator to generate the encoding. Here are the smodels encoding of the action theory, the control knowledge, and the tar file containing all the instances.

5. The Prolog program translate.pl. The program is written in Sicstus Prolog. To translate an action theory  (D,I) into p, follow the steps:

1. Launch Sicstus prolog from the command line: sicstus

2. Compile the translator

| ?- [translate].

3. Issue gen. at the sicstus prompt to generate a domain written in B and then enter the domain description file name. Notice that the default extension of the input domain description file is .pl.

| ?- gen. 

 Enter domain description file name: <file-name>. (for example, elevator.)

4. Quit the Sicstus

| ?- halt.

The output file has the same name as the input file but the extension is .smo. For instance, the output logic program for the elevator.pl domain will be elevator.smo.

06/03/2004 14:02