
First, please note that,

THIS SOURCE CODE IS SUPPLIED "AS IS" WITHOUT WARRANTY OF ANY KIND, AND
ITS AUTHOR AND THE JOURNAL OF ARTIFICIAL INTELLIGENCE RESEARCH (JAIR)
AND JAIR'S PUBLISHERS AND DISTRIBUTORS DISCLAIM ANY AND ALL WARRANTIES,
INCLUDING BUT NOT LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE, AND ANY WARRANTIES OF NON
INFRINGEMENT. THE USER ASSUMES ALL LIABILITY AND RESPONSIBILITY FOR
USE OF THIS SOURCE CODE, AND NEITHER THE AUTHOR, NOR JAIR, NOR JAIR'S
PUBLISHERS AND DISTRIBUTORS WILL BE LIABLE FOR DAMAGES OF ANY KIND
RESULTING FROM ITS USE. Without limiting the generality of the
foregoing, neither the author, nor JAIR, nor JAIR's publishers and
distributors, warrant that the Source Code will be error-free, will
operate without interruption, or will meet the needs of the user.


Contents
========

This archive contains examples of narrative planning problems, and the
source code of the compiler used to transform them into classical
planning problems.

ry-story.npddl: Domain file for the example from Riedl & Young's article
 (appendix A.1), transcribed in "narrative PDDL" (PDDL with some extensions;
 this is the input format for the compiler).

ry-story-1.pddl: Problem file for Riedl & Young's example (standard PDDL).

ex-story.npddl, ex-story-1.pddl: Domain and problem files for the extended
 example.

npc-jt.lsp, npc-jt-2.cc: Source code for the first (justification-tracking)
 compilation.

ry-story-jtc.pddl, ry-story-1-jtc.pddl: JT-compiler's output for R&Y's
 example problem (domain and problem file).

ex-story-jtc.pddl, ex-story-1-jtc.pddl: JT-compiler's output for extended
 example problem (domain and problem file).

npc-mp.lsp: Source code for the second (meta-planning) compilation.

ry-story-mpc.pddl, ry-story-1-mpc.pddl: MP-compiler's output for R&Y's
 example problem (domain and problem file).

ex-story-mpc.pddl, ex-story-1-mpc.pddl: MP-compiler's output for extended
 example problem (domain and problem file).


Compiling and Running
=====================

The JT compiler consists of two parts: npc-jt (written in common LISP)
produces the compiled domain file, and npc-jt-2 (written in C++) produces
the compiled problem file. The MP compiler is just one program: npc-mp
(also in common LISP).

Both the LISP-based programs depend on bits of the source code of INVAL.
To compile npc-jt-2, you will also need the source code for the HSP*
planner. Ask me if you can't find them.

The input and output file names are hardcoded in npc-jt.lsp and npc-mp.lsp,
respectively. They also need some additional domain information: a list
of "intendable predicates" (predicates that characters can have as
intentions), a list of "delegatable predicates" (used to instantiate fact
parameters of actions, like ?goal in (order ?king ?knight ?goal)), and a
"dependency graph" (dg). The dependecy graph is an assoc list of predicates
to lists of predicates: the meaning of an entry (p q r ...) is that facts
involving predicates (q r ...) may be relevant as preconditions of actions
that achieve facts involving p. Note that some predicates are relevant to
themselves (e.g., "has"). This dependency information could probably be
extracted automatically, but I did not implement that.

npc-jt-2 takes as arguments the compiled domain file and the original
problem file; it computes relaxed reachable actions, and from those the
set of relevant "justified"-atoms, and prints out the compiled problem
file.


Bugs, Questions and Comments
============================

I'm sure there are bugs. If you have questions or comments, please email.

Best,
	/P@trik
