Codes for Readers of TPLP 2010 paper
- All codes are currently in SICStus Prolog 4 (but they run in
SICStus 3, as well).
You can download the interpreter for free (for one month)
from here.
The codes can be ported in other clp(fd) Prolog systems with few work.
We are happy to do this for you if you ask us by email.
- All the files are saved in .txt format
to avoid a bad interpretation of Prolog files as Pearl
files by some web browsers.
They can be downloaded as a unique zip file
here.
- This
SICStus Prolog code transforms a B-action description
into an ASP code.
Consult/compile it.
Then launch the goal :- main( FILENAME , PLAN LENGTH ).
It saves a file trdfp_FILENAME that can be executed by ASP
solvers (eg lparse trdfp_FILENAME | smodels 1)
No need to suggest of checking the working directories.
- SICStus Prolog clp(FD)
Interpreter of the B language.
Consult/compile it (if compiled it will run faster).
You can add a line :-[FileName]. at the beginning of the file
to compile it together with the action description you wish to run.
In case no static causal laws are used in FileName,
uncomment the
line :- dynamic(caused/2). at the beginning of the
file. Here there are some
examples of action descriptions. Problems (5)-(8) have
been coded by students of the course
Linguaggi di Nuova Concezione
at the University of Udine.
- The three barrels, parametric on
barrel sizes
- A 3 x 3 puzzle
- A Blocks world Problem
- The Goat, Cabbage, and Wolf problem.
- The Peg Solitaire problem.
- The Langford Numbers problem.
- The Traffic Jam problem
(trolleys in a mine)
- A game of Light Switching
- Interpreter of the B-MV-FD language.
Same comments as the previous point. There are more comments at the beginning
of the file to comment/uncomment in case you do not need some features.
Here there are some examples:
- The three barrels
- A 3 x 3 puzzle
- The Protein Folding Problem
- A better world
- The gas diffusion problem
- A test using Fibonacci numbers
- The Knight tour problem
- A problem of Cars and Fuel
- To use the B and BMV interpreters, after you consulted/compiled
them together with the desired action theory, call the goal
:- sicsplan(N), where N is the length of the
plan.
Have fun with our programs and examples.
Agostino Dovier, Andrea Formisano, and Enrico Pontelli.