ssardina-research / app-trapper

Software for IJCAI17 paper on solving APP with dead-end reasoning
0 stars 0 forks source link

PP-TRAPPER: Agent Planning Programs via Trap Reasoning

This is the PP-LPG solver for APP adapted to include dead-end (i.e., traps) reasoning:

Pre-requisites

Before running the solvers, make sure that:

  1. The following binary tools are available in tools/:
    • validate binary, from the VAL project.
    • trapper binary form the trapper-lapkt repo, presented at ICAPS16 paper Traps, Invariants, and Dead-Ends.
    • lpg preference-based planner binary. This is a modified version of the original LPG planner that leaves the final state of the solution plan in file endstate.txt and the solution plan is always written a file called soln (instead of using the domain name and .SOL extension).
  2. In any problem to solve, there must be a dummy empty file called emptyplan.tmp (its used is hard-coded in the solver).
    • Just create one doing: touch emptyplan.tmp.

      Online solver

To compile the online solver, get into src/, update the paths in def.h if needed, and then run:

$ cd src/
$ make online

This will build the pp-online online solver and the various pp-<solver> offline solvers.

To run the online solvers, get into the problem folder and run:

$ /path/to/src/pp-online <obj_file> <init_file> <predicate_file> <action_file> <graph_file> <seed> <planner_type>

where <planner_type> could be one of the following:

When using trap reasoning, the tool used to extract dead-ends/traps is trapper, available in the trapper-lapkt repo.

Running trapper as follows:

$ tools/trapper --domain domain.pddl --problem pfile-trap.pddl --search dfs+_trap --candidates a2 --goals 1 --plan soln.tmp

For example, this will run the online solver using on the complex example using the LPG planner with no traps (which will fail) and the DFS+ planner with trap reasoning (which will succeed):

$ cd examples/complex

$ ../../src/pp-online obj.pddl init.pddl predicates.pddl acts.pddl graph.txt 123 lpg

$ ../../src/pp-online obj.pddl init.pddl predicates.pddl acts.pddl graph.txt 123 dsf_trap

Offline solvers

To compile the offline solver, get into src/, update the paths in def.h if needed, and then run:

$ cd src/
$ make offline

This will build the varios pp-<solver> offline solvers:

NOTE: when a local planning step is performed to "close" the policy, LPG is used, as it is a preference-based planner. However, LPG is not integrated with trapper, so those planning episodes do not use any dead-end reasoning. So, in all the above cases, LPG is used in some transitions.

To run the offline solvers, get into the problem folder and run:

$ cd /path/to/problem
$ /path/to/src/pp-<planner_type> <obj_file> <init_file> <predicate_file> <action_file> <graph_file> <seed>

For example, to run the LPG offline solver (as per AIJ16) on the complex example:

$ cd examples/complex
$ ../../src/pp-lpg obj.pddl init.pddl predicates.pddl acts.pddl graph.txt 123