Lab Assignment #2

The Blocks World Maze

Temporal ASP

Introduction

This assignment consists in modelling the classical Blocks World problem. The domain deals with n of cubical blocks {1,...,n} of the same size. A block can be on the table (which has always room for all blocks) or on top of another (unique) block, so we can form towers of arbitrary height. We say that a block is free if it does not have anything on top. The only applicable action is moving a block from one position to another, taking into account that the moved block must be free and that the target position must be the table or another free block.

initial
                        state
final
                        state
Figure 1. Possible initial configuration
Figure 2. Possible final configuration

What to do

Each scenario will be encoded as an ASCII file where, for simplicity, we represent the table vertically, in the left margin. The first line of each input file will contain the number n of blocks. Then, it will be followed by several lines corresponding to the towers of the initial state, an empty line, and the towers of the final state. As an example, Figures 1 and 2 would correspond to the file:

6
6 4 3
2
1 5

1 2 3 4
5 6

The file examples-block.zip contains 6 different blocks world domains. The file solutionlength.txt contains the minimum number of steps for solving each scenario.

Program checker.zip can be used to check a solution file where each line contains an action represented as m(B,C) meaning "move block B to C" and the table is represented as 0. For instance, given domain dom01.txt and a file solution01.txt containing:

m(4,0)
m(1,4)
m(2,1)

we can call checker dom01.txt solution01.txt to check that the solution is correct, showing all intermediate steps. If we additionally use checker dom01.txt solution01.txt -q will omit the intermediate states.

We will write a temporal ASP encoding in telingo that solves the problem showing the sequence of actions to perform. The representation of the action is open, so anybody can choose a different one, provided that some explanation is included in a README.txt file.

Assessment & delivery

The maximum grade for this exercise is 0,65 points = 6.5% of the course. The deadline for delivery is Friday, April 17th 2020 using the MOODLE assignment. Exercises can be made by groups of 2 students at most. If so, only one student is required to deliver the files in moodle, but all source files must contain the names of the two group members.

Delivery: upload all files in a .zip including a README.txt on how to use any auxiliary program(s) you included and the encoding of the actions. Regardless of the programming language you choose, avoid using non-standard libraries.




Maintained by Pedro Cabalar. Last update 10/3/2020