diff --git a/README.md b/README.md index a4ecc79..687ca1e 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,17 @@ Secondly, it can be called from the command line. It supports different modes of ## Limitations -At the moment, Lifted PDDL only supports typed STRIPS and existential preconditions (`:requirements :typing :existential-preconditions`). In the future, it will be extended to support ADL and, maybe, other PDDL requirements. We also welcome contributions. The code is brief, simple to understand and has many comments, so I encourage you to implement any functionality you need and submit a pull request to the [Github](https://github.com/AI-Planning/lifted-pddl)! 😄 +At the moment, Lifted PDDL supports the following PDDL extensions: + +- Types (`:typing`). + +- Existential preconditions (`:existential-preconditions`), i.e., `(exists ...)` constructions in action preconditions. + +- Limited support for negative preconditions (`:negative-preconditions`), i.e., `(not ...)` constructions in action preconditions. However, + negative compound formulas are not supported, i.e., constructions like `(exists (not ...))` and `(not (and ...))`. At the moment, we only support + negated atoms in preconditions. + +In the future, Lifted PDDL will be extended to support ADL and, maybe, other PDDL requirements. We also welcome contributions. The code is brief, simple to understand and has many comments, so I encourage you to implement any functionality you need and submit a pull request to the [Github](https://github.com/AI-Planning/lifted-pddl)! 😄 ## Authors diff --git a/src/lifted_pddl/__pycache__/parser.cpython-38.pyc b/src/lifted_pddl/__pycache__/parser.cpython-38.pyc index 0edb019..53fee4e 100644 Binary files a/src/lifted_pddl/__pycache__/parser.cpython-38.pyc and b/src/lifted_pddl/__pycache__/parser.cpython-38.pyc differ diff --git a/src/lifted_pddl/data/sokoban_domain_no_clear.pddl b/src/lifted_pddl/data/sokoban-domain-no-clear.pddl similarity index 100% rename from src/lifted_pddl/data/sokoban_domain_no_clear.pddl rename to src/lifted_pddl/data/sokoban-domain-no-clear.pddl diff --git a/src/lifted_pddl/data/sokoban-problem.pddl b/src/lifted_pddl/data/sokoban-problem.pddl new file mode 100644 index 0000000..6cd3d8a --- /dev/null +++ b/src/lifted_pddl/data/sokoban-problem.pddl @@ -0,0 +1,51 @@ +;; 0 1 2 +;; 0 x +;; 1 x +;; 2 r x +;; 3 + +(define (problem sokoban-problem) + +(:domain typed-sokoban) + +(:objects + l0-0 l0-1 l0-2 l1-0 l1-1 l1-2 l2-0 l2-1 l2-2 l3-0 l3-1 l3-2 - loc +) + +(:init + (connected-up l3-0 l2-0) + (connected-up l2-0 l1-0) + (connected-up l1-0 l0-0) + + (connected-up l3-1 l2-1) + (connected-up l2-1 l1-1) + (connected-up l1-1 l0-1) + + (connected-up l3-2 l2-2) + (connected-up l2-2 l1-2) + (connected-up l1-2 l0-2) + + (connected-right l0-0 l0-1) + (connected-right l0-1 l0-2) + + (connected-right l1-0 l1-1) + (connected-right l1-1 l1-2) + + (connected-right l2-0 l2-1) + (connected-right l2-1 l2-2) + + (connected-right l3-0 l3-1) + (connected-right l3-1 l3-2) + + + (at-robot l2-0) + (at-box l2-1) + (at-box l0-0) + (at-box l1-0) +) + +(:goal (and + (not (at-robot l2-0)) + (at-robot l1-0) +)) +) \ No newline at end of file diff --git a/src/lifted_pddl/parser.py b/src/lifted_pddl/parser.py index 0e7ba8c..02d529d 100644 --- a/src/lifted_pddl/parser.py +++ b/src/lifted_pddl/parser.py @@ -427,12 +427,12 @@ def _get_applicable_var_assigns_action(self, action, _var_assigns): if ground_precond not in atoms: new_var_assigns.append(var_assign) - full_var_assigns = new_var_assings + full_var_assigns = new_var_assigns # If there are no var_assigns left, we know that no variable substitution # satisfies all the preconditions if len(full_var_assigns) == 0: - return list() + return tuple() #