From 8c4c7245272b74194b341f803151171ba0790b01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Math=C3=AFs=20F=C3=A9d=C3=A9rico?= Date: Mon, 13 Mar 2023 05:10:19 +0100 Subject: [PATCH 01/65] =?UTF-8?q?=E2=9C=85=20Add=20simple=20hello-world=20?= =?UTF-8?q?domain=20&=20problem=20for=20numerical-fluents?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pddl/core.py | 9 + pddl/logic/base.py | 16 ++ pddl/logic/functions.py | 181 ++++++++++++++++++ pddl/parser/common.lark | 10 + pddl/parser/domain.lark | 36 +++- pddl/parser/domain.py | 20 +- pddl/parser/problem.lark | 17 ++ pddl/parser/problem.py | 17 ++ pddl/parser/symbols.py | 8 + tests/conftest.py | 1 + .../hello-world-functions/domain.pddl | 15 ++ .../pddl_files/hello-world-functions/p0.pddl | 12 ++ tests/test_functions.py | 37 ++++ 13 files changed, 372 insertions(+), 7 deletions(-) create mode 100644 pddl/logic/functions.py create mode 100644 tests/fixtures/pddl_files/hello-world-functions/domain.pddl create mode 100644 tests/fixtures/pddl_files/hello-world-functions/p0.pddl create mode 100644 tests/test_functions.py diff --git a/pddl/core.py b/pddl/core.py index ffc17450..71df35cf 100644 --- a/pddl/core.py +++ b/pddl/core.py @@ -31,6 +31,7 @@ ) from pddl.logic.base import Formula, TrueFormula, is_literal from pddl.logic.predicates import DerivedPredicate, Predicate +from pddl.logic.functions import Function from pddl.logic.terms import Constant, Variable from pddl.parser.symbols import RequirementSymbols as RS @@ -48,6 +49,7 @@ def __init__( derived_predicates: Optional[ Collection[DerivedPredicate] ] = None, # TODO cannot be empty + functions: Optional[Collection[Function]] = None, actions: Optional[Collection["Action"]] = None, ): """ @@ -68,6 +70,7 @@ def __init__( self._predicates = ensure_set(predicates) self._derived_predicates = ensure_set(derived_predicates) self._actions = ensure_set(actions) + self._functions = ensure_set(functions) @property def name(self) -> str: @@ -89,6 +92,11 @@ def predicates(self) -> AbstractSet[Predicate]: """Get the predicates.""" return self._predicates + @property + def functions(self) -> AbstractSet[Function]: + """Get the functions.""" + self._functions + @property def derived_predicates(self) -> AbstractSet[DerivedPredicate]: """Get the derived predicates.""" @@ -316,6 +324,7 @@ class Requirements(Enum): ADL = RS.ADL.strip() DERIVED_PREDICATES = RS.DERIVED_PREDICATES.strip() NON_DETERMINISTIC = RS.NON_DETERMINISTIC.strip() + FLUENTS = RS.FLUENTS.strip() @classmethod def strips_requirements(cls) -> Set["Requirements"]: diff --git a/pddl/logic/base.py b/pddl/logic/base.py index 37d56699..ea0fd6b3 100644 --- a/pddl/logic/base.py +++ b/pddl/logic/base.py @@ -42,6 +42,22 @@ def __rshift__(self, other: "Formula") -> "Formula": return Or(Not(self), other) +@cache_hash +class Number: + """Base class for all the numbers.""" + + def __init__(self, value: float) -> None: + self._value = value + + def __hash__(self) -> int: + """Compute the hash of the object.""" + return hash(self._value) + + def __str__(self) -> str: + """Get the string representation.""" + return str(self._value) + + class BinaryOp(Formula): """Binary operator.""" diff --git a/pddl/logic/functions.py b/pddl/logic/functions.py new file mode 100644 index 00000000..10c6b56a --- /dev/null +++ b/pddl/logic/functions.py @@ -0,0 +1,181 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2021-2022 WhiteMech +# +# ------------------------------ +# +# This file is part of pddl. +# +# Use of this source code is governed by an MIT-style +# license that can be found in the LICENSE file or at +# https://opensource.org/licenses/MIT. +# + +"""This class implements PDDL functions.""" +import functools +from typing import Sequence + +from pddl.custom_types import name as name_type +from pddl.custom_types import namelike +from pddl.helpers.base import assert_ +from pddl.helpers.cache_hash import cache_hash +from pddl.logic.base import Atomic, Number +from pddl.logic.terms import Term +from pddl.parser.symbols import Symbols + + +@cache_hash +@functools.total_ordering +class Function(Atomic): + """A class for a Function in PDDL.""" + + def __init__(self, name: namelike, *terms: Term): + """Initialize the function.""" + self._name = name_type(name) + self._terms = tuple(terms) + + @property + def name(self) -> str: + """Get the name.""" + return self._name + + @property + def terms(self) -> Sequence[Term]: + """Get the terms.""" + return self._terms + + @property + def arity(self) -> int: + """Get the arity of the function.""" + return len(self.terms) + + # TODO check whether it's a good idea... + # TODO allow also for keyword-based replacement + # TODO allow skip replacement with None arguments. + def __call__(self, *terms: Term): + """Replace terms.""" + assert_(len(terms) == self.arity, "Number of terms not correct.") + assert_( + all(t1.type_tags == t2.type_tags for t1, t2 in zip(self.terms, terms)), + "Types of replacements is not correct.", + ) + return Function(self.name, *terms) + + def __str__(self) -> str: + """Get the string.""" + if self.arity == 0: + return f"({self.name})" + else: + return f"({self.name} {' '.join(map(str, self.terms))})" + + def __repr__(self) -> str: + """Get an unambiguous string representation.""" + return f"{type(self).__name__}({self.name}, {', '.join(map(str, self.terms))})" + + def __eq__(self, other): + """Override equal operator.""" + return ( + isinstance(other, Function) + and self.name == other.name + and self.terms == other.terms + ) + + def __hash__(self): + """Get the has of a Function.""" + return hash((self.name, self.arity, self.terms)) + + def __lt__(self, other): + """Compare with another object.""" + if isinstance(other, Function): + return (self.name, self.terms) < (other.name, other.terms) + return super().__lt__(other) + + +class FunctionOperator(Atomic): + """Assign value to numerical fluent.""" + + def __init__(self, function: Function, value: Number, symbol: Symbols): + """ + Initialize the equality predicate. + + :param func: the function to assign to. + :param right: the right term. + """ + self._function = function + self._value = value + self._symbol = symbol + + @property + def function(self) -> Term: + """Get the numerical fluent.""" + return self._function + + @property + def symbol(self) -> Term: + """Get the operation symbol.""" + return self._symbol + + @property + def value(self) -> Term: + """Get the value of the operation.""" + return self._value + + def __eq__(self, other) -> bool: + """Compare with another object.""" + return ( + isinstance(other, self.__class__) + and self.function == other.function + and self.value == other.value + ) + + def __hash__(self) -> int: + """Get the hash.""" + return hash((self, self.function, self.value)) + + def __str__(self) -> str: + """Get the string representation.""" + return f"({self.symbol} {self.function} {self.value})" + + def __repr__(self) -> str: + """Get the string representation.""" + return f"{type(self).__name__}({self.function}, {self.value})" + + +class EqualTo(FunctionOperator): + def __init__(self, function: Function, value: Number): + super().__init__(function, value, Symbols.EQUAL) + + +class LesserThan(FunctionOperator): + def __init__(self, function: Function, value: Number): + super().__init__(function, value, Symbols.LESSER) + + +class LesserEqualThan(FunctionOperator): + def __init__(self, function: Function, value: Number): + super().__init__(function, value, Symbols.LESSER_EQUAL) + + +class GreaterThan(FunctionOperator): + def __init__(self, function: Function, value: Number): + super().__init__(function, value, Symbols.GREATER) + + +class GreaterEqualThan(FunctionOperator): + def __init__(self, function: Function, value: Number): + super().__init__(function, value, Symbols.GREATER_EQUAL) + + +class AssignTo(FunctionOperator): + def __init__(self, function: Function, value: Number): + super().__init__(function, value, Symbols.ASSIGN) + + +class Increase(FunctionOperator): + def __init__(self, function: Function, value: Number): + super().__init__(function, value, Symbols.INCREASE) + + +class Decrease(FunctionOperator): + def __init__(self, function: Function, value: Number): + super().__init__(function, value, Symbols.DECREASE) diff --git a/pddl/parser/common.lark b/pddl/parser/common.lark index 58bb5fb1..beb1ddfb 100644 --- a/pddl/parser/common.lark +++ b/pddl/parser/common.lark @@ -12,6 +12,7 @@ NAME: /[a-zA-Z][a-zA-Z0-9-_]*/ | ADL | DERIVED_PREDICATES | CONDITIONAL_EFFECTS + | FLUENTS COMMENT: /;[^\n]*/ @@ -21,6 +22,7 @@ REQUIREMENTS: ":requirements" TYPES: ":types" CONSTANTS: ":constants" PREDICATES: ":predicates" +FUNCTIONS: ":functions" ACTION: ":action" PARAMETERS: ":parameters" PRECONDITION: ":precondition" @@ -37,6 +39,13 @@ IMPLY: "imply" EITHER: "either" ONEOF: "oneof" EQUAL_OP: "=" +GREATER_EQUAL_OP: ">=" +GREATER_OP: ">" +LESSER_EQUAL_OP: "<=" +LESSER_OP: "<" +INCREASE: "increase" +DECREASE: "decrease" +NUMBER: /[0-9]+/ // available requirements STRIPS: ":strips" @@ -51,6 +60,7 @@ CONDITIONAL_EFFECTS: ":conditional-effects" EXISTENTIAL_PRECONDITIONS: ":existential-preconditions" UNIVERSAL_PRECONDITIONS: ":universal-preconditions" QUANTIFIED_PRECONDITIONS: ":quantified-preconditions" +FLUENTS: ":fluents" // others LPAR : "(" diff --git a/pddl/parser/domain.lark b/pddl/parser/domain.lark index 4056db64..8bb9395f 100644 --- a/pddl/parser/domain.lark +++ b/pddl/parser/domain.lark @@ -1,26 +1,28 @@ start: domain -domain: LPAR DEFINE domain_def [requirements] [types] [constants] [predicates] structure_def* RPAR +domain: LPAR DEFINE domain_def [requirements] [types] [constants] [predicates] [functions] structure_def* RPAR domain_def: LPAR DOMAIN NAME RPAR requirements: LPAR REQUIREMENTS require_key+ RPAR types: LPAR TYPES typed_list_name RPAR constants: LPAR CONSTANTS typed_list_name RPAR -predicates: LPAR PREDICATES atomic_formula_skeleton+ RPAR -atomic_formula_skeleton: LPAR NAME typed_list_variable RPAR - +predicates: LPAR PREDICATES atomic_predicate_skeleton+ RPAR +functions: LPAR FUNCTIONS atomic_function_skeleton+ RPAR +atomic_predicate_skeleton: LPAR NAME typed_list_variable RPAR +atomic_function_skeleton: LPAR NAME typed_list_variable RPAR ?structure_def: action_def | derived_predicates action_def: LPAR ACTION NAME PARAMETERS action_parameters action_body_def RPAR action_parameters: LPAR typed_list_variable RPAR ?action_body_def: [PRECONDITION emptyor_pregd] [EFFECT emptyor_effect] -derived_predicates: LPAR DERIVED atomic_formula_skeleton gd RPAR +derived_predicates: LPAR DERIVED atomic_predicate_skeleton gd RPAR // preconditions emptyor_pregd: LPAR RPAR | gd gd: atomic_formula_term + | atomic_numeric_formula | LPAR OR gd* RPAR | LPAR NOT gd RPAR | LPAR AND gd* RPAR @@ -28,19 +30,24 @@ gd: atomic_formula_term | LPAR EXISTS LPAR typed_list_variable RPAR gd RPAR | LPAR FORALL LPAR typed_list_variable RPAR gd RPAR + // effects emptyor_effect: LPAR RPAR | effect effect: LPAR AND c_effect* RPAR | c_effect + c_effect: LPAR FORALL LPAR typed_list_variable RPAR effect RPAR | LPAR WHEN gd cond_effect RPAR | LPAR ONEOF effect+ RPAR | p_effect p_effect: LPAR NOT atomic_formula_term RPAR | atomic_formula_term + | num_effect cond_effect: LPAR AND p_effect* RPAR | p_effect +num_effect: LPAR INCREASE numeric_variable numeric_value RPAR + | LPAR DECREASE numeric_variable numeric_value RPAR atomic_formula_term: LPAR predicate term* RPAR | LPAR EQUAL_OP term term RPAR @@ -48,11 +55,22 @@ atomic_formula_term: LPAR predicate term* RPAR | variable ?predicate: NAME constant: NAME +function: NAME typed_list_variable: variable* | variable+ TYPE_SEP type_def (typed_list_variable) ?variable: "?" NAME +atomic_numeric_formula: LPAR EQUAL_OP numeric_variable numeric_value RPAR + | LPAR GREATER_OP numeric_variable numeric_value RPAR + | LPAR GREATER_EQUAL_OP numeric_variable numeric_value RPAR + | LPAR LESSER_OP numeric_variable numeric_value RPAR + | LPAR LESSER_EQUAL_OP numeric_variable numeric_value RPAR + +numeric_variable: LPAR function term* RPAR + +numeric_value: NUMBER | numeric_variable + typed_list_name: NAME* | NAME+ TYPE_SEP type_def (typed_list_name) type_def: LPAR EITHER primitive_type+ RPAR @@ -72,6 +90,7 @@ type_def: LPAR EITHER primitive_type+ RPAR %import .common.TYPES -> TYPES %import .common.CONSTANTS -> CONSTANTS %import .common.PREDICATES -> PREDICATES +%import .common.FUNCTIONS -> FUNCTIONS %import .common.ACTION -> ACTION %import .common.PARAMETERS -> PARAMETERS %import .common.PRECONDITION -> PRECONDITION @@ -88,6 +107,13 @@ type_def: LPAR EITHER primitive_type+ RPAR %import .common.EITHER -> EITHER %import .common.ONEOF -> ONEOF %import .common.EQUAL_OP -> EQUAL_OP +%import .common.GREATER_OP -> GREATER_OP +%import .common.GREATER_EQUAL_OP -> GREATER_EQUAL_OP +%import .common.LESSER_OP -> LESSER_OP +%import .common.LESSER_EQUAL_OP -> LESSER_EQUAL_OP +%import .common.NUMBER -> NUMBER +%import .common.INCREASE -> INCREASE +%import .common.DECREASE -> DECREASE %import .common.LPAR -> LPAR %import .common.RPAR -> RPAR %import .common.TYPE_SEP -> TYPE_SEP diff --git a/pddl/parser/domain.py b/pddl/parser/domain.py index 8c7e6dc5..5ad22d76 100644 --- a/pddl/parser/domain.py +++ b/pddl/parser/domain.py @@ -31,6 +31,7 @@ ) from pddl.logic.effects import AndEffect, Forall, When from pddl.logic.predicates import DerivedPredicate, EqualTo, Predicate +from pddl.logic.functions import Function from pddl.logic.terms import Constant, Variable from pddl.parser import DOMAIN_GRAMMAR_FILE, PARSERS_DIRECTORY from pddl.parser.symbols import Symbols @@ -102,6 +103,12 @@ def predicates(self, args): self._predicates_by_name = {p.name: p for p in predicates} return dict(predicates=predicates) + def functions(self, args): + """Process the 'predicates' rule.""" + functions = args[2:-1] + self._functions_by_name = {f.name: f for f in functions} + return dict(functions=functions) + def action_def(self, args): """Process the 'action_def' rule.""" name = args[2] @@ -281,13 +288,22 @@ def constant(self, args): raise ParseError(f"Constant '{args[0]}' not defined.") return constant - def atomic_formula_skeleton(self, args): - """Process the 'atomic_formula_skeleton' rule.""" + def _formula_skeleton(self, args): name = args[1] variable_data: Dict[str, Set[str]] = args[2] variables = [Variable(name, tags) for name, tags in variable_data.items()] + return name, variables + + def atomic_predicate_skeleton(self, args): + """Process the 'atomic_formula_skeleton' rule.""" + name, variables = self._formula_skeleton(args) return Predicate(name, *variables) + def atomic_function_skeleton(self, args): + """Process the 'atomic_function_skeleton' rule.""" + name, variables = self._formula_skeleton(args) + return Function(name, *variables) + def typed_list_name(self, args): """ Process the 'typed_list_name' rule. diff --git a/pddl/parser/problem.lark b/pddl/parser/problem.lark index 9040fb77..65401888 100644 --- a/pddl/parser/problem.lark +++ b/pddl/parser/problem.lark @@ -9,15 +9,26 @@ objects: LPAR OBJECTS typed_list_name RPAR init: LPAR INIT init_el* RPAR ?init_el: literal_name literal_name: atomic_formula_name + | atomic_function_init | LPAR NOT atomic_formula_name RPAR atomic_formula_name: LPAR predicate NAME* RPAR | LPAR EQUAL_OP NAME NAME RPAR +atomic_function_init: LPAR EQUAL_OP numeric_variable NUMBER RPAR + + goal: LPAR GOAL gd_name RPAR gd_name: atomic_formula_name | LPAR NOT atomic_formula_name RPAR | LPAR AND gd_name* RPAR + | atomic_function_goal + +atomic_function_goal: atomic_function_init + | LPAR GREATER_OP numeric_variable NUMBER RPAR + | LPAR GREATER_EQUAL_OP numeric_variable NUMBER RPAR + | LPAR LESSER_OP numeric_variable NUMBER RPAR + | LPAR LESSER_EQUAL_OP numeric_variable NUMBER RPAR DOMAIN_P: ":domain" PROBLEM: "problem" @@ -32,6 +43,7 @@ GOAL: ":goal" %import .domain.requirements -> requirements %import .domain.typed_list_name -> typed_list_name %import .domain.predicate -> predicate +%import .domain.numeric_variable -> numeric_variable %import .common.NAME -> NAME %import .common.DEFINE -> DEFINE %import .common.DOMAIN -> DOMAIN @@ -49,6 +61,10 @@ GOAL: ":goal" %import .common.EITHER -> EITHER %import .common.ONEOF -> ONEOF %import .common.EQUAL_OP -> EQUAL_OP +%import .common.GREATER_OP -> GREATER_OP +%import .common.GREATER_EQUAL_OP -> GREATER_EQUAL_OP +%import .common.LESSER_OP -> LESSER_OP +%import .common.LESSER_EQUAL_OP -> LESSER_EQUAL_OP %import .common.TYPING -> TYPING %import .common.EQUALITY -> EQUALITY %import .common.STRIPS -> STRIPS @@ -56,3 +72,4 @@ GOAL: ":goal" %import .common.LPAR -> LPAR %import .common.RPAR -> RPAR %import .common.TYPE_SEP -> TYPE_SEP +%import .common.NUMBER -> NUMBER diff --git a/pddl/parser/problem.py b/pddl/parser/problem.py index 1f7d4c6e..10558a42 100644 --- a/pddl/parser/problem.py +++ b/pddl/parser/problem.py @@ -19,6 +19,7 @@ from pddl.core import Problem, Requirements from pddl.logic.base import And, Not from pddl.logic.predicates import EqualTo, Predicate +from pddl.logic.functions import Function from pddl.logic.terms import Constant from pddl.parser import PARSERS_DIRECTORY, PROBLEM_GRAMMAR_FILE from pddl.parser.domain import DomainTransformer @@ -124,6 +125,22 @@ def atomic_formula_name(self, args): ] return Predicate(name, *terms) + def atomic_function_init(self, args): + """Process the 'atomic_function_init' rule.""" + if args[1] == Symbols.EQUAL.value: + obj1 = self._objects_by_name.get(args[1]) + obj2 = self._objects_by_name.get(args[2]) + return EqualTo(obj1, obj2) + else: + name = args[1] + terms = [ + Constant(str(_term_name)) + if self._objects_by_name.get(str(_term_name)) is None + else self._objects_by_name.get(str(_term_name)) + for _term_name in args[2:-1] + ] + return Function(name, *terms) + _problem_parser_lark = PROBLEM_GRAMMAR_FILE.read_text() diff --git a/pddl/parser/symbols.py b/pddl/parser/symbols.py index 2d860228..5ece585f 100644 --- a/pddl/parser/symbols.py +++ b/pddl/parser/symbols.py @@ -50,6 +50,13 @@ class Symbols(Enum): ROUND_BRACKET_RIGHT = ")" TYPE_SEP = "-" EQUAL = "=" + GREATER_EQUAL = ">=" + GREATER = ">" + LESSER_EQUAL = "<=" + LESSER = "<" + ASSIGN = "assign" + INCREASE = "increase" + DECREASE = "decrease" ALL_SYMBOLS = {v.value for v in Symbols} # type: Set[str] @@ -70,6 +77,7 @@ class RequirementSymbols(Enum): ADL = ":adl" DERIVED_PREDICATES = ":derived-predicates" NON_DETERMINISTIC = ":non-deterministic" + FLUENTS = ":fluents" def strip(self) -> str: """Strip the leading colon.""" diff --git a/tests/conftest.py b/tests/conftest.py index b2e0d84a..35363a25 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -58,6 +58,7 @@ "tireworld-truck", "triangle-tireworld", "zenotravel", + "hello-world-functions", ] DOMAIN_FILES = [ diff --git a/tests/fixtures/pddl_files/hello-world-functions/domain.pddl b/tests/fixtures/pddl_files/hello-world-functions/domain.pddl new file mode 100644 index 00000000..e37ab064 --- /dev/null +++ b/tests/fixtures/pddl_files/hello-world-functions/domain.pddl @@ -0,0 +1,15 @@ +;Hello world domain to test numerical fluents (functions) +(define (domain hello-world-functions) + + (:requirements :strips :fluents) + + (:functions + (hello_counter) + ) + + (:action say-hello-world + :parameters () + :precondition (and (<= (hello_counter) 3)) + :effect (and (increase (hello_counter) 1)) + ) +) \ No newline at end of file diff --git a/tests/fixtures/pddl_files/hello-world-functions/p0.pddl b/tests/fixtures/pddl_files/hello-world-functions/p0.pddl new file mode 100644 index 00000000..7f696327 --- /dev/null +++ b/tests/fixtures/pddl_files/hello-world-functions/p0.pddl @@ -0,0 +1,12 @@ +(define (problem hello-3-times) + (:domain hello-world-functions) + + (:init + ; if this was undefined, some planners would not assumed `0` + (= (hello_counter) 0) + ) + + (:goal + (>= (hello_counter) 3) + ) +) \ No newline at end of file diff --git a/tests/test_functions.py b/tests/test_functions.py new file mode 100644 index 00000000..1aa29848 --- /dev/null +++ b/tests/test_functions.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2021-2022 WhiteMech +# +# ------------------------------ +# +# This file is part of pddl. +# +# Use of this source code is governed by an MIT-style +# license that can be found in the LICENSE file or at +# https://opensource.org/licenses/MIT. +# + +"""This module contains tests for PDDL functions.""" +from pddl.core import Function +from pddl.logic.helpers import variables + + +class TestFunctionsimpleInitialisation: + """Test simple function initialisation.""" + + def setup(self): + """Set up the tests.""" + self.a, self.b = variables("a b") + self.function = Function("P", self.a, self.b) + + def test_name(self): + """Test name getter.""" + assert self.function.name == "P" + + def test_variables(self): + """Test terms getter.""" + assert self.function.terms == (self.a, self.b) + + def test_arity(self): + """Test arity property.""" + assert self.function.arity == 2 From 044f38aac123dc2c8a0f271f6c52c26046270e1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Math=C3=AFs=20F=C3=A9d=C3=A9rico?= Date: Mon, 13 Mar 2023 05:11:23 +0100 Subject: [PATCH 02/65] =?UTF-8?q?=F0=9F=93=9D=20Add=20requirements=20files?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- requirements-dev.txt | 5 +++++ requirements.txt | 2 ++ 2 files changed, 7 insertions(+) create mode 100644 requirements-dev.txt create mode 100644 requirements.txt diff --git a/requirements-dev.txt b/requirements-dev.txt new file mode 100644 index 00000000..00794aed --- /dev/null +++ b/requirements-dev.txt @@ -0,0 +1,5 @@ +pytest>=7.2.0,<7.3.0 +pytest-cov>=4.0.0,<4.1.0 +pytest-randomly>=3.12.0,<3.13.0 +pytest-lazy-fixture>=0.6.3 ,<0.7.0 +mistune==2.0.0a4 \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 00000000..78fab284 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +lark-parser>=0.9.0,<1 +click>=8,<9 \ No newline at end of file From b9760805e23fa679d21307ec4c0024deef7aa9b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Math=C3=AFs=20F=C3=A9d=C3=A9rico?= Date: Mon, 13 Mar 2023 05:16:22 +0100 Subject: [PATCH 03/65] =?UTF-8?q?=F0=9F=93=9D=20Add=20docstring=20to=20fun?= =?UTF-8?q?ction=20operators?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pddl/logic/functions.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/pddl/logic/functions.py b/pddl/logic/functions.py index 10c6b56a..eddc237d 100644 --- a/pddl/logic/functions.py +++ b/pddl/logic/functions.py @@ -92,7 +92,7 @@ def __lt__(self, other): class FunctionOperator(Atomic): - """Assign value to numerical fluent.""" + """Operator for to numerical fluent.""" def __init__(self, function: Function, value: Number, symbol: Symbols): """ @@ -142,40 +142,56 @@ def __repr__(self) -> str: class EqualTo(FunctionOperator): + """Check if numerical fluent is equal to value.""" + def __init__(self, function: Function, value: Number): super().__init__(function, value, Symbols.EQUAL) class LesserThan(FunctionOperator): + """Check if numerical fluent is lesser than value.""" + def __init__(self, function: Function, value: Number): super().__init__(function, value, Symbols.LESSER) class LesserEqualThan(FunctionOperator): + """Check if numerical fluent is lesser or equal than value.""" + def __init__(self, function: Function, value: Number): super().__init__(function, value, Symbols.LESSER_EQUAL) class GreaterThan(FunctionOperator): + """Check if numerical fluent is greater than value.""" + def __init__(self, function: Function, value: Number): super().__init__(function, value, Symbols.GREATER) class GreaterEqualThan(FunctionOperator): + """Check if numerical fluent is greater or equal than value.""" + def __init__(self, function: Function, value: Number): super().__init__(function, value, Symbols.GREATER_EQUAL) class AssignTo(FunctionOperator): + """Assign value to numerical fluent.""" + def __init__(self, function: Function, value: Number): super().__init__(function, value, Symbols.ASSIGN) class Increase(FunctionOperator): + """Increase numerical fluent by value.""" + def __init__(self, function: Function, value: Number): super().__init__(function, value, Symbols.INCREASE) class Decrease(FunctionOperator): + """Decrease numerical fluent by value.""" + def __init__(self, function: Function, value: Number): super().__init__(function, value, Symbols.DECREASE) From f47452ca5dd5c59d04de86737f0ff72c443463f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Math=C3=AFs=20F=C3=A9d=C3=A9rico?= Date: Mon, 13 Mar 2023 05:16:32 +0100 Subject: [PATCH 04/65] =?UTF-8?q?=E2=9C=A8=20Sort=20imports?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pddl/core.py | 2 +- pddl/parser/domain.py | 2 +- pddl/parser/problem.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pddl/core.py b/pddl/core.py index 71df35cf..2414caf5 100644 --- a/pddl/core.py +++ b/pddl/core.py @@ -30,8 +30,8 @@ ensure_set, ) from pddl.logic.base import Formula, TrueFormula, is_literal -from pddl.logic.predicates import DerivedPredicate, Predicate from pddl.logic.functions import Function +from pddl.logic.predicates import DerivedPredicate, Predicate from pddl.logic.terms import Constant, Variable from pddl.parser.symbols import RequirementSymbols as RS diff --git a/pddl/parser/domain.py b/pddl/parser/domain.py index 5ad22d76..600f9e37 100644 --- a/pddl/parser/domain.py +++ b/pddl/parser/domain.py @@ -30,8 +30,8 @@ Or, ) from pddl.logic.effects import AndEffect, Forall, When -from pddl.logic.predicates import DerivedPredicate, EqualTo, Predicate from pddl.logic.functions import Function +from pddl.logic.predicates import DerivedPredicate, EqualTo, Predicate from pddl.logic.terms import Constant, Variable from pddl.parser import DOMAIN_GRAMMAR_FILE, PARSERS_DIRECTORY from pddl.parser.symbols import Symbols diff --git a/pddl/parser/problem.py b/pddl/parser/problem.py index 10558a42..d9094f3a 100644 --- a/pddl/parser/problem.py +++ b/pddl/parser/problem.py @@ -18,8 +18,8 @@ from pddl.core import Problem, Requirements from pddl.logic.base import And, Not -from pddl.logic.predicates import EqualTo, Predicate from pddl.logic.functions import Function +from pddl.logic.predicates import EqualTo, Predicate from pddl.logic.terms import Constant from pddl.parser import PARSERS_DIRECTORY, PROBLEM_GRAMMAR_FILE from pddl.parser.domain import DomainTransformer From 415b1bb08a2d100beff0961e8366f3776eb2a571 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Math=C3=AFs=20F=C3=A9d=C3=A9rico?= Date: Mon, 13 Mar 2023 05:21:09 +0100 Subject: [PATCH 05/65] =?UTF-8?q?=F0=9F=93=9D=20Add=20FunctionOperator=20?= =?UTF-8?q?=5F=5Finit=5F=5F=20docstrings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pddl/logic/functions.py | 55 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 52 insertions(+), 3 deletions(-) diff --git a/pddl/logic/functions.py b/pddl/logic/functions.py index eddc237d..6761eb1f 100644 --- a/pddl/logic/functions.py +++ b/pddl/logic/functions.py @@ -96,10 +96,11 @@ class FunctionOperator(Atomic): def __init__(self, function: Function, value: Number, symbol: Symbols): """ - Initialize the equality predicate. + Initialize the function operator. - :param func: the function to assign to. - :param right: the right term. + :param func: function to operate on. + :param value: value of the operator. + :param symbol: symbol of the operator. """ self._function = function self._value = value @@ -145,6 +146,12 @@ class EqualTo(FunctionOperator): """Check if numerical fluent is equal to value.""" def __init__(self, function: Function, value: Number): + """ + Initialize the EqualTo operator. + + :param func: function to operate on. + :param value: value of the operator. + """ super().__init__(function, value, Symbols.EQUAL) @@ -152,6 +159,12 @@ class LesserThan(FunctionOperator): """Check if numerical fluent is lesser than value.""" def __init__(self, function: Function, value: Number): + """ + Initialize the LesserThan operator. + + :param func: function to operate on. + :param value: value of the operator. + """ super().__init__(function, value, Symbols.LESSER) @@ -159,6 +172,12 @@ class LesserEqualThan(FunctionOperator): """Check if numerical fluent is lesser or equal than value.""" def __init__(self, function: Function, value: Number): + """ + Initialize the LesserEqualThan operator. + + :param func: function to operate on. + :param value: value of the operator. + """ super().__init__(function, value, Symbols.LESSER_EQUAL) @@ -166,6 +185,12 @@ class GreaterThan(FunctionOperator): """Check if numerical fluent is greater than value.""" def __init__(self, function: Function, value: Number): + """ + Initialize the GreaterThan operator. + + :param func: function to operate on. + :param value: value of the operator. + """ super().__init__(function, value, Symbols.GREATER) @@ -173,6 +198,12 @@ class GreaterEqualThan(FunctionOperator): """Check if numerical fluent is greater or equal than value.""" def __init__(self, function: Function, value: Number): + """ + Initialize the GreaterEqualThan operator. + + :param func: function to operate on. + :param value: value of the operator. + """ super().__init__(function, value, Symbols.GREATER_EQUAL) @@ -180,6 +211,12 @@ class AssignTo(FunctionOperator): """Assign value to numerical fluent.""" def __init__(self, function: Function, value: Number): + """ + Initialize the AssignTo operator. + + :param func: function to operate on. + :param value: value of the operator. + """ super().__init__(function, value, Symbols.ASSIGN) @@ -187,6 +224,12 @@ class Increase(FunctionOperator): """Increase numerical fluent by value.""" def __init__(self, function: Function, value: Number): + """ + Initialize the Increase operator. + + :param func: function to operate on. + :param value: value of the operator. + """ super().__init__(function, value, Symbols.INCREASE) @@ -194,4 +237,10 @@ class Decrease(FunctionOperator): """Decrease numerical fluent by value.""" def __init__(self, function: Function, value: Number): + """ + Initialize the Decrease operator. + + :param func: function to operate on. + :param value: value of the operator. + """ super().__init__(function, value, Symbols.DECREASE) From 4db9885082167ba9712cd3a1cc10c1115018077c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Math=C3=AFs=20F=C3=A9d=C3=A9rico?= Date: Mon, 13 Mar 2023 05:31:51 +0100 Subject: [PATCH 06/65] =?UTF-8?q?=E2=9C=A8=20Fix=20pytest=20warning=20due?= =?UTF-8?q?=20to=20'setup'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_action.py | 2 +- tests/test_actions.py | 2 +- tests/test_domain.py | 2 +- tests/test_functions.py | 2 +- tests/test_predicate.py | 2 +- tests/test_problem.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/test_action.py b/tests/test_action.py index 23dfa7b3..8334ee8f 100644 --- a/tests/test_action.py +++ b/tests/test_action.py @@ -20,7 +20,7 @@ class TestActionEmpty: """Test the empty action.""" - def setup(self): + def setup_method(self): """Set up the tests.""" self.action = Action("empty_action", []) diff --git a/tests/test_actions.py b/tests/test_actions.py index d97838f5..20302efc 100644 --- a/tests/test_actions.py +++ b/tests/test_actions.py @@ -19,7 +19,7 @@ class TestActionSimpleInitialization: """Test simple action initialization.""" - def setup(self): + def setup_method(self): """Set up the tests.""" self.action = Action("action", []) diff --git a/tests/test_domain.py b/tests/test_domain.py index c6a31186..ef3c402a 100644 --- a/tests/test_domain.py +++ b/tests/test_domain.py @@ -21,7 +21,7 @@ class TestDomainEmpty: """Test the empty domain.""" - def setup(self): + def setup_method(self): """Set up the tests.""" self.domain = Domain("empty_domain") diff --git a/tests/test_functions.py b/tests/test_functions.py index 1aa29848..1a986b25 100644 --- a/tests/test_functions.py +++ b/tests/test_functions.py @@ -19,7 +19,7 @@ class TestFunctionsimpleInitialisation: """Test simple function initialisation.""" - def setup(self): + def setup_method(self): """Set up the tests.""" self.a, self.b = variables("a b") self.function = Function("P", self.a, self.b) diff --git a/tests/test_predicate.py b/tests/test_predicate.py index d93870d8..6c32d6f2 100644 --- a/tests/test_predicate.py +++ b/tests/test_predicate.py @@ -19,7 +19,7 @@ class TestPredicateSimpleInitialisation: """Test simple predicate initialisation.""" - def setup(self): + def setup_method(self): """Set up the tests.""" self.a, self.b = variables("a b") self.predicate = Predicate("P", self.a, self.b) diff --git a/tests/test_problem.py b/tests/test_problem.py index e37aadc0..4975eb82 100644 --- a/tests/test_problem.py +++ b/tests/test_problem.py @@ -23,7 +23,7 @@ class TestProblemEmpty: """Test the empty problem.""" - def setup(self): + def setup_method(self): """Set up the tests.""" self.domain = Domain("empty_domain") self.problem = Problem("empty_problem", self.domain) From 10e490ee115ca011cd2d481116b3863ac70e4539 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Math=C3=AFs=20F=C3=A9d=C3=A9rico?= Date: Mon, 13 Mar 2023 05:39:16 +0100 Subject: [PATCH 07/65] =?UTF-8?q?=F0=9F=94=A5=20Remove=20requirements=20fi?= =?UTF-8?q?les?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- requirements-dev.txt | 5 ----- requirements.txt | 2 -- 2 files changed, 7 deletions(-) delete mode 100644 requirements-dev.txt delete mode 100644 requirements.txt diff --git a/requirements-dev.txt b/requirements-dev.txt deleted file mode 100644 index 00794aed..00000000 --- a/requirements-dev.txt +++ /dev/null @@ -1,5 +0,0 @@ -pytest>=7.2.0,<7.3.0 -pytest-cov>=4.0.0,<4.1.0 -pytest-randomly>=3.12.0,<3.13.0 -pytest-lazy-fixture>=0.6.3 ,<0.7.0 -mistune==2.0.0a4 \ No newline at end of file diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 78fab284..00000000 --- a/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -lark-parser>=0.9.0,<1 -click>=8,<9 \ No newline at end of file From 409e3a4a75195d89b18bf09e16fbf96382849630 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Math=C3=AFs=20F=C3=A9d=C3=A9rico?= Date: Mon, 13 Mar 2023 05:40:15 +0100 Subject: [PATCH 08/65] =?UTF-8?q?=F0=9F=90=9B=20Fix=20mypy=20issues?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pddl/core.py | 2 +- pddl/logic/base.py | 1 + pddl/logic/functions.py | 6 +++--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/pddl/core.py b/pddl/core.py index 2414caf5..379437d8 100644 --- a/pddl/core.py +++ b/pddl/core.py @@ -95,7 +95,7 @@ def predicates(self) -> AbstractSet[Predicate]: @property def functions(self) -> AbstractSet[Function]: """Get the functions.""" - self._functions + return self._functions @property def derived_predicates(self) -> AbstractSet[DerivedPredicate]: diff --git a/pddl/logic/base.py b/pddl/logic/base.py index ea0fd6b3..780ccbb6 100644 --- a/pddl/logic/base.py +++ b/pddl/logic/base.py @@ -47,6 +47,7 @@ class Number: """Base class for all the numbers.""" def __init__(self, value: float) -> None: + """Init the number object.""" self._value = value def __hash__(self) -> int: diff --git a/pddl/logic/functions.py b/pddl/logic/functions.py index 6761eb1f..551b7d28 100644 --- a/pddl/logic/functions.py +++ b/pddl/logic/functions.py @@ -107,17 +107,17 @@ def __init__(self, function: Function, value: Number, symbol: Symbols): self._symbol = symbol @property - def function(self) -> Term: + def function(self) -> Function: """Get the numerical fluent.""" return self._function @property - def symbol(self) -> Term: + def symbol(self) -> Symbols: """Get the operation symbol.""" return self._symbol @property - def value(self) -> Term: + def value(self) -> Number: """Get the value of the operation.""" return self._value From 36c7f3fc96d34caf55b21e2c9b899c10c55a339d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Math=C3=AFs=20F=C3=A9d=C3=A9rico?= Date: Mon, 13 Mar 2023 07:15:42 +0100 Subject: [PATCH 09/65] =?UTF-8?q?=E2=9C=85=20Pass=20simple=20formatter=20t?= =?UTF-8?q?ests=20for=20hello=20world?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- pddl/formatter.py | 16 +++++---- pddl/helpers/base.py | 8 +++-- pddl/logic/functions.py | 4 +-- tests/test_formatter.py | 76 +++++++++++++++++++++++++++++++++++++++++ 5 files changed, 93 insertions(+), 13 deletions(-) create mode 100644 tests/test_formatter.py diff --git a/README.md b/README.md index 23d99759..569c4c9e 100644 --- a/README.md +++ b/README.md @@ -120,7 +120,7 @@ that gives: (:constants a b c) (:predicates (p1 ?x - type_1 ?y - type_1 ?z - type_1) (p2 ?x - type_1 ?y - type_1)) (:action action-1 - :parameters (?x - type_1 ?y - type_1 ?z - type_1 ) + :parameters (?x - type_1 ?y - type_1 ?z - type_1) :precondition (and (p1 ?x ?y ?z) (not (p2 ?y ?z))) :effect (p2 ?y ?z) ) diff --git a/pddl/formatter.py b/pddl/formatter.py index 547a6a23..a0068344 100644 --- a/pddl/formatter.py +++ b/pddl/formatter.py @@ -41,11 +41,9 @@ def _print_predicates_with_types(predicates: Collection): else: result += f"({p.name}" for t in p.terms: - result += ( - f" ?{t.name} - {' '.join(t.type_tags)}" - if t.type_tags - else f"?{t.name}" - ) + result += f" ?{t.name}" + if t.type_tags: + result += f" - {' '.join(t.type_tags)}" result += ") " result += " " return result.strip() @@ -67,7 +65,10 @@ def domain_to_string(domain: Domain) -> str: body += _sort_and_print_collection("(:requirements ", domain.requirements, ")\n") body += _sort_and_print_collection("(:types ", domain.types, ")\n") body += _sort_and_print_collection("(:constants ", domain.constants, ")\n") - body += f"(:predicates {_print_predicates_with_types(domain.predicates)})\n" + if domain.predicates: + body += f"(:predicates {_print_predicates_with_types(domain.predicates)})\n" + if domain.functions: + body += f"(:functions {_print_predicates_with_types(domain.functions)})\n" body += _sort_and_print_collection( "", domain.derived_predicates, @@ -91,7 +92,8 @@ def problem_to_string(problem: Problem) -> str: body = f"(:domain {problem.domain_name})\n" indentation = " " * 4 body += _sort_and_print_collection("(:requirements ", problem.requirements, ")\n") - body += f"(:objects {_print_objects_with_types(problem.objects)})\n" + if problem.objects: + body += f"(:objects {_print_objects_with_types(problem.objects)})\n" body += _sort_and_print_collection("(:init ", problem.init, ")\n") body += f"{'(:goal ' + str(problem.goal) + ')'}\n" if problem.goal != TRUE else "" result = result + "\n" + indent(body, indentation) + "\n)" diff --git a/pddl/helpers/base.py b/pddl/helpers/base.py index 76a89c27..f2f71e4c 100644 --- a/pddl/helpers/base.py +++ b/pddl/helpers/base.py @@ -88,11 +88,13 @@ def find(seq: Sequence, condition: Callable[[Any], bool]) -> int: def _typed_parameters(parameters) -> str: """Return a list of parameters along with types if available.""" result = "" - for p in parameters: + for i, p in enumerate(parameters): + if i > 0: + result += " " if p.type_tags: - result += f"?{p.name} - {' '.join(map(str, p.type_tags))} " + result += f"?{p.name} - {' '.join(map(str, p.type_tags))}" else: - result += str(p) + " " + result += str(p) return result diff --git a/pddl/logic/functions.py b/pddl/logic/functions.py index 551b7d28..51c260a9 100644 --- a/pddl/logic/functions.py +++ b/pddl/logic/functions.py @@ -131,11 +131,11 @@ def __eq__(self, other) -> bool: def __hash__(self) -> int: """Get the hash.""" - return hash((self, self.function, self.value)) + return hash((self.symbol, self.function, self.value)) def __str__(self) -> str: """Get the string representation.""" - return f"({self.symbol} {self.function} {self.value})" + return f"({self.symbol.value} {self.function} {self.value})" def __repr__(self) -> str: """Get the string representation.""" diff --git a/tests/test_formatter.py b/tests/test_formatter.py new file mode 100644 index 00000000..7eae3920 --- /dev/null +++ b/tests/test_formatter.py @@ -0,0 +1,76 @@ +from pddl.formatter import domain_to_string, problem_to_string + +from pddl.core import ( + Domain, + Problem, + Function, + Requirements, + Action, + Variable, + Constant, +) +from pddl.logic.functions import LesserEqualThan, Increase, EqualTo, GreaterEqualThan +from pddl.logic.effects import AndEffect +from pddl.logic.base import ForallCondition, Number + + +def test_numerical_hello_world_domain_formatter(): + neighbor = Variable("neighbor") + hello_counter = Function("hello_counter", neighbor) + action = Action( + "say-hello-world", + parameters=[neighbor], + precondition=LesserEqualThan(hello_counter, Number(3)), + effect=AndEffect(Increase(hello_counter, Number(1))), + ) + + domain = Domain( + name="hello-world-functions", + requirements=[Requirements.STRIPS, Requirements.FLUENTS], + functions=[hello_counter], + actions=[action], + ) + + assert domain_to_string(domain) == "\n".join( + ( + "(define (domain hello-world-functions)", + " (:requirements :fluents :strips)", + " (:functions (hello_counter ?neighbor))", + " (:action say-hello-world", + " :parameters (?neighbor)", + " :precondition (<= (hello_counter ?neighbor) 3)", + " :effect (and (increase (hello_counter ?neighbor) 1))", + " )", + ")", + ) + ) + + +def test_numerical_hello_world_problem_formatter(): + neighbors = [Constant(name, ["neighbor"]) for name in ("Alice", "Bob", "Charlie")] + problem = Problem( + name="hello-3-times", + domain_name="hello-world-functions", + objects=neighbors, + init=[ + EqualTo(Function("hello_counter", neighbor), Number(0)) + for neighbor in neighbors + ], + goal=ForallCondition( + GreaterEqualThan( + Function("hello_counter", Variable("neighbor")), Number(1) + ), + [Variable("neighbor", ["neighbor"])], + ), + ) + + assert problem_to_string(problem) == "\n".join( + ( + "(define (problem hello-3-times)", + " (:domain hello-world-functions)", + " (:objects Alice - neighbor Bob - neighbor Charlie - neighbor)", + " (:init (= (hello_counter Alice) 0) (= (hello_counter Bob) 0) (= (hello_counter Charlie) 0))", + " (:goal (forall (?neighbor - neighbor) (>= (hello_counter ?neighbor) 1)))", + ")", + ) + ) From 2db72270145cd2d35664c8c144fd5d9c108432c0 Mon Sep 17 00:00:00 2001 From: Francesco Fuggitti Date: Sat, 7 Oct 2023 19:02:53 -0400 Subject: [PATCH 10/65] add numeric fluents to requirements --- pddl/parser/symbols.py | 4 ++++ pddl/requirements.py | 2 ++ 2 files changed, 6 insertions(+) diff --git a/pddl/parser/symbols.py b/pddl/parser/symbols.py index d7fa2ac5..53a5d298 100644 --- a/pddl/parser/symbols.py +++ b/pddl/parser/symbols.py @@ -61,6 +61,9 @@ class Symbols(Enum): ALL_SYMBOLS: Set[str] = {v.value for v in Symbols} +BINARY_COMP_SYMBOLS: Set[str] = { + v.value for v in Symbols if v.value in {">=", ">", "<=", "<", "="} +} class RequirementSymbols(Enum): @@ -79,6 +82,7 @@ class RequirementSymbols(Enum): DERIVED_PREDICATES = ":derived-predicates" NON_DETERMINISTIC = ":non-deterministic" FLUENTS = ":fluents" + NUMERIC_FLUENTS = ":numeric-fluents" def strip(self) -> str: """Strip the leading colon.""" diff --git a/pddl/requirements.py b/pddl/requirements.py index 91a5ebc6..73365652 100644 --- a/pddl/requirements.py +++ b/pddl/requirements.py @@ -34,6 +34,8 @@ class Requirements(Enum): ADL = RS.ADL.strip() DERIVED_PREDICATES = RS.DERIVED_PREDICATES.strip() NON_DETERMINISTIC = RS.NON_DETERMINISTIC.strip() + FLUENTS = RS.FLUENTS.strip() + NUMERIC_FLUENTS = RS.NUMERIC_FLUENTS.strip() @classmethod def quantified_precondition_requirements(cls) -> Set["Requirements"]: From 30d6b80dc7821afeec609a304000aa871f1a2ca5 Mon Sep 17 00:00:00 2001 From: Francesco Fuggitti Date: Sat, 7 Oct 2023 19:03:35 -0400 Subject: [PATCH 11/65] fix: types validation for functions --- pddl/_validation.py | 11 +++++++++++ pddl/logic/functions.py | 15 +++++++-------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/pddl/_validation.py b/pddl/_validation.py index 22e42f6e..255dc096 100644 --- a/pddl/_validation.py +++ b/pddl/_validation.py @@ -24,6 +24,7 @@ from pddl.logic import Predicate from pddl.logic.base import BinaryOp, QuantifiedCondition, UnaryOp from pddl.logic.effects import AndEffect, Forall, When +from pddl.logic.functions import Function, FunctionOperator from pddl.logic.predicates import DerivedPredicate, EqualTo from pddl.logic.terms import Term from pddl.parser.symbols import Symbols @@ -234,6 +235,16 @@ def _(self, predicate: Predicate) -> None: """Check types annotations of a PDDL predicate.""" self.check_type(predicate.terms) + @check_type.register + def _(self, function: Function) -> None: + """Check types annotations of a PDDL function.""" + self.check_type(function.terms) + + @check_type.register + def _(self, function_operator: FunctionOperator) -> None: + """Check types annotations of a PDDL function operator.""" + self.check_type(function_operator.function) + @check_type.register def _(self, equal_to: EqualTo) -> None: """Check types annotations of a PDDL equal-to atomic formula.""" diff --git a/pddl/logic/functions.py b/pddl/logic/functions.py index 51c260a9..ceda0d4c 100644 --- a/pddl/logic/functions.py +++ b/pddl/logic/functions.py @@ -15,8 +15,7 @@ import functools from typing import Sequence -from pddl.custom_types import name as name_type -from pddl.custom_types import namelike +from pddl.custom_types import namelike, parse_name from pddl.helpers.base import assert_ from pddl.helpers.cache_hash import cache_hash from pddl.logic.base import Atomic, Number @@ -31,7 +30,7 @@ class Function(Atomic): def __init__(self, name: namelike, *terms: Term): """Initialize the function.""" - self._name = name_type(name) + self._name = parse_name(name) self._terms = tuple(terms) @property @@ -49,15 +48,15 @@ def arity(self) -> int: """Get the arity of the function.""" return len(self.terms) - # TODO check whether it's a good idea... - # TODO allow also for keyword-based replacement - # TODO allow skip replacement with None arguments. + # TODO: check whether it's a good idea... + # TODO: allow also for keyword-based replacement + # TODO: allow skip replacement with None arguments. def __call__(self, *terms: Term): """Replace terms.""" - assert_(len(terms) == self.arity, "Number of terms not correct.") + assert_(len(terms) == self.arity, "Wrong number of terms.") assert_( all(t1.type_tags == t2.type_tags for t1, t2 in zip(self.terms, terms)), - "Types of replacements is not correct.", + "Wrong types of replacements.", ) return Function(self.name, *terms) From 12c676c1bf01a43ed9a2a7afb8d6137aba97e836 Mon Sep 17 00:00:00 2001 From: Francesco Fuggitti Date: Sat, 7 Oct 2023 19:05:07 -0400 Subject: [PATCH 12/65] fix: lark domain file to parse numeric fluents and domain parser --- pddl/parser/domain.lark | 39 +++++++++++++++++---------------- pddl/parser/domain.py | 48 +++++++++++++++++++++++++++++++++-------- 2 files changed, 59 insertions(+), 28 deletions(-) diff --git a/pddl/parser/domain.lark b/pddl/parser/domain.lark index db0b5a99..0b1f5585 100644 --- a/pddl/parser/domain.lark +++ b/pddl/parser/domain.lark @@ -7,29 +7,28 @@ requirements: LPAR REQUIREMENTS require_key+ RPAR types: LPAR TYPES typed_list_name RPAR constants: LPAR CONSTANTS typed_list_name RPAR -predicates: LPAR PREDICATES atomic_predicate_skeleton+ RPAR +predicates: LPAR PREDICATES atomic_formula_skeleton+ RPAR functions: LPAR FUNCTIONS atomic_function_skeleton+ RPAR -atomic_predicate_skeleton: LPAR NAME typed_list_variable RPAR -atomic_function_skeleton: LPAR NAME typed_list_variable RPAR +atomic_formula_skeleton: LPAR NAME typed_list_variable RPAR +atomic_function_skeleton: LPAR NAME typed_list_variable RPAR ?structure_def: action_def | derived_predicates action_def: LPAR ACTION NAME PARAMETERS action_parameters action_body_def RPAR action_parameters: LPAR typed_list_variable RPAR ?action_body_def: [PRECONDITION emptyor_pregd] [EFFECT emptyor_effect] -derived_predicates: LPAR DERIVED atomic_predicate_skeleton gd RPAR +derived_predicates: LPAR DERIVED atomic_formula_skeleton gd RPAR // preconditions emptyor_pregd: LPAR RPAR | gd gd: atomic_formula_term - | atomic_numeric_formula | LPAR OR gd* RPAR | LPAR NOT gd RPAR | LPAR AND gd* RPAR | LPAR IMPLY gd gd RPAR | LPAR EXISTS LPAR typed_list_variable RPAR gd RPAR | LPAR FORALL LPAR typed_list_variable RPAR gd RPAR - + | LPAR binary_comp f_exp f_exp RPAR // effects emptyor_effect: LPAR RPAR @@ -46,8 +45,7 @@ p_effect: LPAR NOT atomic_formula_term RPAR | num_effect cond_effect: LPAR AND p_effect* RPAR | p_effect -num_effect: LPAR INCREASE numeric_variable numeric_value RPAR - | LPAR DECREASE numeric_variable numeric_value RPAR +num_effect: LPAR assign_op f_head f_exp RPAR atomic_formula_term: LPAR predicate term* RPAR | LPAR EQUAL_OP term term RPAR @@ -55,21 +53,24 @@ atomic_formula_term: LPAR predicate term* RPAR | variable ?predicate: NAME constant: NAME -function: NAME -typed_list_variable: variable* - | (variable+ TYPE_SEP type_def)+ variable* -?variable: "?" NAME +binary_comp: GREATER_OP + | LESSER_OP + | EQUAL_OP + | GREATER_EQUAL_OP + | LESSER_EQUAL_OP -atomic_numeric_formula: LPAR EQUAL_OP numeric_variable numeric_value RPAR - | LPAR GREATER_OP numeric_variable numeric_value RPAR - | LPAR GREATER_EQUAL_OP numeric_variable numeric_value RPAR - | LPAR LESSER_OP numeric_variable numeric_value RPAR - | LPAR LESSER_EQUAL_OP numeric_variable numeric_value RPAR +assign_op: INCREASE + | DECREASE -numeric_variable: LPAR function term* RPAR +f_exp: NUMBER + | f_head +?f_head: NAME + | LPAR NAME term* RPAR -numeric_value: NUMBER | numeric_variable +typed_list_variable: variable* + | (variable+ TYPE_SEP type_def)+ variable* +?variable: "?" NAME typed_list_name: NAME* | (NAME+ TYPE_SEP primitive_type)+ NAME* diff --git a/pddl/parser/domain.py b/pddl/parser/domain.py index b3b3de6f..c195c1c6 100644 --- a/pddl/parser/domain.py +++ b/pddl/parser/domain.py @@ -23,11 +23,17 @@ from pddl.helpers.base import assert_ from pddl.logic.base import And, ExistsCondition, ForallCondition, Imply, Not, OneOf, Or from pddl.logic.effects import AndEffect, Forall, When -from pddl.logic.functions import Function +from pddl.logic.functions import ( + Function, + GreaterEqualThan, + GreaterThan, + LesserEqualThan, + LesserThan, +) from pddl.logic.predicates import DerivedPredicate, EqualTo, Predicate from pddl.logic.terms import Constant, Variable from pddl.parser import DOMAIN_GRAMMAR_FILE, PARSERS_DIRECTORY -from pddl.parser.symbols import Symbols +from pddl.parser.symbols import BINARY_COMP_SYMBOLS, Symbols from pddl.parser.typed_list_parser import TypedListParser from pddl.requirements import Requirements, _extend_domain_requirements @@ -41,6 +47,7 @@ def __init__(self, *args, **kwargs): self._constants_by_name: Dict[str, Constant] = {} self._predicates_by_name: Dict[str, Predicate] = {} + self._functions_by_name: Dict[str, Function] = {} self._current_parameters_by_name: Dict[str, Variable] = {} self._requirements: Set[str] = set() self._extended_requirements: Set[str] = set() @@ -100,7 +107,7 @@ def predicates(self, args): return dict(predicates=predicates) def functions(self, args): - """Process the 'predicates' rule.""" + """Process the 'functions' rule.""" functions = args[2:-1] self._functions_by_name = {f.name: f for f in functions} return dict(functions=functions) @@ -194,6 +201,25 @@ def gd_quantifiers(self, args): condition = args[5] return cond_class(cond=condition, variables=variables) + def gd_comparison(self, args): + """Process the 'gd' comparison rule.""" + if not bool({Requirements.NUMERIC_FLUENTS, Requirements.FLUENTS}): + raise PDDLMissingRequirementError(Requirements.NUMERIC_FLUENTS) + left = args[2] + right = args[3] + if args[1] == Symbols.GREATER_EQUAL.value: + return GreaterEqualThan(left, right) + elif args[1] == Symbols.GREATER.value: + return GreaterThan(left, right) + elif args[1] == Symbols.LESSER_EQUAL.value: + return LesserEqualThan(left, right) + elif args[1] == Symbols.LESSER.value: + return LesserThan(left, right) + elif args[1] == Symbols.EQUAL.value: + return EqualTo(left, right) + else: + raise PDDLParsingError(f"Unknown comparison operator: {args[1]}") + def gd(self, args): """Process the 'gd' rule.""" if len(args) == 1: @@ -208,6 +234,8 @@ def gd(self, args): return self.gd_imply(args) elif args[1] in [Symbols.FORALL.value, Symbols.EXISTS.value]: return self.gd_quantifiers(args) + elif args[1] in BINARY_COMP_SYMBOLS: + return self.gd_comparison(args) def emptyor_effect(self, args): """Process the 'emptyor_effect' rule.""" @@ -286,20 +314,22 @@ def constant(self, args): return constant def _formula_skeleton(self, args): - predicate_name = args[1] + """Process the '_formula_skeleton' rule.""" variable_data: Dict[str, Set[str]] = args[2] variables = [Variable(var_name, tags) for var_name, tags in variable_data] - return name, variables + return variables - def atomic_predicate_skeleton(self, args): + def atomic_formula_skeleton(self, args): """Process the 'atomic_formula_skeleton' rule.""" - name, variables = self._formula_skeleton(args) + predicate_name = args[1] + variables = self._formula_skeleton(args) return Predicate(predicate_name, *variables) def atomic_function_skeleton(self, args): """Process the 'atomic_function_skeleton' rule.""" - name, variables = self._formula_skeleton(args) - return Function(name, *variables) + function_name = args[1] + variables = self._formula_skeleton(args) + return Function(function_name, *variables) def typed_list_name(self, args) -> Dict[name, Optional[name]]: """Process the 'typed_list_name' rule.""" From 850a09d277b8eeebe8650e640b43b4034e5c903a Mon Sep 17 00:00:00 2001 From: Francesco Fuggitti Date: Sat, 7 Oct 2023 19:05:35 -0400 Subject: [PATCH 13/65] fix: formatting tests --- tests/test_formatter.py | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/tests/test_formatter.py b/tests/test_formatter.py index 4074a483..fbd2d85d 100644 --- a/tests/test_formatter.py +++ b/tests/test_formatter.py @@ -17,9 +17,19 @@ import pytest +from pddl.action import Action from pddl.core import Domain, Problem from pddl.formatter import domain_to_string, problem_to_string -from pddl.logic import constants +from pddl.logic import Constant, Variable, constants +from pddl.logic.base import ForallCondition, Number +from pddl.logic.effects import AndEffect +from pddl.logic.functions import ( + EqualTo, + Function, + GreaterEqualThan, + Increase, + LesserEqualThan, +) from pddl.requirements import Requirements from tests.conftest import DOMAIN_FILES, PROBLEM_FILES @@ -98,23 +108,11 @@ def test_typed_objects_formatting_in_problem() -> None: (:init ) (:goal (and )) )""" -from pddl.formatter import domain_to_string, problem_to_string - -from pddl.core import ( - Domain, - Problem, - Function, - Requirements, - Action, - Variable, - Constant, -) -from pddl.logic.functions import LesserEqualThan, Increase, EqualTo, GreaterEqualThan -from pddl.logic.effects import AndEffect -from pddl.logic.base import ForallCondition, Number + ) def test_numerical_hello_world_domain_formatter(): + """Test that numerical functions are formatted correctly.""" neighbor = Variable("neighbor") hello_counter = Function("hello_counter", neighbor) action = Action( @@ -135,6 +133,8 @@ def test_numerical_hello_world_domain_formatter(): ( "(define (domain hello-world-functions)", " (:requirements :fluents :strips)", + " (:types)\n" + " (:constants)\n" " (:functions (hello_counter ?neighbor))", " (:action say-hello-world", " :parameters (?neighbor)", @@ -147,7 +147,8 @@ def test_numerical_hello_world_domain_formatter(): def test_numerical_hello_world_problem_formatter(): - neighbors = [Constant(name, ["neighbor"]) for name in ("Alice", "Bob", "Charlie")] + """Test that numerical functions are formatted correctly.""" + neighbors = [Constant(name, "neighbor") for name in ("Alice", "Bob", "Charlie")] problem = Problem( name="hello-3-times", domain_name="hello-world-functions", From 954465def68b6701650107b7f6b28f3d581eed30 Mon Sep 17 00:00:00 2001 From: Francesco Fuggitti Date: Sat, 7 Oct 2023 23:23:48 -0400 Subject: [PATCH 14/65] fix: domain parsing --- pddl/parser/domain.lark | 18 +++++++++--------- pddl/parser/domain.py | 20 ++++++++++++++++++++ 2 files changed, 29 insertions(+), 9 deletions(-) diff --git a/pddl/parser/domain.lark b/pddl/parser/domain.lark index 0b1f5585..55e42fa1 100644 --- a/pddl/parser/domain.lark +++ b/pddl/parser/domain.lark @@ -54,18 +54,18 @@ atomic_formula_term: LPAR predicate term* RPAR ?predicate: NAME constant: NAME -binary_comp: GREATER_OP - | LESSER_OP - | EQUAL_OP - | GREATER_EQUAL_OP - | LESSER_EQUAL_OP +?binary_comp: GREATER_OP + | LESSER_OP + | EQUAL_OP + | GREATER_EQUAL_OP + | LESSER_EQUAL_OP -assign_op: INCREASE - | DECREASE +?assign_op: INCREASE + | DECREASE -f_exp: NUMBER +?f_exp: NUMBER | f_head -?f_head: NAME +f_head: NAME | LPAR NAME term* RPAR typed_list_variable: variable* diff --git a/pddl/parser/domain.py b/pddl/parser/domain.py index c195c1c6..c7c3867e 100644 --- a/pddl/parser/domain.py +++ b/pddl/parser/domain.py @@ -29,6 +29,8 @@ GreaterThan, LesserEqualThan, LesserThan, + Increase, + Decrease, ) from pddl.logic.predicates import DerivedPredicate, EqualTo, Predicate from pddl.logic.terms import Constant, Variable @@ -282,6 +284,16 @@ def cond_effect(self, args): assert_(len(args) == 1) return args[0] + def num_effect(self, args): + """Process the 'num_effect' rule.""" + function = args[2] + value = args[3] + if args[1] == Symbols.INCREASE.value: + return Increase(function, value) + if args[1] == Symbols.DECREASE.value: + return Decrease(function, value) + raise PDDLParsingError("Assign operator not recognized") + def atomic_formula_term(self, args): """Process the 'atomic_formula_term' rule.""" @@ -331,6 +343,14 @@ def atomic_function_skeleton(self, args): variables = self._formula_skeleton(args) return Function(function_name, *variables) + def f_head(self, args): + """Process the 'f_head' rule.""" + if len(args) == 1: + return args[0] + function_name = args[1] + variables = [Variable(x, {}) for x in args[2:-1]] + return Function(function_name, *variables) + def typed_list_name(self, args) -> Dict[name, Optional[name]]: """Process the 'typed_list_name' rule.""" try: From e0945584782ab7ce27fcd5a99971f70c45166ee0 Mon Sep 17 00:00:00 2001 From: Francesco Fuggitti Date: Sat, 7 Oct 2023 23:35:48 -0400 Subject: [PATCH 15/65] fix: hello-world problem test --- tests/test_formatter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_formatter.py b/tests/test_formatter.py index fbd2d85d..fa620263 100644 --- a/tests/test_formatter.py +++ b/tests/test_formatter.py @@ -169,7 +169,7 @@ def test_numerical_hello_world_problem_formatter(): ( "(define (problem hello-3-times)", " (:domain hello-world-functions)", - " (:objects Alice - neighbor Bob - neighbor Charlie - neighbor)", + " (:objects Alice Bob Charlie - neighbor)", " (:init (= (hello_counter Alice) 0) (= (hello_counter Bob) 0) (= (hello_counter Charlie) 0))", " (:goal (forall (?neighbor - neighbor) (>= (hello_counter ?neighbor) 1)))", ")", From 06591d9d8ef295db44b6d44d21e71c89136e84be Mon Sep 17 00:00:00 2001 From: Francesco Fuggitti Date: Sun, 8 Oct 2023 17:24:23 -0400 Subject: [PATCH 16/65] fix: equalto call on gd_comparison rule in domain parsing --- pddl/parser/domain.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pddl/parser/domain.py b/pddl/parser/domain.py index c7c3867e..224dd270 100644 --- a/pddl/parser/domain.py +++ b/pddl/parser/domain.py @@ -31,6 +31,7 @@ LesserThan, Increase, Decrease, + EqualTo as FunctionEqualTo, ) from pddl.logic.predicates import DerivedPredicate, EqualTo, Predicate from pddl.logic.terms import Constant, Variable @@ -218,7 +219,7 @@ def gd_comparison(self, args): elif args[1] == Symbols.LESSER.value: return LesserThan(left, right) elif args[1] == Symbols.EQUAL.value: - return EqualTo(left, right) + return FunctionEqualTo(left, right) else: raise PDDLParsingError(f"Unknown comparison operator: {args[1]}") From d6ad43263028727ba5f7d1c12e5487d125f765fd Mon Sep 17 00:00:00 2001 From: Francesco Fuggitti Date: Sun, 8 Oct 2023 19:32:58 -0400 Subject: [PATCH 17/65] fix: problem grammar and parsing to support part of numeric fluents --- pddl/parser/problem.lark | 26 +++++++------ pddl/parser/problem.py | 81 ++++++++++++++++++++++++++++++---------- 2 files changed, 76 insertions(+), 31 deletions(-) diff --git a/pddl/parser/problem.lark b/pddl/parser/problem.lark index 8dd9a3ae..705e78ee 100644 --- a/pddl/parser/problem.lark +++ b/pddl/parser/problem.lark @@ -10,28 +10,29 @@ problem_requirements: LPAR REQUIREMENTS require_key+ RPAR objects: LPAR OBJECTS typed_list_name RPAR init: LPAR INIT init_el* RPAR -?init_el: literal_name +init_el: literal_name + | LPAR EQUAL_OP basic_function_term NUMBER RPAR + literal_name: atomic_formula_name - | atomic_function_init | LPAR NOT atomic_formula_name RPAR -atomic_formula_name: LPAR predicate NAME* RPAR - | LPAR EQUAL_OP NAME NAME RPAR -atomic_function_init: LPAR EQUAL_OP numeric_variable NUMBER RPAR +basic_function_term: NAME + | LPAR NAME NAME* RPAR +atomic_formula_name: LPAR predicate NAME* RPAR + | LPAR EQUAL_OP NAME NAME RPAR goal: LPAR GOAL gd_name RPAR gd_name: atomic_formula_name | LPAR NOT atomic_formula_name RPAR | LPAR AND gd_name* RPAR - | atomic_function_goal + | LPAR binary_comp f_exp f_exp RPAR -atomic_function_goal: atomic_function_init - | LPAR GREATER_OP numeric_variable NUMBER RPAR - | LPAR GREATER_EQUAL_OP numeric_variable NUMBER RPAR - | LPAR LESSER_OP numeric_variable NUMBER RPAR - | LPAR LESSER_EQUAL_OP numeric_variable NUMBER RPAR +?f_exp: NUMBER + | f_head +f_head: NAME + | LPAR NAME term* RPAR DOMAIN_P: ":domain" PROBLEM: "problem" @@ -46,7 +47,8 @@ GOAL: ":goal" %import .domain.require_key -> require_key %import .domain.typed_list_name -> typed_list_name %import .domain.predicate -> predicate -%import .domain.numeric_variable -> numeric_variable +%import .domain.binary_comp -> binary_comp +%import .domain.term -> term %import .common.NAME -> NAME %import .common.DEFINE -> DEFINE %import .common.DOMAIN -> DOMAIN diff --git a/pddl/parser/problem.py b/pddl/parser/problem.py index fc1f40de..fa08edab 100644 --- a/pddl/parser/problem.py +++ b/pddl/parser/problem.py @@ -15,16 +15,24 @@ from typing import Dict from lark import Lark, ParseError, Transformer +from pddl.exceptions import PDDLParsingError, PDDLMissingRequirementError from pddl.core import Problem from pddl.helpers.base import assert_ from pddl.logic.base import And, Not -from pddl.logic.functions import Function +from pddl.logic.functions import ( + Function, + GreaterEqualThan, + GreaterThan, + LesserEqualThan, + LesserThan, + EqualTo as FunctionEqualTo, +) from pddl.logic.predicates import EqualTo, Predicate -from pddl.logic.terms import Constant +from pddl.logic.terms import Constant, Variable from pddl.parser import PARSERS_DIRECTORY, PROBLEM_GRAMMAR_FILE from pddl.parser.domain import DomainTransformer -from pddl.parser.symbols import Symbols +from pddl.parser.symbols import Symbols, BINARY_COMP_SYMBOLS from pddl.requirements import Requirements @@ -89,7 +97,25 @@ def domain__type_def(self, names): def init(self, args): """Process the 'init' rule.""" - return "init", args[2:-1] + flat_args = [ + item + for sublist in args[2:-1] + for item in (sublist if isinstance(sublist, list) else [sublist]) + ] + return "init", flat_args + + def init_el(self, args): + """Process the 'init_el' rule.""" + if len(args) == 1: + return args[0] + elif args[1] == Symbols.EQUAL.value: + if isinstance(args[2], list) and len(args[2]) == 1: + return FunctionEqualTo(*args[2], args[3]) + elif not isinstance(args[2], list): + return FunctionEqualTo(args[2], args[3]) + else: + funcs = [FunctionEqualTo(x, args[3]) for x in args[2]] + return funcs def literal_name(self, args): """Process the 'literal_name' rule.""" @@ -100,10 +126,33 @@ def literal_name(self, args): else: raise ParseError + def basic_function_term(self, args): + """Process the 'basic_function_term' rule.""" + if len(args) == 1: + return args[0] + return args[1:-1] + def goal(self, args): """Process the 'goal' rule.""" return "goal", args[2] + def gd_binary_comparison(self, args): + """Process the 'gd' comparison rule.""" + left = args[2] + right = args[3] + if args[1] == Symbols.GREATER_EQUAL.value: + return GreaterEqualThan(left, right) + elif args[1] == Symbols.GREATER.value: + return GreaterThan(left, right) + elif args[1] == Symbols.LESSER_EQUAL.value: + return LesserEqualThan(left, right) + elif args[1] == Symbols.LESSER.value: + return LesserThan(left, right) + elif args[1] == Symbols.EQUAL.value: + return FunctionEqualTo(left, right) + else: + raise PDDLParsingError(f"Unknown comparison operator: {args[1]}") + def gd_name(self, args): """Process the 'gd_name' rule.""" if len(args) == 1: @@ -112,6 +161,8 @@ def gd_name(self, args): return Not(args[2]) elif args[1] == Symbols.AND.value: return And(*args[2:-1]) + elif args[1] in BINARY_COMP_SYMBOLS: + return self.gd_binary_comparison(args) else: raise ParseError @@ -131,21 +182,13 @@ def atomic_formula_name(self, args): ] return Predicate(name, *terms) - def atomic_function_init(self, args): - """Process the 'atomic_function_init' rule.""" - if args[1] == Symbols.EQUAL.value: - obj1 = self._objects_by_name.get(args[1]) - obj2 = self._objects_by_name.get(args[2]) - return EqualTo(obj1, obj2) - else: - name = args[1] - terms = [ - Constant(str(_term_name)) - if self._objects_by_name.get(str(_term_name)) is None - else self._objects_by_name.get(str(_term_name)) - for _term_name in args[2:-1] - ] - return Function(name, *terms) + def f_head(self, args): + """Process the 'f_head' rule.""" + if len(args) == 1: + return args[0] + function_name = args[1] + variables = [Variable(x, {}) for x in args[2:-1]] + return Function(function_name, *variables) _problem_parser_lark = PROBLEM_GRAMMAR_FILE.read_text() From fc04b297d553172f8f28b26299905ad6258fb5af Mon Sep 17 00:00:00 2001 From: Francesco Fuggitti Date: Sun, 8 Oct 2023 19:48:43 -0400 Subject: [PATCH 18/65] fix: formatter test as predicates definition in domain is optional --- tests/test_formatter.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/test_formatter.py b/tests/test_formatter.py index fa620263..02875180 100644 --- a/tests/test_formatter.py +++ b/tests/test_formatter.py @@ -77,7 +77,6 @@ def test_typed_constants_formatting_in_domain() -> None: (:requirements :typing) (:types type_2 type_3 - type_1 type_1) (:constants a b c - type_1 d e f - type_2 g h i - type_3 j k l) - (:predicates ) )""" ) From f60cd0045a3bd4da6e3f06b6c5650ca46279f285 Mon Sep 17 00:00:00 2001 From: Francesco Fuggitti Date: Sun, 8 Oct 2023 20:31:40 -0400 Subject: [PATCH 19/65] fix: issue on problem parsing causing a failure on the type-check with the domain --- pddl/parser/problem.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pddl/parser/problem.py b/pddl/parser/problem.py index fa08edab..9ea9288b 100644 --- a/pddl/parser/problem.py +++ b/pddl/parser/problem.py @@ -129,8 +129,8 @@ def literal_name(self, args): def basic_function_term(self, args): """Process the 'basic_function_term' rule.""" if len(args) == 1: - return args[0] - return args[1:-1] + return Function(args[0]) + return [Function(x) for x in args[1:-1]] def goal(self, args): """Process the 'goal' rule.""" From f327c1901400c820b1c9c15d137bbea5fb68fa6c Mon Sep 17 00:00:00 2001 From: Francesco Fuggitti Date: Sun, 8 Oct 2023 20:33:04 -0400 Subject: [PATCH 20/65] apply style checks --- pddl/parser/domain.py | 6 +++--- pddl/parser/problem.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pddl/parser/domain.py b/pddl/parser/domain.py index 224dd270..c415598a 100644 --- a/pddl/parser/domain.py +++ b/pddl/parser/domain.py @@ -23,15 +23,15 @@ from pddl.helpers.base import assert_ from pddl.logic.base import And, ExistsCondition, ForallCondition, Imply, Not, OneOf, Or from pddl.logic.effects import AndEffect, Forall, When +from pddl.logic.functions import Decrease +from pddl.logic.functions import EqualTo as FunctionEqualTo from pddl.logic.functions import ( Function, GreaterEqualThan, GreaterThan, + Increase, LesserEqualThan, LesserThan, - Increase, - Decrease, - EqualTo as FunctionEqualTo, ) from pddl.logic.predicates import DerivedPredicate, EqualTo, Predicate from pddl.logic.terms import Constant, Variable diff --git a/pddl/parser/problem.py b/pddl/parser/problem.py index 9ea9288b..c87b22a2 100644 --- a/pddl/parser/problem.py +++ b/pddl/parser/problem.py @@ -15,24 +15,24 @@ from typing import Dict from lark import Lark, ParseError, Transformer -from pddl.exceptions import PDDLParsingError, PDDLMissingRequirementError from pddl.core import Problem +from pddl.exceptions import PDDLParsingError from pddl.helpers.base import assert_ from pddl.logic.base import And, Not +from pddl.logic.functions import EqualTo as FunctionEqualTo from pddl.logic.functions import ( Function, GreaterEqualThan, GreaterThan, LesserEqualThan, LesserThan, - EqualTo as FunctionEqualTo, ) from pddl.logic.predicates import EqualTo, Predicate from pddl.logic.terms import Constant, Variable from pddl.parser import PARSERS_DIRECTORY, PROBLEM_GRAMMAR_FILE from pddl.parser.domain import DomainTransformer -from pddl.parser.symbols import Symbols, BINARY_COMP_SYMBOLS +from pddl.parser.symbols import BINARY_COMP_SYMBOLS, Symbols from pddl.requirements import Requirements From 5802fca713967b8c2678bec24b9e706649820224 Mon Sep 17 00:00:00 2001 From: Francesco Fuggitti Date: Sun, 8 Oct 2023 20:40:44 -0400 Subject: [PATCH 21/65] update: whitelist.py --- scripts/whitelist.py | 81 ++++++++++++++++++++++++++++---------------- 1 file changed, 52 insertions(+), 29 deletions(-) diff --git a/scripts/whitelist.py b/scripts/whitelist.py index 5477af74..35db1627 100644 --- a/scripts/whitelist.py +++ b/scripts/whitelist.py @@ -1,33 +1,57 @@ -safe_get # unused function (pddl/helpers/base.py:95) -find # unused function (pddl/helpers/base.py:100) -ensure_formula # unused function (pddl/logic/base.py:294) +_._ # unused method (pddl/_validation.py:221) +_._ # unused method (pddl/_validation.py:227) +_._ # unused method (pddl/_validation.py:233) +_._ # unused method (pddl/_validation.py:238) +_._ # unused method (pddl/_validation.py:243) +_._ # unused method (pddl/_validation.py:248) +_._ # unused method (pddl/_validation.py:254) +_._ # unused method (pddl/_validation.py:260) +_._ # unused method (pddl/_validation.py:265) +_._ # unused method (pddl/_validation.py:270) +_._ # unused method (pddl/_validation.py:276) +_._ # unused method (pddl/_validation.py:281) +_._ # unused method (pddl/_validation.py:287) +_._ # unused method (pddl/_validation.py:293) +to_names # unused function (pddl/custom_types.py:82) +safe_get # unused function (pddl/helpers/base.py:111) +find # unused function (pddl/helpers/base.py:116) +ensure_formula # unused function (pddl/logic/base.py:251) PEffect # unused variable (pddl/logic/effects.py:168) Effect # unused variable (pddl/logic/effects.py:170) CondEffect # unused variable (pddl/logic/effects.py:171) -_._predicates_by_name # unused attribute (pddl/parser/domain.py:51) -_.start # unused method (pddl/parser/domain.py:56) -_.domain_def # unused method (pddl/parser/domain.py:77) -_._predicates_by_name # unused attribute (pddl/parser/domain.py:110) -_.action_def # unused method (pddl/parser/domain.py:113) -_.action_parameters # unused method (pddl/parser/domain.py:131) -_.emptyor_pregd # unused method (pddl/parser/domain.py:138) -_.gd # unused method (pddl/parser/domain.py:202) -_.emptyor_effect # unused method (pddl/parser/domain.py:217) -_.c_effect # unused method (pddl/parser/domain.py:232) -_.p_effect # unused method (pddl/parser/domain.py:247) -_.cond_effect # unused method (pddl/parser/domain.py:254) -_.atomic_formula_term # unused method (pddl/parser/domain.py:262) -_.atomic_formula_skeleton # unused method (pddl/parser/domain.py:293) -_.typed_list_variable # unused method (pddl/parser/domain.py:312) -_.type_def # unused method (pddl/parser/domain.py:329) -_.start # unused method (pddl/parser/problem.py:39) -_.problem_def # unused method (pddl/parser/problem.py:52) -_.problem_domain # unused method (pddl/parser/problem.py:56) -_.problem_requirements # unused method (pddl/parser/problem.py:60) -_.domain__type_def # unused method (pddl/parser/problem.py:83) -_.literal_name # unused method (pddl/parser/problem.py:92) -_.gd_name # unused method (pddl/parser/problem.py:105) -_.atomic_formula_name # unused method (pddl/parser/problem.py:116) +AssignTo # unused class (pddl/logic/functions.py:209) +_._predicates_by_name # unused attribute (pddl/parser/domain.py:52) +_._functions_by_name # unused attribute (pddl/parser/domain.py:53) +_.start # unused method (pddl/parser/domain.py:58) +_.domain_def # unused method (pddl/parser/domain.py:79) +_._predicates_by_name # unused attribute (pddl/parser/domain.py:109) +_._functions_by_name # unused attribute (pddl/parser/domain.py:115) +_.action_def # unused method (pddl/parser/domain.py:118) +_.action_parameters # unused method (pddl/parser/domain.py:136) +_.emptyor_pregd # unused method (pddl/parser/domain.py:143) +_.gd # unused method (pddl/parser/domain.py:226) +_.emptyor_effect # unused method (pddl/parser/domain.py:243) +_.c_effect # unused method (pddl/parser/domain.py:258) +_.p_effect # unused method (pddl/parser/domain.py:273) +_.cond_effect # unused method (pddl/parser/domain.py:280) +_.num_effect # unused method (pddl/parser/domain.py:288) +_.atomic_formula_term # unused method (pddl/parser/domain.py:298) +_.atomic_formula_skeleton # unused method (pddl/parser/domain.py:335) +_.atomic_function_skeleton # unused method (pddl/parser/domain.py:341) +_.f_head # unused method (pddl/parser/domain.py:347) +_.typed_list_variable # unused method (pddl/parser/domain.py:363) +_.type_def # unused method (pddl/parser/domain.py:386) +_.start # unused method (pddl/parser/problem.py:49) +_.problem_def # unused method (pddl/parser/problem.py:62) +_.problem_domain # unused method (pddl/parser/problem.py:66) +_.problem_requirements # unused method (pddl/parser/problem.py:70) +_.domain__type_def # unused method (pddl/parser/problem.py:93) +_.init_el # unused method (pddl/parser/problem.py:107) +_.literal_name # unused method (pddl/parser/problem.py:120) +_.basic_function_term # unused method (pddl/parser/problem.py:129) +_.gd_name # unused method (pddl/parser/problem.py:156) +_.atomic_formula_name # unused method (pddl/parser/problem.py:169) +_.f_head # unused method (pddl/parser/problem.py:185) OpSymbol # unused variable (pddl/parser/symbols.py:17) OpRequirement # unused variable (pddl/parser/symbols.py:18) ROUND_BRACKET_LEFT # unused variable (pddl/parser/symbols.py:24) @@ -47,5 +71,4 @@ PROBLEM # unused variable (pddl/parser/symbols.py:50) REQUIREMENTS # unused variable (pddl/parser/symbols.py:51) TYPES # unused variable (pddl/parser/symbols.py:52) -ALL_REQUIREMENTS # unused variable (pddl/parser/symbols.py:80) -to_names # unused function (pddl/custom_types.py:79) +ALL_REQUIREMENTS # unused variable (pddl/parser/symbols.py:92) From bb7ca51779c0f78498f5c971158cc32154af2e67 Mon Sep 17 00:00:00 2001 From: Francesco Fuggitti Date: Mon, 9 Oct 2023 09:59:55 -0400 Subject: [PATCH 22/65] fix: copyright header --- pddl/logic/functions.py | 3 +-- tests/test_functions.py | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/pddl/logic/functions.py b/pddl/logic/functions.py index ceda0d4c..92191644 100644 --- a/pddl/logic/functions.py +++ b/pddl/logic/functions.py @@ -1,6 +1,5 @@ -# -*- coding: utf-8 -*- # -# Copyright 2021-2022 WhiteMech +# Copyright 2021-2023 WhiteMech # # ------------------------------ # diff --git a/tests/test_functions.py b/tests/test_functions.py index 1a986b25..5548d11b 100644 --- a/tests/test_functions.py +++ b/tests/test_functions.py @@ -1,6 +1,5 @@ -# -*- coding: utf-8 -*- # -# Copyright 2021-2022 WhiteMech +# Copyright 2021-2023 WhiteMech # # ------------------------------ # From b3d9d1d8b3dbe50045a00d158f325c6b9beb9eae Mon Sep 17 00:00:00 2001 From: Francesco Fuggitti Date: Mon, 9 Oct 2023 12:53:53 -0400 Subject: [PATCH 23/65] add actions costs and metric specification to domain and problem --- pddl/core.py | 11 ++++++++++- pddl/parser/common.lark | 8 ++++++++ pddl/parser/domain.lark | 2 ++ pddl/parser/domain.py | 5 +++++ pddl/parser/problem.lark | 10 +++++++++- pddl/parser/problem.py | 10 ++++++++++ 6 files changed, 44 insertions(+), 2 deletions(-) diff --git a/pddl/core.py b/pddl/core.py index 9f28e77f..7a7e7be8 100644 --- a/pddl/core.py +++ b/pddl/core.py @@ -28,7 +28,7 @@ from pddl.custom_types import namelike, parse_name, to_names, to_types # noqa: F401 from pddl.helpers.base import assert_, check, ensure, ensure_set from pddl.logic.base import And, Formula, is_literal -from pddl.logic.functions import Function +from pddl.logic.functions import Function, Metric from pddl.logic.predicates import DerivedPredicate, Predicate from pddl.logic.terms import Constant from pddl.requirements import Requirements @@ -157,6 +157,7 @@ def __init__( objects: Optional[Collection["Constant"]] = None, init: Optional[Collection[Formula]] = None, goal: Optional[Formula] = None, + metric: Optional[Metric] = None, ): """ Initialize the PDDL problem. @@ -168,6 +169,7 @@ def __init__( :param objects: the set of objects. :param init: the initial condition. :param goal: the goal condition. + :param metric: the metric. """ self._name = parse_name(name) self._domain: Optional[Domain] @@ -181,6 +183,7 @@ def __init__( self._objects: AbstractSet[Constant] = ensure_set(objects) self._init: AbstractSet[Formula] = ensure_set(init) self._goal: Formula = ensure(goal, And()) + self._metric: Optional[Metric] = metric validate( all(map(is_literal, self.init)), "Not all formulas of initial condition are literals!", @@ -306,6 +309,11 @@ def goal(self) -> Formula: """Get the goal.""" return self._goal + @property + def metric(self) -> Optional[Metric]: + """Get the metric.""" + return self._metric + def __eq__(self, other): """Compare with another object.""" return ( @@ -317,4 +325,5 @@ def __eq__(self, other): and self.objects == other.objects and self.init == other.init and self.goal == other.goal + and self.metric == other.metric ) diff --git a/pddl/parser/common.lark b/pddl/parser/common.lark index beb1ddfb..7168b807 100644 --- a/pddl/parser/common.lark +++ b/pddl/parser/common.lark @@ -12,7 +12,9 @@ NAME: /[a-zA-Z][a-zA-Z0-9-_]*/ | ADL | DERIVED_PREDICATES | CONDITIONAL_EFFECTS + | NUMERIC_FLUENTS | FLUENTS + | ACTION_COSTS COMMENT: /;[^\n]*/ @@ -43,8 +45,12 @@ GREATER_EQUAL_OP: ">=" GREATER_OP: ">" LESSER_EQUAL_OP: "<=" LESSER_OP: "<" +METRIC: ":metric" INCREASE: "increase" DECREASE: "decrease" +MAXIMIZE: "maximize" +MINIMIZE: "minimize" +TOTAL_COST: "total-cost" NUMBER: /[0-9]+/ // available requirements @@ -60,7 +66,9 @@ CONDITIONAL_EFFECTS: ":conditional-effects" EXISTENTIAL_PRECONDITIONS: ":existential-preconditions" UNIVERSAL_PRECONDITIONS: ":universal-preconditions" QUANTIFIED_PRECONDITIONS: ":quantified-preconditions" +NUMERIC_FLUENTS: ":numeric-fluents" FLUENTS: ":fluents" +ACTION_COSTS: ":action-costs" // others LPAR : "(" diff --git a/pddl/parser/domain.lark b/pddl/parser/domain.lark index 55e42fa1..42e6bd12 100644 --- a/pddl/parser/domain.lark +++ b/pddl/parser/domain.lark @@ -11,6 +11,7 @@ predicates: LPAR PREDICATES atomic_formula_skeleton+ RPAR functions: LPAR FUNCTIONS atomic_function_skeleton+ RPAR atomic_formula_skeleton: LPAR NAME typed_list_variable RPAR atomic_function_skeleton: LPAR NAME typed_list_variable RPAR + | LPAR TOTAL_COST RPAR ?structure_def: action_def | derived_predicates action_def: LPAR ACTION NAME PARAMETERS action_parameters action_body_def RPAR @@ -115,6 +116,7 @@ type_def: LPAR EITHER primitive_type+ RPAR %import .common.NUMBER -> NUMBER %import .common.INCREASE -> INCREASE %import .common.DECREASE -> DECREASE +%import .common.TOTAL_COST -> TOTAL_COST %import .common.LPAR -> LPAR %import .common.RPAR -> RPAR %import .common.TYPE_SEP -> TYPE_SEP diff --git a/pddl/parser/domain.py b/pddl/parser/domain.py index c415598a..a26084d7 100644 --- a/pddl/parser/domain.py +++ b/pddl/parser/domain.py @@ -32,6 +32,7 @@ Increase, LesserEqualThan, LesserThan, + TotalCost, ) from pddl.logic.predicates import DerivedPredicate, EqualTo, Predicate from pddl.logic.terms import Constant, Variable @@ -340,6 +341,10 @@ def atomic_formula_skeleton(self, args): def atomic_function_skeleton(self, args): """Process the 'atomic_function_skeleton' rule.""" + if args[1] == Symbols.TOTAL_COST.value: + if not bool({Requirements.ACTION_COSTS}): + raise PDDLMissingRequirementError(Requirements.ACTION_COSTS) + return TotalCost() function_name = args[1] variables = self._formula_skeleton(args) return Function(function_name, *variables) diff --git a/pddl/parser/problem.lark b/pddl/parser/problem.lark index 705e78ee..4abf77f3 100644 --- a/pddl/parser/problem.lark +++ b/pddl/parser/problem.lark @@ -1,6 +1,6 @@ start: problem -problem: LPAR DEFINE problem_def problem_domain [problem_requirements] [objects] init goal RPAR +problem: LPAR DEFINE problem_def problem_domain [problem_requirements] [objects] init goal [metric_spec] RPAR problem_def: LPAR PROBLEM NAME RPAR problem_domain: LPAR DOMAIN_P NAME RPAR @@ -34,6 +34,11 @@ gd_name: atomic_formula_name f_head: NAME | LPAR NAME term* RPAR +metric_spec: LPAR METRIC optimization basic_function_term RPAR + +?optimization: MAXIMIZE + | MINIMIZE + DOMAIN_P: ":domain" PROBLEM: "problem" OBJECTS: ":objects" @@ -70,6 +75,9 @@ GOAL: ":goal" %import .common.GREATER_EQUAL_OP -> GREATER_EQUAL_OP %import .common.LESSER_OP -> LESSER_OP %import .common.LESSER_EQUAL_OP -> LESSER_EQUAL_OP +%import .common.METRIC -> METRIC +%import .common.MAXIMIZE -> MAXIMIZE +%import .common.MINIMIZE -> MINIMIZE %import .common.TYPING -> TYPING %import .common.EQUALITY -> EQUALITY %import .common.STRIPS -> STRIPS diff --git a/pddl/parser/problem.py b/pddl/parser/problem.py index c87b22a2..5d01f814 100644 --- a/pddl/parser/problem.py +++ b/pddl/parser/problem.py @@ -27,6 +27,7 @@ GreaterThan, LesserEqualThan, LesserThan, + Metric, ) from pddl.logic.predicates import EqualTo, Predicate from pddl.logic.terms import Constant, Variable @@ -190,6 +191,15 @@ def f_head(self, args): variables = [Variable(x, {}) for x in args[2:-1]] return Function(function_name, *variables) + def metric_spec(self, args): + """Process the 'metric_spec' rule.""" + if isinstance(args[3], list) and len(args[3]) == 1: + return "metric", Metric(*args[3], args[2]) + elif not isinstance(args[2], list): + return "metric", Metric(args[3], args[2]) + else: + raise ParseError + _problem_parser_lark = PROBLEM_GRAMMAR_FILE.read_text() From 004b84289ccdab58c45388424646814357b3e61d Mon Sep 17 00:00:00 2001 From: Francesco Fuggitti Date: Mon, 9 Oct 2023 12:54:54 -0400 Subject: [PATCH 24/65] add total cost and metric classes, and fix formatting issues --- pddl/custom_types.py | 3 +- pddl/formatter.py | 1 + pddl/logic/functions.py | 63 +++++++++++++++++++++++++++++++++++++++++ pddl/parser/symbols.py | 3 ++ pddl/requirements.py | 1 + 5 files changed, 70 insertions(+), 1 deletion(-) diff --git a/pddl/custom_types.py b/pddl/custom_types.py index 9b4cbaf2..ebfca087 100644 --- a/pddl/custom_types.py +++ b/pddl/custom_types.py @@ -100,7 +100,8 @@ def to_types(names: Dict[namelike, Optional[namelike]]) -> Dict[name, Optional[n def _is_a_keyword(word: str, ignore: Optional[AbstractSet[str]] = None) -> bool: """Check that the word is not a keyword.""" ignore_set = ensure_set(ignore) - return word not in ignore_set and word in ALL_SYMBOLS + # we remove the TOTAL_COST because it is not a keyword but a special function + return word not in ignore_set and word in ALL_SYMBOLS - {Symbols.TOTAL_COST.value} def _check_not_a_keyword( diff --git a/pddl/formatter.py b/pddl/formatter.py index b64cf401..da424596 100644 --- a/pddl/formatter.py +++ b/pddl/formatter.py @@ -157,6 +157,7 @@ def problem_to_string(problem: Problem) -> str: "(:init ", problem.init, ")\n", is_mandatory=True ) body += f"{'(:goal ' + str(problem.goal) + ')'}\n" + body += f"{'(:metric ' + str(problem.metric) + ')'}\n" if problem.metric else "" result = result + "\n" + indent(body, indentation) + "\n)" result = _remove_empty_lines(result) return result diff --git a/pddl/logic/functions.py b/pddl/logic/functions.py index 92191644..f04fed0b 100644 --- a/pddl/logic/functions.py +++ b/pddl/logic/functions.py @@ -89,6 +89,69 @@ def __lt__(self, other): return super().__lt__(other) +class TotalCost(Function): + """A class for the total-cost function in PDDL.""" + + def __init__(self): + """Initialize the function.""" + super().__init__("total-cost") + + +class Metric(Atomic): + """A class for the metric function in PDDL.""" + + MINIMIZE = "minimize" + MAXIMIZE = "maximize" + + def __init__(self, function: Function, optimization: str = MINIMIZE): + """ + Initialize the metric function. + + :param function: function to minimize or maximize. + :param optimization: whether to minimize or maximize the function. + """ + self._function = function + self._optimization = optimization + self._validate() + + @property + def function(self) -> Function: + """Get the function.""" + return self._function + + @property + def optimization(self) -> str: + """Get the optimization.""" + return self._optimization + + def _validate(self): + """Validate the metric.""" + assert_( + self.optimization in {self.MAXIMIZE, self.MINIMIZE}, + "Optimization metric not recognized.", + ) + + def __str__(self) -> str: + """Get the string representation.""" + return f"{self.optimization} {self.function}" + + def __repr__(self) -> str: + """Get an unambiguous string representation.""" + return f"{type(self).__name__}({self.function}, {self.optimization})" + + def __eq__(self, other): + """Override equal operator.""" + return ( + isinstance(other, Metric) + and self.function == other.function + and self.optimization == other.optimization + ) + + def __hash__(self): + """Get the hash of a Metric.""" + return hash((self.function, self.optimization)) + + class FunctionOperator(Atomic): """Operator for to numerical fluent.""" diff --git a/pddl/parser/symbols.py b/pddl/parser/symbols.py index 53a5d298..02176bb4 100644 --- a/pddl/parser/symbols.py +++ b/pddl/parser/symbols.py @@ -50,6 +50,7 @@ class Symbols(Enum): PROBLEM = "problem" REQUIREMENTS = ":requirements" TYPES = ":types" + METRIC = ":metric" WHEN = "when" GREATER_EQUAL = ">=" GREATER = ">" @@ -58,6 +59,7 @@ class Symbols(Enum): ASSIGN = "assign" INCREASE = "increase" DECREASE = "decrease" + TOTAL_COST = "total-cost" ALL_SYMBOLS: Set[str] = {v.value for v in Symbols} @@ -83,6 +85,7 @@ class RequirementSymbols(Enum): NON_DETERMINISTIC = ":non-deterministic" FLUENTS = ":fluents" NUMERIC_FLUENTS = ":numeric-fluents" + ACTION_COSTS = ":action-costs" def strip(self) -> str: """Strip the leading colon.""" diff --git a/pddl/requirements.py b/pddl/requirements.py index 73365652..92b8164d 100644 --- a/pddl/requirements.py +++ b/pddl/requirements.py @@ -36,6 +36,7 @@ class Requirements(Enum): NON_DETERMINISTIC = RS.NON_DETERMINISTIC.strip() FLUENTS = RS.FLUENTS.strip() NUMERIC_FLUENTS = RS.NUMERIC_FLUENTS.strip() + ACTION_COSTS = RS.ACTION_COSTS.strip() @classmethod def quantified_precondition_requirements(cls) -> Set["Requirements"]: From 3e9f10e077ab96106f15679a0f8f99753826fc41 Mon Sep 17 00:00:00 2001 From: Francesco Fuggitti Date: Mon, 9 Oct 2023 13:03:53 -0400 Subject: [PATCH 25/65] update vulture whitelist.py --- scripts/whitelist.py | 70 +++++++++++++++++++++++--------------------- 1 file changed, 36 insertions(+), 34 deletions(-) diff --git a/scripts/whitelist.py b/scripts/whitelist.py index 35db1627..6b2fcb53 100644 --- a/scripts/whitelist.py +++ b/scripts/whitelist.py @@ -19,39 +19,40 @@ PEffect # unused variable (pddl/logic/effects.py:168) Effect # unused variable (pddl/logic/effects.py:170) CondEffect # unused variable (pddl/logic/effects.py:171) -AssignTo # unused class (pddl/logic/functions.py:209) -_._predicates_by_name # unused attribute (pddl/parser/domain.py:52) -_._functions_by_name # unused attribute (pddl/parser/domain.py:53) -_.start # unused method (pddl/parser/domain.py:58) -_.domain_def # unused method (pddl/parser/domain.py:79) -_._predicates_by_name # unused attribute (pddl/parser/domain.py:109) -_._functions_by_name # unused attribute (pddl/parser/domain.py:115) -_.action_def # unused method (pddl/parser/domain.py:118) -_.action_parameters # unused method (pddl/parser/domain.py:136) -_.emptyor_pregd # unused method (pddl/parser/domain.py:143) -_.gd # unused method (pddl/parser/domain.py:226) -_.emptyor_effect # unused method (pddl/parser/domain.py:243) -_.c_effect # unused method (pddl/parser/domain.py:258) -_.p_effect # unused method (pddl/parser/domain.py:273) -_.cond_effect # unused method (pddl/parser/domain.py:280) -_.num_effect # unused method (pddl/parser/domain.py:288) -_.atomic_formula_term # unused method (pddl/parser/domain.py:298) -_.atomic_formula_skeleton # unused method (pddl/parser/domain.py:335) -_.atomic_function_skeleton # unused method (pddl/parser/domain.py:341) -_.f_head # unused method (pddl/parser/domain.py:347) -_.typed_list_variable # unused method (pddl/parser/domain.py:363) -_.type_def # unused method (pddl/parser/domain.py:386) -_.start # unused method (pddl/parser/problem.py:49) -_.problem_def # unused method (pddl/parser/problem.py:62) -_.problem_domain # unused method (pddl/parser/problem.py:66) -_.problem_requirements # unused method (pddl/parser/problem.py:70) -_.domain__type_def # unused method (pddl/parser/problem.py:93) -_.init_el # unused method (pddl/parser/problem.py:107) -_.literal_name # unused method (pddl/parser/problem.py:120) -_.basic_function_term # unused method (pddl/parser/problem.py:129) -_.gd_name # unused method (pddl/parser/problem.py:156) -_.atomic_formula_name # unused method (pddl/parser/problem.py:169) -_.f_head # unused method (pddl/parser/problem.py:185) +AssignTo # unused class (pddl/logic/functions.py:271) +_._predicates_by_name # unused attribute (pddl/parser/domain.py:53) +_._functions_by_name # unused attribute (pddl/parser/domain.py:54) +_.start # unused method (pddl/parser/domain.py:59) +_.domain_def # unused method (pddl/parser/domain.py:80) +_._predicates_by_name # unused attribute (pddl/parser/domain.py:110) +_._functions_by_name # unused attribute (pddl/parser/domain.py:116) +_.action_def # unused method (pddl/parser/domain.py:119) +_.action_parameters # unused method (pddl/parser/domain.py:137) +_.emptyor_pregd # unused method (pddl/parser/domain.py:144) +_.gd # unused method (pddl/parser/domain.py:227) +_.emptyor_effect # unused method (pddl/parser/domain.py:244) +_.c_effect # unused method (pddl/parser/domain.py:259) +_.p_effect # unused method (pddl/parser/domain.py:274) +_.cond_effect # unused method (pddl/parser/domain.py:281) +_.num_effect # unused method (pddl/parser/domain.py:289) +_.atomic_formula_term # unused method (pddl/parser/domain.py:299) +_.atomic_formula_skeleton # unused method (pddl/parser/domain.py:336) +_.atomic_function_skeleton # unused method (pddl/parser/domain.py:342) +_.f_head # unused method (pddl/parser/domain.py:352) +_.typed_list_variable # unused method (pddl/parser/domain.py:368) +_.type_def # unused method (pddl/parser/domain.py:391) +_.start # unused method (pddl/parser/problem.py:50) +_.problem_def # unused method (pddl/parser/problem.py:63) +_.problem_domain # unused method (pddl/parser/problem.py:67) +_.problem_requirements # unused method (pddl/parser/problem.py:71) +_.domain__type_def # unused method (pddl/parser/problem.py:94) +_.init_el # unused method (pddl/parser/problem.py:108) +_.literal_name # unused method (pddl/parser/problem.py:121) +_.basic_function_term # unused method (pddl/parser/problem.py:130) +_.gd_name # unused method (pddl/parser/problem.py:157) +_.atomic_formula_name # unused method (pddl/parser/problem.py:170) +_.f_head # unused method (pddl/parser/problem.py:186) +_.metric_spec # unused method (pddl/parser/problem.py:194) OpSymbol # unused variable (pddl/parser/symbols.py:17) OpRequirement # unused variable (pddl/parser/symbols.py:18) ROUND_BRACKET_LEFT # unused variable (pddl/parser/symbols.py:24) @@ -71,4 +72,5 @@ PROBLEM # unused variable (pddl/parser/symbols.py:50) REQUIREMENTS # unused variable (pddl/parser/symbols.py:51) TYPES # unused variable (pddl/parser/symbols.py:52) -ALL_REQUIREMENTS # unused variable (pddl/parser/symbols.py:92) +METRIC # unused variable (pddl/parser/symbols.py:53) +ALL_REQUIREMENTS # unused variable (pddl/parser/symbols.py:95) From bbcf49cfa9b69bb5e463bfcc08ccde8c6b1d0a3f Mon Sep 17 00:00:00 2001 From: Francesco Fuggitti Date: Mon, 9 Oct 2023 15:57:41 -0400 Subject: [PATCH 26/65] add consistency check on actions costs and total-cost --- pddl/core.py | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/pddl/core.py b/pddl/core.py index 7a7e7be8..eb8b4cab 100644 --- a/pddl/core.py +++ b/pddl/core.py @@ -26,12 +26,13 @@ from pddl.action import Action from pddl.custom_types import name as name_type from pddl.custom_types import namelike, parse_name, to_names, to_types # noqa: F401 +from pddl.exceptions import PDDLValidationError from pddl.helpers.base import assert_, check, ensure, ensure_set from pddl.logic.base import And, Formula, is_literal -from pddl.logic.functions import Function, Metric +from pddl.logic.functions import Function, Metric, TotalCost from pddl.logic.predicates import DerivedPredicate, Predicate from pddl.logic.terms import Constant -from pddl.requirements import Requirements +from pddl.requirements import Requirements, _extend_domain_requirements class Domain: @@ -75,12 +76,13 @@ def __init__( def _check_consistency(self) -> None: """Check consistency of a domain instance object.""" - checker = TypeChecker(self._types, self.requirements) - checker.check_type(self._constants) - checker.check_type(self._predicates) - checker.check_type(self._actions) + type_checker = TypeChecker(self._types, self.requirements) + type_checker.check_type(self._constants) + type_checker.check_type(self._predicates) + type_checker.check_type(self._actions) _check_types_in_has_terms_objects(self._actions, self._types.all_types) # type: ignore self._check_types_in_derived_predicates() + self._check_action_costs_requirement() def _check_types_in_derived_predicates(self) -> None: """Check types in derived predicates.""" @@ -91,6 +93,15 @@ def _check_types_in_derived_predicates(self) -> None: ) _check_types_in_has_terms_objects(dp_list, self._types.all_types) + def _check_action_costs_requirement(self) -> None: + """Check that the action-costs requirement is specified.""" + if not ( + Requirements.ACTION_COSTS in _extend_domain_requirements(self._requirements) + ) and any(isinstance(f, TotalCost) for f in self._functions): + raise PDDLValidationError( + f"action costs requirement is not specified, but the total-cost function is specified." + ) + @property def name(self) -> name_type: """Get the name.""" From 8a215e3132782ed7bd3c71d88a1cf6e89a28970a Mon Sep 17 00:00:00 2001 From: Francesco Fuggitti Date: Mon, 9 Oct 2023 17:40:01 -0400 Subject: [PATCH 27/65] add some tests --- tests/test_functions.py | 86 +++++++++++++++++++++++++++++++++++++++-- tests/test_predicate.py | 2 +- 2 files changed, 84 insertions(+), 4 deletions(-) diff --git a/tests/test_functions.py b/tests/test_functions.py index 5548d11b..d9c6ce88 100644 --- a/tests/test_functions.py +++ b/tests/test_functions.py @@ -11,21 +11,24 @@ # """This module contains tests for PDDL functions.""" +import pytest + from pddl.core import Function +from pddl.logic.functions import TotalCost, Metric from pddl.logic.helpers import variables -class TestFunctionsimpleInitialisation: +class TestFunctionSimpleInitialisation: """Test simple function initialisation.""" def setup_method(self): """Set up the tests.""" self.a, self.b = variables("a b") - self.function = Function("P", self.a, self.b) + self.function = Function("f", self.a, self.b) def test_name(self): """Test name getter.""" - assert self.function.name == "P" + assert self.function.name == "f" def test_variables(self): """Test terms getter.""" @@ -34,3 +37,80 @@ def test_variables(self): def test_arity(self): """Test arity property.""" assert self.function.arity == 2 + + def test_to_equal(self): + """Test to equal.""" + other = Function("f", self.a, self.b) + assert self.function == other + + def test_to_str(self): + """Test to string.""" + assert str(self.function) == f"({self.function.name} {self.a} {self.b})" + + def test_to_repr(self): + """Test to repr.""" + assert ( + repr(self.function) == f"Function({self.function.name}, {self.a}, {self.b})" + ) + + +class TestTotalCost: + """Test total cost function.""" + + def setup_method(self): + """Set up the tests.""" + self.predicate = TotalCost() + + def test_name(self): + """Test name getter.""" + assert self.predicate.name == "total-cost" + + +class TestMetric: + """Test metric.""" + + def setup_method(self): + """Set up the tests.""" + self.a, self.b = variables("a b") + self.function = Function("f", self.a, self.b) + self.maximize_metric = Metric(self.function, Metric.MAXIMIZE) + self.minimize_metric = Metric(self.function, Metric.MINIMIZE) + + def test_function_maximize(self): + """Test function getter for maximize metric.""" + assert self.maximize_metric.function == self.function + + def test_function_minimize(self): + """Test function getter for minimize metric.""" + assert self.minimize_metric.function == self.function + + def test_optimization_maximize(self): + """Test optimization getter for maximize metric.""" + assert self.maximize_metric.optimization == Metric.MAXIMIZE + + def test_optimization_minimize(self): + """Test optimization getter for minimize metric.""" + assert self.minimize_metric.optimization == Metric.MINIMIZE + + def test_wrong_optimization(self): + """Test wrong optimization.""" + with pytest.raises( + AssertionError, + match="Optimization metric not recognized.", + ): + Metric(self.function, "other") + + def test_to_equal(self): + """Test to equal.""" + other = Metric(Function("f", self.a, self.b), Metric.MINIMIZE) + assert self.minimize_metric == other + + def test_to_str(self): + """Test to string.""" + assert str(self.maximize_metric) == f"{self.maximize_metric.optimization} {self.maximize_metric.function}" + + def test_to_repr(self): + """Test to repr.""" + assert ( + repr(self.minimize_metric) == f"Metric(({self.function.name} {self.a} {self.b}), minimize)" + ) diff --git a/tests/test_predicate.py b/tests/test_predicate.py index 63002bd8..3f708161 100644 --- a/tests/test_predicate.py +++ b/tests/test_predicate.py @@ -55,7 +55,7 @@ def test_to_repr(self): class TestEqualToPredicate: - """Test the eaual to predicate.""" + """Test the equal to predicate.""" def setup_method(self): """Set up the tests.""" From 7e3ad074bbbae6e2b0bc7e6c7b592bac3ba1a6b0 Mon Sep 17 00:00:00 2001 From: Francesco Fuggitti Date: Mon, 9 Oct 2023 17:40:51 -0400 Subject: [PATCH 28/65] apply style --- tests/test_functions.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/test_functions.py b/tests/test_functions.py index d9c6ce88..73db7393 100644 --- a/tests/test_functions.py +++ b/tests/test_functions.py @@ -14,7 +14,7 @@ import pytest from pddl.core import Function -from pddl.logic.functions import TotalCost, Metric +from pddl.logic.functions import Metric, TotalCost from pddl.logic.helpers import variables @@ -107,10 +107,14 @@ def test_to_equal(self): def test_to_str(self): """Test to string.""" - assert str(self.maximize_metric) == f"{self.maximize_metric.optimization} {self.maximize_metric.function}" + assert ( + str(self.maximize_metric) + == f"{self.maximize_metric.optimization} {self.maximize_metric.function}" + ) def test_to_repr(self): """Test to repr.""" assert ( - repr(self.minimize_metric) == f"Metric(({self.function.name} {self.a} {self.b}), minimize)" + repr(self.minimize_metric) + == f"Metric(({self.function.name} {self.a} {self.b}), minimize)" ) From 53a106e798d86d12b75bbaacf17cf2ec55ad587a Mon Sep 17 00:00:00 2001 From: Francesco Fuggitti Date: Mon, 9 Oct 2023 17:48:14 -0400 Subject: [PATCH 29/65] fix linting --- pddl/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pddl/core.py b/pddl/core.py index eb8b4cab..6946a88a 100644 --- a/pddl/core.py +++ b/pddl/core.py @@ -99,7 +99,7 @@ def _check_action_costs_requirement(self) -> None: Requirements.ACTION_COSTS in _extend_domain_requirements(self._requirements) ) and any(isinstance(f, TotalCost) for f in self._functions): raise PDDLValidationError( - f"action costs requirement is not specified, but the total-cost function is specified." + "action costs requirement is not specified, but the total-cost function is specified." ) @property From 92b0113301a99b10b946488f9549ec39c97639a0 Mon Sep 17 00:00:00 2001 From: Francesco Fuggitti Date: Mon, 9 Oct 2023 18:50:55 -0400 Subject: [PATCH 30/65] add some further tests --- tests/conftest.py | 15 +++----- tests/test_function.py | 42 ++++++++++++++++++++++ tests/test_function_operators.py | 60 ++++++++++++++++++++++++++++++++ tests/test_parser/test_domain.py | 24 +++++++++++++ 4 files changed, 131 insertions(+), 10 deletions(-) create mode 100644 tests/test_function.py create mode 100644 tests/test_function_operators.py diff --git a/tests/conftest.py b/tests/conftest.py index 970f99e1..b1dc0187 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -37,10 +37,9 @@ TRIANGLE_FILES = FIXTURES_PDDL_FILES / "triangle-tireworld" BLOCKSWORLD_FOND_FILES = FIXTURES_PDDL_FILES / "blocksworld_fond" -# TODO once missing features are supported, uncomment this -# DOMAIN_FILES = [ -# *FIXTURES_PDDL_FILES.glob("./**/domain.pddl") -# ] +DOMAIN_FILES = [ + *FIXTURES_PDDL_FILES.glob("./**/domain.pddl") +] DOMAIN_NAMES = [ "acrobatics", @@ -48,10 +47,10 @@ "blocksworld-ipc08", "blocksworld_fond", "doors", - # "earth_observation", + "earth_observation", "elevators", # "faults-ipc08", - # "first-responders-ipc08", + "first-responders-ipc08", "islands", "maintenance-sequential-satisficing-ipc2014", "miner", @@ -65,10 +64,6 @@ "hello-world-functions", ] -DOMAIN_FILES = [ - FIXTURES_PDDL_FILES / domain_name / "domain.pddl" for domain_name in DOMAIN_NAMES -] - PROBLEM_FILES = list( itertools.chain( *[ diff --git a/tests/test_function.py b/tests/test_function.py new file mode 100644 index 00000000..56f09376 --- /dev/null +++ b/tests/test_function.py @@ -0,0 +1,42 @@ +# +# Copyright 2021-2023 WhiteMech +# +# ------------------------------ +# +# This file is part of pddl. +# +# Use of this source code is governed by an MIT-style +# license that can be found in the LICENSE file or at +# https://opensource.org/licenses/MIT. +# +"""This module contains tests for a PDDL function.""" + +from pddl.logic import variables +from pddl.logic.functions import Function + + +class TestFunctionEmpty: + """Test the empty function.""" + + def setup_method(self): + """Set up the tests.""" + self.function = Function("empty_function") + + def test_name(self): + """Test the name getter.""" + assert self.function.name == "empty_function" + + def test_terms(self): + """Test the parameters getter.""" + assert self.function.terms == () + + def test_arity(self): + """Test the arity getter.""" + assert self.function.arity == 0 + + +def test_build_simple_function(): + """Test a simple PDDL action.""" + x, y, z = variables("x y z", types=["type1"]) + function = Function("simple_function", x, y, z) + assert function diff --git a/tests/test_function_operators.py b/tests/test_function_operators.py new file mode 100644 index 00000000..05031191 --- /dev/null +++ b/tests/test_function_operators.py @@ -0,0 +1,60 @@ +# +# Copyright 2021-2023 WhiteMech +# +# ------------------------------ +# +# This file is part of pddl. +# +# Use of this source code is governed by an MIT-style +# license that can be found in the LICENSE file or at +# https://opensource.org/licenses/MIT. +# +"""This module contains tests for PDDL function operators.""" +from pddl.parser.symbols import Symbols + +from pddl.logic import variables +from pddl.logic.functions import Function, FunctionOperator + + +class TestFunctionOperators: + """Test the function operators.""" + + def setup_method(self): + """Set up the tests.""" + x, y = variables("x y", types=["type1"]) + z = variables("z", types=["type2"]) + self.function = Function("function_1") + self.function_op = FunctionOperator( + self.function, + 3, + Symbols.EQUAL + ) + + def test_function(self): + """Test the function getter.""" + assert self.function_op.function == self.function + + def test_symbol(self): + """Test the symbol getter.""" + assert self.function_op.symbol == Symbols.EQUAL.value + + def test_value(self): + """Test the value getter.""" + assert self.function_op.value == 3 + + def test_equal(self): + """Test the equal operator.""" + other = FunctionOperator( + self.function, + 3, + Symbols.EQUAL.value + ) + assert self.function_op == other + + def test_str(self): + """Test the str operator.""" + assert str(self.function_op) == f"({self.function_op.symbol.value} {self.function} {self.function_op.value})" + + def test_repr(self): + """Test the repr operator.""" + assert repr(self.function_op) == f"FunctionOperator({self.function}, {self.function_op.value})" diff --git a/tests/test_parser/test_domain.py b/tests/test_parser/test_domain.py index c193b651..b49dd88a 100644 --- a/tests/test_parser/test_domain.py +++ b/tests/test_parser/test_domain.py @@ -293,3 +293,27 @@ def test_variables_repetition_allowed_if_same_type() -> None: """ ) DomainParser()(domain_str) + + +def test_check_action_costs_requirement_with_total_cost() -> None: + """Check action costs requirement when total-cost is specified.""" + domain_str = dedent( + """ + (define (domain test) + (:requirements :typing) + (:types t1 t2) + (:predicates (p ?x - t1 ?y - t2)) + (:functions (total-cost)) + (:action a + :parameters (?x - t1 ?y - t2) + :precondition (and (p ?x ?x)) + :effect (p ?x ?x) + ) + ) + """ + ) + with pytest.raises( + lark.exceptions.VisitError, + match=r"action costs requirement is not specified, but the total-cost function is specified.", + ): + DomainParser()(domain_str) From ec335890d7e54ab881e977d32ea5c5526fc459f1 Mon Sep 17 00:00:00 2001 From: Francesco Fuggitti Date: Mon, 9 Oct 2023 18:51:54 -0400 Subject: [PATCH 31/65] apply style --- tests/conftest.py | 4 +--- tests/test_function_operators.py | 27 ++++++++++++--------------- 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index b1dc0187..ed1f73c6 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -37,9 +37,7 @@ TRIANGLE_FILES = FIXTURES_PDDL_FILES / "triangle-tireworld" BLOCKSWORLD_FOND_FILES = FIXTURES_PDDL_FILES / "blocksworld_fond" -DOMAIN_FILES = [ - *FIXTURES_PDDL_FILES.glob("./**/domain.pddl") -] +DOMAIN_FILES = [*FIXTURES_PDDL_FILES.glob("./**/domain.pddl")] DOMAIN_NAMES = [ "acrobatics", diff --git a/tests/test_function_operators.py b/tests/test_function_operators.py index 05031191..a7d2b330 100644 --- a/tests/test_function_operators.py +++ b/tests/test_function_operators.py @@ -10,10 +10,9 @@ # https://opensource.org/licenses/MIT. # """This module contains tests for PDDL function operators.""" -from pddl.parser.symbols import Symbols - from pddl.logic import variables from pddl.logic.functions import Function, FunctionOperator +from pddl.parser.symbols import Symbols class TestFunctionOperators: @@ -23,12 +22,8 @@ def setup_method(self): """Set up the tests.""" x, y = variables("x y", types=["type1"]) z = variables("z", types=["type2"]) - self.function = Function("function_1") - self.function_op = FunctionOperator( - self.function, - 3, - Symbols.EQUAL - ) + self.function = Function("function_1", x, y, z) + self.function_op = FunctionOperator(self.function, 3, Symbols.EQUAL) def test_function(self): """Test the function getter.""" @@ -44,17 +39,19 @@ def test_value(self): def test_equal(self): """Test the equal operator.""" - other = FunctionOperator( - self.function, - 3, - Symbols.EQUAL.value - ) + other = FunctionOperator(self.function, 3, Symbols.EQUAL.value) assert self.function_op == other def test_str(self): """Test the str operator.""" - assert str(self.function_op) == f"({self.function_op.symbol.value} {self.function} {self.function_op.value})" + assert ( + str(self.function_op) + == f"({self.function_op.symbol.value} {self.function} {self.function_op.value})" + ) def test_repr(self): """Test the repr operator.""" - assert repr(self.function_op) == f"FunctionOperator({self.function}, {self.function_op.value})" + assert ( + repr(self.function_op) + == f"FunctionOperator({self.function}, {self.function_op.value})" + ) From 8b91ec0110a4782e519093d0c4ff96aa3d4bfe56 Mon Sep 17 00:00:00 2001 From: Francesco Fuggitti Date: Tue, 10 Oct 2023 15:51:29 -0400 Subject: [PATCH 32/65] fix issue #93 and update test, fix other test on function operators --- pddl/formatter.py | 2 ++ tests/test_formatter.py | 1 - tests/test_function_operators.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pddl/formatter.py b/pddl/formatter.py index da424596..be6957b3 100644 --- a/pddl/formatter.py +++ b/pddl/formatter.py @@ -48,6 +48,8 @@ def _print_types_with_parents( name_by_type: Dict[Optional[name], List[name]] = {} for type_name, parent_type in types_dict.items(): name_by_type.setdefault(parent_type, []).append(type_name) + if not bool(name_by_type): + return "" return _print_typed_lists(prefix, name_by_type, postfix, to_string) diff --git a/tests/test_formatter.py b/tests/test_formatter.py index 02875180..2a3718a8 100644 --- a/tests/test_formatter.py +++ b/tests/test_formatter.py @@ -132,7 +132,6 @@ def test_numerical_hello_world_domain_formatter(): ( "(define (domain hello-world-functions)", " (:requirements :fluents :strips)", - " (:types)\n" " (:constants)\n" " (:functions (hello_counter ?neighbor))", " (:action say-hello-world", diff --git a/tests/test_function_operators.py b/tests/test_function_operators.py index a7d2b330..09d88ae5 100644 --- a/tests/test_function_operators.py +++ b/tests/test_function_operators.py @@ -31,7 +31,7 @@ def test_function(self): def test_symbol(self): """Test the symbol getter.""" - assert self.function_op.symbol == Symbols.EQUAL.value + assert self.function_op.symbol == Symbols.EQUAL def test_value(self): """Test the value getter.""" From acca31fe4f1fcab4dc9e3edd7c8674de5a4abb4b Mon Sep 17 00:00:00 2001 From: Francesco Fuggitti Date: Tue, 10 Oct 2023 16:27:20 -0400 Subject: [PATCH 33/65] adjust the metric class to handle multiple functions --- pddl/logic/functions.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/pddl/logic/functions.py b/pddl/logic/functions.py index f04fed0b..8ddf0442 100644 --- a/pddl/logic/functions.py +++ b/pddl/logic/functions.py @@ -12,7 +12,7 @@ """This class implements PDDL functions.""" import functools -from typing import Sequence +from typing import Sequence, Collection from pddl.custom_types import namelike, parse_name from pddl.helpers.base import assert_ @@ -103,21 +103,21 @@ class Metric(Atomic): MINIMIZE = "minimize" MAXIMIZE = "maximize" - def __init__(self, function: Function, optimization: str = MINIMIZE): + def __init__(self, functions: Collection[Function], optimization: str = MINIMIZE): """ Initialize the metric function. - :param function: function to minimize or maximize. + :param functions: functions to minimize or maximize. :param optimization: whether to minimize or maximize the function. """ - self._function = function + self._functions = functions self._optimization = optimization self._validate() @property - def function(self) -> Function: - """Get the function.""" - return self._function + def functions(self) -> Collection[Function]: + """Get the functions.""" + return self._functions @property def optimization(self) -> str: @@ -133,23 +133,23 @@ def _validate(self): def __str__(self) -> str: """Get the string representation.""" - return f"{self.optimization} {self.function}" + return f"{self.optimization} {' '.join(map(str, self.functions))}" def __repr__(self) -> str: """Get an unambiguous string representation.""" - return f"{type(self).__name__}({self.function}, {self.optimization})" + return f"{type(self).__name__}({*self.functions,}, {self.optimization})" def __eq__(self, other): """Override equal operator.""" return ( isinstance(other, Metric) - and self.function == other.function + and self.functions == other.functions and self.optimization == other.optimization ) def __hash__(self): """Get the hash of a Metric.""" - return hash((self.function, self.optimization)) + return hash((self.functions, self.optimization)) class FunctionOperator(Atomic): From 86d99d18d023d63aee8a504aa01b0872a31785f8 Mon Sep 17 00:00:00 2001 From: Francesco Fuggitti Date: Tue, 10 Oct 2023 18:51:46 -0400 Subject: [PATCH 34/65] add check for the numeric fluents requirement when functions are specified --- pddl/core.py | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/pddl/core.py b/pddl/core.py index 6946a88a..2aa67b44 100644 --- a/pddl/core.py +++ b/pddl/core.py @@ -26,7 +26,6 @@ from pddl.action import Action from pddl.custom_types import name as name_type from pddl.custom_types import namelike, parse_name, to_names, to_types # noqa: F401 -from pddl.exceptions import PDDLValidationError from pddl.helpers.base import assert_, check, ensure, ensure_set from pddl.logic.base import And, Formula, is_literal from pddl.logic.functions import Function, Metric, TotalCost @@ -82,7 +81,7 @@ def _check_consistency(self) -> None: type_checker.check_type(self._actions) _check_types_in_has_terms_objects(self._actions, self._types.all_types) # type: ignore self._check_types_in_derived_predicates() - self._check_action_costs_requirement() + self._check_numeric_fluent_requirements() def _check_types_in_derived_predicates(self) -> None: """Check types in derived predicates.""" @@ -93,14 +92,19 @@ def _check_types_in_derived_predicates(self) -> None: ) _check_types_in_has_terms_objects(dp_list, self._types.all_types) - def _check_action_costs_requirement(self) -> None: - """Check that the action-costs requirement is specified.""" - if not ( - Requirements.ACTION_COSTS in _extend_domain_requirements(self._requirements) - ) and any(isinstance(f, TotalCost) for f in self._functions): - raise PDDLValidationError( - "action costs requirement is not specified, but the total-cost function is specified." + def _check_numeric_fluent_requirements(self) -> None: + """Check that the numeric-fluents requirement is specified.""" + if self._functions: + validate( + Requirements.NUMERIC_FLUENTS + in _extend_domain_requirements(self._requirements), + "numeric-fluents requirement is not specified, but numeric fluents are specified.", ) + if any(isinstance(f, TotalCost) for f in self._functions): + validate( + Requirements.ACTION_COSTS in self._requirements, + "action costs requirement is not specified, but the total-cost function is specified.", + ) @property def name(self) -> name_type: From 3edfa228b1f2258f34e837caf6831941f7699a26 Mon Sep 17 00:00:00 2001 From: Francesco Fuggitti Date: Tue, 10 Oct 2023 18:52:44 -0400 Subject: [PATCH 35/65] fix empty constants printing and apply style checks --- pddl/formatter.py | 3 ++- pddl/logic/functions.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pddl/formatter.py b/pddl/formatter.py index be6957b3..e95561c1 100644 --- a/pddl/formatter.py +++ b/pddl/formatter.py @@ -60,7 +60,8 @@ def _print_constants( term_by_type_tags: Dict[Optional[name], List[name]] = {} for c in constants: term_by_type_tags.setdefault(c.type_tag, []).append(c.name) - + if not bool(term_by_type_tags): + return "" return _print_typed_lists(prefix, term_by_type_tags, postfix, to_string) diff --git a/pddl/logic/functions.py b/pddl/logic/functions.py index 8ddf0442..6d9b1396 100644 --- a/pddl/logic/functions.py +++ b/pddl/logic/functions.py @@ -12,7 +12,7 @@ """This class implements PDDL functions.""" import functools -from typing import Sequence, Collection +from typing import Collection, Sequence from pddl.custom_types import namelike, parse_name from pddl.helpers.base import assert_ From 662e3d5c48529f3a226848c9af1e0f213788cf15 Mon Sep 17 00:00:00 2001 From: Francesco Fuggitti Date: Tue, 10 Oct 2023 18:53:21 -0400 Subject: [PATCH 36/65] fix empty constants printing and apply style checks --- pddl/formatter.py | 3 ++- pddl/logic/functions.py | 2 +- tests/test_formatter.py | 1 - 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pddl/formatter.py b/pddl/formatter.py index be6957b3..e95561c1 100644 --- a/pddl/formatter.py +++ b/pddl/formatter.py @@ -60,7 +60,8 @@ def _print_constants( term_by_type_tags: Dict[Optional[name], List[name]] = {} for c in constants: term_by_type_tags.setdefault(c.type_tag, []).append(c.name) - + if not bool(term_by_type_tags): + return "" return _print_typed_lists(prefix, term_by_type_tags, postfix, to_string) diff --git a/pddl/logic/functions.py b/pddl/logic/functions.py index 8ddf0442..6d9b1396 100644 --- a/pddl/logic/functions.py +++ b/pddl/logic/functions.py @@ -12,7 +12,7 @@ """This class implements PDDL functions.""" import functools -from typing import Sequence, Collection +from typing import Collection, Sequence from pddl.custom_types import namelike, parse_name from pddl.helpers.base import assert_ diff --git a/tests/test_formatter.py b/tests/test_formatter.py index 2a3718a8..add73a94 100644 --- a/tests/test_formatter.py +++ b/tests/test_formatter.py @@ -132,7 +132,6 @@ def test_numerical_hello_world_domain_formatter(): ( "(define (domain hello-world-functions)", " (:requirements :fluents :strips)", - " (:constants)\n" " (:functions (hello_counter ?neighbor))", " (:action say-hello-world", " :parameters (?neighbor)", From bedbeadf69753e2a6e92619d0bdc721a0d417ced Mon Sep 17 00:00:00 2001 From: Francesco Fuggitti Date: Tue, 10 Oct 2023 18:54:25 -0400 Subject: [PATCH 37/65] add some tests for building domains and problems with numeric fluents and action costs --- tests/test_domain.py | 114 ++++++++++++++++++++++++++++++++++++++++++ tests/test_problem.py | 65 ++++++++++++++++++++++++ 2 files changed, 179 insertions(+) diff --git a/tests/test_domain.py b/tests/test_domain.py index d8b11674..3ca0287c 100644 --- a/tests/test_domain.py +++ b/tests/test_domain.py @@ -20,8 +20,20 @@ from pddl.action import Action from pddl.core import Domain from pddl.exceptions import PDDLValidationError +from pddl.formatter import domain_to_string from pddl.logic import Constant, Variable from pddl.logic.base import And, Not +from pddl.logic.functions import Decrease +from pddl.logic.functions import EqualTo as FunctionEqualTo +from pddl.logic.functions import ( + Function, + GreaterEqualThan, + GreaterThan, + Increase, + LesserEqualThan, + LesserThan, + TotalCost, +) from pddl.logic.helpers import constants, variables from pddl.logic.predicates import DerivedPredicate, Predicate from pddl.parser.symbols import Symbols @@ -85,6 +97,108 @@ def test_build_simple_domain(): assert domain +def test_build_simple_domain_with_derived_predicates(): + """Test a simple PDDL domain with derived predicates.""" + x, y, z = variables("x y z") + p = Predicate("p", x, y, z) + q = Predicate("q") + r = Predicate("r") + dp = DerivedPredicate(p, And(q, r)) + action_1 = Action("action_1", [x, y, z], precondition=p, effect=Not(p)) + domain = Domain( + "simple_domain", + predicates={p}, + derived_predicates={dp}, + actions={action_1}, + ) + assert domain + + +def test_build_domain_with_numeric_fluents(): + """Test a PDDL domain with simple numeric fluents.""" + x, y, z = variables("x y z") + p = Predicate("p", x, y, z) + q = Predicate("q") + r = Predicate("r") + func1 = Function("f1", x, y) + func2 = Function("f2") + func3 = Function("f3") + action_1 = Action( + "action_1", + [x, y, z], + precondition=p + & FunctionEqualTo(func1, 0) + & GreaterThan(func2, 1) + & LesserThan(func3, 5), + effect=Not(p) | q, + ) + action_2 = Action( + "action_2", + [x, y, z], + precondition=r & GreaterEqualThan(func1, 1) & LesserEqualThan(func2, 5), + effect=Not(p) | q, + ) + domain = Domain( + "domain_with_numeric", + predicates={p}, + functions={func1, func2, func3}, + actions={action_1, action_2}, + ) + assert domain + + +def test_build_domain_with_action_cost(): + """Test a PDDL domain with action costs.""" + x, y, z = variables("x y z") + p = Predicate("p", x, y, z) + q = Predicate("q") + r = Predicate("r") + cost1 = Function("cost1", x, y) + cost2 = Function("cost2") + action_1 = Action( + "action_1", + [x, y, z], + precondition=p & FunctionEqualTo(cost1, 0) & GreaterThan(cost2, 1), + effect=Not(p) & Increase(cost1, 1), + ) + action_2 = Action( + "action_2", + [x, y, z], + precondition=r & GreaterEqualThan(cost1, 1), + effect=(Not(p) | q) & Decrease(cost2, 1), + ) + domain = Domain( + "domain_with_numeric", + predicates={p}, + functions={cost1, cost2}, + actions={action_1, action_2}, + ) + assert domain + + +def test_build_domain_with_total_cost(): + """Test a PDDL domain with total costs.""" + x, y, z = variables("x y z") + p = Predicate("p", x, y, z) + q = Predicate("q") + total_cost = TotalCost() + action_1 = Action( + "action_1", + [x, y, z], + precondition=p & q, + effect=Not(p) & Increase(total_cost, 1), + ) + domain = Domain( + "domain_with_total_cost", + requirements={Requirements.ACTION_COSTS}, + predicates={p}, + functions={total_cost}, + actions={action_1}, + ) + print(domain_to_string(domain)) + assert domain + + def test_cycles_in_type_defs_not_allowed() -> None: """Test that type defs with cycles are not allowed.""" with pytest.raises( diff --git a/tests/test_problem.py b/tests/test_problem.py index b0867476..5b086034 100644 --- a/tests/test_problem.py +++ b/tests/test_problem.py @@ -18,6 +18,16 @@ from pddl.core import Domain, Problem from pddl.logic.base import And, Not +from pddl.logic.functions import EqualTo as FunctionEqualTo +from pddl.logic.functions import ( + Function, + GreaterEqualThan, + GreaterThan, + LesserEqualThan, + LesserThan, + Metric, + TotalCost, +) from pddl.logic.helpers import constants, variables from pddl.logic.predicates import Predicate from tests.conftest import pddl_objects_problems @@ -81,3 +91,58 @@ def test_build_simple_problem(): goal=p & q, ) assert problem + + +def test_build_problem_with_metric(): + """Test a PDDL problem with metric.""" + x, y = variables("x y") + o1, o2 = constants("o1 o2") + p = Predicate("p", x, y) + q = Predicate("q") + total_cost = TotalCost() + problem = Problem( + "simple_problem", + domain_name="simple_domain", + objects=[o1, o2], + init={p, Not(q), FunctionEqualTo(total_cost, 0)}, + goal=p & q, + metric=Metric([total_cost]), + ) + assert problem + + +def test_build_problem_with_metric_list(): + """Test a PDDL problem with two functions and metric.""" + x, y = variables("x y") + o1, o2 = constants("o1 o2") + p = Predicate("p", x, y) + q = Predicate("q") + cost1 = Function("cost1", x, y) + cost2 = Function("cost2") + problem = Problem( + "simple_problem", + domain_name="simple_domain", + objects=[o1, o2], + init={p, Not(q), FunctionEqualTo(cost1, 0), FunctionEqualTo(cost2, 1)}, + goal=p & q & GreaterEqualThan(cost1, 3) & LesserEqualThan(cost2, 10), + metric=Metric([cost1, cost2], Metric.MAXIMIZE), + ) + assert problem + + +def test_build_problem_with_numeric_goal(): + """Test a PDDL problem with numeric fluents in goal.""" + x, y = variables("x y") + o1, o2 = constants("o1 o2") + p = Predicate("p", x, y) + q = Predicate("q") + cost1 = Function("cost1", x, y) + cost2 = Function("cost2") + problem = Problem( + "simple_problem", + domain_name="simple_domain", + objects=[o1, o2], + init={p, Not(q), FunctionEqualTo(cost1, 0), FunctionEqualTo(cost2, 10)}, + goal=p & q & GreaterThan(cost1, 3) & LesserThan(cost2, 10), + ) + assert problem From 7b376b4e4b68af5fc13a308453be4496544dc8ac Mon Sep 17 00:00:00 2001 From: Francesco Fuggitti Date: Tue, 10 Oct 2023 20:49:49 -0400 Subject: [PATCH 38/65] fix check for numeric requirement and tests --- pddl/core.py | 19 ++++++++++++++----- .../hello-world-functions/domain.pddl | 2 +- tests/test_domain.py | 4 ++-- tests/test_formatter.py | 4 ++-- tests/test_functions.py | 16 ++++++++-------- tests/test_parser/test_domain.py | 2 +- 6 files changed, 28 insertions(+), 19 deletions(-) diff --git a/pddl/core.py b/pddl/core.py index 2aa67b44..96a27d4c 100644 --- a/pddl/core.py +++ b/pddl/core.py @@ -95,16 +95,25 @@ def _check_types_in_derived_predicates(self) -> None: def _check_numeric_fluent_requirements(self) -> None: """Check that the numeric-fluents requirement is specified.""" if self._functions: - validate( - Requirements.NUMERIC_FLUENTS - in _extend_domain_requirements(self._requirements), - "numeric-fluents requirement is not specified, but numeric fluents are specified.", - ) if any(isinstance(f, TotalCost) for f in self._functions): validate( Requirements.ACTION_COSTS in self._requirements, "action costs requirement is not specified, but the total-cost function is specified.", ) + if any( + isinstance(f, Function) and not isinstance(f, TotalCost) + for f in self._functions + ): + validate( + Requirements.NUMERIC_FLUENTS in self._requirements, + "numeric-fluents requirement is not specified, but numeric fluents are specified.", + ) + else: + validate( + Requirements.NUMERIC_FLUENTS + in _extend_domain_requirements(self._requirements), + "numeric-fluents requirement is not specified, but numeric fluents are specified.", + ) @property def name(self) -> name_type: diff --git a/tests/fixtures/pddl_files/hello-world-functions/domain.pddl b/tests/fixtures/pddl_files/hello-world-functions/domain.pddl index e37ab064..07c36b6e 100644 --- a/tests/fixtures/pddl_files/hello-world-functions/domain.pddl +++ b/tests/fixtures/pddl_files/hello-world-functions/domain.pddl @@ -1,7 +1,7 @@ ;Hello world domain to test numerical fluents (functions) (define (domain hello-world-functions) - (:requirements :strips :fluents) + (:requirements :strips :numeric-fluents) (:functions (hello_counter) diff --git a/tests/test_domain.py b/tests/test_domain.py index 3ca0287c..cdcc8015 100644 --- a/tests/test_domain.py +++ b/tests/test_domain.py @@ -20,7 +20,6 @@ from pddl.action import Action from pddl.core import Domain from pddl.exceptions import PDDLValidationError -from pddl.formatter import domain_to_string from pddl.logic import Constant, Variable from pddl.logic.base import And, Not from pddl.logic.functions import Decrease @@ -140,6 +139,7 @@ def test_build_domain_with_numeric_fluents(): ) domain = Domain( "domain_with_numeric", + requirements={Requirements.NUMERIC_FLUENTS}, predicates={p}, functions={func1, func2, func3}, actions={action_1, action_2}, @@ -169,6 +169,7 @@ def test_build_domain_with_action_cost(): ) domain = Domain( "domain_with_numeric", + requirements={Requirements.NUMERIC_FLUENTS}, predicates={p}, functions={cost1, cost2}, actions={action_1, action_2}, @@ -195,7 +196,6 @@ def test_build_domain_with_total_cost(): functions={total_cost}, actions={action_1}, ) - print(domain_to_string(domain)) assert domain diff --git a/tests/test_formatter.py b/tests/test_formatter.py index add73a94..1fe618fc 100644 --- a/tests/test_formatter.py +++ b/tests/test_formatter.py @@ -123,7 +123,7 @@ def test_numerical_hello_world_domain_formatter(): domain = Domain( name="hello-world-functions", - requirements=[Requirements.STRIPS, Requirements.FLUENTS], + requirements=[Requirements.STRIPS, Requirements.NUMERIC_FLUENTS], functions=[hello_counter], actions=[action], ) @@ -131,7 +131,7 @@ def test_numerical_hello_world_domain_formatter(): assert domain_to_string(domain) == "\n".join( ( "(define (domain hello-world-functions)", - " (:requirements :fluents :strips)", + " (:requirements :numeric-fluents :strips)", " (:functions (hello_counter ?neighbor))", " (:action say-hello-world", " :parameters (?neighbor)", diff --git a/tests/test_functions.py b/tests/test_functions.py index 73db7393..18cc23b1 100644 --- a/tests/test_functions.py +++ b/tests/test_functions.py @@ -73,16 +73,16 @@ def setup_method(self): """Set up the tests.""" self.a, self.b = variables("a b") self.function = Function("f", self.a, self.b) - self.maximize_metric = Metric(self.function, Metric.MAXIMIZE) - self.minimize_metric = Metric(self.function, Metric.MINIMIZE) + self.maximize_metric = Metric([self.function], Metric.MAXIMIZE) + self.minimize_metric = Metric([self.function], Metric.MINIMIZE) def test_function_maximize(self): """Test function getter for maximize metric.""" - assert self.maximize_metric.function == self.function + assert self.maximize_metric.functions == [self.function] def test_function_minimize(self): """Test function getter for minimize metric.""" - assert self.minimize_metric.function == self.function + assert self.minimize_metric.functions == [self.function] def test_optimization_maximize(self): """Test optimization getter for maximize metric.""" @@ -98,23 +98,23 @@ def test_wrong_optimization(self): AssertionError, match="Optimization metric not recognized.", ): - Metric(self.function, "other") + Metric([self.function], "other") def test_to_equal(self): """Test to equal.""" - other = Metric(Function("f", self.a, self.b), Metric.MINIMIZE) + other = Metric([Function("f", self.a, self.b)], Metric.MINIMIZE) assert self.minimize_metric == other def test_to_str(self): """Test to string.""" assert ( str(self.maximize_metric) - == f"{self.maximize_metric.optimization} {self.maximize_metric.function}" + == f"{self.maximize_metric.optimization} {' '.join(map(str, self.maximize_metric.functions))}" ) def test_to_repr(self): """Test to repr.""" assert ( repr(self.minimize_metric) - == f"Metric(({self.function.name} {self.a} {self.b}), minimize)" + == f"Metric({*self.maximize_metric.functions,}, minimize)" ) diff --git a/tests/test_parser/test_domain.py b/tests/test_parser/test_domain.py index b49dd88a..b41b480e 100644 --- a/tests/test_parser/test_domain.py +++ b/tests/test_parser/test_domain.py @@ -307,7 +307,7 @@ def test_check_action_costs_requirement_with_total_cost() -> None: (:action a :parameters (?x - t1 ?y - t2) :precondition (and (p ?x ?x)) - :effect (p ?x ?x) + :effect (and (p ?x ?x) (increase (total-cost) 1)) ) ) """ From 610cb6b7740363a346735c8391dd0dca556f0aa6 Mon Sep 17 00:00:00 2001 From: Francesco Fuggitti Date: Thu, 12 Oct 2023 16:58:18 -0400 Subject: [PATCH 39/65] add all new numeric symbols --- pddl/parser/symbols.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pddl/parser/symbols.py b/pddl/parser/symbols.py index 02176bb4..97e71aab 100644 --- a/pddl/parser/symbols.py +++ b/pddl/parser/symbols.py @@ -56,9 +56,15 @@ class Symbols(Enum): GREATER = ">" LESSER_EQUAL = "<=" LESSER = "<" + MINUS = "-" + PLUS = "+" + TIMES = "*" + DIVIDE = "/" ASSIGN = "assign" INCREASE = "increase" DECREASE = "decrease" + MAXIMIZE = "maximize" + MINIMIZE = "minimize" TOTAL_COST = "total-cost" @@ -84,6 +90,7 @@ class RequirementSymbols(Enum): DERIVED_PREDICATES = ":derived-predicates" NON_DETERMINISTIC = ":non-deterministic" FLUENTS = ":fluents" + OBJECT_FLUENTS = ":object-fluents" NUMERIC_FLUENTS = ":numeric-fluents" ACTION_COSTS = ":action-costs" From 56118ec796907bc931787ea95f7478bd25a29701 Mon Sep 17 00:00:00 2001 From: Francesco Fuggitti Date: Thu, 12 Oct 2023 16:58:40 -0400 Subject: [PATCH 40/65] add all new numeric symbols and requirements --- pddl/parser/symbols.py | 7 +++++++ pddl/requirements.py | 9 +++++++++ 2 files changed, 16 insertions(+) diff --git a/pddl/parser/symbols.py b/pddl/parser/symbols.py index 02176bb4..97e71aab 100644 --- a/pddl/parser/symbols.py +++ b/pddl/parser/symbols.py @@ -56,9 +56,15 @@ class Symbols(Enum): GREATER = ">" LESSER_EQUAL = "<=" LESSER = "<" + MINUS = "-" + PLUS = "+" + TIMES = "*" + DIVIDE = "/" ASSIGN = "assign" INCREASE = "increase" DECREASE = "decrease" + MAXIMIZE = "maximize" + MINIMIZE = "minimize" TOTAL_COST = "total-cost" @@ -84,6 +90,7 @@ class RequirementSymbols(Enum): DERIVED_PREDICATES = ":derived-predicates" NON_DETERMINISTIC = ":non-deterministic" FLUENTS = ":fluents" + OBJECT_FLUENTS = ":object-fluents" NUMERIC_FLUENTS = ":numeric-fluents" ACTION_COSTS = ":action-costs" diff --git a/pddl/requirements.py b/pddl/requirements.py index 92b8164d..9875e73a 100644 --- a/pddl/requirements.py +++ b/pddl/requirements.py @@ -35,6 +35,7 @@ class Requirements(Enum): DERIVED_PREDICATES = RS.DERIVED_PREDICATES.strip() NON_DETERMINISTIC = RS.NON_DETERMINISTIC.strip() FLUENTS = RS.FLUENTS.strip() + OBJECT_FLUENTS = RS.OBJECT_FLUENTS.strip() NUMERIC_FLUENTS = RS.NUMERIC_FLUENTS.strip() ACTION_COSTS = RS.ACTION_COSTS.strip() @@ -58,6 +59,14 @@ def adl_requirements(cls) -> Set["Requirements"]: Requirements.CONDITIONAL_EFFECTS, }.union(cls.quantified_precondition_requirements()) + @classmethod + def fluents_requirements(cls) -> Set["Requirements"]: + """Get the fluents requirements.""" + return { + Requirements.OBJECT_FLUENTS, + Requirements.NUMERIC_FLUENTS, + } + def __str__(self) -> str: """Get the string representation.""" return f":{self.value}" From ee87a4760e84e958e38154e610f3662c42ec74e9 Mon Sep 17 00:00:00 2001 From: Francesco Fuggitti Date: Thu, 12 Oct 2023 17:00:24 -0400 Subject: [PATCH 41/65] new definition of functions data structure to handle full support to numeric fluents --- pddl/logic/base.py | 17 --- pddl/logic/functions.py | 276 ++++++++++++++++++++++------------------ 2 files changed, 153 insertions(+), 140 deletions(-) diff --git a/pddl/logic/base.py b/pddl/logic/base.py index 183864fd..5ff3e199 100644 --- a/pddl/logic/base.py +++ b/pddl/logic/base.py @@ -41,23 +41,6 @@ def __rshift__(self, other: "Formula") -> "Formula": return Or(Not(self), other) -@cache_hash -class Number: - """Base class for all the numbers.""" - - def __init__(self, value: float) -> None: - """Init the number object.""" - self._value = value - - def __hash__(self) -> int: - """Compute the hash of the object.""" - return hash(self._value) - - def __str__(self) -> str: - """Get the string representation.""" - return str(self._value) - - class BinaryOp(Formula): """Binary operator.""" diff --git a/pddl/logic/functions.py b/pddl/logic/functions.py index 6d9b1396..83e49ce1 100644 --- a/pddl/logic/functions.py +++ b/pddl/logic/functions.py @@ -12,20 +12,25 @@ """This class implements PDDL functions.""" import functools -from typing import Collection, Sequence +from typing import Sequence from pddl.custom_types import namelike, parse_name from pddl.helpers.base import assert_ from pddl.helpers.cache_hash import cache_hash -from pddl.logic.base import Atomic, Number +from pddl.logic.base import Atomic, MonotoneOp from pddl.logic.terms import Term from pddl.parser.symbols import Symbols +@cache_hash +class FunctionExpression(Atomic): + """A class for all the function expressions.""" + + @cache_hash @functools.total_ordering -class Function(Atomic): - """A class for a Function in PDDL.""" +class NumericFunction(FunctionExpression): + """A class for a numeric function.""" def __init__(self, name: namelike, *terms: Term): """Initialize the function.""" @@ -57,7 +62,7 @@ def __call__(self, *terms: Term): all(t1.type_tags == t2.type_tags for t1, t2 in zip(self.terms, terms)), "Wrong types of replacements.", ) - return Function(self.name, *terms) + return NumericFunction(self.name, *terms) def __str__(self) -> str: """Get the string.""" @@ -73,23 +78,75 @@ def __repr__(self) -> str: def __eq__(self, other): """Override equal operator.""" return ( - isinstance(other, Function) + isinstance(other, NumericFunction) and self.name == other.name and self.terms == other.terms ) - def __hash__(self): - """Get the has of a Function.""" - return hash((self.name, self.arity, self.terms)) + def __hash__(self) -> int: + """Compute the hash of the object.""" + return hash((self.name, self.terms)) def __lt__(self, other): + """Override less than operator.""" + if not isinstance(other, NumericFunction): + return NotImplemented + return (self.name, self.terms) < (other.name, other.terms) + + +@cache_hash +class NumericValue(FunctionExpression): + """A class for a numeric value.""" + + def __init__(self, value: float) -> None: + """Init the numeric value object.""" + self._value = value + + def __hash__(self) -> int: + """Compute the hash of the object.""" + return hash(self._value) + + def __str__(self) -> str: + """Get the string representation.""" + return str(self._value) + + +class BinaryFunction(FunctionExpression): + """A class for a numeric binary function.""" + + SYMBOL: Symbols + + def __init__(self, *operands: FunctionExpression): + """ + Init a binary operator. + + :param operands: the operands. + """ + self._operands = list(operands) + + @property + def operands(self) -> Sequence[FunctionExpression]: + """Get the operands.""" + return tuple(self._operands) + + def __str__(self) -> str: + """Get the string representation.""" + return f"({self.SYMBOL.value} {' '.join(map(str, self.operands))})" + + def __repr__(self) -> str: + """Get an unambiguous string representation.""" + return f"{type(self).__name__}({repr(self.operands)})" + + def __eq__(self, other): """Compare with another object.""" - if isinstance(other, Function): - return (self.name, self.terms) < (other.name, other.terms) - return super().__lt__(other) + return isinstance(other, type(self)) and self.operands == other.operands + + def __hash__(self) -> int: + """Compute the hash of the object.""" + return hash((type(self), self.operands)) -class TotalCost(Function): +class TotalCost(NumericFunction): """A class for the total-cost function in PDDL.""" def __init__(self): @@ -100,24 +157,24 @@ def __init__(self): class Metric(Atomic): """A class for the metric function in PDDL.""" - MINIMIZE = "minimize" - MAXIMIZE = "maximize" + MINIMIZE = Symbols.MINIMIZE.value + MAXIMIZE = Symbols.MAXIMIZE.value - def __init__(self, functions: Collection[Function], optimization: str = MINIMIZE): + def __init__(self, expression: FunctionExpression, optimization: str = MINIMIZE): """ - Initialize the metric function. + Initialize the metric. - :param functions: functions to minimize or maximize. + :param expression: functions to minimize or maximize. :param optimization: whether to minimize or maximize the function. """ - self._functions = functions + self._expression = expression self._optimization = optimization self._validate() @property - def functions(self) -> Collection[Function]: + def expression(self) -> FunctionExpression: """Get the functions.""" - return self._functions + return self._expression @property def optimization(self) -> str: @@ -133,175 +190,148 @@ def _validate(self): def __str__(self) -> str: """Get the string representation.""" - return f"{self.optimization} {' '.join(map(str, self.functions))}" + return f"{self.optimization} {self.expression}" def __repr__(self) -> str: """Get an unambiguous string representation.""" - return f"{type(self).__name__}({*self.functions,}, {self.optimization})" + return f"{type(self).__name__}({*self.expression,}, {self.optimization})" # type: ignore def __eq__(self, other): """Override equal operator.""" return ( isinstance(other, Metric) - and self.functions == other.functions + and self.expression == other.expression and self.optimization == other.optimization ) def __hash__(self): """Get the hash of a Metric.""" - return hash((self.functions, self.optimization)) + return hash((self.expression, self.optimization)) -class FunctionOperator(Atomic): - """Operator for to numerical fluent.""" +class EqualTo(BinaryFunction, metaclass=MonotoneOp): + """Equal to operator.""" - def __init__(self, function: Function, value: Number, symbol: Symbols): - """ - Initialize the function operator. + SYMBOL = Symbols.EQUAL - :param func: function to operate on. - :param value: value of the operator. - :param symbol: symbol of the operator. - """ - self._function = function - self._value = value - self._symbol = symbol - @property - def function(self) -> Function: - """Get the numerical fluent.""" - return self._function +class LesserThan(BinaryFunction): + """Lesser than operator.""" - @property - def symbol(self) -> Symbols: - """Get the operation symbol.""" - return self._symbol + SYMBOL = Symbols.LESSER - @property - def value(self) -> Number: - """Get the value of the operation.""" - return self._value - def __eq__(self, other) -> bool: - """Compare with another object.""" - return ( - isinstance(other, self.__class__) - and self.function == other.function - and self.value == other.value - ) +class LesserEqualThan(BinaryFunction): + """Lesser or equal than operator.""" - def __hash__(self) -> int: - """Get the hash.""" - return hash((self.symbol, self.function, self.value)) + SYMBOL = Symbols.LESSER_EQUAL - def __str__(self) -> str: - """Get the string representation.""" - return f"({self.symbol.value} {self.function} {self.value})" - def __repr__(self) -> str: - """Get the string representation.""" - return f"{type(self).__name__}({self.function}, {self.value})" +class GreaterThan(BinaryFunction): + """Greater than operator.""" + SYMBOL = Symbols.GREATER -class EqualTo(FunctionOperator): - """Check if numerical fluent is equal to value.""" - def __init__(self, function: Function, value: Number): - """ - Initialize the EqualTo operator. +class GreaterEqualThan(BinaryFunction): + """Greater or equal than operator.""" - :param func: function to operate on. - :param value: value of the operator. - """ - super().__init__(function, value, Symbols.EQUAL) + SYMBOL = Symbols.GREATER_EQUAL -class LesserThan(FunctionOperator): - """Check if numerical fluent is lesser than value.""" +class Assign(BinaryFunction): + """Assign operator.""" - def __init__(self, function: Function, value: Number): + SYMBOL = Symbols.ASSIGN + + def __init__(self, *operands: FunctionExpression): """ - Initialize the LesserThan operator. + Initialize the Assign operator. - :param func: function to operate on. - :param value: value of the operator. + :param operands: the operands. """ - super().__init__(function, value, Symbols.LESSER) + super().__init__(*operands) + +class Increase(BinaryFunction): + """Increase operator.""" -class LesserEqualThan(FunctionOperator): - """Check if numerical fluent is lesser or equal than value.""" + SYMBOL = Symbols.INCREASE - def __init__(self, function: Function, value: Number): + def __init__(self, *operands: FunctionExpression): """ - Initialize the LesserEqualThan operator. + Initialize the Increase operator. - :param func: function to operate on. - :param value: value of the operator. + :param operands: the operands. """ - super().__init__(function, value, Symbols.LESSER_EQUAL) + super().__init__(*operands) + +class Decrease(BinaryFunction): + """Decrease operator.""" -class GreaterThan(FunctionOperator): - """Check if numerical fluent is greater than value.""" + SYMBOL = Symbols.DECREASE - def __init__(self, function: Function, value: Number): + def __init__(self, *operands: FunctionExpression): """ - Initialize the GreaterThan operator. + Initialize the Decrease operator. - :param func: function to operate on. - :param value: value of the operator. + :param operands: the operands. """ - super().__init__(function, value, Symbols.GREATER) + super().__init__(*operands) + +class Minus(BinaryFunction, metaclass=MonotoneOp): + """Minus operator.""" -class GreaterEqualThan(FunctionOperator): - """Check if numerical fluent is greater or equal than value.""" + SYMBOL = Symbols.MINUS - def __init__(self, function: Function, value: Number): + def __init__(self, *operands: FunctionExpression): """ - Initialize the GreaterEqualThan operator. + Initialize the Minus operator. - :param func: function to operate on. - :param value: value of the operator. + :param operands: the operands. """ - super().__init__(function, value, Symbols.GREATER_EQUAL) + super().__init__(*operands) -class AssignTo(FunctionOperator): - """Assign value to numerical fluent.""" +class Plus(BinaryFunction, metaclass=MonotoneOp): + """Plus operator.""" - def __init__(self, function: Function, value: Number): + SYMBOL = Symbols.PLUS + + def __init__(self, *operands: FunctionExpression): """ - Initialize the AssignTo operator. + Initialize the Plus operator. - :param func: function to operate on. - :param value: value of the operator. + :param operands: the operands. """ - super().__init__(function, value, Symbols.ASSIGN) + super().__init__(*operands) + +class Times(BinaryFunction, metaclass=MonotoneOp): + """Times operator.""" -class Increase(FunctionOperator): - """Increase numerical fluent by value.""" + SYMBOL = Symbols.TIMES - def __init__(self, function: Function, value: Number): + def __init__(self, *operands: FunctionExpression): """ - Initialize the Increase operator. + Initialize the Times operator. - :param func: function to operate on. - :param value: value of the operator. + :param operands: the operands. """ - super().__init__(function, value, Symbols.INCREASE) + super().__init__(*operands) + +class Divide(BinaryFunction, metaclass=MonotoneOp): + """Divide operator.""" -class Decrease(FunctionOperator): - """Decrease numerical fluent by value.""" + SYMBOL = Symbols.DIVIDE - def __init__(self, function: Function, value: Number): + def __init__(self, *operands: FunctionExpression): """ - Initialize the Decrease operator. + Initialize the Divide operator. - :param func: function to operate on. - :param value: value of the operator. + :param operands: the operands. """ - super().__init__(function, value, Symbols.DECREASE) + super().__init__(*operands) From fd36af7eeed64a5173f7ecdeb184e017468a2df9 Mon Sep 17 00:00:00 2001 From: Francesco Fuggitti Date: Thu, 12 Oct 2023 17:01:17 -0400 Subject: [PATCH 42/65] adjust pddl grammar to handle full numeric fluents and metrics --- pddl/parser/common.lark | 4 ++++ pddl/parser/domain.lark | 25 ++++++++++++++++++++----- pddl/parser/problem.lark | 11 ++++++++++- 3 files changed, 34 insertions(+), 6 deletions(-) diff --git a/pddl/parser/common.lark b/pddl/parser/common.lark index 7168b807..c8bd78e6 100644 --- a/pddl/parser/common.lark +++ b/pddl/parser/common.lark @@ -45,6 +45,10 @@ GREATER_EQUAL_OP: ">=" GREATER_OP: ">" LESSER_EQUAL_OP: "<=" LESSER_OP: "<" +MINUS: "-" +PLUS: "+" +TIMES: "*" +DIVIDE: "/" METRIC: ":metric" INCREASE: "increase" DECREASE: "decrease" diff --git a/pddl/parser/domain.lark b/pddl/parser/domain.lark index 42e6bd12..ca36b0f0 100644 --- a/pddl/parser/domain.lark +++ b/pddl/parser/domain.lark @@ -61,14 +61,25 @@ constant: NAME | GREATER_EQUAL_OP | LESSER_EQUAL_OP +?binary_op: multi_op + | MINUS + | DIVIDE + +?multi_op: TIMES + | PLUS + +f_exp: NUMBER + | LPAR binary_op f_exp f_exp RPAR + | LPAR multi_op f_exp f_exp+ RPAR + | LPAR MINUS f_exp RPAR + | f_head + +f_head: NAME + | LPAR NAME term* RPAR + ?assign_op: INCREASE | DECREASE -?f_exp: NUMBER - | f_head -f_head: NAME - | LPAR NAME term* RPAR - typed_list_variable: variable* | (variable+ TYPE_SEP type_def)+ variable* ?variable: "?" NAME @@ -113,6 +124,10 @@ type_def: LPAR EITHER primitive_type+ RPAR %import .common.GREATER_EQUAL_OP -> GREATER_EQUAL_OP %import .common.LESSER_OP -> LESSER_OP %import .common.LESSER_EQUAL_OP -> LESSER_EQUAL_OP +%import .common.MINUS -> MINUS +%import .common.PLUS -> PLUS +%import .common.TIMES -> TIMES +%import .common.DIVIDE -> DIVIDE %import .common.NUMBER -> NUMBER %import .common.INCREASE -> INCREASE %import .common.DECREASE -> DECREASE diff --git a/pddl/parser/problem.lark b/pddl/parser/problem.lark index 4abf77f3..cef3bd7c 100644 --- a/pddl/parser/problem.lark +++ b/pddl/parser/problem.lark @@ -34,11 +34,17 @@ gd_name: atomic_formula_name f_head: NAME | LPAR NAME term* RPAR -metric_spec: LPAR METRIC optimization basic_function_term RPAR +metric_spec: LPAR METRIC optimization metric_f_exp RPAR ?optimization: MAXIMIZE | MINIMIZE +metric_f_exp: LPAR binary_op metric_f_exp metric_f_exp RPAR + | LPAR multi_op metric_f_exp metric_f_exp+ RPAR + | LPAR MINUS metric_f_exp RPAR + | basic_function_term + | NUMBER + DOMAIN_P: ":domain" PROBLEM: "problem" OBJECTS: ":objects" @@ -53,6 +59,8 @@ GOAL: ":goal" %import .domain.typed_list_name -> typed_list_name %import .domain.predicate -> predicate %import .domain.binary_comp -> binary_comp +%import .domain.binary_op -> binary_op +%import .domain.multi_op -> multi_op %import .domain.term -> term %import .common.NAME -> NAME %import .common.DEFINE -> DEFINE @@ -75,6 +83,7 @@ GOAL: ":goal" %import .common.GREATER_EQUAL_OP -> GREATER_EQUAL_OP %import .common.LESSER_OP -> LESSER_OP %import .common.LESSER_EQUAL_OP -> LESSER_EQUAL_OP +%import .common.MINUS -> MINUS %import .common.METRIC -> METRIC %import .common.MAXIMIZE -> MAXIMIZE %import .common.MINIMIZE -> MINIMIZE From 16b6e5bc98fa2f778921e202b64f009e4f6cb065 Mon Sep 17 00:00:00 2001 From: Francesco Fuggitti Date: Thu, 12 Oct 2023 17:01:46 -0400 Subject: [PATCH 43/65] adjust domain and problem parsers to support all numeric fluents --- pddl/parser/domain.py | 38 +++++++++++++++++++++++++----- pddl/parser/problem.py | 52 ++++++++++++++++++++++++++++++++---------- 2 files changed, 72 insertions(+), 18 deletions(-) diff --git a/pddl/parser/domain.py b/pddl/parser/domain.py index a26084d7..2658e4de 100644 --- a/pddl/parser/domain.py +++ b/pddl/parser/domain.py @@ -23,15 +23,20 @@ from pddl.helpers.base import assert_ from pddl.logic.base import And, ExistsCondition, ForallCondition, Imply, Not, OneOf, Or from pddl.logic.effects import AndEffect, Forall, When -from pddl.logic.functions import Decrease +from pddl.logic.functions import Decrease, Divide from pddl.logic.functions import EqualTo as FunctionEqualTo from pddl.logic.functions import ( - Function, + FunctionExpression, GreaterEqualThan, GreaterThan, Increase, LesserEqualThan, LesserThan, + Minus, + NumericFunction, + NumericValue, + Plus, + Times, TotalCost, ) from pddl.logic.predicates import DerivedPredicate, EqualTo, Predicate @@ -51,7 +56,7 @@ def __init__(self, *args, **kwargs): self._constants_by_name: Dict[str, Constant] = {} self._predicates_by_name: Dict[str, Predicate] = {} - self._functions_by_name: Dict[str, Function] = {} + self._functions_by_name: Dict[str, FunctionExpression] = {} self._current_parameters_by_name: Dict[str, Variable] = {} self._requirements: Set[str] = set() self._extended_requirements: Set[str] = set() @@ -347,15 +352,36 @@ def atomic_function_skeleton(self, args): return TotalCost() function_name = args[1] variables = self._formula_skeleton(args) - return Function(function_name, *variables) + return NumericFunction(function_name, *variables) + + def f_exp(self, args): + """Process the 'f_exp' rule.""" + if len(args) == 1: + if isinstance(args[0], (int, float)): + return NumericValue(args[0]) + return args[0] + op = None + if args[1] == Symbols.MINUS.value: + op = Minus + if args[1] == Symbols.PLUS.value: + op = Plus + if args[1] == Symbols.TIMES.value: + op = Times + if args[1] == Symbols.DIVIDE.value: + op = Divide + return ( + op(*args[2:-1]) + if op is not None + else PDDLParsingError("Operator not recognized") + ) def f_head(self, args): """Process the 'f_head' rule.""" if len(args) == 1: - return args[0] + return NumericFunction(args[0]) function_name = args[1] variables = [Variable(x, {}) for x in args[2:-1]] - return Function(function_name, *variables) + return NumericFunction(function_name, *variables) def typed_list_name(self, args) -> Dict[name, Optional[name]]: """Process the 'typed_list_name' rule.""" diff --git a/pddl/parser/problem.py b/pddl/parser/problem.py index 5d01f814..cb1a8364 100644 --- a/pddl/parser/problem.py +++ b/pddl/parser/problem.py @@ -20,14 +20,19 @@ from pddl.exceptions import PDDLParsingError from pddl.helpers.base import assert_ from pddl.logic.base import And, Not +from pddl.logic.functions import Divide from pddl.logic.functions import EqualTo as FunctionEqualTo from pddl.logic.functions import ( - Function, GreaterEqualThan, GreaterThan, LesserEqualThan, LesserThan, Metric, + Minus, + NumericFunction, + NumericValue, + Plus, + Times, ) from pddl.logic.predicates import EqualTo, Predicate from pddl.logic.terms import Constant, Variable @@ -111,11 +116,11 @@ def init_el(self, args): return args[0] elif args[1] == Symbols.EQUAL.value: if isinstance(args[2], list) and len(args[2]) == 1: - return FunctionEqualTo(*args[2], args[3]) + return FunctionEqualTo(*args[2], NumericValue(args[3])) elif not isinstance(args[2], list): - return FunctionEqualTo(args[2], args[3]) + return FunctionEqualTo(args[2], NumericValue(args[3])) else: - funcs = [FunctionEqualTo(x, args[3]) for x in args[2]] + funcs = [FunctionEqualTo(x, NumericValue(args[3])) for x in args[2]] return funcs def literal_name(self, args): @@ -130,8 +135,10 @@ def literal_name(self, args): def basic_function_term(self, args): """Process the 'basic_function_term' rule.""" if len(args) == 1: - return Function(args[0]) - return [Function(x) for x in args[1:-1]] + return NumericFunction(args[0]) + function_name = args[1] + objects = [Constant(x) for x in args[2:-1]] + return NumericFunction(function_name, *objects) def goal(self, args): """Process the 'goal' rule.""" @@ -186,19 +193,40 @@ def atomic_formula_name(self, args): def f_head(self, args): """Process the 'f_head' rule.""" if len(args) == 1: - return args[0] + return NumericFunction(args[0]) function_name = args[1] variables = [Variable(x, {}) for x in args[2:-1]] - return Function(function_name, *variables) + return NumericFunction(function_name, *variables) def metric_spec(self, args): """Process the 'metric_spec' rule.""" - if isinstance(args[3], list) and len(args[3]) == 1: - return "metric", Metric(*args[3], args[2]) - elif not isinstance(args[2], list): + if args[2] == Symbols.MINIMIZE.value: + return "metric", Metric(args[3], args[2]) + elif args[2] == Symbols.MAXIMIZE.value: return "metric", Metric(args[3], args[2]) else: - raise ParseError + raise PDDLParsingError(f"Unknown metric operator: {args[2]}") + + def metric_f_exp(self, args): + """Process the 'metric_f_exp' rule.""" + if len(args) == 1: + if isinstance(args[0], (int, float)): + return NumericValue(args[0]) + return args[0] + op = None + if args[1] == Symbols.MINUS.value: + op = Minus + if args[1] == Symbols.PLUS.value: + op = Plus + if args[1] == Symbols.TIMES.value: + op = Times + if args[1] == Symbols.DIVIDE.value: + op = Divide + return ( + op(*args[2:-1]) + if op is not None + else PDDLParsingError("Operator not recognized") + ) _problem_parser_lark = PROBLEM_GRAMMAR_FILE.read_text() From c0debe526eec6960035d46a96f1460221840c820 Mon Sep 17 00:00:00 2001 From: Francesco Fuggitti Date: Thu, 12 Oct 2023 17:02:36 -0400 Subject: [PATCH 44/65] add missing types checks for new functions classes, and adjust core module --- pddl/_validation.py | 79 +++++++++++++++++++++++++++++++++++++++++---- pddl/core.py | 8 ++--- 2 files changed, 77 insertions(+), 10 deletions(-) diff --git a/pddl/_validation.py b/pddl/_validation.py index 255dc096..57f660c8 100644 --- a/pddl/_validation.py +++ b/pddl/_validation.py @@ -24,7 +24,19 @@ from pddl.logic import Predicate from pddl.logic.base import BinaryOp, QuantifiedCondition, UnaryOp from pddl.logic.effects import AndEffect, Forall, When -from pddl.logic.functions import Function, FunctionOperator +from pddl.logic.functions import Assign, Decrease, Divide +from pddl.logic.functions import EqualTo as FunctionEqualTo +from pddl.logic.functions import ( + GreaterEqualThan, + GreaterThan, + Increase, + LesserEqualThan, + LesserThan, + Minus, + NumericFunction, + Plus, + Times, +) from pddl.logic.predicates import DerivedPredicate, EqualTo from pddl.logic.terms import Term from pddl.parser.symbols import Symbols @@ -236,14 +248,69 @@ def _(self, predicate: Predicate) -> None: self.check_type(predicate.terms) @check_type.register - def _(self, function: Function) -> None: - """Check types annotations of a PDDL function.""" + def _(self, function: NumericFunction) -> None: + """Check types annotations of a PDDL numeric function.""" self.check_type(function.terms) @check_type.register - def _(self, function_operator: FunctionOperator) -> None: - """Check types annotations of a PDDL function operator.""" - self.check_type(function_operator.function) + def _(self, equal_to: FunctionEqualTo) -> None: + """Check types annotations of a PDDL numeric equal to operator.""" + self.check_type(equal_to.operands) + + @check_type.register + def _(self, lesser: LesserThan) -> None: + """Check types annotations of a PDDL numeric lesser operator.""" + self.check_type(lesser.operands) + + @check_type.register + def _(self, lesser_equal: LesserEqualThan) -> None: + """Check types annotations of a PDDL numeric lesser or equal operator.""" + self.check_type(lesser_equal.operands) + + @check_type.register + def _(self, greater: GreaterThan) -> None: + """Check types annotations of a PDDL numeric greater operator.""" + self.check_type(greater.operands) + + @check_type.register + def _(self, greater_equal: GreaterEqualThan) -> None: + """Check types annotations of a PDDL numeric greater or equal to.""" + self.check_type(greater_equal.operands) + + @check_type.register + def _(self, assign: Assign) -> None: + """Check types annotations of a PDDL numeric assign to.""" + self.check_type(assign.operands) + + @check_type.register + def _(self, increase: Increase) -> None: + """Check types annotations of a PDDL numeric increase to.""" + self.check_type(increase.operands) + + @check_type.register + def _(self, decrease: Decrease) -> None: + """Check types annotations of a PDDL numeric decrease operator.""" + self.check_type(decrease.operands) + + @check_type.register + def _(self, minus: Minus) -> None: + """Check types annotations of a PDDL numeric minus operator.""" + self.check_type(minus.operands) + + @check_type.register + def _(self, plus: Plus) -> None: + """Check types annotations of a PDDL numeric plus operator.""" + self.check_type(plus.operands) + + @check_type.register + def _(self, times: Times) -> None: + """Check types annotations of a PDDL numeric times operator.""" + self.check_type(times.operands) + + @check_type.register + def _(self, divide: Divide) -> None: + """Check types annotations of a PDDL numeric divide operator.""" + self.check_type(divide.operands) @check_type.register def _(self, equal_to: EqualTo) -> None: diff --git a/pddl/core.py b/pddl/core.py index 96a27d4c..44ccc8ac 100644 --- a/pddl/core.py +++ b/pddl/core.py @@ -28,7 +28,7 @@ from pddl.custom_types import namelike, parse_name, to_names, to_types # noqa: F401 from pddl.helpers.base import assert_, check, ensure, ensure_set from pddl.logic.base import And, Formula, is_literal -from pddl.logic.functions import Function, Metric, TotalCost +from pddl.logic.functions import FunctionExpression, Metric, TotalCost from pddl.logic.predicates import DerivedPredicate, Predicate from pddl.logic.terms import Constant from pddl.requirements import Requirements, _extend_domain_requirements @@ -47,7 +47,7 @@ def __init__( derived_predicates: Optional[ Collection[DerivedPredicate] ] = None, # TODO cannot be empty - functions: Optional[Collection[Function]] = None, + functions: Optional[Collection[FunctionExpression]] = None, actions: Optional[Collection["Action"]] = None, ): """ @@ -101,7 +101,7 @@ def _check_numeric_fluent_requirements(self) -> None: "action costs requirement is not specified, but the total-cost function is specified.", ) if any( - isinstance(f, Function) and not isinstance(f, TotalCost) + isinstance(f, FunctionExpression) and not isinstance(f, TotalCost) for f in self._functions ): validate( @@ -136,7 +136,7 @@ def predicates(self) -> AbstractSet[Predicate]: return self._predicates @property - def functions(self) -> AbstractSet[Function]: + def functions(self) -> AbstractSet[FunctionExpression]: """Get the functions.""" return self._functions From 2484c72bfdec0700eef94f2a4c2670dcd36d4995 Mon Sep 17 00:00:00 2001 From: Francesco Fuggitti Date: Thu, 12 Oct 2023 17:48:48 -0400 Subject: [PATCH 45/65] adjust tests for the new data structure --- pddl/logic/functions.py | 7 ++++++- tests/test_domain.py | 12 +++++------ tests/test_formatter.py | 22 +++++++++++--------- tests/test_function.py | 18 +++++++++++++--- tests/test_function_operators.py | 6 +++--- tests/test_functions.py | 35 ++++++++++++++++---------------- tests/test_problem.py | 10 ++++----- 7 files changed, 64 insertions(+), 46 deletions(-) diff --git a/pddl/logic/functions.py b/pddl/logic/functions.py index 83e49ce1..5865ac2e 100644 --- a/pddl/logic/functions.py +++ b/pddl/logic/functions.py @@ -102,6 +102,11 @@ def __init__(self, value: float) -> None: """Init the numeric value object.""" self._value = value + @property + def value(self) -> float: + """Get the value.""" + return self._value + def __hash__(self) -> int: """Compute the hash of the object.""" return hash(self._value) @@ -194,7 +199,7 @@ def __str__(self) -> str: def __repr__(self) -> str: """Get an unambiguous string representation.""" - return f"{type(self).__name__}({*self.expression,}, {self.optimization})" # type: ignore + return f"{type(self).__name__}({self.expression}, {self.optimization})" # type: ignore def __eq__(self, other): """Override equal operator.""" diff --git a/tests/test_domain.py b/tests/test_domain.py index cdcc8015..c409b56c 100644 --- a/tests/test_domain.py +++ b/tests/test_domain.py @@ -25,7 +25,7 @@ from pddl.logic.functions import Decrease from pddl.logic.functions import EqualTo as FunctionEqualTo from pddl.logic.functions import ( - Function, + NumericFunction, GreaterEqualThan, GreaterThan, Increase, @@ -119,9 +119,9 @@ def test_build_domain_with_numeric_fluents(): p = Predicate("p", x, y, z) q = Predicate("q") r = Predicate("r") - func1 = Function("f1", x, y) - func2 = Function("f2") - func3 = Function("f3") + func1 = NumericFunction("f1", x, y) + func2 = NumericFunction("f2") + func3 = NumericFunction("f3") action_1 = Action( "action_1", [x, y, z], @@ -153,8 +153,8 @@ def test_build_domain_with_action_cost(): p = Predicate("p", x, y, z) q = Predicate("q") r = Predicate("r") - cost1 = Function("cost1", x, y) - cost2 = Function("cost2") + cost1 = NumericFunction("cost1", x, y) + cost2 = NumericFunction("cost2") action_1 = Action( "action_1", [x, y, z], diff --git a/tests/test_formatter.py b/tests/test_formatter.py index 1fe618fc..fe468127 100644 --- a/tests/test_formatter.py +++ b/tests/test_formatter.py @@ -21,15 +21,17 @@ from pddl.core import Domain, Problem from pddl.formatter import domain_to_string, problem_to_string from pddl.logic import Constant, Variable, constants -from pddl.logic.base import ForallCondition, Number +from pddl.logic.base import ForallCondition from pddl.logic.effects import AndEffect from pddl.logic.functions import ( EqualTo, - Function, + NumericFunction, GreaterEqualThan, Increase, LesserEqualThan, + NumericValue, ) + from pddl.requirements import Requirements from tests.conftest import DOMAIN_FILES, PROBLEM_FILES @@ -111,20 +113,20 @@ def test_typed_objects_formatting_in_problem() -> None: def test_numerical_hello_world_domain_formatter(): - """Test that numerical functions are formatted correctly.""" + """Test that numerical NumericFunctions are formatted correctly.""" neighbor = Variable("neighbor") - hello_counter = Function("hello_counter", neighbor) + hello_counter = NumericFunction("hello_counter", neighbor) action = Action( "say-hello-world", parameters=[neighbor], - precondition=LesserEqualThan(hello_counter, Number(3)), - effect=AndEffect(Increase(hello_counter, Number(1))), + precondition=LesserEqualThan(hello_counter, NumericValue(3)), + effect=AndEffect(Increase(hello_counter, NumericValue(1))), ) domain = Domain( name="hello-world-functions", requirements=[Requirements.STRIPS, Requirements.NUMERIC_FLUENTS], - functions=[hello_counter], + NumericFunctions=[hello_counter], actions=[action], ) @@ -144,19 +146,19 @@ def test_numerical_hello_world_domain_formatter(): def test_numerical_hello_world_problem_formatter(): - """Test that numerical functions are formatted correctly.""" + """Test that numerical NumericFunctions are formatted correctly.""" neighbors = [Constant(name, "neighbor") for name in ("Alice", "Bob", "Charlie")] problem = Problem( name="hello-3-times", domain_name="hello-world-functions", objects=neighbors, init=[ - EqualTo(Function("hello_counter", neighbor), Number(0)) + EqualTo(NumericFunction("hello_counter", neighbor), NumericValue(0)) for neighbor in neighbors ], goal=ForallCondition( GreaterEqualThan( - Function("hello_counter", Variable("neighbor")), Number(1) + NumericFunction("hello_counter", Variable("neighbor")), NumericValue(1) ), [Variable("neighbor", ["neighbor"])], ), diff --git a/tests/test_function.py b/tests/test_function.py index 56f09376..6a9522e3 100644 --- a/tests/test_function.py +++ b/tests/test_function.py @@ -12,7 +12,7 @@ """This module contains tests for a PDDL function.""" from pddl.logic import variables -from pddl.logic.functions import Function +from pddl.logic.functions import NumericFunction, NumericValue class TestFunctionEmpty: @@ -20,7 +20,7 @@ class TestFunctionEmpty: def setup_method(self): """Set up the tests.""" - self.function = Function("empty_function") + self.function = NumericFunction("empty_function") def test_name(self): """Test the name getter.""" @@ -38,5 +38,17 @@ def test_arity(self): def test_build_simple_function(): """Test a simple PDDL action.""" x, y, z = variables("x y z", types=["type1"]) - function = Function("simple_function", x, y, z) + function = NumericFunction("simple_function", x, y, z) assert function + + +class TestNumericValue: + """Test the numeric value.""" + + def setup_method(self): + """Set up the tests.""" + self.numeric_value = NumericValue(3) + + def test_value(self): + """Test the name getter.""" + assert self.numeric_value.value == 3 diff --git a/tests/test_function_operators.py b/tests/test_function_operators.py index 09d88ae5..4f2a473a 100644 --- a/tests/test_function_operators.py +++ b/tests/test_function_operators.py @@ -11,7 +11,7 @@ # """This module contains tests for PDDL function operators.""" from pddl.logic import variables -from pddl.logic.functions import Function, FunctionOperator +from pddl.logic.functions import NumericFunction from pddl.parser.symbols import Symbols @@ -22,8 +22,8 @@ def setup_method(self): """Set up the tests.""" x, y = variables("x y", types=["type1"]) z = variables("z", types=["type2"]) - self.function = Function("function_1", x, y, z) - self.function_op = FunctionOperator(self.function, 3, Symbols.EQUAL) + self.function = NumericFunction("function_1", x, y, z) + def test_function(self): """Test the function getter.""" diff --git a/tests/test_functions.py b/tests/test_functions.py index 18cc23b1..c8d17ca1 100644 --- a/tests/test_functions.py +++ b/tests/test_functions.py @@ -13,8 +13,7 @@ """This module contains tests for PDDL functions.""" import pytest -from pddl.core import Function -from pddl.logic.functions import Metric, TotalCost +from pddl.logic.functions import Metric, TotalCost, NumericFunction from pddl.logic.helpers import variables @@ -24,11 +23,11 @@ class TestFunctionSimpleInitialisation: def setup_method(self): """Set up the tests.""" self.a, self.b = variables("a b") - self.function = Function("f", self.a, self.b) + self.function = NumericFunction("func", self.a, self.b) def test_name(self): """Test name getter.""" - assert self.function.name == "f" + assert self.function.name == "func" def test_variables(self): """Test terms getter.""" @@ -40,7 +39,7 @@ def test_arity(self): def test_to_equal(self): """Test to equal.""" - other = Function("f", self.a, self.b) + other = NumericFunction("f", self.a, self.b) assert self.function == other def test_to_str(self): @@ -50,7 +49,7 @@ def test_to_str(self): def test_to_repr(self): """Test to repr.""" assert ( - repr(self.function) == f"Function({self.function.name}, {self.a}, {self.b})" + repr(self.function) == f"NumericFunction({self.function.name}, {self.a}, {self.b})" ) @@ -59,11 +58,11 @@ class TestTotalCost: def setup_method(self): """Set up the tests.""" - self.predicate = TotalCost() + self.total_cost = TotalCost() def test_name(self): """Test name getter.""" - assert self.predicate.name == "total-cost" + assert self.total_cost.name == "total-cost" class TestMetric: @@ -72,17 +71,17 @@ class TestMetric: def setup_method(self): """Set up the tests.""" self.a, self.b = variables("a b") - self.function = Function("f", self.a, self.b) - self.maximize_metric = Metric([self.function], Metric.MAXIMIZE) - self.minimize_metric = Metric([self.function], Metric.MINIMIZE) + self.function = NumericFunction("func", self.a, self.b) + self.maximize_metric = Metric(self.function, Metric.MAXIMIZE) + self.minimize_metric = Metric(self.function, Metric.MINIMIZE) def test_function_maximize(self): """Test function getter for maximize metric.""" - assert self.maximize_metric.functions == [self.function] + assert self.maximize_metric.expression == self.function def test_function_minimize(self): """Test function getter for minimize metric.""" - assert self.minimize_metric.functions == [self.function] + assert self.minimize_metric.expression == self.function def test_optimization_maximize(self): """Test optimization getter for maximize metric.""" @@ -98,23 +97,23 @@ def test_wrong_optimization(self): AssertionError, match="Optimization metric not recognized.", ): - Metric([self.function], "other") + Metric(self.function, "other") def test_to_equal(self): """Test to equal.""" - other = Metric([Function("f", self.a, self.b)], Metric.MINIMIZE) + other = Metric(NumericFunction("func", self.a, self.b), Metric.MINIMIZE) assert self.minimize_metric == other def test_to_str(self): """Test to string.""" assert ( str(self.maximize_metric) - == f"{self.maximize_metric.optimization} {' '.join(map(str, self.maximize_metric.functions))}" + == f"{self.maximize_metric.optimization} {self.maximize_metric.expression}" ) def test_to_repr(self): """Test to repr.""" assert ( - repr(self.minimize_metric) - == f"Metric({*self.maximize_metric.functions,}, minimize)" + repr(self.maximize_metric) + == f"Metric({self.maximize_metric.expression}, {self.maximize_metric.optimization})" ) diff --git a/tests/test_problem.py b/tests/test_problem.py index 5b086034..49c02c8b 100644 --- a/tests/test_problem.py +++ b/tests/test_problem.py @@ -20,7 +20,7 @@ from pddl.logic.base import And, Not from pddl.logic.functions import EqualTo as FunctionEqualTo from pddl.logic.functions import ( - Function, + NumericFunction, GreaterEqualThan, GreaterThan, LesserEqualThan, @@ -117,8 +117,8 @@ def test_build_problem_with_metric_list(): o1, o2 = constants("o1 o2") p = Predicate("p", x, y) q = Predicate("q") - cost1 = Function("cost1", x, y) - cost2 = Function("cost2") + cost1 = NumericFunction("cost1", x, y) + cost2 = NumericFunction("cost2") problem = Problem( "simple_problem", domain_name="simple_domain", @@ -136,8 +136,8 @@ def test_build_problem_with_numeric_goal(): o1, o2 = constants("o1 o2") p = Predicate("p", x, y) q = Predicate("q") - cost1 = Function("cost1", x, y) - cost2 = Function("cost2") + cost1 = NumericFunction("cost1", x, y) + cost2 = NumericFunction("cost2") problem = Problem( "simple_problem", domain_name="simple_domain", From 3c090f4fb19a53849c26520bab4032bc54c46031 Mon Sep 17 00:00:00 2001 From: Francesco Fuggitti Date: Thu, 12 Oct 2023 19:25:28 -0400 Subject: [PATCH 46/65] add numericValue and totalCost rules in the type checker --- pddl/_validation.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pddl/_validation.py b/pddl/_validation.py index 57f660c8..95034115 100644 --- a/pddl/_validation.py +++ b/pddl/_validation.py @@ -34,8 +34,10 @@ LesserThan, Minus, NumericFunction, + NumericValue, Plus, Times, + TotalCost, ) from pddl.logic.predicates import DerivedPredicate, EqualTo from pddl.logic.terms import Term @@ -252,6 +254,16 @@ def _(self, function: NumericFunction) -> None: """Check types annotations of a PDDL numeric function.""" self.check_type(function.terms) + @check_type.register + def _(self, _: NumericValue) -> None: + """Check types annotations of a PDDL numeric value operator.""" + return None + + @check_type.register + def _(self, _: TotalCost) -> None: + """Check types annotations of a PDDL numeric total-cost operator.""" + return None + @check_type.register def _(self, equal_to: FunctionEqualTo) -> None: """Check types annotations of a PDDL numeric equal to operator.""" From 1cf756077558fd100ef4d5e3370ee9ad124f2223 Mon Sep 17 00:00:00 2001 From: Francesco Fuggitti Date: Thu, 12 Oct 2023 19:28:02 -0400 Subject: [PATCH 47/65] add scaleUp and scaleDown operators to complete the domain parsing of numeric fluents, fix numEffect in domain parsing --- pddl/_validation.py | 12 +++++++++++- pddl/logic/functions.py | 30 +++++++++++++++++++++++++++++- pddl/parser/common.lark | 3 +++ pddl/parser/domain.lark | 8 +++++++- pddl/parser/domain.py | 25 ++++++++++++++++--------- pddl/parser/symbols.py | 2 ++ 6 files changed, 68 insertions(+), 12 deletions(-) diff --git a/pddl/_validation.py b/pddl/_validation.py index 95034115..e10ba64b 100644 --- a/pddl/_validation.py +++ b/pddl/_validation.py @@ -24,7 +24,7 @@ from pddl.logic import Predicate from pddl.logic.base import BinaryOp, QuantifiedCondition, UnaryOp from pddl.logic.effects import AndEffect, Forall, When -from pddl.logic.functions import Assign, Decrease, Divide +from pddl.logic.functions import Assign, Decrease, Divide, ScaleUp, ScaleDown from pddl.logic.functions import EqualTo as FunctionEqualTo from pddl.logic.functions import ( GreaterEqualThan, @@ -294,6 +294,16 @@ def _(self, assign: Assign) -> None: """Check types annotations of a PDDL numeric assign to.""" self.check_type(assign.operands) + @check_type.register + def _(self, scale_up: ScaleUp) -> None: + """Check types annotations of a PDDL numeric assign to.""" + self.check_type(scale_up.operands) + + @check_type.register + def _(self, scale_down: ScaleDown) -> None: + """Check types annotations of a PDDL numeric assign to.""" + self.check_type(scale_down.operands) + @check_type.register def _(self, increase: Increase) -> None: """Check types annotations of a PDDL numeric increase to.""" diff --git a/pddl/logic/functions.py b/pddl/logic/functions.py index 5865ac2e..a999ef6a 100644 --- a/pddl/logic/functions.py +++ b/pddl/logic/functions.py @@ -156,7 +156,7 @@ class TotalCost(NumericFunction): def __init__(self): """Initialize the function.""" - super().__init__("total-cost") + super().__init__("total-cost", *[]) class Metric(Atomic): @@ -258,6 +258,34 @@ def __init__(self, *operands: FunctionExpression): super().__init__(*operands) +class ScaleUp(BinaryFunction): + """Scale-Up operator.""" + + SYMBOL = Symbols.SCALE_UP + + def __init__(self, *operands: FunctionExpression): + """ + Initialize the Scale-Up operator. + + :param operands: the operands. + """ + super().__init__(*operands) + + +class ScaleDown(BinaryFunction): + """Scale-Down operator.""" + + SYMBOL = Symbols.SCALE_DOWN + + def __init__(self, *operands: FunctionExpression): + """ + Initialize the Scale-Down operator. + + :param operands: the operands. + """ + super().__init__(*operands) + + class Increase(BinaryFunction): """Increase operator.""" diff --git a/pddl/parser/common.lark b/pddl/parser/common.lark index c8bd78e6..02d97283 100644 --- a/pddl/parser/common.lark +++ b/pddl/parser/common.lark @@ -50,6 +50,9 @@ PLUS: "+" TIMES: "*" DIVIDE: "/" METRIC: ":metric" +ASSIGN: "assign" +SCALE_UP: "scale-up" +SCALE_DOWN: "scale-down" INCREASE: "increase" DECREASE: "decrease" MAXIMIZE: "maximize" diff --git a/pddl/parser/domain.lark b/pddl/parser/domain.lark index ca36b0f0..f7476597 100644 --- a/pddl/parser/domain.lark +++ b/pddl/parser/domain.lark @@ -77,7 +77,10 @@ f_exp: NUMBER f_head: NAME | LPAR NAME term* RPAR -?assign_op: INCREASE +?assign_op: ASSIGN + | SCALE_UP + | SCALE_DOWN + | INCREASE | DECREASE typed_list_variable: variable* @@ -129,6 +132,9 @@ type_def: LPAR EITHER primitive_type+ RPAR %import .common.TIMES -> TIMES %import .common.DIVIDE -> DIVIDE %import .common.NUMBER -> NUMBER +%import .common.ASSIGN -> ASSIGN +%import .common.SCALE_UP -> SCALE_UP +%import .common.SCALE_DOWN -> SCALE_DOWN %import .common.INCREASE -> INCREASE %import .common.DECREASE -> DECREASE %import .common.TOTAL_COST -> TOTAL_COST diff --git a/pddl/parser/domain.py b/pddl/parser/domain.py index 2658e4de..3452b27e 100644 --- a/pddl/parser/domain.py +++ b/pddl/parser/domain.py @@ -23,7 +23,7 @@ from pddl.helpers.base import assert_ from pddl.logic.base import And, ExistsCondition, ForallCondition, Imply, Not, OneOf, Or from pddl.logic.effects import AndEffect, Forall, When -from pddl.logic.functions import Decrease, Divide +from pddl.logic.functions import Assign, Decrease, Divide from pddl.logic.functions import EqualTo as FunctionEqualTo from pddl.logic.functions import ( FunctionExpression, @@ -36,6 +36,8 @@ NumericFunction, NumericValue, Plus, + ScaleDown, + ScaleUp, Times, TotalCost, ) @@ -293,13 +295,18 @@ def cond_effect(self, args): def num_effect(self, args): """Process the 'num_effect' rule.""" - function = args[2] - value = args[3] - if args[1] == Symbols.INCREASE.value: - return Increase(function, value) - if args[1] == Symbols.DECREASE.value: - return Decrease(function, value) - raise PDDLParsingError("Assign operator not recognized") + if args[1] == Symbols.ASSIGN.value: + return Assign(args[2], args[3]) + elif args[1] == Symbols.SCALE_UP.value: + return ScaleUp(args[2], args[3]) + elif args[1] == Symbols.SCALE_DOWN.value: + return ScaleDown(args[2], args[3]) + elif args[1] == Symbols.INCREASE.value: + return Increase(args[2], args[3]) + elif args[1] == Symbols.DECREASE.value: + return Decrease(args[2], args[3]) + else: + raise PDDLParsingError(f"Unrecognized assign operator: {args[1]}") def atomic_formula_term(self, args): """Process the 'atomic_formula_term' rule.""" @@ -357,7 +364,7 @@ def atomic_function_skeleton(self, args): def f_exp(self, args): """Process the 'f_exp' rule.""" if len(args) == 1: - if isinstance(args[0], (int, float)): + if float(args[0]): return NumericValue(args[0]) return args[0] op = None diff --git a/pddl/parser/symbols.py b/pddl/parser/symbols.py index 97e71aab..283f7849 100644 --- a/pddl/parser/symbols.py +++ b/pddl/parser/symbols.py @@ -61,6 +61,8 @@ class Symbols(Enum): TIMES = "*" DIVIDE = "/" ASSIGN = "assign" + SCALE_UP = "scale-up" + SCALE_DOWN = "scale-down" INCREASE = "increase" DECREASE = "decrease" MAXIMIZE = "maximize" From 673f53951ec76fec1a11a55856a629fc4db2ca6c Mon Sep 17 00:00:00 2001 From: Francesco Fuggitti Date: Thu, 12 Oct 2023 19:30:29 -0400 Subject: [PATCH 48/65] apply isort check --- pddl/_validation.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pddl/_validation.py b/pddl/_validation.py index e10ba64b..ba5a8dde 100644 --- a/pddl/_validation.py +++ b/pddl/_validation.py @@ -24,7 +24,7 @@ from pddl.logic import Predicate from pddl.logic.base import BinaryOp, QuantifiedCondition, UnaryOp from pddl.logic.effects import AndEffect, Forall, When -from pddl.logic.functions import Assign, Decrease, Divide, ScaleUp, ScaleDown +from pddl.logic.functions import Assign, Decrease, Divide from pddl.logic.functions import EqualTo as FunctionEqualTo from pddl.logic.functions import ( GreaterEqualThan, @@ -36,6 +36,8 @@ NumericFunction, NumericValue, Plus, + ScaleDown, + ScaleUp, Times, TotalCost, ) From 4013d44516ea5e5915094a718c42b1a2b76208b1 Mon Sep 17 00:00:00 2001 From: Francesco Fuggitti Date: Fri, 13 Oct 2023 09:43:35 -0400 Subject: [PATCH 49/65] fix domain and problem parsing --- pddl/parser/domain.py | 2 +- pddl/parser/problem.lark | 8 ++++++-- pddl/parser/problem.py | 23 ++++++++++++++++++++++- 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/pddl/parser/domain.py b/pddl/parser/domain.py index 3452b27e..70603771 100644 --- a/pddl/parser/domain.py +++ b/pddl/parser/domain.py @@ -364,7 +364,7 @@ def atomic_function_skeleton(self, args): def f_exp(self, args): """Process the 'f_exp' rule.""" if len(args) == 1: - if float(args[0]): + if not isinstance(args[0], NumericFunction): return NumericValue(args[0]) return args[0] op = None diff --git a/pddl/parser/problem.lark b/pddl/parser/problem.lark index cef3bd7c..c6951a87 100644 --- a/pddl/parser/problem.lark +++ b/pddl/parser/problem.lark @@ -29,10 +29,14 @@ gd_name: atomic_formula_name | LPAR AND gd_name* RPAR | LPAR binary_comp f_exp f_exp RPAR -?f_exp: NUMBER +f_exp: NUMBER + | LPAR binary_op f_exp f_exp RPAR + | LPAR multi_op f_exp f_exp+ RPAR + | LPAR MINUS f_exp RPAR | f_head + f_head: NAME - | LPAR NAME term* RPAR + | LPAR NAME term* RPAR metric_spec: LPAR METRIC optimization metric_f_exp RPAR diff --git a/pddl/parser/problem.py b/pddl/parser/problem.py index cb1a8364..f3ea36e7 100644 --- a/pddl/parser/problem.py +++ b/pddl/parser/problem.py @@ -190,6 +190,27 @@ def atomic_formula_name(self, args): ] return Predicate(name, *terms) + def f_exp(self, args): + """Process the 'f_exp' rule.""" + if len(args) == 1: + if not isinstance(args[0], NumericFunction): + return NumericValue(args[0]) + return args[0] + op = None + if args[1] == Symbols.MINUS.value: + op = Minus + if args[1] == Symbols.PLUS.value: + op = Plus + if args[1] == Symbols.TIMES.value: + op = Times + if args[1] == Symbols.DIVIDE.value: + op = Divide + return ( + op(*args[2:-1]) + if op is not None + else PDDLParsingError("Operator not recognized") + ) + def f_head(self, args): """Process the 'f_head' rule.""" if len(args) == 1: @@ -210,7 +231,7 @@ def metric_spec(self, args): def metric_f_exp(self, args): """Process the 'metric_f_exp' rule.""" if len(args) == 1: - if isinstance(args[0], (int, float)): + if not isinstance(args[0], NumericFunction): return NumericValue(args[0]) return args[0] op = None From b109722f9bf29cdac0e2fc796e96d709c9d6d044 Mon Sep 17 00:00:00 2001 From: Francesco Fuggitti Date: Fri, 13 Oct 2023 09:44:43 -0400 Subject: [PATCH 50/65] update tests to reflect the new data structure --- pddl/logic/functions.py | 6 ++- .../pddl_files/earth_observation/domain.pddl | 6 ++- tests/test_domain.py | 25 +++++---- tests/test_formatter.py | 5 +- tests/test_function.py | 54 ------------------- tests/test_functions.py | 25 ++++++--- tests/test_problem.py | 2 +- 7 files changed, 46 insertions(+), 77 deletions(-) delete mode 100644 tests/test_function.py diff --git a/pddl/logic/functions.py b/pddl/logic/functions.py index a999ef6a..68b5d162 100644 --- a/pddl/logic/functions.py +++ b/pddl/logic/functions.py @@ -107,6 +107,10 @@ def value(self) -> float: """Get the value.""" return self._value + def __eq__(self, other): + """Compare with another object.""" + return isinstance(other, NumericValue) and self.value == other.value + def __hash__(self) -> int: """Compute the hash of the object.""" return hash(self._value) @@ -127,7 +131,7 @@ def __init__(self, *operands: FunctionExpression): :param operands: the operands. """ - self._operands = list(operands) + self._operands = operands @property def operands(self) -> Sequence[FunctionExpression]: diff --git a/tests/fixtures/pddl_files/earth_observation/domain.pddl b/tests/fixtures/pddl_files/earth_observation/domain.pddl index 5f87ad5b..6851a550 100644 --- a/tests/fixtures/pddl_files/earth_observation/domain.pddl +++ b/tests/fixtures/pddl_files/earth_observation/domain.pddl @@ -1,5 +1,5 @@ (define (domain earth_observation) - (:requirements :strips :typing :equality :non-deterministic) + (:requirements :strips :typing :equality :non-deterministic :action-costs) (:types patch - object @@ -18,7 +18,9 @@ (is-target ?p - patch) (scanned ?p - patch) ) - + + (:functions (total-cost)) + (:action slew :parameters (?p ?n - patch ?d - cost-direction) :precondition diff --git a/tests/test_domain.py b/tests/test_domain.py index c409b56c..9072be2c 100644 --- a/tests/test_domain.py +++ b/tests/test_domain.py @@ -25,12 +25,13 @@ from pddl.logic.functions import Decrease from pddl.logic.functions import EqualTo as FunctionEqualTo from pddl.logic.functions import ( - NumericFunction, GreaterEqualThan, GreaterThan, Increase, LesserEqualThan, LesserThan, + NumericFunction, + NumericValue, TotalCost, ) from pddl.logic.helpers import constants, variables @@ -126,15 +127,17 @@ def test_build_domain_with_numeric_fluents(): "action_1", [x, y, z], precondition=p - & FunctionEqualTo(func1, 0) - & GreaterThan(func2, 1) - & LesserThan(func3, 5), + & FunctionEqualTo(func1, NumericValue(0)) + & GreaterThan(func2, NumericValue(1)) + & LesserThan(func3, NumericValue(5)), effect=Not(p) | q, ) action_2 = Action( "action_2", [x, y, z], - precondition=r & GreaterEqualThan(func1, 1) & LesserEqualThan(func2, 5), + precondition=r + & GreaterEqualThan(func1, NumericValue(1)) + & LesserEqualThan(func2, NumericValue(5)), effect=Not(p) | q, ) domain = Domain( @@ -158,14 +161,16 @@ def test_build_domain_with_action_cost(): action_1 = Action( "action_1", [x, y, z], - precondition=p & FunctionEqualTo(cost1, 0) & GreaterThan(cost2, 1), - effect=Not(p) & Increase(cost1, 1), + precondition=p + & FunctionEqualTo(cost1, NumericValue(0)) + & GreaterThan(cost2, NumericValue(1)), + effect=Not(p) & Increase(cost1, NumericValue(1)), ) action_2 = Action( "action_2", [x, y, z], - precondition=r & GreaterEqualThan(cost1, 1), - effect=(Not(p) | q) & Decrease(cost2, 1), + precondition=r & GreaterEqualThan(cost1, NumericValue(1)), + effect=(Not(p) | q) & Decrease(cost2, NumericValue(1)), ) domain = Domain( "domain_with_numeric", @@ -187,7 +192,7 @@ def test_build_domain_with_total_cost(): "action_1", [x, y, z], precondition=p & q, - effect=Not(p) & Increase(total_cost, 1), + effect=Not(p) & Increase(total_cost, NumericValue(1)), ) domain = Domain( "domain_with_total_cost", diff --git a/tests/test_formatter.py b/tests/test_formatter.py index fe468127..359d8c87 100644 --- a/tests/test_formatter.py +++ b/tests/test_formatter.py @@ -25,13 +25,12 @@ from pddl.logic.effects import AndEffect from pddl.logic.functions import ( EqualTo, - NumericFunction, GreaterEqualThan, Increase, LesserEqualThan, + NumericFunction, NumericValue, ) - from pddl.requirements import Requirements from tests.conftest import DOMAIN_FILES, PROBLEM_FILES @@ -126,7 +125,7 @@ def test_numerical_hello_world_domain_formatter(): domain = Domain( name="hello-world-functions", requirements=[Requirements.STRIPS, Requirements.NUMERIC_FLUENTS], - NumericFunctions=[hello_counter], + functions=[hello_counter], actions=[action], ) diff --git a/tests/test_function.py b/tests/test_function.py deleted file mode 100644 index 6a9522e3..00000000 --- a/tests/test_function.py +++ /dev/null @@ -1,54 +0,0 @@ -# -# Copyright 2021-2023 WhiteMech -# -# ------------------------------ -# -# This file is part of pddl. -# -# Use of this source code is governed by an MIT-style -# license that can be found in the LICENSE file or at -# https://opensource.org/licenses/MIT. -# -"""This module contains tests for a PDDL function.""" - -from pddl.logic import variables -from pddl.logic.functions import NumericFunction, NumericValue - - -class TestFunctionEmpty: - """Test the empty function.""" - - def setup_method(self): - """Set up the tests.""" - self.function = NumericFunction("empty_function") - - def test_name(self): - """Test the name getter.""" - assert self.function.name == "empty_function" - - def test_terms(self): - """Test the parameters getter.""" - assert self.function.terms == () - - def test_arity(self): - """Test the arity getter.""" - assert self.function.arity == 0 - - -def test_build_simple_function(): - """Test a simple PDDL action.""" - x, y, z = variables("x y z", types=["type1"]) - function = NumericFunction("simple_function", x, y, z) - assert function - - -class TestNumericValue: - """Test the numeric value.""" - - def setup_method(self): - """Set up the tests.""" - self.numeric_value = NumericValue(3) - - def test_value(self): - """Test the name getter.""" - assert self.numeric_value.value == 3 diff --git a/tests/test_functions.py b/tests/test_functions.py index c8d17ca1..3f8a912a 100644 --- a/tests/test_functions.py +++ b/tests/test_functions.py @@ -13,16 +13,16 @@ """This module contains tests for PDDL functions.""" import pytest -from pddl.logic.functions import Metric, TotalCost, NumericFunction +from pddl.logic.functions import Metric, NumericFunction, NumericValue, TotalCost from pddl.logic.helpers import variables -class TestFunctionSimpleInitialisation: - """Test simple function initialisation.""" +class TestNumericFunction: + """Test simple numeric function.""" def setup_method(self): """Set up the tests.""" - self.a, self.b = variables("a b") + self.a, self.b = variables("a b", types=["type1"]) self.function = NumericFunction("func", self.a, self.b) def test_name(self): @@ -39,7 +39,7 @@ def test_arity(self): def test_to_equal(self): """Test to equal.""" - other = NumericFunction("f", self.a, self.b) + other = NumericFunction("func", self.a, self.b) assert self.function == other def test_to_str(self): @@ -49,7 +49,8 @@ def test_to_str(self): def test_to_repr(self): """Test to repr.""" assert ( - repr(self.function) == f"NumericFunction({self.function.name}, {self.a}, {self.b})" + repr(self.function) + == f"NumericFunction({self.function.name}, {self.a}, {self.b})" ) @@ -117,3 +118,15 @@ def test_to_repr(self): repr(self.maximize_metric) == f"Metric({self.maximize_metric.expression}, {self.maximize_metric.optimization})" ) + + +class TestNumericValue: + """Test the numeric value.""" + + def setup_method(self): + """Set up the tests.""" + self.numeric_value = NumericValue(3) + + def test_value(self): + """Test the name getter.""" + assert self.numeric_value.value == 3 diff --git a/tests/test_problem.py b/tests/test_problem.py index 49c02c8b..a04fef2c 100644 --- a/tests/test_problem.py +++ b/tests/test_problem.py @@ -20,12 +20,12 @@ from pddl.logic.base import And, Not from pddl.logic.functions import EqualTo as FunctionEqualTo from pddl.logic.functions import ( - NumericFunction, GreaterEqualThan, GreaterThan, LesserEqualThan, LesserThan, Metric, + NumericFunction, TotalCost, ) from pddl.logic.helpers import constants, variables From a2b8d9951d26cac448ce1221d249e15d69fb41ce Mon Sep 17 00:00:00 2001 From: Francesco Fuggitti Date: Fri, 13 Oct 2023 09:44:54 -0400 Subject: [PATCH 51/65] add new tests --- tests/test_function_operators.py | 190 ++++++++++++++++++++++++++++--- 1 file changed, 175 insertions(+), 15 deletions(-) diff --git a/tests/test_function_operators.py b/tests/test_function_operators.py index 4f2a473a..2091d488 100644 --- a/tests/test_function_operators.py +++ b/tests/test_function_operators.py @@ -11,47 +11,207 @@ # """This module contains tests for PDDL function operators.""" from pddl.logic import variables -from pddl.logic.functions import NumericFunction +from pddl.logic.functions import ( + EqualTo, + GreaterEqualThan, + GreaterThan, + LesserEqualThan, + LesserThan, + NumericFunction, +) from pddl.parser.symbols import Symbols -class TestFunctionOperators: - """Test the function operators.""" +class TestFunctionEqualTo: + """Test the function equal to.""" def setup_method(self): """Set up the tests.""" x, y = variables("x y", types=["type1"]) z = variables("z", types=["type2"]) - self.function = NumericFunction("function_1", x, y, z) + self.function_1 = NumericFunction("function_1", x, y) + self.function_2 = NumericFunction("function_2", *z) + self.equal_to = EqualTo(self.function_1, self.function_2) + def test_function(self): + """Test the function getter.""" + assert self.equal_to.operands == (self.function_1, self.function_2) + + def test_symbol(self): + """Test the symbol getter.""" + assert self.equal_to.SYMBOL == Symbols.EQUAL + + def test_str(self): + """Test the str operator.""" + assert ( + str(self.equal_to) + == f"({self.equal_to.SYMBOL.value} {self.function_1} {self.function_2})" + ) + + def test_repr(self): + """Test the repr operator.""" + assert ( + repr(self.equal_to) + == f"EqualTo(({repr(self.function_1)}, {repr(self.function_2)}))" + ) + + def test_equal(self): + """Test the equal operator.""" + other = EqualTo(self.function_1, self.function_2) + assert self.equal_to == other + + +class TestFunctionLesser: + """Test the function lesser than.""" + + def setup_method(self): + """Set up the tests.""" + x, y = variables("x y", types=["type1"]) + z = variables("z", types=["type2"]) + self.function_1 = NumericFunction("function_1", x, y) + self.function_2 = NumericFunction("function_2", *z) + self.lesser = LesserThan(self.function_1, self.function_2) + + def test_function(self): + """Test the function getter.""" + assert self.lesser.operands == (self.function_1, self.function_2) + + def test_symbol(self): + """Test the symbol getter.""" + assert self.lesser.SYMBOL == Symbols.LESSER + + def test_str(self): + """Test the str operator.""" + assert ( + str(self.lesser) + == f"({self.lesser.SYMBOL.value} {self.function_1} {self.function_2})" + ) + + def test_repr(self): + """Test the repr operator.""" + assert ( + repr(self.lesser) + == f"LesserThan(({repr(self.function_1)}, {repr(self.function_2)}))" + ) + + def test_equal(self): + """Test the equal operator.""" + other = LesserThan(self.function_1, self.function_2) + assert self.lesser == other + + +class TestFunctionLesserOrEqual: + """Test the function lesser or equal than.""" + + def setup_method(self): + """Set up the tests.""" + x, y = variables("x y", types=["type1"]) + z = variables("z", types=["type2"]) + self.function_1 = NumericFunction("function_1", x, y) + self.function_2 = NumericFunction("function_2", *z) + self.lesser_or_equal = LesserEqualThan(self.function_1, self.function_2) def test_function(self): """Test the function getter.""" - assert self.function_op.function == self.function + assert self.lesser_or_equal.operands == (self.function_1, self.function_2) def test_symbol(self): """Test the symbol getter.""" - assert self.function_op.symbol == Symbols.EQUAL + assert self.lesser_or_equal.SYMBOL == Symbols.LESSER_EQUAL - def test_value(self): - """Test the value getter.""" - assert self.function_op.value == 3 + def test_str(self): + """Test the str operator.""" + assert ( + str(self.lesser_or_equal) + == f"({self.lesser_or_equal.SYMBOL.value} {self.function_1} {self.function_2})" + ) + + def test_repr(self): + """Test the repr operator.""" + assert ( + repr(self.lesser_or_equal) + == f"LesserEqualThan(({repr(self.function_1)}, {repr(self.function_2)}))" + ) def test_equal(self): """Test the equal operator.""" - other = FunctionOperator(self.function, 3, Symbols.EQUAL.value) - assert self.function_op == other + other = LesserEqualThan(self.function_1, self.function_2) + assert self.lesser_or_equal == other + + +class TestFunctionGreater: + """Test the function greater than.""" + + def setup_method(self): + """Set up the tests.""" + x, y = variables("x y", types=["type1"]) + z = variables("z", types=["type2"]) + self.function_1 = NumericFunction("function_1", x, y) + self.function_2 = NumericFunction("function_2", *z) + self.greater = GreaterThan(self.function_1, self.function_2) + + def test_function(self): + """Test the function getter.""" + assert self.greater.operands == (self.function_1, self.function_2) + + def test_symbol(self): + """Test the symbol getter.""" + assert self.greater.SYMBOL == Symbols.GREATER def test_str(self): """Test the str operator.""" assert ( - str(self.function_op) - == f"({self.function_op.symbol.value} {self.function} {self.function_op.value})" + str(self.greater) + == f"({self.greater.SYMBOL.value} {self.function_1} {self.function_2})" ) def test_repr(self): """Test the repr operator.""" assert ( - repr(self.function_op) - == f"FunctionOperator({self.function}, {self.function_op.value})" + repr(self.greater) + == f"GreaterThan(({repr(self.function_1)}, {repr(self.function_2)}))" ) + + def test_equal(self): + """Test the equal operator.""" + other = GreaterThan(self.function_1, self.function_2) + assert self.greater == other + + +class TestFunctionGreaterOrEqual: + """Test the function greater or equal than.""" + + def setup_method(self): + """Set up the tests.""" + x, y = variables("x y", types=["type1"]) + z = variables("z", types=["type2"]) + self.function_1 = NumericFunction("function_1", x, y) + self.function_2 = NumericFunction("function_2", *z) + self.greater_or_equal = GreaterEqualThan(self.function_1, self.function_2) + + def test_function(self): + """Test the function getter.""" + assert self.greater_or_equal.operands == (self.function_1, self.function_2) + + def test_symbol(self): + """Test the symbol getter.""" + assert self.greater_or_equal.SYMBOL == Symbols.GREATER_EQUAL + + def test_str(self): + """Test the str operator.""" + assert ( + str(self.greater_or_equal) + == f"({self.greater_or_equal.SYMBOL.value} {self.function_1} {self.function_2})" + ) + + def test_repr(self): + """Test the repr operator.""" + assert ( + repr(self.greater_or_equal) + == f"GreaterEqualThan(({repr(self.function_1)}, {repr(self.function_2)}))" + ) + + def test_equal(self): + """Test the equal operator.""" + other = GreaterEqualThan(self.function_1, self.function_2) + assert self.greater_or_equal == other From 0e6c35924abf6157829b3e4a7abba6ef269f0b25 Mon Sep 17 00:00:00 2001 From: Francesco Fuggitti Date: Fri, 13 Oct 2023 09:45:08 -0400 Subject: [PATCH 52/65] update readme and whitelist --- README.md | 4 +- scripts/whitelist.py | 114 +++++++++++++++++++++++++------------------ 2 files changed, 68 insertions(+), 50 deletions(-) diff --git a/README.md b/README.md index caa3e752..d6f24a5b 100644 --- a/README.md +++ b/README.md @@ -183,7 +183,7 @@ requirements: - [x] `:quantified-preconditions` - [x] `:conditional-effects` - [ ] `:fluents` -- [ ] `:numeric-fluents` +- [x] `:numeric-fluents` - [x] `:non-deterministic` (see [6th IPC: Uncertainty Part](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.163.7140&rep=rep1&type=pdf)) - [x] `:adl` - [ ] `:durative-actions` @@ -192,7 +192,7 @@ requirements: - [ ] `:timed-initial-literals` - [ ] `:preferences` - [ ] `:constraints` -- [ ] `:action-costs` +- [x] `:action-costs` ## Development diff --git a/scripts/whitelist.py b/scripts/whitelist.py index 6b2fcb53..5bc55779 100644 --- a/scripts/whitelist.py +++ b/scripts/whitelist.py @@ -1,58 +1,75 @@ -_._ # unused method (pddl/_validation.py:221) -_._ # unused method (pddl/_validation.py:227) -_._ # unused method (pddl/_validation.py:233) -_._ # unused method (pddl/_validation.py:238) +_._ # unused method (pddl/_validation.py:237) _._ # unused method (pddl/_validation.py:243) -_._ # unused method (pddl/_validation.py:248) +_._ # unused method (pddl/_validation.py:249) _._ # unused method (pddl/_validation.py:254) -_._ # unused method (pddl/_validation.py:260) -_._ # unused method (pddl/_validation.py:265) -_._ # unused method (pddl/_validation.py:270) -_._ # unused method (pddl/_validation.py:276) -_._ # unused method (pddl/_validation.py:281) -_._ # unused method (pddl/_validation.py:287) -_._ # unused method (pddl/_validation.py:293) +_._ # unused method (pddl/_validation.py:259) +_._ # unused method (pddl/_validation.py:264) +_._ # unused method (pddl/_validation.py:269) +_._ # unused method (pddl/_validation.py:274) +_._ # unused method (pddl/_validation.py:279) +_._ # unused method (pddl/_validation.py:284) +_._ # unused method (pddl/_validation.py:289) +_._ # unused method (pddl/_validation.py:294) +_._ # unused method (pddl/_validation.py:299) +_._ # unused method (pddl/_validation.py:304) +_._ # unused method (pddl/_validation.py:309) +_._ # unused method (pddl/_validation.py:314) +_._ # unused method (pddl/_validation.py:319) +_._ # unused method (pddl/_validation.py:324) +_._ # unused method (pddl/_validation.py:329) +_._ # unused method (pddl/_validation.py:334) +_._ # unused method (pddl/_validation.py:339) +_._ # unused method (pddl/_validation.py:345) +_._ # unused method (pddl/_validation.py:351) +_._ # unused method (pddl/_validation.py:356) +_._ # unused method (pddl/_validation.py:361) +_._ # unused method (pddl/_validation.py:367) +_._ # unused method (pddl/_validation.py:372) +_._ # unused method (pddl/_validation.py:378) +_._ # unused method (pddl/_validation.py:384) to_names # unused function (pddl/custom_types.py:82) safe_get # unused function (pddl/helpers/base.py:111) find # unused function (pddl/helpers/base.py:116) -ensure_formula # unused function (pddl/logic/base.py:251) +ensure_formula # unused function (pddl/logic/base.py:234) PEffect # unused variable (pddl/logic/effects.py:168) Effect # unused variable (pddl/logic/effects.py:170) CondEffect # unused variable (pddl/logic/effects.py:171) -AssignTo # unused class (pddl/logic/functions.py:271) -_._predicates_by_name # unused attribute (pddl/parser/domain.py:53) -_._functions_by_name # unused attribute (pddl/parser/domain.py:54) -_.start # unused method (pddl/parser/domain.py:59) -_.domain_def # unused method (pddl/parser/domain.py:80) -_._predicates_by_name # unused attribute (pddl/parser/domain.py:110) -_._functions_by_name # unused attribute (pddl/parser/domain.py:116) -_.action_def # unused method (pddl/parser/domain.py:119) -_.action_parameters # unused method (pddl/parser/domain.py:137) -_.emptyor_pregd # unused method (pddl/parser/domain.py:144) -_.gd # unused method (pddl/parser/domain.py:227) -_.emptyor_effect # unused method (pddl/parser/domain.py:244) -_.c_effect # unused method (pddl/parser/domain.py:259) -_.p_effect # unused method (pddl/parser/domain.py:274) -_.cond_effect # unused method (pddl/parser/domain.py:281) -_.num_effect # unused method (pddl/parser/domain.py:289) -_.atomic_formula_term # unused method (pddl/parser/domain.py:299) -_.atomic_formula_skeleton # unused method (pddl/parser/domain.py:336) -_.atomic_function_skeleton # unused method (pddl/parser/domain.py:342) -_.f_head # unused method (pddl/parser/domain.py:352) -_.typed_list_variable # unused method (pddl/parser/domain.py:368) -_.type_def # unused method (pddl/parser/domain.py:391) -_.start # unused method (pddl/parser/problem.py:50) -_.problem_def # unused method (pddl/parser/problem.py:63) -_.problem_domain # unused method (pddl/parser/problem.py:67) -_.problem_requirements # unused method (pddl/parser/problem.py:71) -_.domain__type_def # unused method (pddl/parser/problem.py:94) -_.init_el # unused method (pddl/parser/problem.py:108) -_.literal_name # unused method (pddl/parser/problem.py:121) -_.basic_function_term # unused method (pddl/parser/problem.py:130) -_.gd_name # unused method (pddl/parser/problem.py:157) -_.atomic_formula_name # unused method (pddl/parser/problem.py:170) -_.f_head # unused method (pddl/parser/problem.py:186) -_.metric_spec # unused method (pddl/parser/problem.py:194) +_._predicates_by_name # unused attribute (pddl/parser/domain.py:60) +_._functions_by_name # unused attribute (pddl/parser/domain.py:61) +_.start # unused method (pddl/parser/domain.py:66) +_.domain_def # unused method (pddl/parser/domain.py:87) +_._predicates_by_name # unused attribute (pddl/parser/domain.py:117) +_._functions_by_name # unused attribute (pddl/parser/domain.py:123) +_.action_def # unused method (pddl/parser/domain.py:126) +_.action_parameters # unused method (pddl/parser/domain.py:144) +_.emptyor_pregd # unused method (pddl/parser/domain.py:151) +_.gd # unused method (pddl/parser/domain.py:234) +_.emptyor_effect # unused method (pddl/parser/domain.py:251) +_.c_effect # unused method (pddl/parser/domain.py:266) +_.p_effect # unused method (pddl/parser/domain.py:281) +_.cond_effect # unused method (pddl/parser/domain.py:288) +_.num_effect # unused method (pddl/parser/domain.py:296) +_.atomic_formula_term # unused method (pddl/parser/domain.py:311) +_.atomic_formula_skeleton # unused method (pddl/parser/domain.py:348) +_.atomic_function_skeleton # unused method (pddl/parser/domain.py:354) +_.f_exp # unused method (pddl/parser/domain.py:364) +_.f_head # unused method (pddl/parser/domain.py:385) +_.typed_list_variable # unused method (pddl/parser/domain.py:401) +_.type_def # unused method (pddl/parser/domain.py:424) +_.start # unused method (pddl/parser/problem.py:55) +_.problem_def # unused method (pddl/parser/problem.py:68) +_.problem_domain # unused method (pddl/parser/problem.py:72) +_.problem_requirements # unused method (pddl/parser/problem.py:76) +_.domain__type_def # unused method (pddl/parser/problem.py:99) +_.init_el # unused method (pddl/parser/problem.py:113) +_.literal_name # unused method (pddl/parser/problem.py:126) +_.basic_function_term # unused method (pddl/parser/problem.py:135) +_.gd_name # unused method (pddl/parser/problem.py:164) +_.atomic_formula_name # unused method (pddl/parser/problem.py:177) +_.f_exp # unused method (pddl/parser/problem.py:193) +_.f_head # unused method (pddl/parser/problem.py:214) +_.metric_spec # unused method (pddl/parser/problem.py:222) +_.metric_f_exp # unused method (pddl/parser/problem.py:231) OpSymbol # unused variable (pddl/parser/symbols.py:17) OpRequirement # unused variable (pddl/parser/symbols.py:18) ROUND_BRACKET_LEFT # unused variable (pddl/parser/symbols.py:24) @@ -73,4 +90,5 @@ REQUIREMENTS # unused variable (pddl/parser/symbols.py:51) TYPES # unused variable (pddl/parser/symbols.py:52) METRIC # unused variable (pddl/parser/symbols.py:53) -ALL_REQUIREMENTS # unused variable (pddl/parser/symbols.py:95) +ALL_REQUIREMENTS # unused variable (pddl/parser/symbols.py:104) +_.fluents_requirements # unused method (pddl/requirements.py:62) From 83de952eb3fb64cc05b64044ac9a4384e9951dcc Mon Sep 17 00:00:00 2001 From: Francesco Fuggitti Date: Fri, 13 Oct 2023 18:56:57 -0400 Subject: [PATCH 53/65] add the possibility to parse the deprecated number type of functions --- pddl/custom_types.py | 19 ++++++++++++++++++- pddl/logic/functions.py | 12 ++---------- pddl/parser/common.lark | 1 + pddl/parser/domain.lark | 11 +++++++++-- pddl/parser/domain.py | 16 +++++++++++----- 5 files changed, 41 insertions(+), 18 deletions(-) diff --git a/pddl/custom_types.py b/pddl/custom_types.py index ebfca087..39aec409 100644 --- a/pddl/custom_types.py +++ b/pddl/custom_types.py @@ -79,6 +79,23 @@ def parse_type(s: str) -> name: return name(s) +def parse_function(s: str) -> name: + """ + Parse a function name from a string. + + It performs two validations: + - the function name is not a keyword; + - the function name is a valid name, i.e. it matches the name regular expression. + + The function name 'total-cost' is allowed. + + :param s: the input string to be parsed + :return: the parsed name + """ + _check_not_a_keyword(s, "name", ignore={Symbols.TOTAL_COST.value}) + return name(s) + + def to_names(names: Collection[namelike]) -> List[name]: """From name-like sequence to list of names.""" return list(map(parse_name, names)) @@ -101,7 +118,7 @@ def _is_a_keyword(word: str, ignore: Optional[AbstractSet[str]] = None) -> bool: """Check that the word is not a keyword.""" ignore_set = ensure_set(ignore) # we remove the TOTAL_COST because it is not a keyword but a special function - return word not in ignore_set and word in ALL_SYMBOLS - {Symbols.TOTAL_COST.value} + return word not in ignore_set and word in ALL_SYMBOLS def _check_not_a_keyword( diff --git a/pddl/logic/functions.py b/pddl/logic/functions.py index 68b5d162..9a9cbf12 100644 --- a/pddl/logic/functions.py +++ b/pddl/logic/functions.py @@ -14,7 +14,7 @@ import functools from typing import Sequence -from pddl.custom_types import namelike, parse_name +from pddl.custom_types import namelike, parse_function from pddl.helpers.base import assert_ from pddl.helpers.cache_hash import cache_hash from pddl.logic.base import Atomic, MonotoneOp @@ -34,7 +34,7 @@ class NumericFunction(FunctionExpression): def __init__(self, name: namelike, *terms: Term): """Initialize the function.""" - self._name = parse_name(name) + self._name = parse_function(name) self._terms = tuple(terms) @property @@ -155,14 +155,6 @@ def __hash__(self) -> int: return hash((type(self), self.operands)) -class TotalCost(NumericFunction): - """A class for the total-cost function in PDDL.""" - - def __init__(self): - """Initialize the function.""" - super().__init__("total-cost", *[]) - - class Metric(Atomic): """A class for the metric function in PDDL.""" diff --git a/pddl/parser/common.lark b/pddl/parser/common.lark index 02d97283..64513f05 100644 --- a/pddl/parser/common.lark +++ b/pddl/parser/common.lark @@ -81,3 +81,4 @@ ACTION_COSTS: ":action-costs" LPAR : "(" RPAR : ")" TYPE_SEP: "-" +TYPE_NUMBER: "number" \ No newline at end of file diff --git a/pddl/parser/domain.lark b/pddl/parser/domain.lark index f7476597..6703c107 100644 --- a/pddl/parser/domain.lark +++ b/pddl/parser/domain.lark @@ -8,10 +8,16 @@ requirements: LPAR REQUIREMENTS require_key+ RPAR types: LPAR TYPES typed_list_name RPAR constants: LPAR CONSTANTS typed_list_name RPAR predicates: LPAR PREDICATES atomic_formula_skeleton+ RPAR -functions: LPAR FUNCTIONS atomic_function_skeleton+ RPAR +functions: LPAR FUNCTIONS f_typed_list_atomic_function_skeleton RPAR + atomic_formula_skeleton: LPAR NAME typed_list_variable RPAR + +f_typed_list_atomic_function_skeleton: atomic_function_skeleton+ + | (atomic_function_skeleton+ TYPE_SEP f_type_def)+ atomic_function_skeleton* + +?f_type_def: TYPE_NUMBER + atomic_function_skeleton: LPAR NAME typed_list_variable RPAR - | LPAR TOTAL_COST RPAR ?structure_def: action_def | derived_predicates action_def: LPAR ACTION NAME PARAMETERS action_parameters action_body_def RPAR @@ -141,4 +147,5 @@ type_def: LPAR EITHER primitive_type+ RPAR %import .common.LPAR -> LPAR %import .common.RPAR -> RPAR %import .common.TYPE_SEP -> TYPE_SEP +%import .common.TYPE_NUMBER -> TYPE_NUMBER diff --git a/pddl/parser/domain.py b/pddl/parser/domain.py index 70603771..dd600dfd 100644 --- a/pddl/parser/domain.py +++ b/pddl/parser/domain.py @@ -39,7 +39,6 @@ ScaleDown, ScaleUp, Times, - TotalCost, ) from pddl.logic.predicates import DerivedPredicate, EqualTo, Predicate from pddl.logic.terms import Constant, Variable @@ -119,9 +118,8 @@ def predicates(self, args): def functions(self, args): """Process the 'functions' rule.""" - functions = args[2:-1] - self._functions_by_name = {f.name: f for f in functions} - return dict(functions=functions) + function_definition = args[2] + return dict(functions=function_definition) def action_def(self, args): """Process the 'action_def' rule.""" @@ -356,7 +354,7 @@ def atomic_function_skeleton(self, args): if args[1] == Symbols.TOTAL_COST.value: if not bool({Requirements.ACTION_COSTS}): raise PDDLMissingRequirementError(Requirements.ACTION_COSTS) - return TotalCost() + return NumericFunction("total-cost") function_name = args[1] variables = self._formula_skeleton(args) return NumericFunction(function_name, *variables) @@ -413,6 +411,14 @@ def typed_list_variable(self, args) -> Tuple[Tuple[name, Set[name]], ...]: except ValueError as e: raise self._raise_typed_list_parsing_error(args, e) from e + def f_typed_list_atomic_function_skeleton(self, args): + """Process the 'f_typed_list_atomic_function_skeleton' rule.""" + try: + types_index = TypedListParser.parse_typed_list(args) + return types_index.get_typed_list_of_names() + except ValueError as e: + raise self._raise_typed_list_parsing_error(args, e) from e + def _raise_typed_list_parsing_error(self, args, exception) -> PDDLParsingError: string_list = [ str(arg) if isinstance(arg, str) else list(map(str, arg)) for arg in args From 09ddc10ab328f9e51194c3376e1ee5e8a7e813bc Mon Sep 17 00:00:00 2001 From: Francesco Fuggitti Date: Fri, 13 Oct 2023 18:59:43 -0400 Subject: [PATCH 54/65] adjust data structure to parse typed functions --- pddl/_validation.py | 73 +++++++++++++++++++++++++++++--- pddl/core.py | 38 ++++------------- pddl/formatter.py | 31 ++++++++------ pddl/logic/terms.py | 4 +- pddl/parser/typed_list_parser.py | 63 +++++++++++++-------------- 5 files changed, 128 insertions(+), 81 deletions(-) diff --git a/pddl/_validation.py b/pddl/_validation.py index ba5a8dde..895d8712 100644 --- a/pddl/_validation.py +++ b/pddl/_validation.py @@ -17,6 +17,7 @@ from typing import AbstractSet, Collection, Dict, Optional, Set, Tuple, cast from pddl.action import Action +from pddl.custom_types import _check_not_a_keyword # noqa: F401 from pddl.custom_types import name as name_type from pddl.custom_types import namelike, to_names, to_types # noqa: F401 from pddl.exceptions import PDDLValidationError @@ -27,6 +28,7 @@ from pddl.logic.functions import Assign, Decrease, Divide from pddl.logic.functions import EqualTo as FunctionEqualTo from pddl.logic.functions import ( + FunctionExpression, GreaterEqualThan, GreaterThan, Increase, @@ -39,7 +41,6 @@ ScaleDown, ScaleUp, Times, - TotalCost, ) from pddl.logic.predicates import DerivedPredicate, EqualTo from pddl.logic.terms import Term @@ -261,11 +262,6 @@ def _(self, _: NumericValue) -> None: """Check types annotations of a PDDL numeric value operator.""" return None - @check_type.register - def _(self, _: TotalCost) -> None: - """Check types annotations of a PDDL numeric total-cost operator.""" - return None - @check_type.register def _(self, equal_to: FunctionEqualTo) -> None: """Check types annotations of a PDDL numeric equal to operator.""" @@ -387,3 +383,68 @@ def _(self, action: Action) -> None: self.check_type(action.parameters) self.check_type(action.precondition) self.check_type(action.effect) + + +class Functions: + """A class for representing and managing the numeric functions available in a PDDL Domain.""" + + def __init__( + self, + functions: Optional[Collection[FunctionExpression]] = None, + requirements: Optional[AbstractSet[Requirements]] = None, + skip_checks: bool = False, + ) -> None: + """Initialize the Functions object.""" + self._functions = ensure(functions, dict()) + self._all_function = self._get_all_functions() + + if not skip_checks: + self._check_total_cost(self._functions, ensure_set(requirements)) + + @property + def raw(self) -> Dict[NumericFunction, Optional[name_type]]: + """Get the raw functions' dictionary.""" + return self._functions + + @property + def all_functions(self) -> Set[NumericFunction]: + """Get all available functions.""" + return self._all_function + + def _get_all_functions(self) -> Set[NumericFunction]: + """Get all function supported by the domain.""" + if self._functions is None: + return set() + result = set(self._functions.keys()) | set(self._functions.values()) + result.discard(None) + return cast(Set[NumericFunction], result) + + @classmethod + def _check_total_cost( + cls, + function_dict: Dict[NumericFunction, Optional[name_type]], + requirements: AbstractSet[Requirements], + ) -> None: + """Check consistency of total-cost function with the requirements.""" + if bool(function_dict): + if any(f.name == Symbols.TOTAL_COST.value for f in {*function_dict}): + validate( + Requirements.ACTION_COSTS in requirements, + f"action costs requirement is not specified, but the {Symbols.TOTAL_COST.value} " + f"function is specified.", + ) + if any( + isinstance(f, FunctionExpression) + and not f.name == Symbols.TOTAL_COST.value + for f in function_dict.keys() + ): + validate( + Requirements.NUMERIC_FLUENTS in requirements, + "numeric-fluents requirement is not specified, but numeric fluents are specified.", + ) + else: + validate( + Requirements.NUMERIC_FLUENTS + in _extend_domain_requirements(requirements), + "numeric-fluents requirement is not specified, but numeric fluents are specified.", + ) diff --git a/pddl/core.py b/pddl/core.py index 44ccc8ac..d60f9549 100644 --- a/pddl/core.py +++ b/pddl/core.py @@ -18,6 +18,7 @@ from typing import AbstractSet, Collection, Dict, Optional, Tuple, cast from pddl._validation import ( + Functions, TypeChecker, Types, _check_types_in_has_terms_objects, @@ -28,10 +29,10 @@ from pddl.custom_types import namelike, parse_name, to_names, to_types # noqa: F401 from pddl.helpers.base import assert_, check, ensure, ensure_set from pddl.logic.base import And, Formula, is_literal -from pddl.logic.functions import FunctionExpression, Metric, TotalCost +from pddl.logic.functions import FunctionExpression, Metric, NumericFunction from pddl.logic.predicates import DerivedPredicate, Predicate from pddl.logic.terms import Constant -from pddl.requirements import Requirements, _extend_domain_requirements +from pddl.requirements import Requirements class Domain: @@ -59,6 +60,8 @@ def __init__( types is a dictionary mapping a type name to its ancestor. :param constants: the constants. :param predicates: the predicates. + :param functions: the functions. + functions is a dictionary mapping a function to its type. :param derived_predicates: the derived predicates. :param actions: the actions. """ @@ -69,7 +72,7 @@ def __init__( self._predicates = ensure_set(predicates) self._derived_predicates = ensure_set(derived_predicates) self._actions = ensure_set(actions) - self._functions = ensure_set(functions) + self._functions = Functions(functions, self._requirements) self._check_consistency() @@ -81,7 +84,6 @@ def _check_consistency(self) -> None: type_checker.check_type(self._actions) _check_types_in_has_terms_objects(self._actions, self._types.all_types) # type: ignore self._check_types_in_derived_predicates() - self._check_numeric_fluent_requirements() def _check_types_in_derived_predicates(self) -> None: """Check types in derived predicates.""" @@ -92,29 +94,6 @@ def _check_types_in_derived_predicates(self) -> None: ) _check_types_in_has_terms_objects(dp_list, self._types.all_types) - def _check_numeric_fluent_requirements(self) -> None: - """Check that the numeric-fluents requirement is specified.""" - if self._functions: - if any(isinstance(f, TotalCost) for f in self._functions): - validate( - Requirements.ACTION_COSTS in self._requirements, - "action costs requirement is not specified, but the total-cost function is specified.", - ) - if any( - isinstance(f, FunctionExpression) and not isinstance(f, TotalCost) - for f in self._functions - ): - validate( - Requirements.NUMERIC_FLUENTS in self._requirements, - "numeric-fluents requirement is not specified, but numeric fluents are specified.", - ) - else: - validate( - Requirements.NUMERIC_FLUENTS - in _extend_domain_requirements(self._requirements), - "numeric-fluents requirement is not specified, but numeric fluents are specified.", - ) - @property def name(self) -> name_type: """Get the name.""" @@ -136,9 +115,9 @@ def predicates(self) -> AbstractSet[Predicate]: return self._predicates @property - def functions(self) -> AbstractSet[FunctionExpression]: + def functions(self) -> Dict[NumericFunction, Optional[name_type]]: """Get the functions.""" - return self._functions + return self._functions.raw @property def derived_predicates(self) -> AbstractSet[DerivedPredicate]: @@ -164,6 +143,7 @@ def __eq__(self, other): and self.types == other.types and self.constants == other.constants and self.predicates == other.predicates + and self.functions == other.functions and self.derived_predicates == other.derived_predicates and self.actions == other.actions ) diff --git a/pddl/formatter.py b/pddl/formatter.py index e95561c1..45cd056f 100644 --- a/pddl/formatter.py +++ b/pddl/formatter.py @@ -12,12 +12,15 @@ """Formatting utilities for PDDL domains and problems.""" from textwrap import indent -from typing import Callable, Collection, Dict, List, Optional +from typing import Callable, Collection, Dict, List, Optional, TypeVar from pddl.core import Domain, Problem from pddl.custom_types import name +from pddl.logic.functions import NumericFunction from pddl.logic.terms import Constant +T = TypeVar("T", name, NumericFunction) + def _remove_empty_lines(s: str) -> str: """Remove empty lines from string.""" @@ -38,19 +41,19 @@ def _sort_and_print_collection( return "" -def _print_types_with_parents( +def _print_types_or_functions_with_parents( prefix: str, - types_dict: Dict[name, Optional[name]], + types_dict: Dict[T, Optional[name]], postfix: str, to_string: Callable = str, ): """Print the type dictionary of a PDDL domain.""" - name_by_type: Dict[Optional[name], List[name]] = {} - for type_name, parent_type in types_dict.items(): - name_by_type.setdefault(parent_type, []).append(type_name) - if not bool(name_by_type): + name_by_obj: Dict[Optional[T], List[name]] = {} + for obj_name, parent_type in types_dict.items(): + name_by_obj.setdefault(parent_type, []).append(obj_name) # type: ignore + if not bool(name_by_obj): return "" - return _print_typed_lists(prefix, name_by_type, postfix, to_string) + return _print_typed_lists(prefix, name_by_obj, postfix, to_string) def _print_constants( @@ -88,7 +91,7 @@ def _print_predicates_with_types(predicates: Collection): def _print_typed_lists( prefix, - names_by_type: Dict[Optional[name], List[name]], + names_by_obj: Dict[Optional[T], List[name]], postfix, to_string: Callable = str, ): @@ -96,11 +99,11 @@ def _print_typed_lists( result = prefix + " " # names with no type will be printed at the end - names_with_none_types = names_by_type.pop(None, []) + names_with_none_types = names_by_obj.pop(None, []) # print typed constants, first sorted by type, then by constant name for type_tag, typed_names in sorted( - names_by_type.items(), key=lambda type_and_name: type_and_name[0] # type: ignore + names_by_obj.items(), key=lambda type_and_name: type_and_name[0] # type: ignore ): result += ( " ".join(sorted(to_string(n) for n in typed_names)) + " - " + type_tag + " " # type: ignore @@ -125,12 +128,14 @@ def domain_to_string(domain: Domain) -> str: body = "" indentation = " " * 4 body += _sort_and_print_collection("(:requirements ", domain.requirements, ")\n") - body += _print_types_with_parents("(:types", domain.types, ")\n") + body += _print_types_or_functions_with_parents("(:types", domain.types, ")\n") body += _print_constants("(:constants", domain.constants, ")\n") if domain.predicates: body += f"(:predicates {_print_predicates_with_types(domain.predicates)})\n" if domain.functions: - body += f"(:functions {_print_predicates_with_types(domain.functions)})\n" + body += _print_types_or_functions_with_parents( + "(:functions", domain.functions, ")\n" + ) body += _sort_and_print_collection( "", domain.derived_predicates, diff --git a/pddl/logic/terms.py b/pddl/logic/terms.py index 4fb37f15..b2b577cb 100644 --- a/pddl/logic/terms.py +++ b/pddl/logic/terms.py @@ -12,7 +12,7 @@ """This modules implements PDDL terms.""" import functools -from typing import AbstractSet, Collection, Optional +from typing import AbstractSet, Collection, Optional, Any from pddl.custom_types import name as name_type from pddl.custom_types import namelike, parse_name, to_type @@ -20,7 +20,7 @@ from pddl.helpers.cache_hash import cache_hash -def _print_tag_set(type_tags: AbstractSet[name_type]) -> str: +def _print_tag_set(type_tags: AbstractSet[Any]) -> str: """Print a tag set.""" if len(type_tags) == 0: return "[]" diff --git a/pddl/parser/typed_list_parser.py b/pddl/parser/typed_list_parser.py index 9be8302d..d530effc 100644 --- a/pddl/parser/typed_list_parser.py +++ b/pddl/parser/typed_list_parser.py @@ -12,19 +12,22 @@ """Utility to handle typed lists.""" import itertools -from typing import Dict, List, Optional, Set, Tuple, Union, cast +from typing import Dict, List, Optional, Set, Tuple, TypeVar, Union, cast, Generic, Any -from pddl.custom_types import name, parse_name, parse_type +from pddl.custom_types import parse_name, parse_type, name from pddl.helpers.base import check, safe_index +from pddl.logic.functions import NumericFunction from pddl.logic.terms import _print_tag_set from pddl.parser.symbols import Symbols +T = TypeVar("T", name, NumericFunction) -class TypedListParser: + +class TypedListParser(Generic[T]): """ - An index for PDDL types and PDDL names/variables. + An index for PDDL types and PDDL names/variables/functions. - This class is used to index PDDL names and variables by their types. + This class is used to index PDDL names, variables, and functions by their types. OrderedDict is used to preserve the order of the types and the names, e.g. for predicate variables. Other types of validations are performed to ensure that the types index is consistent. @@ -34,12 +37,11 @@ def __init__(self, allow_duplicates: bool) -> None: """Initialize the types index.""" self._allow_duplicates = allow_duplicates - self._types_to_items: Dict[name, Set[name]] = {} - self._item_to_types: Dict[name, Set[name]] = {} - - self._item_to_types_sequence: List[Tuple[name, Set[name]]] = [] + self._types_to_items: Dict[T, Set[T]] = {} + self._item_to_types: Dict[T, Set[T]] = {} + self._item_to_types_sequence: List[Tuple[T, Set[T]]] = [] - def add_item(self, item_name: name, type_tags: Set[name]) -> None: + def add_item(self, item_name: T, type_tags: Set[T]) -> None: """ Add an item to the types index with the given type tags. @@ -54,9 +56,9 @@ def add_item(self, item_name: name, type_tags: Set[name]) -> None: self._check_item_types(item_name, type_tags) self._add_item(item_name, type_tags) - def get_typed_list_of_names(self) -> Dict[name, Optional[name]]: + def get_typed_list_of_names(self) -> Dict[T, Optional[T]]: """Get the typed list of names in form of dictionary.""" - result: Dict[name, Optional[name]] = {} + result: Dict[T, Optional[T]] = {} for item, types_tags in self._item_to_types.items(): if len(types_tags) > 1: self._raise_multiple_types_error(item, types_tags) @@ -64,13 +66,13 @@ def get_typed_list_of_names(self) -> Dict[name, Optional[name]]: result[item] = type_tag return result - def get_typed_list_of_variables(self) -> Tuple[Tuple[name, Set[name]], ...]: + def get_typed_list_of_variables(self) -> Tuple[Tuple[T, Set[T]], ...]: """Get the typed list of variables in form of a tuple of pairs.""" return tuple(self._item_to_types_sequence) @classmethod def parse_typed_list( - cls, tokens: List[Union[str, List[str]]], allow_duplicates: bool = False + cls, tokens: List[Union[T, List[T]]], allow_duplicates: bool = False ) -> "TypedListParser": """ Parse typed list. @@ -149,7 +151,7 @@ def _add_typed_lists( result: "TypedListParser", start_index: int, end_index: int, - tokens: List[Union[str, List[str]]], + tokens: List[Union[T, List[T]]], type_tags: Set[str], ) -> None: """ @@ -160,16 +162,19 @@ def _add_typed_lists( """ for item_name in itertools.islice(tokens, start_index, end_index): check( - isinstance(item_name, str), f"invalid item '{item_name}' in typed list" + isinstance(item_name, str) or isinstance(item_name, NumericFunction), + f"invalid item '{item_name}' in typed list", ) # these lines implicitly perform name validation - item_name = parse_name(cast(str, item_name)) - type_tags_names: Set[name] = set(map(parse_type, type_tags)) - result.add_item(item_name, type_tags_names) + cast_item_name: Any = ( + parse_name(item_name) if isinstance(item_name, str) else item_name + ) + type_tags_names: Set[Any] = set(map(parse_type, type_tags)) + result.add_item(cast_item_name, type_tags_names) - def _check_item_name_already_present(self, item_name: name) -> None: + def _check_item_name_already_present(self, item_name: T) -> None: """ - Check if the item name is already present in the index. + Check if the item name/function is already present in the index. :param item_name: the item name """ @@ -183,23 +188,21 @@ def _check_item_name_already_present(self, item_name: name) -> None: f"duplicate name '{item_name}' in typed list already present" ) - def _check_tags_already_present( - self, item_name: name, type_tags: Set[name] - ) -> None: + def _check_tags_already_present(self, item_name: T, type_tags: Set[T]) -> None: """ Check if the type tags are already present for the given item name. :param item_name: the item name :param type_tags: the type tags """ - exisiting_tags = self._item_to_types.get(item_name, set()) + existing_tags = self._item_to_types.get(item_name, set()) for type_tag in type_tags: - if type_tag in exisiting_tags: + if type_tag in existing_tags: raise ValueError( f"duplicate type tag '{type_tag}' in typed list: type already specified for item {item_name}" ) - def _check_item_types(self, item_name: name, type_tags: Set[name]) -> None: + def _check_item_types(self, item_name: T, type_tags: Set[T]) -> None: """Check if the types of the item are valid.""" if item_name in self._item_to_types: previous_type_tags = self._item_to_types[item_name] @@ -209,16 +212,14 @@ def _check_item_types(self, item_name: name, type_tags: Set[name]) -> None: f"{_print_tag_set(previous_type_tags)}, got {_print_tag_set(type_tags)}" ) - def _add_item(self, item_name: name, type_tags: Set[name]) -> None: + def _add_item(self, item_name: T, type_tags: Set[T]) -> None: """Add an item (no validation).""" for type_tag in type_tags: self._types_to_items.setdefault(type_tag, set()).add(item_name) self._item_to_types.setdefault(item_name, set()).update(type_tags) self._item_to_types_sequence.append((item_name, type_tags)) - def _raise_multiple_types_error( - self, item_name: name, type_tags: Set[name] - ) -> None: + def _raise_multiple_types_error(self, item_name: T, type_tags: Set[T]) -> None: """Raise an error if the item has multiple types.""" raise ValueError( f"typed list names should not have more than one type, got '{item_name}' with " From 64d9f76ee44f0643deb2ee71a8670870729efc0b Mon Sep 17 00:00:00 2001 From: Francesco Fuggitti Date: Fri, 13 Oct 2023 19:02:11 -0400 Subject: [PATCH 55/65] update tests and whitelist --- scripts/whitelist.py | 104 ++++++++++++++++++++-------------------- tests/test_domain.py | 9 ++-- tests/test_formatter.py | 2 +- tests/test_functions.py | 5 +- tests/test_problem.py | 4 +- 5 files changed, 62 insertions(+), 62 deletions(-) diff --git a/scripts/whitelist.py b/scripts/whitelist.py index 5bc55779..cd3f5a2b 100644 --- a/scripts/whitelist.py +++ b/scripts/whitelist.py @@ -1,61 +1,61 @@ -_._ # unused method (pddl/_validation.py:237) -_._ # unused method (pddl/_validation.py:243) -_._ # unused method (pddl/_validation.py:249) -_._ # unused method (pddl/_validation.py:254) -_._ # unused method (pddl/_validation.py:259) -_._ # unused method (pddl/_validation.py:264) -_._ # unused method (pddl/_validation.py:269) -_._ # unused method (pddl/_validation.py:274) -_._ # unused method (pddl/_validation.py:279) -_._ # unused method (pddl/_validation.py:284) -_._ # unused method (pddl/_validation.py:289) -_._ # unused method (pddl/_validation.py:294) -_._ # unused method (pddl/_validation.py:299) -_._ # unused method (pddl/_validation.py:304) -_._ # unused method (pddl/_validation.py:309) -_._ # unused method (pddl/_validation.py:314) -_._ # unused method (pddl/_validation.py:319) -_._ # unused method (pddl/_validation.py:324) -_._ # unused method (pddl/_validation.py:329) -_._ # unused method (pddl/_validation.py:334) -_._ # unused method (pddl/_validation.py:339) -_._ # unused method (pddl/_validation.py:345) -_._ # unused method (pddl/_validation.py:351) -_._ # unused method (pddl/_validation.py:356) -_._ # unused method (pddl/_validation.py:361) -_._ # unused method (pddl/_validation.py:367) -_._ # unused method (pddl/_validation.py:372) -_._ # unused method (pddl/_validation.py:378) -_._ # unused method (pddl/_validation.py:384) -to_names # unused function (pddl/custom_types.py:82) +_._ # unused method (pddl/_validation.py:238) +_._ # unused method (pddl/_validation.py:244) +_._ # unused method (pddl/_validation.py:250) +_._ # unused method (pddl/_validation.py:255) +_._ # unused method (pddl/_validation.py:260) +_._ # unused method (pddl/_validation.py:265) +_._ # unused method (pddl/_validation.py:270) +_._ # unused method (pddl/_validation.py:275) +_._ # unused method (pddl/_validation.py:280) +_._ # unused method (pddl/_validation.py:285) +_._ # unused method (pddl/_validation.py:290) +_._ # unused method (pddl/_validation.py:295) +_._ # unused method (pddl/_validation.py:300) +_._ # unused method (pddl/_validation.py:305) +_._ # unused method (pddl/_validation.py:310) +_._ # unused method (pddl/_validation.py:315) +_._ # unused method (pddl/_validation.py:320) +_._ # unused method (pddl/_validation.py:325) +_._ # unused method (pddl/_validation.py:330) +_._ # unused method (pddl/_validation.py:335) +_._ # unused method (pddl/_validation.py:341) +_._ # unused method (pddl/_validation.py:347) +_._ # unused method (pddl/_validation.py:352) +_._ # unused method (pddl/_validation.py:357) +_._ # unused method (pddl/_validation.py:363) +_._ # unused method (pddl/_validation.py:368) +_._ # unused method (pddl/_validation.py:374) +_._ # unused method (pddl/_validation.py:380) +_.all_functions # unused property (pddl/_validation.py:409) +to_names # unused function (pddl/custom_types.py:99) safe_get # unused function (pddl/helpers/base.py:111) find # unused function (pddl/helpers/base.py:116) ensure_formula # unused function (pddl/logic/base.py:234) PEffect # unused variable (pddl/logic/effects.py:168) Effect # unused variable (pddl/logic/effects.py:170) CondEffect # unused variable (pddl/logic/effects.py:171) -_._predicates_by_name # unused attribute (pddl/parser/domain.py:60) -_._functions_by_name # unused attribute (pddl/parser/domain.py:61) -_.start # unused method (pddl/parser/domain.py:66) -_.domain_def # unused method (pddl/parser/domain.py:87) -_._predicates_by_name # unused attribute (pddl/parser/domain.py:117) -_._functions_by_name # unused attribute (pddl/parser/domain.py:123) -_.action_def # unused method (pddl/parser/domain.py:126) -_.action_parameters # unused method (pddl/parser/domain.py:144) -_.emptyor_pregd # unused method (pddl/parser/domain.py:151) -_.gd # unused method (pddl/parser/domain.py:234) -_.emptyor_effect # unused method (pddl/parser/domain.py:251) -_.c_effect # unused method (pddl/parser/domain.py:266) -_.p_effect # unused method (pddl/parser/domain.py:281) -_.cond_effect # unused method (pddl/parser/domain.py:288) -_.num_effect # unused method (pddl/parser/domain.py:296) -_.atomic_formula_term # unused method (pddl/parser/domain.py:311) -_.atomic_formula_skeleton # unused method (pddl/parser/domain.py:348) -_.atomic_function_skeleton # unused method (pddl/parser/domain.py:354) -_.f_exp # unused method (pddl/parser/domain.py:364) -_.f_head # unused method (pddl/parser/domain.py:385) -_.typed_list_variable # unused method (pddl/parser/domain.py:401) -_.type_def # unused method (pddl/parser/domain.py:424) +_._predicates_by_name # unused attribute (pddl/parser/domain.py:59) +_._functions_by_name # unused attribute (pddl/parser/domain.py:60) +_.start # unused method (pddl/parser/domain.py:65) +_.domain_def # unused method (pddl/parser/domain.py:86) +_._predicates_by_name # unused attribute (pddl/parser/domain.py:116) +_.action_def # unused method (pddl/parser/domain.py:124) +_.action_parameters # unused method (pddl/parser/domain.py:142) +_.emptyor_pregd # unused method (pddl/parser/domain.py:149) +_.gd # unused method (pddl/parser/domain.py:232) +_.emptyor_effect # unused method (pddl/parser/domain.py:249) +_.c_effect # unused method (pddl/parser/domain.py:264) +_.p_effect # unused method (pddl/parser/domain.py:279) +_.cond_effect # unused method (pddl/parser/domain.py:286) +_.num_effect # unused method (pddl/parser/domain.py:294) +_.atomic_formula_term # unused method (pddl/parser/domain.py:309) +_.atomic_formula_skeleton # unused method (pddl/parser/domain.py:346) +_.atomic_function_skeleton # unused method (pddl/parser/domain.py:352) +_.f_exp # unused method (pddl/parser/domain.py:362) +_.f_head # unused method (pddl/parser/domain.py:383) +_.typed_list_variable # unused method (pddl/parser/domain.py:399) +_.f_typed_list_atomic_function_skeleton # unused method (pddl/parser/domain.py:414) +_.type_def # unused method (pddl/parser/domain.py:430) _.start # unused method (pddl/parser/problem.py:55) _.problem_def # unused method (pddl/parser/problem.py:68) _.problem_domain # unused method (pddl/parser/problem.py:72) diff --git a/tests/test_domain.py b/tests/test_domain.py index 9072be2c..e8ac11d4 100644 --- a/tests/test_domain.py +++ b/tests/test_domain.py @@ -32,7 +32,6 @@ LesserThan, NumericFunction, NumericValue, - TotalCost, ) from pddl.logic.helpers import constants, variables from pddl.logic.predicates import DerivedPredicate, Predicate @@ -144,7 +143,7 @@ def test_build_domain_with_numeric_fluents(): "domain_with_numeric", requirements={Requirements.NUMERIC_FLUENTS}, predicates={p}, - functions={func1, func2, func3}, + functions={func1: None, func2: None, func3: None}, actions={action_1, action_2}, ) assert domain @@ -176,7 +175,7 @@ def test_build_domain_with_action_cost(): "domain_with_numeric", requirements={Requirements.NUMERIC_FLUENTS}, predicates={p}, - functions={cost1, cost2}, + functions={cost1: None, cost2: None}, actions={action_1, action_2}, ) assert domain @@ -187,7 +186,7 @@ def test_build_domain_with_total_cost(): x, y, z = variables("x y z") p = Predicate("p", x, y, z) q = Predicate("q") - total_cost = TotalCost() + total_cost = NumericFunction(Symbols.TOTAL_COST.value) action_1 = Action( "action_1", [x, y, z], @@ -198,7 +197,7 @@ def test_build_domain_with_total_cost(): "domain_with_total_cost", requirements={Requirements.ACTION_COSTS}, predicates={p}, - functions={total_cost}, + functions={total_cost: None}, actions={action_1}, ) assert domain diff --git a/tests/test_formatter.py b/tests/test_formatter.py index 359d8c87..ef95e747 100644 --- a/tests/test_formatter.py +++ b/tests/test_formatter.py @@ -125,7 +125,7 @@ def test_numerical_hello_world_domain_formatter(): domain = Domain( name="hello-world-functions", requirements=[Requirements.STRIPS, Requirements.NUMERIC_FLUENTS], - functions=[hello_counter], + functions={hello_counter: None}, actions=[action], ) diff --git a/tests/test_functions.py b/tests/test_functions.py index 3f8a912a..08cab99e 100644 --- a/tests/test_functions.py +++ b/tests/test_functions.py @@ -12,8 +12,9 @@ """This module contains tests for PDDL functions.""" import pytest +from pddl.parser.symbols import Symbols -from pddl.logic.functions import Metric, NumericFunction, NumericValue, TotalCost +from pddl.logic.functions import Metric, NumericFunction, NumericValue from pddl.logic.helpers import variables @@ -59,7 +60,7 @@ class TestTotalCost: def setup_method(self): """Set up the tests.""" - self.total_cost = TotalCost() + self.total_cost = NumericFunction(Symbols.TOTAL_COST.value) def test_name(self): """Test name getter.""" diff --git a/tests/test_problem.py b/tests/test_problem.py index a04fef2c..31de44ed 100644 --- a/tests/test_problem.py +++ b/tests/test_problem.py @@ -15,6 +15,7 @@ import pickle # nosec import pytest +from pddl.parser.symbols import Symbols from pddl.core import Domain, Problem from pddl.logic.base import And, Not @@ -26,7 +27,6 @@ LesserThan, Metric, NumericFunction, - TotalCost, ) from pddl.logic.helpers import constants, variables from pddl.logic.predicates import Predicate @@ -99,7 +99,7 @@ def test_build_problem_with_metric(): o1, o2 = constants("o1 o2") p = Predicate("p", x, y) q = Predicate("q") - total_cost = TotalCost() + total_cost = NumericFunction(Symbols.TOTAL_COST.value) problem = Problem( "simple_problem", domain_name="simple_domain", From 047313f8bf627d7168e4fca099012748896eb3f5 Mon Sep 17 00:00:00 2001 From: Francesco Fuggitti Date: Fri, 13 Oct 2023 19:30:29 -0400 Subject: [PATCH 56/65] add some more domains with numeric fluents and action costs --- tests/conftest.py | 4 + .../barman-sequential-optimal/domain.pddl | 169 ++ .../barman-sequential-optimal/p01.pddl | 51 + .../barman-sequential-optimal/p02.pddl | 51 + .../barman-sequential-optimal/p03.pddl | 51 + .../barman-sequential-optimal/p04.pddl | 51 + .../barman-sequential-optimal/p05.pddl | 57 + .../barman-sequential-optimal/p06.pddl | 57 + .../barman-sequential-optimal/p07.pddl | 57 + .../barman-sequential-optimal/p08.pddl | 57 + .../barman-sequential-optimal/p09.pddl | 63 + .../barman-sequential-optimal/p10.pddl | 63 + .../barman-sequential-optimal/p11.pddl | 63 + .../barman-sequential-optimal/p12.pddl | 63 + .../barman-sequential-optimal/p13.pddl | 73 + .../barman-sequential-optimal/p14.pddl | 73 + .../barman-sequential-optimal/p15.pddl | 73 + .../barman-sequential-optimal/p16.pddl | 73 + .../barman-sequential-optimal/p17.pddl | 79 + .../barman-sequential-optimal/p18.pddl | 79 + .../barman-sequential-optimal/p19.pddl | 79 + .../barman-sequential-optimal/p20.pddl | 79 + .../domain.pddl | 145 ++ .../cave-diving-sequential-optimal/p01.pddl | 78 + .../cave-diving-sequential-optimal/p02.pddl | 74 + .../cave-diving-sequential-optimal/p03.pddl | 74 + .../cave-diving-sequential-optimal/p04.pddl | 72 + .../cave-diving-sequential-optimal/p05.pddl | 75 + .../cave-diving-sequential-optimal/p06.pddl | 54 + .../cave-diving-sequential-optimal/p07.pddl | 54 + .../cave-diving-sequential-optimal/p08.pddl | 53 + .../cave-diving-sequential-optimal/p09.pddl | 54 + .../cave-diving-sequential-optimal/p10.pddl | 120 ++ .../cave-diving-sequential-optimal/p11.pddl | 121 ++ .../cave-diving-sequential-optimal/p12.pddl | 124 ++ .../cave-diving-sequential-optimal/p13.pddl | 122 ++ .../cave-diving-sequential-optimal/p14.pddl | 79 + .../cave-diving-sequential-optimal/p15.pddl | 79 + .../cave-diving-sequential-optimal/p16.pddl | 75 + .../cave-diving-sequential-optimal/p17.pddl | 77 + .../cave-diving-sequential-optimal/p18.pddl | 57 + .../cave-diving-sequential-optimal/p19.pddl | 59 + .../cave-diving-sequential-optimal/p20.pddl | 58 + .../depots-numeric-automatic/domain.pddl | 54 + .../depots-numeric-automatic/p01.pddl | 43 + .../depots-numeric-automatic/p02.pddl | 51 + .../depots-numeric-automatic/p03.pddl | 59 + .../depots-numeric-automatic/p04.pddl | 65 + .../depots-numeric-automatic/p05.pddl | 75 + .../depots-numeric-automatic/p06.pddl | 91 + .../depots-numeric-automatic/p07.pddl | 64 + .../depots-numeric-automatic/p08.pddl | 78 + .../depots-numeric-automatic/p09.pddl | 99 + .../depots-numeric-automatic/p10.pddl | 69 + .../depots-numeric-automatic/p11.pddl | 87 + .../depots-numeric-automatic/p12.pddl | 103 + .../depots-numeric-automatic/p13.pddl | 79 + .../depots-numeric-automatic/p14.pddl | 92 + .../depots-numeric-automatic/p15.pddl | 115 ++ .../depots-numeric-automatic/p16.pddl | 84 + .../depots-numeric-automatic/p17.pddl | 98 + .../depots-numeric-automatic/p18.pddl | 119 ++ .../depots-numeric-automatic/p19.pddl | 96 + .../depots-numeric-automatic/p20.pddl | 124 ++ .../depots-numeric-automatic/p21.pddl | 143 ++ .../depots-numeric-automatic/p22.pddl | 183 ++ .../sokoban-sequential-optimal/domain.pddl | 69 + .../sokoban-sequential-optimal/p01.pddl | 213 ++ .../sokoban-sequential-optimal/p02.pddl | 532 +++++ .../sokoban-sequential-optimal/p03.pddl | 296 +++ .../sokoban-sequential-optimal/p04.pddl | 297 +++ .../sokoban-sequential-optimal/p05.pddl | 534 +++++ .../sokoban-sequential-optimal/p06.pddl | 544 ++++++ .../sokoban-sequential-optimal/p07.pddl | 410 ++++ .../sokoban-sequential-optimal/p08.pddl | 373 ++++ .../sokoban-sequential-optimal/p09.pddl | 541 ++++++ .../sokoban-sequential-optimal/p10.pddl | 325 ++++ .../sokoban-sequential-optimal/p11.pddl | 373 ++++ .../sokoban-sequential-optimal/p12.pddl | 1715 +++++++++++++++++ .../sokoban-sequential-optimal/p13.pddl | 345 ++++ .../sokoban-sequential-optimal/p14.pddl | 374 ++++ .../sokoban-sequential-optimal/p15.pddl | 447 +++++ .../sokoban-sequential-optimal/p16.pddl | 509 +++++ .../sokoban-sequential-optimal/p17.pddl | 347 ++++ .../sokoban-sequential-optimal/p18.pddl | 341 ++++ .../sokoban-sequential-optimal/p19.pddl | 434 +++++ .../sokoban-sequential-optimal/p20.pddl | 323 ++++ 87 files changed, 14582 insertions(+) create mode 100644 tests/fixtures/pddl_files/barman-sequential-optimal/domain.pddl create mode 100644 tests/fixtures/pddl_files/barman-sequential-optimal/p01.pddl create mode 100644 tests/fixtures/pddl_files/barman-sequential-optimal/p02.pddl create mode 100644 tests/fixtures/pddl_files/barman-sequential-optimal/p03.pddl create mode 100644 tests/fixtures/pddl_files/barman-sequential-optimal/p04.pddl create mode 100644 tests/fixtures/pddl_files/barman-sequential-optimal/p05.pddl create mode 100644 tests/fixtures/pddl_files/barman-sequential-optimal/p06.pddl create mode 100644 tests/fixtures/pddl_files/barman-sequential-optimal/p07.pddl create mode 100644 tests/fixtures/pddl_files/barman-sequential-optimal/p08.pddl create mode 100644 tests/fixtures/pddl_files/barman-sequential-optimal/p09.pddl create mode 100644 tests/fixtures/pddl_files/barman-sequential-optimal/p10.pddl create mode 100644 tests/fixtures/pddl_files/barman-sequential-optimal/p11.pddl create mode 100644 tests/fixtures/pddl_files/barman-sequential-optimal/p12.pddl create mode 100644 tests/fixtures/pddl_files/barman-sequential-optimal/p13.pddl create mode 100644 tests/fixtures/pddl_files/barman-sequential-optimal/p14.pddl create mode 100644 tests/fixtures/pddl_files/barman-sequential-optimal/p15.pddl create mode 100644 tests/fixtures/pddl_files/barman-sequential-optimal/p16.pddl create mode 100644 tests/fixtures/pddl_files/barman-sequential-optimal/p17.pddl create mode 100644 tests/fixtures/pddl_files/barman-sequential-optimal/p18.pddl create mode 100644 tests/fixtures/pddl_files/barman-sequential-optimal/p19.pddl create mode 100644 tests/fixtures/pddl_files/barman-sequential-optimal/p20.pddl create mode 100644 tests/fixtures/pddl_files/cave-diving-sequential-optimal/domain.pddl create mode 100644 tests/fixtures/pddl_files/cave-diving-sequential-optimal/p01.pddl create mode 100644 tests/fixtures/pddl_files/cave-diving-sequential-optimal/p02.pddl create mode 100644 tests/fixtures/pddl_files/cave-diving-sequential-optimal/p03.pddl create mode 100644 tests/fixtures/pddl_files/cave-diving-sequential-optimal/p04.pddl create mode 100644 tests/fixtures/pddl_files/cave-diving-sequential-optimal/p05.pddl create mode 100644 tests/fixtures/pddl_files/cave-diving-sequential-optimal/p06.pddl create mode 100644 tests/fixtures/pddl_files/cave-diving-sequential-optimal/p07.pddl create mode 100644 tests/fixtures/pddl_files/cave-diving-sequential-optimal/p08.pddl create mode 100644 tests/fixtures/pddl_files/cave-diving-sequential-optimal/p09.pddl create mode 100644 tests/fixtures/pddl_files/cave-diving-sequential-optimal/p10.pddl create mode 100644 tests/fixtures/pddl_files/cave-diving-sequential-optimal/p11.pddl create mode 100644 tests/fixtures/pddl_files/cave-diving-sequential-optimal/p12.pddl create mode 100644 tests/fixtures/pddl_files/cave-diving-sequential-optimal/p13.pddl create mode 100644 tests/fixtures/pddl_files/cave-diving-sequential-optimal/p14.pddl create mode 100644 tests/fixtures/pddl_files/cave-diving-sequential-optimal/p15.pddl create mode 100644 tests/fixtures/pddl_files/cave-diving-sequential-optimal/p16.pddl create mode 100644 tests/fixtures/pddl_files/cave-diving-sequential-optimal/p17.pddl create mode 100644 tests/fixtures/pddl_files/cave-diving-sequential-optimal/p18.pddl create mode 100644 tests/fixtures/pddl_files/cave-diving-sequential-optimal/p19.pddl create mode 100644 tests/fixtures/pddl_files/cave-diving-sequential-optimal/p20.pddl create mode 100644 tests/fixtures/pddl_files/depots-numeric-automatic/domain.pddl create mode 100644 tests/fixtures/pddl_files/depots-numeric-automatic/p01.pddl create mode 100644 tests/fixtures/pddl_files/depots-numeric-automatic/p02.pddl create mode 100644 tests/fixtures/pddl_files/depots-numeric-automatic/p03.pddl create mode 100644 tests/fixtures/pddl_files/depots-numeric-automatic/p04.pddl create mode 100644 tests/fixtures/pddl_files/depots-numeric-automatic/p05.pddl create mode 100644 tests/fixtures/pddl_files/depots-numeric-automatic/p06.pddl create mode 100644 tests/fixtures/pddl_files/depots-numeric-automatic/p07.pddl create mode 100644 tests/fixtures/pddl_files/depots-numeric-automatic/p08.pddl create mode 100644 tests/fixtures/pddl_files/depots-numeric-automatic/p09.pddl create mode 100644 tests/fixtures/pddl_files/depots-numeric-automatic/p10.pddl create mode 100644 tests/fixtures/pddl_files/depots-numeric-automatic/p11.pddl create mode 100644 tests/fixtures/pddl_files/depots-numeric-automatic/p12.pddl create mode 100644 tests/fixtures/pddl_files/depots-numeric-automatic/p13.pddl create mode 100644 tests/fixtures/pddl_files/depots-numeric-automatic/p14.pddl create mode 100644 tests/fixtures/pddl_files/depots-numeric-automatic/p15.pddl create mode 100644 tests/fixtures/pddl_files/depots-numeric-automatic/p16.pddl create mode 100644 tests/fixtures/pddl_files/depots-numeric-automatic/p17.pddl create mode 100644 tests/fixtures/pddl_files/depots-numeric-automatic/p18.pddl create mode 100644 tests/fixtures/pddl_files/depots-numeric-automatic/p19.pddl create mode 100644 tests/fixtures/pddl_files/depots-numeric-automatic/p20.pddl create mode 100644 tests/fixtures/pddl_files/depots-numeric-automatic/p21.pddl create mode 100644 tests/fixtures/pddl_files/depots-numeric-automatic/p22.pddl create mode 100644 tests/fixtures/pddl_files/sokoban-sequential-optimal/domain.pddl create mode 100644 tests/fixtures/pddl_files/sokoban-sequential-optimal/p01.pddl create mode 100644 tests/fixtures/pddl_files/sokoban-sequential-optimal/p02.pddl create mode 100644 tests/fixtures/pddl_files/sokoban-sequential-optimal/p03.pddl create mode 100644 tests/fixtures/pddl_files/sokoban-sequential-optimal/p04.pddl create mode 100644 tests/fixtures/pddl_files/sokoban-sequential-optimal/p05.pddl create mode 100644 tests/fixtures/pddl_files/sokoban-sequential-optimal/p06.pddl create mode 100644 tests/fixtures/pddl_files/sokoban-sequential-optimal/p07.pddl create mode 100644 tests/fixtures/pddl_files/sokoban-sequential-optimal/p08.pddl create mode 100644 tests/fixtures/pddl_files/sokoban-sequential-optimal/p09.pddl create mode 100644 tests/fixtures/pddl_files/sokoban-sequential-optimal/p10.pddl create mode 100644 tests/fixtures/pddl_files/sokoban-sequential-optimal/p11.pddl create mode 100644 tests/fixtures/pddl_files/sokoban-sequential-optimal/p12.pddl create mode 100644 tests/fixtures/pddl_files/sokoban-sequential-optimal/p13.pddl create mode 100644 tests/fixtures/pddl_files/sokoban-sequential-optimal/p14.pddl create mode 100644 tests/fixtures/pddl_files/sokoban-sequential-optimal/p15.pddl create mode 100644 tests/fixtures/pddl_files/sokoban-sequential-optimal/p16.pddl create mode 100644 tests/fixtures/pddl_files/sokoban-sequential-optimal/p17.pddl create mode 100644 tests/fixtures/pddl_files/sokoban-sequential-optimal/p18.pddl create mode 100644 tests/fixtures/pddl_files/sokoban-sequential-optimal/p19.pddl create mode 100644 tests/fixtures/pddl_files/sokoban-sequential-optimal/p20.pddl diff --git a/tests/conftest.py b/tests/conftest.py index ed1f73c6..fbe62a50 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -41,9 +41,12 @@ DOMAIN_NAMES = [ "acrobatics", + "barman-sequential-optimal", "beam-walk", "blocksworld-ipc08", "blocksworld_fond", + "cave-diving-sequential-optimal", + "depots-numeric-automatic", "doors", "earth_observation", "elevators", @@ -53,6 +56,7 @@ "maintenance-sequential-satisficing-ipc2014", "miner", "rovers_fond", + "sokoban-sequential-optimal", "spiky-tireworld", "storage", "tireworld", diff --git a/tests/fixtures/pddl_files/barman-sequential-optimal/domain.pddl b/tests/fixtures/pddl_files/barman-sequential-optimal/domain.pddl new file mode 100644 index 00000000..5043848b --- /dev/null +++ b/tests/fixtures/pddl_files/barman-sequential-optimal/domain.pddl @@ -0,0 +1,169 @@ +(define (domain barman) + (:requirements :strips :typing :action-costs) + (:types hand level beverage dispenser container - object + ingredient cocktail - beverage + shot shaker - container) + (:predicates (ontable ?c - container) + (holding ?h - hand ?c - container) + (handempty ?h - hand) + (empty ?c - container) + (contains ?c - container ?b - beverage) + (clean ?c - container) + (used ?c - container ?b - beverage) + (dispenses ?d - dispenser ?i - ingredient) + (shaker-empty-level ?s - shaker ?l - level) + (shaker-level ?s - shaker ?l - level) + (next ?l1 ?l2 - level) + (unshaked ?s - shaker) + (shaked ?s - shaker) + (cocktail-part1 ?c - cocktail ?i - ingredient) + (cocktail-part2 ?c - cocktail ?i - ingredient)) + +(:functions (total-cost) - number) + + (:action grasp + :parameters (?h - hand ?c - container) + :precondition (and (ontable ?c) (handempty ?h)) + :effect (and (not (ontable ?c)) + (not (handempty ?h)) + (holding ?h ?c) + (increase (total-cost) 1))) + + (:action leave + :parameters (?h - hand ?c - container) + :precondition (holding ?h ?c) + :effect (and (not (holding ?h ?c)) + (handempty ?h) + (ontable ?c) + (increase (total-cost) 1))) + + (:action fill-shot + :parameters (?s - shot ?i - ingredient ?h1 ?h2 - hand ?d - dispenser) + :precondition (and (holding ?h1 ?s) + (handempty ?h2) + (dispenses ?d ?i) + (empty ?s) + (clean ?s)) + :effect (and (not (empty ?s)) + (contains ?s ?i) + (not (clean ?s)) + (used ?s ?i) + (increase (total-cost) 10))) + + + (:action refill-shot + :parameters (?s - shot ?i - ingredient ?h1 ?h2 - hand ?d - dispenser) + :precondition (and (holding ?h1 ?s) + (handempty ?h2) + (dispenses ?d ?i) + (empty ?s) + (used ?s ?i)) + :effect (and (not (empty ?s)) + (contains ?s ?i) + (increase (total-cost) 10))) + + (:action empty-shot + :parameters (?h - hand ?p - shot ?b - beverage) + :precondition (and (holding ?h ?p) + (contains ?p ?b)) + :effect (and (not (contains ?p ?b)) + (empty ?p) + (increase (total-cost) 1))) + + (:action clean-shot + :parameters (?s - shot ?b - beverage ?h1 ?h2 - hand) + :precondition (and (holding ?h1 ?s) + (handempty ?h2) + (empty ?s) + (used ?s ?b)) + :effect (and (not (used ?s ?b)) + (clean ?s) + (increase (total-cost) 1))) + + (:action pour-shot-to-clean-shaker + :parameters (?s - shot ?i - ingredient ?d - shaker ?h1 - hand ?l ?l1 - level) + :precondition (and (holding ?h1 ?s) + (contains ?s ?i) + (empty ?d) + (clean ?d) + (shaker-level ?d ?l) + (next ?l ?l1)) + :effect (and (not (contains ?s ?i)) + (empty ?s) + (contains ?d ?i) + (not (empty ?d)) + (not (clean ?d)) + (unshaked ?d) + (not (shaker-level ?d ?l)) + (shaker-level ?d ?l1) + (increase (total-cost) 1))) + + + (:action pour-shot-to-used-shaker + :parameters (?s - shot ?i - ingredient ?d - shaker ?h1 - hand ?l ?l1 - level) + :precondition (and (holding ?h1 ?s) + (contains ?s ?i) + (unshaked ?d) + (shaker-level ?d ?l) + (next ?l ?l1)) + :effect (and (not (contains ?s ?i)) + (contains ?d ?i) + (empty ?s) + (not (shaker-level ?d ?l)) + (shaker-level ?d ?l1) + (increase (total-cost) 1))) + + (:action empty-shaker + :parameters (?h - hand ?s - shaker ?b - cocktail ?l ?l1 - level) + :precondition (and (holding ?h ?s) + (contains ?s ?b) + (shaked ?s) + (shaker-level ?s ?l) + (shaker-empty-level ?s ?l1)) + :effect (and (not (shaked ?s)) + (not (shaker-level ?s ?l)) + (shaker-level ?s ?l1) + (not (contains ?s ?b)) + (empty ?s) + (increase (total-cost) 1))) + + (:action clean-shaker + :parameters (?h1 ?h2 - hand ?s - shaker) + :precondition (and (holding ?h1 ?s) + (handempty ?h2) + (empty ?s)) + :effect (and (clean ?s) + (increase (total-cost) 1))) + + (:action shake + :parameters (?b - cocktail ?d1 ?d2 - ingredient ?s - shaker ?h1 ?h2 - hand) + :precondition (and (holding ?h1 ?s) + (handempty ?h2) + (contains ?s ?d1) + (contains ?s ?d2) + (cocktail-part1 ?b ?d1) + (cocktail-part2 ?b ?d2) + (unshaked ?s)) + :effect (and (not (unshaked ?s)) + (not (contains ?s ?d1)) + (not (contains ?s ?d2)) + (shaked ?s) + (contains ?s ?b) + (increase (total-cost) 1))) + + (:action pour-shaker-to-shot + :parameters (?b - beverage ?d - shot ?h - hand ?s - shaker ?l ?l1 - level) + :precondition (and (holding ?h ?s) + (shaked ?s) + (empty ?d) + (clean ?d) + (contains ?s ?b) + (shaker-level ?s ?l) + (next ?l1 ?l)) + :effect (and (not (clean ?d)) + (not (empty ?d)) + (contains ?d ?b) + (shaker-level ?s ?l1) + (not (shaker-level ?s ?l)) + (increase (total-cost) 1))) + ) \ No newline at end of file diff --git a/tests/fixtures/pddl_files/barman-sequential-optimal/p01.pddl b/tests/fixtures/pddl_files/barman-sequential-optimal/p01.pddl new file mode 100644 index 00000000..602e5e49 --- /dev/null +++ b/tests/fixtures/pddl_files/barman-sequential-optimal/p01.pddl @@ -0,0 +1,51 @@ +(define (problem prob) + (:domain barman) + (:objects + shaker1 - shaker + left right - hand + shot1 shot2 shot3 shot4 - shot + ingredient1 ingredient2 ingredient3 - ingredient + cocktail1 cocktail2 cocktail3 - cocktail + dispenser1 dispenser2 dispenser3 - dispenser + l0 l1 l2 - level +) + (:init + (= (total-cost) 0) + (ontable shaker1) + (ontable shot1) + (ontable shot2) + (ontable shot3) + (ontable shot4) + (dispenses dispenser1 ingredient1) + (dispenses dispenser2 ingredient2) + (dispenses dispenser3 ingredient3) + (clean shaker1) + (clean shot1) + (clean shot2) + (clean shot3) + (clean shot4) + (empty shaker1) + (empty shot1) + (empty shot2) + (empty shot3) + (empty shot4) + (handempty left) + (handempty right) + (shaker-empty-level shaker1 l0) + (shaker-level shaker1 l0) + (next l0 l1) + (next l1 l2) + (cocktail-part1 cocktail1 ingredient3) + (cocktail-part2 cocktail1 ingredient1) + (cocktail-part1 cocktail2 ingredient2) + (cocktail-part2 cocktail2 ingredient3) + (cocktail-part1 cocktail3 ingredient1) + (cocktail-part2 cocktail3 ingredient2) +) + (:goal + (and + (contains shot1 cocktail3) + (contains shot2 cocktail1) + (contains shot3 cocktail2) +)) +(:metric minimize (total-cost))) diff --git a/tests/fixtures/pddl_files/barman-sequential-optimal/p02.pddl b/tests/fixtures/pddl_files/barman-sequential-optimal/p02.pddl new file mode 100644 index 00000000..b167055d --- /dev/null +++ b/tests/fixtures/pddl_files/barman-sequential-optimal/p02.pddl @@ -0,0 +1,51 @@ +(define (problem prob) + (:domain barman) + (:objects + shaker1 - shaker + left right - hand + shot1 shot2 shot3 shot4 - shot + ingredient1 ingredient2 ingredient3 - ingredient + cocktail1 cocktail2 cocktail3 - cocktail + dispenser1 dispenser2 dispenser3 - dispenser + l0 l1 l2 - level +) + (:init + (= (total-cost) 0) + (ontable shaker1) + (ontable shot1) + (ontable shot2) + (ontable shot3) + (ontable shot4) + (dispenses dispenser1 ingredient1) + (dispenses dispenser2 ingredient2) + (dispenses dispenser3 ingredient3) + (clean shaker1) + (clean shot1) + (clean shot2) + (clean shot3) + (clean shot4) + (empty shaker1) + (empty shot1) + (empty shot2) + (empty shot3) + (empty shot4) + (handempty left) + (handempty right) + (shaker-empty-level shaker1 l0) + (shaker-level shaker1 l0) + (next l0 l1) + (next l1 l2) + (cocktail-part1 cocktail1 ingredient2) + (cocktail-part2 cocktail1 ingredient3) + (cocktail-part1 cocktail2 ingredient1) + (cocktail-part2 cocktail2 ingredient2) + (cocktail-part1 cocktail3 ingredient1) + (cocktail-part2 cocktail3 ingredient2) +) + (:goal + (and + (contains shot1 cocktail2) + (contains shot2 cocktail1) + (contains shot3 cocktail3) +)) +(:metric minimize (total-cost))) diff --git a/tests/fixtures/pddl_files/barman-sequential-optimal/p03.pddl b/tests/fixtures/pddl_files/barman-sequential-optimal/p03.pddl new file mode 100644 index 00000000..0a3cea0b --- /dev/null +++ b/tests/fixtures/pddl_files/barman-sequential-optimal/p03.pddl @@ -0,0 +1,51 @@ +(define (problem prob) + (:domain barman) + (:objects + shaker1 - shaker + left right - hand + shot1 shot2 shot3 shot4 - shot + ingredient1 ingredient2 ingredient3 - ingredient + cocktail1 cocktail2 cocktail3 - cocktail + dispenser1 dispenser2 dispenser3 - dispenser + l0 l1 l2 - level +) + (:init + (= (total-cost) 0) + (ontable shaker1) + (ontable shot1) + (ontable shot2) + (ontable shot3) + (ontable shot4) + (dispenses dispenser1 ingredient1) + (dispenses dispenser2 ingredient2) + (dispenses dispenser3 ingredient3) + (clean shaker1) + (clean shot1) + (clean shot2) + (clean shot3) + (clean shot4) + (empty shaker1) + (empty shot1) + (empty shot2) + (empty shot3) + (empty shot4) + (handempty left) + (handempty right) + (shaker-empty-level shaker1 l0) + (shaker-level shaker1 l0) + (next l0 l1) + (next l1 l2) + (cocktail-part1 cocktail1 ingredient1) + (cocktail-part2 cocktail1 ingredient2) + (cocktail-part1 cocktail2 ingredient1) + (cocktail-part2 cocktail2 ingredient2) + (cocktail-part1 cocktail3 ingredient3) + (cocktail-part2 cocktail3 ingredient2) +) + (:goal + (and + (contains shot1 cocktail3) + (contains shot2 cocktail2) + (contains shot3 cocktail1) +)) +(:metric minimize (total-cost))) diff --git a/tests/fixtures/pddl_files/barman-sequential-optimal/p04.pddl b/tests/fixtures/pddl_files/barman-sequential-optimal/p04.pddl new file mode 100644 index 00000000..a525a927 --- /dev/null +++ b/tests/fixtures/pddl_files/barman-sequential-optimal/p04.pddl @@ -0,0 +1,51 @@ +(define (problem prob) + (:domain barman) + (:objects + shaker1 - shaker + left right - hand + shot1 shot2 shot3 shot4 - shot + ingredient1 ingredient2 ingredient3 - ingredient + cocktail1 cocktail2 cocktail3 - cocktail + dispenser1 dispenser2 dispenser3 - dispenser + l0 l1 l2 - level +) + (:init + (= (total-cost) 0) + (ontable shaker1) + (ontable shot1) + (ontable shot2) + (ontable shot3) + (ontable shot4) + (dispenses dispenser1 ingredient1) + (dispenses dispenser2 ingredient2) + (dispenses dispenser3 ingredient3) + (clean shaker1) + (clean shot1) + (clean shot2) + (clean shot3) + (clean shot4) + (empty shaker1) + (empty shot1) + (empty shot2) + (empty shot3) + (empty shot4) + (handempty left) + (handempty right) + (shaker-empty-level shaker1 l0) + (shaker-level shaker1 l0) + (next l0 l1) + (next l1 l2) + (cocktail-part1 cocktail1 ingredient1) + (cocktail-part2 cocktail1 ingredient2) + (cocktail-part1 cocktail2 ingredient2) + (cocktail-part2 cocktail2 ingredient3) + (cocktail-part1 cocktail3 ingredient1) + (cocktail-part2 cocktail3 ingredient2) +) + (:goal + (and + (contains shot1 cocktail1) + (contains shot2 cocktail2) + (contains shot3 cocktail3) +)) +(:metric minimize (total-cost))) diff --git a/tests/fixtures/pddl_files/barman-sequential-optimal/p05.pddl b/tests/fixtures/pddl_files/barman-sequential-optimal/p05.pddl new file mode 100644 index 00000000..5fa96c40 --- /dev/null +++ b/tests/fixtures/pddl_files/barman-sequential-optimal/p05.pddl @@ -0,0 +1,57 @@ +(define (problem prob) + (:domain barman) + (:objects + shaker1 - shaker + left right - hand + shot1 shot2 shot3 shot4 shot5 - shot + ingredient1 ingredient2 ingredient3 - ingredient + cocktail1 cocktail2 cocktail3 cocktail4 - cocktail + dispenser1 dispenser2 dispenser3 - dispenser + l0 l1 l2 - level +) + (:init + (= (total-cost) 0) + (ontable shaker1) + (ontable shot1) + (ontable shot2) + (ontable shot3) + (ontable shot4) + (ontable shot5) + (dispenses dispenser1 ingredient1) + (dispenses dispenser2 ingredient2) + (dispenses dispenser3 ingredient3) + (clean shaker1) + (clean shot1) + (clean shot2) + (clean shot3) + (clean shot4) + (clean shot5) + (empty shaker1) + (empty shot1) + (empty shot2) + (empty shot3) + (empty shot4) + (empty shot5) + (handempty left) + (handempty right) + (shaker-empty-level shaker1 l0) + (shaker-level shaker1 l0) + (next l0 l1) + (next l1 l2) + (cocktail-part1 cocktail1 ingredient3) + (cocktail-part2 cocktail1 ingredient2) + (cocktail-part1 cocktail2 ingredient2) + (cocktail-part2 cocktail2 ingredient1) + (cocktail-part1 cocktail3 ingredient3) + (cocktail-part2 cocktail3 ingredient2) + (cocktail-part1 cocktail4 ingredient2) + (cocktail-part2 cocktail4 ingredient3) +) + (:goal + (and + (contains shot1 cocktail1) + (contains shot2 cocktail2) + (contains shot3 cocktail4) + (contains shot4 cocktail3) +)) +(:metric minimize (total-cost))) diff --git a/tests/fixtures/pddl_files/barman-sequential-optimal/p06.pddl b/tests/fixtures/pddl_files/barman-sequential-optimal/p06.pddl new file mode 100644 index 00000000..7e7c58f1 --- /dev/null +++ b/tests/fixtures/pddl_files/barman-sequential-optimal/p06.pddl @@ -0,0 +1,57 @@ +(define (problem prob) + (:domain barman) + (:objects + shaker1 - shaker + left right - hand + shot1 shot2 shot3 shot4 shot5 - shot + ingredient1 ingredient2 ingredient3 - ingredient + cocktail1 cocktail2 cocktail3 cocktail4 - cocktail + dispenser1 dispenser2 dispenser3 - dispenser + l0 l1 l2 - level +) + (:init + (= (total-cost) 0) + (ontable shaker1) + (ontable shot1) + (ontable shot2) + (ontable shot3) + (ontable shot4) + (ontable shot5) + (dispenses dispenser1 ingredient1) + (dispenses dispenser2 ingredient2) + (dispenses dispenser3 ingredient3) + (clean shaker1) + (clean shot1) + (clean shot2) + (clean shot3) + (clean shot4) + (clean shot5) + (empty shaker1) + (empty shot1) + (empty shot2) + (empty shot3) + (empty shot4) + (empty shot5) + (handempty left) + (handempty right) + (shaker-empty-level shaker1 l0) + (shaker-level shaker1 l0) + (next l0 l1) + (next l1 l2) + (cocktail-part1 cocktail1 ingredient3) + (cocktail-part2 cocktail1 ingredient2) + (cocktail-part1 cocktail2 ingredient1) + (cocktail-part2 cocktail2 ingredient3) + (cocktail-part1 cocktail3 ingredient3) + (cocktail-part2 cocktail3 ingredient2) + (cocktail-part1 cocktail4 ingredient2) + (cocktail-part2 cocktail4 ingredient3) +) + (:goal + (and + (contains shot1 cocktail4) + (contains shot2 cocktail1) + (contains shot3 cocktail2) + (contains shot4 cocktail3) +)) +(:metric minimize (total-cost))) diff --git a/tests/fixtures/pddl_files/barman-sequential-optimal/p07.pddl b/tests/fixtures/pddl_files/barman-sequential-optimal/p07.pddl new file mode 100644 index 00000000..7ad7becb --- /dev/null +++ b/tests/fixtures/pddl_files/barman-sequential-optimal/p07.pddl @@ -0,0 +1,57 @@ +(define (problem prob) + (:domain barman) + (:objects + shaker1 - shaker + left right - hand + shot1 shot2 shot3 shot4 shot5 - shot + ingredient1 ingredient2 ingredient3 - ingredient + cocktail1 cocktail2 cocktail3 cocktail4 - cocktail + dispenser1 dispenser2 dispenser3 - dispenser + l0 l1 l2 - level +) + (:init + (= (total-cost) 0) + (ontable shaker1) + (ontable shot1) + (ontable shot2) + (ontable shot3) + (ontable shot4) + (ontable shot5) + (dispenses dispenser1 ingredient1) + (dispenses dispenser2 ingredient2) + (dispenses dispenser3 ingredient3) + (clean shaker1) + (clean shot1) + (clean shot2) + (clean shot3) + (clean shot4) + (clean shot5) + (empty shaker1) + (empty shot1) + (empty shot2) + (empty shot3) + (empty shot4) + (empty shot5) + (handempty left) + (handempty right) + (shaker-empty-level shaker1 l0) + (shaker-level shaker1 l0) + (next l0 l1) + (next l1 l2) + (cocktail-part1 cocktail1 ingredient2) + (cocktail-part2 cocktail1 ingredient3) + (cocktail-part1 cocktail2 ingredient3) + (cocktail-part2 cocktail2 ingredient2) + (cocktail-part1 cocktail3 ingredient2) + (cocktail-part2 cocktail3 ingredient1) + (cocktail-part1 cocktail4 ingredient2) + (cocktail-part2 cocktail4 ingredient1) +) + (:goal + (and + (contains shot1 cocktail4) + (contains shot2 cocktail2) + (contains shot3 cocktail3) + (contains shot4 cocktail1) +)) +(:metric minimize (total-cost))) diff --git a/tests/fixtures/pddl_files/barman-sequential-optimal/p08.pddl b/tests/fixtures/pddl_files/barman-sequential-optimal/p08.pddl new file mode 100644 index 00000000..0da8dea2 --- /dev/null +++ b/tests/fixtures/pddl_files/barman-sequential-optimal/p08.pddl @@ -0,0 +1,57 @@ +(define (problem prob) + (:domain barman) + (:objects + shaker1 - shaker + left right - hand + shot1 shot2 shot3 shot4 shot5 - shot + ingredient1 ingredient2 ingredient3 - ingredient + cocktail1 cocktail2 cocktail3 cocktail4 - cocktail + dispenser1 dispenser2 dispenser3 - dispenser + l0 l1 l2 - level +) + (:init + (= (total-cost) 0) + (ontable shaker1) + (ontable shot1) + (ontable shot2) + (ontable shot3) + (ontable shot4) + (ontable shot5) + (dispenses dispenser1 ingredient1) + (dispenses dispenser2 ingredient2) + (dispenses dispenser3 ingredient3) + (clean shaker1) + (clean shot1) + (clean shot2) + (clean shot3) + (clean shot4) + (clean shot5) + (empty shaker1) + (empty shot1) + (empty shot2) + (empty shot3) + (empty shot4) + (empty shot5) + (handempty left) + (handempty right) + (shaker-empty-level shaker1 l0) + (shaker-level shaker1 l0) + (next l0 l1) + (next l1 l2) + (cocktail-part1 cocktail1 ingredient3) + (cocktail-part2 cocktail1 ingredient1) + (cocktail-part1 cocktail2 ingredient1) + (cocktail-part2 cocktail2 ingredient2) + (cocktail-part1 cocktail3 ingredient2) + (cocktail-part2 cocktail3 ingredient1) + (cocktail-part1 cocktail4 ingredient1) + (cocktail-part2 cocktail4 ingredient2) +) + (:goal + (and + (contains shot1 cocktail2) + (contains shot2 cocktail1) + (contains shot3 cocktail3) + (contains shot4 cocktail4) +)) +(:metric minimize (total-cost))) diff --git a/tests/fixtures/pddl_files/barman-sequential-optimal/p09.pddl b/tests/fixtures/pddl_files/barman-sequential-optimal/p09.pddl new file mode 100644 index 00000000..516196f1 --- /dev/null +++ b/tests/fixtures/pddl_files/barman-sequential-optimal/p09.pddl @@ -0,0 +1,63 @@ +(define (problem prob) + (:domain barman) + (:objects + shaker1 - shaker + left right - hand + shot1 shot2 shot3 shot4 shot5 shot6 - shot + ingredient1 ingredient2 ingredient3 - ingredient + cocktail1 cocktail2 cocktail3 cocktail4 cocktail5 - cocktail + dispenser1 dispenser2 dispenser3 - dispenser + l0 l1 l2 - level +) + (:init + (= (total-cost) 0) + (ontable shaker1) + (ontable shot1) + (ontable shot2) + (ontable shot3) + (ontable shot4) + (ontable shot5) + (ontable shot6) + (dispenses dispenser1 ingredient1) + (dispenses dispenser2 ingredient2) + (dispenses dispenser3 ingredient3) + (clean shaker1) + (clean shot1) + (clean shot2) + (clean shot3) + (clean shot4) + (clean shot5) + (clean shot6) + (empty shaker1) + (empty shot1) + (empty shot2) + (empty shot3) + (empty shot4) + (empty shot5) + (empty shot6) + (handempty left) + (handempty right) + (shaker-empty-level shaker1 l0) + (shaker-level shaker1 l0) + (next l0 l1) + (next l1 l2) + (cocktail-part1 cocktail1 ingredient3) + (cocktail-part2 cocktail1 ingredient2) + (cocktail-part1 cocktail2 ingredient2) + (cocktail-part2 cocktail2 ingredient3) + (cocktail-part1 cocktail3 ingredient2) + (cocktail-part2 cocktail3 ingredient1) + (cocktail-part1 cocktail4 ingredient1) + (cocktail-part2 cocktail4 ingredient2) + (cocktail-part1 cocktail5 ingredient2) + (cocktail-part2 cocktail5 ingredient1) +) + (:goal + (and + (contains shot1 cocktail1) + (contains shot2 cocktail5) + (contains shot3 cocktail4) + (contains shot4 cocktail3) + (contains shot5 cocktail2) +)) +(:metric minimize (total-cost))) diff --git a/tests/fixtures/pddl_files/barman-sequential-optimal/p10.pddl b/tests/fixtures/pddl_files/barman-sequential-optimal/p10.pddl new file mode 100644 index 00000000..a877c07f --- /dev/null +++ b/tests/fixtures/pddl_files/barman-sequential-optimal/p10.pddl @@ -0,0 +1,63 @@ +(define (problem prob) + (:domain barman) + (:objects + shaker1 - shaker + left right - hand + shot1 shot2 shot3 shot4 shot5 shot6 - shot + ingredient1 ingredient2 ingredient3 - ingredient + cocktail1 cocktail2 cocktail3 cocktail4 cocktail5 - cocktail + dispenser1 dispenser2 dispenser3 - dispenser + l0 l1 l2 - level +) + (:init + (= (total-cost) 0) + (ontable shaker1) + (ontable shot1) + (ontable shot2) + (ontable shot3) + (ontable shot4) + (ontable shot5) + (ontable shot6) + (dispenses dispenser1 ingredient1) + (dispenses dispenser2 ingredient2) + (dispenses dispenser3 ingredient3) + (clean shaker1) + (clean shot1) + (clean shot2) + (clean shot3) + (clean shot4) + (clean shot5) + (clean shot6) + (empty shaker1) + (empty shot1) + (empty shot2) + (empty shot3) + (empty shot4) + (empty shot5) + (empty shot6) + (handempty left) + (handempty right) + (shaker-empty-level shaker1 l0) + (shaker-level shaker1 l0) + (next l0 l1) + (next l1 l2) + (cocktail-part1 cocktail1 ingredient2) + (cocktail-part2 cocktail1 ingredient3) + (cocktail-part1 cocktail2 ingredient3) + (cocktail-part2 cocktail2 ingredient2) + (cocktail-part1 cocktail3 ingredient3) + (cocktail-part2 cocktail3 ingredient1) + (cocktail-part1 cocktail4 ingredient1) + (cocktail-part2 cocktail4 ingredient3) + (cocktail-part1 cocktail5 ingredient1) + (cocktail-part2 cocktail5 ingredient2) +) + (:goal + (and + (contains shot1 cocktail1) + (contains shot2 cocktail5) + (contains shot3 cocktail4) + (contains shot4 cocktail2) + (contains shot5 cocktail3) +)) +(:metric minimize (total-cost))) diff --git a/tests/fixtures/pddl_files/barman-sequential-optimal/p11.pddl b/tests/fixtures/pddl_files/barman-sequential-optimal/p11.pddl new file mode 100644 index 00000000..f179f1a7 --- /dev/null +++ b/tests/fixtures/pddl_files/barman-sequential-optimal/p11.pddl @@ -0,0 +1,63 @@ +(define (problem prob) + (:domain barman) + (:objects + shaker1 - shaker + left right - hand + shot1 shot2 shot3 shot4 shot5 shot6 - shot + ingredient1 ingredient2 ingredient3 - ingredient + cocktail1 cocktail2 cocktail3 cocktail4 cocktail5 - cocktail + dispenser1 dispenser2 dispenser3 - dispenser + l0 l1 l2 - level +) + (:init + (= (total-cost) 0) + (ontable shaker1) + (ontable shot1) + (ontable shot2) + (ontable shot3) + (ontable shot4) + (ontable shot5) + (ontable shot6) + (dispenses dispenser1 ingredient1) + (dispenses dispenser2 ingredient2) + (dispenses dispenser3 ingredient3) + (clean shaker1) + (clean shot1) + (clean shot2) + (clean shot3) + (clean shot4) + (clean shot5) + (clean shot6) + (empty shaker1) + (empty shot1) + (empty shot2) + (empty shot3) + (empty shot4) + (empty shot5) + (empty shot6) + (handempty left) + (handempty right) + (shaker-empty-level shaker1 l0) + (shaker-level shaker1 l0) + (next l0 l1) + (next l1 l2) + (cocktail-part1 cocktail1 ingredient1) + (cocktail-part2 cocktail1 ingredient3) + (cocktail-part1 cocktail2 ingredient1) + (cocktail-part2 cocktail2 ingredient3) + (cocktail-part1 cocktail3 ingredient1) + (cocktail-part2 cocktail3 ingredient3) + (cocktail-part1 cocktail4 ingredient1) + (cocktail-part2 cocktail4 ingredient2) + (cocktail-part1 cocktail5 ingredient1) + (cocktail-part2 cocktail5 ingredient2) +) + (:goal + (and + (contains shot1 cocktail4) + (contains shot2 cocktail2) + (contains shot3 cocktail3) + (contains shot4 cocktail1) + (contains shot5 cocktail5) +)) +(:metric minimize (total-cost))) diff --git a/tests/fixtures/pddl_files/barman-sequential-optimal/p12.pddl b/tests/fixtures/pddl_files/barman-sequential-optimal/p12.pddl new file mode 100644 index 00000000..6af19709 --- /dev/null +++ b/tests/fixtures/pddl_files/barman-sequential-optimal/p12.pddl @@ -0,0 +1,63 @@ +(define (problem prob) + (:domain barman) + (:objects + shaker1 - shaker + left right - hand + shot1 shot2 shot3 shot4 shot5 shot6 - shot + ingredient1 ingredient2 ingredient3 - ingredient + cocktail1 cocktail2 cocktail3 cocktail4 cocktail5 - cocktail + dispenser1 dispenser2 dispenser3 - dispenser + l0 l1 l2 - level +) + (:init + (= (total-cost) 0) + (ontable shaker1) + (ontable shot1) + (ontable shot2) + (ontable shot3) + (ontable shot4) + (ontable shot5) + (ontable shot6) + (dispenses dispenser1 ingredient1) + (dispenses dispenser2 ingredient2) + (dispenses dispenser3 ingredient3) + (clean shaker1) + (clean shot1) + (clean shot2) + (clean shot3) + (clean shot4) + (clean shot5) + (clean shot6) + (empty shaker1) + (empty shot1) + (empty shot2) + (empty shot3) + (empty shot4) + (empty shot5) + (empty shot6) + (handempty left) + (handempty right) + (shaker-empty-level shaker1 l0) + (shaker-level shaker1 l0) + (next l0 l1) + (next l1 l2) + (cocktail-part1 cocktail1 ingredient2) + (cocktail-part2 cocktail1 ingredient1) + (cocktail-part1 cocktail2 ingredient1) + (cocktail-part2 cocktail2 ingredient3) + (cocktail-part1 cocktail3 ingredient2) + (cocktail-part2 cocktail3 ingredient1) + (cocktail-part1 cocktail4 ingredient3) + (cocktail-part2 cocktail4 ingredient1) + (cocktail-part1 cocktail5 ingredient2) + (cocktail-part2 cocktail5 ingredient3) +) + (:goal + (and + (contains shot1 cocktail5) + (contains shot2 cocktail1) + (contains shot3 cocktail3) + (contains shot4 cocktail2) + (contains shot5 cocktail4) +)) +(:metric minimize (total-cost))) diff --git a/tests/fixtures/pddl_files/barman-sequential-optimal/p13.pddl b/tests/fixtures/pddl_files/barman-sequential-optimal/p13.pddl new file mode 100644 index 00000000..0567267a --- /dev/null +++ b/tests/fixtures/pddl_files/barman-sequential-optimal/p13.pddl @@ -0,0 +1,73 @@ +(define (problem prob) + (:domain barman) + (:objects + shaker1 - shaker + left right - hand + shot1 shot2 shot3 shot4 shot5 shot6 shot7 shot8 - shot + ingredient1 ingredient2 ingredient3 - ingredient + cocktail1 cocktail2 cocktail3 cocktail4 cocktail5 cocktail6 - cocktail + dispenser1 dispenser2 dispenser3 - dispenser + l0 l1 l2 - level +) + (:init + (= (total-cost) 0) + (ontable shaker1) + (ontable shot1) + (ontable shot2) + (ontable shot3) + (ontable shot4) + (ontable shot5) + (ontable shot6) + (ontable shot7) + (ontable shot8) + (dispenses dispenser1 ingredient1) + (dispenses dispenser2 ingredient2) + (dispenses dispenser3 ingredient3) + (clean shaker1) + (clean shot1) + (clean shot2) + (clean shot3) + (clean shot4) + (clean shot5) + (clean shot6) + (clean shot7) + (clean shot8) + (empty shaker1) + (empty shot1) + (empty shot2) + (empty shot3) + (empty shot4) + (empty shot5) + (empty shot6) + (empty shot7) + (empty shot8) + (handempty left) + (handempty right) + (shaker-empty-level shaker1 l0) + (shaker-level shaker1 l0) + (next l0 l1) + (next l1 l2) + (cocktail-part1 cocktail1 ingredient1) + (cocktail-part2 cocktail1 ingredient2) + (cocktail-part1 cocktail2 ingredient3) + (cocktail-part2 cocktail2 ingredient1) + (cocktail-part1 cocktail3 ingredient2) + (cocktail-part2 cocktail3 ingredient3) + (cocktail-part1 cocktail4 ingredient1) + (cocktail-part2 cocktail4 ingredient3) + (cocktail-part1 cocktail5 ingredient1) + (cocktail-part2 cocktail5 ingredient2) + (cocktail-part1 cocktail6 ingredient3) + (cocktail-part2 cocktail6 ingredient2) +) + (:goal + (and + (contains shot1 cocktail3) + (contains shot2 cocktail2) + (contains shot3 cocktail4) + (contains shot4 cocktail5) + (contains shot5 cocktail1) + (contains shot6 cocktail6) + (contains shot7 ingredient1) +)) +(:metric minimize (total-cost))) diff --git a/tests/fixtures/pddl_files/barman-sequential-optimal/p14.pddl b/tests/fixtures/pddl_files/barman-sequential-optimal/p14.pddl new file mode 100644 index 00000000..f5122d89 --- /dev/null +++ b/tests/fixtures/pddl_files/barman-sequential-optimal/p14.pddl @@ -0,0 +1,73 @@ +(define (problem prob) + (:domain barman) + (:objects + shaker1 - shaker + left right - hand + shot1 shot2 shot3 shot4 shot5 shot6 shot7 shot8 - shot + ingredient1 ingredient2 ingredient3 - ingredient + cocktail1 cocktail2 cocktail3 cocktail4 cocktail5 cocktail6 - cocktail + dispenser1 dispenser2 dispenser3 - dispenser + l0 l1 l2 - level +) + (:init + (= (total-cost) 0) + (ontable shaker1) + (ontable shot1) + (ontable shot2) + (ontable shot3) + (ontable shot4) + (ontable shot5) + (ontable shot6) + (ontable shot7) + (ontable shot8) + (dispenses dispenser1 ingredient1) + (dispenses dispenser2 ingredient2) + (dispenses dispenser3 ingredient3) + (clean shaker1) + (clean shot1) + (clean shot2) + (clean shot3) + (clean shot4) + (clean shot5) + (clean shot6) + (clean shot7) + (clean shot8) + (empty shaker1) + (empty shot1) + (empty shot2) + (empty shot3) + (empty shot4) + (empty shot5) + (empty shot6) + (empty shot7) + (empty shot8) + (handempty left) + (handempty right) + (shaker-empty-level shaker1 l0) + (shaker-level shaker1 l0) + (next l0 l1) + (next l1 l2) + (cocktail-part1 cocktail1 ingredient3) + (cocktail-part2 cocktail1 ingredient1) + (cocktail-part1 cocktail2 ingredient2) + (cocktail-part2 cocktail2 ingredient3) + (cocktail-part1 cocktail3 ingredient2) + (cocktail-part2 cocktail3 ingredient1) + (cocktail-part1 cocktail4 ingredient3) + (cocktail-part2 cocktail4 ingredient2) + (cocktail-part1 cocktail5 ingredient3) + (cocktail-part2 cocktail5 ingredient1) + (cocktail-part1 cocktail6 ingredient2) + (cocktail-part2 cocktail6 ingredient1) +) + (:goal + (and + (contains shot1 cocktail4) + (contains shot2 cocktail6) + (contains shot3 cocktail1) + (contains shot4 cocktail2) + (contains shot5 cocktail3) + (contains shot6 cocktail5) + (contains shot7 cocktail4) +)) +(:metric minimize (total-cost))) diff --git a/tests/fixtures/pddl_files/barman-sequential-optimal/p15.pddl b/tests/fixtures/pddl_files/barman-sequential-optimal/p15.pddl new file mode 100644 index 00000000..30640d28 --- /dev/null +++ b/tests/fixtures/pddl_files/barman-sequential-optimal/p15.pddl @@ -0,0 +1,73 @@ +(define (problem prob) + (:domain barman) + (:objects + shaker1 - shaker + left right - hand + shot1 shot2 shot3 shot4 shot5 shot6 shot7 shot8 - shot + ingredient1 ingredient2 ingredient3 - ingredient + cocktail1 cocktail2 cocktail3 cocktail4 cocktail5 cocktail6 - cocktail + dispenser1 dispenser2 dispenser3 - dispenser + l0 l1 l2 - level +) + (:init + (= (total-cost) 0) + (ontable shaker1) + (ontable shot1) + (ontable shot2) + (ontable shot3) + (ontable shot4) + (ontable shot5) + (ontable shot6) + (ontable shot7) + (ontable shot8) + (dispenses dispenser1 ingredient1) + (dispenses dispenser2 ingredient2) + (dispenses dispenser3 ingredient3) + (clean shaker1) + (clean shot1) + (clean shot2) + (clean shot3) + (clean shot4) + (clean shot5) + (clean shot6) + (clean shot7) + (clean shot8) + (empty shaker1) + (empty shot1) + (empty shot2) + (empty shot3) + (empty shot4) + (empty shot5) + (empty shot6) + (empty shot7) + (empty shot8) + (handempty left) + (handempty right) + (shaker-empty-level shaker1 l0) + (shaker-level shaker1 l0) + (next l0 l1) + (next l1 l2) + (cocktail-part1 cocktail1 ingredient1) + (cocktail-part2 cocktail1 ingredient2) + (cocktail-part1 cocktail2 ingredient1) + (cocktail-part2 cocktail2 ingredient2) + (cocktail-part1 cocktail3 ingredient3) + (cocktail-part2 cocktail3 ingredient1) + (cocktail-part1 cocktail4 ingredient1) + (cocktail-part2 cocktail4 ingredient3) + (cocktail-part1 cocktail5 ingredient2) + (cocktail-part2 cocktail5 ingredient3) + (cocktail-part1 cocktail6 ingredient1) + (cocktail-part2 cocktail6 ingredient2) +) + (:goal + (and + (contains shot1 cocktail6) + (contains shot2 cocktail2) + (contains shot3 cocktail5) + (contains shot4 cocktail3) + (contains shot5 cocktail4) + (contains shot6 cocktail1) + (contains shot7 ingredient3) +)) +(:metric minimize (total-cost))) diff --git a/tests/fixtures/pddl_files/barman-sequential-optimal/p16.pddl b/tests/fixtures/pddl_files/barman-sequential-optimal/p16.pddl new file mode 100644 index 00000000..4b8bbab1 --- /dev/null +++ b/tests/fixtures/pddl_files/barman-sequential-optimal/p16.pddl @@ -0,0 +1,73 @@ +(define (problem prob) + (:domain barman) + (:objects + shaker1 - shaker + left right - hand + shot1 shot2 shot3 shot4 shot5 shot6 shot7 shot8 - shot + ingredient1 ingredient2 ingredient3 - ingredient + cocktail1 cocktail2 cocktail3 cocktail4 cocktail5 cocktail6 - cocktail + dispenser1 dispenser2 dispenser3 - dispenser + l0 l1 l2 - level +) + (:init + (= (total-cost) 0) + (ontable shaker1) + (ontable shot1) + (ontable shot2) + (ontable shot3) + (ontable shot4) + (ontable shot5) + (ontable shot6) + (ontable shot7) + (ontable shot8) + (dispenses dispenser1 ingredient1) + (dispenses dispenser2 ingredient2) + (dispenses dispenser3 ingredient3) + (clean shaker1) + (clean shot1) + (clean shot2) + (clean shot3) + (clean shot4) + (clean shot5) + (clean shot6) + (clean shot7) + (clean shot8) + (empty shaker1) + (empty shot1) + (empty shot2) + (empty shot3) + (empty shot4) + (empty shot5) + (empty shot6) + (empty shot7) + (empty shot8) + (handempty left) + (handempty right) + (shaker-empty-level shaker1 l0) + (shaker-level shaker1 l0) + (next l0 l1) + (next l1 l2) + (cocktail-part1 cocktail1 ingredient1) + (cocktail-part2 cocktail1 ingredient3) + (cocktail-part1 cocktail2 ingredient1) + (cocktail-part2 cocktail2 ingredient2) + (cocktail-part1 cocktail3 ingredient2) + (cocktail-part2 cocktail3 ingredient3) + (cocktail-part1 cocktail4 ingredient1) + (cocktail-part2 cocktail4 ingredient2) + (cocktail-part1 cocktail5 ingredient3) + (cocktail-part2 cocktail5 ingredient1) + (cocktail-part1 cocktail6 ingredient3) + (cocktail-part2 cocktail6 ingredient1) +) + (:goal + (and + (contains shot1 cocktail3) + (contains shot2 cocktail1) + (contains shot3 cocktail4) + (contains shot4 cocktail5) + (contains shot5 cocktail2) + (contains shot6 cocktail6) + (contains shot7 ingredient2) +)) +(:metric minimize (total-cost))) diff --git a/tests/fixtures/pddl_files/barman-sequential-optimal/p17.pddl b/tests/fixtures/pddl_files/barman-sequential-optimal/p17.pddl new file mode 100644 index 00000000..3ddebaa4 --- /dev/null +++ b/tests/fixtures/pddl_files/barman-sequential-optimal/p17.pddl @@ -0,0 +1,79 @@ +(define (problem prob) + (:domain barman) + (:objects + shaker1 - shaker + left right - hand + shot1 shot2 shot3 shot4 shot5 shot6 shot7 shot8 shot9 - shot + ingredient1 ingredient2 ingredient3 - ingredient + cocktail1 cocktail2 cocktail3 cocktail4 cocktail5 cocktail6 cocktail7 - cocktail + dispenser1 dispenser2 dispenser3 - dispenser + l0 l1 l2 - level +) + (:init + (= (total-cost) 0) + (ontable shaker1) + (ontable shot1) + (ontable shot2) + (ontable shot3) + (ontable shot4) + (ontable shot5) + (ontable shot6) + (ontable shot7) + (ontable shot8) + (ontable shot9) + (dispenses dispenser1 ingredient1) + (dispenses dispenser2 ingredient2) + (dispenses dispenser3 ingredient3) + (clean shaker1) + (clean shot1) + (clean shot2) + (clean shot3) + (clean shot4) + (clean shot5) + (clean shot6) + (clean shot7) + (clean shot8) + (clean shot9) + (empty shaker1) + (empty shot1) + (empty shot2) + (empty shot3) + (empty shot4) + (empty shot5) + (empty shot6) + (empty shot7) + (empty shot8) + (empty shot9) + (handempty left) + (handempty right) + (shaker-empty-level shaker1 l0) + (shaker-level shaker1 l0) + (next l0 l1) + (next l1 l2) + (cocktail-part1 cocktail1 ingredient1) + (cocktail-part2 cocktail1 ingredient2) + (cocktail-part1 cocktail2 ingredient1) + (cocktail-part2 cocktail2 ingredient2) + (cocktail-part1 cocktail3 ingredient3) + (cocktail-part2 cocktail3 ingredient1) + (cocktail-part1 cocktail4 ingredient2) + (cocktail-part2 cocktail4 ingredient3) + (cocktail-part1 cocktail5 ingredient2) + (cocktail-part2 cocktail5 ingredient1) + (cocktail-part1 cocktail6 ingredient3) + (cocktail-part2 cocktail6 ingredient1) + (cocktail-part1 cocktail7 ingredient1) + (cocktail-part2 cocktail7 ingredient2) +) + (:goal + (and + (contains shot1 cocktail7) + (contains shot2 cocktail6) + (contains shot3 cocktail3) + (contains shot4 cocktail2) + (contains shot5 cocktail4) + (contains shot6 cocktail1) + (contains shot7 cocktail5) + (contains shot8 cocktail3) +)) +(:metric minimize (total-cost))) diff --git a/tests/fixtures/pddl_files/barman-sequential-optimal/p18.pddl b/tests/fixtures/pddl_files/barman-sequential-optimal/p18.pddl new file mode 100644 index 00000000..ac1c64e6 --- /dev/null +++ b/tests/fixtures/pddl_files/barman-sequential-optimal/p18.pddl @@ -0,0 +1,79 @@ +(define (problem prob) + (:domain barman) + (:objects + shaker1 - shaker + left right - hand + shot1 shot2 shot3 shot4 shot5 shot6 shot7 shot8 shot9 - shot + ingredient1 ingredient2 ingredient3 - ingredient + cocktail1 cocktail2 cocktail3 cocktail4 cocktail5 cocktail6 cocktail7 - cocktail + dispenser1 dispenser2 dispenser3 - dispenser + l0 l1 l2 - level +) + (:init + (= (total-cost) 0) + (ontable shaker1) + (ontable shot1) + (ontable shot2) + (ontable shot3) + (ontable shot4) + (ontable shot5) + (ontable shot6) + (ontable shot7) + (ontable shot8) + (ontable shot9) + (dispenses dispenser1 ingredient1) + (dispenses dispenser2 ingredient2) + (dispenses dispenser3 ingredient3) + (clean shaker1) + (clean shot1) + (clean shot2) + (clean shot3) + (clean shot4) + (clean shot5) + (clean shot6) + (clean shot7) + (clean shot8) + (clean shot9) + (empty shaker1) + (empty shot1) + (empty shot2) + (empty shot3) + (empty shot4) + (empty shot5) + (empty shot6) + (empty shot7) + (empty shot8) + (empty shot9) + (handempty left) + (handempty right) + (shaker-empty-level shaker1 l0) + (shaker-level shaker1 l0) + (next l0 l1) + (next l1 l2) + (cocktail-part1 cocktail1 ingredient3) + (cocktail-part2 cocktail1 ingredient1) + (cocktail-part1 cocktail2 ingredient3) + (cocktail-part2 cocktail2 ingredient1) + (cocktail-part1 cocktail3 ingredient1) + (cocktail-part2 cocktail3 ingredient2) + (cocktail-part1 cocktail4 ingredient2) + (cocktail-part2 cocktail4 ingredient1) + (cocktail-part1 cocktail5 ingredient2) + (cocktail-part2 cocktail5 ingredient3) + (cocktail-part1 cocktail6 ingredient2) + (cocktail-part2 cocktail6 ingredient3) + (cocktail-part1 cocktail7 ingredient2) + (cocktail-part2 cocktail7 ingredient1) +) + (:goal + (and + (contains shot1 cocktail6) + (contains shot2 cocktail1) + (contains shot3 cocktail7) + (contains shot4 cocktail4) + (contains shot5 cocktail2) + (contains shot6 cocktail3) + (contains shot7 cocktail5) + (contains shot8 cocktail1) +)) +(:metric minimize (total-cost))) diff --git a/tests/fixtures/pddl_files/barman-sequential-optimal/p19.pddl b/tests/fixtures/pddl_files/barman-sequential-optimal/p19.pddl new file mode 100644 index 00000000..c51eb32a --- /dev/null +++ b/tests/fixtures/pddl_files/barman-sequential-optimal/p19.pddl @@ -0,0 +1,79 @@ +(define (problem prob) + (:domain barman) + (:objects + shaker1 - shaker + left right - hand + shot1 shot2 shot3 shot4 shot5 shot6 shot7 shot8 shot9 - shot + ingredient1 ingredient2 ingredient3 - ingredient + cocktail1 cocktail2 cocktail3 cocktail4 cocktail5 cocktail6 cocktail7 - cocktail + dispenser1 dispenser2 dispenser3 - dispenser + l0 l1 l2 - level +) + (:init + (= (total-cost) 0) + (ontable shaker1) + (ontable shot1) + (ontable shot2) + (ontable shot3) + (ontable shot4) + (ontable shot5) + (ontable shot6) + (ontable shot7) + (ontable shot8) + (ontable shot9) + (dispenses dispenser1 ingredient1) + (dispenses dispenser2 ingredient2) + (dispenses dispenser3 ingredient3) + (clean shaker1) + (clean shot1) + (clean shot2) + (clean shot3) + (clean shot4) + (clean shot5) + (clean shot6) + (clean shot7) + (clean shot8) + (clean shot9) + (empty shaker1) + (empty shot1) + (empty shot2) + (empty shot3) + (empty shot4) + (empty shot5) + (empty shot6) + (empty shot7) + (empty shot8) + (empty shot9) + (handempty left) + (handempty right) + (shaker-empty-level shaker1 l0) + (shaker-level shaker1 l0) + (next l0 l1) + (next l1 l2) + (cocktail-part1 cocktail1 ingredient2) + (cocktail-part2 cocktail1 ingredient1) + (cocktail-part1 cocktail2 ingredient1) + (cocktail-part2 cocktail2 ingredient3) + (cocktail-part1 cocktail3 ingredient3) + (cocktail-part2 cocktail3 ingredient1) + (cocktail-part1 cocktail4 ingredient1) + (cocktail-part2 cocktail4 ingredient2) + (cocktail-part1 cocktail5 ingredient1) + (cocktail-part2 cocktail5 ingredient3) + (cocktail-part1 cocktail6 ingredient2) + (cocktail-part2 cocktail6 ingredient3) + (cocktail-part1 cocktail7 ingredient3) + (cocktail-part2 cocktail7 ingredient2) +) + (:goal + (and + (contains shot1 cocktail7) + (contains shot2 cocktail1) + (contains shot3 cocktail3) + (contains shot4 cocktail5) + (contains shot5 cocktail4) + (contains shot6 cocktail6) + (contains shot7 cocktail2) + (contains shot8 cocktail4) +)) +(:metric minimize (total-cost))) diff --git a/tests/fixtures/pddl_files/barman-sequential-optimal/p20.pddl b/tests/fixtures/pddl_files/barman-sequential-optimal/p20.pddl new file mode 100644 index 00000000..46dda631 --- /dev/null +++ b/tests/fixtures/pddl_files/barman-sequential-optimal/p20.pddl @@ -0,0 +1,79 @@ +(define (problem prob) + (:domain barman) + (:objects + shaker1 - shaker + left right - hand + shot1 shot2 shot3 shot4 shot5 shot6 shot7 shot8 shot9 - shot + ingredient1 ingredient2 ingredient3 - ingredient + cocktail1 cocktail2 cocktail3 cocktail4 cocktail5 cocktail6 cocktail7 - cocktail + dispenser1 dispenser2 dispenser3 - dispenser + l0 l1 l2 - level +) + (:init + (= (total-cost) 0) + (ontable shaker1) + (ontable shot1) + (ontable shot2) + (ontable shot3) + (ontable shot4) + (ontable shot5) + (ontable shot6) + (ontable shot7) + (ontable shot8) + (ontable shot9) + (dispenses dispenser1 ingredient1) + (dispenses dispenser2 ingredient2) + (dispenses dispenser3 ingredient3) + (clean shaker1) + (clean shot1) + (clean shot2) + (clean shot3) + (clean shot4) + (clean shot5) + (clean shot6) + (clean shot7) + (clean shot8) + (clean shot9) + (empty shaker1) + (empty shot1) + (empty shot2) + (empty shot3) + (empty shot4) + (empty shot5) + (empty shot6) + (empty shot7) + (empty shot8) + (empty shot9) + (handempty left) + (handempty right) + (shaker-empty-level shaker1 l0) + (shaker-level shaker1 l0) + (next l0 l1) + (next l1 l2) + (cocktail-part1 cocktail1 ingredient3) + (cocktail-part2 cocktail1 ingredient1) + (cocktail-part1 cocktail2 ingredient3) + (cocktail-part2 cocktail2 ingredient1) + (cocktail-part1 cocktail3 ingredient2) + (cocktail-part2 cocktail3 ingredient3) + (cocktail-part1 cocktail4 ingredient3) + (cocktail-part2 cocktail4 ingredient1) + (cocktail-part1 cocktail5 ingredient3) + (cocktail-part2 cocktail5 ingredient1) + (cocktail-part1 cocktail6 ingredient1) + (cocktail-part2 cocktail6 ingredient2) + (cocktail-part1 cocktail7 ingredient1) + (cocktail-part2 cocktail7 ingredient2) +) + (:goal + (and + (contains shot1 cocktail3) + (contains shot2 cocktail6) + (contains shot3 cocktail1) + (contains shot4 cocktail7) + (contains shot5 cocktail2) + (contains shot6 cocktail5) + (contains shot7 cocktail4) + (contains shot8 cocktail5) +)) +(:metric minimize (total-cost))) diff --git a/tests/fixtures/pddl_files/cave-diving-sequential-optimal/domain.pddl b/tests/fixtures/pddl_files/cave-diving-sequential-optimal/domain.pddl new file mode 100644 index 00000000..9f8b46e3 --- /dev/null +++ b/tests/fixtures/pddl_files/cave-diving-sequential-optimal/domain.pddl @@ -0,0 +1,145 @@ +;; Cave Diving ADL +;; Authors: Nathan Robinson, +;; Christian Muise, and +;; Charles Gretton + +(define (domain cave-diving-adl) + (:requirements :typing :action-costs :adl :numeric-fluents :action-costs) + (:types location diver tank quantity) + (:predicates + (at-tank ?t - tank ?l - location) + (in-storage ?t - tank) + (full ?t - tank) + (next-tank ?t1 - tank ?t2 - tank) + (at-diver ?d - diver ?l - location) + (available ?d - diver) + (at-surface ?d - diver) + (decompressing ?d - diver) + (precludes ?d1 - diver ?d2 - diver) + (cave-entrance ?l - location) + (connected ?l1 - location ?l2 - location) + (next-quantity ?q1 - quantity ?q2 - quantity) + (holding ?d - diver ?t - tank) + (capacity ?d - diver ?q - quantity) + (have-photo ?l - location) + (in-water ) + ) + + (:functions + (hiring-cost ?d - diver) - number + (other-cost) - number + (total-cost) - number + ) + + (:action hire-diver + :parameters (?d1 - diver) + :precondition (and (available ?d1) + (not (in-water)) + ) + :effect (and (at-surface ?d1) + (not (available ?d1)) + (forall (?d2 - diver) + (when (precludes ?d1 ?d2) (not (available ?d2)))) + (in-water) + (increase (total-cost) (hiring-cost ?d1)) + ) + ) + + (:action prepare-tank + :parameters (?d - diver ?t1 ?t2 - tank ?q1 ?q2 - quantity) + :precondition (and (at-surface ?d) + (in-storage ?t1) + (next-quantity ?q1 ?q2) + (capacity ?d ?q2) + (next-tank ?t1 ?t2) + ) + :effect (and (not (in-storage ?t1)) + (not (capacity ?d ?q2)) + (in-storage ?t2) + (full ?t1) + (capacity ?d ?q1) + (holding ?d ?t1) + (increase (total-cost) (other-cost )) + ) + ) + + (:action enter-water + :parameters (?d - diver ?l - location) + :precondition (and (at-surface ?d) + (cave-entrance ?l) + ) + :effect (and (not (at-surface ?d)) + (at-diver ?d ?l) + (increase (total-cost) (other-cost )) + ) + ) + + (:action pickup-tank + :parameters (?d - diver ?t - tank ?l - location ?q1 ?q2 - quantity) + :precondition (and (at-diver ?d ?l) + (at-tank ?t ?l) + (next-quantity ?q1 ?q2) + (capacity ?d ?q2) + ) + :effect (and (not (at-tank ?t ?l)) + (not (capacity ?d ?q2)) + (holding ?d ?t) + (capacity ?d ?q1) + (increase (total-cost) (other-cost )) + ) + ) + + (:action drop-tank + :parameters (?d - diver ?t - tank ?l - location ?q1 ?q2 - quantity) + :precondition (and (at-diver ?d ?l) + (holding ?d ?t) + (next-quantity ?q1 ?q2) + (capacity ?d ?q1) + ) + :effect (and (not (holding ?d ?t)) + (not (capacity ?d ?q1)) + (at-tank ?t ?l) + (capacity ?d ?q2) + (increase (total-cost) (other-cost )) + ) + ) + + (:action swim + :parameters (?d - diver ?t - tank ?l1 ?l2 - location) + :precondition (and (at-diver ?d ?l1) + (holding ?d ?t) + (full ?t) + (connected ?l1 ?l2) + ) + :effect (and (not (at-diver ?d ?l1)) + (not (full ?t)) + (at-diver ?d ?l2) + (increase (total-cost) (other-cost )) + ) + ) + + (:action photograph + :parameters (?d - diver ?l - location ?t - tank) + :precondition (and (at-diver ?d ?l) + (holding ?d ?t) + (full ?t) + ) + :effect (and (not (full ?t)) + (have-photo ?l) + (increase (total-cost) (other-cost )) + ) + ) + + (:action decompress + :parameters (?d - diver ?l - location) + :precondition (and (at-diver ?d ?l) + (cave-entrance ?l) + ) + :effect (and (not (at-diver ?d ?l)) + (decompressing ?d) + (not (in-water)) + (increase (total-cost) (other-cost )) + ) + ) + +) diff --git a/tests/fixtures/pddl_files/cave-diving-sequential-optimal/p01.pddl b/tests/fixtures/pddl_files/cave-diving-sequential-optimal/p01.pddl new file mode 100644 index 00000000..5fe1b616 --- /dev/null +++ b/tests/fixtures/pddl_files/cave-diving-sequential-optimal/p01.pddl @@ -0,0 +1,78 @@ +;; Cave Diving ADL +;; Authors: Nathan Robinson, +;; Christian Muise, and +;; Charles Gretton + +(define (problem cave-diving-adl-p01) + (:domain cave-diving-adl) + (:objects + l0 l1 l2 l3 l4 l5 - location + d0 d1 d2 d3 - diver + t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 dummy - tank + zero one two three four - quantity + ) + + (:init + (available d0) + (available d1) + (available d2) + (available d3) + (capacity d0 four) + (capacity d1 four) + (capacity d2 four) + (capacity d3 four) + (in-storage t0) + (next-tank t0 t1) + (next-tank t1 t2) + (next-tank t2 t3) + (next-tank t3 t4) + (next-tank t4 t5) + (next-tank t5 t6) + (next-tank t6 t7) + (next-tank t7 t8) + (next-tank t8 t9) + (next-tank t9 t10) + (next-tank t10 t11) + (next-tank t11 t12) + (next-tank t12 t13) + (next-tank t13 t14) + (next-tank t14 dummy) + (cave-entrance l0) + (connected l0 l1) + (connected l1 l0) + (connected l1 l2) + (connected l2 l1) + (connected l2 l3) + (connected l3 l2) + (connected l1 l4) + (connected l4 l1) + (connected l1 l5) + (connected l5 l1) + (next-quantity zero one) + (next-quantity one two) + (next-quantity two three) + (next-quantity three four) + (precludes d1 d3) + (precludes d2 d3) + (= (hiring-cost d0) 60) + (= (hiring-cost d1) 10) + (= (hiring-cost d2) 10) + (= (hiring-cost d3) 58) + (= (other-cost ) 1) + (= (total-cost) 0) + ) + + (:goal + (and + (have-photo l4) + (have-photo l5) + (decompressing d0) + (decompressing d1) + (decompressing d2) + (decompressing d3) + ) + ) + + (:metric minimize (total-cost)) + +) diff --git a/tests/fixtures/pddl_files/cave-diving-sequential-optimal/p02.pddl b/tests/fixtures/pddl_files/cave-diving-sequential-optimal/p02.pddl new file mode 100644 index 00000000..3cee90bd --- /dev/null +++ b/tests/fixtures/pddl_files/cave-diving-sequential-optimal/p02.pddl @@ -0,0 +1,74 @@ +;; Cave Diving ADL +;; Authors: Nathan Robinson, +;; Christian Muise, and +;; Charles Gretton + +(define (problem cave-diving-adl-p01) + (:domain cave-diving-adl) + (:objects + l0 l1 l2 l3 - location + d0 d1 d2 d3 - diver + t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 dummy - tank + zero one two three four - quantity + ) + + (:init + (available d0) + (available d1) + (available d2) + (available d3) + (capacity d0 four) + (capacity d1 four) + (capacity d2 four) + (capacity d3 four) + (in-storage t0) + (next-tank t0 t1) + (next-tank t1 t2) + (next-tank t2 t3) + (next-tank t3 t4) + (next-tank t4 t5) + (next-tank t5 t6) + (next-tank t6 t7) + (next-tank t7 t8) + (next-tank t8 t9) + (next-tank t9 t10) + (next-tank t10 t11) + (next-tank t11 t12) + (next-tank t12 t13) + (next-tank t13 t14) + (next-tank t14 dummy) + (cave-entrance l0) + (connected l0 l1) + (connected l1 l0) + (connected l1 l2) + (connected l2 l1) + (connected l2 l3) + (connected l3 l2) + (next-quantity zero one) + (next-quantity one two) + (next-quantity two three) + (next-quantity three four) + (precludes d1 d0) + (precludes d2 d3) + (precludes d0 d3) + (= (hiring-cost d1) 10) + (= (hiring-cost d2) 10) + (= (hiring-cost d0) 10) + (= (hiring-cost d3) 51) + (= (other-cost ) 1) + (= (total-cost) 0) + ) + + (:goal + (and + (have-photo l3) + (decompressing d1) + (decompressing d2) + (decompressing d0) + (decompressing d3) + ) + ) + + (:metric minimize (total-cost)) + +) diff --git a/tests/fixtures/pddl_files/cave-diving-sequential-optimal/p03.pddl b/tests/fixtures/pddl_files/cave-diving-sequential-optimal/p03.pddl new file mode 100644 index 00000000..c05e8015 --- /dev/null +++ b/tests/fixtures/pddl_files/cave-diving-sequential-optimal/p03.pddl @@ -0,0 +1,74 @@ +;; Cave Diving ADL +;; Authors: Nathan Robinson, +;; Christian Muise, and +;; Charles Gretton + +(define (problem cave-diving-adl-p02) + (:domain cave-diving-adl) + (:objects + l0 l1 l2 l3 - location + d0 d1 d2 d3 - diver + t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 dummy - tank + zero one two three four - quantity + ) + + (:init + (available d0) + (available d1) + (available d2) + (available d3) + (capacity d0 four) + (capacity d1 four) + (capacity d2 four) + (capacity d3 four) + (in-storage t0) + (next-tank t0 t1) + (next-tank t1 t2) + (next-tank t2 t3) + (next-tank t3 t4) + (next-tank t4 t5) + (next-tank t5 t6) + (next-tank t6 t7) + (next-tank t7 t8) + (next-tank t8 t9) + (next-tank t9 t10) + (next-tank t10 t11) + (next-tank t11 t12) + (next-tank t12 t13) + (next-tank t13 t14) + (next-tank t14 dummy) + (cave-entrance l0) + (connected l0 l1) + (connected l1 l0) + (connected l1 l2) + (connected l2 l1) + (connected l2 l3) + (connected l3 l2) + (next-quantity zero one) + (next-quantity one two) + (next-quantity two three) + (next-quantity three four) + (precludes d3 d1) + (precludes d1 d2) + (precludes d2 d0) + (= (hiring-cost d3) 10) + (= (hiring-cost d1) 10) + (= (hiring-cost d2) 10) + (= (hiring-cost d0) 55) + (= (other-cost ) 1) + (= (total-cost) 0) + ) + + (:goal + (and + (have-photo l3) + (decompressing d3) + (decompressing d1) + (decompressing d2) + (decompressing d0) + ) + ) + + (:metric minimize (total-cost)) + +) diff --git a/tests/fixtures/pddl_files/cave-diving-sequential-optimal/p04.pddl b/tests/fixtures/pddl_files/cave-diving-sequential-optimal/p04.pddl new file mode 100644 index 00000000..246d9011 --- /dev/null +++ b/tests/fixtures/pddl_files/cave-diving-sequential-optimal/p04.pddl @@ -0,0 +1,72 @@ +;; Cave Diving ADL +;; Authors: Nathan Robinson, +;; Christian Muise, and +;; Charles Gretton + +(define (problem cave-diving-adl-p03) + (:domain cave-diving-adl) + (:objects + l0 l1 l2 l3 - location + d0 d1 d2 d3 - diver + t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 dummy - tank + zero one two three four - quantity + ) + + (:init + (available d0) + (available d1) + (available d2) + (available d3) + (capacity d0 four) + (capacity d1 four) + (capacity d2 four) + (capacity d3 four) + (in-storage t0) + (next-tank t0 t1) + (next-tank t1 t2) + (next-tank t2 t3) + (next-tank t3 t4) + (next-tank t4 t5) + (next-tank t5 t6) + (next-tank t6 t7) + (next-tank t7 t8) + (next-tank t8 t9) + (next-tank t9 t10) + (next-tank t10 t11) + (next-tank t11 t12) + (next-tank t12 t13) + (next-tank t13 t14) + (next-tank t14 dummy) + (cave-entrance l0) + (connected l0 l1) + (connected l1 l0) + (connected l1 l2) + (connected l2 l1) + (connected l2 l3) + (connected l3 l2) + (next-quantity zero one) + (next-quantity one two) + (next-quantity two three) + (next-quantity three four) + (precludes d3 d0) + (= (hiring-cost d3) 10) + (= (hiring-cost d1) 50) + (= (hiring-cost d0) 54) + (= (hiring-cost d2) 50) + (= (other-cost ) 1) + (= (total-cost) 0) + ) + + (:goal + (and + (have-photo l3) + (decompressing d3) + (decompressing d1) + (decompressing d0) + (decompressing d2) + ) + ) + + (:metric minimize (total-cost)) + +) diff --git a/tests/fixtures/pddl_files/cave-diving-sequential-optimal/p05.pddl b/tests/fixtures/pddl_files/cave-diving-sequential-optimal/p05.pddl new file mode 100644 index 00000000..44bbf087 --- /dev/null +++ b/tests/fixtures/pddl_files/cave-diving-sequential-optimal/p05.pddl @@ -0,0 +1,75 @@ +;; Cave Diving ADL +;; Authors: Nathan Robinson, +;; Christian Muise, and +;; Charles Gretton + +(define (problem cave-diving-adl-p04) + (:domain cave-diving-adl) + (:objects + l0 l1 l2 l3 - location + d0 d1 d2 d3 - diver + t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 dummy - tank + zero one two three four - quantity + ) + + (:init + (available d0) + (available d1) + (available d2) + (available d3) + (capacity d0 four) + (capacity d1 four) + (capacity d2 four) + (capacity d3 four) + (in-storage t0) + (next-tank t0 t1) + (next-tank t1 t2) + (next-tank t2 t3) + (next-tank t3 t4) + (next-tank t4 t5) + (next-tank t5 t6) + (next-tank t6 t7) + (next-tank t7 t8) + (next-tank t8 t9) + (next-tank t9 t10) + (next-tank t10 t11) + (next-tank t11 t12) + (next-tank t12 t13) + (next-tank t13 t14) + (next-tank t14 dummy) + (cave-entrance l0) + (connected l0 l1) + (connected l1 l0) + (connected l1 l2) + (connected l2 l1) + (connected l2 l3) + (connected l3 l2) + (next-quantity zero one) + (next-quantity one two) + (next-quantity two three) + (next-quantity three four) + (precludes d0 d1) + (precludes d0 d3) + (precludes d1 d2) + (precludes d1 d3) + (= (hiring-cost d0) 10) + (= (hiring-cost d1) 10) + (= (hiring-cost d2) 54) + (= (hiring-cost d3) 56) + (= (other-cost ) 1) + (= (total-cost) 0) + ) + + (:goal + (and + (have-photo l3) + (decompressing d0) + (decompressing d1) + (decompressing d2) + (decompressing d3) + ) + ) + + (:metric minimize (total-cost)) + +) diff --git a/tests/fixtures/pddl_files/cave-diving-sequential-optimal/p06.pddl b/tests/fixtures/pddl_files/cave-diving-sequential-optimal/p06.pddl new file mode 100644 index 00000000..b6a3e378 --- /dev/null +++ b/tests/fixtures/pddl_files/cave-diving-sequential-optimal/p06.pddl @@ -0,0 +1,54 @@ +;; Cave Diving ADL +;; Authors: Nathan Robinson, +;; Christian Muise, and +;; Charles Gretton + +(define (problem cave-diving-adl-p01) + (:domain cave-diving-adl) + (:objects + l0 l1 l2 - location + d0 d1 - diver + t0 t1 t2 t3 t4 t5 t6 dummy - tank + zero one two three four - quantity + ) + + (:init + (available d0) + (available d1) + (capacity d0 four) + (capacity d1 four) + (in-storage t0) + (next-tank t0 t1) + (next-tank t1 t2) + (next-tank t2 t3) + (next-tank t3 t4) + (next-tank t4 t5) + (next-tank t5 t6) + (next-tank t6 dummy) + (cave-entrance l0) + (connected l0 l1) + (connected l1 l0) + (connected l1 l2) + (connected l2 l1) + (next-quantity zero one) + (next-quantity one two) + (next-quantity two three) + (next-quantity three four) + (precludes d0 d1) + (= (hiring-cost d0) 10) + (= (hiring-cost d1) 63) + (= (other-cost ) 1) + (= (total-cost) 0) + ) + + (:goal + (and + (have-photo l2) + (decompressing d0) + (decompressing d1) + ) + ) + + (:metric minimize (total-cost)) + +) diff --git a/tests/fixtures/pddl_files/cave-diving-sequential-optimal/p07.pddl b/tests/fixtures/pddl_files/cave-diving-sequential-optimal/p07.pddl new file mode 100644 index 00000000..6928d71b --- /dev/null +++ b/tests/fixtures/pddl_files/cave-diving-sequential-optimal/p07.pddl @@ -0,0 +1,54 @@ +;; Cave Diving ADL +;; Authors: Nathan Robinson, +;; Christian Muise, and +;; Charles Gretton + +(define (problem cave-diving-adl-p02) + (:domain cave-diving-adl) + (:objects + l0 l1 l2 - location + d0 d1 - diver + t0 t1 t2 t3 t4 t5 t6 dummy - tank + zero one two three four - quantity + ) + + (:init + (available d0) + (available d1) + (capacity d0 four) + (capacity d1 four) + (in-storage t0) + (next-tank t0 t1) + (next-tank t1 t2) + (next-tank t2 t3) + (next-tank t3 t4) + (next-tank t4 t5) + (next-tank t5 t6) + (next-tank t6 dummy) + (cave-entrance l0) + (connected l0 l1) + (connected l1 l0) + (connected l1 l2) + (connected l2 l1) + (next-quantity zero one) + (next-quantity one two) + (next-quantity two three) + (next-quantity three four) + (precludes d0 d1) + (= (hiring-cost d0) 11) + (= (hiring-cost d1) 63) + (= (other-cost ) 1) + (= (total-cost) 0) + ) + + (:goal + (and + (have-photo l2) + (decompressing d0) + (decompressing d1) + ) + ) + + (:metric minimize (total-cost)) + +) diff --git a/tests/fixtures/pddl_files/cave-diving-sequential-optimal/p08.pddl b/tests/fixtures/pddl_files/cave-diving-sequential-optimal/p08.pddl new file mode 100644 index 00000000..92e719f4 --- /dev/null +++ b/tests/fixtures/pddl_files/cave-diving-sequential-optimal/p08.pddl @@ -0,0 +1,53 @@ +;; Cave Diving ADL +;; Authors: Nathan Robinson, +;; Christian Muise, and +;; Charles Gretton + +(define (problem cave-diving-adl-p03) + (:domain cave-diving-adl) + (:objects + l0 l1 l2 - location + d0 d1 - diver + t0 t1 t2 t3 t4 t5 t6 dummy - tank + zero one two three four - quantity + ) + + (:init + (available d0) + (available d1) + (capacity d0 four) + (capacity d1 four) + (in-storage t0) + (next-tank t0 t1) + (next-tank t1 t2) + (next-tank t2 t3) + (next-tank t3 t4) + (next-tank t4 t5) + (next-tank t5 t6) + (next-tank t6 dummy) + (cave-entrance l0) + (connected l0 l1) + (connected l1 l0) + (connected l1 l2) + (connected l2 l1) + (next-quantity zero one) + (next-quantity one two) + (next-quantity two three) + (next-quantity three four) + (= (hiring-cost d1) 55) + (= (hiring-cost d0) 55) + (= (other-cost ) 1) + (= (total-cost) 0) + ) + + (:goal + (and + (have-photo l2) + (decompressing d1) + (decompressing d0) + ) + ) + + (:metric minimize (total-cost)) + +) diff --git a/tests/fixtures/pddl_files/cave-diving-sequential-optimal/p09.pddl b/tests/fixtures/pddl_files/cave-diving-sequential-optimal/p09.pddl new file mode 100644 index 00000000..069337fb --- /dev/null +++ b/tests/fixtures/pddl_files/cave-diving-sequential-optimal/p09.pddl @@ -0,0 +1,54 @@ +;; Cave Diving ADL +;; Authors: Nathan Robinson, +;; Christian Muise, and +;; Charles Gretton + +(define (problem cave-diving-adl-p04) + (:domain cave-diving-adl) + (:objects + l0 l1 l2 - location + d0 d1 - diver + t0 t1 t2 t3 t4 t5 t6 dummy - tank + zero one two three four - quantity + ) + + (:init + (available d0) + (available d1) + (capacity d0 four) + (capacity d1 four) + (in-storage t0) + (next-tank t0 t1) + (next-tank t1 t2) + (next-tank t2 t3) + (next-tank t3 t4) + (next-tank t4 t5) + (next-tank t5 t6) + (next-tank t6 dummy) + (cave-entrance l0) + (connected l0 l1) + (connected l1 l0) + (connected l1 l2) + (connected l2 l1) + (next-quantity zero one) + (next-quantity one two) + (next-quantity two three) + (next-quantity three four) + (precludes d0 d1) + (= (hiring-cost d0) 10) + (= (hiring-cost d1) 59) + (= (other-cost ) 1) + (= (total-cost) 0) + ) + + (:goal + (and + (have-photo l2) + (decompressing d0) + (decompressing d1) + ) + ) + + (:metric minimize (total-cost)) + +) diff --git a/tests/fixtures/pddl_files/cave-diving-sequential-optimal/p10.pddl b/tests/fixtures/pddl_files/cave-diving-sequential-optimal/p10.pddl new file mode 100644 index 00000000..d9fee38a --- /dev/null +++ b/tests/fixtures/pddl_files/cave-diving-sequential-optimal/p10.pddl @@ -0,0 +1,120 @@ +;; Cave Diving ADL +;; Authors: Nathan Robinson, +;; Christian Muise, and +;; Charles Gretton + +(define (problem cave-diving-adl-p01) + (:domain cave-diving-adl) + (:objects + l0 l1 l2 l3 l4 - location + d0 d1 d2 d3 d4 d5 d6 d7 - diver + t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 - tank + t20 t21 t22 t23 t24 t25 t26 t27 t28 t29 t30 dummy - tank + zero one two three four - quantity + ) + + (:init + (available d0) + (available d1) + (available d2) + (available d3) + (available d4) + (available d5) + (available d6) + (available d7) + (capacity d0 four) + (capacity d1 four) + (capacity d2 four) + (capacity d3 four) + (capacity d4 four) + (capacity d5 four) + (capacity d6 four) + (capacity d7 four) + (in-storage t0) + (next-tank t0 t1) + (next-tank t1 t2) + (next-tank t2 t3) + (next-tank t3 t4) + (next-tank t4 t5) + (next-tank t5 t6) + (next-tank t6 t7) + (next-tank t7 t8) + (next-tank t8 t9) + (next-tank t9 t10) + (next-tank t10 t11) + (next-tank t11 t12) + (next-tank t12 t13) + (next-tank t13 t14) + (next-tank t14 t15) + (next-tank t15 t16) + (next-tank t16 t17) + (next-tank t17 t18) + (next-tank t18 t19) + (next-tank t19 t20) + (next-tank t20 t21) + (next-tank t21 t22) + (next-tank t22 t23) + (next-tank t23 t24) + (next-tank t24 t25) + (next-tank t25 t26) + (next-tank t26 t27) + (next-tank t27 t28) + (next-tank t28 t29) + (next-tank t29 t30) + (next-tank t30 dummy) + (cave-entrance l0) + (connected l0 l1) + (connected l1 l0) + (connected l1 l2) + (connected l2 l1) + (connected l2 l3) + (connected l3 l2) + (connected l3 l4) + (connected l4 l3) + (next-quantity zero one) + (next-quantity one two) + (next-quantity two three) + (next-quantity three four) + (precludes d3 d0) + (precludes d3 d2) + (precludes d3 d4) + (precludes d3 d5) + (precludes d3 d7) + (precludes d3 d6) + (precludes d0 d5) + (precludes d0 d7) + (precludes d2 d5) + (precludes d2 d6) + (precludes d4 d6) + (precludes d1 d7) + (precludes d1 d6) + (precludes d5 d6) + (= (hiring-cost d3) 10) + (= (hiring-cost d0) 31) + (= (hiring-cost d2) 33) + (= (hiring-cost d4) 55) + (= (hiring-cost d1) 34) + (= (hiring-cost d5) 51) + (= (hiring-cost d7) 73) + (= (hiring-cost d6) 77) + (= (other-cost ) 1) + (= (total-cost) 0) + ) + + (:goal + (and + (have-photo l4) + (decompressing d3) + (decompressing d0) + (decompressing d2) + (decompressing d4) + (decompressing d1) + (decompressing d5) + (decompressing d7) + (decompressing d6) + ) + ) + + (:metric minimize (total-cost)) + +) diff --git a/tests/fixtures/pddl_files/cave-diving-sequential-optimal/p11.pddl b/tests/fixtures/pddl_files/cave-diving-sequential-optimal/p11.pddl new file mode 100644 index 00000000..30bd8295 --- /dev/null +++ b/tests/fixtures/pddl_files/cave-diving-sequential-optimal/p11.pddl @@ -0,0 +1,121 @@ +;; Cave Diving ADL +;; Authors: Nathan Robinson, +;; Christian Muise, and +;; Charles Gretton + +(define (problem cave-diving-adl-p02) + (:domain cave-diving-adl) + (:objects + l0 l1 l2 l3 l4 - location + d0 d1 d2 d3 d4 d5 d6 d7 - diver + t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 - tank + t20 t21 t22 t23 t24 t25 t26 t27 t28 t29 t30 dummy - tank + zero one two three four - quantity + ) + + (:init + (available d0) + (available d1) + (available d2) + (available d3) + (available d4) + (available d5) + (available d6) + (available d7) + (capacity d0 four) + (capacity d1 four) + (capacity d2 four) + (capacity d3 four) + (capacity d4 four) + (capacity d5 four) + (capacity d6 four) + (capacity d7 four) + (in-storage t0) + (next-tank t0 t1) + (next-tank t1 t2) + (next-tank t2 t3) + (next-tank t3 t4) + (next-tank t4 t5) + (next-tank t5 t6) + (next-tank t6 t7) + (next-tank t7 t8) + (next-tank t8 t9) + (next-tank t9 t10) + (next-tank t10 t11) + (next-tank t11 t12) + (next-tank t12 t13) + (next-tank t13 t14) + (next-tank t14 t15) + (next-tank t15 t16) + (next-tank t16 t17) + (next-tank t17 t18) + (next-tank t18 t19) + (next-tank t19 t20) + (next-tank t20 t21) + (next-tank t21 t22) + (next-tank t22 t23) + (next-tank t23 t24) + (next-tank t24 t25) + (next-tank t25 t26) + (next-tank t26 t27) + (next-tank t27 t28) + (next-tank t28 t29) + (next-tank t29 t30) + (next-tank t30 dummy) + (cave-entrance l0) + (connected l0 l1) + (connected l1 l0) + (connected l1 l2) + (connected l2 l1) + (connected l2 l3) + (connected l3 l2) + (connected l3 l4) + (connected l4 l3) + (next-quantity zero one) + (next-quantity one two) + (next-quantity two three) + (next-quantity three four) + (precludes d4 d0) + (precludes d4 d7) + (precludes d4 d2) + (precludes d4 d6) + (precludes d0 d5) + (precludes d0 d7) + (precludes d0 d6) + (precludes d0 d1) + (precludes d5 d3) + (precludes d5 d1) + (precludes d3 d7) + (precludes d3 d2) + (precludes d7 d2) + (precludes d7 d1) + (precludes d2 d6) + (= (hiring-cost d4) 10) + (= (hiring-cost d0) 10) + (= (hiring-cost d5) 17) + (= (hiring-cost d3) 45) + (= (hiring-cost d7) 33) + (= (hiring-cost d2) 50) + (= (hiring-cost d6) 41) + (= (hiring-cost d1) 46) + (= (other-cost ) 1) + (= (total-cost) 0) + ) + + (:goal + (and + (have-photo l4) + (decompressing d4) + (decompressing d0) + (decompressing d5) + (decompressing d3) + (decompressing d7) + (decompressing d2) + (decompressing d6) + (decompressing d1) + ) + ) + + (:metric minimize (total-cost)) + +) diff --git a/tests/fixtures/pddl_files/cave-diving-sequential-optimal/p12.pddl b/tests/fixtures/pddl_files/cave-diving-sequential-optimal/p12.pddl new file mode 100644 index 00000000..c864fb5c --- /dev/null +++ b/tests/fixtures/pddl_files/cave-diving-sequential-optimal/p12.pddl @@ -0,0 +1,124 @@ +;; Cave Diving ADL +;; Authors: Nathan Robinson, +;; Christian Muise, and +;; Charles Gretton + +(define (problem cave-diving-adl-p03) + (:domain cave-diving-adl) + (:objects + l0 l1 l2 l3 l4 - location + d0 d1 d2 d3 d4 d5 d6 d7 - diver + t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 - tank + t20 t21 t22 t23 t24 t25 t26 t27 t28 t29 t30 dummy - tank + zero one two three four - quantity + ) + + (:init + (available d0) + (available d1) + (available d2) + (available d3) + (available d4) + (available d5) + (available d6) + (available d7) + (capacity d0 four) + (capacity d1 four) + (capacity d2 four) + (capacity d3 four) + (capacity d4 four) + (capacity d5 four) + (capacity d6 four) + (capacity d7 four) + (in-storage t0) + (next-tank t0 t1) + (next-tank t1 t2) + (next-tank t2 t3) + (next-tank t3 t4) + (next-tank t4 t5) + (next-tank t5 t6) + (next-tank t6 t7) + (next-tank t7 t8) + (next-tank t8 t9) + (next-tank t9 t10) + (next-tank t10 t11) + (next-tank t11 t12) + (next-tank t12 t13) + (next-tank t13 t14) + (next-tank t14 t15) + (next-tank t15 t16) + (next-tank t16 t17) + (next-tank t17 t18) + (next-tank t18 t19) + (next-tank t19 t20) + (next-tank t20 t21) + (next-tank t21 t22) + (next-tank t22 t23) + (next-tank t23 t24) + (next-tank t24 t25) + (next-tank t25 t26) + (next-tank t26 t27) + (next-tank t27 t28) + (next-tank t28 t29) + (next-tank t29 t30) + (next-tank t30 dummy) + (cave-entrance l0) + (connected l0 l1) + (connected l1 l0) + (connected l1 l2) + (connected l2 l1) + (connected l2 l3) + (connected l3 l2) + (connected l3 l4) + (connected l4 l3) + (next-quantity zero one) + (next-quantity one two) + (next-quantity two three) + (next-quantity three four) + (precludes d2 d3) + (precludes d2 d1) + (precludes d2 d4) + (precludes d2 d0) + (precludes d2 d6) + (precludes d5 d0) + (precludes d5 d6) + (precludes d5 d7) + (precludes d3 d1) + (precludes d3 d0) + (precludes d3 d6) + (precludes d3 d7) + (precludes d1 d0) + (precludes d1 d6) + (precludes d1 d7) + (precludes d4 d6) + (precludes d0 d6) + (precludes d0 d7) + (= (hiring-cost d2) 10) + (= (hiring-cost d5) 33) + (= (hiring-cost d3) 24) + (= (hiring-cost d1) 49) + (= (hiring-cost d4) 76) + (= (hiring-cost d0) 42) + (= (hiring-cost d6) 100) + (= (hiring-cost d7) 79) + (= (other-cost ) 1) + (= (total-cost) 0) + ) + + (:goal + (and + (have-photo l4) + (decompressing d2) + (decompressing d5) + (decompressing d3) + (decompressing d1) + (decompressing d4) + (decompressing d0) + (decompressing d6) + (decompressing d7) + ) + ) + + (:metric minimize (total-cost)) + +) diff --git a/tests/fixtures/pddl_files/cave-diving-sequential-optimal/p13.pddl b/tests/fixtures/pddl_files/cave-diving-sequential-optimal/p13.pddl new file mode 100644 index 00000000..68784b9a --- /dev/null +++ b/tests/fixtures/pddl_files/cave-diving-sequential-optimal/p13.pddl @@ -0,0 +1,122 @@ +;; Cave Diving ADL +;; Authors: Nathan Robinson, +;; Christian Muise, and +;; Charles Gretton + +(define (problem cave-diving-adl-p04) + (:domain cave-diving-adl) + (:objects + l0 l1 l2 l3 l4 - location + d0 d1 d2 d3 d4 d5 d6 d7 - diver + t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 - tank + t20 t21 t22 t23 t24 t25 t26 t27 t28 t29 t30 dummy - tank + zero one two three four - quantity + ) + + (:init + (available d0) + (available d1) + (available d2) + (available d3) + (available d4) + (available d5) + (available d6) + (available d7) + (capacity d0 four) + (capacity d1 four) + (capacity d2 four) + (capacity d3 four) + (capacity d4 four) + (capacity d5 four) + (capacity d6 four) + (capacity d7 four) + (in-storage t0) + (next-tank t0 t1) + (next-tank t1 t2) + (next-tank t2 t3) + (next-tank t3 t4) + (next-tank t4 t5) + (next-tank t5 t6) + (next-tank t6 t7) + (next-tank t7 t8) + (next-tank t8 t9) + (next-tank t9 t10) + (next-tank t10 t11) + (next-tank t11 t12) + (next-tank t12 t13) + (next-tank t13 t14) + (next-tank t14 t15) + (next-tank t15 t16) + (next-tank t16 t17) + (next-tank t17 t18) + (next-tank t18 t19) + (next-tank t19 t20) + (next-tank t20 t21) + (next-tank t21 t22) + (next-tank t22 t23) + (next-tank t23 t24) + (next-tank t24 t25) + (next-tank t25 t26) + (next-tank t26 t27) + (next-tank t27 t28) + (next-tank t28 t29) + (next-tank t29 t30) + (next-tank t30 dummy) + (cave-entrance l0) + (connected l0 l1) + (connected l1 l0) + (connected l1 l2) + (connected l2 l1) + (connected l2 l3) + (connected l3 l2) + (connected l3 l4) + (connected l4 l3) + (next-quantity zero one) + (next-quantity one two) + (next-quantity two three) + (next-quantity three four) + (precludes d2 d3) + (precludes d2 d5) + (precludes d2 d4) + (precludes d2 d0) + (precludes d3 d5) + (precludes d3 d1) + (precludes d3 d7) + (precludes d3 d4) + (precludes d3 d0) + (precludes d5 d0) + (precludes d6 d1) + (precludes d6 d4) + (precludes d6 d0) + (precludes d1 d4) + (precludes d1 d0) + (precludes d7 d4) + (= (hiring-cost d2) 27) + (= (hiring-cost d3) 13) + (= (hiring-cost d5) 58) + (= (hiring-cost d6) 45) + (= (hiring-cost d1) 54) + (= (hiring-cost d7) 82) + (= (hiring-cost d4) 56) + (= (hiring-cost d0) 66) + (= (other-cost ) 1) + (= (total-cost) 0) + ) + + (:goal + (and + (have-photo l4) + (decompressing d2) + (decompressing d3) + (decompressing d5) + (decompressing d6) + (decompressing d1) + (decompressing d7) + (decompressing d4) + (decompressing d0) + ) + ) + + (:metric minimize (total-cost)) + +) diff --git a/tests/fixtures/pddl_files/cave-diving-sequential-optimal/p14.pddl b/tests/fixtures/pddl_files/cave-diving-sequential-optimal/p14.pddl new file mode 100644 index 00000000..47c56fb0 --- /dev/null +++ b/tests/fixtures/pddl_files/cave-diving-sequential-optimal/p14.pddl @@ -0,0 +1,79 @@ +;; Cave Diving ADL +;; Authors: Nathan Robinson, +;; Christian Muise, and +;; Charles Gretton + +(define (problem cave-diving-adl-p01) + (:domain cave-diving-adl) + (:objects + l0 l1 l2 l3 l4 l5 - location + d0 d1 d2 d3 - diver + t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 dummy - tank + zero one two three four - quantity + ) + + (:init + (available d0) + (available d1) + (available d2) + (available d3) + (capacity d0 four) + (capacity d1 four) + (capacity d2 four) + (capacity d3 four) + (in-storage t0) + (next-tank t0 t1) + (next-tank t1 t2) + (next-tank t2 t3) + (next-tank t3 t4) + (next-tank t4 t5) + (next-tank t5 t6) + (next-tank t6 t7) + (next-tank t7 t8) + (next-tank t8 t9) + (next-tank t9 t10) + (next-tank t10 t11) + (next-tank t11 t12) + (next-tank t12 t13) + (next-tank t13 t14) + (next-tank t14 dummy) + (cave-entrance l0) + (connected l0 l1) + (connected l1 l0) + (connected l1 l2) + (connected l2 l1) + (connected l2 l3) + (connected l3 l2) + (connected l0 l4) + (connected l4 l0) + (connected l4 l5) + (connected l5 l4) + (next-quantity zero one) + (next-quantity one two) + (next-quantity two three) + (next-quantity three four) + (precludes d0 d3) + (precludes d0 d2) + (precludes d3 d2) + (precludes d2 d1) + (= (hiring-cost d0) 10) + (= (hiring-cost d3) 46) + (= (hiring-cost d2) 41) + (= (hiring-cost d1) 73) + (= (other-cost ) 1) + (= (total-cost) 0) + ) + + (:goal + (and + (have-photo l3) + (decompressing d0) + (decompressing d3) + (decompressing d2) + (decompressing d1) + ) + ) + + (:metric minimize (total-cost)) + +) diff --git a/tests/fixtures/pddl_files/cave-diving-sequential-optimal/p15.pddl b/tests/fixtures/pddl_files/cave-diving-sequential-optimal/p15.pddl new file mode 100644 index 00000000..c0dec773 --- /dev/null +++ b/tests/fixtures/pddl_files/cave-diving-sequential-optimal/p15.pddl @@ -0,0 +1,79 @@ +;; Cave Diving ADL +;; Authors: Nathan Robinson, +;; Christian Muise, and +;; Charles Gretton + +(define (problem cave-diving-adl-p01) + (:domain cave-diving-adl) + (:objects + l0 l1 l2 l3 l4 l5 - location + d0 d1 d2 d3 - diver + t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 dummy - tank + zero one two three four - quantity + ) + + (:init + (available d0) + (available d1) + (available d2) + (available d3) + (capacity d0 four) + (capacity d1 four) + (capacity d2 four) + (capacity d3 four) + (in-storage t0) + (next-tank t0 t1) + (next-tank t1 t2) + (next-tank t2 t3) + (next-tank t3 t4) + (next-tank t4 t5) + (next-tank t5 t6) + (next-tank t6 t7) + (next-tank t7 t8) + (next-tank t8 t9) + (next-tank t9 t10) + (next-tank t10 t11) + (next-tank t11 t12) + (next-tank t12 t13) + (next-tank t13 t14) + (next-tank t14 dummy) + (cave-entrance l0) + (connected l0 l1) + (connected l1 l0) + (connected l1 l2) + (connected l2 l1) + (connected l2 l3) + (connected l3 l2) + (connected l0 l4) + (connected l4 l0) + (connected l4 l5) + (connected l5 l4) + (next-quantity zero one) + (next-quantity one two) + (next-quantity two three) + (next-quantity three four) + (precludes d2 d3) + (precludes d2 d0) + (precludes d2 d1) + (precludes d0 d1) + (= (hiring-cost d2) 10) + (= (hiring-cost d3) 100) + (= (hiring-cost d0) 35) + (= (hiring-cost d1) 53) + (= (other-cost ) 1) + (= (total-cost) 0) + ) + + (:goal + (and + (have-photo l3) + (decompressing d2) + (decompressing d3) + (decompressing d0) + (decompressing d1) + ) + ) + + (:metric minimize (total-cost)) + +) diff --git a/tests/fixtures/pddl_files/cave-diving-sequential-optimal/p16.pddl b/tests/fixtures/pddl_files/cave-diving-sequential-optimal/p16.pddl new file mode 100644 index 00000000..fdfb5121 --- /dev/null +++ b/tests/fixtures/pddl_files/cave-diving-sequential-optimal/p16.pddl @@ -0,0 +1,75 @@ +;; Cave Diving ADL +;; Authors: Nathan Robinson, +;; Christian Muise, and +;; Charles Gretton + +(define (problem cave-diving-adl-p01) + (:domain cave-diving-adl) + (:objects + l0 l1 l2 l3 l4 - location + d0 d1 d2 d3 - diver + t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 dummy - tank + zero one two three four - quantity + ) + + (:init + (available d0) + (available d1) + (available d2) + (available d3) + (capacity d0 four) + (capacity d1 four) + (capacity d2 four) + (capacity d3 four) + (in-storage t0) + (next-tank t0 t1) + (next-tank t1 t2) + (next-tank t2 t3) + (next-tank t3 t4) + (next-tank t4 t5) + (next-tank t5 t6) + (next-tank t6 t7) + (next-tank t7 t8) + (next-tank t8 t9) + (next-tank t9 t10) + (next-tank t10 t11) + (next-tank t11 t12) + (next-tank t12 t13) + (next-tank t13 t14) + (next-tank t14 dummy) + (cave-entrance l0) + (connected l0 l1) + (connected l1 l0) + (connected l1 l2) + (connected l2 l1) + (connected l2 l3) + (connected l3 l2) + (connected l1 l4) + (connected l4 l1) + (next-quantity zero one) + (next-quantity one two) + (next-quantity two three) + (next-quantity three four) + (precludes d1 d0) + (precludes d3 d0) + (= (hiring-cost d1) 13) + (= (hiring-cost d3) 10) + (= (hiring-cost d2) 31) + (= (hiring-cost d0) 70) + (= (other-cost ) 1) + (= (total-cost) 0) + ) + + (:goal + (and + (have-photo l3) + (decompressing d1) + (decompressing d3) + (decompressing d2) + (decompressing d0) + ) + ) + + (:metric minimize (total-cost)) + +) diff --git a/tests/fixtures/pddl_files/cave-diving-sequential-optimal/p17.pddl b/tests/fixtures/pddl_files/cave-diving-sequential-optimal/p17.pddl new file mode 100644 index 00000000..b9478bcd --- /dev/null +++ b/tests/fixtures/pddl_files/cave-diving-sequential-optimal/p17.pddl @@ -0,0 +1,77 @@ +;; Cave Diving ADL +;; Authors: Nathan Robinson, +;; Christian Muise, and +;; Charles Gretton + +(define (problem cave-diving-adl-p01) + (:domain cave-diving-adl) + (:objects + l0 l1 l2 l3 l4 l5 - location + d0 d1 d2 d3 - diver + t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 dummy - tank + zero one two three four - quantity + ) + + (:init + (available d0) + (available d1) + (available d2) + (available d3) + (capacity d0 four) + (capacity d1 four) + (capacity d2 four) + (capacity d3 four) + (in-storage t0) + (next-tank t0 t1) + (next-tank t1 t2) + (next-tank t2 t3) + (next-tank t3 t4) + (next-tank t4 t5) + (next-tank t5 t6) + (next-tank t6 t7) + (next-tank t7 t8) + (next-tank t8 t9) + (next-tank t9 t10) + (next-tank t10 t11) + (next-tank t11 t12) + (next-tank t12 t13) + (next-tank t13 t14) + (next-tank t14 dummy) + (cave-entrance l0) + (connected l0 l1) + (connected l1 l0) + (connected l1 l2) + (connected l2 l1) + (connected l2 l3) + (connected l3 l2) + (connected l0 l4) + (connected l4 l0) + (connected l4 l5) + (connected l5 l4) + (next-quantity zero one) + (next-quantity one two) + (next-quantity two three) + (next-quantity three four) + (precludes d2 d0) + (precludes d0 d1) + (= (hiring-cost d2) 10) + (= (hiring-cost d0) 10) + (= (hiring-cost d1) 71) + (= (hiring-cost d3) 37) + (= (other-cost ) 1) + (= (total-cost) 0) + ) + + (:goal + (and + (have-photo l3) + (decompressing d2) + (decompressing d0) + (decompressing d1) + (decompressing d3) + ) + ) + + (:metric minimize (total-cost)) + +) diff --git a/tests/fixtures/pddl_files/cave-diving-sequential-optimal/p18.pddl b/tests/fixtures/pddl_files/cave-diving-sequential-optimal/p18.pddl new file mode 100644 index 00000000..75ba39d3 --- /dev/null +++ b/tests/fixtures/pddl_files/cave-diving-sequential-optimal/p18.pddl @@ -0,0 +1,57 @@ +;; Cave Diving ADL +;; Authors: Nathan Robinson, +;; Christian Muise, and +;; Charles Gretton + +(define (problem cave-diving-adl-p01) + (:domain cave-diving-adl) + (:objects + l0 l1 l2 l3 l4 - location + d0 d1 - diver + t0 t1 t2 t3 t4 t5 t6 dummy - tank + zero one two three four - quantity + ) + + (:init + (available d0) + (available d1) + (capacity d0 four) + (capacity d1 four) + (in-storage t0) + (next-tank t0 t1) + (next-tank t1 t2) + (next-tank t2 t3) + (next-tank t3 t4) + (next-tank t4 t5) + (next-tank t5 t6) + (next-tank t6 dummy) + (cave-entrance l0) + (connected l0 l1) + (connected l1 l0) + (connected l1 l2) + (connected l2 l1) + (connected l2 l3) + (connected l3 l2) + (connected l1 l4) + (connected l4 l1) + (next-quantity zero one) + (next-quantity one two) + (next-quantity two three) + (next-quantity three four) + (= (hiring-cost d1) 55) + (= (hiring-cost d0) 55) + (= (other-cost ) 1) + (= (total-cost) 0) + ) + + (:goal + (and + (have-photo l4) + (decompressing d1) + (decompressing d0) + ) + ) + + (:metric minimize (total-cost)) + +) diff --git a/tests/fixtures/pddl_files/cave-diving-sequential-optimal/p19.pddl b/tests/fixtures/pddl_files/cave-diving-sequential-optimal/p19.pddl new file mode 100644 index 00000000..dd015915 --- /dev/null +++ b/tests/fixtures/pddl_files/cave-diving-sequential-optimal/p19.pddl @@ -0,0 +1,59 @@ +;; Cave Diving ADL +;; Authors: Nathan Robinson, +;; Christian Muise, and +;; Charles Gretton + +(define (problem cave-diving-adl-p01) + (:domain cave-diving-adl) + (:objects + l0 l1 l2 l3 l4 l5 - location + d0 d1 - diver + t0 t1 t2 t3 t4 t5 t6 dummy - tank + zero one two three four - quantity + ) + + (:init + (available d0) + (available d1) + (capacity d0 four) + (capacity d1 four) + (in-storage t0) + (next-tank t0 t1) + (next-tank t1 t2) + (next-tank t2 t3) + (next-tank t3 t4) + (next-tank t4 t5) + (next-tank t5 t6) + (next-tank t6 dummy) + (cave-entrance l0) + (connected l0 l1) + (connected l1 l0) + (connected l1 l2) + (connected l2 l1) + (connected l2 l3) + (connected l3 l2) + (connected l0 l4) + (connected l4 l0) + (connected l4 l5) + (connected l5 l4) + (next-quantity zero one) + (next-quantity one two) + (next-quantity two three) + (next-quantity three four) + (= (hiring-cost d1) 55) + (= (hiring-cost d0) 55) + (= (other-cost ) 1) + (= (total-cost) 0) + ) + + (:goal + (and + (have-photo l5) + (decompressing d1) + (decompressing d0) + ) + ) + + (:metric minimize (total-cost)) + +) diff --git a/tests/fixtures/pddl_files/cave-diving-sequential-optimal/p20.pddl b/tests/fixtures/pddl_files/cave-diving-sequential-optimal/p20.pddl new file mode 100644 index 00000000..d5d81f55 --- /dev/null +++ b/tests/fixtures/pddl_files/cave-diving-sequential-optimal/p20.pddl @@ -0,0 +1,58 @@ +;; Cave Diving ADL +;; Authors: Nathan Robinson, +;; Christian Muise, and +;; Charles Gretton + +(define (problem cave-diving-adl-p01) + (:domain cave-diving-adl) + (:objects + l0 l1 l2 l3 l4 - location + d0 d1 - diver + t0 t1 t2 t3 t4 t5 t6 dummy - tank + zero one two three four - quantity + ) + + (:init + (available d0) + (available d1) + (capacity d0 four) + (capacity d1 four) + (in-storage t0) + (next-tank t0 t1) + (next-tank t1 t2) + (next-tank t2 t3) + (next-tank t3 t4) + (next-tank t4 t5) + (next-tank t5 t6) + (next-tank t6 dummy) + (cave-entrance l0) + (connected l0 l1) + (connected l1 l0) + (connected l1 l2) + (connected l2 l1) + (connected l2 l3) + (connected l3 l2) + (connected l1 l4) + (connected l4 l1) + (next-quantity zero one) + (next-quantity one two) + (next-quantity two three) + (next-quantity three four) + (precludes d0 d1) + (= (hiring-cost d0) 10) + (= (hiring-cost d1) 67) + (= (other-cost ) 1) + (= (total-cost) 0) + ) + + (:goal + (and + (have-photo l4) + (decompressing d0) + (decompressing d1) + ) + ) + + (:metric minimize (total-cost)) + +) diff --git a/tests/fixtures/pddl_files/depots-numeric-automatic/domain.pddl b/tests/fixtures/pddl_files/depots-numeric-automatic/domain.pddl new file mode 100644 index 00000000..0fda3d95 --- /dev/null +++ b/tests/fixtures/pddl_files/depots-numeric-automatic/domain.pddl @@ -0,0 +1,54 @@ +(define (domain Depot) +(:requirements :typing :numeric-fluents) +(:types place locatable - object + depot distributor - place + truck hoist surface - locatable + pallet crate - surface) + +(:predicates (at ?x - locatable ?y - place) + (on ?x - crate ?y - surface) + (in ?x - crate ?y - truck) + (lifting ?x - hoist ?y - crate) + (available ?x - hoist) + (clear ?x - surface) +) + +(:functions + (load_limit ?t - truck) + (current_load ?t - truck) + (weight ?c - crate) + (fuel-cost) +) + +(:action Drive +:parameters (?x - truck ?y - place ?z - place) +:precondition (and (at ?x ?y)) +:effect (and (not (at ?x ?y)) (at ?x ?z) + (increase (fuel-cost) 10))) + +(:action Lift +:parameters (?x - hoist ?y - crate ?z - surface ?p - place) +:precondition (and (at ?x ?p) (available ?x) (at ?y ?p) (on ?y ?z) (clear ?y)) +:effect (and (not (at ?y ?p)) (lifting ?x ?y) (not (clear ?y)) (not (available ?x)) + (clear ?z) (not (on ?y ?z)) (increase (fuel-cost) 1))) + +(:action Drop +:parameters (?x - hoist ?y - crate ?z - surface ?p - place) +:precondition (and (at ?x ?p) (at ?z ?p) (clear ?z) (lifting ?x ?y)) +:effect (and (available ?x) (not (lifting ?x ?y)) (at ?y ?p) (not (clear ?z)) (clear ?y) + (on ?y ?z))) + +(:action Load +:parameters (?x - hoist ?y - crate ?z - truck ?p - place) +:precondition (and (at ?x ?p) (at ?z ?p) (lifting ?x ?y) + (<= (+ (current_load ?z) (weight ?y)) (load_limit ?z))) +:effect (and (not (lifting ?x ?y)) (in ?y ?z) (available ?x) + (increase (current_load ?z) (weight ?y)))) + +(:action Unload +:parameters (?x - hoist ?y - crate ?z - truck ?p - place) +:precondition (and (at ?x ?p) (at ?z ?p) (available ?x) (in ?y ?z)) +:effect (and (not (in ?y ?z)) (not (available ?x)) (lifting ?x ?y) + (decrease (current_load ?z) (weight ?y)))) + +) diff --git a/tests/fixtures/pddl_files/depots-numeric-automatic/p01.pddl b/tests/fixtures/pddl_files/depots-numeric-automatic/p01.pddl new file mode 100644 index 00000000..f3fa97d9 --- /dev/null +++ b/tests/fixtures/pddl_files/depots-numeric-automatic/p01.pddl @@ -0,0 +1,43 @@ +(define (problem depotprob1818) (:domain Depot) +(:objects + depot0 - Depot + distributor0 distributor1 - Distributor + truck0 truck1 - Truck + pallet0 pallet1 pallet2 - Pallet + crate0 crate1 - Crate + hoist0 hoist1 hoist2 - Hoist) +(:init + (at pallet0 depot0) + (clear crate1) + (at pallet1 distributor0) + (clear crate0) + (at pallet2 distributor1) + (clear pallet2) + (at truck0 distributor1) + (= (current_load truck0) 0) + (= (load_limit truck0) 323) + (at truck1 depot0) + (= (current_load truck1) 0) + (= (load_limit truck1) 220) + (at hoist0 depot0) + (available hoist0) + (at hoist1 distributor0) + (available hoist1) + (at hoist2 distributor1) + (available hoist2) + (at crate0 distributor0) + (on crate0 pallet1) + (= (weight crate0) 11) + (at crate1 depot0) + (on crate1 pallet0) + (= (weight crate1) 86) + (= (fuel-cost) 0) +) + +(:goal (and + (on crate0 pallet2) + (on crate1 pallet1) + ) +) + +(:metric minimize (fuel-cost))) diff --git a/tests/fixtures/pddl_files/depots-numeric-automatic/p02.pddl b/tests/fixtures/pddl_files/depots-numeric-automatic/p02.pddl new file mode 100644 index 00000000..6242a14f --- /dev/null +++ b/tests/fixtures/pddl_files/depots-numeric-automatic/p02.pddl @@ -0,0 +1,51 @@ +(define (problem depotprob7512) (:domain Depot) +(:objects + depot0 - Depot + distributor0 distributor1 - Distributor + truck0 truck1 - Truck + pallet0 pallet1 pallet2 - Pallet + crate0 crate1 crate2 crate3 - Crate + hoist0 hoist1 hoist2 - Hoist) +(:init + (at pallet0 depot0) + (clear crate0) + (at pallet1 distributor0) + (clear crate3) + (at pallet2 distributor1) + (clear crate2) + (at truck0 depot0) + (= (current_load truck0) 0) + (= (load_limit truck0) 411) + (at truck1 depot0) + (= (current_load truck1) 0) + (= (load_limit truck1) 390) + (at hoist0 depot0) + (available hoist0) + (at hoist1 distributor0) + (available hoist1) + (at hoist2 distributor1) + (available hoist2) + (at crate0 depot0) + (on crate0 pallet0) + (= (weight crate0) 32) + (at crate1 distributor1) + (on crate1 pallet2) + (= (weight crate1) 4) + (at crate2 distributor1) + (on crate2 crate1) + (= (weight crate2) 89) + (at crate3 distributor0) + (on crate3 pallet1) + (= (weight crate3) 62) + (= (fuel-cost) 0) +) + +(:goal (and + (on crate0 pallet2) + (on crate1 crate3) + (on crate2 pallet0) + (on crate3 pallet1) + ) +) + +(:metric minimize (fuel-cost))) diff --git a/tests/fixtures/pddl_files/depots-numeric-automatic/p03.pddl b/tests/fixtures/pddl_files/depots-numeric-automatic/p03.pddl new file mode 100644 index 00000000..87a0f832 --- /dev/null +++ b/tests/fixtures/pddl_files/depots-numeric-automatic/p03.pddl @@ -0,0 +1,59 @@ +(define (problem depotprob1935) (:domain Depot) +(:objects + depot0 - Depot + distributor0 distributor1 - Distributor + truck0 truck1 - Truck + pallet0 pallet1 pallet2 - Pallet + crate0 crate1 crate2 crate3 crate4 crate5 - Crate + hoist0 hoist1 hoist2 - Hoist) +(:init + (at pallet0 depot0) + (clear crate1) + (at pallet1 distributor0) + (clear crate4) + (at pallet2 distributor1) + (clear crate5) + (at truck0 depot0) + (= (current_load truck0) 0) + (= (load_limit truck0) 457) + (at truck1 distributor0) + (= (current_load truck1) 0) + (= (load_limit truck1) 331) + (at hoist0 depot0) + (available hoist0) + (at hoist1 distributor0) + (available hoist1) + (at hoist2 distributor1) + (available hoist2) + (at crate0 distributor0) + (on crate0 pallet1) + (= (weight crate0) 99) + (at crate1 depot0) + (on crate1 pallet0) + (= (weight crate1) 89) + (at crate2 distributor1) + (on crate2 pallet2) + (= (weight crate2) 67) + (at crate3 distributor0) + (on crate3 crate0) + (= (weight crate3) 81) + (at crate4 distributor0) + (on crate4 crate3) + (= (weight crate4) 4) + (at crate5 distributor1) + (on crate5 crate2) + (= (weight crate5) 50) + (= (fuel-cost) 0) +) + +(:goal (and + (on crate0 crate1) + (on crate1 pallet2) + (on crate2 pallet0) + (on crate3 crate2) + (on crate4 pallet1) + (on crate5 crate0) + ) +) + +(:metric minimize (total-time))) diff --git a/tests/fixtures/pddl_files/depots-numeric-automatic/p04.pddl b/tests/fixtures/pddl_files/depots-numeric-automatic/p04.pddl new file mode 100644 index 00000000..15359539 --- /dev/null +++ b/tests/fixtures/pddl_files/depots-numeric-automatic/p04.pddl @@ -0,0 +1,65 @@ +(define (problem depotprob6512) (:domain Depot) +(:objects + depot0 - Depot + distributor0 distributor1 - Distributor + truck0 truck1 - Truck + pallet0 pallet1 pallet2 - Pallet + crate0 crate1 crate2 crate3 crate4 crate5 crate6 crate7 - Crate + hoist0 hoist1 hoist2 - Hoist) +(:init + (at pallet0 depot0) + (clear crate7) + (at pallet1 distributor0) + (clear crate2) + (at pallet2 distributor1) + (clear crate6) + (at truck0 distributor1) + (= (current_load truck0) 0) + (= (load_limit truck0) 420) + (at truck1 distributor1) + (= (current_load truck1) 0) + (= (load_limit truck1) 233) + (at hoist0 depot0) + (available hoist0) + (at hoist1 distributor0) + (available hoist1) + (at hoist2 distributor1) + (available hoist2) + (at crate0 depot0) + (on crate0 pallet0) + (= (weight crate0) 6) + (at crate1 depot0) + (on crate1 crate0) + (= (weight crate1) 22) + (at crate2 distributor0) + (on crate2 pallet1) + (= (weight crate2) 23) + (at crate3 distributor1) + (on crate3 pallet2) + (= (weight crate3) 87) + (at crate4 depot0) + (on crate4 crate1) + (= (weight crate4) 89) + (at crate5 distributor1) + (on crate5 crate3) + (= (weight crate5) 50) + (at crate6 distributor1) + (on crate6 crate5) + (= (weight crate6) 18) + (at crate7 depot0) + (on crate7 crate4) + (= (weight crate7) 93) + (= (fuel-cost) 0) +) + +(:goal (and + (on crate0 crate4) + (on crate2 crate6) + (on crate4 crate7) + (on crate5 pallet2) + (on crate6 pallet1) + (on crate7 pallet0) + ) +) + +(:metric minimize (fuel-cost))) diff --git a/tests/fixtures/pddl_files/depots-numeric-automatic/p05.pddl b/tests/fixtures/pddl_files/depots-numeric-automatic/p05.pddl new file mode 100644 index 00000000..5c0e7cbe --- /dev/null +++ b/tests/fixtures/pddl_files/depots-numeric-automatic/p05.pddl @@ -0,0 +1,75 @@ +(define (problem depotprob1212) (:domain Depot) +(:objects + depot0 - Depot + distributor0 distributor1 - Distributor + truck0 truck1 - Truck + pallet0 pallet1 pallet2 - Pallet + crate0 crate1 crate2 crate3 crate4 crate5 crate6 crate7 crate8 crate9 - Crate + hoist0 hoist1 hoist2 - Hoist) +(:init + (at pallet0 depot0) + (clear crate4) + (at pallet1 distributor0) + (clear crate8) + (at pallet2 distributor1) + (clear crate9) + (at truck0 depot0) + (= (current_load truck0) 0) + (= (load_limit truck0) 387) + (at truck1 distributor0) + (= (current_load truck1) 0) + (= (load_limit truck1) 343) + (at hoist0 depot0) + (available hoist0) + (at hoist1 distributor0) + (available hoist1) + (at hoist2 distributor1) + (available hoist2) + (at crate0 distributor1) + (on crate0 pallet2) + (= (weight crate0) 87) + (at crate1 depot0) + (on crate1 pallet0) + (= (weight crate1) 69) + (at crate2 distributor1) + (on crate2 crate0) + (= (weight crate2) 18) + (at crate3 depot0) + (on crate3 crate1) + (= (weight crate3) 76) + (at crate4 depot0) + (on crate4 crate3) + (= (weight crate4) 44) + (at crate5 distributor1) + (on crate5 crate2) + (= (weight crate5) 96) + (at crate6 distributor0) + (on crate6 pallet1) + (= (weight crate6) 15) + (at crate7 distributor0) + (on crate7 crate6) + (= (weight crate7) 99) + (at crate8 distributor0) + (on crate8 crate7) + (= (weight crate8) 57) + (at crate9 distributor1) + (on crate9 crate5) + (= (weight crate9) 6) + (= (fuel-cost) 0) +) + +(:goal (and + (on crate0 crate5) + (on crate1 pallet1) + (on crate2 crate0) + (on crate3 pallet2) + (on crate4 crate6) + (on crate5 crate4) + (on crate6 crate9) + (on crate7 crate1) + (on crate8 crate3) + (on crate9 pallet0) + ) +) + +(:metric minimize (fuel-cost))) diff --git a/tests/fixtures/pddl_files/depots-numeric-automatic/p06.pddl b/tests/fixtures/pddl_files/depots-numeric-automatic/p06.pddl new file mode 100644 index 00000000..5cdaf2d6 --- /dev/null +++ b/tests/fixtures/pddl_files/depots-numeric-automatic/p06.pddl @@ -0,0 +1,91 @@ +(define (problem depotprob5656) (:domain Depot) +(:objects + depot0 - Depot + distributor0 distributor1 - Distributor + truck0 truck1 - Truck + pallet0 pallet1 pallet2 - Pallet + crate0 crate1 crate2 crate3 crate4 crate5 crate6 crate7 crate8 crate9 crate10 crate11 crate12 crate13 crate14 - Crate + hoist0 hoist1 hoist2 - Hoist) +(:init + (at pallet0 depot0) + (clear crate11) + (at pallet1 distributor0) + (clear crate14) + (at pallet2 distributor1) + (clear crate10) + (at truck0 distributor1) + (= (current_load truck0) 0) + (= (load_limit truck0) 301) + (at truck1 depot0) + (= (current_load truck1) 0) + (= (load_limit truck1) 268) + (at hoist0 depot0) + (available hoist0) + (at hoist1 distributor0) + (available hoist1) + (at hoist2 distributor1) + (available hoist2) + (at crate0 distributor1) + (on crate0 pallet2) + (= (weight crate0) 89) + (at crate1 depot0) + (on crate1 pallet0) + (= (weight crate1) 62) + (at crate2 distributor1) + (on crate2 crate0) + (= (weight crate2) 42) + (at crate3 distributor0) + (on crate3 pallet1) + (= (weight crate3) 37) + (at crate4 distributor0) + (on crate4 crate3) + (= (weight crate4) 11) + (at crate5 distributor1) + (on crate5 crate2) + (= (weight crate5) 91) + (at crate6 depot0) + (on crate6 crate1) + (= (weight crate6) 58) + (at crate7 distributor0) + (on crate7 crate4) + (= (weight crate7) 58) + (at crate8 distributor0) + (on crate8 crate7) + (= (weight crate8) 20) + (at crate9 distributor0) + (on crate9 crate8) + (= (weight crate9) 15) + (at crate10 distributor1) + (on crate10 crate5) + (= (weight crate10) 95) + (at crate11 depot0) + (on crate11 crate6) + (= (weight crate11) 75) + (at crate12 distributor0) + (on crate12 crate9) + (= (weight crate12) 53) + (at crate13 distributor0) + (on crate13 crate12) + (= (weight crate13) 73) + (at crate14 distributor0) + (on crate14 crate13) + (= (weight crate14) 70) + (= (fuel-cost) 0) +) + +(:goal (and + (on crate0 crate8) + (on crate1 crate9) + (on crate2 crate1) + (on crate3 crate12) + (on crate4 crate11) + (on crate5 crate0) + (on crate8 pallet0) + (on crate9 pallet1) + (on crate10 crate4) + (on crate11 crate5) + (on crate12 pallet2) + ) +) + +(:metric minimize (total-time))) diff --git a/tests/fixtures/pddl_files/depots-numeric-automatic/p07.pddl b/tests/fixtures/pddl_files/depots-numeric-automatic/p07.pddl new file mode 100644 index 00000000..b63badf8 --- /dev/null +++ b/tests/fixtures/pddl_files/depots-numeric-automatic/p07.pddl @@ -0,0 +1,64 @@ +(define (problem depotprob1234) (:domain Depot) +(:objects + depot0 - Depot + distributor0 distributor1 - Distributor + truck0 truck1 - Truck + pallet0 pallet1 pallet2 pallet3 pallet4 pallet5 - Pallet + crate0 crate1 crate2 crate3 crate4 crate5 - Crate + hoist0 hoist1 hoist2 - Hoist) +(:init + (at pallet0 depot0) + (clear crate5) + (at pallet1 distributor0) + (clear pallet1) + (at pallet2 distributor1) + (clear crate3) + (at pallet3 distributor0) + (clear pallet3) + (at pallet4 distributor0) + (clear crate4) + (at pallet5 distributor1) + (clear crate1) + (at truck0 distributor1) + (= (current_load truck0) 0) + (= (load_limit truck0) 327) + (at truck1 depot0) + (= (current_load truck1) 0) + (= (load_limit truck1) 273) + (at hoist0 depot0) + (available hoist0) + (at hoist1 distributor0) + (available hoist1) + (at hoist2 distributor1) + (available hoist2) + (at crate0 distributor0) + (on crate0 pallet4) + (= (weight crate0) 90) + (at crate1 distributor1) + (on crate1 pallet5) + (= (weight crate1) 25) + (at crate2 distributor1) + (on crate2 pallet2) + (= (weight crate2) 96) + (at crate3 distributor1) + (on crate3 crate2) + (= (weight crate3) 29) + (at crate4 distributor0) + (on crate4 crate0) + (= (weight crate4) 4) + (at crate5 depot0) + (on crate5 pallet0) + (= (weight crate5) 93) + (= (fuel-cost) 0) +) + +(:goal (and + (on crate0 pallet3) + (on crate1 crate4) + (on crate3 pallet1) + (on crate4 pallet5) + (on crate5 crate1) + ) +) + +(:metric minimize (fuel-cost))) diff --git a/tests/fixtures/pddl_files/depots-numeric-automatic/p08.pddl b/tests/fixtures/pddl_files/depots-numeric-automatic/p08.pddl new file mode 100644 index 00000000..358226f4 --- /dev/null +++ b/tests/fixtures/pddl_files/depots-numeric-automatic/p08.pddl @@ -0,0 +1,78 @@ +(define (problem depotprob4321) (:domain Depot) +(:objects + depot0 - Depot + distributor0 distributor1 - Distributor + truck0 truck1 - Truck + pallet0 pallet1 pallet2 pallet3 pallet4 pallet5 - Pallet + crate0 crate1 crate2 crate3 crate4 crate5 crate6 crate7 crate8 crate9 - Crate + hoist0 hoist1 hoist2 - Hoist) +(:init + (at pallet0 depot0) + (clear crate2) + (at pallet1 distributor0) + (clear crate6) + (at pallet2 distributor1) + (clear crate9) + (at pallet3 distributor1) + (clear crate7) + (at pallet4 distributor0) + (clear crate0) + (at pallet5 distributor0) + (clear crate8) + (at truck0 distributor0) + (= (current_load truck0) 0) + (= (load_limit truck0) 477) + (at truck1 distributor0) + (= (current_load truck1) 0) + (= (load_limit truck1) 342) + (at hoist0 depot0) + (available hoist0) + (at hoist1 distributor0) + (available hoist1) + (at hoist2 distributor1) + (available hoist2) + (at crate0 distributor0) + (on crate0 pallet4) + (= (weight crate0) 100) + (at crate1 distributor0) + (on crate1 pallet1) + (= (weight crate1) 23) + (at crate2 depot0) + (on crate2 pallet0) + (= (weight crate2) 28) + (at crate3 distributor0) + (on crate3 pallet5) + (= (weight crate3) 41) + (at crate4 distributor1) + (on crate4 pallet3) + (= (weight crate4) 2) + (at crate5 distributor0) + (on crate5 crate1) + (= (weight crate5) 89) + (at crate6 distributor0) + (on crate6 crate5) + (= (weight crate6) 9) + (at crate7 distributor1) + (on crate7 crate4) + (= (weight crate7) 18) + (at crate8 distributor0) + (on crate8 crate3) + (= (weight crate8) 79) + (at crate9 distributor1) + (on crate9 pallet2) + (= (weight crate9) 43) + (= (fuel-cost) 0) +) + +(:goal (and + (on crate0 pallet3) + (on crate1 crate0) + (on crate3 crate8) + (on crate6 pallet2) + (on crate7 pallet1) + (on crate8 pallet4) + (on crate9 pallet0) + ) +) + +(:metric minimize (total-time))) diff --git a/tests/fixtures/pddl_files/depots-numeric-automatic/p09.pddl b/tests/fixtures/pddl_files/depots-numeric-automatic/p09.pddl new file mode 100644 index 00000000..3ada434f --- /dev/null +++ b/tests/fixtures/pddl_files/depots-numeric-automatic/p09.pddl @@ -0,0 +1,99 @@ +(define (problem depotprob5451) (:domain Depot) +(:objects + depot0 - Depot + distributor0 distributor1 - Distributor + truck0 truck1 - Truck + pallet0 pallet1 pallet2 pallet3 pallet4 pallet5 - Pallet + crate0 crate1 crate2 crate3 crate4 crate5 crate6 crate7 crate8 crate9 crate10 crate11 crate12 crate13 crate14 - Crate + hoist0 hoist1 hoist2 - Hoist) +(:init + (at pallet0 depot0) + (clear crate2) + (at pallet1 distributor0) + (clear crate14) + (at pallet2 distributor1) + (clear crate13) + (at pallet3 distributor1) + (clear crate10) + (at pallet4 distributor0) + (clear crate12) + (at pallet5 depot0) + (clear crate8) + (at truck0 distributor0) + (= (current_load truck0) 0) + (= (load_limit truck0) 314) + (at truck1 distributor0) + (= (current_load truck1) 0) + (= (load_limit truck1) 246) + (at hoist0 depot0) + (available hoist0) + (at hoist1 distributor0) + (available hoist1) + (at hoist2 distributor1) + (available hoist2) + (at crate0 distributor1) + (on crate0 pallet2) + (= (weight crate0) 13) + (at crate1 depot0) + (on crate1 pallet0) + (= (weight crate1) 94) + (at crate2 depot0) + (on crate2 crate1) + (= (weight crate2) 45) + (at crate3 distributor0) + (on crate3 pallet1) + (= (weight crate3) 26) + (at crate4 distributor1) + (on crate4 crate0) + (= (weight crate4) 96) + (at crate5 distributor1) + (on crate5 pallet3) + (= (weight crate5) 74) + (at crate6 distributor0) + (on crate6 crate3) + (= (weight crate6) 68) + (at crate7 distributor0) + (on crate7 crate6) + (= (weight crate7) 71) + (at crate8 depot0) + (on crate8 pallet5) + (= (weight crate8) 81) + (at crate9 distributor0) + (on crate9 crate7) + (= (weight crate9) 51) + (at crate10 distributor1) + (on crate10 crate5) + (= (weight crate10) 94) + (at crate11 distributor0) + (on crate11 pallet4) + (= (weight crate11) 36) + (at crate12 distributor0) + (on crate12 crate11) + (= (weight crate12) 70) + (at crate13 distributor1) + (on crate13 crate4) + (= (weight crate13) 66) + (at crate14 distributor0) + (on crate14 crate9) + (= (weight crate14) 55) + (= (fuel-cost) 0) +) + +(:goal (and + (on crate0 crate5) + (on crate1 crate2) + (on crate2 crate10) + (on crate3 pallet0) + (on crate4 crate6) + (on crate5 pallet5) + (on crate6 pallet4) + (on crate9 crate1) + (on crate10 pallet2) + (on crate11 pallet1) + (on crate12 crate14) + (on crate13 crate3) + (on crate14 pallet3) + ) +) + +(:metric minimize (fuel-cost))) diff --git a/tests/fixtures/pddl_files/depots-numeric-automatic/p10.pddl b/tests/fixtures/pddl_files/depots-numeric-automatic/p10.pddl new file mode 100644 index 00000000..4b10159e --- /dev/null +++ b/tests/fixtures/pddl_files/depots-numeric-automatic/p10.pddl @@ -0,0 +1,69 @@ +(define (problem depotprob7654) (:domain Depot) +(:objects + depot0 depot1 depot2 - Depot + distributor0 distributor1 distributor2 - Distributor + truck0 truck1 - Truck + pallet0 pallet1 pallet2 pallet3 pallet4 pallet5 - Pallet + crate0 crate1 crate2 crate3 crate4 crate5 - Crate + hoist0 hoist1 hoist2 hoist3 hoist4 hoist5 - Hoist) +(:init + (at pallet0 depot0) + (clear crate1) + (at pallet1 depot1) + (clear crate0) + (at pallet2 depot2) + (clear crate4) + (at pallet3 distributor0) + (clear crate5) + (at pallet4 distributor1) + (clear pallet4) + (at pallet5 distributor2) + (clear crate3) + (at truck0 depot1) + (= (current_load truck0) 0) + (= (load_limit truck0) 370) + (at truck1 depot2) + (= (current_load truck1) 0) + (= (load_limit truck1) 287) + (at hoist0 depot0) + (available hoist0) + (at hoist1 depot1) + (available hoist1) + (at hoist2 depot2) + (available hoist2) + (at hoist3 distributor0) + (available hoist3) + (at hoist4 distributor1) + (available hoist4) + (at hoist5 distributor2) + (available hoist5) + (at crate0 depot1) + (on crate0 pallet1) + (= (weight crate0) 96) + (at crate1 depot0) + (on crate1 pallet0) + (= (weight crate1) 72) + (at crate2 distributor2) + (on crate2 pallet5) + (= (weight crate2) 74) + (at crate3 distributor2) + (on crate3 crate2) + (= (weight crate3) 16) + (at crate4 depot2) + (on crate4 pallet2) + (= (weight crate4) 23) + (at crate5 distributor0) + (on crate5 pallet3) + (= (weight crate5) 42) + (= (fuel-cost) 0) +) + +(:goal (and + (on crate0 crate4) + (on crate2 pallet3) + (on crate3 pallet0) + (on crate4 pallet5) + ) +) + +(:metric minimize (total-time))) diff --git a/tests/fixtures/pddl_files/depots-numeric-automatic/p11.pddl b/tests/fixtures/pddl_files/depots-numeric-automatic/p11.pddl new file mode 100644 index 00000000..f6e266dc --- /dev/null +++ b/tests/fixtures/pddl_files/depots-numeric-automatic/p11.pddl @@ -0,0 +1,87 @@ +(define (problem depotprob8765) (:domain Depot) +(:objects + depot0 depot1 depot2 - Depot + distributor0 distributor1 distributor2 - Distributor + truck0 truck1 - Truck + pallet0 pallet1 pallet2 pallet3 pallet4 pallet5 - Pallet + crate0 crate1 crate2 crate3 crate4 crate5 crate6 crate7 crate8 crate9 - Crate + hoist0 hoist1 hoist2 hoist3 hoist4 hoist5 - Hoist) +(:init + (at pallet0 depot0) + (clear crate1) + (at pallet1 depot1) + (clear crate3) + (at pallet2 depot2) + (clear crate9) + (at pallet3 distributor0) + (clear pallet3) + (at pallet4 distributor1) + (clear pallet4) + (at pallet5 distributor2) + (clear crate8) + (at truck0 depot2) + (= (current_load truck0) 0) + (= (load_limit truck0) 336) + (at truck1 distributor0) + (= (current_load truck1) 0) + (= (load_limit truck1) 366) + (at hoist0 depot0) + (available hoist0) + (at hoist1 depot1) + (available hoist1) + (at hoist2 depot2) + (available hoist2) + (at hoist3 distributor0) + (available hoist3) + (at hoist4 distributor1) + (available hoist4) + (at hoist5 distributor2) + (available hoist5) + (at crate0 depot1) + (on crate0 pallet1) + (= (weight crate0) 42) + (at crate1 depot0) + (on crate1 pallet0) + (= (weight crate1) 6) + (at crate2 depot2) + (on crate2 pallet2) + (= (weight crate2) 74) + (at crate3 depot1) + (on crate3 crate0) + (= (weight crate3) 64) + (at crate4 depot2) + (on crate4 crate2) + (= (weight crate4) 61) + (at crate5 depot2) + (on crate5 crate4) + (= (weight crate5) 79) + (at crate6 distributor2) + (on crate6 pallet5) + (= (weight crate6) 29) + (at crate7 distributor2) + (on crate7 crate6) + (= (weight crate7) 77) + (at crate8 distributor2) + (on crate8 crate7) + (= (weight crate8) 19) + (at crate9 depot2) + (on crate9 crate5) + (= (weight crate9) 98) + (= (fuel-cost) 0) +) + +(:goal (and + (on crate0 crate7) + (on crate1 pallet4) + (on crate2 pallet5) + (on crate3 crate9) + (on crate4 pallet0) + (on crate5 pallet2) + (on crate6 crate5) + (on crate7 crate1) + (on crate8 pallet3) + (on crate9 crate2) + ) +) + +(:metric minimize (fuel-cost))) diff --git a/tests/fixtures/pddl_files/depots-numeric-automatic/p12.pddl b/tests/fixtures/pddl_files/depots-numeric-automatic/p12.pddl new file mode 100644 index 00000000..94e1e97e --- /dev/null +++ b/tests/fixtures/pddl_files/depots-numeric-automatic/p12.pddl @@ -0,0 +1,103 @@ +(define (problem depotprob9876) (:domain Depot) +(:objects + depot0 depot1 depot2 - Depot + distributor0 distributor1 distributor2 - Distributor + truck0 truck1 - Truck + pallet0 pallet1 pallet2 pallet3 pallet4 pallet5 - Pallet + crate0 crate1 crate2 crate3 crate4 crate5 crate6 crate7 crate8 crate9 crate10 crate11 crate12 crate13 crate14 - Crate + hoist0 hoist1 hoist2 hoist3 hoist4 hoist5 - Hoist) +(:init + (at pallet0 depot0) + (clear pallet0) + (at pallet1 depot1) + (clear crate12) + (at pallet2 depot2) + (clear pallet2) + (at pallet3 distributor0) + (clear crate4) + (at pallet4 distributor1) + (clear crate14) + (at pallet5 distributor2) + (clear crate13) + (at truck0 distributor1) + (= (current_load truck0) 0) + (= (load_limit truck0) 390) + (at truck1 depot1) + (= (current_load truck1) 0) + (= (load_limit truck1) 246) + (at hoist0 depot0) + (available hoist0) + (at hoist1 depot1) + (available hoist1) + (at hoist2 depot2) + (available hoist2) + (at hoist3 distributor0) + (available hoist3) + (at hoist4 distributor1) + (available hoist4) + (at hoist5 distributor2) + (available hoist5) + (at crate0 distributor2) + (on crate0 pallet5) + (= (weight crate0) 41) + (at crate1 depot1) + (on crate1 pallet1) + (= (weight crate1) 43) + (at crate2 distributor0) + (on crate2 pallet3) + (= (weight crate2) 25) + (at crate3 distributor2) + (on crate3 crate0) + (= (weight crate3) 16) + (at crate4 distributor0) + (on crate4 crate2) + (= (weight crate4) 5) + (at crate5 depot1) + (on crate5 crate1) + (= (weight crate5) 16) + (at crate6 distributor2) + (on crate6 crate3) + (= (weight crate6) 62) + (at crate7 distributor2) + (on crate7 crate6) + (= (weight crate7) 87) + (at crate8 distributor2) + (on crate8 crate7) + (= (weight crate8) 30) + (at crate9 distributor2) + (on crate9 crate8) + (= (weight crate9) 49) + (at crate10 depot1) + (on crate10 crate5) + (= (weight crate10) 31) + (at crate11 distributor1) + (on crate11 pallet4) + (= (weight crate11) 81) + (at crate12 depot1) + (on crate12 crate10) + (= (weight crate12) 4) + (at crate13 distributor2) + (on crate13 crate9) + (= (weight crate13) 73) + (at crate14 distributor1) + (on crate14 crate11) + (= (weight crate14) 31) + (= (fuel-cost) 0) +) + +(:goal (and + (on crate0 pallet4) + (on crate1 crate12) + (on crate2 crate0) + (on crate3 crate9) + (on crate5 pallet0) + (on crate6 crate2) + (on crate9 pallet2) + (on crate10 crate13) + (on crate12 pallet5) + (on crate13 pallet1) + (on crate14 crate10) + ) +) + +(:metric minimize (fuel-cost))) diff --git a/tests/fixtures/pddl_files/depots-numeric-automatic/p13.pddl b/tests/fixtures/pddl_files/depots-numeric-automatic/p13.pddl new file mode 100644 index 00000000..fc0fe5af --- /dev/null +++ b/tests/fixtures/pddl_files/depots-numeric-automatic/p13.pddl @@ -0,0 +1,79 @@ +(define (problem depotprob5646) (:domain Depot) +(:objects + depot0 depot1 depot2 - Depot + distributor0 distributor1 distributor2 - Distributor + truck0 truck1 - Truck + pallet0 pallet1 pallet2 pallet3 pallet4 pallet5 pallet6 pallet7 pallet8 pallet9 - Pallet + crate0 crate1 crate2 crate3 crate4 crate5 - Crate + hoist0 hoist1 hoist2 hoist3 hoist4 hoist5 - Hoist) +(:init + (at pallet0 depot0) + (clear crate2) + (at pallet1 depot1) + (clear pallet1) + (at pallet2 depot2) + (clear crate5) + (at pallet3 distributor0) + (clear crate4) + (at pallet4 distributor1) + (clear pallet4) + (at pallet5 distributor2) + (clear pallet5) + (at pallet6 distributor1) + (clear pallet6) + (at pallet7 depot0) + (clear pallet7) + (at pallet8 depot0) + (clear crate3) + (at pallet9 distributor0) + (clear pallet9) + (at truck0 distributor1) + (= (current_load truck0) 0) + (= (load_limit truck0) 402) + (at truck1 depot0) + (= (current_load truck1) 0) + (= (load_limit truck1) 211) + (at hoist0 depot0) + (available hoist0) + (at hoist1 depot1) + (available hoist1) + (at hoist2 depot2) + (available hoist2) + (at hoist3 distributor0) + (available hoist3) + (at hoist4 distributor1) + (available hoist4) + (at hoist5 distributor2) + (available hoist5) + (at crate0 depot2) + (on crate0 pallet2) + (= (weight crate0) 55) + (at crate1 depot2) + (on crate1 crate0) + (= (weight crate1) 100) + (at crate2 depot0) + (on crate2 pallet0) + (= (weight crate2) 81) + (at crate3 depot0) + (on crate3 pallet8) + (= (weight crate3) 26) + (at crate4 distributor0) + (on crate4 pallet3) + (= (weight crate4) 50) + (at crate5 depot2) + (on crate5 crate1) + (= (weight crate5) 71) + (= (fuel-cost) 0) +) + +(:goal (and + (on crate0 pallet0) + (on crate1 pallet5) + (on crate2 pallet4) + (on crate3 pallet7) + (on crate4 pallet9) + (on crate5 pallet1) + ) +) + +(:metric minimize (total-time))) diff --git a/tests/fixtures/pddl_files/depots-numeric-automatic/p14.pddl b/tests/fixtures/pddl_files/depots-numeric-automatic/p14.pddl new file mode 100644 index 00000000..61bcd23d --- /dev/null +++ b/tests/fixtures/pddl_files/depots-numeric-automatic/p14.pddl @@ -0,0 +1,92 @@ +(define (problem depotprob7654) (:domain Depot) +(:objects + depot0 depot1 depot2 - Depot + distributor0 distributor1 distributor2 - Distributor + truck0 truck1 - Truck + pallet0 pallet1 pallet2 pallet3 pallet4 pallet5 pallet6 pallet7 pallet8 pallet9 - Pallet + crate0 crate1 crate2 crate3 crate4 crate5 crate6 crate7 crate8 crate9 - Crate + hoist0 hoist1 hoist2 hoist3 hoist4 hoist5 - Hoist) +(:init + (at pallet0 depot0) + (clear crate4) + (at pallet1 depot1) + (clear crate8) + (at pallet2 depot2) + (clear pallet2) + (at pallet3 distributor0) + (clear crate9) + (at pallet4 distributor1) + (clear crate7) + (at pallet5 distributor2) + (clear pallet5) + (at pallet6 distributor2) + (clear crate3) + (at pallet7 depot1) + (clear pallet7) + (at pallet8 distributor1) + (clear crate0) + (at pallet9 depot0) + (clear crate5) + (at truck0 depot1) + (= (current_load truck0) 0) + (= (load_limit truck0) 361) + (at truck1 depot2) + (= (current_load truck1) 0) + (= (load_limit truck1) 287) + (at hoist0 depot0) + (available hoist0) + (at hoist1 depot1) + (available hoist1) + (at hoist2 depot2) + (available hoist2) + (at hoist3 distributor0) + (available hoist3) + (at hoist4 distributor1) + (available hoist4) + (at hoist5 distributor2) + (available hoist5) + (at crate0 distributor1) + (on crate0 pallet8) + (= (weight crate0) 74) + (at crate1 depot0) + (on crate1 pallet9) + (= (weight crate1) 16) + (at crate2 distributor0) + (on crate2 pallet3) + (= (weight crate2) 23) + (at crate3 distributor2) + (on crate3 pallet6) + (= (weight crate3) 42) + (at crate4 depot0) + (on crate4 pallet0) + (= (weight crate4) 52) + (at crate5 depot0) + (on crate5 crate1) + (= (weight crate5) 74) + (at crate6 distributor1) + (on crate6 pallet4) + (= (weight crate6) 60) + (at crate7 distributor1) + (on crate7 crate6) + (= (weight crate7) 56) + (at crate8 depot1) + (on crate8 pallet1) + (= (weight crate8) 48) + (at crate9 distributor0) + (on crate9 crate2) + (= (weight crate9) 87) + (= (fuel-cost) 0) +) + +(:goal (and + (on crate1 pallet8) + (on crate2 pallet3) + (on crate4 pallet0) + (on crate5 pallet5) + (on crate6 pallet1) + (on crate7 crate6) + (on crate9 crate7) + ) +) + +(:metric minimize (total-time))) diff --git a/tests/fixtures/pddl_files/depots-numeric-automatic/p15.pddl b/tests/fixtures/pddl_files/depots-numeric-automatic/p15.pddl new file mode 100644 index 00000000..56d35425 --- /dev/null +++ b/tests/fixtures/pddl_files/depots-numeric-automatic/p15.pddl @@ -0,0 +1,115 @@ +(define (problem depotprob4534) (:domain Depot) +(:objects + depot0 depot1 depot2 - Depot + distributor0 distributor1 distributor2 - Distributor + truck0 truck1 - Truck + pallet0 pallet1 pallet2 pallet3 pallet4 pallet5 pallet6 pallet7 pallet8 pallet9 - Pallet + crate0 crate1 crate2 crate3 crate4 crate5 crate6 crate7 crate8 crate9 crate10 crate11 crate12 crate13 crate14 - Crate + hoist0 hoist1 hoist2 hoist3 hoist4 hoist5 - Hoist) +(:init + (at pallet0 depot0) + (clear pallet0) + (at pallet1 depot1) + (clear crate7) + (at pallet2 depot2) + (clear pallet2) + (at pallet3 distributor0) + (clear crate8) + (at pallet4 distributor1) + (clear crate12) + (at pallet5 distributor2) + (clear crate11) + (at pallet6 depot1) + (clear crate4) + (at pallet7 distributor0) + (clear crate9) + (at pallet8 depot2) + (clear crate13) + (at pallet9 distributor0) + (clear crate14) + (at truck0 distributor1) + (= (current_load truck0) 0) + (= (load_limit truck0) 492) + (at truck1 distributor2) + (= (current_load truck1) 0) + (= (load_limit truck1) 272) + (at hoist0 depot0) + (available hoist0) + (at hoist1 depot1) + (available hoist1) + (at hoist2 depot2) + (available hoist2) + (at hoist3 distributor0) + (available hoist3) + (at hoist4 distributor1) + (available hoist4) + (at hoist5 distributor2) + (available hoist5) + (at crate0 distributor2) + (on crate0 pallet5) + (= (weight crate0) 68) + (at crate1 distributor1) + (on crate1 pallet4) + (= (weight crate1) 94) + (at crate2 depot2) + (on crate2 pallet8) + (= (weight crate2) 51) + (at crate3 depot2) + (on crate3 crate2) + (= (weight crate3) 30) + (at crate4 depot1) + (on crate4 pallet6) + (= (weight crate4) 58) + (at crate5 distributor2) + (on crate5 crate0) + (= (weight crate5) 75) + (at crate6 depot1) + (on crate6 pallet1) + (= (weight crate6) 5) + (at crate7 depot1) + (on crate7 crate6) + (= (weight crate7) 1) + (at crate8 distributor0) + (on crate8 pallet3) + (= (weight crate8) 79) + (at crate9 distributor0) + (on crate9 pallet7) + (= (weight crate9) 42) + (at crate10 distributor1) + (on crate10 crate1) + (= (weight crate10) 46) + (at crate11 distributor2) + (on crate11 crate5) + (= (weight crate11) 78) + (at crate12 distributor1) + (on crate12 crate10) + (= (weight crate12) 63) + (at crate13 depot2) + (on crate13 crate3) + (= (weight crate13) 63) + (at crate14 distributor0) + (on crate14 pallet9) + (= (weight crate14) 6) + (= (fuel-cost) 0) +) + +(:goal (and + (on crate0 crate8) + (on crate1 crate10) + (on crate2 pallet0) + (on crate3 pallet1) + (on crate4 crate7) + (on crate5 pallet5) + (on crate6 pallet6) + (on crate7 pallet4) + (on crate8 pallet7) + (on crate9 crate4) + (on crate10 crate11) + (on crate11 crate9) + (on crate12 crate5) + (on crate13 pallet8) + (on crate14 pallet9) + ) +) + +(:metric minimize (fuel-cost))) diff --git a/tests/fixtures/pddl_files/depots-numeric-automatic/p16.pddl b/tests/fixtures/pddl_files/depots-numeric-automatic/p16.pddl new file mode 100644 index 00000000..df953d1e --- /dev/null +++ b/tests/fixtures/pddl_files/depots-numeric-automatic/p16.pddl @@ -0,0 +1,84 @@ +(define (problem depotprob4398) (:domain Depot) +(:objects + depot0 depot1 - Depot + distributor0 distributor1 - Distributor + truck0 truck1 truck2 truck3 - Truck + pallet0 pallet1 pallet2 pallet3 pallet4 pallet5 pallet6 pallet7 - Pallet + crate0 crate1 crate2 crate3 crate4 crate5 - Crate + hoist0 hoist1 hoist2 hoist3 hoist4 hoist5 hoist6 hoist7 - Hoist) +(:init + (at pallet0 depot0) + (clear crate5) + (at pallet1 depot1) + (clear crate3) + (at pallet2 distributor0) + (clear crate4) + (at pallet3 distributor1) + (clear pallet3) + (at pallet4 depot1) + (clear crate0) + (at pallet5 distributor1) + (clear pallet5) + (at pallet6 depot1) + (clear pallet6) + (at pallet7 distributor0) + (clear pallet7) + (at truck0 depot1) + (= (current_load truck0) 0) + (= (load_limit truck0) 309) + (at truck1 depot1) + (= (current_load truck1) 0) + (= (load_limit truck1) 267) + (at truck2 depot0) + (= (current_load truck2) 0) + (= (load_limit truck2) 360) + (at truck3 distributor1) + (= (current_load truck3) 0) + (= (load_limit truck3) 335) + (at hoist0 depot0) + (available hoist0) + (at hoist1 depot1) + (available hoist1) + (at hoist2 distributor0) + (available hoist2) + (at hoist3 distributor1) + (available hoist3) + (at hoist4 distributor1) + (available hoist4) + (at hoist5 depot1) + (available hoist5) + (at hoist6 depot1) + (available hoist6) + (at hoist7 distributor1) + (available hoist7) + (at crate0 depot1) + (on crate0 pallet4) + (= (weight crate0) 32) + (at crate1 depot1) + (on crate1 pallet1) + (= (weight crate1) 46) + (at crate2 depot0) + (on crate2 pallet0) + (= (weight crate2) 39) + (at crate3 depot1) + (on crate3 crate1) + (= (weight crate3) 24) + (at crate4 distributor0) + (on crate4 pallet2) + (= (weight crate4) 2) + (at crate5 depot0) + (on crate5 crate2) + (= (weight crate5) 25) + (= (fuel-cost) 0) +) + +(:goal (and + (on crate0 pallet3) + (on crate2 pallet1) + (on crate3 pallet0) + (on crate4 crate3) + (on crate5 pallet2) + ) +) + +(:metric minimize (total-time))) diff --git a/tests/fixtures/pddl_files/depots-numeric-automatic/p17.pddl b/tests/fixtures/pddl_files/depots-numeric-automatic/p17.pddl new file mode 100644 index 00000000..a41abdf8 --- /dev/null +++ b/tests/fixtures/pddl_files/depots-numeric-automatic/p17.pddl @@ -0,0 +1,98 @@ +(define (problem depotprob6587) (:domain Depot) +(:objects + depot0 depot1 - Depot + distributor0 distributor1 - Distributor + truck0 truck1 truck2 truck3 - Truck + pallet0 pallet1 pallet2 pallet3 pallet4 pallet5 pallet6 pallet7 - Pallet + crate0 crate1 crate2 crate3 crate4 crate5 crate6 crate7 crate8 crate9 - Crate + hoist0 hoist1 hoist2 hoist3 hoist4 hoist5 hoist6 hoist7 - Hoist) +(:init + (at pallet0 depot0) + (clear pallet0) + (at pallet1 depot1) + (clear crate4) + (at pallet2 distributor0) + (clear crate9) + (at pallet3 distributor1) + (clear crate7) + (at pallet4 distributor0) + (clear crate2) + (at pallet5 distributor1) + (clear crate1) + (at pallet6 depot0) + (clear crate3) + (at pallet7 distributor1) + (clear crate8) + (at truck0 depot1) + (= (current_load truck0) 0) + (= (load_limit truck0) 462) + (at truck1 distributor1) + (= (current_load truck1) 0) + (= (load_limit truck1) 261) + (at truck2 depot1) + (= (current_load truck2) 0) + (= (load_limit truck2) 254) + (at truck3 depot0) + (= (current_load truck3) 0) + (= (load_limit truck3) 291) + (at hoist0 depot0) + (available hoist0) + (at hoist1 depot1) + (available hoist1) + (at hoist2 distributor0) + (available hoist2) + (at hoist3 distributor1) + (available hoist3) + (at hoist4 depot0) + (available hoist4) + (at hoist5 depot0) + (available hoist5) + (at hoist6 depot0) + (available hoist6) + (at hoist7 distributor1) + (available hoist7) + (at crate0 distributor1) + (on crate0 pallet3) + (= (weight crate0) 92) + (at crate1 distributor1) + (on crate1 pallet5) + (= (weight crate1) 8) + (at crate2 distributor0) + (on crate2 pallet4) + (= (weight crate2) 65) + (at crate3 depot0) + (on crate3 pallet6) + (= (weight crate3) 14) + (at crate4 depot1) + (on crate4 pallet1) + (= (weight crate4) 3) + (at crate5 distributor1) + (on crate5 crate0) + (= (weight crate5) 13) + (at crate6 distributor1) + (on crate6 pallet7) + (= (weight crate6) 33) + (at crate7 distributor1) + (on crate7 crate5) + (= (weight crate7) 76) + (at crate8 distributor1) + (on crate8 crate6) + (= (weight crate8) 31) + (at crate9 distributor0) + (on crate9 pallet2) + (= (weight crate9) 91) + (= (fuel-cost) 0) +) + +(:goal (and + (on crate1 pallet7) + (on crate2 pallet4) + (on crate3 crate8) + (on crate4 pallet0) + (on crate6 pallet1) + (on crate7 crate3) + (on crate8 pallet6) + ) +) + +(:metric minimize (total-time))) diff --git a/tests/fixtures/pddl_files/depots-numeric-automatic/p18.pddl b/tests/fixtures/pddl_files/depots-numeric-automatic/p18.pddl new file mode 100644 index 00000000..3d5676ee --- /dev/null +++ b/tests/fixtures/pddl_files/depots-numeric-automatic/p18.pddl @@ -0,0 +1,119 @@ +(define (problem depotprob1916) (:domain Depot) +(:objects + depot0 depot1 - Depot + distributor0 distributor1 - Distributor + truck0 truck1 truck2 truck3 - Truck + pallet0 pallet1 pallet2 pallet3 pallet4 pallet5 pallet6 pallet7 - Pallet + crate0 crate1 crate2 crate3 crate4 crate5 crate6 crate7 crate8 crate9 crate10 crate11 crate12 crate13 crate14 - Crate + hoist0 hoist1 hoist2 hoist3 hoist4 hoist5 hoist6 hoist7 - Hoist) +(:init + (at pallet0 depot0) + (clear crate13) + (at pallet1 depot1) + (clear crate11) + (at pallet2 distributor0) + (clear crate14) + (at pallet3 distributor1) + (clear crate10) + (at pallet4 depot0) + (clear pallet4) + (at pallet5 distributor0) + (clear crate8) + (at pallet6 distributor1) + (clear crate3) + (at pallet7 depot1) + (clear crate5) + (at truck0 depot1) + (= (current_load truck0) 0) + (= (load_limit truck0) 460) + (at truck1 distributor0) + (= (current_load truck1) 0) + (= (load_limit truck1) 229) + (at truck2 depot0) + (= (current_load truck2) 0) + (= (load_limit truck2) 314) + (at truck3 depot1) + (= (current_load truck3) 0) + (= (load_limit truck3) 282) + (at hoist0 depot0) + (available hoist0) + (at hoist1 depot1) + (available hoist1) + (at hoist2 distributor0) + (available hoist2) + (at hoist3 distributor1) + (available hoist3) + (at hoist4 distributor0) + (available hoist4) + (at hoist5 depot0) + (available hoist5) + (at hoist6 distributor0) + (available hoist6) + (at hoist7 distributor1) + (available hoist7) + (at crate0 depot0) + (on crate0 pallet0) + (= (weight crate0) 7) + (at crate1 depot1) + (on crate1 pallet1) + (= (weight crate1) 94) + (at crate2 distributor0) + (on crate2 pallet2) + (= (weight crate2) 46) + (at crate3 distributor1) + (on crate3 pallet6) + (= (weight crate3) 3) + (at crate4 depot0) + (on crate4 crate0) + (= (weight crate4) 15) + (at crate5 depot1) + (on crate5 pallet7) + (= (weight crate5) 90) + (at crate6 distributor0) + (on crate6 pallet5) + (= (weight crate6) 58) + (at crate7 depot0) + (on crate7 crate4) + (= (weight crate7) 69) + (at crate8 distributor0) + (on crate8 crate6) + (= (weight crate8) 77) + (at crate9 distributor1) + (on crate9 pallet3) + (= (weight crate9) 42) + (at crate10 distributor1) + (on crate10 crate9) + (= (weight crate10) 38) + (at crate11 depot1) + (on crate11 crate1) + (= (weight crate11) 11) + (at crate12 distributor0) + (on crate12 crate2) + (= (weight crate12) 82) + (at crate13 depot0) + (on crate13 crate7) + (= (weight crate13) 46) + (at crate14 distributor0) + (on crate14 crate12) + (= (weight crate14) 88) + (= (fuel-cost) 0) +) + +(:goal (and + (on crate0 crate10) + (on crate1 pallet6) + (on crate2 crate12) + (on crate4 pallet4) + (on crate5 pallet2) + (on crate6 pallet7) + (on crate8 crate4) + (on crate9 crate1) + (on crate10 pallet1) + (on crate11 pallet5) + (on crate12 crate5) + (on crate13 pallet3) + (on crate14 pallet0) + ) +) + +(:metric minimize (total-time))) diff --git a/tests/fixtures/pddl_files/depots-numeric-automatic/p19.pddl b/tests/fixtures/pddl_files/depots-numeric-automatic/p19.pddl new file mode 100644 index 00000000..09bcd4c0 --- /dev/null +++ b/tests/fixtures/pddl_files/depots-numeric-automatic/p19.pddl @@ -0,0 +1,96 @@ +(define (problem depotprob6178) (:domain Depot) +(:objects + depot0 depot1 depot2 depot3 - Depot + distributor0 distributor1 distributor2 distributor3 - Distributor + truck0 truck1 truck2 truck3 - Truck + pallet0 pallet1 pallet2 pallet3 pallet4 pallet5 pallet6 pallet7 pallet8 pallet9 - Pallet + crate0 crate1 crate2 crate3 crate4 crate5 crate6 crate7 - Crate + hoist0 hoist1 hoist2 hoist3 hoist4 hoist5 hoist6 hoist7 - Hoist) +(:init + (at pallet0 depot0) + (clear crate6) + (at pallet1 depot1) + (clear crate1) + (at pallet2 depot2) + (clear pallet2) + (at pallet3 depot3) + (clear crate7) + (at pallet4 distributor0) + (clear crate2) + (at pallet5 distributor1) + (clear crate5) + (at pallet6 distributor2) + (clear pallet6) + (at pallet7 distributor3) + (clear pallet7) + (at pallet8 distributor2) + (clear crate4) + (at pallet9 depot3) + (clear crate0) + (at truck0 depot0) + (= (current_load truck0) 0) + (= (load_limit truck0) 298) + (at truck1 distributor0) + (= (current_load truck1) 0) + (= (load_limit truck1) 361) + (at truck2 depot2) + (= (current_load truck2) 0) + (= (load_limit truck2) 334) + (at truck3 distributor3) + (= (current_load truck3) 0) + (= (load_limit truck3) 267) + (at hoist0 depot0) + (available hoist0) + (at hoist1 depot1) + (available hoist1) + (at hoist2 depot2) + (available hoist2) + (at hoist3 depot3) + (available hoist3) + (at hoist4 distributor0) + (available hoist4) + (at hoist5 distributor1) + (available hoist5) + (at hoist6 distributor2) + (available hoist6) + (at hoist7 distributor3) + (available hoist7) + (at crate0 depot3) + (on crate0 pallet9) + (= (weight crate0) 81) + (at crate1 depot1) + (on crate1 pallet1) + (= (weight crate1) 32) + (at crate2 distributor0) + (on crate2 pallet4) + (= (weight crate2) 50) + (at crate3 distributor1) + (on crate3 pallet5) + (= (weight crate3) 80) + (at crate4 distributor2) + (on crate4 pallet8) + (= (weight crate4) 20) + (at crate5 distributor1) + (on crate5 crate3) + (= (weight crate5) 63) + (at crate6 depot0) + (on crate6 pallet0) + (= (weight crate6) 93) + (at crate7 depot3) + (on crate7 pallet3) + (= (weight crate7) 67) + (= (fuel-cost) 0) +) + +(:goal (and + (on crate0 pallet6) + (on crate1 pallet8) + (on crate3 crate1) + (on crate4 pallet5) + (on crate5 crate7) + (on crate6 pallet4) + (on crate7 crate4) + ) +) + +(:metric minimize (total-time))) diff --git a/tests/fixtures/pddl_files/depots-numeric-automatic/p20.pddl b/tests/fixtures/pddl_files/depots-numeric-automatic/p20.pddl new file mode 100644 index 00000000..6b3ce426 --- /dev/null +++ b/tests/fixtures/pddl_files/depots-numeric-automatic/p20.pddl @@ -0,0 +1,124 @@ +(define (problem depotprob7615) (:domain Depot) +(:objects + depot0 depot1 depot2 depot3 - Depot + distributor0 distributor1 distributor2 distributor3 - Distributor + truck0 truck1 truck2 truck3 - Truck + pallet0 pallet1 pallet2 pallet3 pallet4 pallet5 pallet6 pallet7 pallet8 pallet9 - Pallet + crate0 crate1 crate2 crate3 crate4 crate5 crate6 crate7 crate8 crate9 crate10 crate11 crate12 crate13 crate14 - Crate + hoist0 hoist1 hoist2 hoist3 hoist4 hoist5 hoist6 hoist7 - Hoist) +(:init + (at pallet0 depot0) + (clear crate13) + (at pallet1 depot1) + (clear crate14) + (at pallet2 depot2) + (clear pallet2) + (at pallet3 depot3) + (clear crate5) + (at pallet4 distributor0) + (clear pallet4) + (at pallet5 distributor1) + (clear crate9) + (at pallet6 distributor2) + (clear crate8) + (at pallet7 distributor3) + (clear crate10) + (at pallet8 depot1) + (clear crate11) + (at pallet9 depot2) + (clear pallet9) + (at truck0 distributor2) + (= (current_load truck0) 0) + (= (load_limit truck0) 458) + (at truck1 depot0) + (= (current_load truck1) 0) + (= (load_limit truck1) 400) + (at truck2 depot1) + (= (current_load truck2) 0) + (= (load_limit truck2) 390) + (at truck3 distributor1) + (= (current_load truck3) 0) + (= (load_limit truck3) 379) + (at hoist0 depot0) + (available hoist0) + (at hoist1 depot1) + (available hoist1) + (at hoist2 depot2) + (available hoist2) + (at hoist3 depot3) + (available hoist3) + (at hoist4 distributor0) + (available hoist4) + (at hoist5 distributor1) + (available hoist5) + (at hoist6 distributor2) + (available hoist6) + (at hoist7 distributor3) + (available hoist7) + (at crate0 distributor3) + (on crate0 pallet7) + (= (weight crate0) 64) + (at crate1 distributor1) + (on crate1 pallet5) + (= (weight crate1) 1) + (at crate2 depot3) + (on crate2 pallet3) + (= (weight crate2) 50) + (at crate3 depot0) + (on crate3 pallet0) + (= (weight crate3) 56) + (at crate4 depot0) + (on crate4 crate3) + (= (weight crate4) 36) + (at crate5 depot3) + (on crate5 crate2) + (= (weight crate5) 68) + (at crate6 depot1) + (on crate6 pallet1) + (= (weight crate6) 90) + (at crate7 distributor2) + (on crate7 pallet6) + (= (weight crate7) 55) + (at crate8 distributor2) + (on crate8 crate7) + (= (weight crate8) 94) + (at crate9 distributor1) + (on crate9 crate1) + (= (weight crate9) 44) + (at crate10 distributor3) + (on crate10 crate0) + (= (weight crate10) 36) + (at crate11 depot1) + (on crate11 pallet8) + (= (weight crate11) 47) + (at crate12 depot1) + (on crate12 crate6) + (= (weight crate12) 88) + (at crate13 depot0) + (on crate13 crate4) + (= (weight crate13) 97) + (at crate14 depot1) + (on crate14 crate12) + (= (weight crate14) 84) + (= (fuel-cost) 0) +) + +(:goal (and + (on crate0 pallet3) + (on crate1 crate11) + (on crate2 pallet6) + (on crate3 crate0) + (on crate4 crate5) + (on crate5 crate14) + (on crate6 pallet4) + (on crate7 pallet2) + (on crate8 pallet7) + (on crate9 crate8) + (on crate11 pallet5) + (on crate12 crate6) + (on crate13 crate2) + (on crate14 pallet1) + ) +) + +(:metric minimize (fuel-cost))) diff --git a/tests/fixtures/pddl_files/depots-numeric-automatic/p21.pddl b/tests/fixtures/pddl_files/depots-numeric-automatic/p21.pddl new file mode 100644 index 00000000..fc569df5 --- /dev/null +++ b/tests/fixtures/pddl_files/depots-numeric-automatic/p21.pddl @@ -0,0 +1,143 @@ +(define (problem depotprob8715) (:domain Depot) +(:objects + depot0 depot1 depot2 depot3 depot4 depot5 - Depot + distributor0 distributor1 distributor2 distributor3 distributor4 distributor5 - Distributor + truck0 truck1 truck2 truck3 truck4 truck5 - Truck + pallet0 pallet1 pallet2 pallet3 pallet4 pallet5 pallet6 pallet7 pallet8 pallet9 pallet10 pallet11 pallet12 pallet13 pallet14 pallet15 pallet16 pallet17 pallet18 pallet19 - Pallet + crate0 crate1 crate2 crate3 crate4 crate5 crate6 crate7 crate8 crate9 - Crate + hoist0 hoist1 hoist2 hoist3 hoist4 hoist5 hoist6 hoist7 hoist8 hoist9 hoist10 hoist11 hoist12 hoist13 hoist14 - Hoist) +(:init + (at pallet0 depot0) + (clear crate1) + (at pallet1 depot1) + (clear crate5) + (at pallet2 depot2) + (clear pallet2) + (at pallet3 depot3) + (clear pallet3) + (at pallet4 depot4) + (clear crate6) + (at pallet5 depot5) + (clear pallet5) + (at pallet6 distributor0) + (clear pallet6) + (at pallet7 distributor1) + (clear crate8) + (at pallet8 distributor2) + (clear crate4) + (at pallet9 distributor3) + (clear pallet9) + (at pallet10 distributor4) + (clear pallet10) + (at pallet11 distributor5) + (clear pallet11) + (at pallet12 distributor1) + (clear pallet12) + (at pallet13 distributor5) + (clear crate2) + (at pallet14 depot2) + (clear pallet14) + (at pallet15 depot1) + (clear crate3) + (at pallet16 depot1) + (clear crate0) + (at pallet17 distributor2) + (clear pallet17) + (at pallet18 depot4) + (clear crate7) + (at pallet19 depot1) + (clear crate9) + (at truck0 distributor2) + (= (current_load truck0) 0) + (= (load_limit truck0) 399) + (at truck1 depot0) + (= (current_load truck1) 0) + (= (load_limit truck1) 340) + (at truck2 distributor3) + (= (current_load truck2) 0) + (= (load_limit truck2) 258) + (at truck3 distributor0) + (= (current_load truck3) 0) + (= (load_limit truck3) 264) + (at truck4 depot0) + (= (current_load truck4) 0) + (= (load_limit truck4) 272) + (at truck5 depot4) + (= (current_load truck5) 0) + (= (load_limit truck5) 397) + (at hoist0 depot0) + (available hoist0) + (at hoist1 depot1) + (available hoist1) + (at hoist2 depot2) + (available hoist2) + (at hoist3 depot3) + (available hoist3) + (at hoist4 depot4) + (available hoist4) + (at hoist5 depot5) + (available hoist5) + (at hoist6 distributor0) + (available hoist6) + (at hoist7 distributor1) + (available hoist7) + (at hoist8 distributor2) + (available hoist8) + (at hoist9 distributor3) + (available hoist9) + (at hoist10 distributor4) + (available hoist10) + (at hoist11 distributor5) + (available hoist11) + (at hoist12 depot5) + (available hoist12) + (at hoist13 depot1) + (available hoist13) + (at hoist14 depot4) + (available hoist14) + (at crate0 depot1) + (on crate0 pallet16) + (= (weight crate0) 13) + (at crate1 depot0) + (on crate1 pallet0) + (= (weight crate1) 25) + (at crate2 distributor5) + (on crate2 pallet13) + (= (weight crate2) 64) + (at crate3 depot1) + (on crate3 pallet15) + (= (weight crate3) 5) + (at crate4 distributor2) + (on crate4 pallet8) + (= (weight crate4) 92) + (at crate5 depot1) + (on crate5 pallet1) + (= (weight crate5) 95) + (at crate6 depot4) + (on crate6 pallet4) + (= (weight crate6) 32) + (at crate7 depot4) + (on crate7 pallet18) + (= (weight crate7) 7) + (at crate8 distributor1) + (on crate8 pallet7) + (= (weight crate8) 8) + (at crate9 depot1) + (on crate9 pallet19) + (= (weight crate9) 24) + (= (fuel-cost) 0) +) + +(:goal (and + (on crate0 pallet2) + (on crate1 pallet7) + (on crate2 pallet11) + (on crate3 pallet3) + (on crate5 pallet5) + (on crate6 pallet12) + (on crate7 pallet18) + (on crate8 pallet15) + ) +) + +(:metric minimize (total-time))) diff --git a/tests/fixtures/pddl_files/depots-numeric-automatic/p22.pddl b/tests/fixtures/pddl_files/depots-numeric-automatic/p22.pddl new file mode 100644 index 00000000..c06fc834 --- /dev/null +++ b/tests/fixtures/pddl_files/depots-numeric-automatic/p22.pddl @@ -0,0 +1,183 @@ +(define (problem depotprob1817) (:domain Depot) +(:objects + depot0 depot1 depot2 depot3 depot4 depot5 - Depot + distributor0 distributor1 distributor2 distributor3 distributor4 distributor5 - Distributor + truck0 truck1 truck2 truck3 truck4 truck5 - Truck + pallet0 pallet1 pallet2 pallet3 pallet4 pallet5 pallet6 pallet7 pallet8 pallet9 pallet10 pallet11 pallet12 pallet13 pallet14 pallet15 pallet16 pallet17 pallet18 pallet19 - Pallet + crate0 crate1 crate2 crate3 crate4 crate5 crate6 crate7 crate8 crate9 crate10 crate11 crate12 crate13 crate14 crate15 crate16 crate17 crate18 crate19 - Crate + hoist0 hoist1 hoist2 hoist3 hoist4 hoist5 hoist6 hoist7 hoist8 hoist9 hoist10 hoist11 hoist12 hoist13 hoist14 - Hoist) +(:init + (at pallet0 depot0) + (clear crate10) + (at pallet1 depot1) + (clear crate17) + (at pallet2 depot2) + (clear pallet2) + (at pallet3 depot3) + (clear pallet3) + (at pallet4 depot4) + (clear pallet4) + (at pallet5 depot5) + (clear crate8) + (at pallet6 distributor0) + (clear pallet6) + (at pallet7 distributor1) + (clear crate19) + (at pallet8 distributor2) + (clear crate13) + (at pallet9 distributor3) + (clear crate16) + (at pallet10 distributor4) + (clear crate14) + (at pallet11 distributor5) + (clear crate0) + (at pallet12 distributor4) + (clear crate18) + (at pallet13 distributor2) + (clear crate15) + (at pallet14 depot3) + (clear pallet14) + (at pallet15 depot3) + (clear pallet15) + (at pallet16 distributor1) + (clear pallet16) + (at pallet17 distributor2) + (clear crate6) + (at pallet18 distributor3) + (clear pallet18) + (at pallet19 distributor1) + (clear pallet19) + (at truck0 depot2) + (= (current_load truck0) 0) + (= (load_limit truck0) 443) + (at truck1 distributor4) + (= (current_load truck1) 0) + (= (load_limit truck1) 222) + (at truck2 distributor2) + (= (current_load truck2) 0) + (= (load_limit truck2) 267) + (at truck3 depot0) + (= (current_load truck3) 0) + (= (load_limit truck3) 301) + (at truck4 distributor3) + (= (current_load truck4) 0) + (= (load_limit truck4) 234) + (at truck5 distributor0) + (= (current_load truck5) 0) + (= (load_limit truck5) 219) + (at hoist0 depot0) + (available hoist0) + (at hoist1 depot1) + (available hoist1) + (at hoist2 depot2) + (available hoist2) + (at hoist3 depot3) + (available hoist3) + (at hoist4 depot4) + (available hoist4) + (at hoist5 depot5) + (available hoist5) + (at hoist6 distributor0) + (available hoist6) + (at hoist7 distributor1) + (available hoist7) + (at hoist8 distributor2) + (available hoist8) + (at hoist9 distributor3) + (available hoist9) + (at hoist10 distributor4) + (available hoist10) + (at hoist11 distributor5) + (available hoist11) + (at hoist12 depot0) + (available hoist12) + (at hoist13 depot5) + (available hoist13) + (at hoist14 depot5) + (available hoist14) + (at crate0 distributor5) + (on crate0 pallet11) + (= (weight crate0) 86) + (at crate1 depot0) + (on crate1 pallet0) + (= (weight crate1) 47) + (at crate2 distributor4) + (on crate2 pallet10) + (= (weight crate2) 93) + (at crate3 distributor2) + (on crate3 pallet8) + (= (weight crate3) 92) + (at crate4 distributor1) + (on crate4 pallet7) + (= (weight crate4) 36) + (at crate5 distributor4) + (on crate5 crate2) + (= (weight crate5) 1) + (at crate6 distributor2) + (on crate6 pallet17) + (= (weight crate6) 27) + (at crate7 depot5) + (on crate7 pallet5) + (= (weight crate7) 37) + (at crate8 depot5) + (on crate8 crate7) + (= (weight crate8) 50) + (at crate9 depot0) + (on crate9 crate1) + (= (weight crate9) 60) + (at crate10 depot0) + (on crate10 crate9) + (= (weight crate10) 57) + (at crate11 distributor3) + (on crate11 pallet9) + (= (weight crate11) 80) + (at crate12 depot1) + (on crate12 pallet1) + (= (weight crate12) 75) + (at crate13 distributor2) + (on crate13 crate3) + (= (weight crate13) 76) + (at crate14 distributor4) + (on crate14 crate5) + (= (weight crate14) 84) + (at crate15 distributor2) + (on crate15 pallet13) + (= (weight crate15) 2) + (at crate16 distributor3) + (on crate16 crate11) + (= (weight crate16) 13) + (at crate17 depot1) + (on crate17 crate12) + (= (weight crate17) 70) + (at crate18 distributor4) + (on crate18 pallet12) + (= (weight crate18) 2) + (at crate19 distributor1) + (on crate19 crate4) + (= (weight crate19) 48) + (= (fuel-cost) 0) +) + +(:goal (and + (on crate0 pallet14) + (on crate1 pallet15) + (on crate2 pallet13) + (on crate3 pallet18) + (on crate5 pallet12) + (on crate6 pallet6) + (on crate7 pallet5) + (on crate8 crate10) + (on crate9 pallet17) + (on crate10 crate17) + (on crate11 pallet1) + (on crate12 pallet16) + (on crate13 crate16) + (on crate15 pallet7) + (on crate16 crate15) + (on crate17 pallet2) + (on crate18 pallet4) + (on crate19 pallet9) + ) +) + +(:metric minimize (total-time))) diff --git a/tests/fixtures/pddl_files/sokoban-sequential-optimal/domain.pddl b/tests/fixtures/pddl_files/sokoban-sequential-optimal/domain.pddl new file mode 100644 index 00000000..c11ca823 --- /dev/null +++ b/tests/fixtures/pddl_files/sokoban-sequential-optimal/domain.pddl @@ -0,0 +1,69 @@ +(define (domain sokoban-sequential) + (:requirements :typing :action-costs) + (:types thing location direction - object + player stone - thing) + (:predicates (clear ?l - location) + (at ?t - thing ?l - location) + (at-goal ?s - stone) + (IS-GOAL ?l - location) + (IS-NONGOAL ?l - location) + (MOVE-DIR ?from ?to - location ?dir - direction)) + (:functions (total-cost) - number) + + (:action move + :parameters (?p - player ?from ?to - location ?dir - direction) + :precondition (and (at ?p ?from) + (clear ?to) + (MOVE-DIR ?from ?to ?dir) + ) + :effect (and (not (at ?p ?from)) + (not (clear ?to)) + (at ?p ?to) + (clear ?from) + ) + ) + + (:action push-to-nongoal + :parameters (?p - player ?s - stone + ?ppos ?from ?to - location + ?dir - direction) + :precondition (and (at ?p ?ppos) + (at ?s ?from) + (clear ?to) + (MOVE-DIR ?ppos ?from ?dir) + (MOVE-DIR ?from ?to ?dir) + (IS-NONGOAL ?to) + ) + :effect (and (not (at ?p ?ppos)) + (not (at ?s ?from)) + (not (clear ?to)) + (at ?p ?from) + (at ?s ?to) + (clear ?ppos) + (not (at-goal ?s)) + (increase (total-cost) 1) + ) + ) + + (:action push-to-goal + :parameters (?p - player ?s - stone + ?ppos ?from ?to - location + ?dir - direction) + :precondition (and (at ?p ?ppos) + (at ?s ?from) + (clear ?to) + (MOVE-DIR ?ppos ?from ?dir) + (MOVE-DIR ?from ?to ?dir) + (IS-GOAL ?to) + ) + :effect (and (not (at ?p ?ppos)) + (not (at ?s ?from)) + (not (clear ?to)) + (at ?p ?from) + (at ?s ?to) + (clear ?ppos) + (at-goal ?s) + (increase (total-cost) 1) + ) + ) +) diff --git a/tests/fixtures/pddl_files/sokoban-sequential-optimal/p01.pddl b/tests/fixtures/pddl_files/sokoban-sequential-optimal/p01.pddl new file mode 100644 index 00000000..e8a328e6 --- /dev/null +++ b/tests/fixtures/pddl_files/sokoban-sequential-optimal/p01.pddl @@ -0,0 +1,213 @@ +;; #### +;; ## ### +;; # # +;; #.**$@# +;; # ### +;; ## # +;; #### + +(define (problem p032-microban-sequential) + (:domain sokoban-sequential) + (:objects + dir-down - direction + dir-left - direction + dir-right - direction + dir-up - direction + player-01 - player + pos-1-1 - location + pos-1-2 - location + pos-1-3 - location + pos-1-4 - location + pos-1-5 - location + pos-1-6 - location + pos-1-7 - location + pos-2-1 - location + pos-2-2 - location + pos-2-3 - location + pos-2-4 - location + pos-2-5 - location + pos-2-6 - location + pos-2-7 - location + pos-3-1 - location + pos-3-2 - location + pos-3-3 - location + pos-3-4 - location + pos-3-5 - location + pos-3-6 - location + pos-3-7 - location + pos-4-1 - location + pos-4-2 - location + pos-4-3 - location + pos-4-4 - location + pos-4-5 - location + pos-4-6 - location + pos-4-7 - location + pos-5-1 - location + pos-5-2 - location + pos-5-3 - location + pos-5-4 - location + pos-5-5 - location + pos-5-6 - location + pos-5-7 - location + pos-6-1 - location + pos-6-2 - location + pos-6-3 - location + pos-6-4 - location + pos-6-5 - location + pos-6-6 - location + pos-6-7 - location + pos-7-1 - location + pos-7-2 - location + pos-7-3 - location + pos-7-4 - location + pos-7-5 - location + pos-7-6 - location + pos-7-7 - location + stone-01 - stone + stone-02 - stone + stone-03 - stone + ) + (:init + (IS-GOAL pos-2-4) + (IS-GOAL pos-3-4) + (IS-GOAL pos-4-4) + (IS-NONGOAL pos-1-1) + (IS-NONGOAL pos-1-2) + (IS-NONGOAL pos-1-3) + (IS-NONGOAL pos-1-4) + (IS-NONGOAL pos-1-5) + (IS-NONGOAL pos-1-6) + (IS-NONGOAL pos-1-7) + (IS-NONGOAL pos-2-1) + (IS-NONGOAL pos-2-2) + (IS-NONGOAL pos-2-3) + (IS-NONGOAL pos-2-5) + (IS-NONGOAL pos-2-6) + (IS-NONGOAL pos-2-7) + (IS-NONGOAL pos-3-1) + (IS-NONGOAL pos-3-2) + (IS-NONGOAL pos-3-3) + (IS-NONGOAL pos-3-5) + (IS-NONGOAL pos-3-6) + (IS-NONGOAL pos-3-7) + (IS-NONGOAL pos-4-1) + (IS-NONGOAL pos-4-2) + (IS-NONGOAL pos-4-3) + (IS-NONGOAL pos-4-5) + (IS-NONGOAL pos-4-6) + (IS-NONGOAL pos-4-7) + (IS-NONGOAL pos-5-1) + (IS-NONGOAL pos-5-2) + (IS-NONGOAL pos-5-3) + (IS-NONGOAL pos-5-4) + (IS-NONGOAL pos-5-5) + (IS-NONGOAL pos-5-6) + (IS-NONGOAL pos-5-7) + (IS-NONGOAL pos-6-1) + (IS-NONGOAL pos-6-2) + (IS-NONGOAL pos-6-3) + (IS-NONGOAL pos-6-4) + (IS-NONGOAL pos-6-5) + (IS-NONGOAL pos-6-6) + (IS-NONGOAL pos-6-7) + (IS-NONGOAL pos-7-1) + (IS-NONGOAL pos-7-2) + (IS-NONGOAL pos-7-3) + (IS-NONGOAL pos-7-4) + (IS-NONGOAL pos-7-5) + (IS-NONGOAL pos-7-6) + (IS-NONGOAL pos-7-7) + (MOVE-DIR pos-2-3 pos-2-4 dir-down) + (MOVE-DIR pos-2-3 pos-3-3 dir-right) + (MOVE-DIR pos-2-4 pos-2-3 dir-up) + (MOVE-DIR pos-2-4 pos-2-5 dir-down) + (MOVE-DIR pos-2-4 pos-3-4 dir-right) + (MOVE-DIR pos-2-5 pos-2-4 dir-up) + (MOVE-DIR pos-2-5 pos-3-5 dir-right) + (MOVE-DIR pos-3-2 pos-3-3 dir-down) + (MOVE-DIR pos-3-2 pos-4-2 dir-right) + (MOVE-DIR pos-3-3 pos-2-3 dir-left) + (MOVE-DIR pos-3-3 pos-3-2 dir-up) + (MOVE-DIR pos-3-3 pos-3-4 dir-down) + (MOVE-DIR pos-3-3 pos-4-3 dir-right) + (MOVE-DIR pos-3-4 pos-2-4 dir-left) + (MOVE-DIR pos-3-4 pos-3-3 dir-up) + (MOVE-DIR pos-3-4 pos-3-5 dir-down) + (MOVE-DIR pos-3-4 pos-4-4 dir-right) + (MOVE-DIR pos-3-5 pos-2-5 dir-left) + (MOVE-DIR pos-3-5 pos-3-4 dir-up) + (MOVE-DIR pos-3-5 pos-3-6 dir-down) + (MOVE-DIR pos-3-5 pos-4-5 dir-right) + (MOVE-DIR pos-3-6 pos-3-5 dir-up) + (MOVE-DIR pos-3-6 pos-4-6 dir-right) + (MOVE-DIR pos-4-2 pos-3-2 dir-left) + (MOVE-DIR pos-4-2 pos-4-3 dir-down) + (MOVE-DIR pos-4-3 pos-3-3 dir-left) + (MOVE-DIR pos-4-3 pos-4-2 dir-up) + (MOVE-DIR pos-4-3 pos-4-4 dir-down) + (MOVE-DIR pos-4-3 pos-5-3 dir-right) + (MOVE-DIR pos-4-4 pos-3-4 dir-left) + (MOVE-DIR pos-4-4 pos-4-3 dir-up) + (MOVE-DIR pos-4-4 pos-4-5 dir-down) + (MOVE-DIR pos-4-4 pos-5-4 dir-right) + (MOVE-DIR pos-4-5 pos-3-5 dir-left) + (MOVE-DIR pos-4-5 pos-4-4 dir-up) + (MOVE-DIR pos-4-5 pos-4-6 dir-down) + (MOVE-DIR pos-4-6 pos-3-6 dir-left) + (MOVE-DIR pos-4-6 pos-4-5 dir-up) + (MOVE-DIR pos-5-3 pos-4-3 dir-left) + (MOVE-DIR pos-5-3 pos-5-4 dir-down) + (MOVE-DIR pos-5-3 pos-6-3 dir-right) + (MOVE-DIR pos-5-4 pos-4-4 dir-left) + (MOVE-DIR pos-5-4 pos-5-3 dir-up) + (MOVE-DIR pos-5-4 pos-6-4 dir-right) + (MOVE-DIR pos-6-1 pos-7-1 dir-right) + (MOVE-DIR pos-6-3 pos-5-3 dir-left) + (MOVE-DIR pos-6-3 pos-6-4 dir-down) + (MOVE-DIR pos-6-4 pos-5-4 dir-left) + (MOVE-DIR pos-6-4 pos-6-3 dir-up) + (MOVE-DIR pos-6-6 pos-6-7 dir-down) + (MOVE-DIR pos-6-6 pos-7-6 dir-right) + (MOVE-DIR pos-6-7 pos-6-6 dir-up) + (MOVE-DIR pos-6-7 pos-7-7 dir-right) + (MOVE-DIR pos-7-1 pos-6-1 dir-left) + (MOVE-DIR pos-7-6 pos-6-6 dir-left) + (MOVE-DIR pos-7-6 pos-7-7 dir-down) + (MOVE-DIR pos-7-7 pos-6-7 dir-left) + (MOVE-DIR pos-7-7 pos-7-6 dir-up) + (at player-01 pos-6-4) + (at stone-01 pos-3-4) + (at stone-02 pos-4-4) + (at stone-03 pos-5-4) + (at-goal stone-01) + (at-goal stone-02) + (clear pos-1-1) + (clear pos-1-7) + (clear pos-2-3) + (clear pos-2-4) + (clear pos-2-5) + (clear pos-3-2) + (clear pos-3-3) + (clear pos-3-5) + (clear pos-3-6) + (clear pos-4-2) + (clear pos-4-3) + (clear pos-4-5) + (clear pos-4-6) + (clear pos-5-3) + (clear pos-6-1) + (clear pos-6-3) + (clear pos-6-6) + (clear pos-6-7) + (clear pos-7-1) + (clear pos-7-6) + (clear pos-7-7) + (= (total-cost) 0) + ) + (:goal (and + (at-goal stone-01) + (at-goal stone-02) + (at-goal stone-03) + )) + (:metric minimize (total-cost)) +) diff --git a/tests/fixtures/pddl_files/sokoban-sequential-optimal/p02.pddl b/tests/fixtures/pddl_files/sokoban-sequential-optimal/p02.pddl new file mode 100644 index 00000000..429cef34 --- /dev/null +++ b/tests/fixtures/pddl_files/sokoban-sequential-optimal/p02.pddl @@ -0,0 +1,532 @@ +;; ###### +;; # # +;; # # +;; ##### # +;; # #.##### +;; # $@$ # +;; #####.# # +;; ## ## ## +;; # $.# +;; # ### +;; ##### + +(define (problem p096-microban-sequential) + (:domain sokoban-sequential) + (:objects + dir-down - direction + dir-left - direction + dir-right - direction + dir-up - direction + player-01 - player + pos-01-01 - location + pos-01-02 - location + pos-01-03 - location + pos-01-04 - location + pos-01-05 - location + pos-01-06 - location + pos-01-07 - location + pos-01-08 - location + pos-01-09 - location + pos-01-10 - location + pos-01-11 - location + pos-02-01 - location + pos-02-02 - location + pos-02-03 - location + pos-02-04 - location + pos-02-05 - location + pos-02-06 - location + pos-02-07 - location + pos-02-08 - location + pos-02-09 - location + pos-02-10 - location + pos-02-11 - location + pos-03-01 - location + pos-03-02 - location + pos-03-03 - location + pos-03-04 - location + pos-03-05 - location + pos-03-06 - location + pos-03-07 - location + pos-03-08 - location + pos-03-09 - location + pos-03-10 - location + pos-03-11 - location + pos-04-01 - location + pos-04-02 - location + pos-04-03 - location + pos-04-04 - location + pos-04-05 - location + pos-04-06 - location + pos-04-07 - location + pos-04-08 - location + pos-04-09 - location + pos-04-10 - location + pos-04-11 - location + pos-05-01 - location + pos-05-02 - location + pos-05-03 - location + pos-05-04 - location + pos-05-05 - location + pos-05-06 - location + pos-05-07 - location + pos-05-08 - location + pos-05-09 - location + pos-05-10 - location + pos-05-11 - location + pos-06-01 - location + pos-06-02 - location + pos-06-03 - location + pos-06-04 - location + pos-06-05 - location + pos-06-06 - location + pos-06-07 - location + pos-06-08 - location + pos-06-09 - location + pos-06-10 - location + pos-06-11 - location + pos-07-01 - location + pos-07-02 - location + pos-07-03 - location + pos-07-04 - location + pos-07-05 - location + pos-07-06 - location + pos-07-07 - location + pos-07-08 - location + pos-07-09 - location + pos-07-10 - location + pos-07-11 - location + pos-08-01 - location + pos-08-02 - location + pos-08-03 - location + pos-08-04 - location + pos-08-05 - location + pos-08-06 - location + pos-08-07 - location + pos-08-08 - location + pos-08-09 - location + pos-08-10 - location + pos-08-11 - location + pos-09-01 - location + pos-09-02 - location + pos-09-03 - location + pos-09-04 - location + pos-09-05 - location + pos-09-06 - location + pos-09-07 - location + pos-09-08 - location + pos-09-09 - location + pos-09-10 - location + pos-09-11 - location + pos-10-01 - location + pos-10-02 - location + pos-10-03 - location + pos-10-04 - location + pos-10-05 - location + pos-10-06 - location + pos-10-07 - location + pos-10-08 - location + pos-10-09 - location + pos-10-10 - location + pos-10-11 - location + pos-11-01 - location + pos-11-02 - location + pos-11-03 - location + pos-11-04 - location + pos-11-05 - location + pos-11-06 - location + pos-11-07 - location + pos-11-08 - location + pos-11-09 - location + pos-11-10 - location + pos-11-11 - location + stone-01 - stone + stone-02 - stone + stone-03 - stone + ) + (:init + (IS-GOAL pos-06-05) + (IS-GOAL pos-06-07) + (IS-GOAL pos-09-09) + (IS-NONGOAL pos-01-01) + (IS-NONGOAL pos-01-02) + (IS-NONGOAL pos-01-03) + (IS-NONGOAL pos-01-04) + (IS-NONGOAL pos-01-05) + (IS-NONGOAL pos-01-06) + (IS-NONGOAL pos-01-07) + (IS-NONGOAL pos-01-08) + (IS-NONGOAL pos-01-09) + (IS-NONGOAL pos-01-10) + (IS-NONGOAL pos-01-11) + (IS-NONGOAL pos-02-01) + (IS-NONGOAL pos-02-02) + (IS-NONGOAL pos-02-03) + (IS-NONGOAL pos-02-04) + (IS-NONGOAL pos-02-05) + (IS-NONGOAL pos-02-06) + (IS-NONGOAL pos-02-07) + (IS-NONGOAL pos-02-08) + (IS-NONGOAL pos-02-09) + (IS-NONGOAL pos-02-10) + (IS-NONGOAL pos-02-11) + (IS-NONGOAL pos-03-01) + (IS-NONGOAL pos-03-02) + (IS-NONGOAL pos-03-03) + (IS-NONGOAL pos-03-04) + (IS-NONGOAL pos-03-05) + (IS-NONGOAL pos-03-06) + (IS-NONGOAL pos-03-07) + (IS-NONGOAL pos-03-08) + (IS-NONGOAL pos-03-09) + (IS-NONGOAL pos-03-10) + (IS-NONGOAL pos-03-11) + (IS-NONGOAL pos-04-01) + (IS-NONGOAL pos-04-02) + (IS-NONGOAL pos-04-03) + (IS-NONGOAL pos-04-04) + (IS-NONGOAL pos-04-05) + (IS-NONGOAL pos-04-06) + (IS-NONGOAL pos-04-07) + (IS-NONGOAL pos-04-08) + (IS-NONGOAL pos-04-09) + (IS-NONGOAL pos-04-10) + (IS-NONGOAL pos-04-11) + (IS-NONGOAL pos-05-01) + (IS-NONGOAL pos-05-02) + (IS-NONGOAL pos-05-03) + (IS-NONGOAL pos-05-04) + (IS-NONGOAL pos-05-05) + (IS-NONGOAL pos-05-06) + (IS-NONGOAL pos-05-07) + (IS-NONGOAL pos-05-08) + (IS-NONGOAL pos-05-09) + (IS-NONGOAL pos-05-10) + (IS-NONGOAL pos-05-11) + (IS-NONGOAL pos-06-01) + (IS-NONGOAL pos-06-02) + (IS-NONGOAL pos-06-03) + (IS-NONGOAL pos-06-04) + (IS-NONGOAL pos-06-06) + (IS-NONGOAL pos-06-08) + (IS-NONGOAL pos-06-09) + (IS-NONGOAL pos-06-10) + (IS-NONGOAL pos-06-11) + (IS-NONGOAL pos-07-01) + (IS-NONGOAL pos-07-02) + (IS-NONGOAL pos-07-03) + (IS-NONGOAL pos-07-04) + (IS-NONGOAL pos-07-05) + (IS-NONGOAL pos-07-06) + (IS-NONGOAL pos-07-07) + (IS-NONGOAL pos-07-08) + (IS-NONGOAL pos-07-09) + (IS-NONGOAL pos-07-10) + (IS-NONGOAL pos-07-11) + (IS-NONGOAL pos-08-01) + (IS-NONGOAL pos-08-02) + (IS-NONGOAL pos-08-03) + (IS-NONGOAL pos-08-04) + (IS-NONGOAL pos-08-05) + (IS-NONGOAL pos-08-06) + (IS-NONGOAL pos-08-07) + (IS-NONGOAL pos-08-08) + (IS-NONGOAL pos-08-09) + (IS-NONGOAL pos-08-10) + (IS-NONGOAL pos-08-11) + (IS-NONGOAL pos-09-01) + (IS-NONGOAL pos-09-02) + (IS-NONGOAL pos-09-03) + (IS-NONGOAL pos-09-04) + (IS-NONGOAL pos-09-05) + (IS-NONGOAL pos-09-06) + (IS-NONGOAL pos-09-07) + (IS-NONGOAL pos-09-08) + (IS-NONGOAL pos-09-10) + (IS-NONGOAL pos-09-11) + (IS-NONGOAL pos-10-01) + (IS-NONGOAL pos-10-02) + (IS-NONGOAL pos-10-03) + (IS-NONGOAL pos-10-04) + (IS-NONGOAL pos-10-05) + (IS-NONGOAL pos-10-06) + (IS-NONGOAL pos-10-07) + (IS-NONGOAL pos-10-08) + (IS-NONGOAL pos-10-09) + (IS-NONGOAL pos-10-10) + (IS-NONGOAL pos-10-11) + (IS-NONGOAL pos-11-01) + (IS-NONGOAL pos-11-02) + (IS-NONGOAL pos-11-03) + (IS-NONGOAL pos-11-04) + (IS-NONGOAL pos-11-05) + (IS-NONGOAL pos-11-06) + (IS-NONGOAL pos-11-07) + (IS-NONGOAL pos-11-08) + (IS-NONGOAL pos-11-09) + (IS-NONGOAL pos-11-10) + (IS-NONGOAL pos-11-11) + (MOVE-DIR pos-01-01 pos-01-02 dir-down) + (MOVE-DIR pos-01-01 pos-02-01 dir-right) + (MOVE-DIR pos-01-02 pos-01-01 dir-up) + (MOVE-DIR pos-01-02 pos-01-03 dir-down) + (MOVE-DIR pos-01-02 pos-02-02 dir-right) + (MOVE-DIR pos-01-03 pos-01-02 dir-up) + (MOVE-DIR pos-01-03 pos-02-03 dir-right) + (MOVE-DIR pos-01-08 pos-01-09 dir-down) + (MOVE-DIR pos-01-08 pos-02-08 dir-right) + (MOVE-DIR pos-01-09 pos-01-08 dir-up) + (MOVE-DIR pos-01-09 pos-01-10 dir-down) + (MOVE-DIR pos-01-09 pos-02-09 dir-right) + (MOVE-DIR pos-01-10 pos-01-09 dir-up) + (MOVE-DIR pos-01-10 pos-01-11 dir-down) + (MOVE-DIR pos-01-10 pos-02-10 dir-right) + (MOVE-DIR pos-01-11 pos-01-10 dir-up) + (MOVE-DIR pos-01-11 pos-02-11 dir-right) + (MOVE-DIR pos-02-01 pos-01-01 dir-left) + (MOVE-DIR pos-02-01 pos-02-02 dir-down) + (MOVE-DIR pos-02-02 pos-01-02 dir-left) + (MOVE-DIR pos-02-02 pos-02-01 dir-up) + (MOVE-DIR pos-02-02 pos-02-03 dir-down) + (MOVE-DIR pos-02-03 pos-01-03 dir-left) + (MOVE-DIR pos-02-03 pos-02-02 dir-up) + (MOVE-DIR pos-02-05 pos-02-06 dir-down) + (MOVE-DIR pos-02-05 pos-03-05 dir-right) + (MOVE-DIR pos-02-06 pos-02-05 dir-up) + (MOVE-DIR pos-02-06 pos-03-06 dir-right) + (MOVE-DIR pos-02-08 pos-01-08 dir-left) + (MOVE-DIR pos-02-08 pos-02-09 dir-down) + (MOVE-DIR pos-02-08 pos-03-08 dir-right) + (MOVE-DIR pos-02-09 pos-01-09 dir-left) + (MOVE-DIR pos-02-09 pos-02-08 dir-up) + (MOVE-DIR pos-02-09 pos-02-10 dir-down) + (MOVE-DIR pos-02-09 pos-03-09 dir-right) + (MOVE-DIR pos-02-10 pos-01-10 dir-left) + (MOVE-DIR pos-02-10 pos-02-09 dir-up) + (MOVE-DIR pos-02-10 pos-02-11 dir-down) + (MOVE-DIR pos-02-10 pos-03-10 dir-right) + (MOVE-DIR pos-02-11 pos-01-11 dir-left) + (MOVE-DIR pos-02-11 pos-02-10 dir-up) + (MOVE-DIR pos-02-11 pos-03-11 dir-right) + (MOVE-DIR pos-03-05 pos-02-05 dir-left) + (MOVE-DIR pos-03-05 pos-03-06 dir-down) + (MOVE-DIR pos-03-05 pos-04-05 dir-right) + (MOVE-DIR pos-03-06 pos-02-06 dir-left) + (MOVE-DIR pos-03-06 pos-03-05 dir-up) + (MOVE-DIR pos-03-06 pos-04-06 dir-right) + (MOVE-DIR pos-03-08 pos-02-08 dir-left) + (MOVE-DIR pos-03-08 pos-03-09 dir-down) + (MOVE-DIR pos-03-09 pos-02-09 dir-left) + (MOVE-DIR pos-03-09 pos-03-08 dir-up) + (MOVE-DIR pos-03-09 pos-03-10 dir-down) + (MOVE-DIR pos-03-10 pos-02-10 dir-left) + (MOVE-DIR pos-03-10 pos-03-09 dir-up) + (MOVE-DIR pos-03-10 pos-03-11 dir-down) + (MOVE-DIR pos-03-11 pos-02-11 dir-left) + (MOVE-DIR pos-03-11 pos-03-10 dir-up) + (MOVE-DIR pos-04-02 pos-04-03 dir-down) + (MOVE-DIR pos-04-02 pos-05-02 dir-right) + (MOVE-DIR pos-04-03 pos-04-02 dir-up) + (MOVE-DIR pos-04-03 pos-05-03 dir-right) + (MOVE-DIR pos-04-05 pos-03-05 dir-left) + (MOVE-DIR pos-04-05 pos-04-06 dir-down) + (MOVE-DIR pos-04-06 pos-03-06 dir-left) + (MOVE-DIR pos-04-06 pos-04-05 dir-up) + (MOVE-DIR pos-04-06 pos-05-06 dir-right) + (MOVE-DIR pos-05-02 pos-04-02 dir-left) + (MOVE-DIR pos-05-02 pos-05-03 dir-down) + (MOVE-DIR pos-05-02 pos-06-02 dir-right) + (MOVE-DIR pos-05-03 pos-04-03 dir-left) + (MOVE-DIR pos-05-03 pos-05-02 dir-up) + (MOVE-DIR pos-05-03 pos-06-03 dir-right) + (MOVE-DIR pos-05-06 pos-04-06 dir-left) + (MOVE-DIR pos-05-06 pos-06-06 dir-right) + (MOVE-DIR pos-05-09 pos-05-10 dir-down) + (MOVE-DIR pos-05-09 pos-06-09 dir-right) + (MOVE-DIR pos-05-10 pos-05-09 dir-up) + (MOVE-DIR pos-05-10 pos-06-10 dir-right) + (MOVE-DIR pos-06-02 pos-05-02 dir-left) + (MOVE-DIR pos-06-02 pos-06-03 dir-down) + (MOVE-DIR pos-06-02 pos-07-02 dir-right) + (MOVE-DIR pos-06-03 pos-05-03 dir-left) + (MOVE-DIR pos-06-03 pos-06-02 dir-up) + (MOVE-DIR pos-06-03 pos-06-04 dir-down) + (MOVE-DIR pos-06-03 pos-07-03 dir-right) + (MOVE-DIR pos-06-04 pos-06-03 dir-up) + (MOVE-DIR pos-06-04 pos-06-05 dir-down) + (MOVE-DIR pos-06-04 pos-07-04 dir-right) + (MOVE-DIR pos-06-05 pos-06-04 dir-up) + (MOVE-DIR pos-06-05 pos-06-06 dir-down) + (MOVE-DIR pos-06-06 pos-05-06 dir-left) + (MOVE-DIR pos-06-06 pos-06-05 dir-up) + (MOVE-DIR pos-06-06 pos-06-07 dir-down) + (MOVE-DIR pos-06-06 pos-07-06 dir-right) + (MOVE-DIR pos-06-07 pos-06-06 dir-up) + (MOVE-DIR pos-06-07 pos-06-08 dir-down) + (MOVE-DIR pos-06-08 pos-06-07 dir-up) + (MOVE-DIR pos-06-08 pos-06-09 dir-down) + (MOVE-DIR pos-06-09 pos-05-09 dir-left) + (MOVE-DIR pos-06-09 pos-06-08 dir-up) + (MOVE-DIR pos-06-09 pos-06-10 dir-down) + (MOVE-DIR pos-06-09 pos-07-09 dir-right) + (MOVE-DIR pos-06-10 pos-05-10 dir-left) + (MOVE-DIR pos-06-10 pos-06-09 dir-up) + (MOVE-DIR pos-06-10 pos-07-10 dir-right) + (MOVE-DIR pos-07-02 pos-06-02 dir-left) + (MOVE-DIR pos-07-02 pos-07-03 dir-down) + (MOVE-DIR pos-07-03 pos-06-03 dir-left) + (MOVE-DIR pos-07-03 pos-07-02 dir-up) + (MOVE-DIR pos-07-03 pos-07-04 dir-down) + (MOVE-DIR pos-07-04 pos-06-04 dir-left) + (MOVE-DIR pos-07-04 pos-07-03 dir-up) + (MOVE-DIR pos-07-06 pos-06-06 dir-left) + (MOVE-DIR pos-07-06 pos-08-06 dir-right) + (MOVE-DIR pos-07-09 pos-06-09 dir-left) + (MOVE-DIR pos-07-09 pos-07-10 dir-down) + (MOVE-DIR pos-07-09 pos-08-09 dir-right) + (MOVE-DIR pos-07-10 pos-06-10 dir-left) + (MOVE-DIR pos-07-10 pos-07-09 dir-up) + (MOVE-DIR pos-08-06 pos-07-06 dir-left) + (MOVE-DIR pos-08-06 pos-08-07 dir-down) + (MOVE-DIR pos-08-06 pos-09-06 dir-right) + (MOVE-DIR pos-08-07 pos-08-06 dir-up) + (MOVE-DIR pos-08-07 pos-09-07 dir-right) + (MOVE-DIR pos-08-09 pos-07-09 dir-left) + (MOVE-DIR pos-08-09 pos-09-09 dir-right) + (MOVE-DIR pos-09-01 pos-09-02 dir-down) + (MOVE-DIR pos-09-01 pos-10-01 dir-right) + (MOVE-DIR pos-09-02 pos-09-01 dir-up) + (MOVE-DIR pos-09-02 pos-09-03 dir-down) + (MOVE-DIR pos-09-02 pos-10-02 dir-right) + (MOVE-DIR pos-09-03 pos-09-02 dir-up) + (MOVE-DIR pos-09-03 pos-09-04 dir-down) + (MOVE-DIR pos-09-03 pos-10-03 dir-right) + (MOVE-DIR pos-09-04 pos-09-03 dir-up) + (MOVE-DIR pos-09-04 pos-10-04 dir-right) + (MOVE-DIR pos-09-06 pos-08-06 dir-left) + (MOVE-DIR pos-09-06 pos-09-07 dir-down) + (MOVE-DIR pos-09-06 pos-10-06 dir-right) + (MOVE-DIR pos-09-07 pos-08-07 dir-left) + (MOVE-DIR pos-09-07 pos-09-06 dir-up) + (MOVE-DIR pos-09-07 pos-09-08 dir-down) + (MOVE-DIR pos-09-07 pos-10-07 dir-right) + (MOVE-DIR pos-09-08 pos-09-07 dir-up) + (MOVE-DIR pos-09-08 pos-09-09 dir-down) + (MOVE-DIR pos-09-09 pos-08-09 dir-left) + (MOVE-DIR pos-09-09 pos-09-08 dir-up) + (MOVE-DIR pos-09-11 pos-10-11 dir-right) + (MOVE-DIR pos-10-01 pos-09-01 dir-left) + (MOVE-DIR pos-10-01 pos-10-02 dir-down) + (MOVE-DIR pos-10-01 pos-11-01 dir-right) + (MOVE-DIR pos-10-02 pos-09-02 dir-left) + (MOVE-DIR pos-10-02 pos-10-01 dir-up) + (MOVE-DIR pos-10-02 pos-10-03 dir-down) + (MOVE-DIR pos-10-02 pos-11-02 dir-right) + (MOVE-DIR pos-10-03 pos-09-03 dir-left) + (MOVE-DIR pos-10-03 pos-10-02 dir-up) + (MOVE-DIR pos-10-03 pos-10-04 dir-down) + (MOVE-DIR pos-10-03 pos-11-03 dir-right) + (MOVE-DIR pos-10-04 pos-09-04 dir-left) + (MOVE-DIR pos-10-04 pos-10-03 dir-up) + (MOVE-DIR pos-10-04 pos-11-04 dir-right) + (MOVE-DIR pos-10-06 pos-09-06 dir-left) + (MOVE-DIR pos-10-06 pos-10-07 dir-down) + (MOVE-DIR pos-10-07 pos-09-07 dir-left) + (MOVE-DIR pos-10-07 pos-10-06 dir-up) + (MOVE-DIR pos-10-11 pos-09-11 dir-left) + (MOVE-DIR pos-10-11 pos-11-11 dir-right) + (MOVE-DIR pos-11-01 pos-10-01 dir-left) + (MOVE-DIR pos-11-01 pos-11-02 dir-down) + (MOVE-DIR pos-11-02 pos-10-02 dir-left) + (MOVE-DIR pos-11-02 pos-11-01 dir-up) + (MOVE-DIR pos-11-02 pos-11-03 dir-down) + (MOVE-DIR pos-11-03 pos-10-03 dir-left) + (MOVE-DIR pos-11-03 pos-11-02 dir-up) + (MOVE-DIR pos-11-03 pos-11-04 dir-down) + (MOVE-DIR pos-11-04 pos-10-04 dir-left) + (MOVE-DIR pos-11-04 pos-11-03 dir-up) + (MOVE-DIR pos-11-09 pos-11-10 dir-down) + (MOVE-DIR pos-11-10 pos-11-09 dir-up) + (MOVE-DIR pos-11-10 pos-11-11 dir-down) + (MOVE-DIR pos-11-11 pos-10-11 dir-left) + (MOVE-DIR pos-11-11 pos-11-10 dir-up) + (at player-01 pos-06-06) + (at stone-01 pos-05-06) + (at stone-02 pos-07-06) + (at stone-03 pos-08-09) + (clear pos-01-01) + (clear pos-01-02) + (clear pos-01-03) + (clear pos-01-08) + (clear pos-01-09) + (clear pos-01-10) + (clear pos-01-11) + (clear pos-02-01) + (clear pos-02-02) + (clear pos-02-03) + (clear pos-02-05) + (clear pos-02-06) + (clear pos-02-08) + (clear pos-02-09) + (clear pos-02-10) + (clear pos-02-11) + (clear pos-03-05) + (clear pos-03-06) + (clear pos-03-08) + (clear pos-03-09) + (clear pos-03-10) + (clear pos-03-11) + (clear pos-04-02) + (clear pos-04-03) + (clear pos-04-05) + (clear pos-04-06) + (clear pos-05-02) + (clear pos-05-03) + (clear pos-05-09) + (clear pos-05-10) + (clear pos-06-02) + (clear pos-06-03) + (clear pos-06-04) + (clear pos-06-05) + (clear pos-06-07) + (clear pos-06-08) + (clear pos-06-09) + (clear pos-06-10) + (clear pos-07-02) + (clear pos-07-03) + (clear pos-07-04) + (clear pos-07-09) + (clear pos-07-10) + (clear pos-08-06) + (clear pos-08-07) + (clear pos-09-01) + (clear pos-09-02) + (clear pos-09-03) + (clear pos-09-04) + (clear pos-09-06) + (clear pos-09-07) + (clear pos-09-08) + (clear pos-09-09) + (clear pos-09-11) + (clear pos-10-01) + (clear pos-10-02) + (clear pos-10-03) + (clear pos-10-04) + (clear pos-10-06) + (clear pos-10-07) + (clear pos-10-11) + (clear pos-11-01) + (clear pos-11-02) + (clear pos-11-03) + (clear pos-11-04) + (clear pos-11-09) + (clear pos-11-10) + (clear pos-11-11) + (= (total-cost) 0) + ) + (:goal (and + (at-goal stone-01) + (at-goal stone-02) + (at-goal stone-03) + )) + (:metric minimize (total-cost)) +) diff --git a/tests/fixtures/pddl_files/sokoban-sequential-optimal/p03.pddl b/tests/fixtures/pddl_files/sokoban-sequential-optimal/p03.pddl new file mode 100644 index 00000000..713a1fd7 --- /dev/null +++ b/tests/fixtures/pddl_files/sokoban-sequential-optimal/p03.pddl @@ -0,0 +1,296 @@ +;; ######### +;; # @ # # +;; # $ $ # +;; ##$### ## +;; # ... # +;; # # # +;; ###### # +;; #### + +(define (problem p094-microban-sequential) + (:domain sokoban-sequential) + (:objects + dir-down - direction + dir-left - direction + dir-right - direction + dir-up - direction + player-01 - player + pos-1-1 - location + pos-1-2 - location + pos-1-3 - location + pos-1-4 - location + pos-1-5 - location + pos-1-6 - location + pos-1-7 - location + pos-1-8 - location + pos-2-1 - location + pos-2-2 - location + pos-2-3 - location + pos-2-4 - location + pos-2-5 - location + pos-2-6 - location + pos-2-7 - location + pos-2-8 - location + pos-3-1 - location + pos-3-2 - location + pos-3-3 - location + pos-3-4 - location + pos-3-5 - location + pos-3-6 - location + pos-3-7 - location + pos-3-8 - location + pos-4-1 - location + pos-4-2 - location + pos-4-3 - location + pos-4-4 - location + pos-4-5 - location + pos-4-6 - location + pos-4-7 - location + pos-4-8 - location + pos-5-1 - location + pos-5-2 - location + pos-5-3 - location + pos-5-4 - location + pos-5-5 - location + pos-5-6 - location + pos-5-7 - location + pos-5-8 - location + pos-6-1 - location + pos-6-2 - location + pos-6-3 - location + pos-6-4 - location + pos-6-5 - location + pos-6-6 - location + pos-6-7 - location + pos-6-8 - location + pos-7-1 - location + pos-7-2 - location + pos-7-3 - location + pos-7-4 - location + pos-7-5 - location + pos-7-6 - location + pos-7-7 - location + pos-7-8 - location + pos-8-1 - location + pos-8-2 - location + pos-8-3 - location + pos-8-4 - location + pos-8-5 - location + pos-8-6 - location + pos-8-7 - location + pos-8-8 - location + pos-9-1 - location + pos-9-2 - location + pos-9-3 - location + pos-9-4 - location + pos-9-5 - location + pos-9-6 - location + pos-9-7 - location + pos-9-8 - location + stone-01 - stone + stone-02 - stone + stone-03 - stone + ) + (:init + (IS-GOAL pos-4-5) + (IS-GOAL pos-5-5) + (IS-GOAL pos-6-5) + (IS-NONGOAL pos-1-1) + (IS-NONGOAL pos-1-2) + (IS-NONGOAL pos-1-3) + (IS-NONGOAL pos-1-4) + (IS-NONGOAL pos-1-5) + (IS-NONGOAL pos-1-6) + (IS-NONGOAL pos-1-7) + (IS-NONGOAL pos-1-8) + (IS-NONGOAL pos-2-1) + (IS-NONGOAL pos-2-2) + (IS-NONGOAL pos-2-3) + (IS-NONGOAL pos-2-4) + (IS-NONGOAL pos-2-5) + (IS-NONGOAL pos-2-6) + (IS-NONGOAL pos-2-7) + (IS-NONGOAL pos-2-8) + (IS-NONGOAL pos-3-1) + (IS-NONGOAL pos-3-2) + (IS-NONGOAL pos-3-3) + (IS-NONGOAL pos-3-4) + (IS-NONGOAL pos-3-5) + (IS-NONGOAL pos-3-6) + (IS-NONGOAL pos-3-7) + (IS-NONGOAL pos-3-8) + (IS-NONGOAL pos-4-1) + (IS-NONGOAL pos-4-2) + (IS-NONGOAL pos-4-3) + (IS-NONGOAL pos-4-4) + (IS-NONGOAL pos-4-6) + (IS-NONGOAL pos-4-7) + (IS-NONGOAL pos-4-8) + (IS-NONGOAL pos-5-1) + (IS-NONGOAL pos-5-2) + (IS-NONGOAL pos-5-3) + (IS-NONGOAL pos-5-4) + (IS-NONGOAL pos-5-6) + (IS-NONGOAL pos-5-7) + (IS-NONGOAL pos-5-8) + (IS-NONGOAL pos-6-1) + (IS-NONGOAL pos-6-2) + (IS-NONGOAL pos-6-3) + (IS-NONGOAL pos-6-4) + (IS-NONGOAL pos-6-6) + (IS-NONGOAL pos-6-7) + (IS-NONGOAL pos-6-8) + (IS-NONGOAL pos-7-1) + (IS-NONGOAL pos-7-2) + (IS-NONGOAL pos-7-3) + (IS-NONGOAL pos-7-4) + (IS-NONGOAL pos-7-5) + (IS-NONGOAL pos-7-6) + (IS-NONGOAL pos-7-7) + (IS-NONGOAL pos-7-8) + (IS-NONGOAL pos-8-1) + (IS-NONGOAL pos-8-2) + (IS-NONGOAL pos-8-3) + (IS-NONGOAL pos-8-4) + (IS-NONGOAL pos-8-5) + (IS-NONGOAL pos-8-6) + (IS-NONGOAL pos-8-7) + (IS-NONGOAL pos-8-8) + (IS-NONGOAL pos-9-1) + (IS-NONGOAL pos-9-2) + (IS-NONGOAL pos-9-3) + (IS-NONGOAL pos-9-4) + (IS-NONGOAL pos-9-5) + (IS-NONGOAL pos-9-6) + (IS-NONGOAL pos-9-7) + (IS-NONGOAL pos-9-8) + (MOVE-DIR pos-1-8 pos-2-8 dir-right) + (MOVE-DIR pos-2-2 pos-2-3 dir-down) + (MOVE-DIR pos-2-2 pos-3-2 dir-right) + (MOVE-DIR pos-2-3 pos-2-2 dir-up) + (MOVE-DIR pos-2-3 pos-3-3 dir-right) + (MOVE-DIR pos-2-5 pos-2-6 dir-down) + (MOVE-DIR pos-2-5 pos-3-5 dir-right) + (MOVE-DIR pos-2-6 pos-2-5 dir-up) + (MOVE-DIR pos-2-6 pos-3-6 dir-right) + (MOVE-DIR pos-2-8 pos-1-8 dir-left) + (MOVE-DIR pos-2-8 pos-3-8 dir-right) + (MOVE-DIR pos-3-2 pos-2-2 dir-left) + (MOVE-DIR pos-3-2 pos-3-3 dir-down) + (MOVE-DIR pos-3-2 pos-4-2 dir-right) + (MOVE-DIR pos-3-3 pos-2-3 dir-left) + (MOVE-DIR pos-3-3 pos-3-2 dir-up) + (MOVE-DIR pos-3-3 pos-3-4 dir-down) + (MOVE-DIR pos-3-3 pos-4-3 dir-right) + (MOVE-DIR pos-3-4 pos-3-3 dir-up) + (MOVE-DIR pos-3-4 pos-3-5 dir-down) + (MOVE-DIR pos-3-5 pos-2-5 dir-left) + (MOVE-DIR pos-3-5 pos-3-4 dir-up) + (MOVE-DIR pos-3-5 pos-3-6 dir-down) + (MOVE-DIR pos-3-5 pos-4-5 dir-right) + (MOVE-DIR pos-3-6 pos-2-6 dir-left) + (MOVE-DIR pos-3-6 pos-3-5 dir-up) + (MOVE-DIR pos-3-6 pos-4-6 dir-right) + (MOVE-DIR pos-3-8 pos-2-8 dir-left) + (MOVE-DIR pos-3-8 pos-4-8 dir-right) + (MOVE-DIR pos-4-2 pos-3-2 dir-left) + (MOVE-DIR pos-4-2 pos-4-3 dir-down) + (MOVE-DIR pos-4-3 pos-3-3 dir-left) + (MOVE-DIR pos-4-3 pos-4-2 dir-up) + (MOVE-DIR pos-4-3 pos-5-3 dir-right) + (MOVE-DIR pos-4-5 pos-3-5 dir-left) + (MOVE-DIR pos-4-5 pos-4-6 dir-down) + (MOVE-DIR pos-4-5 pos-5-5 dir-right) + (MOVE-DIR pos-4-6 pos-3-6 dir-left) + (MOVE-DIR pos-4-6 pos-4-5 dir-up) + (MOVE-DIR pos-4-8 pos-3-8 dir-left) + (MOVE-DIR pos-4-8 pos-5-8 dir-right) + (MOVE-DIR pos-5-3 pos-4-3 dir-left) + (MOVE-DIR pos-5-3 pos-6-3 dir-right) + (MOVE-DIR pos-5-5 pos-4-5 dir-left) + (MOVE-DIR pos-5-5 pos-6-5 dir-right) + (MOVE-DIR pos-5-8 pos-4-8 dir-left) + (MOVE-DIR pos-6-2 pos-6-3 dir-down) + (MOVE-DIR pos-6-2 pos-7-2 dir-right) + (MOVE-DIR pos-6-3 pos-5-3 dir-left) + (MOVE-DIR pos-6-3 pos-6-2 dir-up) + (MOVE-DIR pos-6-3 pos-7-3 dir-right) + (MOVE-DIR pos-6-5 pos-5-5 dir-left) + (MOVE-DIR pos-6-5 pos-6-6 dir-down) + (MOVE-DIR pos-6-5 pos-7-5 dir-right) + (MOVE-DIR pos-6-6 pos-6-5 dir-up) + (MOVE-DIR pos-6-6 pos-7-6 dir-right) + (MOVE-DIR pos-7-2 pos-6-2 dir-left) + (MOVE-DIR pos-7-2 pos-7-3 dir-down) + (MOVE-DIR pos-7-2 pos-8-2 dir-right) + (MOVE-DIR pos-7-3 pos-6-3 dir-left) + (MOVE-DIR pos-7-3 pos-7-2 dir-up) + (MOVE-DIR pos-7-3 pos-7-4 dir-down) + (MOVE-DIR pos-7-3 pos-8-3 dir-right) + (MOVE-DIR pos-7-4 pos-7-3 dir-up) + (MOVE-DIR pos-7-4 pos-7-5 dir-down) + (MOVE-DIR pos-7-5 pos-6-5 dir-left) + (MOVE-DIR pos-7-5 pos-7-4 dir-up) + (MOVE-DIR pos-7-5 pos-7-6 dir-down) + (MOVE-DIR pos-7-5 pos-8-5 dir-right) + (MOVE-DIR pos-7-6 pos-6-6 dir-left) + (MOVE-DIR pos-7-6 pos-7-5 dir-up) + (MOVE-DIR pos-7-6 pos-7-7 dir-down) + (MOVE-DIR pos-7-6 pos-8-6 dir-right) + (MOVE-DIR pos-7-7 pos-7-6 dir-up) + (MOVE-DIR pos-7-7 pos-8-7 dir-right) + (MOVE-DIR pos-8-2 pos-7-2 dir-left) + (MOVE-DIR pos-8-2 pos-8-3 dir-down) + (MOVE-DIR pos-8-3 pos-7-3 dir-left) + (MOVE-DIR pos-8-3 pos-8-2 dir-up) + (MOVE-DIR pos-8-5 pos-7-5 dir-left) + (MOVE-DIR pos-8-5 pos-8-6 dir-down) + (MOVE-DIR pos-8-6 pos-7-6 dir-left) + (MOVE-DIR pos-8-6 pos-8-5 dir-up) + (MOVE-DIR pos-8-6 pos-8-7 dir-down) + (MOVE-DIR pos-8-7 pos-7-7 dir-left) + (MOVE-DIR pos-8-7 pos-8-6 dir-up) + (at player-01 pos-3-2) + (at stone-01 pos-3-3) + (at stone-02 pos-5-3) + (at stone-03 pos-3-4) + (clear pos-1-8) + (clear pos-2-2) + (clear pos-2-3) + (clear pos-2-5) + (clear pos-2-6) + (clear pos-2-8) + (clear pos-3-5) + (clear pos-3-6) + (clear pos-3-8) + (clear pos-4-2) + (clear pos-4-3) + (clear pos-4-5) + (clear pos-4-6) + (clear pos-4-8) + (clear pos-5-5) + (clear pos-5-8) + (clear pos-6-2) + (clear pos-6-3) + (clear pos-6-5) + (clear pos-6-6) + (clear pos-7-2) + (clear pos-7-3) + (clear pos-7-4) + (clear pos-7-5) + (clear pos-7-6) + (clear pos-7-7) + (clear pos-8-2) + (clear pos-8-3) + (clear pos-8-5) + (clear pos-8-6) + (clear pos-8-7) + (= (total-cost) 0) + ) + (:goal (and + (at-goal stone-01) + (at-goal stone-02) + (at-goal stone-03) + )) + (:metric minimize (total-cost)) +) diff --git a/tests/fixtures/pddl_files/sokoban-sequential-optimal/p04.pddl b/tests/fixtures/pddl_files/sokoban-sequential-optimal/p04.pddl new file mode 100644 index 00000000..58bb7475 --- /dev/null +++ b/tests/fixtures/pddl_files/sokoban-sequential-optimal/p04.pddl @@ -0,0 +1,297 @@ +;; ###### ##### +;; # ### # +;; # $$ #@# +;; # $ #... # +;; # ######## +;; ##### + +(define (problem p006-microban-sequential) + (:domain sokoban-sequential) + (:objects + dir-down - direction + dir-left - direction + dir-right - direction + dir-up - direction + player-01 - player + pos-01-01 - location + pos-01-02 - location + pos-01-03 - location + pos-01-04 - location + pos-01-05 - location + pos-01-06 - location + pos-02-01 - location + pos-02-02 - location + pos-02-03 - location + pos-02-04 - location + pos-02-05 - location + pos-02-06 - location + pos-03-01 - location + pos-03-02 - location + pos-03-03 - location + pos-03-04 - location + pos-03-05 - location + pos-03-06 - location + pos-04-01 - location + pos-04-02 - location + pos-04-03 - location + pos-04-04 - location + pos-04-05 - location + pos-04-06 - location + pos-05-01 - location + pos-05-02 - location + pos-05-03 - location + pos-05-04 - location + pos-05-05 - location + pos-05-06 - location + pos-06-01 - location + pos-06-02 - location + pos-06-03 - location + pos-06-04 - location + pos-06-05 - location + pos-06-06 - location + pos-07-01 - location + pos-07-02 - location + pos-07-03 - location + pos-07-04 - location + pos-07-05 - location + pos-07-06 - location + pos-08-01 - location + pos-08-02 - location + pos-08-03 - location + pos-08-04 - location + pos-08-05 - location + pos-08-06 - location + pos-09-01 - location + pos-09-02 - location + pos-09-03 - location + pos-09-04 - location + pos-09-05 - location + pos-09-06 - location + pos-10-01 - location + pos-10-02 - location + pos-10-03 - location + pos-10-04 - location + pos-10-05 - location + pos-10-06 - location + pos-11-01 - location + pos-11-02 - location + pos-11-03 - location + pos-11-04 - location + pos-11-05 - location + pos-11-06 - location + pos-12-01 - location + pos-12-02 - location + pos-12-03 - location + pos-12-04 - location + pos-12-05 - location + pos-12-06 - location + stone-01 - stone + stone-02 - stone + stone-03 - stone + ) + (:init + (IS-GOAL pos-06-04) + (IS-GOAL pos-07-04) + (IS-GOAL pos-08-04) + (IS-NONGOAL pos-01-01) + (IS-NONGOAL pos-01-02) + (IS-NONGOAL pos-01-03) + (IS-NONGOAL pos-01-04) + (IS-NONGOAL pos-01-05) + (IS-NONGOAL pos-01-06) + (IS-NONGOAL pos-02-01) + (IS-NONGOAL pos-02-02) + (IS-NONGOAL pos-02-03) + (IS-NONGOAL pos-02-04) + (IS-NONGOAL pos-02-05) + (IS-NONGOAL pos-02-06) + (IS-NONGOAL pos-03-01) + (IS-NONGOAL pos-03-02) + (IS-NONGOAL pos-03-03) + (IS-NONGOAL pos-03-04) + (IS-NONGOAL pos-03-05) + (IS-NONGOAL pos-03-06) + (IS-NONGOAL pos-04-01) + (IS-NONGOAL pos-04-02) + (IS-NONGOAL pos-04-03) + (IS-NONGOAL pos-04-04) + (IS-NONGOAL pos-04-05) + (IS-NONGOAL pos-04-06) + (IS-NONGOAL pos-05-01) + (IS-NONGOAL pos-05-02) + (IS-NONGOAL pos-05-03) + (IS-NONGOAL pos-05-04) + (IS-NONGOAL pos-05-05) + (IS-NONGOAL pos-05-06) + (IS-NONGOAL pos-06-01) + (IS-NONGOAL pos-06-02) + (IS-NONGOAL pos-06-03) + (IS-NONGOAL pos-06-05) + (IS-NONGOAL pos-06-06) + (IS-NONGOAL pos-07-01) + (IS-NONGOAL pos-07-02) + (IS-NONGOAL pos-07-03) + (IS-NONGOAL pos-07-05) + (IS-NONGOAL pos-07-06) + (IS-NONGOAL pos-08-01) + (IS-NONGOAL pos-08-02) + (IS-NONGOAL pos-08-03) + (IS-NONGOAL pos-08-05) + (IS-NONGOAL pos-08-06) + (IS-NONGOAL pos-09-01) + (IS-NONGOAL pos-09-02) + (IS-NONGOAL pos-09-03) + (IS-NONGOAL pos-09-04) + (IS-NONGOAL pos-09-05) + (IS-NONGOAL pos-09-06) + (IS-NONGOAL pos-10-01) + (IS-NONGOAL pos-10-02) + (IS-NONGOAL pos-10-03) + (IS-NONGOAL pos-10-04) + (IS-NONGOAL pos-10-05) + (IS-NONGOAL pos-10-06) + (IS-NONGOAL pos-11-01) + (IS-NONGOAL pos-11-02) + (IS-NONGOAL pos-11-03) + (IS-NONGOAL pos-11-04) + (IS-NONGOAL pos-11-05) + (IS-NONGOAL pos-11-06) + (IS-NONGOAL pos-12-01) + (IS-NONGOAL pos-12-02) + (IS-NONGOAL pos-12-03) + (IS-NONGOAL pos-12-04) + (IS-NONGOAL pos-12-05) + (IS-NONGOAL pos-12-06) + (MOVE-DIR pos-02-02 pos-02-03 dir-down) + (MOVE-DIR pos-02-02 pos-03-02 dir-right) + (MOVE-DIR pos-02-03 pos-02-02 dir-up) + (MOVE-DIR pos-02-03 pos-02-04 dir-down) + (MOVE-DIR pos-02-03 pos-03-03 dir-right) + (MOVE-DIR pos-02-04 pos-02-03 dir-up) + (MOVE-DIR pos-02-04 pos-02-05 dir-down) + (MOVE-DIR pos-02-04 pos-03-04 dir-right) + (MOVE-DIR pos-02-05 pos-02-04 dir-up) + (MOVE-DIR pos-02-05 pos-03-05 dir-right) + (MOVE-DIR pos-03-02 pos-02-02 dir-left) + (MOVE-DIR pos-03-02 pos-03-03 dir-down) + (MOVE-DIR pos-03-02 pos-04-02 dir-right) + (MOVE-DIR pos-03-03 pos-02-03 dir-left) + (MOVE-DIR pos-03-03 pos-03-02 dir-up) + (MOVE-DIR pos-03-03 pos-03-04 dir-down) + (MOVE-DIR pos-03-03 pos-04-03 dir-right) + (MOVE-DIR pos-03-04 pos-02-04 dir-left) + (MOVE-DIR pos-03-04 pos-03-03 dir-up) + (MOVE-DIR pos-03-04 pos-03-05 dir-down) + (MOVE-DIR pos-03-04 pos-04-04 dir-right) + (MOVE-DIR pos-03-05 pos-02-05 dir-left) + (MOVE-DIR pos-03-05 pos-03-04 dir-up) + (MOVE-DIR pos-03-05 pos-04-05 dir-right) + (MOVE-DIR pos-04-02 pos-03-02 dir-left) + (MOVE-DIR pos-04-02 pos-04-03 dir-down) + (MOVE-DIR pos-04-02 pos-05-02 dir-right) + (MOVE-DIR pos-04-03 pos-03-03 dir-left) + (MOVE-DIR pos-04-03 pos-04-02 dir-up) + (MOVE-DIR pos-04-03 pos-04-04 dir-down) + (MOVE-DIR pos-04-03 pos-05-03 dir-right) + (MOVE-DIR pos-04-04 pos-03-04 dir-left) + (MOVE-DIR pos-04-04 pos-04-03 dir-up) + (MOVE-DIR pos-04-04 pos-04-05 dir-down) + (MOVE-DIR pos-04-05 pos-03-05 dir-left) + (MOVE-DIR pos-04-05 pos-04-04 dir-up) + (MOVE-DIR pos-05-02 pos-04-02 dir-left) + (MOVE-DIR pos-05-02 pos-05-03 dir-down) + (MOVE-DIR pos-05-03 pos-04-03 dir-left) + (MOVE-DIR pos-05-03 pos-05-02 dir-up) + (MOVE-DIR pos-05-03 pos-06-03 dir-right) + (MOVE-DIR pos-06-03 pos-05-03 dir-left) + (MOVE-DIR pos-06-03 pos-06-04 dir-down) + (MOVE-DIR pos-06-03 pos-07-03 dir-right) + (MOVE-DIR pos-06-04 pos-06-03 dir-up) + (MOVE-DIR pos-06-04 pos-07-04 dir-right) + (MOVE-DIR pos-06-06 pos-07-06 dir-right) + (MOVE-DIR pos-07-03 pos-06-03 dir-left) + (MOVE-DIR pos-07-03 pos-07-04 dir-down) + (MOVE-DIR pos-07-03 pos-08-03 dir-right) + (MOVE-DIR pos-07-04 pos-06-04 dir-left) + (MOVE-DIR pos-07-04 pos-07-03 dir-up) + (MOVE-DIR pos-07-04 pos-08-04 dir-right) + (MOVE-DIR pos-07-06 pos-06-06 dir-left) + (MOVE-DIR pos-07-06 pos-08-06 dir-right) + (MOVE-DIR pos-08-03 pos-07-03 dir-left) + (MOVE-DIR pos-08-03 pos-08-04 dir-down) + (MOVE-DIR pos-08-03 pos-09-03 dir-right) + (MOVE-DIR pos-08-04 pos-07-04 dir-left) + (MOVE-DIR pos-08-04 pos-08-03 dir-up) + (MOVE-DIR pos-08-04 pos-09-04 dir-right) + (MOVE-DIR pos-08-06 pos-07-06 dir-left) + (MOVE-DIR pos-08-06 pos-09-06 dir-right) + (MOVE-DIR pos-09-02 pos-09-03 dir-down) + (MOVE-DIR pos-09-02 pos-10-02 dir-right) + (MOVE-DIR pos-09-03 pos-08-03 dir-left) + (MOVE-DIR pos-09-03 pos-09-02 dir-up) + (MOVE-DIR pos-09-03 pos-09-04 dir-down) + (MOVE-DIR pos-09-04 pos-08-04 dir-left) + (MOVE-DIR pos-09-04 pos-09-03 dir-up) + (MOVE-DIR pos-09-04 pos-10-04 dir-right) + (MOVE-DIR pos-09-06 pos-08-06 dir-left) + (MOVE-DIR pos-09-06 pos-10-06 dir-right) + (MOVE-DIR pos-10-02 pos-09-02 dir-left) + (MOVE-DIR pos-10-02 pos-11-02 dir-right) + (MOVE-DIR pos-10-04 pos-09-04 dir-left) + (MOVE-DIR pos-10-04 pos-11-04 dir-right) + (MOVE-DIR pos-10-06 pos-09-06 dir-left) + (MOVE-DIR pos-10-06 pos-11-06 dir-right) + (MOVE-DIR pos-11-02 pos-10-02 dir-left) + (MOVE-DIR pos-11-02 pos-11-03 dir-down) + (MOVE-DIR pos-11-03 pos-11-02 dir-up) + (MOVE-DIR pos-11-03 pos-11-04 dir-down) + (MOVE-DIR pos-11-04 pos-10-04 dir-left) + (MOVE-DIR pos-11-04 pos-11-03 dir-up) + (MOVE-DIR pos-11-06 pos-10-06 dir-left) + (MOVE-DIR pos-11-06 pos-12-06 dir-right) + (MOVE-DIR pos-12-06 pos-11-06 dir-left) + (at player-01 pos-11-03) + (at stone-01 pos-03-03) + (at stone-02 pos-04-03) + (at stone-03 pos-03-04) + (clear pos-02-02) + (clear pos-02-03) + (clear pos-02-04) + (clear pos-02-05) + (clear pos-03-02) + (clear pos-03-05) + (clear pos-04-02) + (clear pos-04-04) + (clear pos-04-05) + (clear pos-05-02) + (clear pos-05-03) + (clear pos-06-03) + (clear pos-06-04) + (clear pos-06-06) + (clear pos-07-01) + (clear pos-07-03) + (clear pos-07-04) + (clear pos-07-06) + (clear pos-08-03) + (clear pos-08-04) + (clear pos-08-06) + (clear pos-09-02) + (clear pos-09-03) + (clear pos-09-04) + (clear pos-09-06) + (clear pos-10-02) + (clear pos-10-04) + (clear pos-10-06) + (clear pos-11-02) + (clear pos-11-04) + (clear pos-11-06) + (clear pos-12-06) + (= (total-cost) 0) + ) + (:goal (and + (at-goal stone-01) + (at-goal stone-02) + (at-goal stone-03) + )) + (:metric minimize (total-cost)) +) diff --git a/tests/fixtures/pddl_files/sokoban-sequential-optimal/p05.pddl b/tests/fixtures/pddl_files/sokoban-sequential-optimal/p05.pddl new file mode 100644 index 00000000..835e81a7 --- /dev/null +++ b/tests/fixtures/pddl_files/sokoban-sequential-optimal/p05.pddl @@ -0,0 +1,534 @@ +;; 'reduction of (Mas Sasquatch 8)' +;; +;; ##### +;; ######## # +;; #. . @#.# +;; # ### # +;; ## $ # # +;; # $ ##### +;; # $# # +;; ## # # +;; # ## +;; ##### + +(define (problem p147-microban-sequential) + (:domain sokoban-sequential) + (:objects + dir-down - direction + dir-left - direction + dir-right - direction + dir-up - direction + player-01 - player + pos-01-01 - location + pos-01-02 - location + pos-01-03 - location + pos-01-04 - location + pos-01-05 - location + pos-01-06 - location + pos-01-07 - location + pos-01-08 - location + pos-01-09 - location + pos-01-10 - location + pos-02-01 - location + pos-02-02 - location + pos-02-03 - location + pos-02-04 - location + pos-02-05 - location + pos-02-06 - location + pos-02-07 - location + pos-02-08 - location + pos-02-09 - location + pos-02-10 - location + pos-03-01 - location + pos-03-02 - location + pos-03-03 - location + pos-03-04 - location + pos-03-05 - location + pos-03-06 - location + pos-03-07 - location + pos-03-08 - location + pos-03-09 - location + pos-03-10 - location + pos-04-01 - location + pos-04-02 - location + pos-04-03 - location + pos-04-04 - location + pos-04-05 - location + pos-04-06 - location + pos-04-07 - location + pos-04-08 - location + pos-04-09 - location + pos-04-10 - location + pos-05-01 - location + pos-05-02 - location + pos-05-03 - location + pos-05-04 - location + pos-05-05 - location + pos-05-06 - location + pos-05-07 - location + pos-05-08 - location + pos-05-09 - location + pos-05-10 - location + pos-06-01 - location + pos-06-02 - location + pos-06-03 - location + pos-06-04 - location + pos-06-05 - location + pos-06-06 - location + pos-06-07 - location + pos-06-08 - location + pos-06-09 - location + pos-06-10 - location + pos-07-01 - location + pos-07-02 - location + pos-07-03 - location + pos-07-04 - location + pos-07-05 - location + pos-07-06 - location + pos-07-07 - location + pos-07-08 - location + pos-07-09 - location + pos-07-10 - location + pos-08-01 - location + pos-08-02 - location + pos-08-03 - location + pos-08-04 - location + pos-08-05 - location + pos-08-06 - location + pos-08-07 - location + pos-08-08 - location + pos-08-09 - location + pos-08-10 - location + pos-09-01 - location + pos-09-02 - location + pos-09-03 - location + pos-09-04 - location + pos-09-05 - location + pos-09-06 - location + pos-09-07 - location + pos-09-08 - location + pos-09-09 - location + pos-09-10 - location + pos-10-01 - location + pos-10-02 - location + pos-10-03 - location + pos-10-04 - location + pos-10-05 - location + pos-10-06 - location + pos-10-07 - location + pos-10-08 - location + pos-10-09 - location + pos-10-10 - location + pos-11-01 - location + pos-11-02 - location + pos-11-03 - location + pos-11-04 - location + pos-11-05 - location + pos-11-06 - location + pos-11-07 - location + pos-11-08 - location + pos-11-09 - location + pos-11-10 - location + pos-12-01 - location + pos-12-02 - location + pos-12-03 - location + pos-12-04 - location + pos-12-05 - location + pos-12-06 - location + pos-12-07 - location + pos-12-08 - location + pos-12-09 - location + pos-12-10 - location + stone-01 - stone + stone-02 - stone + stone-03 - stone + ) + (:init + (IS-GOAL pos-02-03) + (IS-GOAL pos-06-03) + (IS-GOAL pos-11-03) + (IS-NONGOAL pos-01-01) + (IS-NONGOAL pos-01-02) + (IS-NONGOAL pos-01-03) + (IS-NONGOAL pos-01-04) + (IS-NONGOAL pos-01-05) + (IS-NONGOAL pos-01-06) + (IS-NONGOAL pos-01-07) + (IS-NONGOAL pos-01-08) + (IS-NONGOAL pos-01-09) + (IS-NONGOAL pos-01-10) + (IS-NONGOAL pos-02-01) + (IS-NONGOAL pos-02-02) + (IS-NONGOAL pos-02-04) + (IS-NONGOAL pos-02-05) + (IS-NONGOAL pos-02-06) + (IS-NONGOAL pos-02-07) + (IS-NONGOAL pos-02-08) + (IS-NONGOAL pos-02-09) + (IS-NONGOAL pos-02-10) + (IS-NONGOAL pos-03-01) + (IS-NONGOAL pos-03-02) + (IS-NONGOAL pos-03-03) + (IS-NONGOAL pos-03-04) + (IS-NONGOAL pos-03-05) + (IS-NONGOAL pos-03-06) + (IS-NONGOAL pos-03-07) + (IS-NONGOAL pos-03-08) + (IS-NONGOAL pos-03-09) + (IS-NONGOAL pos-03-10) + (IS-NONGOAL pos-04-01) + (IS-NONGOAL pos-04-02) + (IS-NONGOAL pos-04-03) + (IS-NONGOAL pos-04-04) + (IS-NONGOAL pos-04-05) + (IS-NONGOAL pos-04-06) + (IS-NONGOAL pos-04-07) + (IS-NONGOAL pos-04-08) + (IS-NONGOAL pos-04-09) + (IS-NONGOAL pos-04-10) + (IS-NONGOAL pos-05-01) + (IS-NONGOAL pos-05-02) + (IS-NONGOAL pos-05-03) + (IS-NONGOAL pos-05-04) + (IS-NONGOAL pos-05-05) + (IS-NONGOAL pos-05-06) + (IS-NONGOAL pos-05-07) + (IS-NONGOAL pos-05-08) + (IS-NONGOAL pos-05-09) + (IS-NONGOAL pos-05-10) + (IS-NONGOAL pos-06-01) + (IS-NONGOAL pos-06-02) + (IS-NONGOAL pos-06-04) + (IS-NONGOAL pos-06-05) + (IS-NONGOAL pos-06-06) + (IS-NONGOAL pos-06-07) + (IS-NONGOAL pos-06-08) + (IS-NONGOAL pos-06-09) + (IS-NONGOAL pos-06-10) + (IS-NONGOAL pos-07-01) + (IS-NONGOAL pos-07-02) + (IS-NONGOAL pos-07-03) + (IS-NONGOAL pos-07-04) + (IS-NONGOAL pos-07-05) + (IS-NONGOAL pos-07-06) + (IS-NONGOAL pos-07-07) + (IS-NONGOAL pos-07-08) + (IS-NONGOAL pos-07-09) + (IS-NONGOAL pos-07-10) + (IS-NONGOAL pos-08-01) + (IS-NONGOAL pos-08-02) + (IS-NONGOAL pos-08-03) + (IS-NONGOAL pos-08-04) + (IS-NONGOAL pos-08-05) + (IS-NONGOAL pos-08-06) + (IS-NONGOAL pos-08-07) + (IS-NONGOAL pos-08-08) + (IS-NONGOAL pos-08-09) + (IS-NONGOAL pos-08-10) + (IS-NONGOAL pos-09-01) + (IS-NONGOAL pos-09-02) + (IS-NONGOAL pos-09-03) + (IS-NONGOAL pos-09-04) + (IS-NONGOAL pos-09-05) + (IS-NONGOAL pos-09-06) + (IS-NONGOAL pos-09-07) + (IS-NONGOAL pos-09-08) + (IS-NONGOAL pos-09-09) + (IS-NONGOAL pos-09-10) + (IS-NONGOAL pos-10-01) + (IS-NONGOAL pos-10-02) + (IS-NONGOAL pos-10-03) + (IS-NONGOAL pos-10-04) + (IS-NONGOAL pos-10-05) + (IS-NONGOAL pos-10-06) + (IS-NONGOAL pos-10-07) + (IS-NONGOAL pos-10-08) + (IS-NONGOAL pos-10-09) + (IS-NONGOAL pos-10-10) + (IS-NONGOAL pos-11-01) + (IS-NONGOAL pos-11-02) + (IS-NONGOAL pos-11-04) + (IS-NONGOAL pos-11-05) + (IS-NONGOAL pos-11-06) + (IS-NONGOAL pos-11-07) + (IS-NONGOAL pos-11-08) + (IS-NONGOAL pos-11-09) + (IS-NONGOAL pos-11-10) + (IS-NONGOAL pos-12-01) + (IS-NONGOAL pos-12-02) + (IS-NONGOAL pos-12-03) + (IS-NONGOAL pos-12-04) + (IS-NONGOAL pos-12-05) + (IS-NONGOAL pos-12-06) + (IS-NONGOAL pos-12-07) + (IS-NONGOAL pos-12-08) + (IS-NONGOAL pos-12-09) + (IS-NONGOAL pos-12-10) + (MOVE-DIR pos-01-01 pos-02-01 dir-right) + (MOVE-DIR pos-01-06 pos-01-07 dir-down) + (MOVE-DIR pos-01-07 pos-01-06 dir-up) + (MOVE-DIR pos-01-07 pos-01-08 dir-down) + (MOVE-DIR pos-01-08 pos-01-07 dir-up) + (MOVE-DIR pos-01-08 pos-01-09 dir-down) + (MOVE-DIR pos-01-09 pos-01-08 dir-up) + (MOVE-DIR pos-01-09 pos-01-10 dir-down) + (MOVE-DIR pos-01-09 pos-02-09 dir-right) + (MOVE-DIR pos-01-10 pos-01-09 dir-up) + (MOVE-DIR pos-01-10 pos-02-10 dir-right) + (MOVE-DIR pos-02-01 pos-01-01 dir-left) + (MOVE-DIR pos-02-01 pos-03-01 dir-right) + (MOVE-DIR pos-02-03 pos-02-04 dir-down) + (MOVE-DIR pos-02-03 pos-03-03 dir-right) + (MOVE-DIR pos-02-04 pos-02-03 dir-up) + (MOVE-DIR pos-02-04 pos-03-04 dir-right) + (MOVE-DIR pos-02-09 pos-01-09 dir-left) + (MOVE-DIR pos-02-09 pos-02-10 dir-down) + (MOVE-DIR pos-02-10 pos-01-10 dir-left) + (MOVE-DIR pos-02-10 pos-02-09 dir-up) + (MOVE-DIR pos-03-01 pos-02-01 dir-left) + (MOVE-DIR pos-03-01 pos-04-01 dir-right) + (MOVE-DIR pos-03-03 pos-02-03 dir-left) + (MOVE-DIR pos-03-03 pos-03-04 dir-down) + (MOVE-DIR pos-03-03 pos-04-03 dir-right) + (MOVE-DIR pos-03-04 pos-02-04 dir-left) + (MOVE-DIR pos-03-04 pos-03-03 dir-up) + (MOVE-DIR pos-03-04 pos-03-05 dir-down) + (MOVE-DIR pos-03-05 pos-03-04 dir-up) + (MOVE-DIR pos-03-05 pos-03-06 dir-down) + (MOVE-DIR pos-03-05 pos-04-05 dir-right) + (MOVE-DIR pos-03-06 pos-03-05 dir-up) + (MOVE-DIR pos-03-06 pos-03-07 dir-down) + (MOVE-DIR pos-03-06 pos-04-06 dir-right) + (MOVE-DIR pos-03-07 pos-03-06 dir-up) + (MOVE-DIR pos-03-07 pos-04-07 dir-right) + (MOVE-DIR pos-04-01 pos-03-01 dir-left) + (MOVE-DIR pos-04-01 pos-05-01 dir-right) + (MOVE-DIR pos-04-03 pos-03-03 dir-left) + (MOVE-DIR pos-04-03 pos-05-03 dir-right) + (MOVE-DIR pos-04-05 pos-03-05 dir-left) + (MOVE-DIR pos-04-05 pos-04-06 dir-down) + (MOVE-DIR pos-04-05 pos-05-05 dir-right) + (MOVE-DIR pos-04-06 pos-03-06 dir-left) + (MOVE-DIR pos-04-06 pos-04-05 dir-up) + (MOVE-DIR pos-04-06 pos-04-07 dir-down) + (MOVE-DIR pos-04-06 pos-05-06 dir-right) + (MOVE-DIR pos-04-07 pos-03-07 dir-left) + (MOVE-DIR pos-04-07 pos-04-06 dir-up) + (MOVE-DIR pos-04-07 pos-04-08 dir-down) + (MOVE-DIR pos-04-08 pos-04-07 dir-up) + (MOVE-DIR pos-04-08 pos-04-09 dir-down) + (MOVE-DIR pos-04-09 pos-04-08 dir-up) + (MOVE-DIR pos-04-09 pos-05-09 dir-right) + (MOVE-DIR pos-05-01 pos-04-01 dir-left) + (MOVE-DIR pos-05-01 pos-06-01 dir-right) + (MOVE-DIR pos-05-03 pos-04-03 dir-left) + (MOVE-DIR pos-05-03 pos-06-03 dir-right) + (MOVE-DIR pos-05-05 pos-04-05 dir-left) + (MOVE-DIR pos-05-05 pos-05-06 dir-down) + (MOVE-DIR pos-05-05 pos-06-05 dir-right) + (MOVE-DIR pos-05-06 pos-04-06 dir-left) + (MOVE-DIR pos-05-06 pos-05-05 dir-up) + (MOVE-DIR pos-05-06 pos-06-06 dir-right) + (MOVE-DIR pos-05-09 pos-04-09 dir-left) + (MOVE-DIR pos-05-09 pos-06-09 dir-right) + (MOVE-DIR pos-06-01 pos-05-01 dir-left) + (MOVE-DIR pos-06-01 pos-07-01 dir-right) + (MOVE-DIR pos-06-03 pos-05-03 dir-left) + (MOVE-DIR pos-06-03 pos-07-03 dir-right) + (MOVE-DIR pos-06-05 pos-05-05 dir-left) + (MOVE-DIR pos-06-05 pos-06-06 dir-down) + (MOVE-DIR pos-06-06 pos-05-06 dir-left) + (MOVE-DIR pos-06-06 pos-06-05 dir-up) + (MOVE-DIR pos-06-06 pos-06-07 dir-down) + (MOVE-DIR pos-06-06 pos-07-06 dir-right) + (MOVE-DIR pos-06-07 pos-06-06 dir-up) + (MOVE-DIR pos-06-07 pos-06-08 dir-down) + (MOVE-DIR pos-06-07 pos-07-07 dir-right) + (MOVE-DIR pos-06-08 pos-06-07 dir-up) + (MOVE-DIR pos-06-08 pos-06-09 dir-down) + (MOVE-DIR pos-06-08 pos-07-08 dir-right) + (MOVE-DIR pos-06-09 pos-05-09 dir-left) + (MOVE-DIR pos-06-09 pos-06-08 dir-up) + (MOVE-DIR pos-07-01 pos-06-01 dir-left) + (MOVE-DIR pos-07-03 pos-06-03 dir-left) + (MOVE-DIR pos-07-03 pos-07-04 dir-down) + (MOVE-DIR pos-07-03 pos-08-03 dir-right) + (MOVE-DIR pos-07-04 pos-07-03 dir-up) + (MOVE-DIR pos-07-04 pos-08-04 dir-right) + (MOVE-DIR pos-07-06 pos-06-06 dir-left) + (MOVE-DIR pos-07-06 pos-07-07 dir-down) + (MOVE-DIR pos-07-07 pos-06-07 dir-left) + (MOVE-DIR pos-07-07 pos-07-06 dir-up) + (MOVE-DIR pos-07-07 pos-07-08 dir-down) + (MOVE-DIR pos-07-08 pos-06-08 dir-left) + (MOVE-DIR pos-07-08 pos-07-07 dir-up) + (MOVE-DIR pos-08-03 pos-07-03 dir-left) + (MOVE-DIR pos-08-03 pos-08-04 dir-down) + (MOVE-DIR pos-08-03 pos-09-03 dir-right) + (MOVE-DIR pos-08-04 pos-07-04 dir-left) + (MOVE-DIR pos-08-04 pos-08-03 dir-up) + (MOVE-DIR pos-08-04 pos-08-05 dir-down) + (MOVE-DIR pos-08-04 pos-09-04 dir-right) + (MOVE-DIR pos-08-05 pos-08-04 dir-up) + (MOVE-DIR pos-08-05 pos-09-05 dir-right) + (MOVE-DIR pos-08-10 pos-09-10 dir-right) + (MOVE-DIR pos-09-02 pos-09-03 dir-down) + (MOVE-DIR pos-09-02 pos-10-02 dir-right) + (MOVE-DIR pos-09-03 pos-08-03 dir-left) + (MOVE-DIR pos-09-03 pos-09-02 dir-up) + (MOVE-DIR pos-09-03 pos-09-04 dir-down) + (MOVE-DIR pos-09-04 pos-08-04 dir-left) + (MOVE-DIR pos-09-04 pos-09-03 dir-up) + (MOVE-DIR pos-09-04 pos-09-05 dir-down) + (MOVE-DIR pos-09-04 pos-10-04 dir-right) + (MOVE-DIR pos-09-05 pos-08-05 dir-left) + (MOVE-DIR pos-09-05 pos-09-04 dir-up) + (MOVE-DIR pos-09-05 pos-10-05 dir-right) + (MOVE-DIR pos-09-07 pos-09-08 dir-down) + (MOVE-DIR pos-09-07 pos-10-07 dir-right) + (MOVE-DIR pos-09-08 pos-09-07 dir-up) + (MOVE-DIR pos-09-08 pos-09-09 dir-down) + (MOVE-DIR pos-09-08 pos-10-08 dir-right) + (MOVE-DIR pos-09-09 pos-09-08 dir-up) + (MOVE-DIR pos-09-09 pos-09-10 dir-down) + (MOVE-DIR pos-09-09 pos-10-09 dir-right) + (MOVE-DIR pos-09-10 pos-08-10 dir-left) + (MOVE-DIR pos-09-10 pos-09-09 dir-up) + (MOVE-DIR pos-09-10 pos-10-10 dir-right) + (MOVE-DIR pos-10-02 pos-09-02 dir-left) + (MOVE-DIR pos-10-02 pos-11-02 dir-right) + (MOVE-DIR pos-10-04 pos-09-04 dir-left) + (MOVE-DIR pos-10-04 pos-10-05 dir-down) + (MOVE-DIR pos-10-04 pos-11-04 dir-right) + (MOVE-DIR pos-10-05 pos-09-05 dir-left) + (MOVE-DIR pos-10-05 pos-10-04 dir-up) + (MOVE-DIR pos-10-05 pos-11-05 dir-right) + (MOVE-DIR pos-10-07 pos-09-07 dir-left) + (MOVE-DIR pos-10-07 pos-10-08 dir-down) + (MOVE-DIR pos-10-07 pos-11-07 dir-right) + (MOVE-DIR pos-10-08 pos-09-08 dir-left) + (MOVE-DIR pos-10-08 pos-10-07 dir-up) + (MOVE-DIR pos-10-08 pos-10-09 dir-down) + (MOVE-DIR pos-10-08 pos-11-08 dir-right) + (MOVE-DIR pos-10-09 pos-09-09 dir-left) + (MOVE-DIR pos-10-09 pos-10-08 dir-up) + (MOVE-DIR pos-10-09 pos-10-10 dir-down) + (MOVE-DIR pos-10-09 pos-11-09 dir-right) + (MOVE-DIR pos-10-10 pos-09-10 dir-left) + (MOVE-DIR pos-10-10 pos-10-09 dir-up) + (MOVE-DIR pos-10-10 pos-11-10 dir-right) + (MOVE-DIR pos-11-02 pos-10-02 dir-left) + (MOVE-DIR pos-11-02 pos-11-03 dir-down) + (MOVE-DIR pos-11-03 pos-11-02 dir-up) + (MOVE-DIR pos-11-03 pos-11-04 dir-down) + (MOVE-DIR pos-11-04 pos-10-04 dir-left) + (MOVE-DIR pos-11-04 pos-11-03 dir-up) + (MOVE-DIR pos-11-04 pos-11-05 dir-down) + (MOVE-DIR pos-11-05 pos-10-05 dir-left) + (MOVE-DIR pos-11-05 pos-11-04 dir-up) + (MOVE-DIR pos-11-07 pos-10-07 dir-left) + (MOVE-DIR pos-11-07 pos-11-08 dir-down) + (MOVE-DIR pos-11-07 pos-12-07 dir-right) + (MOVE-DIR pos-11-08 pos-10-08 dir-left) + (MOVE-DIR pos-11-08 pos-11-07 dir-up) + (MOVE-DIR pos-11-08 pos-11-09 dir-down) + (MOVE-DIR pos-11-08 pos-12-08 dir-right) + (MOVE-DIR pos-11-09 pos-10-09 dir-left) + (MOVE-DIR pos-11-09 pos-11-08 dir-up) + (MOVE-DIR pos-11-09 pos-11-10 dir-down) + (MOVE-DIR pos-11-09 pos-12-09 dir-right) + (MOVE-DIR pos-11-10 pos-10-10 dir-left) + (MOVE-DIR pos-11-10 pos-11-09 dir-up) + (MOVE-DIR pos-11-10 pos-12-10 dir-right) + (MOVE-DIR pos-12-07 pos-11-07 dir-left) + (MOVE-DIR pos-12-07 pos-12-08 dir-down) + (MOVE-DIR pos-12-08 pos-11-08 dir-left) + (MOVE-DIR pos-12-08 pos-12-07 dir-up) + (MOVE-DIR pos-12-08 pos-12-09 dir-down) + (MOVE-DIR pos-12-09 pos-11-09 dir-left) + (MOVE-DIR pos-12-09 pos-12-08 dir-up) + (MOVE-DIR pos-12-09 pos-12-10 dir-down) + (MOVE-DIR pos-12-10 pos-11-10 dir-left) + (MOVE-DIR pos-12-10 pos-12-09 dir-up) + (at player-01 pos-09-03) + (at stone-01 pos-04-05) + (at stone-02 pos-04-06) + (at stone-03 pos-04-07) + (clear pos-01-01) + (clear pos-01-06) + (clear pos-01-07) + (clear pos-01-08) + (clear pos-01-09) + (clear pos-01-10) + (clear pos-02-01) + (clear pos-02-03) + (clear pos-02-04) + (clear pos-02-09) + (clear pos-02-10) + (clear pos-03-01) + (clear pos-03-03) + (clear pos-03-04) + (clear pos-03-05) + (clear pos-03-06) + (clear pos-03-07) + (clear pos-04-01) + (clear pos-04-03) + (clear pos-04-08) + (clear pos-04-09) + (clear pos-05-01) + (clear pos-05-03) + (clear pos-05-05) + (clear pos-05-06) + (clear pos-05-09) + (clear pos-06-01) + (clear pos-06-03) + (clear pos-06-05) + (clear pos-06-06) + (clear pos-06-07) + (clear pos-06-08) + (clear pos-06-09) + (clear pos-07-01) + (clear pos-07-03) + (clear pos-07-04) + (clear pos-07-06) + (clear pos-07-07) + (clear pos-07-08) + (clear pos-08-03) + (clear pos-08-04) + (clear pos-08-05) + (clear pos-08-10) + (clear pos-09-02) + (clear pos-09-04) + (clear pos-09-05) + (clear pos-09-07) + (clear pos-09-08) + (clear pos-09-09) + (clear pos-09-10) + (clear pos-10-02) + (clear pos-10-04) + (clear pos-10-05) + (clear pos-10-07) + (clear pos-10-08) + (clear pos-10-09) + (clear pos-10-10) + (clear pos-11-02) + (clear pos-11-03) + (clear pos-11-04) + (clear pos-11-05) + (clear pos-11-07) + (clear pos-11-08) + (clear pos-11-09) + (clear pos-11-10) + (clear pos-12-07) + (clear pos-12-08) + (clear pos-12-09) + (clear pos-12-10) + (= (total-cost) 0) + ) + (:goal (and + (at-goal stone-01) + (at-goal stone-02) + (at-goal stone-03) + )) + (:metric minimize (total-cost)) +) diff --git a/tests/fixtures/pddl_files/sokoban-sequential-optimal/p06.pddl b/tests/fixtures/pddl_files/sokoban-sequential-optimal/p06.pddl new file mode 100644 index 00000000..62af94a6 --- /dev/null +++ b/tests/fixtures/pddl_files/sokoban-sequential-optimal/p06.pddl @@ -0,0 +1,544 @@ +;; 'reduced (Mas Sasquatch 23)' +;; +;; ###### #### +;; # # # +;; #.## #$## # +;; # # # # +;; #$ # ### # # +;; # # # # # +;; # # #### # # # +;; #. @ $ * . # +;; ############### + +(define (problem p152-microban-sequential) + (:domain sokoban-sequential) + (:objects + dir-down - direction + dir-left - direction + dir-right - direction + dir-up - direction + player-01 - player + pos-01-01 - location + pos-01-02 - location + pos-01-03 - location + pos-01-04 - location + pos-01-05 - location + pos-01-06 - location + pos-01-07 - location + pos-01-08 - location + pos-01-09 - location + pos-02-01 - location + pos-02-02 - location + pos-02-03 - location + pos-02-04 - location + pos-02-05 - location + pos-02-06 - location + pos-02-07 - location + pos-02-08 - location + pos-02-09 - location + pos-03-01 - location + pos-03-02 - location + pos-03-03 - location + pos-03-04 - location + pos-03-05 - location + pos-03-06 - location + pos-03-07 - location + pos-03-08 - location + pos-03-09 - location + pos-04-01 - location + pos-04-02 - location + pos-04-03 - location + pos-04-04 - location + pos-04-05 - location + pos-04-06 - location + pos-04-07 - location + pos-04-08 - location + pos-04-09 - location + pos-05-01 - location + pos-05-02 - location + pos-05-03 - location + pos-05-04 - location + pos-05-05 - location + pos-05-06 - location + pos-05-07 - location + pos-05-08 - location + pos-05-09 - location + pos-06-01 - location + pos-06-02 - location + pos-06-03 - location + pos-06-04 - location + pos-06-05 - location + pos-06-06 - location + pos-06-07 - location + pos-06-08 - location + pos-06-09 - location + pos-07-01 - location + pos-07-02 - location + pos-07-03 - location + pos-07-04 - location + pos-07-05 - location + pos-07-06 - location + pos-07-07 - location + pos-07-08 - location + pos-07-09 - location + pos-08-01 - location + pos-08-02 - location + pos-08-03 - location + pos-08-04 - location + pos-08-05 - location + pos-08-06 - location + pos-08-07 - location + pos-08-08 - location + pos-08-09 - location + pos-09-01 - location + pos-09-02 - location + pos-09-03 - location + pos-09-04 - location + pos-09-05 - location + pos-09-06 - location + pos-09-07 - location + pos-09-08 - location + pos-09-09 - location + pos-10-01 - location + pos-10-02 - location + pos-10-03 - location + pos-10-04 - location + pos-10-05 - location + pos-10-06 - location + pos-10-07 - location + pos-10-08 - location + pos-10-09 - location + pos-11-01 - location + pos-11-02 - location + pos-11-03 - location + pos-11-04 - location + pos-11-05 - location + pos-11-06 - location + pos-11-07 - location + pos-11-08 - location + pos-11-09 - location + pos-12-01 - location + pos-12-02 - location + pos-12-03 - location + pos-12-04 - location + pos-12-05 - location + pos-12-06 - location + pos-12-07 - location + pos-12-08 - location + pos-12-09 - location + pos-13-01 - location + pos-13-02 - location + pos-13-03 - location + pos-13-04 - location + pos-13-05 - location + pos-13-06 - location + pos-13-07 - location + pos-13-08 - location + pos-13-09 - location + pos-14-01 - location + pos-14-02 - location + pos-14-03 - location + pos-14-04 - location + pos-14-05 - location + pos-14-06 - location + pos-14-07 - location + pos-14-08 - location + pos-14-09 - location + pos-15-01 - location + pos-15-02 - location + pos-15-03 - location + pos-15-04 - location + pos-15-05 - location + pos-15-06 - location + pos-15-07 - location + pos-15-08 - location + pos-15-09 - location + stone-01 - stone + stone-02 - stone + stone-03 - stone + stone-04 - stone + ) + (:init + (IS-GOAL pos-02-03) + (IS-GOAL pos-02-08) + (IS-GOAL pos-11-08) + (IS-GOAL pos-13-08) + (IS-NONGOAL pos-01-01) + (IS-NONGOAL pos-01-02) + (IS-NONGOAL pos-01-03) + (IS-NONGOAL pos-01-04) + (IS-NONGOAL pos-01-05) + (IS-NONGOAL pos-01-06) + (IS-NONGOAL pos-01-07) + (IS-NONGOAL pos-01-08) + (IS-NONGOAL pos-01-09) + (IS-NONGOAL pos-02-01) + (IS-NONGOAL pos-02-02) + (IS-NONGOAL pos-02-04) + (IS-NONGOAL pos-02-05) + (IS-NONGOAL pos-02-06) + (IS-NONGOAL pos-02-07) + (IS-NONGOAL pos-02-09) + (IS-NONGOAL pos-03-01) + (IS-NONGOAL pos-03-02) + (IS-NONGOAL pos-03-03) + (IS-NONGOAL pos-03-04) + (IS-NONGOAL pos-03-05) + (IS-NONGOAL pos-03-06) + (IS-NONGOAL pos-03-07) + (IS-NONGOAL pos-03-08) + (IS-NONGOAL pos-03-09) + (IS-NONGOAL pos-04-01) + (IS-NONGOAL pos-04-02) + (IS-NONGOAL pos-04-03) + (IS-NONGOAL pos-04-04) + (IS-NONGOAL pos-04-05) + (IS-NONGOAL pos-04-06) + (IS-NONGOAL pos-04-07) + (IS-NONGOAL pos-04-08) + (IS-NONGOAL pos-04-09) + (IS-NONGOAL pos-05-01) + (IS-NONGOAL pos-05-02) + (IS-NONGOAL pos-05-03) + (IS-NONGOAL pos-05-04) + (IS-NONGOAL pos-05-05) + (IS-NONGOAL pos-05-06) + (IS-NONGOAL pos-05-07) + (IS-NONGOAL pos-05-08) + (IS-NONGOAL pos-05-09) + (IS-NONGOAL pos-06-01) + (IS-NONGOAL pos-06-02) + (IS-NONGOAL pos-06-03) + (IS-NONGOAL pos-06-04) + (IS-NONGOAL pos-06-05) + (IS-NONGOAL pos-06-06) + (IS-NONGOAL pos-06-07) + (IS-NONGOAL pos-06-08) + (IS-NONGOAL pos-06-09) + (IS-NONGOAL pos-07-01) + (IS-NONGOAL pos-07-02) + (IS-NONGOAL pos-07-03) + (IS-NONGOAL pos-07-04) + (IS-NONGOAL pos-07-05) + (IS-NONGOAL pos-07-06) + (IS-NONGOAL pos-07-07) + (IS-NONGOAL pos-07-08) + (IS-NONGOAL pos-07-09) + (IS-NONGOAL pos-08-01) + (IS-NONGOAL pos-08-02) + (IS-NONGOAL pos-08-03) + (IS-NONGOAL pos-08-04) + (IS-NONGOAL pos-08-05) + (IS-NONGOAL pos-08-06) + (IS-NONGOAL pos-08-07) + (IS-NONGOAL pos-08-08) + (IS-NONGOAL pos-08-09) + (IS-NONGOAL pos-09-01) + (IS-NONGOAL pos-09-02) + (IS-NONGOAL pos-09-03) + (IS-NONGOAL pos-09-04) + (IS-NONGOAL pos-09-05) + (IS-NONGOAL pos-09-06) + (IS-NONGOAL pos-09-07) + (IS-NONGOAL pos-09-08) + (IS-NONGOAL pos-09-09) + (IS-NONGOAL pos-10-01) + (IS-NONGOAL pos-10-02) + (IS-NONGOAL pos-10-03) + (IS-NONGOAL pos-10-04) + (IS-NONGOAL pos-10-05) + (IS-NONGOAL pos-10-06) + (IS-NONGOAL pos-10-07) + (IS-NONGOAL pos-10-08) + (IS-NONGOAL pos-10-09) + (IS-NONGOAL pos-11-01) + (IS-NONGOAL pos-11-02) + (IS-NONGOAL pos-11-03) + (IS-NONGOAL pos-11-04) + (IS-NONGOAL pos-11-05) + (IS-NONGOAL pos-11-06) + (IS-NONGOAL pos-11-07) + (IS-NONGOAL pos-11-09) + (IS-NONGOAL pos-12-01) + (IS-NONGOAL pos-12-02) + (IS-NONGOAL pos-12-03) + (IS-NONGOAL pos-12-04) + (IS-NONGOAL pos-12-05) + (IS-NONGOAL pos-12-06) + (IS-NONGOAL pos-12-07) + (IS-NONGOAL pos-12-08) + (IS-NONGOAL pos-12-09) + (IS-NONGOAL pos-13-01) + (IS-NONGOAL pos-13-02) + (IS-NONGOAL pos-13-03) + (IS-NONGOAL pos-13-04) + (IS-NONGOAL pos-13-05) + (IS-NONGOAL pos-13-06) + (IS-NONGOAL pos-13-07) + (IS-NONGOAL pos-13-09) + (IS-NONGOAL pos-14-01) + (IS-NONGOAL pos-14-02) + (IS-NONGOAL pos-14-03) + (IS-NONGOAL pos-14-04) + (IS-NONGOAL pos-14-05) + (IS-NONGOAL pos-14-06) + (IS-NONGOAL pos-14-07) + (IS-NONGOAL pos-14-08) + (IS-NONGOAL pos-14-09) + (IS-NONGOAL pos-15-01) + (IS-NONGOAL pos-15-02) + (IS-NONGOAL pos-15-03) + (IS-NONGOAL pos-15-04) + (IS-NONGOAL pos-15-05) + (IS-NONGOAL pos-15-06) + (IS-NONGOAL pos-15-07) + (IS-NONGOAL pos-15-08) + (IS-NONGOAL pos-15-09) + (MOVE-DIR pos-02-02 pos-02-03 dir-down) + (MOVE-DIR pos-02-02 pos-03-02 dir-right) + (MOVE-DIR pos-02-03 pos-02-02 dir-up) + (MOVE-DIR pos-02-03 pos-02-04 dir-down) + (MOVE-DIR pos-02-04 pos-02-03 dir-up) + (MOVE-DIR pos-02-04 pos-02-05 dir-down) + (MOVE-DIR pos-02-04 pos-03-04 dir-right) + (MOVE-DIR pos-02-05 pos-02-04 dir-up) + (MOVE-DIR pos-02-05 pos-02-06 dir-down) + (MOVE-DIR pos-02-05 pos-03-05 dir-right) + (MOVE-DIR pos-02-06 pos-02-05 dir-up) + (MOVE-DIR pos-02-06 pos-02-07 dir-down) + (MOVE-DIR pos-02-07 pos-02-06 dir-up) + (MOVE-DIR pos-02-07 pos-02-08 dir-down) + (MOVE-DIR pos-02-08 pos-02-07 dir-up) + (MOVE-DIR pos-02-08 pos-03-08 dir-right) + (MOVE-DIR pos-03-02 pos-02-02 dir-left) + (MOVE-DIR pos-03-02 pos-04-02 dir-right) + (MOVE-DIR pos-03-04 pos-02-04 dir-left) + (MOVE-DIR pos-03-04 pos-03-05 dir-down) + (MOVE-DIR pos-03-04 pos-04-04 dir-right) + (MOVE-DIR pos-03-05 pos-02-05 dir-left) + (MOVE-DIR pos-03-05 pos-03-04 dir-up) + (MOVE-DIR pos-03-05 pos-04-05 dir-right) + (MOVE-DIR pos-03-08 pos-02-08 dir-left) + (MOVE-DIR pos-03-08 pos-04-08 dir-right) + (MOVE-DIR pos-04-02 pos-03-02 dir-left) + (MOVE-DIR pos-04-02 pos-05-02 dir-right) + (MOVE-DIR pos-04-04 pos-03-04 dir-left) + (MOVE-DIR pos-04-04 pos-04-05 dir-down) + (MOVE-DIR pos-04-05 pos-03-05 dir-left) + (MOVE-DIR pos-04-05 pos-04-04 dir-up) + (MOVE-DIR pos-04-05 pos-04-06 dir-down) + (MOVE-DIR pos-04-06 pos-04-05 dir-up) + (MOVE-DIR pos-04-06 pos-04-07 dir-down) + (MOVE-DIR pos-04-06 pos-05-06 dir-right) + (MOVE-DIR pos-04-07 pos-04-06 dir-up) + (MOVE-DIR pos-04-07 pos-04-08 dir-down) + (MOVE-DIR pos-04-08 pos-03-08 dir-left) + (MOVE-DIR pos-04-08 pos-04-07 dir-up) + (MOVE-DIR pos-04-08 pos-05-08 dir-right) + (MOVE-DIR pos-05-02 pos-04-02 dir-left) + (MOVE-DIR pos-05-02 pos-05-03 dir-down) + (MOVE-DIR pos-05-02 pos-06-02 dir-right) + (MOVE-DIR pos-05-03 pos-05-02 dir-up) + (MOVE-DIR pos-05-03 pos-06-03 dir-right) + (MOVE-DIR pos-05-06 pos-04-06 dir-left) + (MOVE-DIR pos-05-06 pos-06-06 dir-right) + (MOVE-DIR pos-05-08 pos-04-08 dir-left) + (MOVE-DIR pos-05-08 pos-06-08 dir-right) + (MOVE-DIR pos-06-02 pos-05-02 dir-left) + (MOVE-DIR pos-06-02 pos-06-03 dir-down) + (MOVE-DIR pos-06-03 pos-05-03 dir-left) + (MOVE-DIR pos-06-03 pos-06-02 dir-up) + (MOVE-DIR pos-06-03 pos-06-04 dir-down) + (MOVE-DIR pos-06-04 pos-06-03 dir-up) + (MOVE-DIR pos-06-04 pos-06-05 dir-down) + (MOVE-DIR pos-06-04 pos-07-04 dir-right) + (MOVE-DIR pos-06-05 pos-06-04 dir-up) + (MOVE-DIR pos-06-05 pos-06-06 dir-down) + (MOVE-DIR pos-06-06 pos-05-06 dir-left) + (MOVE-DIR pos-06-06 pos-06-05 dir-up) + (MOVE-DIR pos-06-06 pos-07-06 dir-right) + (MOVE-DIR pos-06-08 pos-05-08 dir-left) + (MOVE-DIR pos-06-08 pos-07-08 dir-right) + (MOVE-DIR pos-07-04 pos-06-04 dir-left) + (MOVE-DIR pos-07-04 pos-08-04 dir-right) + (MOVE-DIR pos-07-06 pos-06-06 dir-left) + (MOVE-DIR pos-07-06 pos-08-06 dir-right) + (MOVE-DIR pos-07-08 pos-06-08 dir-left) + (MOVE-DIR pos-07-08 pos-08-08 dir-right) + (MOVE-DIR pos-08-02 pos-08-03 dir-down) + (MOVE-DIR pos-08-02 pos-09-02 dir-right) + (MOVE-DIR pos-08-03 pos-08-02 dir-up) + (MOVE-DIR pos-08-03 pos-08-04 dir-down) + (MOVE-DIR pos-08-04 pos-07-04 dir-left) + (MOVE-DIR pos-08-04 pos-08-03 dir-up) + (MOVE-DIR pos-08-04 pos-09-04 dir-right) + (MOVE-DIR pos-08-06 pos-07-06 dir-left) + (MOVE-DIR pos-08-06 pos-09-06 dir-right) + (MOVE-DIR pos-08-08 pos-07-08 dir-left) + (MOVE-DIR pos-08-08 pos-09-08 dir-right) + (MOVE-DIR pos-09-02 pos-08-02 dir-left) + (MOVE-DIR pos-09-02 pos-10-02 dir-right) + (MOVE-DIR pos-09-04 pos-08-04 dir-left) + (MOVE-DIR pos-09-04 pos-10-04 dir-right) + (MOVE-DIR pos-09-06 pos-08-06 dir-left) + (MOVE-DIR pos-09-06 pos-09-07 dir-down) + (MOVE-DIR pos-09-07 pos-09-06 dir-up) + (MOVE-DIR pos-09-07 pos-09-08 dir-down) + (MOVE-DIR pos-09-07 pos-10-07 dir-right) + (MOVE-DIR pos-09-08 pos-08-08 dir-left) + (MOVE-DIR pos-09-08 pos-09-07 dir-up) + (MOVE-DIR pos-09-08 pos-10-08 dir-right) + (MOVE-DIR pos-10-02 pos-09-02 dir-left) + (MOVE-DIR pos-10-02 pos-11-02 dir-right) + (MOVE-DIR pos-10-04 pos-09-04 dir-left) + (MOVE-DIR pos-10-04 pos-10-05 dir-down) + (MOVE-DIR pos-10-05 pos-10-04 dir-up) + (MOVE-DIR pos-10-05 pos-11-05 dir-right) + (MOVE-DIR pos-10-07 pos-09-07 dir-left) + (MOVE-DIR pos-10-07 pos-10-08 dir-down) + (MOVE-DIR pos-10-08 pos-09-08 dir-left) + (MOVE-DIR pos-10-08 pos-10-07 dir-up) + (MOVE-DIR pos-10-08 pos-11-08 dir-right) + (MOVE-DIR pos-11-02 pos-10-02 dir-left) + (MOVE-DIR pos-11-02 pos-11-03 dir-down) + (MOVE-DIR pos-11-03 pos-11-02 dir-up) + (MOVE-DIR pos-11-03 pos-12-03 dir-right) + (MOVE-DIR pos-11-05 pos-10-05 dir-left) + (MOVE-DIR pos-11-05 pos-11-06 dir-down) + (MOVE-DIR pos-11-06 pos-11-05 dir-up) + (MOVE-DIR pos-11-06 pos-12-06 dir-right) + (MOVE-DIR pos-11-08 pos-10-08 dir-left) + (MOVE-DIR pos-11-08 pos-12-08 dir-right) + (MOVE-DIR pos-12-01 pos-13-01 dir-right) + (MOVE-DIR pos-12-03 pos-11-03 dir-left) + (MOVE-DIR pos-12-03 pos-12-04 dir-down) + (MOVE-DIR pos-12-04 pos-12-03 dir-up) + (MOVE-DIR pos-12-04 pos-13-04 dir-right) + (MOVE-DIR pos-12-06 pos-11-06 dir-left) + (MOVE-DIR pos-12-06 pos-12-07 dir-down) + (MOVE-DIR pos-12-07 pos-12-06 dir-up) + (MOVE-DIR pos-12-07 pos-12-08 dir-down) + (MOVE-DIR pos-12-08 pos-11-08 dir-left) + (MOVE-DIR pos-12-08 pos-12-07 dir-up) + (MOVE-DIR pos-12-08 pos-13-08 dir-right) + (MOVE-DIR pos-13-01 pos-12-01 dir-left) + (MOVE-DIR pos-13-01 pos-13-02 dir-down) + (MOVE-DIR pos-13-01 pos-14-01 dir-right) + (MOVE-DIR pos-13-02 pos-13-01 dir-up) + (MOVE-DIR pos-13-02 pos-14-02 dir-right) + (MOVE-DIR pos-13-04 pos-12-04 dir-left) + (MOVE-DIR pos-13-04 pos-13-05 dir-down) + (MOVE-DIR pos-13-05 pos-13-04 dir-up) + (MOVE-DIR pos-13-05 pos-14-05 dir-right) + (MOVE-DIR pos-13-08 pos-12-08 dir-left) + (MOVE-DIR pos-13-08 pos-14-08 dir-right) + (MOVE-DIR pos-14-01 pos-13-01 dir-left) + (MOVE-DIR pos-14-01 pos-14-02 dir-down) + (MOVE-DIR pos-14-01 pos-15-01 dir-right) + (MOVE-DIR pos-14-02 pos-13-02 dir-left) + (MOVE-DIR pos-14-02 pos-14-01 dir-up) + (MOVE-DIR pos-14-02 pos-14-03 dir-down) + (MOVE-DIR pos-14-02 pos-15-02 dir-right) + (MOVE-DIR pos-14-03 pos-14-02 dir-up) + (MOVE-DIR pos-14-03 pos-15-03 dir-right) + (MOVE-DIR pos-14-05 pos-13-05 dir-left) + (MOVE-DIR pos-14-05 pos-14-06 dir-down) + (MOVE-DIR pos-14-06 pos-14-05 dir-up) + (MOVE-DIR pos-14-06 pos-14-07 dir-down) + (MOVE-DIR pos-14-07 pos-14-06 dir-up) + (MOVE-DIR pos-14-07 pos-14-08 dir-down) + (MOVE-DIR pos-14-08 pos-13-08 dir-left) + (MOVE-DIR pos-14-08 pos-14-07 dir-up) + (MOVE-DIR pos-15-01 pos-14-01 dir-left) + (MOVE-DIR pos-15-01 pos-15-02 dir-down) + (MOVE-DIR pos-15-02 pos-14-02 dir-left) + (MOVE-DIR pos-15-02 pos-15-01 dir-up) + (MOVE-DIR pos-15-02 pos-15-03 dir-down) + (MOVE-DIR pos-15-03 pos-14-03 dir-left) + (MOVE-DIR pos-15-03 pos-15-02 dir-up) + (MOVE-DIR pos-15-03 pos-15-04 dir-down) + (MOVE-DIR pos-15-04 pos-15-03 dir-up) + (at player-01 pos-04-08) + (at stone-01 pos-08-03) + (at stone-02 pos-02-05) + (at stone-03 pos-09-08) + (at stone-04 pos-11-08) + (at-goal stone-04) + (clear pos-02-02) + (clear pos-02-03) + (clear pos-02-04) + (clear pos-02-06) + (clear pos-02-07) + (clear pos-02-08) + (clear pos-03-02) + (clear pos-03-04) + (clear pos-03-05) + (clear pos-03-08) + (clear pos-04-02) + (clear pos-04-04) + (clear pos-04-05) + (clear pos-04-06) + (clear pos-04-07) + (clear pos-05-02) + (clear pos-05-03) + (clear pos-05-06) + (clear pos-05-08) + (clear pos-06-02) + (clear pos-06-03) + (clear pos-06-04) + (clear pos-06-05) + (clear pos-06-06) + (clear pos-06-08) + (clear pos-07-01) + (clear pos-07-04) + (clear pos-07-06) + (clear pos-07-08) + (clear pos-08-02) + (clear pos-08-04) + (clear pos-08-06) + (clear pos-08-08) + (clear pos-09-02) + (clear pos-09-04) + (clear pos-09-06) + (clear pos-09-07) + (clear pos-10-02) + (clear pos-10-04) + (clear pos-10-05) + (clear pos-10-07) + (clear pos-10-08) + (clear pos-11-02) + (clear pos-11-03) + (clear pos-11-05) + (clear pos-11-06) + (clear pos-12-01) + (clear pos-12-03) + (clear pos-12-04) + (clear pos-12-06) + (clear pos-12-07) + (clear pos-12-08) + (clear pos-13-01) + (clear pos-13-02) + (clear pos-13-04) + (clear pos-13-05) + (clear pos-13-08) + (clear pos-14-01) + (clear pos-14-02) + (clear pos-14-03) + (clear pos-14-05) + (clear pos-14-06) + (clear pos-14-07) + (clear pos-14-08) + (clear pos-15-01) + (clear pos-15-02) + (clear pos-15-03) + (clear pos-15-04) + (= (total-cost) 0) + ) + (:goal (and + (at-goal stone-01) + (at-goal stone-02) + (at-goal stone-03) + (at-goal stone-04) + )) + (:metric minimize (total-cost)) +) diff --git a/tests/fixtures/pddl_files/sokoban-sequential-optimal/p07.pddl b/tests/fixtures/pddl_files/sokoban-sequential-optimal/p07.pddl new file mode 100644 index 00000000..7112b6e2 --- /dev/null +++ b/tests/fixtures/pddl_files/sokoban-sequential-optimal/p07.pddl @@ -0,0 +1,410 @@ +;; ###### +;; ## # +;; # $ # +;; # $$ # +;; ### .##### +;; ##.# @ # +;; #. $ # +;; #. #### +;; #### + +(define (problem p064-microban-sequential) + (:domain sokoban-sequential) + (:objects + dir-down - direction + dir-left - direction + dir-right - direction + dir-up - direction + player-01 - player + pos-01-01 - location + pos-01-02 - location + pos-01-03 - location + pos-01-04 - location + pos-01-05 - location + pos-01-06 - location + pos-01-07 - location + pos-01-08 - location + pos-01-09 - location + pos-02-01 - location + pos-02-02 - location + pos-02-03 - location + pos-02-04 - location + pos-02-05 - location + pos-02-06 - location + pos-02-07 - location + pos-02-08 - location + pos-02-09 - location + pos-03-01 - location + pos-03-02 - location + pos-03-03 - location + pos-03-04 - location + pos-03-05 - location + pos-03-06 - location + pos-03-07 - location + pos-03-08 - location + pos-03-09 - location + pos-04-01 - location + pos-04-02 - location + pos-04-03 - location + pos-04-04 - location + pos-04-05 - location + pos-04-06 - location + pos-04-07 - location + pos-04-08 - location + pos-04-09 - location + pos-05-01 - location + pos-05-02 - location + pos-05-03 - location + pos-05-04 - location + pos-05-05 - location + pos-05-06 - location + pos-05-07 - location + pos-05-08 - location + pos-05-09 - location + pos-06-01 - location + pos-06-02 - location + pos-06-03 - location + pos-06-04 - location + pos-06-05 - location + pos-06-06 - location + pos-06-07 - location + pos-06-08 - location + pos-06-09 - location + pos-07-01 - location + pos-07-02 - location + pos-07-03 - location + pos-07-04 - location + pos-07-05 - location + pos-07-06 - location + pos-07-07 - location + pos-07-08 - location + pos-07-09 - location + pos-08-01 - location + pos-08-02 - location + pos-08-03 - location + pos-08-04 - location + pos-08-05 - location + pos-08-06 - location + pos-08-07 - location + pos-08-08 - location + pos-08-09 - location + pos-09-01 - location + pos-09-02 - location + pos-09-03 - location + pos-09-04 - location + pos-09-05 - location + pos-09-06 - location + pos-09-07 - location + pos-09-08 - location + pos-09-09 - location + pos-10-01 - location + pos-10-02 - location + pos-10-03 - location + pos-10-04 - location + pos-10-05 - location + pos-10-06 - location + pos-10-07 - location + pos-10-08 - location + pos-10-09 - location + stone-01 - stone + stone-02 - stone + stone-03 - stone + stone-04 - stone + ) + (:init + (IS-GOAL pos-05-05) + (IS-GOAL pos-05-06) + (IS-GOAL pos-05-07) + (IS-GOAL pos-05-08) + (IS-NONGOAL pos-01-01) + (IS-NONGOAL pos-01-02) + (IS-NONGOAL pos-01-03) + (IS-NONGOAL pos-01-04) + (IS-NONGOAL pos-01-05) + (IS-NONGOAL pos-01-06) + (IS-NONGOAL pos-01-07) + (IS-NONGOAL pos-01-08) + (IS-NONGOAL pos-01-09) + (IS-NONGOAL pos-02-01) + (IS-NONGOAL pos-02-02) + (IS-NONGOAL pos-02-03) + (IS-NONGOAL pos-02-04) + (IS-NONGOAL pos-02-05) + (IS-NONGOAL pos-02-06) + (IS-NONGOAL pos-02-07) + (IS-NONGOAL pos-02-08) + (IS-NONGOAL pos-02-09) + (IS-NONGOAL pos-03-01) + (IS-NONGOAL pos-03-02) + (IS-NONGOAL pos-03-03) + (IS-NONGOAL pos-03-04) + (IS-NONGOAL pos-03-05) + (IS-NONGOAL pos-03-06) + (IS-NONGOAL pos-03-07) + (IS-NONGOAL pos-03-08) + (IS-NONGOAL pos-03-09) + (IS-NONGOAL pos-04-01) + (IS-NONGOAL pos-04-02) + (IS-NONGOAL pos-04-03) + (IS-NONGOAL pos-04-04) + (IS-NONGOAL pos-04-05) + (IS-NONGOAL pos-04-06) + (IS-NONGOAL pos-04-07) + (IS-NONGOAL pos-04-08) + (IS-NONGOAL pos-04-09) + (IS-NONGOAL pos-05-01) + (IS-NONGOAL pos-05-02) + (IS-NONGOAL pos-05-03) + (IS-NONGOAL pos-05-04) + (IS-NONGOAL pos-05-09) + (IS-NONGOAL pos-06-01) + (IS-NONGOAL pos-06-02) + (IS-NONGOAL pos-06-03) + (IS-NONGOAL pos-06-04) + (IS-NONGOAL pos-06-05) + (IS-NONGOAL pos-06-06) + (IS-NONGOAL pos-06-07) + (IS-NONGOAL pos-06-08) + (IS-NONGOAL pos-06-09) + (IS-NONGOAL pos-07-01) + (IS-NONGOAL pos-07-02) + (IS-NONGOAL pos-07-03) + (IS-NONGOAL pos-07-04) + (IS-NONGOAL pos-07-05) + (IS-NONGOAL pos-07-06) + (IS-NONGOAL pos-07-07) + (IS-NONGOAL pos-07-08) + (IS-NONGOAL pos-07-09) + (IS-NONGOAL pos-08-01) + (IS-NONGOAL pos-08-02) + (IS-NONGOAL pos-08-03) + (IS-NONGOAL pos-08-04) + (IS-NONGOAL pos-08-05) + (IS-NONGOAL pos-08-06) + (IS-NONGOAL pos-08-07) + (IS-NONGOAL pos-08-08) + (IS-NONGOAL pos-08-09) + (IS-NONGOAL pos-09-01) + (IS-NONGOAL pos-09-02) + (IS-NONGOAL pos-09-03) + (IS-NONGOAL pos-09-04) + (IS-NONGOAL pos-09-05) + (IS-NONGOAL pos-09-06) + (IS-NONGOAL pos-09-07) + (IS-NONGOAL pos-09-08) + (IS-NONGOAL pos-09-09) + (IS-NONGOAL pos-10-01) + (IS-NONGOAL pos-10-02) + (IS-NONGOAL pos-10-03) + (IS-NONGOAL pos-10-04) + (IS-NONGOAL pos-10-05) + (IS-NONGOAL pos-10-06) + (IS-NONGOAL pos-10-07) + (IS-NONGOAL pos-10-08) + (IS-NONGOAL pos-10-09) + (MOVE-DIR pos-01-06 pos-01-07 dir-down) + (MOVE-DIR pos-01-06 pos-02-06 dir-right) + (MOVE-DIR pos-01-07 pos-01-06 dir-up) + (MOVE-DIR pos-01-07 pos-01-08 dir-down) + (MOVE-DIR pos-01-07 pos-02-07 dir-right) + (MOVE-DIR pos-01-08 pos-01-07 dir-up) + (MOVE-DIR pos-01-08 pos-01-09 dir-down) + (MOVE-DIR pos-01-08 pos-02-08 dir-right) + (MOVE-DIR pos-01-09 pos-01-08 dir-up) + (MOVE-DIR pos-01-09 pos-02-09 dir-right) + (MOVE-DIR pos-02-03 pos-02-04 dir-down) + (MOVE-DIR pos-02-03 pos-03-03 dir-right) + (MOVE-DIR pos-02-04 pos-02-03 dir-up) + (MOVE-DIR pos-02-04 pos-03-04 dir-right) + (MOVE-DIR pos-02-06 pos-01-06 dir-left) + (MOVE-DIR pos-02-06 pos-02-07 dir-down) + (MOVE-DIR pos-02-07 pos-01-07 dir-left) + (MOVE-DIR pos-02-07 pos-02-06 dir-up) + (MOVE-DIR pos-02-07 pos-02-08 dir-down) + (MOVE-DIR pos-02-07 pos-03-07 dir-right) + (MOVE-DIR pos-02-08 pos-01-08 dir-left) + (MOVE-DIR pos-02-08 pos-02-07 dir-up) + (MOVE-DIR pos-02-08 pos-02-09 dir-down) + (MOVE-DIR pos-02-08 pos-03-08 dir-right) + (MOVE-DIR pos-02-09 pos-01-09 dir-left) + (MOVE-DIR pos-02-09 pos-02-08 dir-up) + (MOVE-DIR pos-02-09 pos-03-09 dir-right) + (MOVE-DIR pos-03-02 pos-03-03 dir-down) + (MOVE-DIR pos-03-02 pos-04-02 dir-right) + (MOVE-DIR pos-03-03 pos-02-03 dir-left) + (MOVE-DIR pos-03-03 pos-03-02 dir-up) + (MOVE-DIR pos-03-03 pos-03-04 dir-down) + (MOVE-DIR pos-03-03 pos-04-03 dir-right) + (MOVE-DIR pos-03-04 pos-02-04 dir-left) + (MOVE-DIR pos-03-04 pos-03-03 dir-up) + (MOVE-DIR pos-03-04 pos-04-04 dir-right) + (MOVE-DIR pos-03-07 pos-02-07 dir-left) + (MOVE-DIR pos-03-07 pos-03-08 dir-down) + (MOVE-DIR pos-03-08 pos-02-08 dir-left) + (MOVE-DIR pos-03-08 pos-03-07 dir-up) + (MOVE-DIR pos-03-08 pos-03-09 dir-down) + (MOVE-DIR pos-03-09 pos-02-09 dir-left) + (MOVE-DIR pos-03-09 pos-03-08 dir-up) + (MOVE-DIR pos-04-02 pos-03-02 dir-left) + (MOVE-DIR pos-04-02 pos-04-03 dir-down) + (MOVE-DIR pos-04-02 pos-05-02 dir-right) + (MOVE-DIR pos-04-03 pos-03-03 dir-left) + (MOVE-DIR pos-04-03 pos-04-02 dir-up) + (MOVE-DIR pos-04-03 pos-04-04 dir-down) + (MOVE-DIR pos-04-03 pos-05-03 dir-right) + (MOVE-DIR pos-04-04 pos-03-04 dir-left) + (MOVE-DIR pos-04-04 pos-04-03 dir-up) + (MOVE-DIR pos-04-04 pos-04-05 dir-down) + (MOVE-DIR pos-04-04 pos-05-04 dir-right) + (MOVE-DIR pos-04-05 pos-04-04 dir-up) + (MOVE-DIR pos-04-05 pos-05-05 dir-right) + (MOVE-DIR pos-05-02 pos-04-02 dir-left) + (MOVE-DIR pos-05-02 pos-05-03 dir-down) + (MOVE-DIR pos-05-02 pos-06-02 dir-right) + (MOVE-DIR pos-05-03 pos-04-03 dir-left) + (MOVE-DIR pos-05-03 pos-05-02 dir-up) + (MOVE-DIR pos-05-03 pos-05-04 dir-down) + (MOVE-DIR pos-05-03 pos-06-03 dir-right) + (MOVE-DIR pos-05-04 pos-04-04 dir-left) + (MOVE-DIR pos-05-04 pos-05-03 dir-up) + (MOVE-DIR pos-05-04 pos-05-05 dir-down) + (MOVE-DIR pos-05-04 pos-06-04 dir-right) + (MOVE-DIR pos-05-05 pos-04-05 dir-left) + (MOVE-DIR pos-05-05 pos-05-04 dir-up) + (MOVE-DIR pos-05-05 pos-05-06 dir-down) + (MOVE-DIR pos-05-06 pos-05-05 dir-up) + (MOVE-DIR pos-05-06 pos-05-07 dir-down) + (MOVE-DIR pos-05-07 pos-05-06 dir-up) + (MOVE-DIR pos-05-07 pos-05-08 dir-down) + (MOVE-DIR pos-05-07 pos-06-07 dir-right) + (MOVE-DIR pos-05-08 pos-05-07 dir-up) + (MOVE-DIR pos-05-08 pos-06-08 dir-right) + (MOVE-DIR pos-06-02 pos-05-02 dir-left) + (MOVE-DIR pos-06-02 pos-06-03 dir-down) + (MOVE-DIR pos-06-03 pos-05-03 dir-left) + (MOVE-DIR pos-06-03 pos-06-02 dir-up) + (MOVE-DIR pos-06-03 pos-06-04 dir-down) + (MOVE-DIR pos-06-04 pos-05-04 dir-left) + (MOVE-DIR pos-06-04 pos-06-03 dir-up) + (MOVE-DIR pos-06-07 pos-05-07 dir-left) + (MOVE-DIR pos-06-07 pos-06-08 dir-down) + (MOVE-DIR pos-06-07 pos-07-07 dir-right) + (MOVE-DIR pos-06-08 pos-05-08 dir-left) + (MOVE-DIR pos-06-08 pos-06-07 dir-up) + (MOVE-DIR pos-07-06 pos-07-07 dir-down) + (MOVE-DIR pos-07-06 pos-08-06 dir-right) + (MOVE-DIR pos-07-07 pos-06-07 dir-left) + (MOVE-DIR pos-07-07 pos-07-06 dir-up) + (MOVE-DIR pos-07-07 pos-08-07 dir-right) + (MOVE-DIR pos-08-01 pos-08-02 dir-down) + (MOVE-DIR pos-08-01 pos-09-01 dir-right) + (MOVE-DIR pos-08-02 pos-08-01 dir-up) + (MOVE-DIR pos-08-02 pos-08-03 dir-down) + (MOVE-DIR pos-08-02 pos-09-02 dir-right) + (MOVE-DIR pos-08-03 pos-08-02 dir-up) + (MOVE-DIR pos-08-03 pos-08-04 dir-down) + (MOVE-DIR pos-08-03 pos-09-03 dir-right) + (MOVE-DIR pos-08-04 pos-08-03 dir-up) + (MOVE-DIR pos-08-04 pos-09-04 dir-right) + (MOVE-DIR pos-08-06 pos-07-06 dir-left) + (MOVE-DIR pos-08-06 pos-08-07 dir-down) + (MOVE-DIR pos-08-06 pos-09-06 dir-right) + (MOVE-DIR pos-08-07 pos-07-07 dir-left) + (MOVE-DIR pos-08-07 pos-08-06 dir-up) + (MOVE-DIR pos-08-07 pos-09-07 dir-right) + (MOVE-DIR pos-08-09 pos-09-09 dir-right) + (MOVE-DIR pos-09-01 pos-08-01 dir-left) + (MOVE-DIR pos-09-01 pos-09-02 dir-down) + (MOVE-DIR pos-09-01 pos-10-01 dir-right) + (MOVE-DIR pos-09-02 pos-08-02 dir-left) + (MOVE-DIR pos-09-02 pos-09-01 dir-up) + (MOVE-DIR pos-09-02 pos-09-03 dir-down) + (MOVE-DIR pos-09-02 pos-10-02 dir-right) + (MOVE-DIR pos-09-03 pos-08-03 dir-left) + (MOVE-DIR pos-09-03 pos-09-02 dir-up) + (MOVE-DIR pos-09-03 pos-09-04 dir-down) + (MOVE-DIR pos-09-03 pos-10-03 dir-right) + (MOVE-DIR pos-09-04 pos-08-04 dir-left) + (MOVE-DIR pos-09-04 pos-09-03 dir-up) + (MOVE-DIR pos-09-04 pos-10-04 dir-right) + (MOVE-DIR pos-09-06 pos-08-06 dir-left) + (MOVE-DIR pos-09-06 pos-09-07 dir-down) + (MOVE-DIR pos-09-07 pos-08-07 dir-left) + (MOVE-DIR pos-09-07 pos-09-06 dir-up) + (MOVE-DIR pos-09-09 pos-08-09 dir-left) + (MOVE-DIR pos-09-09 pos-10-09 dir-right) + (MOVE-DIR pos-10-01 pos-09-01 dir-left) + (MOVE-DIR pos-10-01 pos-10-02 dir-down) + (MOVE-DIR pos-10-02 pos-09-02 dir-left) + (MOVE-DIR pos-10-02 pos-10-01 dir-up) + (MOVE-DIR pos-10-02 pos-10-03 dir-down) + (MOVE-DIR pos-10-03 pos-09-03 dir-left) + (MOVE-DIR pos-10-03 pos-10-02 dir-up) + (MOVE-DIR pos-10-03 pos-10-04 dir-down) + (MOVE-DIR pos-10-04 pos-09-04 dir-left) + (MOVE-DIR pos-10-04 pos-10-03 dir-up) + (MOVE-DIR pos-10-09 pos-09-09 dir-left) + (at player-01 pos-08-06) + (at stone-01 pos-05-03) + (at stone-02 pos-04-04) + (at stone-03 pos-05-04) + (at stone-04 pos-08-07) + (clear pos-01-01) + (clear pos-01-06) + (clear pos-01-07) + (clear pos-01-08) + (clear pos-01-09) + (clear pos-02-03) + (clear pos-02-04) + (clear pos-02-06) + (clear pos-02-07) + (clear pos-02-08) + (clear pos-02-09) + (clear pos-03-02) + (clear pos-03-03) + (clear pos-03-04) + (clear pos-03-07) + (clear pos-03-08) + (clear pos-03-09) + (clear pos-04-02) + (clear pos-04-03) + (clear pos-04-05) + (clear pos-05-02) + (clear pos-05-05) + (clear pos-05-06) + (clear pos-05-07) + (clear pos-05-08) + (clear pos-06-02) + (clear pos-06-03) + (clear pos-06-04) + (clear pos-06-07) + (clear pos-06-08) + (clear pos-07-06) + (clear pos-07-07) + (clear pos-08-01) + (clear pos-08-02) + (clear pos-08-03) + (clear pos-08-04) + (clear pos-08-09) + (clear pos-09-01) + (clear pos-09-02) + (clear pos-09-03) + (clear pos-09-04) + (clear pos-09-06) + (clear pos-09-07) + (clear pos-09-09) + (clear pos-10-01) + (clear pos-10-02) + (clear pos-10-03) + (clear pos-10-04) + (clear pos-10-09) + (= (total-cost) 0) + ) + (:goal (and + (at-goal stone-01) + (at-goal stone-02) + (at-goal stone-03) + (at-goal stone-04) + )) + (:metric minimize (total-cost)) +) diff --git a/tests/fixtures/pddl_files/sokoban-sequential-optimal/p08.pddl b/tests/fixtures/pddl_files/sokoban-sequential-optimal/p08.pddl new file mode 100644 index 00000000..7f8ca15e --- /dev/null +++ b/tests/fixtures/pddl_files/sokoban-sequential-optimal/p08.pddl @@ -0,0 +1,373 @@ +;; ######### +;; ### # # +;; # * $ . . # +;; # $ ## ## +;; ####*# # +;; # @ ### +;; # ### +;; ##### + +(define (problem p128-microban-sequential) + (:domain sokoban-sequential) + (:objects + dir-down - direction + dir-left - direction + dir-right - direction + dir-up - direction + player-01 - player + pos-01-01 - location + pos-01-02 - location + pos-01-03 - location + pos-01-04 - location + pos-01-05 - location + pos-01-06 - location + pos-01-07 - location + pos-01-08 - location + pos-02-01 - location + pos-02-02 - location + pos-02-03 - location + pos-02-04 - location + pos-02-05 - location + pos-02-06 - location + pos-02-07 - location + pos-02-08 - location + pos-03-01 - location + pos-03-02 - location + pos-03-03 - location + pos-03-04 - location + pos-03-05 - location + pos-03-06 - location + pos-03-07 - location + pos-03-08 - location + pos-04-01 - location + pos-04-02 - location + pos-04-03 - location + pos-04-04 - location + pos-04-05 - location + pos-04-06 - location + pos-04-07 - location + pos-04-08 - location + pos-05-01 - location + pos-05-02 - location + pos-05-03 - location + pos-05-04 - location + pos-05-05 - location + pos-05-06 - location + pos-05-07 - location + pos-05-08 - location + pos-06-01 - location + pos-06-02 - location + pos-06-03 - location + pos-06-04 - location + pos-06-05 - location + pos-06-06 - location + pos-06-07 - location + pos-06-08 - location + pos-07-01 - location + pos-07-02 - location + pos-07-03 - location + pos-07-04 - location + pos-07-05 - location + pos-07-06 - location + pos-07-07 - location + pos-07-08 - location + pos-08-01 - location + pos-08-02 - location + pos-08-03 - location + pos-08-04 - location + pos-08-05 - location + pos-08-06 - location + pos-08-07 - location + pos-08-08 - location + pos-09-01 - location + pos-09-02 - location + pos-09-03 - location + pos-09-04 - location + pos-09-05 - location + pos-09-06 - location + pos-09-07 - location + pos-09-08 - location + pos-10-01 - location + pos-10-02 - location + pos-10-03 - location + pos-10-04 - location + pos-10-05 - location + pos-10-06 - location + pos-10-07 - location + pos-10-08 - location + pos-11-01 - location + pos-11-02 - location + pos-11-03 - location + pos-11-04 - location + pos-11-05 - location + pos-11-06 - location + pos-11-07 - location + pos-11-08 - location + stone-01 - stone + stone-02 - stone + stone-03 - stone + stone-04 - stone + ) + (:init + (IS-GOAL pos-03-03) + (IS-GOAL pos-05-05) + (IS-GOAL pos-07-03) + (IS-GOAL pos-09-03) + (IS-NONGOAL pos-01-01) + (IS-NONGOAL pos-01-02) + (IS-NONGOAL pos-01-03) + (IS-NONGOAL pos-01-04) + (IS-NONGOAL pos-01-05) + (IS-NONGOAL pos-01-06) + (IS-NONGOAL pos-01-07) + (IS-NONGOAL pos-01-08) + (IS-NONGOAL pos-02-01) + (IS-NONGOAL pos-02-02) + (IS-NONGOAL pos-02-03) + (IS-NONGOAL pos-02-04) + (IS-NONGOAL pos-02-05) + (IS-NONGOAL pos-02-06) + (IS-NONGOAL pos-02-07) + (IS-NONGOAL pos-02-08) + (IS-NONGOAL pos-03-01) + (IS-NONGOAL pos-03-02) + (IS-NONGOAL pos-03-04) + (IS-NONGOAL pos-03-05) + (IS-NONGOAL pos-03-06) + (IS-NONGOAL pos-03-07) + (IS-NONGOAL pos-03-08) + (IS-NONGOAL pos-04-01) + (IS-NONGOAL pos-04-02) + (IS-NONGOAL pos-04-03) + (IS-NONGOAL pos-04-04) + (IS-NONGOAL pos-04-05) + (IS-NONGOAL pos-04-06) + (IS-NONGOAL pos-04-07) + (IS-NONGOAL pos-04-08) + (IS-NONGOAL pos-05-01) + (IS-NONGOAL pos-05-02) + (IS-NONGOAL pos-05-03) + (IS-NONGOAL pos-05-04) + (IS-NONGOAL pos-05-06) + (IS-NONGOAL pos-05-07) + (IS-NONGOAL pos-05-08) + (IS-NONGOAL pos-06-01) + (IS-NONGOAL pos-06-02) + (IS-NONGOAL pos-06-03) + (IS-NONGOAL pos-06-04) + (IS-NONGOAL pos-06-05) + (IS-NONGOAL pos-06-06) + (IS-NONGOAL pos-06-07) + (IS-NONGOAL pos-06-08) + (IS-NONGOAL pos-07-01) + (IS-NONGOAL pos-07-02) + (IS-NONGOAL pos-07-04) + (IS-NONGOAL pos-07-05) + (IS-NONGOAL pos-07-06) + (IS-NONGOAL pos-07-07) + (IS-NONGOAL pos-07-08) + (IS-NONGOAL pos-08-01) + (IS-NONGOAL pos-08-02) + (IS-NONGOAL pos-08-03) + (IS-NONGOAL pos-08-04) + (IS-NONGOAL pos-08-05) + (IS-NONGOAL pos-08-06) + (IS-NONGOAL pos-08-07) + (IS-NONGOAL pos-08-08) + (IS-NONGOAL pos-09-01) + (IS-NONGOAL pos-09-02) + (IS-NONGOAL pos-09-04) + (IS-NONGOAL pos-09-05) + (IS-NONGOAL pos-09-06) + (IS-NONGOAL pos-09-07) + (IS-NONGOAL pos-09-08) + (IS-NONGOAL pos-10-01) + (IS-NONGOAL pos-10-02) + (IS-NONGOAL pos-10-03) + (IS-NONGOAL pos-10-04) + (IS-NONGOAL pos-10-05) + (IS-NONGOAL pos-10-06) + (IS-NONGOAL pos-10-07) + (IS-NONGOAL pos-10-08) + (IS-NONGOAL pos-11-01) + (IS-NONGOAL pos-11-02) + (IS-NONGOAL pos-11-03) + (IS-NONGOAL pos-11-04) + (IS-NONGOAL pos-11-05) + (IS-NONGOAL pos-11-06) + (IS-NONGOAL pos-11-07) + (IS-NONGOAL pos-11-08) + (MOVE-DIR pos-01-01 pos-02-01 dir-right) + (MOVE-DIR pos-01-06 pos-01-07 dir-down) + (MOVE-DIR pos-01-07 pos-01-06 dir-up) + (MOVE-DIR pos-01-07 pos-01-08 dir-down) + (MOVE-DIR pos-01-08 pos-01-07 dir-up) + (MOVE-DIR pos-02-01 pos-01-01 dir-left) + (MOVE-DIR pos-02-03 pos-02-04 dir-down) + (MOVE-DIR pos-02-03 pos-03-03 dir-right) + (MOVE-DIR pos-02-04 pos-02-03 dir-up) + (MOVE-DIR pos-02-04 pos-03-04 dir-right) + (MOVE-DIR pos-03-03 pos-02-03 dir-left) + (MOVE-DIR pos-03-03 pos-03-04 dir-down) + (MOVE-DIR pos-03-03 pos-04-03 dir-right) + (MOVE-DIR pos-03-04 pos-02-04 dir-left) + (MOVE-DIR pos-03-04 pos-03-03 dir-up) + (MOVE-DIR pos-03-04 pos-04-04 dir-right) + (MOVE-DIR pos-03-06 pos-03-07 dir-down) + (MOVE-DIR pos-03-06 pos-04-06 dir-right) + (MOVE-DIR pos-03-07 pos-03-06 dir-up) + (MOVE-DIR pos-03-07 pos-04-07 dir-right) + (MOVE-DIR pos-04-02 pos-04-03 dir-down) + (MOVE-DIR pos-04-02 pos-05-02 dir-right) + (MOVE-DIR pos-04-03 pos-03-03 dir-left) + (MOVE-DIR pos-04-03 pos-04-02 dir-up) + (MOVE-DIR pos-04-03 pos-04-04 dir-down) + (MOVE-DIR pos-04-03 pos-05-03 dir-right) + (MOVE-DIR pos-04-04 pos-03-04 dir-left) + (MOVE-DIR pos-04-04 pos-04-03 dir-up) + (MOVE-DIR pos-04-04 pos-05-04 dir-right) + (MOVE-DIR pos-04-06 pos-03-06 dir-left) + (MOVE-DIR pos-04-06 pos-04-07 dir-down) + (MOVE-DIR pos-04-06 pos-05-06 dir-right) + (MOVE-DIR pos-04-07 pos-03-07 dir-left) + (MOVE-DIR pos-04-07 pos-04-06 dir-up) + (MOVE-DIR pos-04-07 pos-05-07 dir-right) + (MOVE-DIR pos-05-02 pos-04-02 dir-left) + (MOVE-DIR pos-05-02 pos-05-03 dir-down) + (MOVE-DIR pos-05-02 pos-06-02 dir-right) + (MOVE-DIR pos-05-03 pos-04-03 dir-left) + (MOVE-DIR pos-05-03 pos-05-02 dir-up) + (MOVE-DIR pos-05-03 pos-05-04 dir-down) + (MOVE-DIR pos-05-03 pos-06-03 dir-right) + (MOVE-DIR pos-05-04 pos-04-04 dir-left) + (MOVE-DIR pos-05-04 pos-05-03 dir-up) + (MOVE-DIR pos-05-04 pos-05-05 dir-down) + (MOVE-DIR pos-05-04 pos-06-04 dir-right) + (MOVE-DIR pos-05-05 pos-05-04 dir-up) + (MOVE-DIR pos-05-05 pos-05-06 dir-down) + (MOVE-DIR pos-05-06 pos-04-06 dir-left) + (MOVE-DIR pos-05-06 pos-05-05 dir-up) + (MOVE-DIR pos-05-06 pos-05-07 dir-down) + (MOVE-DIR pos-05-06 pos-06-06 dir-right) + (MOVE-DIR pos-05-07 pos-04-07 dir-left) + (MOVE-DIR pos-05-07 pos-05-06 dir-up) + (MOVE-DIR pos-06-02 pos-05-02 dir-left) + (MOVE-DIR pos-06-02 pos-06-03 dir-down) + (MOVE-DIR pos-06-03 pos-05-03 dir-left) + (MOVE-DIR pos-06-03 pos-06-02 dir-up) + (MOVE-DIR pos-06-03 pos-06-04 dir-down) + (MOVE-DIR pos-06-03 pos-07-03 dir-right) + (MOVE-DIR pos-06-04 pos-05-04 dir-left) + (MOVE-DIR pos-06-04 pos-06-03 dir-up) + (MOVE-DIR pos-06-06 pos-05-06 dir-left) + (MOVE-DIR pos-06-06 pos-07-06 dir-right) + (MOVE-DIR pos-07-03 pos-06-03 dir-left) + (MOVE-DIR pos-07-03 pos-08-03 dir-right) + (MOVE-DIR pos-07-05 pos-07-06 dir-down) + (MOVE-DIR pos-07-05 pos-08-05 dir-right) + (MOVE-DIR pos-07-06 pos-06-06 dir-left) + (MOVE-DIR pos-07-06 pos-07-05 dir-up) + (MOVE-DIR pos-07-08 pos-08-08 dir-right) + (MOVE-DIR pos-08-02 pos-08-03 dir-down) + (MOVE-DIR pos-08-02 pos-09-02 dir-right) + (MOVE-DIR pos-08-03 pos-07-03 dir-left) + (MOVE-DIR pos-08-03 pos-08-02 dir-up) + (MOVE-DIR pos-08-03 pos-09-03 dir-right) + (MOVE-DIR pos-08-05 pos-07-05 dir-left) + (MOVE-DIR pos-08-05 pos-09-05 dir-right) + (MOVE-DIR pos-08-08 pos-07-08 dir-left) + (MOVE-DIR pos-08-08 pos-09-08 dir-right) + (MOVE-DIR pos-09-02 pos-08-02 dir-left) + (MOVE-DIR pos-09-02 pos-09-03 dir-down) + (MOVE-DIR pos-09-02 pos-10-02 dir-right) + (MOVE-DIR pos-09-03 pos-08-03 dir-left) + (MOVE-DIR pos-09-03 pos-09-02 dir-up) + (MOVE-DIR pos-09-03 pos-09-04 dir-down) + (MOVE-DIR pos-09-03 pos-10-03 dir-right) + (MOVE-DIR pos-09-04 pos-09-03 dir-up) + (MOVE-DIR pos-09-04 pos-09-05 dir-down) + (MOVE-DIR pos-09-05 pos-08-05 dir-left) + (MOVE-DIR pos-09-05 pos-09-04 dir-up) + (MOVE-DIR pos-09-07 pos-09-08 dir-down) + (MOVE-DIR pos-09-07 pos-10-07 dir-right) + (MOVE-DIR pos-09-08 pos-08-08 dir-left) + (MOVE-DIR pos-09-08 pos-09-07 dir-up) + (MOVE-DIR pos-09-08 pos-10-08 dir-right) + (MOVE-DIR pos-10-02 pos-09-02 dir-left) + (MOVE-DIR pos-10-02 pos-10-03 dir-down) + (MOVE-DIR pos-10-03 pos-09-03 dir-left) + (MOVE-DIR pos-10-03 pos-10-02 dir-up) + (MOVE-DIR pos-10-07 pos-09-07 dir-left) + (MOVE-DIR pos-10-07 pos-10-08 dir-down) + (MOVE-DIR pos-10-07 pos-11-07 dir-right) + (MOVE-DIR pos-10-08 pos-09-08 dir-left) + (MOVE-DIR pos-10-08 pos-10-07 dir-up) + (MOVE-DIR pos-10-08 pos-11-08 dir-right) + (MOVE-DIR pos-11-05 pos-11-06 dir-down) + (MOVE-DIR pos-11-06 pos-11-05 dir-up) + (MOVE-DIR pos-11-06 pos-11-07 dir-down) + (MOVE-DIR pos-11-07 pos-10-07 dir-left) + (MOVE-DIR pos-11-07 pos-11-06 dir-up) + (MOVE-DIR pos-11-07 pos-11-08 dir-down) + (MOVE-DIR pos-11-08 pos-10-08 dir-left) + (MOVE-DIR pos-11-08 pos-11-07 dir-up) + (at player-01 pos-05-06) + (at stone-01 pos-03-03) + (at stone-02 pos-05-03) + (at stone-03 pos-05-04) + (at stone-04 pos-05-05) + (at-goal stone-01) + (at-goal stone-04) + (clear pos-01-01) + (clear pos-01-06) + (clear pos-01-07) + (clear pos-01-08) + (clear pos-02-01) + (clear pos-02-03) + (clear pos-02-04) + (clear pos-03-04) + (clear pos-03-06) + (clear pos-03-07) + (clear pos-04-02) + (clear pos-04-03) + (clear pos-04-04) + (clear pos-04-06) + (clear pos-04-07) + (clear pos-05-02) + (clear pos-05-07) + (clear pos-06-02) + (clear pos-06-03) + (clear pos-06-04) + (clear pos-06-06) + (clear pos-07-03) + (clear pos-07-05) + (clear pos-07-06) + (clear pos-07-08) + (clear pos-08-02) + (clear pos-08-03) + (clear pos-08-05) + (clear pos-08-08) + (clear pos-09-02) + (clear pos-09-03) + (clear pos-09-04) + (clear pos-09-05) + (clear pos-09-07) + (clear pos-09-08) + (clear pos-10-02) + (clear pos-10-03) + (clear pos-10-07) + (clear pos-10-08) + (clear pos-11-05) + (clear pos-11-06) + (clear pos-11-07) + (clear pos-11-08) + (= (total-cost) 0) + ) + (:goal (and + (at-goal stone-01) + (at-goal stone-02) + (at-goal stone-03) + (at-goal stone-04) + )) + (:metric minimize (total-cost)) +) diff --git a/tests/fixtures/pddl_files/sokoban-sequential-optimal/p09.pddl b/tests/fixtures/pddl_files/sokoban-sequential-optimal/p09.pddl new file mode 100644 index 00000000..e5ed6e7e --- /dev/null +++ b/tests/fixtures/pddl_files/sokoban-sequential-optimal/p09.pddl @@ -0,0 +1,541 @@ +;; ### +;; #@# +;; ###$### +;; ## . ## +;; # # # # +;; # # # # +;; # # # # +;; # # # # +;; # # # # +;; ## $ $ ## +;; ##. .## +;; # # +;; # # +;; ##### + +(define (problem p066-microban-sequential) + (:domain sokoban-sequential) + (:objects + dir-down - direction + dir-left - direction + dir-right - direction + dir-up - direction + player-01 - player + pos-01-01 - location + pos-01-02 - location + pos-01-03 - location + pos-01-04 - location + pos-01-05 - location + pos-01-06 - location + pos-01-07 - location + pos-01-08 - location + pos-01-09 - location + pos-01-10 - location + pos-01-11 - location + pos-01-12 - location + pos-01-13 - location + pos-01-14 - location + pos-02-01 - location + pos-02-02 - location + pos-02-03 - location + pos-02-04 - location + pos-02-05 - location + pos-02-06 - location + pos-02-07 - location + pos-02-08 - location + pos-02-09 - location + pos-02-10 - location + pos-02-11 - location + pos-02-12 - location + pos-02-13 - location + pos-02-14 - location + pos-03-01 - location + pos-03-02 - location + pos-03-03 - location + pos-03-04 - location + pos-03-05 - location + pos-03-06 - location + pos-03-07 - location + pos-03-08 - location + pos-03-09 - location + pos-03-10 - location + pos-03-11 - location + pos-03-12 - location + pos-03-13 - location + pos-03-14 - location + pos-04-01 - location + pos-04-02 - location + pos-04-03 - location + pos-04-04 - location + pos-04-05 - location + pos-04-06 - location + pos-04-07 - location + pos-04-08 - location + pos-04-09 - location + pos-04-10 - location + pos-04-11 - location + pos-04-12 - location + pos-04-13 - location + pos-04-14 - location + pos-05-01 - location + pos-05-02 - location + pos-05-03 - location + pos-05-04 - location + pos-05-05 - location + pos-05-06 - location + pos-05-07 - location + pos-05-08 - location + pos-05-09 - location + pos-05-10 - location + pos-05-11 - location + pos-05-12 - location + pos-05-13 - location + pos-05-14 - location + pos-06-01 - location + pos-06-02 - location + pos-06-03 - location + pos-06-04 - location + pos-06-05 - location + pos-06-06 - location + pos-06-07 - location + pos-06-08 - location + pos-06-09 - location + pos-06-10 - location + pos-06-11 - location + pos-06-12 - location + pos-06-13 - location + pos-06-14 - location + pos-07-01 - location + pos-07-02 - location + pos-07-03 - location + pos-07-04 - location + pos-07-05 - location + pos-07-06 - location + pos-07-07 - location + pos-07-08 - location + pos-07-09 - location + pos-07-10 - location + pos-07-11 - location + pos-07-12 - location + pos-07-13 - location + pos-07-14 - location + pos-08-01 - location + pos-08-02 - location + pos-08-03 - location + pos-08-04 - location + pos-08-05 - location + pos-08-06 - location + pos-08-07 - location + pos-08-08 - location + pos-08-09 - location + pos-08-10 - location + pos-08-11 - location + pos-08-12 - location + pos-08-13 - location + pos-08-14 - location + pos-09-01 - location + pos-09-02 - location + pos-09-03 - location + pos-09-04 - location + pos-09-05 - location + pos-09-06 - location + pos-09-07 - location + pos-09-08 - location + pos-09-09 - location + pos-09-10 - location + pos-09-11 - location + pos-09-12 - location + pos-09-13 - location + pos-09-14 - location + stone-01 - stone + stone-02 - stone + stone-03 - stone + ) + (:init + (IS-GOAL pos-04-11) + (IS-GOAL pos-05-04) + (IS-GOAL pos-06-11) + (IS-NONGOAL pos-01-01) + (IS-NONGOAL pos-01-02) + (IS-NONGOAL pos-01-03) + (IS-NONGOAL pos-01-04) + (IS-NONGOAL pos-01-05) + (IS-NONGOAL pos-01-06) + (IS-NONGOAL pos-01-07) + (IS-NONGOAL pos-01-08) + (IS-NONGOAL pos-01-09) + (IS-NONGOAL pos-01-10) + (IS-NONGOAL pos-01-11) + (IS-NONGOAL pos-01-12) + (IS-NONGOAL pos-01-13) + (IS-NONGOAL pos-01-14) + (IS-NONGOAL pos-02-01) + (IS-NONGOAL pos-02-02) + (IS-NONGOAL pos-02-03) + (IS-NONGOAL pos-02-04) + (IS-NONGOAL pos-02-05) + (IS-NONGOAL pos-02-06) + (IS-NONGOAL pos-02-07) + (IS-NONGOAL pos-02-08) + (IS-NONGOAL pos-02-09) + (IS-NONGOAL pos-02-10) + (IS-NONGOAL pos-02-11) + (IS-NONGOAL pos-02-12) + (IS-NONGOAL pos-02-13) + (IS-NONGOAL pos-02-14) + (IS-NONGOAL pos-03-01) + (IS-NONGOAL pos-03-02) + (IS-NONGOAL pos-03-03) + (IS-NONGOAL pos-03-04) + (IS-NONGOAL pos-03-05) + (IS-NONGOAL pos-03-06) + (IS-NONGOAL pos-03-07) + (IS-NONGOAL pos-03-08) + (IS-NONGOAL pos-03-09) + (IS-NONGOAL pos-03-10) + (IS-NONGOAL pos-03-11) + (IS-NONGOAL pos-03-12) + (IS-NONGOAL pos-03-13) + (IS-NONGOAL pos-03-14) + (IS-NONGOAL pos-04-01) + (IS-NONGOAL pos-04-02) + (IS-NONGOAL pos-04-03) + (IS-NONGOAL pos-04-04) + (IS-NONGOAL pos-04-05) + (IS-NONGOAL pos-04-06) + (IS-NONGOAL pos-04-07) + (IS-NONGOAL pos-04-08) + (IS-NONGOAL pos-04-09) + (IS-NONGOAL pos-04-10) + (IS-NONGOAL pos-04-12) + (IS-NONGOAL pos-04-13) + (IS-NONGOAL pos-04-14) + (IS-NONGOAL pos-05-01) + (IS-NONGOAL pos-05-02) + (IS-NONGOAL pos-05-03) + (IS-NONGOAL pos-05-05) + (IS-NONGOAL pos-05-06) + (IS-NONGOAL pos-05-07) + (IS-NONGOAL pos-05-08) + (IS-NONGOAL pos-05-09) + (IS-NONGOAL pos-05-10) + (IS-NONGOAL pos-05-11) + (IS-NONGOAL pos-05-12) + (IS-NONGOAL pos-05-13) + (IS-NONGOAL pos-05-14) + (IS-NONGOAL pos-06-01) + (IS-NONGOAL pos-06-02) + (IS-NONGOAL pos-06-03) + (IS-NONGOAL pos-06-04) + (IS-NONGOAL pos-06-05) + (IS-NONGOAL pos-06-06) + (IS-NONGOAL pos-06-07) + (IS-NONGOAL pos-06-08) + (IS-NONGOAL pos-06-09) + (IS-NONGOAL pos-06-10) + (IS-NONGOAL pos-06-12) + (IS-NONGOAL pos-06-13) + (IS-NONGOAL pos-06-14) + (IS-NONGOAL pos-07-01) + (IS-NONGOAL pos-07-02) + (IS-NONGOAL pos-07-03) + (IS-NONGOAL pos-07-04) + (IS-NONGOAL pos-07-05) + (IS-NONGOAL pos-07-06) + (IS-NONGOAL pos-07-07) + (IS-NONGOAL pos-07-08) + (IS-NONGOAL pos-07-09) + (IS-NONGOAL pos-07-10) + (IS-NONGOAL pos-07-11) + (IS-NONGOAL pos-07-12) + (IS-NONGOAL pos-07-13) + (IS-NONGOAL pos-07-14) + (IS-NONGOAL pos-08-01) + (IS-NONGOAL pos-08-02) + (IS-NONGOAL pos-08-03) + (IS-NONGOAL pos-08-04) + (IS-NONGOAL pos-08-05) + (IS-NONGOAL pos-08-06) + (IS-NONGOAL pos-08-07) + (IS-NONGOAL pos-08-08) + (IS-NONGOAL pos-08-09) + (IS-NONGOAL pos-08-10) + (IS-NONGOAL pos-08-11) + (IS-NONGOAL pos-08-12) + (IS-NONGOAL pos-08-13) + (IS-NONGOAL pos-08-14) + (IS-NONGOAL pos-09-01) + (IS-NONGOAL pos-09-02) + (IS-NONGOAL pos-09-03) + (IS-NONGOAL pos-09-04) + (IS-NONGOAL pos-09-05) + (IS-NONGOAL pos-09-06) + (IS-NONGOAL pos-09-07) + (IS-NONGOAL pos-09-08) + (IS-NONGOAL pos-09-09) + (IS-NONGOAL pos-09-10) + (IS-NONGOAL pos-09-11) + (IS-NONGOAL pos-09-12) + (IS-NONGOAL pos-09-13) + (IS-NONGOAL pos-09-14) + (MOVE-DIR pos-01-01 pos-01-02 dir-down) + (MOVE-DIR pos-01-01 pos-02-01 dir-right) + (MOVE-DIR pos-01-02 pos-01-01 dir-up) + (MOVE-DIR pos-01-02 pos-01-03 dir-down) + (MOVE-DIR pos-01-02 pos-02-02 dir-right) + (MOVE-DIR pos-01-03 pos-01-02 dir-up) + (MOVE-DIR pos-01-11 pos-01-12 dir-down) + (MOVE-DIR pos-01-12 pos-01-11 dir-up) + (MOVE-DIR pos-01-12 pos-01-13 dir-down) + (MOVE-DIR pos-01-12 pos-02-12 dir-right) + (MOVE-DIR pos-01-13 pos-01-12 dir-up) + (MOVE-DIR pos-01-13 pos-01-14 dir-down) + (MOVE-DIR pos-01-13 pos-02-13 dir-right) + (MOVE-DIR pos-01-14 pos-01-13 dir-up) + (MOVE-DIR pos-01-14 pos-02-14 dir-right) + (MOVE-DIR pos-02-01 pos-01-01 dir-left) + (MOVE-DIR pos-02-01 pos-02-02 dir-down) + (MOVE-DIR pos-02-01 pos-03-01 dir-right) + (MOVE-DIR pos-02-02 pos-01-02 dir-left) + (MOVE-DIR pos-02-02 pos-02-01 dir-up) + (MOVE-DIR pos-02-02 pos-03-02 dir-right) + (MOVE-DIR pos-02-05 pos-02-06 dir-down) + (MOVE-DIR pos-02-05 pos-03-05 dir-right) + (MOVE-DIR pos-02-06 pos-02-05 dir-up) + (MOVE-DIR pos-02-06 pos-02-07 dir-down) + (MOVE-DIR pos-02-07 pos-02-06 dir-up) + (MOVE-DIR pos-02-07 pos-02-08 dir-down) + (MOVE-DIR pos-02-08 pos-02-07 dir-up) + (MOVE-DIR pos-02-08 pos-02-09 dir-down) + (MOVE-DIR pos-02-09 pos-02-08 dir-up) + (MOVE-DIR pos-02-09 pos-03-09 dir-right) + (MOVE-DIR pos-02-12 pos-01-12 dir-left) + (MOVE-DIR pos-02-12 pos-02-13 dir-down) + (MOVE-DIR pos-02-13 pos-01-13 dir-left) + (MOVE-DIR pos-02-13 pos-02-12 dir-up) + (MOVE-DIR pos-02-13 pos-02-14 dir-down) + (MOVE-DIR pos-02-14 pos-01-14 dir-left) + (MOVE-DIR pos-02-14 pos-02-13 dir-up) + (MOVE-DIR pos-03-01 pos-02-01 dir-left) + (MOVE-DIR pos-03-01 pos-03-02 dir-down) + (MOVE-DIR pos-03-02 pos-02-02 dir-left) + (MOVE-DIR pos-03-02 pos-03-01 dir-up) + (MOVE-DIR pos-03-04 pos-03-05 dir-down) + (MOVE-DIR pos-03-04 pos-04-04 dir-right) + (MOVE-DIR pos-03-05 pos-02-05 dir-left) + (MOVE-DIR pos-03-05 pos-03-04 dir-up) + (MOVE-DIR pos-03-09 pos-02-09 dir-left) + (MOVE-DIR pos-03-09 pos-03-10 dir-down) + (MOVE-DIR pos-03-10 pos-03-09 dir-up) + (MOVE-DIR pos-03-10 pos-04-10 dir-right) + (MOVE-DIR pos-04-04 pos-03-04 dir-left) + (MOVE-DIR pos-04-04 pos-05-04 dir-right) + (MOVE-DIR pos-04-06 pos-04-07 dir-down) + (MOVE-DIR pos-04-06 pos-05-06 dir-right) + (MOVE-DIR pos-04-07 pos-04-06 dir-up) + (MOVE-DIR pos-04-07 pos-04-08 dir-down) + (MOVE-DIR pos-04-07 pos-05-07 dir-right) + (MOVE-DIR pos-04-08 pos-04-07 dir-up) + (MOVE-DIR pos-04-08 pos-05-08 dir-right) + (MOVE-DIR pos-04-10 pos-03-10 dir-left) + (MOVE-DIR pos-04-10 pos-04-11 dir-down) + (MOVE-DIR pos-04-10 pos-05-10 dir-right) + (MOVE-DIR pos-04-11 pos-04-10 dir-up) + (MOVE-DIR pos-04-11 pos-04-12 dir-down) + (MOVE-DIR pos-04-11 pos-05-11 dir-right) + (MOVE-DIR pos-04-12 pos-04-11 dir-up) + (MOVE-DIR pos-04-12 pos-04-13 dir-down) + (MOVE-DIR pos-04-12 pos-05-12 dir-right) + (MOVE-DIR pos-04-13 pos-04-12 dir-up) + (MOVE-DIR pos-04-13 pos-05-13 dir-right) + (MOVE-DIR pos-05-02 pos-05-03 dir-down) + (MOVE-DIR pos-05-03 pos-05-02 dir-up) + (MOVE-DIR pos-05-03 pos-05-04 dir-down) + (MOVE-DIR pos-05-04 pos-04-04 dir-left) + (MOVE-DIR pos-05-04 pos-05-03 dir-up) + (MOVE-DIR pos-05-04 pos-05-05 dir-down) + (MOVE-DIR pos-05-04 pos-06-04 dir-right) + (MOVE-DIR pos-05-05 pos-05-04 dir-up) + (MOVE-DIR pos-05-05 pos-05-06 dir-down) + (MOVE-DIR pos-05-06 pos-04-06 dir-left) + (MOVE-DIR pos-05-06 pos-05-05 dir-up) + (MOVE-DIR pos-05-06 pos-05-07 dir-down) + (MOVE-DIR pos-05-06 pos-06-06 dir-right) + (MOVE-DIR pos-05-07 pos-04-07 dir-left) + (MOVE-DIR pos-05-07 pos-05-06 dir-up) + (MOVE-DIR pos-05-07 pos-05-08 dir-down) + (MOVE-DIR pos-05-07 pos-06-07 dir-right) + (MOVE-DIR pos-05-08 pos-04-08 dir-left) + (MOVE-DIR pos-05-08 pos-05-07 dir-up) + (MOVE-DIR pos-05-08 pos-05-09 dir-down) + (MOVE-DIR pos-05-08 pos-06-08 dir-right) + (MOVE-DIR pos-05-09 pos-05-08 dir-up) + (MOVE-DIR pos-05-09 pos-05-10 dir-down) + (MOVE-DIR pos-05-10 pos-04-10 dir-left) + (MOVE-DIR pos-05-10 pos-05-09 dir-up) + (MOVE-DIR pos-05-10 pos-05-11 dir-down) + (MOVE-DIR pos-05-10 pos-06-10 dir-right) + (MOVE-DIR pos-05-11 pos-04-11 dir-left) + (MOVE-DIR pos-05-11 pos-05-10 dir-up) + (MOVE-DIR pos-05-11 pos-05-12 dir-down) + (MOVE-DIR pos-05-11 pos-06-11 dir-right) + (MOVE-DIR pos-05-12 pos-04-12 dir-left) + (MOVE-DIR pos-05-12 pos-05-11 dir-up) + (MOVE-DIR pos-05-12 pos-05-13 dir-down) + (MOVE-DIR pos-05-12 pos-06-12 dir-right) + (MOVE-DIR pos-05-13 pos-04-13 dir-left) + (MOVE-DIR pos-05-13 pos-05-12 dir-up) + (MOVE-DIR pos-05-13 pos-06-13 dir-right) + (MOVE-DIR pos-06-04 pos-05-04 dir-left) + (MOVE-DIR pos-06-04 pos-07-04 dir-right) + (MOVE-DIR pos-06-06 pos-05-06 dir-left) + (MOVE-DIR pos-06-06 pos-06-07 dir-down) + (MOVE-DIR pos-06-07 pos-05-07 dir-left) + (MOVE-DIR pos-06-07 pos-06-06 dir-up) + (MOVE-DIR pos-06-07 pos-06-08 dir-down) + (MOVE-DIR pos-06-08 pos-05-08 dir-left) + (MOVE-DIR pos-06-08 pos-06-07 dir-up) + (MOVE-DIR pos-06-10 pos-05-10 dir-left) + (MOVE-DIR pos-06-10 pos-06-11 dir-down) + (MOVE-DIR pos-06-10 pos-07-10 dir-right) + (MOVE-DIR pos-06-11 pos-05-11 dir-left) + (MOVE-DIR pos-06-11 pos-06-10 dir-up) + (MOVE-DIR pos-06-11 pos-06-12 dir-down) + (MOVE-DIR pos-06-12 pos-05-12 dir-left) + (MOVE-DIR pos-06-12 pos-06-11 dir-up) + (MOVE-DIR pos-06-12 pos-06-13 dir-down) + (MOVE-DIR pos-06-13 pos-05-13 dir-left) + (MOVE-DIR pos-06-13 pos-06-12 dir-up) + (MOVE-DIR pos-07-01 pos-07-02 dir-down) + (MOVE-DIR pos-07-01 pos-08-01 dir-right) + (MOVE-DIR pos-07-02 pos-07-01 dir-up) + (MOVE-DIR pos-07-02 pos-08-02 dir-right) + (MOVE-DIR pos-07-04 pos-06-04 dir-left) + (MOVE-DIR pos-07-04 pos-07-05 dir-down) + (MOVE-DIR pos-07-05 pos-07-04 dir-up) + (MOVE-DIR pos-07-05 pos-08-05 dir-right) + (MOVE-DIR pos-07-09 pos-07-10 dir-down) + (MOVE-DIR pos-07-09 pos-08-09 dir-right) + (MOVE-DIR pos-07-10 pos-06-10 dir-left) + (MOVE-DIR pos-07-10 pos-07-09 dir-up) + (MOVE-DIR pos-08-01 pos-07-01 dir-left) + (MOVE-DIR pos-08-01 pos-08-02 dir-down) + (MOVE-DIR pos-08-01 pos-09-01 dir-right) + (MOVE-DIR pos-08-02 pos-07-02 dir-left) + (MOVE-DIR pos-08-02 pos-08-01 dir-up) + (MOVE-DIR pos-08-02 pos-09-02 dir-right) + (MOVE-DIR pos-08-05 pos-07-05 dir-left) + (MOVE-DIR pos-08-05 pos-08-06 dir-down) + (MOVE-DIR pos-08-06 pos-08-05 dir-up) + (MOVE-DIR pos-08-06 pos-08-07 dir-down) + (MOVE-DIR pos-08-07 pos-08-06 dir-up) + (MOVE-DIR pos-08-07 pos-08-08 dir-down) + (MOVE-DIR pos-08-08 pos-08-07 dir-up) + (MOVE-DIR pos-08-08 pos-08-09 dir-down) + (MOVE-DIR pos-08-09 pos-07-09 dir-left) + (MOVE-DIR pos-08-09 pos-08-08 dir-up) + (MOVE-DIR pos-08-12 pos-08-13 dir-down) + (MOVE-DIR pos-08-12 pos-09-12 dir-right) + (MOVE-DIR pos-08-13 pos-08-12 dir-up) + (MOVE-DIR pos-08-13 pos-08-14 dir-down) + (MOVE-DIR pos-08-13 pos-09-13 dir-right) + (MOVE-DIR pos-08-14 pos-08-13 dir-up) + (MOVE-DIR pos-08-14 pos-09-14 dir-right) + (MOVE-DIR pos-09-01 pos-08-01 dir-left) + (MOVE-DIR pos-09-01 pos-09-02 dir-down) + (MOVE-DIR pos-09-02 pos-08-02 dir-left) + (MOVE-DIR pos-09-02 pos-09-01 dir-up) + (MOVE-DIR pos-09-02 pos-09-03 dir-down) + (MOVE-DIR pos-09-03 pos-09-02 dir-up) + (MOVE-DIR pos-09-11 pos-09-12 dir-down) + (MOVE-DIR pos-09-12 pos-08-12 dir-left) + (MOVE-DIR pos-09-12 pos-09-11 dir-up) + (MOVE-DIR pos-09-12 pos-09-13 dir-down) + (MOVE-DIR pos-09-13 pos-08-13 dir-left) + (MOVE-DIR pos-09-13 pos-09-12 dir-up) + (MOVE-DIR pos-09-13 pos-09-14 dir-down) + (MOVE-DIR pos-09-14 pos-08-14 dir-left) + (MOVE-DIR pos-09-14 pos-09-13 dir-up) + (at player-01 pos-05-02) + (at stone-01 pos-05-03) + (at stone-02 pos-04-10) + (at stone-03 pos-06-10) + (clear pos-01-01) + (clear pos-01-02) + (clear pos-01-03) + (clear pos-01-11) + (clear pos-01-12) + (clear pos-01-13) + (clear pos-01-14) + (clear pos-02-01) + (clear pos-02-02) + (clear pos-02-05) + (clear pos-02-06) + (clear pos-02-07) + (clear pos-02-08) + (clear pos-02-09) + (clear pos-02-12) + (clear pos-02-13) + (clear pos-02-14) + (clear pos-03-01) + (clear pos-03-02) + (clear pos-03-04) + (clear pos-03-05) + (clear pos-03-09) + (clear pos-03-10) + (clear pos-04-04) + (clear pos-04-06) + (clear pos-04-07) + (clear pos-04-08) + (clear pos-04-11) + (clear pos-04-12) + (clear pos-04-13) + (clear pos-05-04) + (clear pos-05-05) + (clear pos-05-06) + (clear pos-05-07) + (clear pos-05-08) + (clear pos-05-09) + (clear pos-05-10) + (clear pos-05-11) + (clear pos-05-12) + (clear pos-05-13) + (clear pos-06-04) + (clear pos-06-06) + (clear pos-06-07) + (clear pos-06-08) + (clear pos-06-11) + (clear pos-06-12) + (clear pos-06-13) + (clear pos-07-01) + (clear pos-07-02) + (clear pos-07-04) + (clear pos-07-05) + (clear pos-07-09) + (clear pos-07-10) + (clear pos-08-01) + (clear pos-08-02) + (clear pos-08-05) + (clear pos-08-06) + (clear pos-08-07) + (clear pos-08-08) + (clear pos-08-09) + (clear pos-08-12) + (clear pos-08-13) + (clear pos-08-14) + (clear pos-09-01) + (clear pos-09-02) + (clear pos-09-03) + (clear pos-09-11) + (clear pos-09-12) + (clear pos-09-13) + (clear pos-09-14) + (= (total-cost) 0) + ) + (:goal (and + (at-goal stone-01) + (at-goal stone-02) + (at-goal stone-03) + )) + (:metric minimize (total-cost)) +) diff --git a/tests/fixtures/pddl_files/sokoban-sequential-optimal/p10.pddl b/tests/fixtures/pddl_files/sokoban-sequential-optimal/p10.pddl new file mode 100644 index 00000000..e5aef5ff --- /dev/null +++ b/tests/fixtures/pddl_files/sokoban-sequential-optimal/p10.pddl @@ -0,0 +1,325 @@ +;; ######## +;; #@ # +;; # .$$. # +;; # $..$ # +;; # $..$ # +;; # .$$. # +;; # # +;; ######## + +(define (problem p095-microban-sequential) + (:domain sokoban-sequential) + (:objects + dir-down - direction + dir-left - direction + dir-right - direction + dir-up - direction + player-01 - player + pos-1-1 - location + pos-1-2 - location + pos-1-3 - location + pos-1-4 - location + pos-1-5 - location + pos-1-6 - location + pos-1-7 - location + pos-1-8 - location + pos-2-1 - location + pos-2-2 - location + pos-2-3 - location + pos-2-4 - location + pos-2-5 - location + pos-2-6 - location + pos-2-7 - location + pos-2-8 - location + pos-3-1 - location + pos-3-2 - location + pos-3-3 - location + pos-3-4 - location + pos-3-5 - location + pos-3-6 - location + pos-3-7 - location + pos-3-8 - location + pos-4-1 - location + pos-4-2 - location + pos-4-3 - location + pos-4-4 - location + pos-4-5 - location + pos-4-6 - location + pos-4-7 - location + pos-4-8 - location + pos-5-1 - location + pos-5-2 - location + pos-5-3 - location + pos-5-4 - location + pos-5-5 - location + pos-5-6 - location + pos-5-7 - location + pos-5-8 - location + pos-6-1 - location + pos-6-2 - location + pos-6-3 - location + pos-6-4 - location + pos-6-5 - location + pos-6-6 - location + pos-6-7 - location + pos-6-8 - location + pos-7-1 - location + pos-7-2 - location + pos-7-3 - location + pos-7-4 - location + pos-7-5 - location + pos-7-6 - location + pos-7-7 - location + pos-7-8 - location + pos-8-1 - location + pos-8-2 - location + pos-8-3 - location + pos-8-4 - location + pos-8-5 - location + pos-8-6 - location + pos-8-7 - location + pos-8-8 - location + stone-01 - stone + stone-02 - stone + stone-03 - stone + stone-04 - stone + stone-05 - stone + stone-06 - stone + stone-07 - stone + stone-08 - stone + ) + (:init + (IS-GOAL pos-3-3) + (IS-GOAL pos-3-6) + (IS-GOAL pos-4-4) + (IS-GOAL pos-4-5) + (IS-GOAL pos-5-4) + (IS-GOAL pos-5-5) + (IS-GOAL pos-6-3) + (IS-GOAL pos-6-6) + (IS-NONGOAL pos-1-1) + (IS-NONGOAL pos-1-2) + (IS-NONGOAL pos-1-3) + (IS-NONGOAL pos-1-4) + (IS-NONGOAL pos-1-5) + (IS-NONGOAL pos-1-6) + (IS-NONGOAL pos-1-7) + (IS-NONGOAL pos-1-8) + (IS-NONGOAL pos-2-1) + (IS-NONGOAL pos-2-2) + (IS-NONGOAL pos-2-3) + (IS-NONGOAL pos-2-4) + (IS-NONGOAL pos-2-5) + (IS-NONGOAL pos-2-6) + (IS-NONGOAL pos-2-7) + (IS-NONGOAL pos-2-8) + (IS-NONGOAL pos-3-1) + (IS-NONGOAL pos-3-2) + (IS-NONGOAL pos-3-4) + (IS-NONGOAL pos-3-5) + (IS-NONGOAL pos-3-7) + (IS-NONGOAL pos-3-8) + (IS-NONGOAL pos-4-1) + (IS-NONGOAL pos-4-2) + (IS-NONGOAL pos-4-3) + (IS-NONGOAL pos-4-6) + (IS-NONGOAL pos-4-7) + (IS-NONGOAL pos-4-8) + (IS-NONGOAL pos-5-1) + (IS-NONGOAL pos-5-2) + (IS-NONGOAL pos-5-3) + (IS-NONGOAL pos-5-6) + (IS-NONGOAL pos-5-7) + (IS-NONGOAL pos-5-8) + (IS-NONGOAL pos-6-1) + (IS-NONGOAL pos-6-2) + (IS-NONGOAL pos-6-4) + (IS-NONGOAL pos-6-5) + (IS-NONGOAL pos-6-7) + (IS-NONGOAL pos-6-8) + (IS-NONGOAL pos-7-1) + (IS-NONGOAL pos-7-2) + (IS-NONGOAL pos-7-3) + (IS-NONGOAL pos-7-4) + (IS-NONGOAL pos-7-5) + (IS-NONGOAL pos-7-6) + (IS-NONGOAL pos-7-7) + (IS-NONGOAL pos-7-8) + (IS-NONGOAL pos-8-1) + (IS-NONGOAL pos-8-2) + (IS-NONGOAL pos-8-3) + (IS-NONGOAL pos-8-4) + (IS-NONGOAL pos-8-5) + (IS-NONGOAL pos-8-6) + (IS-NONGOAL pos-8-7) + (IS-NONGOAL pos-8-8) + (MOVE-DIR pos-2-2 pos-2-3 dir-down) + (MOVE-DIR pos-2-2 pos-3-2 dir-right) + (MOVE-DIR pos-2-3 pos-2-2 dir-up) + (MOVE-DIR pos-2-3 pos-2-4 dir-down) + (MOVE-DIR pos-2-3 pos-3-3 dir-right) + (MOVE-DIR pos-2-4 pos-2-3 dir-up) + (MOVE-DIR pos-2-4 pos-2-5 dir-down) + (MOVE-DIR pos-2-4 pos-3-4 dir-right) + (MOVE-DIR pos-2-5 pos-2-4 dir-up) + (MOVE-DIR pos-2-5 pos-2-6 dir-down) + (MOVE-DIR pos-2-5 pos-3-5 dir-right) + (MOVE-DIR pos-2-6 pos-2-5 dir-up) + (MOVE-DIR pos-2-6 pos-2-7 dir-down) + (MOVE-DIR pos-2-6 pos-3-6 dir-right) + (MOVE-DIR pos-2-7 pos-2-6 dir-up) + (MOVE-DIR pos-2-7 pos-3-7 dir-right) + (MOVE-DIR pos-3-2 pos-2-2 dir-left) + (MOVE-DIR pos-3-2 pos-3-3 dir-down) + (MOVE-DIR pos-3-2 pos-4-2 dir-right) + (MOVE-DIR pos-3-3 pos-2-3 dir-left) + (MOVE-DIR pos-3-3 pos-3-2 dir-up) + (MOVE-DIR pos-3-3 pos-3-4 dir-down) + (MOVE-DIR pos-3-3 pos-4-3 dir-right) + (MOVE-DIR pos-3-4 pos-2-4 dir-left) + (MOVE-DIR pos-3-4 pos-3-3 dir-up) + (MOVE-DIR pos-3-4 pos-3-5 dir-down) + (MOVE-DIR pos-3-4 pos-4-4 dir-right) + (MOVE-DIR pos-3-5 pos-2-5 dir-left) + (MOVE-DIR pos-3-5 pos-3-4 dir-up) + (MOVE-DIR pos-3-5 pos-3-6 dir-down) + (MOVE-DIR pos-3-5 pos-4-5 dir-right) + (MOVE-DIR pos-3-6 pos-2-6 dir-left) + (MOVE-DIR pos-3-6 pos-3-5 dir-up) + (MOVE-DIR pos-3-6 pos-3-7 dir-down) + (MOVE-DIR pos-3-6 pos-4-6 dir-right) + (MOVE-DIR pos-3-7 pos-2-7 dir-left) + (MOVE-DIR pos-3-7 pos-3-6 dir-up) + (MOVE-DIR pos-3-7 pos-4-7 dir-right) + (MOVE-DIR pos-4-2 pos-3-2 dir-left) + (MOVE-DIR pos-4-2 pos-4-3 dir-down) + (MOVE-DIR pos-4-2 pos-5-2 dir-right) + (MOVE-DIR pos-4-3 pos-3-3 dir-left) + (MOVE-DIR pos-4-3 pos-4-2 dir-up) + (MOVE-DIR pos-4-3 pos-4-4 dir-down) + (MOVE-DIR pos-4-3 pos-5-3 dir-right) + (MOVE-DIR pos-4-4 pos-3-4 dir-left) + (MOVE-DIR pos-4-4 pos-4-3 dir-up) + (MOVE-DIR pos-4-4 pos-4-5 dir-down) + (MOVE-DIR pos-4-4 pos-5-4 dir-right) + (MOVE-DIR pos-4-5 pos-3-5 dir-left) + (MOVE-DIR pos-4-5 pos-4-4 dir-up) + (MOVE-DIR pos-4-5 pos-4-6 dir-down) + (MOVE-DIR pos-4-5 pos-5-5 dir-right) + (MOVE-DIR pos-4-6 pos-3-6 dir-left) + (MOVE-DIR pos-4-6 pos-4-5 dir-up) + (MOVE-DIR pos-4-6 pos-4-7 dir-down) + (MOVE-DIR pos-4-6 pos-5-6 dir-right) + (MOVE-DIR pos-4-7 pos-3-7 dir-left) + (MOVE-DIR pos-4-7 pos-4-6 dir-up) + (MOVE-DIR pos-4-7 pos-5-7 dir-right) + (MOVE-DIR pos-5-2 pos-4-2 dir-left) + (MOVE-DIR pos-5-2 pos-5-3 dir-down) + (MOVE-DIR pos-5-2 pos-6-2 dir-right) + (MOVE-DIR pos-5-3 pos-4-3 dir-left) + (MOVE-DIR pos-5-3 pos-5-2 dir-up) + (MOVE-DIR pos-5-3 pos-5-4 dir-down) + (MOVE-DIR pos-5-3 pos-6-3 dir-right) + (MOVE-DIR pos-5-4 pos-4-4 dir-left) + (MOVE-DIR pos-5-4 pos-5-3 dir-up) + (MOVE-DIR pos-5-4 pos-5-5 dir-down) + (MOVE-DIR pos-5-4 pos-6-4 dir-right) + (MOVE-DIR pos-5-5 pos-4-5 dir-left) + (MOVE-DIR pos-5-5 pos-5-4 dir-up) + (MOVE-DIR pos-5-5 pos-5-6 dir-down) + (MOVE-DIR pos-5-5 pos-6-5 dir-right) + (MOVE-DIR pos-5-6 pos-4-6 dir-left) + (MOVE-DIR pos-5-6 pos-5-5 dir-up) + (MOVE-DIR pos-5-6 pos-5-7 dir-down) + (MOVE-DIR pos-5-6 pos-6-6 dir-right) + (MOVE-DIR pos-5-7 pos-4-7 dir-left) + (MOVE-DIR pos-5-7 pos-5-6 dir-up) + (MOVE-DIR pos-5-7 pos-6-7 dir-right) + (MOVE-DIR pos-6-2 pos-5-2 dir-left) + (MOVE-DIR pos-6-2 pos-6-3 dir-down) + (MOVE-DIR pos-6-2 pos-7-2 dir-right) + (MOVE-DIR pos-6-3 pos-5-3 dir-left) + (MOVE-DIR pos-6-3 pos-6-2 dir-up) + (MOVE-DIR pos-6-3 pos-6-4 dir-down) + (MOVE-DIR pos-6-3 pos-7-3 dir-right) + (MOVE-DIR pos-6-4 pos-5-4 dir-left) + (MOVE-DIR pos-6-4 pos-6-3 dir-up) + (MOVE-DIR pos-6-4 pos-6-5 dir-down) + (MOVE-DIR pos-6-4 pos-7-4 dir-right) + (MOVE-DIR pos-6-5 pos-5-5 dir-left) + (MOVE-DIR pos-6-5 pos-6-4 dir-up) + (MOVE-DIR pos-6-5 pos-6-6 dir-down) + (MOVE-DIR pos-6-5 pos-7-5 dir-right) + (MOVE-DIR pos-6-6 pos-5-6 dir-left) + (MOVE-DIR pos-6-6 pos-6-5 dir-up) + (MOVE-DIR pos-6-6 pos-6-7 dir-down) + (MOVE-DIR pos-6-6 pos-7-6 dir-right) + (MOVE-DIR pos-6-7 pos-5-7 dir-left) + (MOVE-DIR pos-6-7 pos-6-6 dir-up) + (MOVE-DIR pos-6-7 pos-7-7 dir-right) + (MOVE-DIR pos-7-2 pos-6-2 dir-left) + (MOVE-DIR pos-7-2 pos-7-3 dir-down) + (MOVE-DIR pos-7-3 pos-6-3 dir-left) + (MOVE-DIR pos-7-3 pos-7-2 dir-up) + (MOVE-DIR pos-7-3 pos-7-4 dir-down) + (MOVE-DIR pos-7-4 pos-6-4 dir-left) + (MOVE-DIR pos-7-4 pos-7-3 dir-up) + (MOVE-DIR pos-7-4 pos-7-5 dir-down) + (MOVE-DIR pos-7-5 pos-6-5 dir-left) + (MOVE-DIR pos-7-5 pos-7-4 dir-up) + (MOVE-DIR pos-7-5 pos-7-6 dir-down) + (MOVE-DIR pos-7-6 pos-6-6 dir-left) + (MOVE-DIR pos-7-6 pos-7-5 dir-up) + (MOVE-DIR pos-7-6 pos-7-7 dir-down) + (MOVE-DIR pos-7-7 pos-6-7 dir-left) + (MOVE-DIR pos-7-7 pos-7-6 dir-up) + (at player-01 pos-2-2) + (at stone-01 pos-4-3) + (at stone-02 pos-5-3) + (at stone-03 pos-3-4) + (at stone-04 pos-6-4) + (at stone-05 pos-3-5) + (at stone-06 pos-6-5) + (at stone-07 pos-4-6) + (at stone-08 pos-5-6) + (clear pos-2-3) + (clear pos-2-4) + (clear pos-2-5) + (clear pos-2-6) + (clear pos-2-7) + (clear pos-3-2) + (clear pos-3-3) + (clear pos-3-6) + (clear pos-3-7) + (clear pos-4-2) + (clear pos-4-4) + (clear pos-4-5) + (clear pos-4-7) + (clear pos-5-2) + (clear pos-5-4) + (clear pos-5-5) + (clear pos-5-7) + (clear pos-6-2) + (clear pos-6-3) + (clear pos-6-6) + (clear pos-6-7) + (clear pos-7-2) + (clear pos-7-3) + (clear pos-7-4) + (clear pos-7-5) + (clear pos-7-6) + (clear pos-7-7) + (= (total-cost) 0) + ) + (:goal (and + (at-goal stone-01) + (at-goal stone-02) + (at-goal stone-03) + (at-goal stone-04) + (at-goal stone-05) + (at-goal stone-06) + (at-goal stone-07) + (at-goal stone-08) + )) + (:metric minimize (total-cost)) +) diff --git a/tests/fixtures/pddl_files/sokoban-sequential-optimal/p11.pddl b/tests/fixtures/pddl_files/sokoban-sequential-optimal/p11.pddl new file mode 100644 index 00000000..fb5475b0 --- /dev/null +++ b/tests/fixtures/pddl_files/sokoban-sequential-optimal/p11.pddl @@ -0,0 +1,373 @@ +;; #### +;; # # +;; # #### +;; ###$.$ # +;; # .@. # +;; # $.$### +;; #### # +;; # # +;; #### + +(define (problem p142-microban-sequential) + (:domain sokoban-sequential) + (:objects + dir-down - direction + dir-left - direction + dir-right - direction + dir-up - direction + player-01 - player + pos-1-1 - location + pos-1-2 - location + pos-1-3 - location + pos-1-4 - location + pos-1-5 - location + pos-1-6 - location + pos-1-7 - location + pos-1-8 - location + pos-1-9 - location + pos-2-1 - location + pos-2-2 - location + pos-2-3 - location + pos-2-4 - location + pos-2-5 - location + pos-2-6 - location + pos-2-7 - location + pos-2-8 - location + pos-2-9 - location + pos-3-1 - location + pos-3-2 - location + pos-3-3 - location + pos-3-4 - location + pos-3-5 - location + pos-3-6 - location + pos-3-7 - location + pos-3-8 - location + pos-3-9 - location + pos-4-1 - location + pos-4-2 - location + pos-4-3 - location + pos-4-4 - location + pos-4-5 - location + pos-4-6 - location + pos-4-7 - location + pos-4-8 - location + pos-4-9 - location + pos-5-1 - location + pos-5-2 - location + pos-5-3 - location + pos-5-4 - location + pos-5-5 - location + pos-5-6 - location + pos-5-7 - location + pos-5-8 - location + pos-5-9 - location + pos-6-1 - location + pos-6-2 - location + pos-6-3 - location + pos-6-4 - location + pos-6-5 - location + pos-6-6 - location + pos-6-7 - location + pos-6-8 - location + pos-6-9 - location + pos-7-1 - location + pos-7-2 - location + pos-7-3 - location + pos-7-4 - location + pos-7-5 - location + pos-7-6 - location + pos-7-7 - location + pos-7-8 - location + pos-7-9 - location + pos-8-1 - location + pos-8-2 - location + pos-8-3 - location + pos-8-4 - location + pos-8-5 - location + pos-8-6 - location + pos-8-7 - location + pos-8-8 - location + pos-8-9 - location + pos-9-1 - location + pos-9-2 - location + pos-9-3 - location + pos-9-4 - location + pos-9-5 - location + pos-9-6 - location + pos-9-7 - location + pos-9-8 - location + pos-9-9 - location + stone-01 - stone + stone-02 - stone + stone-03 - stone + stone-04 - stone + ) + (:init + (IS-GOAL pos-4-5) + (IS-GOAL pos-5-4) + (IS-GOAL pos-5-6) + (IS-GOAL pos-6-5) + (IS-NONGOAL pos-1-1) + (IS-NONGOAL pos-1-2) + (IS-NONGOAL pos-1-3) + (IS-NONGOAL pos-1-4) + (IS-NONGOAL pos-1-5) + (IS-NONGOAL pos-1-6) + (IS-NONGOAL pos-1-7) + (IS-NONGOAL pos-1-8) + (IS-NONGOAL pos-1-9) + (IS-NONGOAL pos-2-1) + (IS-NONGOAL pos-2-2) + (IS-NONGOAL pos-2-3) + (IS-NONGOAL pos-2-4) + (IS-NONGOAL pos-2-5) + (IS-NONGOAL pos-2-6) + (IS-NONGOAL pos-2-7) + (IS-NONGOAL pos-2-8) + (IS-NONGOAL pos-2-9) + (IS-NONGOAL pos-3-1) + (IS-NONGOAL pos-3-2) + (IS-NONGOAL pos-3-3) + (IS-NONGOAL pos-3-4) + (IS-NONGOAL pos-3-5) + (IS-NONGOAL pos-3-6) + (IS-NONGOAL pos-3-7) + (IS-NONGOAL pos-3-8) + (IS-NONGOAL pos-3-9) + (IS-NONGOAL pos-4-1) + (IS-NONGOAL pos-4-2) + (IS-NONGOAL pos-4-3) + (IS-NONGOAL pos-4-4) + (IS-NONGOAL pos-4-6) + (IS-NONGOAL pos-4-7) + (IS-NONGOAL pos-4-8) + (IS-NONGOAL pos-4-9) + (IS-NONGOAL pos-5-1) + (IS-NONGOAL pos-5-2) + (IS-NONGOAL pos-5-3) + (IS-NONGOAL pos-5-5) + (IS-NONGOAL pos-5-7) + (IS-NONGOAL pos-5-8) + (IS-NONGOAL pos-5-9) + (IS-NONGOAL pos-6-1) + (IS-NONGOAL pos-6-2) + (IS-NONGOAL pos-6-3) + (IS-NONGOAL pos-6-4) + (IS-NONGOAL pos-6-6) + (IS-NONGOAL pos-6-7) + (IS-NONGOAL pos-6-8) + (IS-NONGOAL pos-6-9) + (IS-NONGOAL pos-7-1) + (IS-NONGOAL pos-7-2) + (IS-NONGOAL pos-7-3) + (IS-NONGOAL pos-7-4) + (IS-NONGOAL pos-7-5) + (IS-NONGOAL pos-7-6) + (IS-NONGOAL pos-7-7) + (IS-NONGOAL pos-7-8) + (IS-NONGOAL pos-7-9) + (IS-NONGOAL pos-8-1) + (IS-NONGOAL pos-8-2) + (IS-NONGOAL pos-8-3) + (IS-NONGOAL pos-8-4) + (IS-NONGOAL pos-8-5) + (IS-NONGOAL pos-8-6) + (IS-NONGOAL pos-8-7) + (IS-NONGOAL pos-8-8) + (IS-NONGOAL pos-8-9) + (IS-NONGOAL pos-9-1) + (IS-NONGOAL pos-9-2) + (IS-NONGOAL pos-9-3) + (IS-NONGOAL pos-9-4) + (IS-NONGOAL pos-9-5) + (IS-NONGOAL pos-9-6) + (IS-NONGOAL pos-9-7) + (IS-NONGOAL pos-9-8) + (IS-NONGOAL pos-9-9) + (MOVE-DIR pos-1-1 pos-1-2 dir-down) + (MOVE-DIR pos-1-1 pos-2-1 dir-right) + (MOVE-DIR pos-1-2 pos-1-1 dir-up) + (MOVE-DIR pos-1-2 pos-1-3 dir-down) + (MOVE-DIR pos-1-2 pos-2-2 dir-right) + (MOVE-DIR pos-1-3 pos-1-2 dir-up) + (MOVE-DIR pos-1-3 pos-2-3 dir-right) + (MOVE-DIR pos-1-8 pos-1-9 dir-down) + (MOVE-DIR pos-1-8 pos-2-8 dir-right) + (MOVE-DIR pos-1-9 pos-1-8 dir-up) + (MOVE-DIR pos-1-9 pos-2-9 dir-right) + (MOVE-DIR pos-2-1 pos-1-1 dir-left) + (MOVE-DIR pos-2-1 pos-2-2 dir-down) + (MOVE-DIR pos-2-2 pos-1-2 dir-left) + (MOVE-DIR pos-2-2 pos-2-1 dir-up) + (MOVE-DIR pos-2-2 pos-2-3 dir-down) + (MOVE-DIR pos-2-3 pos-1-3 dir-left) + (MOVE-DIR pos-2-3 pos-2-2 dir-up) + (MOVE-DIR pos-2-5 pos-2-6 dir-down) + (MOVE-DIR pos-2-5 pos-3-5 dir-right) + (MOVE-DIR pos-2-6 pos-2-5 dir-up) + (MOVE-DIR pos-2-6 pos-3-6 dir-right) + (MOVE-DIR pos-2-8 pos-1-8 dir-left) + (MOVE-DIR pos-2-8 pos-2-9 dir-down) + (MOVE-DIR pos-2-8 pos-3-8 dir-right) + (MOVE-DIR pos-2-9 pos-1-9 dir-left) + (MOVE-DIR pos-2-9 pos-2-8 dir-up) + (MOVE-DIR pos-2-9 pos-3-9 dir-right) + (MOVE-DIR pos-3-5 pos-2-5 dir-left) + (MOVE-DIR pos-3-5 pos-3-6 dir-down) + (MOVE-DIR pos-3-5 pos-4-5 dir-right) + (MOVE-DIR pos-3-6 pos-2-6 dir-left) + (MOVE-DIR pos-3-6 pos-3-5 dir-up) + (MOVE-DIR pos-3-6 pos-4-6 dir-right) + (MOVE-DIR pos-3-8 pos-2-8 dir-left) + (MOVE-DIR pos-3-8 pos-3-9 dir-down) + (MOVE-DIR pos-3-9 pos-2-9 dir-left) + (MOVE-DIR pos-3-9 pos-3-8 dir-up) + (MOVE-DIR pos-4-2 pos-4-3 dir-down) + (MOVE-DIR pos-4-2 pos-5-2 dir-right) + (MOVE-DIR pos-4-3 pos-4-2 dir-up) + (MOVE-DIR pos-4-3 pos-4-4 dir-down) + (MOVE-DIR pos-4-3 pos-5-3 dir-right) + (MOVE-DIR pos-4-4 pos-4-3 dir-up) + (MOVE-DIR pos-4-4 pos-4-5 dir-down) + (MOVE-DIR pos-4-4 pos-5-4 dir-right) + (MOVE-DIR pos-4-5 pos-3-5 dir-left) + (MOVE-DIR pos-4-5 pos-4-4 dir-up) + (MOVE-DIR pos-4-5 pos-4-6 dir-down) + (MOVE-DIR pos-4-5 pos-5-5 dir-right) + (MOVE-DIR pos-4-6 pos-3-6 dir-left) + (MOVE-DIR pos-4-6 pos-4-5 dir-up) + (MOVE-DIR pos-4-6 pos-5-6 dir-right) + (MOVE-DIR pos-5-2 pos-4-2 dir-left) + (MOVE-DIR pos-5-2 pos-5-3 dir-down) + (MOVE-DIR pos-5-3 pos-4-3 dir-left) + (MOVE-DIR pos-5-3 pos-5-2 dir-up) + (MOVE-DIR pos-5-3 pos-5-4 dir-down) + (MOVE-DIR pos-5-4 pos-4-4 dir-left) + (MOVE-DIR pos-5-4 pos-5-3 dir-up) + (MOVE-DIR pos-5-4 pos-5-5 dir-down) + (MOVE-DIR pos-5-4 pos-6-4 dir-right) + (MOVE-DIR pos-5-5 pos-4-5 dir-left) + (MOVE-DIR pos-5-5 pos-5-4 dir-up) + (MOVE-DIR pos-5-5 pos-5-6 dir-down) + (MOVE-DIR pos-5-5 pos-6-5 dir-right) + (MOVE-DIR pos-5-6 pos-4-6 dir-left) + (MOVE-DIR pos-5-6 pos-5-5 dir-up) + (MOVE-DIR pos-5-6 pos-5-7 dir-down) + (MOVE-DIR pos-5-6 pos-6-6 dir-right) + (MOVE-DIR pos-5-7 pos-5-6 dir-up) + (MOVE-DIR pos-5-7 pos-5-8 dir-down) + (MOVE-DIR pos-5-7 pos-6-7 dir-right) + (MOVE-DIR pos-5-8 pos-5-7 dir-up) + (MOVE-DIR pos-5-8 pos-6-8 dir-right) + (MOVE-DIR pos-6-4 pos-5-4 dir-left) + (MOVE-DIR pos-6-4 pos-6-5 dir-down) + (MOVE-DIR pos-6-4 pos-7-4 dir-right) + (MOVE-DIR pos-6-5 pos-5-5 dir-left) + (MOVE-DIR pos-6-5 pos-6-4 dir-up) + (MOVE-DIR pos-6-5 pos-6-6 dir-down) + (MOVE-DIR pos-6-5 pos-7-5 dir-right) + (MOVE-DIR pos-6-6 pos-5-6 dir-left) + (MOVE-DIR pos-6-6 pos-6-5 dir-up) + (MOVE-DIR pos-6-6 pos-6-7 dir-down) + (MOVE-DIR pos-6-7 pos-5-7 dir-left) + (MOVE-DIR pos-6-7 pos-6-6 dir-up) + (MOVE-DIR pos-6-7 pos-6-8 dir-down) + (MOVE-DIR pos-6-8 pos-5-8 dir-left) + (MOVE-DIR pos-6-8 pos-6-7 dir-up) + (MOVE-DIR pos-7-1 pos-7-2 dir-down) + (MOVE-DIR pos-7-1 pos-8-1 dir-right) + (MOVE-DIR pos-7-2 pos-7-1 dir-up) + (MOVE-DIR pos-7-2 pos-8-2 dir-right) + (MOVE-DIR pos-7-4 pos-6-4 dir-left) + (MOVE-DIR pos-7-4 pos-7-5 dir-down) + (MOVE-DIR pos-7-4 pos-8-4 dir-right) + (MOVE-DIR pos-7-5 pos-6-5 dir-left) + (MOVE-DIR pos-7-5 pos-7-4 dir-up) + (MOVE-DIR pos-7-5 pos-8-5 dir-right) + (MOVE-DIR pos-8-1 pos-7-1 dir-left) + (MOVE-DIR pos-8-1 pos-8-2 dir-down) + (MOVE-DIR pos-8-1 pos-9-1 dir-right) + (MOVE-DIR pos-8-2 pos-7-2 dir-left) + (MOVE-DIR pos-8-2 pos-8-1 dir-up) + (MOVE-DIR pos-8-2 pos-9-2 dir-right) + (MOVE-DIR pos-8-4 pos-7-4 dir-left) + (MOVE-DIR pos-8-4 pos-8-5 dir-down) + (MOVE-DIR pos-8-5 pos-7-5 dir-left) + (MOVE-DIR pos-8-5 pos-8-4 dir-up) + (MOVE-DIR pos-8-7 pos-8-8 dir-down) + (MOVE-DIR pos-8-7 pos-9-7 dir-right) + (MOVE-DIR pos-8-8 pos-8-7 dir-up) + (MOVE-DIR pos-8-8 pos-8-9 dir-down) + (MOVE-DIR pos-8-8 pos-9-8 dir-right) + (MOVE-DIR pos-8-9 pos-8-8 dir-up) + (MOVE-DIR pos-8-9 pos-9-9 dir-right) + (MOVE-DIR pos-9-1 pos-8-1 dir-left) + (MOVE-DIR pos-9-1 pos-9-2 dir-down) + (MOVE-DIR pos-9-2 pos-8-2 dir-left) + (MOVE-DIR pos-9-2 pos-9-1 dir-up) + (MOVE-DIR pos-9-7 pos-8-7 dir-left) + (MOVE-DIR pos-9-7 pos-9-8 dir-down) + (MOVE-DIR pos-9-8 pos-8-8 dir-left) + (MOVE-DIR pos-9-8 pos-9-7 dir-up) + (MOVE-DIR pos-9-8 pos-9-9 dir-down) + (MOVE-DIR pos-9-9 pos-8-9 dir-left) + (MOVE-DIR pos-9-9 pos-9-8 dir-up) + (at player-01 pos-5-5) + (at stone-01 pos-4-4) + (at stone-02 pos-6-4) + (at stone-03 pos-4-6) + (at stone-04 pos-6-6) + (clear pos-1-1) + (clear pos-1-2) + (clear pos-1-3) + (clear pos-1-8) + (clear pos-1-9) + (clear pos-2-1) + (clear pos-2-2) + (clear pos-2-3) + (clear pos-2-5) + (clear pos-2-6) + (clear pos-2-8) + (clear pos-2-9) + (clear pos-3-5) + (clear pos-3-6) + (clear pos-3-8) + (clear pos-3-9) + (clear pos-4-2) + (clear pos-4-3) + (clear pos-4-5) + (clear pos-5-2) + (clear pos-5-3) + (clear pos-5-4) + (clear pos-5-6) + (clear pos-5-7) + (clear pos-5-8) + (clear pos-6-5) + (clear pos-6-7) + (clear pos-6-8) + (clear pos-7-1) + (clear pos-7-2) + (clear pos-7-4) + (clear pos-7-5) + (clear pos-8-1) + (clear pos-8-2) + (clear pos-8-4) + (clear pos-8-5) + (clear pos-8-7) + (clear pos-8-8) + (clear pos-8-9) + (clear pos-9-1) + (clear pos-9-2) + (clear pos-9-7) + (clear pos-9-8) + (clear pos-9-9) + (= (total-cost) 0) + ) + (:goal (and + (at-goal stone-01) + (at-goal stone-02) + (at-goal stone-03) + (at-goal stone-04) + )) + (:metric minimize (total-cost)) +) diff --git a/tests/fixtures/pddl_files/sokoban-sequential-optimal/p12.pddl b/tests/fixtures/pddl_files/sokoban-sequential-optimal/p12.pddl new file mode 100644 index 00000000..b2094d76 --- /dev/null +++ b/tests/fixtures/pddl_files/sokoban-sequential-optimal/p12.pddl @@ -0,0 +1,1715 @@ +;; 'Take the long way home.' +;; +;; ############################ +;; # # +;; # ######################## # +;; # # # # +;; # # #################### # # +;; # # # # # # +;; # # # ################ # # # +;; # # # # # # # # +;; # # # # ############ # # # # +;; # # # # # # # # # +;; # # # # # ############ # # # +;; # # # # # # # # +;; # # # # ################ # # +;; # # # # # # +;; ##$# # #################### # +;; #. @ # # +;; ############################# + +(define (problem p154-microban-sequential) + (:domain sokoban-sequential) + (:objects + dir-down - direction + dir-left - direction + dir-right - direction + dir-up - direction + player-01 - player + pos-01-01 - location + pos-01-02 - location + pos-01-03 - location + pos-01-04 - location + pos-01-05 - location + pos-01-06 - location + pos-01-07 - location + pos-01-08 - location + pos-01-09 - location + pos-01-10 - location + pos-01-11 - location + pos-01-12 - location + pos-01-13 - location + pos-01-14 - location + pos-01-15 - location + pos-01-16 - location + pos-01-17 - location + pos-02-01 - location + pos-02-02 - location + pos-02-03 - location + pos-02-04 - location + pos-02-05 - location + pos-02-06 - location + pos-02-07 - location + pos-02-08 - location + pos-02-09 - location + pos-02-10 - location + pos-02-11 - location + pos-02-12 - location + pos-02-13 - location + pos-02-14 - location + pos-02-15 - location + pos-02-16 - location + pos-02-17 - location + pos-03-01 - location + pos-03-02 - location + pos-03-03 - location + pos-03-04 - location + pos-03-05 - location + pos-03-06 - location + pos-03-07 - location + pos-03-08 - location + pos-03-09 - location + pos-03-10 - location + pos-03-11 - location + pos-03-12 - location + pos-03-13 - location + pos-03-14 - location + pos-03-15 - location + pos-03-16 - location + pos-03-17 - location + pos-04-01 - location + pos-04-02 - location + pos-04-03 - location + pos-04-04 - location + pos-04-05 - location + pos-04-06 - location + pos-04-07 - location + pos-04-08 - location + pos-04-09 - location + pos-04-10 - location + pos-04-11 - location + pos-04-12 - location + pos-04-13 - location + pos-04-14 - location + pos-04-15 - location + pos-04-16 - location + pos-04-17 - location + pos-05-01 - location + pos-05-02 - location + pos-05-03 - location + pos-05-04 - location + pos-05-05 - location + pos-05-06 - location + pos-05-07 - location + pos-05-08 - location + pos-05-09 - location + pos-05-10 - location + pos-05-11 - location + pos-05-12 - location + pos-05-13 - location + pos-05-14 - location + pos-05-15 - location + pos-05-16 - location + pos-05-17 - location + pos-06-01 - location + pos-06-02 - location + pos-06-03 - location + pos-06-04 - location + pos-06-05 - location + pos-06-06 - location + pos-06-07 - location + pos-06-08 - location + pos-06-09 - location + pos-06-10 - location + pos-06-11 - location + pos-06-12 - location + pos-06-13 - location + pos-06-14 - location + pos-06-15 - location + pos-06-16 - location + pos-06-17 - location + pos-07-01 - location + pos-07-02 - location + pos-07-03 - location + pos-07-04 - location + pos-07-05 - location + pos-07-06 - location + pos-07-07 - location + pos-07-08 - location + pos-07-09 - location + pos-07-10 - location + pos-07-11 - location + pos-07-12 - location + pos-07-13 - location + pos-07-14 - location + pos-07-15 - location + pos-07-16 - location + pos-07-17 - location + pos-08-01 - location + pos-08-02 - location + pos-08-03 - location + pos-08-04 - location + pos-08-05 - location + pos-08-06 - location + pos-08-07 - location + pos-08-08 - location + pos-08-09 - location + pos-08-10 - location + pos-08-11 - location + pos-08-12 - location + pos-08-13 - location + pos-08-14 - location + pos-08-15 - location + pos-08-16 - location + pos-08-17 - location + pos-09-01 - location + pos-09-02 - location + pos-09-03 - location + pos-09-04 - location + pos-09-05 - location + pos-09-06 - location + pos-09-07 - location + pos-09-08 - location + pos-09-09 - location + pos-09-10 - location + pos-09-11 - location + pos-09-12 - location + pos-09-13 - location + pos-09-14 - location + pos-09-15 - location + pos-09-16 - location + pos-09-17 - location + pos-10-01 - location + pos-10-02 - location + pos-10-03 - location + pos-10-04 - location + pos-10-05 - location + pos-10-06 - location + pos-10-07 - location + pos-10-08 - location + pos-10-09 - location + pos-10-10 - location + pos-10-11 - location + pos-10-12 - location + pos-10-13 - location + pos-10-14 - location + pos-10-15 - location + pos-10-16 - location + pos-10-17 - location + pos-11-01 - location + pos-11-02 - location + pos-11-03 - location + pos-11-04 - location + pos-11-05 - location + pos-11-06 - location + pos-11-07 - location + pos-11-08 - location + pos-11-09 - location + pos-11-10 - location + pos-11-11 - location + pos-11-12 - location + pos-11-13 - location + pos-11-14 - location + pos-11-15 - location + pos-11-16 - location + pos-11-17 - location + pos-12-01 - location + pos-12-02 - location + pos-12-03 - location + pos-12-04 - location + pos-12-05 - location + pos-12-06 - location + pos-12-07 - location + pos-12-08 - location + pos-12-09 - location + pos-12-10 - location + pos-12-11 - location + pos-12-12 - location + pos-12-13 - location + pos-12-14 - location + pos-12-15 - location + pos-12-16 - location + pos-12-17 - location + pos-13-01 - location + pos-13-02 - location + pos-13-03 - location + pos-13-04 - location + pos-13-05 - location + pos-13-06 - location + pos-13-07 - location + pos-13-08 - location + pos-13-09 - location + pos-13-10 - location + pos-13-11 - location + pos-13-12 - location + pos-13-13 - location + pos-13-14 - location + pos-13-15 - location + pos-13-16 - location + pos-13-17 - location + pos-14-01 - location + pos-14-02 - location + pos-14-03 - location + pos-14-04 - location + pos-14-05 - location + pos-14-06 - location + pos-14-07 - location + pos-14-08 - location + pos-14-09 - location + pos-14-10 - location + pos-14-11 - location + pos-14-12 - location + pos-14-13 - location + pos-14-14 - location + pos-14-15 - location + pos-14-16 - location + pos-14-17 - location + pos-15-01 - location + pos-15-02 - location + pos-15-03 - location + pos-15-04 - location + pos-15-05 - location + pos-15-06 - location + pos-15-07 - location + pos-15-08 - location + pos-15-09 - location + pos-15-10 - location + pos-15-11 - location + pos-15-12 - location + pos-15-13 - location + pos-15-14 - location + pos-15-15 - location + pos-15-16 - location + pos-15-17 - location + pos-16-01 - location + pos-16-02 - location + pos-16-03 - location + pos-16-04 - location + pos-16-05 - location + pos-16-06 - location + pos-16-07 - location + pos-16-08 - location + pos-16-09 - location + pos-16-10 - location + pos-16-11 - location + pos-16-12 - location + pos-16-13 - location + pos-16-14 - location + pos-16-15 - location + pos-16-16 - location + pos-16-17 - location + pos-17-01 - location + pos-17-02 - location + pos-17-03 - location + pos-17-04 - location + pos-17-05 - location + pos-17-06 - location + pos-17-07 - location + pos-17-08 - location + pos-17-09 - location + pos-17-10 - location + pos-17-11 - location + pos-17-12 - location + pos-17-13 - location + pos-17-14 - location + pos-17-15 - location + pos-17-16 - location + pos-17-17 - location + pos-18-01 - location + pos-18-02 - location + pos-18-03 - location + pos-18-04 - location + pos-18-05 - location + pos-18-06 - location + pos-18-07 - location + pos-18-08 - location + pos-18-09 - location + pos-18-10 - location + pos-18-11 - location + pos-18-12 - location + pos-18-13 - location + pos-18-14 - location + pos-18-15 - location + pos-18-16 - location + pos-18-17 - location + pos-19-01 - location + pos-19-02 - location + pos-19-03 - location + pos-19-04 - location + pos-19-05 - location + pos-19-06 - location + pos-19-07 - location + pos-19-08 - location + pos-19-09 - location + pos-19-10 - location + pos-19-11 - location + pos-19-12 - location + pos-19-13 - location + pos-19-14 - location + pos-19-15 - location + pos-19-16 - location + pos-19-17 - location + pos-20-01 - location + pos-20-02 - location + pos-20-03 - location + pos-20-04 - location + pos-20-05 - location + pos-20-06 - location + pos-20-07 - location + pos-20-08 - location + pos-20-09 - location + pos-20-10 - location + pos-20-11 - location + pos-20-12 - location + pos-20-13 - location + pos-20-14 - location + pos-20-15 - location + pos-20-16 - location + pos-20-17 - location + pos-21-01 - location + pos-21-02 - location + pos-21-03 - location + pos-21-04 - location + pos-21-05 - location + pos-21-06 - location + pos-21-07 - location + pos-21-08 - location + pos-21-09 - location + pos-21-10 - location + pos-21-11 - location + pos-21-12 - location + pos-21-13 - location + pos-21-14 - location + pos-21-15 - location + pos-21-16 - location + pos-21-17 - location + pos-22-01 - location + pos-22-02 - location + pos-22-03 - location + pos-22-04 - location + pos-22-05 - location + pos-22-06 - location + pos-22-07 - location + pos-22-08 - location + pos-22-09 - location + pos-22-10 - location + pos-22-11 - location + pos-22-12 - location + pos-22-13 - location + pos-22-14 - location + pos-22-15 - location + pos-22-16 - location + pos-22-17 - location + pos-23-01 - location + pos-23-02 - location + pos-23-03 - location + pos-23-04 - location + pos-23-05 - location + pos-23-06 - location + pos-23-07 - location + pos-23-08 - location + pos-23-09 - location + pos-23-10 - location + pos-23-11 - location + pos-23-12 - location + pos-23-13 - location + pos-23-14 - location + pos-23-15 - location + pos-23-16 - location + pos-23-17 - location + pos-24-01 - location + pos-24-02 - location + pos-24-03 - location + pos-24-04 - location + pos-24-05 - location + pos-24-06 - location + pos-24-07 - location + pos-24-08 - location + pos-24-09 - location + pos-24-10 - location + pos-24-11 - location + pos-24-12 - location + pos-24-13 - location + pos-24-14 - location + pos-24-15 - location + pos-24-16 - location + pos-24-17 - location + pos-25-01 - location + pos-25-02 - location + pos-25-03 - location + pos-25-04 - location + pos-25-05 - location + pos-25-06 - location + pos-25-07 - location + pos-25-08 - location + pos-25-09 - location + pos-25-10 - location + pos-25-11 - location + pos-25-12 - location + pos-25-13 - location + pos-25-14 - location + pos-25-15 - location + pos-25-16 - location + pos-25-17 - location + pos-26-01 - location + pos-26-02 - location + pos-26-03 - location + pos-26-04 - location + pos-26-05 - location + pos-26-06 - location + pos-26-07 - location + pos-26-08 - location + pos-26-09 - location + pos-26-10 - location + pos-26-11 - location + pos-26-12 - location + pos-26-13 - location + pos-26-14 - location + pos-26-15 - location + pos-26-16 - location + pos-26-17 - location + pos-27-01 - location + pos-27-02 - location + pos-27-03 - location + pos-27-04 - location + pos-27-05 - location + pos-27-06 - location + pos-27-07 - location + pos-27-08 - location + pos-27-09 - location + pos-27-10 - location + pos-27-11 - location + pos-27-12 - location + pos-27-13 - location + pos-27-14 - location + pos-27-15 - location + pos-27-16 - location + pos-27-17 - location + pos-28-01 - location + pos-28-02 - location + pos-28-03 - location + pos-28-04 - location + pos-28-05 - location + pos-28-06 - location + pos-28-07 - location + pos-28-08 - location + pos-28-09 - location + pos-28-10 - location + pos-28-11 - location + pos-28-12 - location + pos-28-13 - location + pos-28-14 - location + pos-28-15 - location + pos-28-16 - location + pos-28-17 - location + pos-29-01 - location + pos-29-02 - location + pos-29-03 - location + pos-29-04 - location + pos-29-05 - location + pos-29-06 - location + pos-29-07 - location + pos-29-08 - location + pos-29-09 - location + pos-29-10 - location + pos-29-11 - location + pos-29-12 - location + pos-29-13 - location + pos-29-14 - location + pos-29-15 - location + pos-29-16 - location + pos-29-17 - location + stone-01 - stone + ) + (:init + (IS-GOAL pos-02-16) + (IS-NONGOAL pos-01-01) + (IS-NONGOAL pos-01-02) + (IS-NONGOAL pos-01-03) + (IS-NONGOAL pos-01-04) + (IS-NONGOAL pos-01-05) + (IS-NONGOAL pos-01-06) + (IS-NONGOAL pos-01-07) + (IS-NONGOAL pos-01-08) + (IS-NONGOAL pos-01-09) + (IS-NONGOAL pos-01-10) + (IS-NONGOAL pos-01-11) + (IS-NONGOAL pos-01-12) + (IS-NONGOAL pos-01-13) + (IS-NONGOAL pos-01-14) + (IS-NONGOAL pos-01-15) + (IS-NONGOAL pos-01-16) + (IS-NONGOAL pos-01-17) + (IS-NONGOAL pos-02-01) + (IS-NONGOAL pos-02-02) + (IS-NONGOAL pos-02-03) + (IS-NONGOAL pos-02-04) + (IS-NONGOAL pos-02-05) + (IS-NONGOAL pos-02-06) + (IS-NONGOAL pos-02-07) + (IS-NONGOAL pos-02-08) + (IS-NONGOAL pos-02-09) + (IS-NONGOAL pos-02-10) + (IS-NONGOAL pos-02-11) + (IS-NONGOAL pos-02-12) + (IS-NONGOAL pos-02-13) + (IS-NONGOAL pos-02-14) + (IS-NONGOAL pos-02-15) + (IS-NONGOAL pos-02-17) + (IS-NONGOAL pos-03-01) + (IS-NONGOAL pos-03-02) + (IS-NONGOAL pos-03-03) + (IS-NONGOAL pos-03-04) + (IS-NONGOAL pos-03-05) + (IS-NONGOAL pos-03-06) + (IS-NONGOAL pos-03-07) + (IS-NONGOAL pos-03-08) + (IS-NONGOAL pos-03-09) + (IS-NONGOAL pos-03-10) + (IS-NONGOAL pos-03-11) + (IS-NONGOAL pos-03-12) + (IS-NONGOAL pos-03-13) + (IS-NONGOAL pos-03-14) + (IS-NONGOAL pos-03-15) + (IS-NONGOAL pos-03-16) + (IS-NONGOAL pos-03-17) + (IS-NONGOAL pos-04-01) + (IS-NONGOAL pos-04-02) + (IS-NONGOAL pos-04-03) + (IS-NONGOAL pos-04-04) + (IS-NONGOAL pos-04-05) + (IS-NONGOAL pos-04-06) + (IS-NONGOAL pos-04-07) + (IS-NONGOAL pos-04-08) + (IS-NONGOAL pos-04-09) + (IS-NONGOAL pos-04-10) + (IS-NONGOAL pos-04-11) + (IS-NONGOAL pos-04-12) + (IS-NONGOAL pos-04-13) + (IS-NONGOAL pos-04-14) + (IS-NONGOAL pos-04-15) + (IS-NONGOAL pos-04-16) + (IS-NONGOAL pos-04-17) + (IS-NONGOAL pos-05-01) + (IS-NONGOAL pos-05-02) + (IS-NONGOAL pos-05-03) + (IS-NONGOAL pos-05-04) + (IS-NONGOAL pos-05-05) + (IS-NONGOAL pos-05-06) + (IS-NONGOAL pos-05-07) + (IS-NONGOAL pos-05-08) + (IS-NONGOAL pos-05-09) + (IS-NONGOAL pos-05-10) + (IS-NONGOAL pos-05-11) + (IS-NONGOAL pos-05-12) + (IS-NONGOAL pos-05-13) + (IS-NONGOAL pos-05-14) + (IS-NONGOAL pos-05-15) + (IS-NONGOAL pos-05-16) + (IS-NONGOAL pos-05-17) + (IS-NONGOAL pos-06-01) + (IS-NONGOAL pos-06-02) + (IS-NONGOAL pos-06-03) + (IS-NONGOAL pos-06-04) + (IS-NONGOAL pos-06-05) + (IS-NONGOAL pos-06-06) + (IS-NONGOAL pos-06-07) + (IS-NONGOAL pos-06-08) + (IS-NONGOAL pos-06-09) + (IS-NONGOAL pos-06-10) + (IS-NONGOAL pos-06-11) + (IS-NONGOAL pos-06-12) + (IS-NONGOAL pos-06-13) + (IS-NONGOAL pos-06-14) + (IS-NONGOAL pos-06-15) + (IS-NONGOAL pos-06-16) + (IS-NONGOAL pos-06-17) + (IS-NONGOAL pos-07-01) + (IS-NONGOAL pos-07-02) + (IS-NONGOAL pos-07-03) + (IS-NONGOAL pos-07-04) + (IS-NONGOAL pos-07-05) + (IS-NONGOAL pos-07-06) + (IS-NONGOAL pos-07-07) + (IS-NONGOAL pos-07-08) + (IS-NONGOAL pos-07-09) + (IS-NONGOAL pos-07-10) + (IS-NONGOAL pos-07-11) + (IS-NONGOAL pos-07-12) + (IS-NONGOAL pos-07-13) + (IS-NONGOAL pos-07-14) + (IS-NONGOAL pos-07-15) + (IS-NONGOAL pos-07-16) + (IS-NONGOAL pos-07-17) + (IS-NONGOAL pos-08-01) + (IS-NONGOAL pos-08-02) + (IS-NONGOAL pos-08-03) + (IS-NONGOAL pos-08-04) + (IS-NONGOAL pos-08-05) + (IS-NONGOAL pos-08-06) + (IS-NONGOAL pos-08-07) + (IS-NONGOAL pos-08-08) + (IS-NONGOAL pos-08-09) + (IS-NONGOAL pos-08-10) + (IS-NONGOAL pos-08-11) + (IS-NONGOAL pos-08-12) + (IS-NONGOAL pos-08-13) + (IS-NONGOAL pos-08-14) + (IS-NONGOAL pos-08-15) + (IS-NONGOAL pos-08-16) + (IS-NONGOAL pos-08-17) + (IS-NONGOAL pos-09-01) + (IS-NONGOAL pos-09-02) + (IS-NONGOAL pos-09-03) + (IS-NONGOAL pos-09-04) + (IS-NONGOAL pos-09-05) + (IS-NONGOAL pos-09-06) + (IS-NONGOAL pos-09-07) + (IS-NONGOAL pos-09-08) + (IS-NONGOAL pos-09-09) + (IS-NONGOAL pos-09-10) + (IS-NONGOAL pos-09-11) + (IS-NONGOAL pos-09-12) + (IS-NONGOAL pos-09-13) + (IS-NONGOAL pos-09-14) + (IS-NONGOAL pos-09-15) + (IS-NONGOAL pos-09-16) + (IS-NONGOAL pos-09-17) + (IS-NONGOAL pos-10-01) + (IS-NONGOAL pos-10-02) + (IS-NONGOAL pos-10-03) + (IS-NONGOAL pos-10-04) + (IS-NONGOAL pos-10-05) + (IS-NONGOAL pos-10-06) + (IS-NONGOAL pos-10-07) + (IS-NONGOAL pos-10-08) + (IS-NONGOAL pos-10-09) + (IS-NONGOAL pos-10-10) + (IS-NONGOAL pos-10-11) + (IS-NONGOAL pos-10-12) + (IS-NONGOAL pos-10-13) + (IS-NONGOAL pos-10-14) + (IS-NONGOAL pos-10-15) + (IS-NONGOAL pos-10-16) + (IS-NONGOAL pos-10-17) + (IS-NONGOAL pos-11-01) + (IS-NONGOAL pos-11-02) + (IS-NONGOAL pos-11-03) + (IS-NONGOAL pos-11-04) + (IS-NONGOAL pos-11-05) + (IS-NONGOAL pos-11-06) + (IS-NONGOAL pos-11-07) + (IS-NONGOAL pos-11-08) + (IS-NONGOAL pos-11-09) + (IS-NONGOAL pos-11-10) + (IS-NONGOAL pos-11-11) + (IS-NONGOAL pos-11-12) + (IS-NONGOAL pos-11-13) + (IS-NONGOAL pos-11-14) + (IS-NONGOAL pos-11-15) + (IS-NONGOAL pos-11-16) + (IS-NONGOAL pos-11-17) + (IS-NONGOAL pos-12-01) + (IS-NONGOAL pos-12-02) + (IS-NONGOAL pos-12-03) + (IS-NONGOAL pos-12-04) + (IS-NONGOAL pos-12-05) + (IS-NONGOAL pos-12-06) + (IS-NONGOAL pos-12-07) + (IS-NONGOAL pos-12-08) + (IS-NONGOAL pos-12-09) + (IS-NONGOAL pos-12-10) + (IS-NONGOAL pos-12-11) + (IS-NONGOAL pos-12-12) + (IS-NONGOAL pos-12-13) + (IS-NONGOAL pos-12-14) + (IS-NONGOAL pos-12-15) + (IS-NONGOAL pos-12-16) + (IS-NONGOAL pos-12-17) + (IS-NONGOAL pos-13-01) + (IS-NONGOAL pos-13-02) + (IS-NONGOAL pos-13-03) + (IS-NONGOAL pos-13-04) + (IS-NONGOAL pos-13-05) + (IS-NONGOAL pos-13-06) + (IS-NONGOAL pos-13-07) + (IS-NONGOAL pos-13-08) + (IS-NONGOAL pos-13-09) + (IS-NONGOAL pos-13-10) + (IS-NONGOAL pos-13-11) + (IS-NONGOAL pos-13-12) + (IS-NONGOAL pos-13-13) + (IS-NONGOAL pos-13-14) + (IS-NONGOAL pos-13-15) + (IS-NONGOAL pos-13-16) + (IS-NONGOAL pos-13-17) + (IS-NONGOAL pos-14-01) + (IS-NONGOAL pos-14-02) + (IS-NONGOAL pos-14-03) + (IS-NONGOAL pos-14-04) + (IS-NONGOAL pos-14-05) + (IS-NONGOAL pos-14-06) + (IS-NONGOAL pos-14-07) + (IS-NONGOAL pos-14-08) + (IS-NONGOAL pos-14-09) + (IS-NONGOAL pos-14-10) + (IS-NONGOAL pos-14-11) + (IS-NONGOAL pos-14-12) + (IS-NONGOAL pos-14-13) + (IS-NONGOAL pos-14-14) + (IS-NONGOAL pos-14-15) + (IS-NONGOAL pos-14-16) + (IS-NONGOAL pos-14-17) + (IS-NONGOAL pos-15-01) + (IS-NONGOAL pos-15-02) + (IS-NONGOAL pos-15-03) + (IS-NONGOAL pos-15-04) + (IS-NONGOAL pos-15-05) + (IS-NONGOAL pos-15-06) + (IS-NONGOAL pos-15-07) + (IS-NONGOAL pos-15-08) + (IS-NONGOAL pos-15-09) + (IS-NONGOAL pos-15-10) + (IS-NONGOAL pos-15-11) + (IS-NONGOAL pos-15-12) + (IS-NONGOAL pos-15-13) + (IS-NONGOAL pos-15-14) + (IS-NONGOAL pos-15-15) + (IS-NONGOAL pos-15-16) + (IS-NONGOAL pos-15-17) + (IS-NONGOAL pos-16-01) + (IS-NONGOAL pos-16-02) + (IS-NONGOAL pos-16-03) + (IS-NONGOAL pos-16-04) + (IS-NONGOAL pos-16-05) + (IS-NONGOAL pos-16-06) + (IS-NONGOAL pos-16-07) + (IS-NONGOAL pos-16-08) + (IS-NONGOAL pos-16-09) + (IS-NONGOAL pos-16-10) + (IS-NONGOAL pos-16-11) + (IS-NONGOAL pos-16-12) + (IS-NONGOAL pos-16-13) + (IS-NONGOAL pos-16-14) + (IS-NONGOAL pos-16-15) + (IS-NONGOAL pos-16-16) + (IS-NONGOAL pos-16-17) + (IS-NONGOAL pos-17-01) + (IS-NONGOAL pos-17-02) + (IS-NONGOAL pos-17-03) + (IS-NONGOAL pos-17-04) + (IS-NONGOAL pos-17-05) + (IS-NONGOAL pos-17-06) + (IS-NONGOAL pos-17-07) + (IS-NONGOAL pos-17-08) + (IS-NONGOAL pos-17-09) + (IS-NONGOAL pos-17-10) + (IS-NONGOAL pos-17-11) + (IS-NONGOAL pos-17-12) + (IS-NONGOAL pos-17-13) + (IS-NONGOAL pos-17-14) + (IS-NONGOAL pos-17-15) + (IS-NONGOAL pos-17-16) + (IS-NONGOAL pos-17-17) + (IS-NONGOAL pos-18-01) + (IS-NONGOAL pos-18-02) + (IS-NONGOAL pos-18-03) + (IS-NONGOAL pos-18-04) + (IS-NONGOAL pos-18-05) + (IS-NONGOAL pos-18-06) + (IS-NONGOAL pos-18-07) + (IS-NONGOAL pos-18-08) + (IS-NONGOAL pos-18-09) + (IS-NONGOAL pos-18-10) + (IS-NONGOAL pos-18-11) + (IS-NONGOAL pos-18-12) + (IS-NONGOAL pos-18-13) + (IS-NONGOAL pos-18-14) + (IS-NONGOAL pos-18-15) + (IS-NONGOAL pos-18-16) + (IS-NONGOAL pos-18-17) + (IS-NONGOAL pos-19-01) + (IS-NONGOAL pos-19-02) + (IS-NONGOAL pos-19-03) + (IS-NONGOAL pos-19-04) + (IS-NONGOAL pos-19-05) + (IS-NONGOAL pos-19-06) + (IS-NONGOAL pos-19-07) + (IS-NONGOAL pos-19-08) + (IS-NONGOAL pos-19-09) + (IS-NONGOAL pos-19-10) + (IS-NONGOAL pos-19-11) + (IS-NONGOAL pos-19-12) + (IS-NONGOAL pos-19-13) + (IS-NONGOAL pos-19-14) + (IS-NONGOAL pos-19-15) + (IS-NONGOAL pos-19-16) + (IS-NONGOAL pos-19-17) + (IS-NONGOAL pos-20-01) + (IS-NONGOAL pos-20-02) + (IS-NONGOAL pos-20-03) + (IS-NONGOAL pos-20-04) + (IS-NONGOAL pos-20-05) + (IS-NONGOAL pos-20-06) + (IS-NONGOAL pos-20-07) + (IS-NONGOAL pos-20-08) + (IS-NONGOAL pos-20-09) + (IS-NONGOAL pos-20-10) + (IS-NONGOAL pos-20-11) + (IS-NONGOAL pos-20-12) + (IS-NONGOAL pos-20-13) + (IS-NONGOAL pos-20-14) + (IS-NONGOAL pos-20-15) + (IS-NONGOAL pos-20-16) + (IS-NONGOAL pos-20-17) + (IS-NONGOAL pos-21-01) + (IS-NONGOAL pos-21-02) + (IS-NONGOAL pos-21-03) + (IS-NONGOAL pos-21-04) + (IS-NONGOAL pos-21-05) + (IS-NONGOAL pos-21-06) + (IS-NONGOAL pos-21-07) + (IS-NONGOAL pos-21-08) + (IS-NONGOAL pos-21-09) + (IS-NONGOAL pos-21-10) + (IS-NONGOAL pos-21-11) + (IS-NONGOAL pos-21-12) + (IS-NONGOAL pos-21-13) + (IS-NONGOAL pos-21-14) + (IS-NONGOAL pos-21-15) + (IS-NONGOAL pos-21-16) + (IS-NONGOAL pos-21-17) + (IS-NONGOAL pos-22-01) + (IS-NONGOAL pos-22-02) + (IS-NONGOAL pos-22-03) + (IS-NONGOAL pos-22-04) + (IS-NONGOAL pos-22-05) + (IS-NONGOAL pos-22-06) + (IS-NONGOAL pos-22-07) + (IS-NONGOAL pos-22-08) + (IS-NONGOAL pos-22-09) + (IS-NONGOAL pos-22-10) + (IS-NONGOAL pos-22-11) + (IS-NONGOAL pos-22-12) + (IS-NONGOAL pos-22-13) + (IS-NONGOAL pos-22-14) + (IS-NONGOAL pos-22-15) + (IS-NONGOAL pos-22-16) + (IS-NONGOAL pos-22-17) + (IS-NONGOAL pos-23-01) + (IS-NONGOAL pos-23-02) + (IS-NONGOAL pos-23-03) + (IS-NONGOAL pos-23-04) + (IS-NONGOAL pos-23-05) + (IS-NONGOAL pos-23-06) + (IS-NONGOAL pos-23-07) + (IS-NONGOAL pos-23-08) + (IS-NONGOAL pos-23-09) + (IS-NONGOAL pos-23-10) + (IS-NONGOAL pos-23-11) + (IS-NONGOAL pos-23-12) + (IS-NONGOAL pos-23-13) + (IS-NONGOAL pos-23-14) + (IS-NONGOAL pos-23-15) + (IS-NONGOAL pos-23-16) + (IS-NONGOAL pos-23-17) + (IS-NONGOAL pos-24-01) + (IS-NONGOAL pos-24-02) + (IS-NONGOAL pos-24-03) + (IS-NONGOAL pos-24-04) + (IS-NONGOAL pos-24-05) + (IS-NONGOAL pos-24-06) + (IS-NONGOAL pos-24-07) + (IS-NONGOAL pos-24-08) + (IS-NONGOAL pos-24-09) + (IS-NONGOAL pos-24-10) + (IS-NONGOAL pos-24-11) + (IS-NONGOAL pos-24-12) + (IS-NONGOAL pos-24-13) + (IS-NONGOAL pos-24-14) + (IS-NONGOAL pos-24-15) + (IS-NONGOAL pos-24-16) + (IS-NONGOAL pos-24-17) + (IS-NONGOAL pos-25-01) + (IS-NONGOAL pos-25-02) + (IS-NONGOAL pos-25-03) + (IS-NONGOAL pos-25-04) + (IS-NONGOAL pos-25-05) + (IS-NONGOAL pos-25-06) + (IS-NONGOAL pos-25-07) + (IS-NONGOAL pos-25-08) + (IS-NONGOAL pos-25-09) + (IS-NONGOAL pos-25-10) + (IS-NONGOAL pos-25-11) + (IS-NONGOAL pos-25-12) + (IS-NONGOAL pos-25-13) + (IS-NONGOAL pos-25-14) + (IS-NONGOAL pos-25-15) + (IS-NONGOAL pos-25-16) + (IS-NONGOAL pos-25-17) + (IS-NONGOAL pos-26-01) + (IS-NONGOAL pos-26-02) + (IS-NONGOAL pos-26-03) + (IS-NONGOAL pos-26-04) + (IS-NONGOAL pos-26-05) + (IS-NONGOAL pos-26-06) + (IS-NONGOAL pos-26-07) + (IS-NONGOAL pos-26-08) + (IS-NONGOAL pos-26-09) + (IS-NONGOAL pos-26-10) + (IS-NONGOAL pos-26-11) + (IS-NONGOAL pos-26-12) + (IS-NONGOAL pos-26-13) + (IS-NONGOAL pos-26-14) + (IS-NONGOAL pos-26-15) + (IS-NONGOAL pos-26-16) + (IS-NONGOAL pos-26-17) + (IS-NONGOAL pos-27-01) + (IS-NONGOAL pos-27-02) + (IS-NONGOAL pos-27-03) + (IS-NONGOAL pos-27-04) + (IS-NONGOAL pos-27-05) + (IS-NONGOAL pos-27-06) + (IS-NONGOAL pos-27-07) + (IS-NONGOAL pos-27-08) + (IS-NONGOAL pos-27-09) + (IS-NONGOAL pos-27-10) + (IS-NONGOAL pos-27-11) + (IS-NONGOAL pos-27-12) + (IS-NONGOAL pos-27-13) + (IS-NONGOAL pos-27-14) + (IS-NONGOAL pos-27-15) + (IS-NONGOAL pos-27-16) + (IS-NONGOAL pos-27-17) + (IS-NONGOAL pos-28-01) + (IS-NONGOAL pos-28-02) + (IS-NONGOAL pos-28-03) + (IS-NONGOAL pos-28-04) + (IS-NONGOAL pos-28-05) + (IS-NONGOAL pos-28-06) + (IS-NONGOAL pos-28-07) + (IS-NONGOAL pos-28-08) + (IS-NONGOAL pos-28-09) + (IS-NONGOAL pos-28-10) + (IS-NONGOAL pos-28-11) + (IS-NONGOAL pos-28-12) + (IS-NONGOAL pos-28-13) + (IS-NONGOAL pos-28-14) + (IS-NONGOAL pos-28-15) + (IS-NONGOAL pos-28-16) + (IS-NONGOAL pos-28-17) + (IS-NONGOAL pos-29-01) + (IS-NONGOAL pos-29-02) + (IS-NONGOAL pos-29-03) + (IS-NONGOAL pos-29-04) + (IS-NONGOAL pos-29-05) + (IS-NONGOAL pos-29-06) + (IS-NONGOAL pos-29-07) + (IS-NONGOAL pos-29-08) + (IS-NONGOAL pos-29-09) + (IS-NONGOAL pos-29-10) + (IS-NONGOAL pos-29-11) + (IS-NONGOAL pos-29-12) + (IS-NONGOAL pos-29-13) + (IS-NONGOAL pos-29-14) + (IS-NONGOAL pos-29-15) + (IS-NONGOAL pos-29-16) + (IS-NONGOAL pos-29-17) + (MOVE-DIR pos-01-01 pos-01-02 dir-down) + (MOVE-DIR pos-01-02 pos-01-01 dir-up) + (MOVE-DIR pos-01-02 pos-01-03 dir-down) + (MOVE-DIR pos-01-03 pos-01-02 dir-up) + (MOVE-DIR pos-01-03 pos-01-04 dir-down) + (MOVE-DIR pos-01-04 pos-01-03 dir-up) + (MOVE-DIR pos-01-04 pos-01-05 dir-down) + (MOVE-DIR pos-01-05 pos-01-04 dir-up) + (MOVE-DIR pos-01-05 pos-01-06 dir-down) + (MOVE-DIR pos-01-06 pos-01-05 dir-up) + (MOVE-DIR pos-01-06 pos-01-07 dir-down) + (MOVE-DIR pos-01-07 pos-01-06 dir-up) + (MOVE-DIR pos-01-07 pos-01-08 dir-down) + (MOVE-DIR pos-01-08 pos-01-07 dir-up) + (MOVE-DIR pos-01-08 pos-01-09 dir-down) + (MOVE-DIR pos-01-09 pos-01-08 dir-up) + (MOVE-DIR pos-01-09 pos-01-10 dir-down) + (MOVE-DIR pos-01-10 pos-01-09 dir-up) + (MOVE-DIR pos-01-10 pos-01-11 dir-down) + (MOVE-DIR pos-01-11 pos-01-10 dir-up) + (MOVE-DIR pos-01-11 pos-01-12 dir-down) + (MOVE-DIR pos-01-12 pos-01-11 dir-up) + (MOVE-DIR pos-01-12 pos-01-13 dir-down) + (MOVE-DIR pos-01-13 pos-01-12 dir-up) + (MOVE-DIR pos-01-13 pos-01-14 dir-down) + (MOVE-DIR pos-01-14 pos-01-13 dir-up) + (MOVE-DIR pos-02-16 pos-03-16 dir-right) + (MOVE-DIR pos-03-02 pos-03-03 dir-down) + (MOVE-DIR pos-03-02 pos-04-02 dir-right) + (MOVE-DIR pos-03-03 pos-03-02 dir-up) + (MOVE-DIR pos-03-03 pos-03-04 dir-down) + (MOVE-DIR pos-03-04 pos-03-03 dir-up) + (MOVE-DIR pos-03-04 pos-03-05 dir-down) + (MOVE-DIR pos-03-05 pos-03-04 dir-up) + (MOVE-DIR pos-03-05 pos-03-06 dir-down) + (MOVE-DIR pos-03-06 pos-03-05 dir-up) + (MOVE-DIR pos-03-06 pos-03-07 dir-down) + (MOVE-DIR pos-03-07 pos-03-06 dir-up) + (MOVE-DIR pos-03-07 pos-03-08 dir-down) + (MOVE-DIR pos-03-08 pos-03-07 dir-up) + (MOVE-DIR pos-03-08 pos-03-09 dir-down) + (MOVE-DIR pos-03-09 pos-03-08 dir-up) + (MOVE-DIR pos-03-09 pos-03-10 dir-down) + (MOVE-DIR pos-03-10 pos-03-09 dir-up) + (MOVE-DIR pos-03-10 pos-03-11 dir-down) + (MOVE-DIR pos-03-11 pos-03-10 dir-up) + (MOVE-DIR pos-03-11 pos-03-12 dir-down) + (MOVE-DIR pos-03-12 pos-03-11 dir-up) + (MOVE-DIR pos-03-12 pos-03-13 dir-down) + (MOVE-DIR pos-03-13 pos-03-12 dir-up) + (MOVE-DIR pos-03-13 pos-03-14 dir-down) + (MOVE-DIR pos-03-14 pos-03-13 dir-up) + (MOVE-DIR pos-03-14 pos-03-15 dir-down) + (MOVE-DIR pos-03-15 pos-03-14 dir-up) + (MOVE-DIR pos-03-15 pos-03-16 dir-down) + (MOVE-DIR pos-03-16 pos-02-16 dir-left) + (MOVE-DIR pos-03-16 pos-03-15 dir-up) + (MOVE-DIR pos-03-16 pos-04-16 dir-right) + (MOVE-DIR pos-04-02 pos-03-02 dir-left) + (MOVE-DIR pos-04-02 pos-05-02 dir-right) + (MOVE-DIR pos-04-16 pos-03-16 dir-left) + (MOVE-DIR pos-04-16 pos-05-16 dir-right) + (MOVE-DIR pos-05-02 pos-04-02 dir-left) + (MOVE-DIR pos-05-02 pos-06-02 dir-right) + (MOVE-DIR pos-05-04 pos-05-05 dir-down) + (MOVE-DIR pos-05-04 pos-06-04 dir-right) + (MOVE-DIR pos-05-05 pos-05-04 dir-up) + (MOVE-DIR pos-05-05 pos-05-06 dir-down) + (MOVE-DIR pos-05-06 pos-05-05 dir-up) + (MOVE-DIR pos-05-06 pos-05-07 dir-down) + (MOVE-DIR pos-05-07 pos-05-06 dir-up) + (MOVE-DIR pos-05-07 pos-05-08 dir-down) + (MOVE-DIR pos-05-08 pos-05-07 dir-up) + (MOVE-DIR pos-05-08 pos-05-09 dir-down) + (MOVE-DIR pos-05-09 pos-05-08 dir-up) + (MOVE-DIR pos-05-09 pos-05-10 dir-down) + (MOVE-DIR pos-05-10 pos-05-09 dir-up) + (MOVE-DIR pos-05-10 pos-05-11 dir-down) + (MOVE-DIR pos-05-11 pos-05-10 dir-up) + (MOVE-DIR pos-05-11 pos-05-12 dir-down) + (MOVE-DIR pos-05-12 pos-05-11 dir-up) + (MOVE-DIR pos-05-12 pos-05-13 dir-down) + (MOVE-DIR pos-05-13 pos-05-12 dir-up) + (MOVE-DIR pos-05-13 pos-05-14 dir-down) + (MOVE-DIR pos-05-14 pos-05-13 dir-up) + (MOVE-DIR pos-05-14 pos-05-15 dir-down) + (MOVE-DIR pos-05-15 pos-05-14 dir-up) + (MOVE-DIR pos-05-15 pos-05-16 dir-down) + (MOVE-DIR pos-05-16 pos-04-16 dir-left) + (MOVE-DIR pos-05-16 pos-05-15 dir-up) + (MOVE-DIR pos-06-02 pos-05-02 dir-left) + (MOVE-DIR pos-06-02 pos-07-02 dir-right) + (MOVE-DIR pos-06-04 pos-05-04 dir-left) + (MOVE-DIR pos-06-04 pos-07-04 dir-right) + (MOVE-DIR pos-07-02 pos-06-02 dir-left) + (MOVE-DIR pos-07-02 pos-08-02 dir-right) + (MOVE-DIR pos-07-04 pos-06-04 dir-left) + (MOVE-DIR pos-07-04 pos-08-04 dir-right) + (MOVE-DIR pos-07-06 pos-07-07 dir-down) + (MOVE-DIR pos-07-06 pos-08-06 dir-right) + (MOVE-DIR pos-07-07 pos-07-06 dir-up) + (MOVE-DIR pos-07-07 pos-07-08 dir-down) + (MOVE-DIR pos-07-08 pos-07-07 dir-up) + (MOVE-DIR pos-07-08 pos-07-09 dir-down) + (MOVE-DIR pos-07-09 pos-07-08 dir-up) + (MOVE-DIR pos-07-09 pos-07-10 dir-down) + (MOVE-DIR pos-07-10 pos-07-09 dir-up) + (MOVE-DIR pos-07-10 pos-07-11 dir-down) + (MOVE-DIR pos-07-11 pos-07-10 dir-up) + (MOVE-DIR pos-07-11 pos-07-12 dir-down) + (MOVE-DIR pos-07-12 pos-07-11 dir-up) + (MOVE-DIR pos-07-12 pos-07-13 dir-down) + (MOVE-DIR pos-07-13 pos-07-12 dir-up) + (MOVE-DIR pos-07-13 pos-07-14 dir-down) + (MOVE-DIR pos-07-14 pos-07-13 dir-up) + (MOVE-DIR pos-07-14 pos-07-15 dir-down) + (MOVE-DIR pos-07-15 pos-07-14 dir-up) + (MOVE-DIR pos-07-15 pos-07-16 dir-down) + (MOVE-DIR pos-07-16 pos-07-15 dir-up) + (MOVE-DIR pos-07-16 pos-08-16 dir-right) + (MOVE-DIR pos-08-02 pos-07-02 dir-left) + (MOVE-DIR pos-08-02 pos-09-02 dir-right) + (MOVE-DIR pos-08-04 pos-07-04 dir-left) + (MOVE-DIR pos-08-04 pos-09-04 dir-right) + (MOVE-DIR pos-08-06 pos-07-06 dir-left) + (MOVE-DIR pos-08-06 pos-09-06 dir-right) + (MOVE-DIR pos-08-16 pos-07-16 dir-left) + (MOVE-DIR pos-08-16 pos-09-16 dir-right) + (MOVE-DIR pos-09-02 pos-08-02 dir-left) + (MOVE-DIR pos-09-02 pos-10-02 dir-right) + (MOVE-DIR pos-09-04 pos-08-04 dir-left) + (MOVE-DIR pos-09-04 pos-10-04 dir-right) + (MOVE-DIR pos-09-06 pos-08-06 dir-left) + (MOVE-DIR pos-09-06 pos-10-06 dir-right) + (MOVE-DIR pos-09-08 pos-09-09 dir-down) + (MOVE-DIR pos-09-08 pos-10-08 dir-right) + (MOVE-DIR pos-09-09 pos-09-08 dir-up) + (MOVE-DIR pos-09-09 pos-09-10 dir-down) + (MOVE-DIR pos-09-10 pos-09-09 dir-up) + (MOVE-DIR pos-09-10 pos-09-11 dir-down) + (MOVE-DIR pos-09-11 pos-09-10 dir-up) + (MOVE-DIR pos-09-11 pos-09-12 dir-down) + (MOVE-DIR pos-09-12 pos-09-11 dir-up) + (MOVE-DIR pos-09-12 pos-09-13 dir-down) + (MOVE-DIR pos-09-13 pos-09-12 dir-up) + (MOVE-DIR pos-09-13 pos-09-14 dir-down) + (MOVE-DIR pos-09-14 pos-09-13 dir-up) + (MOVE-DIR pos-09-14 pos-10-14 dir-right) + (MOVE-DIR pos-09-16 pos-08-16 dir-left) + (MOVE-DIR pos-09-16 pos-10-16 dir-right) + (MOVE-DIR pos-10-02 pos-09-02 dir-left) + (MOVE-DIR pos-10-02 pos-11-02 dir-right) + (MOVE-DIR pos-10-04 pos-09-04 dir-left) + (MOVE-DIR pos-10-04 pos-11-04 dir-right) + (MOVE-DIR pos-10-06 pos-09-06 dir-left) + (MOVE-DIR pos-10-06 pos-11-06 dir-right) + (MOVE-DIR pos-10-08 pos-09-08 dir-left) + (MOVE-DIR pos-10-08 pos-11-08 dir-right) + (MOVE-DIR pos-10-14 pos-09-14 dir-left) + (MOVE-DIR pos-10-14 pos-11-14 dir-right) + (MOVE-DIR pos-10-16 pos-09-16 dir-left) + (MOVE-DIR pos-10-16 pos-11-16 dir-right) + (MOVE-DIR pos-11-02 pos-10-02 dir-left) + (MOVE-DIR pos-11-02 pos-12-02 dir-right) + (MOVE-DIR pos-11-04 pos-10-04 dir-left) + (MOVE-DIR pos-11-04 pos-12-04 dir-right) + (MOVE-DIR pos-11-06 pos-10-06 dir-left) + (MOVE-DIR pos-11-06 pos-12-06 dir-right) + (MOVE-DIR pos-11-08 pos-10-08 dir-left) + (MOVE-DIR pos-11-08 pos-12-08 dir-right) + (MOVE-DIR pos-11-10 pos-11-11 dir-down) + (MOVE-DIR pos-11-10 pos-12-10 dir-right) + (MOVE-DIR pos-11-11 pos-11-10 dir-up) + (MOVE-DIR pos-11-11 pos-11-12 dir-down) + (MOVE-DIR pos-11-12 pos-11-11 dir-up) + (MOVE-DIR pos-11-12 pos-12-12 dir-right) + (MOVE-DIR pos-11-14 pos-10-14 dir-left) + (MOVE-DIR pos-11-14 pos-12-14 dir-right) + (MOVE-DIR pos-11-16 pos-10-16 dir-left) + (MOVE-DIR pos-11-16 pos-12-16 dir-right) + (MOVE-DIR pos-12-02 pos-11-02 dir-left) + (MOVE-DIR pos-12-02 pos-13-02 dir-right) + (MOVE-DIR pos-12-04 pos-11-04 dir-left) + (MOVE-DIR pos-12-04 pos-13-04 dir-right) + (MOVE-DIR pos-12-06 pos-11-06 dir-left) + (MOVE-DIR pos-12-06 pos-13-06 dir-right) + (MOVE-DIR pos-12-08 pos-11-08 dir-left) + (MOVE-DIR pos-12-08 pos-13-08 dir-right) + (MOVE-DIR pos-12-10 pos-11-10 dir-left) + (MOVE-DIR pos-12-10 pos-13-10 dir-right) + (MOVE-DIR pos-12-12 pos-11-12 dir-left) + (MOVE-DIR pos-12-12 pos-13-12 dir-right) + (MOVE-DIR pos-12-14 pos-11-14 dir-left) + (MOVE-DIR pos-12-14 pos-13-14 dir-right) + (MOVE-DIR pos-12-16 pos-11-16 dir-left) + (MOVE-DIR pos-12-16 pos-13-16 dir-right) + (MOVE-DIR pos-13-02 pos-12-02 dir-left) + (MOVE-DIR pos-13-02 pos-14-02 dir-right) + (MOVE-DIR pos-13-04 pos-12-04 dir-left) + (MOVE-DIR pos-13-04 pos-14-04 dir-right) + (MOVE-DIR pos-13-06 pos-12-06 dir-left) + (MOVE-DIR pos-13-06 pos-14-06 dir-right) + (MOVE-DIR pos-13-08 pos-12-08 dir-left) + (MOVE-DIR pos-13-08 pos-14-08 dir-right) + (MOVE-DIR pos-13-10 pos-12-10 dir-left) + (MOVE-DIR pos-13-10 pos-14-10 dir-right) + (MOVE-DIR pos-13-12 pos-12-12 dir-left) + (MOVE-DIR pos-13-12 pos-14-12 dir-right) + (MOVE-DIR pos-13-14 pos-12-14 dir-left) + (MOVE-DIR pos-13-14 pos-14-14 dir-right) + (MOVE-DIR pos-13-16 pos-12-16 dir-left) + (MOVE-DIR pos-13-16 pos-14-16 dir-right) + (MOVE-DIR pos-14-02 pos-13-02 dir-left) + (MOVE-DIR pos-14-02 pos-15-02 dir-right) + (MOVE-DIR pos-14-04 pos-13-04 dir-left) + (MOVE-DIR pos-14-04 pos-15-04 dir-right) + (MOVE-DIR pos-14-06 pos-13-06 dir-left) + (MOVE-DIR pos-14-06 pos-15-06 dir-right) + (MOVE-DIR pos-14-08 pos-13-08 dir-left) + (MOVE-DIR pos-14-08 pos-15-08 dir-right) + (MOVE-DIR pos-14-10 pos-13-10 dir-left) + (MOVE-DIR pos-14-10 pos-15-10 dir-right) + (MOVE-DIR pos-14-12 pos-13-12 dir-left) + (MOVE-DIR pos-14-12 pos-15-12 dir-right) + (MOVE-DIR pos-14-14 pos-13-14 dir-left) + (MOVE-DIR pos-14-14 pos-15-14 dir-right) + (MOVE-DIR pos-14-16 pos-13-16 dir-left) + (MOVE-DIR pos-14-16 pos-15-16 dir-right) + (MOVE-DIR pos-15-02 pos-14-02 dir-left) + (MOVE-DIR pos-15-02 pos-16-02 dir-right) + (MOVE-DIR pos-15-04 pos-14-04 dir-left) + (MOVE-DIR pos-15-04 pos-16-04 dir-right) + (MOVE-DIR pos-15-06 pos-14-06 dir-left) + (MOVE-DIR pos-15-06 pos-16-06 dir-right) + (MOVE-DIR pos-15-08 pos-14-08 dir-left) + (MOVE-DIR pos-15-08 pos-16-08 dir-right) + (MOVE-DIR pos-15-10 pos-14-10 dir-left) + (MOVE-DIR pos-15-10 pos-16-10 dir-right) + (MOVE-DIR pos-15-12 pos-14-12 dir-left) + (MOVE-DIR pos-15-12 pos-16-12 dir-right) + (MOVE-DIR pos-15-14 pos-14-14 dir-left) + (MOVE-DIR pos-15-14 pos-16-14 dir-right) + (MOVE-DIR pos-15-16 pos-14-16 dir-left) + (MOVE-DIR pos-15-16 pos-16-16 dir-right) + (MOVE-DIR pos-16-02 pos-15-02 dir-left) + (MOVE-DIR pos-16-02 pos-17-02 dir-right) + (MOVE-DIR pos-16-04 pos-15-04 dir-left) + (MOVE-DIR pos-16-04 pos-17-04 dir-right) + (MOVE-DIR pos-16-06 pos-15-06 dir-left) + (MOVE-DIR pos-16-06 pos-17-06 dir-right) + (MOVE-DIR pos-16-08 pos-15-08 dir-left) + (MOVE-DIR pos-16-08 pos-17-08 dir-right) + (MOVE-DIR pos-16-10 pos-15-10 dir-left) + (MOVE-DIR pos-16-10 pos-17-10 dir-right) + (MOVE-DIR pos-16-12 pos-15-12 dir-left) + (MOVE-DIR pos-16-12 pos-17-12 dir-right) + (MOVE-DIR pos-16-14 pos-15-14 dir-left) + (MOVE-DIR pos-16-14 pos-17-14 dir-right) + (MOVE-DIR pos-16-16 pos-15-16 dir-left) + (MOVE-DIR pos-16-16 pos-17-16 dir-right) + (MOVE-DIR pos-17-02 pos-16-02 dir-left) + (MOVE-DIR pos-17-02 pos-18-02 dir-right) + (MOVE-DIR pos-17-04 pos-16-04 dir-left) + (MOVE-DIR pos-17-04 pos-18-04 dir-right) + (MOVE-DIR pos-17-06 pos-16-06 dir-left) + (MOVE-DIR pos-17-06 pos-18-06 dir-right) + (MOVE-DIR pos-17-08 pos-16-08 dir-left) + (MOVE-DIR pos-17-08 pos-18-08 dir-right) + (MOVE-DIR pos-17-10 pos-16-10 dir-left) + (MOVE-DIR pos-17-10 pos-18-10 dir-right) + (MOVE-DIR pos-17-12 pos-16-12 dir-left) + (MOVE-DIR pos-17-12 pos-18-12 dir-right) + (MOVE-DIR pos-17-14 pos-16-14 dir-left) + (MOVE-DIR pos-17-14 pos-18-14 dir-right) + (MOVE-DIR pos-17-16 pos-16-16 dir-left) + (MOVE-DIR pos-17-16 pos-18-16 dir-right) + (MOVE-DIR pos-18-02 pos-17-02 dir-left) + (MOVE-DIR pos-18-02 pos-19-02 dir-right) + (MOVE-DIR pos-18-04 pos-17-04 dir-left) + (MOVE-DIR pos-18-04 pos-19-04 dir-right) + (MOVE-DIR pos-18-06 pos-17-06 dir-left) + (MOVE-DIR pos-18-06 pos-19-06 dir-right) + (MOVE-DIR pos-18-08 pos-17-08 dir-left) + (MOVE-DIR pos-18-08 pos-19-08 dir-right) + (MOVE-DIR pos-18-10 pos-17-10 dir-left) + (MOVE-DIR pos-18-10 pos-19-10 dir-right) + (MOVE-DIR pos-18-12 pos-17-12 dir-left) + (MOVE-DIR pos-18-12 pos-19-12 dir-right) + (MOVE-DIR pos-18-14 pos-17-14 dir-left) + (MOVE-DIR pos-18-14 pos-19-14 dir-right) + (MOVE-DIR pos-18-16 pos-17-16 dir-left) + (MOVE-DIR pos-18-16 pos-19-16 dir-right) + (MOVE-DIR pos-19-02 pos-18-02 dir-left) + (MOVE-DIR pos-19-02 pos-20-02 dir-right) + (MOVE-DIR pos-19-04 pos-18-04 dir-left) + (MOVE-DIR pos-19-04 pos-20-04 dir-right) + (MOVE-DIR pos-19-06 pos-18-06 dir-left) + (MOVE-DIR pos-19-06 pos-20-06 dir-right) + (MOVE-DIR pos-19-08 pos-18-08 dir-left) + (MOVE-DIR pos-19-08 pos-20-08 dir-right) + (MOVE-DIR pos-19-10 pos-18-10 dir-left) + (MOVE-DIR pos-19-10 pos-20-10 dir-right) + (MOVE-DIR pos-19-12 pos-18-12 dir-left) + (MOVE-DIR pos-19-12 pos-20-12 dir-right) + (MOVE-DIR pos-19-14 pos-18-14 dir-left) + (MOVE-DIR pos-19-14 pos-20-14 dir-right) + (MOVE-DIR pos-19-16 pos-18-16 dir-left) + (MOVE-DIR pos-19-16 pos-20-16 dir-right) + (MOVE-DIR pos-20-02 pos-19-02 dir-left) + (MOVE-DIR pos-20-02 pos-21-02 dir-right) + (MOVE-DIR pos-20-04 pos-19-04 dir-left) + (MOVE-DIR pos-20-04 pos-21-04 dir-right) + (MOVE-DIR pos-20-06 pos-19-06 dir-left) + (MOVE-DIR pos-20-06 pos-21-06 dir-right) + (MOVE-DIR pos-20-08 pos-19-08 dir-left) + (MOVE-DIR pos-20-08 pos-21-08 dir-right) + (MOVE-DIR pos-20-10 pos-19-10 dir-left) + (MOVE-DIR pos-20-10 pos-21-10 dir-right) + (MOVE-DIR pos-20-12 pos-19-12 dir-left) + (MOVE-DIR pos-20-12 pos-21-12 dir-right) + (MOVE-DIR pos-20-14 pos-19-14 dir-left) + (MOVE-DIR pos-20-14 pos-21-14 dir-right) + (MOVE-DIR pos-20-16 pos-19-16 dir-left) + (MOVE-DIR pos-20-16 pos-21-16 dir-right) + (MOVE-DIR pos-21-02 pos-20-02 dir-left) + (MOVE-DIR pos-21-02 pos-22-02 dir-right) + (MOVE-DIR pos-21-04 pos-20-04 dir-left) + (MOVE-DIR pos-21-04 pos-22-04 dir-right) + (MOVE-DIR pos-21-06 pos-20-06 dir-left) + (MOVE-DIR pos-21-06 pos-22-06 dir-right) + (MOVE-DIR pos-21-08 pos-20-08 dir-left) + (MOVE-DIR pos-21-08 pos-22-08 dir-right) + (MOVE-DIR pos-21-10 pos-20-10 dir-left) + (MOVE-DIR pos-21-10 pos-22-10 dir-right) + (MOVE-DIR pos-21-12 pos-20-12 dir-left) + (MOVE-DIR pos-21-12 pos-22-12 dir-right) + (MOVE-DIR pos-21-14 pos-20-14 dir-left) + (MOVE-DIR pos-21-14 pos-22-14 dir-right) + (MOVE-DIR pos-21-16 pos-20-16 dir-left) + (MOVE-DIR pos-21-16 pos-22-16 dir-right) + (MOVE-DIR pos-22-02 pos-21-02 dir-left) + (MOVE-DIR pos-22-02 pos-23-02 dir-right) + (MOVE-DIR pos-22-04 pos-21-04 dir-left) + (MOVE-DIR pos-22-04 pos-23-04 dir-right) + (MOVE-DIR pos-22-06 pos-21-06 dir-left) + (MOVE-DIR pos-22-06 pos-23-06 dir-right) + (MOVE-DIR pos-22-08 pos-21-08 dir-left) + (MOVE-DIR pos-22-08 pos-22-09 dir-down) + (MOVE-DIR pos-22-09 pos-22-08 dir-up) + (MOVE-DIR pos-22-09 pos-22-10 dir-down) + (MOVE-DIR pos-22-10 pos-21-10 dir-left) + (MOVE-DIR pos-22-10 pos-22-09 dir-up) + (MOVE-DIR pos-22-12 pos-21-12 dir-left) + (MOVE-DIR pos-22-12 pos-23-12 dir-right) + (MOVE-DIR pos-22-14 pos-21-14 dir-left) + (MOVE-DIR pos-22-14 pos-23-14 dir-right) + (MOVE-DIR pos-22-16 pos-21-16 dir-left) + (MOVE-DIR pos-22-16 pos-23-16 dir-right) + (MOVE-DIR pos-23-02 pos-22-02 dir-left) + (MOVE-DIR pos-23-02 pos-24-02 dir-right) + (MOVE-DIR pos-23-04 pos-22-04 dir-left) + (MOVE-DIR pos-23-04 pos-24-04 dir-right) + (MOVE-DIR pos-23-06 pos-22-06 dir-left) + (MOVE-DIR pos-23-06 pos-24-06 dir-right) + (MOVE-DIR pos-23-12 pos-22-12 dir-left) + (MOVE-DIR pos-23-12 pos-24-12 dir-right) + (MOVE-DIR pos-23-14 pos-22-14 dir-left) + (MOVE-DIR pos-23-14 pos-24-14 dir-right) + (MOVE-DIR pos-23-16 pos-22-16 dir-left) + (MOVE-DIR pos-23-16 pos-24-16 dir-right) + (MOVE-DIR pos-24-02 pos-23-02 dir-left) + (MOVE-DIR pos-24-02 pos-25-02 dir-right) + (MOVE-DIR pos-24-04 pos-23-04 dir-left) + (MOVE-DIR pos-24-04 pos-25-04 dir-right) + (MOVE-DIR pos-24-06 pos-23-06 dir-left) + (MOVE-DIR pos-24-06 pos-24-07 dir-down) + (MOVE-DIR pos-24-07 pos-24-06 dir-up) + (MOVE-DIR pos-24-07 pos-24-08 dir-down) + (MOVE-DIR pos-24-08 pos-24-07 dir-up) + (MOVE-DIR pos-24-08 pos-24-09 dir-down) + (MOVE-DIR pos-24-09 pos-24-08 dir-up) + (MOVE-DIR pos-24-09 pos-24-10 dir-down) + (MOVE-DIR pos-24-10 pos-24-09 dir-up) + (MOVE-DIR pos-24-10 pos-24-11 dir-down) + (MOVE-DIR pos-24-11 pos-24-10 dir-up) + (MOVE-DIR pos-24-11 pos-24-12 dir-down) + (MOVE-DIR pos-24-12 pos-23-12 dir-left) + (MOVE-DIR pos-24-12 pos-24-11 dir-up) + (MOVE-DIR pos-24-14 pos-23-14 dir-left) + (MOVE-DIR pos-24-14 pos-25-14 dir-right) + (MOVE-DIR pos-24-16 pos-23-16 dir-left) + (MOVE-DIR pos-24-16 pos-25-16 dir-right) + (MOVE-DIR pos-25-02 pos-24-02 dir-left) + (MOVE-DIR pos-25-02 pos-26-02 dir-right) + (MOVE-DIR pos-25-04 pos-24-04 dir-left) + (MOVE-DIR pos-25-04 pos-26-04 dir-right) + (MOVE-DIR pos-25-14 pos-24-14 dir-left) + (MOVE-DIR pos-25-14 pos-26-14 dir-right) + (MOVE-DIR pos-25-16 pos-24-16 dir-left) + (MOVE-DIR pos-25-16 pos-26-16 dir-right) + (MOVE-DIR pos-26-02 pos-25-02 dir-left) + (MOVE-DIR pos-26-02 pos-27-02 dir-right) + (MOVE-DIR pos-26-04 pos-25-04 dir-left) + (MOVE-DIR pos-26-04 pos-26-05 dir-down) + (MOVE-DIR pos-26-05 pos-26-04 dir-up) + (MOVE-DIR pos-26-05 pos-26-06 dir-down) + (MOVE-DIR pos-26-06 pos-26-05 dir-up) + (MOVE-DIR pos-26-06 pos-26-07 dir-down) + (MOVE-DIR pos-26-07 pos-26-06 dir-up) + (MOVE-DIR pos-26-07 pos-26-08 dir-down) + (MOVE-DIR pos-26-08 pos-26-07 dir-up) + (MOVE-DIR pos-26-08 pos-26-09 dir-down) + (MOVE-DIR pos-26-09 pos-26-08 dir-up) + (MOVE-DIR pos-26-09 pos-26-10 dir-down) + (MOVE-DIR pos-26-10 pos-26-09 dir-up) + (MOVE-DIR pos-26-10 pos-26-11 dir-down) + (MOVE-DIR pos-26-11 pos-26-10 dir-up) + (MOVE-DIR pos-26-11 pos-26-12 dir-down) + (MOVE-DIR pos-26-12 pos-26-11 dir-up) + (MOVE-DIR pos-26-12 pos-26-13 dir-down) + (MOVE-DIR pos-26-13 pos-26-12 dir-up) + (MOVE-DIR pos-26-13 pos-26-14 dir-down) + (MOVE-DIR pos-26-14 pos-25-14 dir-left) + (MOVE-DIR pos-26-14 pos-26-13 dir-up) + (MOVE-DIR pos-26-16 pos-25-16 dir-left) + (MOVE-DIR pos-26-16 pos-27-16 dir-right) + (MOVE-DIR pos-27-02 pos-26-02 dir-left) + (MOVE-DIR pos-27-02 pos-28-02 dir-right) + (MOVE-DIR pos-27-16 pos-26-16 dir-left) + (MOVE-DIR pos-27-16 pos-28-16 dir-right) + (MOVE-DIR pos-28-02 pos-27-02 dir-left) + (MOVE-DIR pos-28-02 pos-28-03 dir-down) + (MOVE-DIR pos-28-03 pos-28-02 dir-up) + (MOVE-DIR pos-28-03 pos-28-04 dir-down) + (MOVE-DIR pos-28-04 pos-28-03 dir-up) + (MOVE-DIR pos-28-04 pos-28-05 dir-down) + (MOVE-DIR pos-28-05 pos-28-04 dir-up) + (MOVE-DIR pos-28-05 pos-28-06 dir-down) + (MOVE-DIR pos-28-06 pos-28-05 dir-up) + (MOVE-DIR pos-28-06 pos-28-07 dir-down) + (MOVE-DIR pos-28-07 pos-28-06 dir-up) + (MOVE-DIR pos-28-07 pos-28-08 dir-down) + (MOVE-DIR pos-28-08 pos-28-07 dir-up) + (MOVE-DIR pos-28-08 pos-28-09 dir-down) + (MOVE-DIR pos-28-09 pos-28-08 dir-up) + (MOVE-DIR pos-28-09 pos-28-10 dir-down) + (MOVE-DIR pos-28-10 pos-28-09 dir-up) + (MOVE-DIR pos-28-10 pos-28-11 dir-down) + (MOVE-DIR pos-28-11 pos-28-10 dir-up) + (MOVE-DIR pos-28-11 pos-28-12 dir-down) + (MOVE-DIR pos-28-12 pos-28-11 dir-up) + (MOVE-DIR pos-28-12 pos-28-13 dir-down) + (MOVE-DIR pos-28-13 pos-28-12 dir-up) + (MOVE-DIR pos-28-13 pos-28-14 dir-down) + (MOVE-DIR pos-28-14 pos-28-13 dir-up) + (MOVE-DIR pos-28-14 pos-28-15 dir-down) + (MOVE-DIR pos-28-15 pos-28-14 dir-up) + (MOVE-DIR pos-28-15 pos-28-16 dir-down) + (MOVE-DIR pos-28-16 pos-27-16 dir-left) + (MOVE-DIR pos-28-16 pos-28-15 dir-up) + (at player-01 pos-04-16) + (at stone-01 pos-03-15) + (clear pos-01-01) + (clear pos-01-02) + (clear pos-01-03) + (clear pos-01-04) + (clear pos-01-05) + (clear pos-01-06) + (clear pos-01-07) + (clear pos-01-08) + (clear pos-01-09) + (clear pos-01-10) + (clear pos-01-11) + (clear pos-01-12) + (clear pos-01-13) + (clear pos-01-14) + (clear pos-02-16) + (clear pos-03-02) + (clear pos-03-03) + (clear pos-03-04) + (clear pos-03-05) + (clear pos-03-06) + (clear pos-03-07) + (clear pos-03-08) + (clear pos-03-09) + (clear pos-03-10) + (clear pos-03-11) + (clear pos-03-12) + (clear pos-03-13) + (clear pos-03-14) + (clear pos-03-16) + (clear pos-04-02) + (clear pos-05-02) + (clear pos-05-04) + (clear pos-05-05) + (clear pos-05-06) + (clear pos-05-07) + (clear pos-05-08) + (clear pos-05-09) + (clear pos-05-10) + (clear pos-05-11) + (clear pos-05-12) + (clear pos-05-13) + (clear pos-05-14) + (clear pos-05-15) + (clear pos-05-16) + (clear pos-06-02) + (clear pos-06-04) + (clear pos-07-02) + (clear pos-07-04) + (clear pos-07-06) + (clear pos-07-07) + (clear pos-07-08) + (clear pos-07-09) + (clear pos-07-10) + (clear pos-07-11) + (clear pos-07-12) + (clear pos-07-13) + (clear pos-07-14) + (clear pos-07-15) + (clear pos-07-16) + (clear pos-08-02) + (clear pos-08-04) + (clear pos-08-06) + (clear pos-08-16) + (clear pos-09-02) + (clear pos-09-04) + (clear pos-09-06) + (clear pos-09-08) + (clear pos-09-09) + (clear pos-09-10) + (clear pos-09-11) + (clear pos-09-12) + (clear pos-09-13) + (clear pos-09-14) + (clear pos-09-16) + (clear pos-10-02) + (clear pos-10-04) + (clear pos-10-06) + (clear pos-10-08) + (clear pos-10-14) + (clear pos-10-16) + (clear pos-11-02) + (clear pos-11-04) + (clear pos-11-06) + (clear pos-11-08) + (clear pos-11-10) + (clear pos-11-11) + (clear pos-11-12) + (clear pos-11-14) + (clear pos-11-16) + (clear pos-12-02) + (clear pos-12-04) + (clear pos-12-06) + (clear pos-12-08) + (clear pos-12-10) + (clear pos-12-12) + (clear pos-12-14) + (clear pos-12-16) + (clear pos-13-02) + (clear pos-13-04) + (clear pos-13-06) + (clear pos-13-08) + (clear pos-13-10) + (clear pos-13-12) + (clear pos-13-14) + (clear pos-13-16) + (clear pos-14-02) + (clear pos-14-04) + (clear pos-14-06) + (clear pos-14-08) + (clear pos-14-10) + (clear pos-14-12) + (clear pos-14-14) + (clear pos-14-16) + (clear pos-15-02) + (clear pos-15-04) + (clear pos-15-06) + (clear pos-15-08) + (clear pos-15-10) + (clear pos-15-12) + (clear pos-15-14) + (clear pos-15-16) + (clear pos-16-02) + (clear pos-16-04) + (clear pos-16-06) + (clear pos-16-08) + (clear pos-16-10) + (clear pos-16-12) + (clear pos-16-14) + (clear pos-16-16) + (clear pos-17-02) + (clear pos-17-04) + (clear pos-17-06) + (clear pos-17-08) + (clear pos-17-10) + (clear pos-17-12) + (clear pos-17-14) + (clear pos-17-16) + (clear pos-18-02) + (clear pos-18-04) + (clear pos-18-06) + (clear pos-18-08) + (clear pos-18-10) + (clear pos-18-12) + (clear pos-18-14) + (clear pos-18-16) + (clear pos-19-02) + (clear pos-19-04) + (clear pos-19-06) + (clear pos-19-08) + (clear pos-19-10) + (clear pos-19-12) + (clear pos-19-14) + (clear pos-19-16) + (clear pos-20-02) + (clear pos-20-04) + (clear pos-20-06) + (clear pos-20-08) + (clear pos-20-10) + (clear pos-20-12) + (clear pos-20-14) + (clear pos-20-16) + (clear pos-21-02) + (clear pos-21-04) + (clear pos-21-06) + (clear pos-21-08) + (clear pos-21-10) + (clear pos-21-12) + (clear pos-21-14) + (clear pos-21-16) + (clear pos-22-02) + (clear pos-22-04) + (clear pos-22-06) + (clear pos-22-08) + (clear pos-22-09) + (clear pos-22-10) + (clear pos-22-12) + (clear pos-22-14) + (clear pos-22-16) + (clear pos-23-02) + (clear pos-23-04) + (clear pos-23-06) + (clear pos-23-12) + (clear pos-23-14) + (clear pos-23-16) + (clear pos-24-02) + (clear pos-24-04) + (clear pos-24-06) + (clear pos-24-07) + (clear pos-24-08) + (clear pos-24-09) + (clear pos-24-10) + (clear pos-24-11) + (clear pos-24-12) + (clear pos-24-14) + (clear pos-24-16) + (clear pos-25-02) + (clear pos-25-04) + (clear pos-25-14) + (clear pos-25-16) + (clear pos-26-02) + (clear pos-26-04) + (clear pos-26-05) + (clear pos-26-06) + (clear pos-26-07) + (clear pos-26-08) + (clear pos-26-09) + (clear pos-26-10) + (clear pos-26-11) + (clear pos-26-12) + (clear pos-26-13) + (clear pos-26-14) + (clear pos-26-16) + (clear pos-27-02) + (clear pos-27-16) + (clear pos-28-02) + (clear pos-28-03) + (clear pos-28-04) + (clear pos-28-05) + (clear pos-28-06) + (clear pos-28-07) + (clear pos-28-08) + (clear pos-28-09) + (clear pos-28-10) + (clear pos-28-11) + (clear pos-28-12) + (clear pos-28-13) + (clear pos-28-14) + (clear pos-28-15) + (clear pos-28-16) + (= (total-cost) 0) + ) + (:goal (and + (at-goal stone-01) + )) + (:metric minimize (total-cost)) +) diff --git a/tests/fixtures/pddl_files/sokoban-sequential-optimal/p13.pddl b/tests/fixtures/pddl_files/sokoban-sequential-optimal/p13.pddl new file mode 100644 index 00000000..eafae099 --- /dev/null +++ b/tests/fixtures/pddl_files/sokoban-sequential-optimal/p13.pddl @@ -0,0 +1,345 @@ +;; ##### +;; # # +;; # . # +;; #.@.### +;; ##.# # +;; # $ # +;; # $ # +;; ##$$ # +;; # ### +;; # # +;; #### + +(define (problem p131-microban-sequential) + (:domain sokoban-sequential) + (:objects + dir-down - direction + dir-left - direction + dir-right - direction + dir-up - direction + player-01 - player + pos-01-01 - location + pos-01-02 - location + pos-01-03 - location + pos-01-04 - location + pos-01-05 - location + pos-01-06 - location + pos-01-07 - location + pos-01-08 - location + pos-01-09 - location + pos-01-10 - location + pos-01-11 - location + pos-02-01 - location + pos-02-02 - location + pos-02-03 - location + pos-02-04 - location + pos-02-05 - location + pos-02-06 - location + pos-02-07 - location + pos-02-08 - location + pos-02-09 - location + pos-02-10 - location + pos-02-11 - location + pos-03-01 - location + pos-03-02 - location + pos-03-03 - location + pos-03-04 - location + pos-03-05 - location + pos-03-06 - location + pos-03-07 - location + pos-03-08 - location + pos-03-09 - location + pos-03-10 - location + pos-03-11 - location + pos-04-01 - location + pos-04-02 - location + pos-04-03 - location + pos-04-04 - location + pos-04-05 - location + pos-04-06 - location + pos-04-07 - location + pos-04-08 - location + pos-04-09 - location + pos-04-10 - location + pos-04-11 - location + pos-05-01 - location + pos-05-02 - location + pos-05-03 - location + pos-05-04 - location + pos-05-05 - location + pos-05-06 - location + pos-05-07 - location + pos-05-08 - location + pos-05-09 - location + pos-05-10 - location + pos-05-11 - location + pos-06-01 - location + pos-06-02 - location + pos-06-03 - location + pos-06-04 - location + pos-06-05 - location + pos-06-06 - location + pos-06-07 - location + pos-06-08 - location + pos-06-09 - location + pos-06-10 - location + pos-06-11 - location + pos-07-01 - location + pos-07-02 - location + pos-07-03 - location + pos-07-04 - location + pos-07-05 - location + pos-07-06 - location + pos-07-07 - location + pos-07-08 - location + pos-07-09 - location + pos-07-10 - location + pos-07-11 - location + stone-01 - stone + stone-02 - stone + stone-03 - stone + stone-04 - stone + ) + (:init + (IS-GOAL pos-02-04) + (IS-GOAL pos-03-03) + (IS-GOAL pos-03-05) + (IS-GOAL pos-04-04) + (IS-NONGOAL pos-01-01) + (IS-NONGOAL pos-01-02) + (IS-NONGOAL pos-01-03) + (IS-NONGOAL pos-01-04) + (IS-NONGOAL pos-01-05) + (IS-NONGOAL pos-01-06) + (IS-NONGOAL pos-01-07) + (IS-NONGOAL pos-01-08) + (IS-NONGOAL pos-01-09) + (IS-NONGOAL pos-01-10) + (IS-NONGOAL pos-01-11) + (IS-NONGOAL pos-02-01) + (IS-NONGOAL pos-02-02) + (IS-NONGOAL pos-02-03) + (IS-NONGOAL pos-02-05) + (IS-NONGOAL pos-02-06) + (IS-NONGOAL pos-02-07) + (IS-NONGOAL pos-02-08) + (IS-NONGOAL pos-02-09) + (IS-NONGOAL pos-02-10) + (IS-NONGOAL pos-02-11) + (IS-NONGOAL pos-03-01) + (IS-NONGOAL pos-03-02) + (IS-NONGOAL pos-03-04) + (IS-NONGOAL pos-03-06) + (IS-NONGOAL pos-03-07) + (IS-NONGOAL pos-03-08) + (IS-NONGOAL pos-03-09) + (IS-NONGOAL pos-03-10) + (IS-NONGOAL pos-03-11) + (IS-NONGOAL pos-04-01) + (IS-NONGOAL pos-04-02) + (IS-NONGOAL pos-04-03) + (IS-NONGOAL pos-04-05) + (IS-NONGOAL pos-04-06) + (IS-NONGOAL pos-04-07) + (IS-NONGOAL pos-04-08) + (IS-NONGOAL pos-04-09) + (IS-NONGOAL pos-04-10) + (IS-NONGOAL pos-04-11) + (IS-NONGOAL pos-05-01) + (IS-NONGOAL pos-05-02) + (IS-NONGOAL pos-05-03) + (IS-NONGOAL pos-05-04) + (IS-NONGOAL pos-05-05) + (IS-NONGOAL pos-05-06) + (IS-NONGOAL pos-05-07) + (IS-NONGOAL pos-05-08) + (IS-NONGOAL pos-05-09) + (IS-NONGOAL pos-05-10) + (IS-NONGOAL pos-05-11) + (IS-NONGOAL pos-06-01) + (IS-NONGOAL pos-06-02) + (IS-NONGOAL pos-06-03) + (IS-NONGOAL pos-06-04) + (IS-NONGOAL pos-06-05) + (IS-NONGOAL pos-06-06) + (IS-NONGOAL pos-06-07) + (IS-NONGOAL pos-06-08) + (IS-NONGOAL pos-06-09) + (IS-NONGOAL pos-06-10) + (IS-NONGOAL pos-06-11) + (IS-NONGOAL pos-07-01) + (IS-NONGOAL pos-07-02) + (IS-NONGOAL pos-07-03) + (IS-NONGOAL pos-07-04) + (IS-NONGOAL pos-07-05) + (IS-NONGOAL pos-07-06) + (IS-NONGOAL pos-07-07) + (IS-NONGOAL pos-07-08) + (IS-NONGOAL pos-07-09) + (IS-NONGOAL pos-07-10) + (IS-NONGOAL pos-07-11) + (MOVE-DIR pos-01-09 pos-01-10 dir-down) + (MOVE-DIR pos-01-10 pos-01-09 dir-up) + (MOVE-DIR pos-01-10 pos-01-11 dir-down) + (MOVE-DIR pos-01-11 pos-01-10 dir-up) + (MOVE-DIR pos-02-02 pos-02-03 dir-down) + (MOVE-DIR pos-02-02 pos-03-02 dir-right) + (MOVE-DIR pos-02-03 pos-02-02 dir-up) + (MOVE-DIR pos-02-03 pos-02-04 dir-down) + (MOVE-DIR pos-02-03 pos-03-03 dir-right) + (MOVE-DIR pos-02-04 pos-02-03 dir-up) + (MOVE-DIR pos-02-04 pos-03-04 dir-right) + (MOVE-DIR pos-02-06 pos-02-07 dir-down) + (MOVE-DIR pos-02-06 pos-03-06 dir-right) + (MOVE-DIR pos-02-07 pos-02-06 dir-up) + (MOVE-DIR pos-02-07 pos-03-07 dir-right) + (MOVE-DIR pos-03-02 pos-02-02 dir-left) + (MOVE-DIR pos-03-02 pos-03-03 dir-down) + (MOVE-DIR pos-03-02 pos-04-02 dir-right) + (MOVE-DIR pos-03-03 pos-02-03 dir-left) + (MOVE-DIR pos-03-03 pos-03-02 dir-up) + (MOVE-DIR pos-03-03 pos-03-04 dir-down) + (MOVE-DIR pos-03-03 pos-04-03 dir-right) + (MOVE-DIR pos-03-04 pos-02-04 dir-left) + (MOVE-DIR pos-03-04 pos-03-03 dir-up) + (MOVE-DIR pos-03-04 pos-03-05 dir-down) + (MOVE-DIR pos-03-04 pos-04-04 dir-right) + (MOVE-DIR pos-03-05 pos-03-04 dir-up) + (MOVE-DIR pos-03-05 pos-03-06 dir-down) + (MOVE-DIR pos-03-06 pos-02-06 dir-left) + (MOVE-DIR pos-03-06 pos-03-05 dir-up) + (MOVE-DIR pos-03-06 pos-03-07 dir-down) + (MOVE-DIR pos-03-06 pos-04-06 dir-right) + (MOVE-DIR pos-03-07 pos-02-07 dir-left) + (MOVE-DIR pos-03-07 pos-03-06 dir-up) + (MOVE-DIR pos-03-07 pos-03-08 dir-down) + (MOVE-DIR pos-03-07 pos-04-07 dir-right) + (MOVE-DIR pos-03-08 pos-03-07 dir-up) + (MOVE-DIR pos-03-08 pos-03-09 dir-down) + (MOVE-DIR pos-03-08 pos-04-08 dir-right) + (MOVE-DIR pos-03-09 pos-03-08 dir-up) + (MOVE-DIR pos-03-09 pos-03-10 dir-down) + (MOVE-DIR pos-03-09 pos-04-09 dir-right) + (MOVE-DIR pos-03-10 pos-03-09 dir-up) + (MOVE-DIR pos-03-10 pos-04-10 dir-right) + (MOVE-DIR pos-04-02 pos-03-02 dir-left) + (MOVE-DIR pos-04-02 pos-04-03 dir-down) + (MOVE-DIR pos-04-03 pos-03-03 dir-left) + (MOVE-DIR pos-04-03 pos-04-02 dir-up) + (MOVE-DIR pos-04-03 pos-04-04 dir-down) + (MOVE-DIR pos-04-04 pos-03-04 dir-left) + (MOVE-DIR pos-04-04 pos-04-03 dir-up) + (MOVE-DIR pos-04-06 pos-03-06 dir-left) + (MOVE-DIR pos-04-06 pos-04-07 dir-down) + (MOVE-DIR pos-04-06 pos-05-06 dir-right) + (MOVE-DIR pos-04-07 pos-03-07 dir-left) + (MOVE-DIR pos-04-07 pos-04-06 dir-up) + (MOVE-DIR pos-04-07 pos-04-08 dir-down) + (MOVE-DIR pos-04-07 pos-05-07 dir-right) + (MOVE-DIR pos-04-08 pos-03-08 dir-left) + (MOVE-DIR pos-04-08 pos-04-07 dir-up) + (MOVE-DIR pos-04-08 pos-04-09 dir-down) + (MOVE-DIR pos-04-08 pos-05-08 dir-right) + (MOVE-DIR pos-04-09 pos-03-09 dir-left) + (MOVE-DIR pos-04-09 pos-04-08 dir-up) + (MOVE-DIR pos-04-09 pos-04-10 dir-down) + (MOVE-DIR pos-04-10 pos-03-10 dir-left) + (MOVE-DIR pos-04-10 pos-04-09 dir-up) + (MOVE-DIR pos-05-05 pos-05-06 dir-down) + (MOVE-DIR pos-05-05 pos-06-05 dir-right) + (MOVE-DIR pos-05-06 pos-04-06 dir-left) + (MOVE-DIR pos-05-06 pos-05-05 dir-up) + (MOVE-DIR pos-05-06 pos-05-07 dir-down) + (MOVE-DIR pos-05-06 pos-06-06 dir-right) + (MOVE-DIR pos-05-07 pos-04-07 dir-left) + (MOVE-DIR pos-05-07 pos-05-06 dir-up) + (MOVE-DIR pos-05-07 pos-05-08 dir-down) + (MOVE-DIR pos-05-07 pos-06-07 dir-right) + (MOVE-DIR pos-05-08 pos-04-08 dir-left) + (MOVE-DIR pos-05-08 pos-05-07 dir-up) + (MOVE-DIR pos-05-08 pos-06-08 dir-right) + (MOVE-DIR pos-06-01 pos-06-02 dir-down) + (MOVE-DIR pos-06-01 pos-07-01 dir-right) + (MOVE-DIR pos-06-02 pos-06-01 dir-up) + (MOVE-DIR pos-06-02 pos-06-03 dir-down) + (MOVE-DIR pos-06-02 pos-07-02 dir-right) + (MOVE-DIR pos-06-03 pos-06-02 dir-up) + (MOVE-DIR pos-06-03 pos-07-03 dir-right) + (MOVE-DIR pos-06-05 pos-05-05 dir-left) + (MOVE-DIR pos-06-05 pos-06-06 dir-down) + (MOVE-DIR pos-06-06 pos-05-06 dir-left) + (MOVE-DIR pos-06-06 pos-06-05 dir-up) + (MOVE-DIR pos-06-06 pos-06-07 dir-down) + (MOVE-DIR pos-06-07 pos-05-07 dir-left) + (MOVE-DIR pos-06-07 pos-06-06 dir-up) + (MOVE-DIR pos-06-07 pos-06-08 dir-down) + (MOVE-DIR pos-06-08 pos-05-08 dir-left) + (MOVE-DIR pos-06-08 pos-06-07 dir-up) + (MOVE-DIR pos-06-10 pos-06-11 dir-down) + (MOVE-DIR pos-06-10 pos-07-10 dir-right) + (MOVE-DIR pos-06-11 pos-06-10 dir-up) + (MOVE-DIR pos-06-11 pos-07-11 dir-right) + (MOVE-DIR pos-07-01 pos-06-01 dir-left) + (MOVE-DIR pos-07-01 pos-07-02 dir-down) + (MOVE-DIR pos-07-02 pos-06-02 dir-left) + (MOVE-DIR pos-07-02 pos-07-01 dir-up) + (MOVE-DIR pos-07-02 pos-07-03 dir-down) + (MOVE-DIR pos-07-03 pos-06-03 dir-left) + (MOVE-DIR pos-07-03 pos-07-02 dir-up) + (MOVE-DIR pos-07-10 pos-06-10 dir-left) + (MOVE-DIR pos-07-10 pos-07-11 dir-down) + (MOVE-DIR pos-07-11 pos-06-11 dir-left) + (MOVE-DIR pos-07-11 pos-07-10 dir-up) + (at player-01 pos-03-04) + (at stone-01 pos-04-06) + (at stone-02 pos-03-07) + (at stone-03 pos-03-08) + (at stone-04 pos-04-08) + (clear pos-01-09) + (clear pos-01-10) + (clear pos-01-11) + (clear pos-02-02) + (clear pos-02-03) + (clear pos-02-04) + (clear pos-02-06) + (clear pos-02-07) + (clear pos-03-02) + (clear pos-03-03) + (clear pos-03-05) + (clear pos-03-06) + (clear pos-03-09) + (clear pos-03-10) + (clear pos-04-02) + (clear pos-04-03) + (clear pos-04-04) + (clear pos-04-07) + (clear pos-04-09) + (clear pos-04-10) + (clear pos-05-05) + (clear pos-05-06) + (clear pos-05-07) + (clear pos-05-08) + (clear pos-06-01) + (clear pos-06-02) + (clear pos-06-03) + (clear pos-06-05) + (clear pos-06-06) + (clear pos-06-07) + (clear pos-06-08) + (clear pos-06-10) + (clear pos-06-11) + (clear pos-07-01) + (clear pos-07-02) + (clear pos-07-03) + (clear pos-07-10) + (clear pos-07-11) + (= (total-cost) 0) + ) + (:goal (and + (at-goal stone-01) + (at-goal stone-02) + (at-goal stone-03) + (at-goal stone-04) + )) + (:metric minimize (total-cost)) +) diff --git a/tests/fixtures/pddl_files/sokoban-sequential-optimal/p14.pddl b/tests/fixtures/pddl_files/sokoban-sequential-optimal/p14.pddl new file mode 100644 index 00000000..2c4afc00 --- /dev/null +++ b/tests/fixtures/pddl_files/sokoban-sequential-optimal/p14.pddl @@ -0,0 +1,374 @@ +;; ## #### +;; #### #### +;; # $ $. # +;; ## # .$ # +;; # ##.### +;; # $ . # +;; # @ # # +;; # ###### +;; #### + +(define (problem p127-microban-sequential) + (:domain sokoban-sequential) + (:objects + dir-down - direction + dir-left - direction + dir-right - direction + dir-up - direction + player-01 - player + pos-01-01 - location + pos-01-02 - location + pos-01-03 - location + pos-01-04 - location + pos-01-05 - location + pos-01-06 - location + pos-01-07 - location + pos-01-08 - location + pos-01-09 - location + pos-02-01 - location + pos-02-02 - location + pos-02-03 - location + pos-02-04 - location + pos-02-05 - location + pos-02-06 - location + pos-02-07 - location + pos-02-08 - location + pos-02-09 - location + pos-03-01 - location + pos-03-02 - location + pos-03-03 - location + pos-03-04 - location + pos-03-05 - location + pos-03-06 - location + pos-03-07 - location + pos-03-08 - location + pos-03-09 - location + pos-04-01 - location + pos-04-02 - location + pos-04-03 - location + pos-04-04 - location + pos-04-05 - location + pos-04-06 - location + pos-04-07 - location + pos-04-08 - location + pos-04-09 - location + pos-05-01 - location + pos-05-02 - location + pos-05-03 - location + pos-05-04 - location + pos-05-05 - location + pos-05-06 - location + pos-05-07 - location + pos-05-08 - location + pos-05-09 - location + pos-06-01 - location + pos-06-02 - location + pos-06-03 - location + pos-06-04 - location + pos-06-05 - location + pos-06-06 - location + pos-06-07 - location + pos-06-08 - location + pos-06-09 - location + pos-07-01 - location + pos-07-02 - location + pos-07-03 - location + pos-07-04 - location + pos-07-05 - location + pos-07-06 - location + pos-07-07 - location + pos-07-08 - location + pos-07-09 - location + pos-08-01 - location + pos-08-02 - location + pos-08-03 - location + pos-08-04 - location + pos-08-05 - location + pos-08-06 - location + pos-08-07 - location + pos-08-08 - location + pos-08-09 - location + pos-09-01 - location + pos-09-02 - location + pos-09-03 - location + pos-09-04 - location + pos-09-05 - location + pos-09-06 - location + pos-09-07 - location + pos-09-08 - location + pos-09-09 - location + pos-10-01 - location + pos-10-02 - location + pos-10-03 - location + pos-10-04 - location + pos-10-05 - location + pos-10-06 - location + pos-10-07 - location + pos-10-08 - location + pos-10-09 - location + stone-01 - stone + stone-02 - stone + stone-03 - stone + stone-04 - stone + ) + (:init + (IS-GOAL pos-07-03) + (IS-GOAL pos-07-04) + (IS-GOAL pos-07-05) + (IS-GOAL pos-07-06) + (IS-NONGOAL pos-01-01) + (IS-NONGOAL pos-01-02) + (IS-NONGOAL pos-01-03) + (IS-NONGOAL pos-01-04) + (IS-NONGOAL pos-01-05) + (IS-NONGOAL pos-01-06) + (IS-NONGOAL pos-01-07) + (IS-NONGOAL pos-01-08) + (IS-NONGOAL pos-01-09) + (IS-NONGOAL pos-02-01) + (IS-NONGOAL pos-02-02) + (IS-NONGOAL pos-02-03) + (IS-NONGOAL pos-02-04) + (IS-NONGOAL pos-02-05) + (IS-NONGOAL pos-02-06) + (IS-NONGOAL pos-02-07) + (IS-NONGOAL pos-02-08) + (IS-NONGOAL pos-02-09) + (IS-NONGOAL pos-03-01) + (IS-NONGOAL pos-03-02) + (IS-NONGOAL pos-03-03) + (IS-NONGOAL pos-03-04) + (IS-NONGOAL pos-03-05) + (IS-NONGOAL pos-03-06) + (IS-NONGOAL pos-03-07) + (IS-NONGOAL pos-03-08) + (IS-NONGOAL pos-03-09) + (IS-NONGOAL pos-04-01) + (IS-NONGOAL pos-04-02) + (IS-NONGOAL pos-04-03) + (IS-NONGOAL pos-04-04) + (IS-NONGOAL pos-04-05) + (IS-NONGOAL pos-04-06) + (IS-NONGOAL pos-04-07) + (IS-NONGOAL pos-04-08) + (IS-NONGOAL pos-04-09) + (IS-NONGOAL pos-05-01) + (IS-NONGOAL pos-05-02) + (IS-NONGOAL pos-05-03) + (IS-NONGOAL pos-05-04) + (IS-NONGOAL pos-05-05) + (IS-NONGOAL pos-05-06) + (IS-NONGOAL pos-05-07) + (IS-NONGOAL pos-05-08) + (IS-NONGOAL pos-05-09) + (IS-NONGOAL pos-06-01) + (IS-NONGOAL pos-06-02) + (IS-NONGOAL pos-06-03) + (IS-NONGOAL pos-06-04) + (IS-NONGOAL pos-06-05) + (IS-NONGOAL pos-06-06) + (IS-NONGOAL pos-06-07) + (IS-NONGOAL pos-06-08) + (IS-NONGOAL pos-06-09) + (IS-NONGOAL pos-07-01) + (IS-NONGOAL pos-07-02) + (IS-NONGOAL pos-07-07) + (IS-NONGOAL pos-07-08) + (IS-NONGOAL pos-07-09) + (IS-NONGOAL pos-08-01) + (IS-NONGOAL pos-08-02) + (IS-NONGOAL pos-08-03) + (IS-NONGOAL pos-08-04) + (IS-NONGOAL pos-08-05) + (IS-NONGOAL pos-08-06) + (IS-NONGOAL pos-08-07) + (IS-NONGOAL pos-08-08) + (IS-NONGOAL pos-08-09) + (IS-NONGOAL pos-09-01) + (IS-NONGOAL pos-09-02) + (IS-NONGOAL pos-09-03) + (IS-NONGOAL pos-09-04) + (IS-NONGOAL pos-09-05) + (IS-NONGOAL pos-09-06) + (IS-NONGOAL pos-09-07) + (IS-NONGOAL pos-09-08) + (IS-NONGOAL pos-09-09) + (IS-NONGOAL pos-10-01) + (IS-NONGOAL pos-10-02) + (IS-NONGOAL pos-10-03) + (IS-NONGOAL pos-10-04) + (IS-NONGOAL pos-10-05) + (IS-NONGOAL pos-10-06) + (IS-NONGOAL pos-10-07) + (IS-NONGOAL pos-10-08) + (IS-NONGOAL pos-10-09) + (MOVE-DIR pos-02-05 pos-02-06 dir-down) + (MOVE-DIR pos-02-05 pos-03-05 dir-right) + (MOVE-DIR pos-02-06 pos-02-05 dir-up) + (MOVE-DIR pos-02-06 pos-02-07 dir-down) + (MOVE-DIR pos-02-06 pos-03-06 dir-right) + (MOVE-DIR pos-02-07 pos-02-06 dir-up) + (MOVE-DIR pos-02-07 pos-02-08 dir-down) + (MOVE-DIR pos-02-07 pos-03-07 dir-right) + (MOVE-DIR pos-02-08 pos-02-07 dir-up) + (MOVE-DIR pos-02-08 pos-03-08 dir-right) + (MOVE-DIR pos-03-03 pos-03-04 dir-down) + (MOVE-DIR pos-03-03 pos-04-03 dir-right) + (MOVE-DIR pos-03-04 pos-03-03 dir-up) + (MOVE-DIR pos-03-04 pos-03-05 dir-down) + (MOVE-DIR pos-03-05 pos-02-05 dir-left) + (MOVE-DIR pos-03-05 pos-03-04 dir-up) + (MOVE-DIR pos-03-05 pos-03-06 dir-down) + (MOVE-DIR pos-03-05 pos-04-05 dir-right) + (MOVE-DIR pos-03-06 pos-02-06 dir-left) + (MOVE-DIR pos-03-06 pos-03-05 dir-up) + (MOVE-DIR pos-03-06 pos-03-07 dir-down) + (MOVE-DIR pos-03-06 pos-04-06 dir-right) + (MOVE-DIR pos-03-07 pos-02-07 dir-left) + (MOVE-DIR pos-03-07 pos-03-06 dir-up) + (MOVE-DIR pos-03-07 pos-03-08 dir-down) + (MOVE-DIR pos-03-07 pos-04-07 dir-right) + (MOVE-DIR pos-03-08 pos-02-08 dir-left) + (MOVE-DIR pos-03-08 pos-03-07 dir-up) + (MOVE-DIR pos-04-03 pos-03-03 dir-left) + (MOVE-DIR pos-04-03 pos-05-03 dir-right) + (MOVE-DIR pos-04-05 pos-03-05 dir-left) + (MOVE-DIR pos-04-05 pos-04-06 dir-down) + (MOVE-DIR pos-04-06 pos-03-06 dir-left) + (MOVE-DIR pos-04-06 pos-04-05 dir-up) + (MOVE-DIR pos-04-06 pos-04-07 dir-down) + (MOVE-DIR pos-04-06 pos-05-06 dir-right) + (MOVE-DIR pos-04-07 pos-03-07 dir-left) + (MOVE-DIR pos-04-07 pos-04-06 dir-up) + (MOVE-DIR pos-05-02 pos-05-03 dir-down) + (MOVE-DIR pos-05-02 pos-06-02 dir-right) + (MOVE-DIR pos-05-03 pos-04-03 dir-left) + (MOVE-DIR pos-05-03 pos-05-02 dir-up) + (MOVE-DIR pos-05-03 pos-05-04 dir-down) + (MOVE-DIR pos-05-03 pos-06-03 dir-right) + (MOVE-DIR pos-05-04 pos-05-03 dir-up) + (MOVE-DIR pos-05-04 pos-06-04 dir-right) + (MOVE-DIR pos-05-06 pos-04-06 dir-left) + (MOVE-DIR pos-05-06 pos-06-06 dir-right) + (MOVE-DIR pos-05-09 pos-06-09 dir-right) + (MOVE-DIR pos-06-02 pos-05-02 dir-left) + (MOVE-DIR pos-06-02 pos-06-03 dir-down) + (MOVE-DIR pos-06-03 pos-05-03 dir-left) + (MOVE-DIR pos-06-03 pos-06-02 dir-up) + (MOVE-DIR pos-06-03 pos-06-04 dir-down) + (MOVE-DIR pos-06-03 pos-07-03 dir-right) + (MOVE-DIR pos-06-04 pos-05-04 dir-left) + (MOVE-DIR pos-06-04 pos-06-03 dir-up) + (MOVE-DIR pos-06-04 pos-07-04 dir-right) + (MOVE-DIR pos-06-06 pos-05-06 dir-left) + (MOVE-DIR pos-06-06 pos-06-07 dir-down) + (MOVE-DIR pos-06-06 pos-07-06 dir-right) + (MOVE-DIR pos-06-07 pos-06-06 dir-up) + (MOVE-DIR pos-06-07 pos-07-07 dir-right) + (MOVE-DIR pos-06-09 pos-05-09 dir-left) + (MOVE-DIR pos-06-09 pos-07-09 dir-right) + (MOVE-DIR pos-07-03 pos-06-03 dir-left) + (MOVE-DIR pos-07-03 pos-07-04 dir-down) + (MOVE-DIR pos-07-03 pos-08-03 dir-right) + (MOVE-DIR pos-07-04 pos-06-04 dir-left) + (MOVE-DIR pos-07-04 pos-07-03 dir-up) + (MOVE-DIR pos-07-04 pos-07-05 dir-down) + (MOVE-DIR pos-07-04 pos-08-04 dir-right) + (MOVE-DIR pos-07-05 pos-07-04 dir-up) + (MOVE-DIR pos-07-05 pos-07-06 dir-down) + (MOVE-DIR pos-07-06 pos-06-06 dir-left) + (MOVE-DIR pos-07-06 pos-07-05 dir-up) + (MOVE-DIR pos-07-06 pos-07-07 dir-down) + (MOVE-DIR pos-07-06 pos-08-06 dir-right) + (MOVE-DIR pos-07-07 pos-06-07 dir-left) + (MOVE-DIR pos-07-07 pos-07-06 dir-up) + (MOVE-DIR pos-07-07 pos-08-07 dir-right) + (MOVE-DIR pos-07-09 pos-06-09 dir-left) + (MOVE-DIR pos-07-09 pos-08-09 dir-right) + (MOVE-DIR pos-08-01 pos-09-01 dir-right) + (MOVE-DIR pos-08-03 pos-07-03 dir-left) + (MOVE-DIR pos-08-03 pos-08-04 dir-down) + (MOVE-DIR pos-08-03 pos-09-03 dir-right) + (MOVE-DIR pos-08-04 pos-07-04 dir-left) + (MOVE-DIR pos-08-04 pos-08-03 dir-up) + (MOVE-DIR pos-08-04 pos-09-04 dir-right) + (MOVE-DIR pos-08-06 pos-07-06 dir-left) + (MOVE-DIR pos-08-06 pos-08-07 dir-down) + (MOVE-DIR pos-08-07 pos-07-07 dir-left) + (MOVE-DIR pos-08-07 pos-08-06 dir-up) + (MOVE-DIR pos-08-09 pos-07-09 dir-left) + (MOVE-DIR pos-08-09 pos-09-09 dir-right) + (MOVE-DIR pos-09-01 pos-08-01 dir-left) + (MOVE-DIR pos-09-01 pos-10-01 dir-right) + (MOVE-DIR pos-09-03 pos-08-03 dir-left) + (MOVE-DIR pos-09-03 pos-09-04 dir-down) + (MOVE-DIR pos-09-04 pos-08-04 dir-left) + (MOVE-DIR pos-09-04 pos-09-03 dir-up) + (MOVE-DIR pos-09-09 pos-08-09 dir-left) + (MOVE-DIR pos-09-09 pos-10-09 dir-right) + (MOVE-DIR pos-10-01 pos-09-01 dir-left) + (MOVE-DIR pos-10-06 pos-10-07 dir-down) + (MOVE-DIR pos-10-07 pos-10-06 dir-up) + (MOVE-DIR pos-10-07 pos-10-08 dir-down) + (MOVE-DIR pos-10-08 pos-10-07 dir-up) + (MOVE-DIR pos-10-08 pos-10-09 dir-down) + (MOVE-DIR pos-10-09 pos-09-09 dir-left) + (MOVE-DIR pos-10-09 pos-10-08 dir-up) + (at player-01 pos-03-07) + (at stone-01 pos-04-03) + (at stone-02 pos-06-03) + (at stone-03 pos-08-04) + (at stone-04 pos-04-06) + (clear pos-01-03) + (clear pos-02-05) + (clear pos-02-06) + (clear pos-02-07) + (clear pos-02-08) + (clear pos-03-01) + (clear pos-03-03) + (clear pos-03-04) + (clear pos-03-05) + (clear pos-03-06) + (clear pos-03-08) + (clear pos-04-05) + (clear pos-04-07) + (clear pos-05-02) + (clear pos-05-03) + (clear pos-05-04) + (clear pos-05-06) + (clear pos-05-09) + (clear pos-06-02) + (clear pos-06-04) + (clear pos-06-06) + (clear pos-06-07) + (clear pos-06-09) + (clear pos-07-03) + (clear pos-07-04) + (clear pos-07-05) + (clear pos-07-06) + (clear pos-07-07) + (clear pos-07-09) + (clear pos-08-01) + (clear pos-08-03) + (clear pos-08-06) + (clear pos-08-07) + (clear pos-08-09) + (clear pos-09-01) + (clear pos-09-03) + (clear pos-09-04) + (clear pos-09-09) + (clear pos-10-01) + (clear pos-10-06) + (clear pos-10-07) + (clear pos-10-08) + (clear pos-10-09) + (= (total-cost) 0) + ) + (:goal (and + (at-goal stone-01) + (at-goal stone-02) + (at-goal stone-03) + (at-goal stone-04) + )) + (:metric minimize (total-cost)) +) diff --git a/tests/fixtures/pddl_files/sokoban-sequential-optimal/p15.pddl b/tests/fixtures/pddl_files/sokoban-sequential-optimal/p15.pddl new file mode 100644 index 00000000..1dfb1c26 --- /dev/null +++ b/tests/fixtures/pddl_files/sokoban-sequential-optimal/p15.pddl @@ -0,0 +1,447 @@ +;; 'from (Original 18)' +;; +;; ########### +;; # . # # +;; # #. @ # +;; # #..# ####### +;; ## ## $$ $ $ # +;; ## # +;; ############# + +(define (problem p148-microban-sequential) + (:domain sokoban-sequential) + (:objects + dir-down - direction + dir-left - direction + dir-right - direction + dir-up - direction + player-01 - player + pos-01-01 - location + pos-01-02 - location + pos-01-03 - location + pos-01-04 - location + pos-01-05 - location + pos-01-06 - location + pos-01-07 - location + pos-02-01 - location + pos-02-02 - location + pos-02-03 - location + pos-02-04 - location + pos-02-05 - location + pos-02-06 - location + pos-02-07 - location + pos-03-01 - location + pos-03-02 - location + pos-03-03 - location + pos-03-04 - location + pos-03-05 - location + pos-03-06 - location + pos-03-07 - location + pos-04-01 - location + pos-04-02 - location + pos-04-03 - location + pos-04-04 - location + pos-04-05 - location + pos-04-06 - location + pos-04-07 - location + pos-05-01 - location + pos-05-02 - location + pos-05-03 - location + pos-05-04 - location + pos-05-05 - location + pos-05-06 - location + pos-05-07 - location + pos-06-01 - location + pos-06-02 - location + pos-06-03 - location + pos-06-04 - location + pos-06-05 - location + pos-06-06 - location + pos-06-07 - location + pos-07-01 - location + pos-07-02 - location + pos-07-03 - location + pos-07-04 - location + pos-07-05 - location + pos-07-06 - location + pos-07-07 - location + pos-08-01 - location + pos-08-02 - location + pos-08-03 - location + pos-08-04 - location + pos-08-05 - location + pos-08-06 - location + pos-08-07 - location + pos-09-01 - location + pos-09-02 - location + pos-09-03 - location + pos-09-04 - location + pos-09-05 - location + pos-09-06 - location + pos-09-07 - location + pos-10-01 - location + pos-10-02 - location + pos-10-03 - location + pos-10-04 - location + pos-10-05 - location + pos-10-06 - location + pos-10-07 - location + pos-11-01 - location + pos-11-02 - location + pos-11-03 - location + pos-11-04 - location + pos-11-05 - location + pos-11-06 - location + pos-11-07 - location + pos-12-01 - location + pos-12-02 - location + pos-12-03 - location + pos-12-04 - location + pos-12-05 - location + pos-12-06 - location + pos-12-07 - location + pos-13-01 - location + pos-13-02 - location + pos-13-03 - location + pos-13-04 - location + pos-13-05 - location + pos-13-06 - location + pos-13-07 - location + pos-14-01 - location + pos-14-02 - location + pos-14-03 - location + pos-14-04 - location + pos-14-05 - location + pos-14-06 - location + pos-14-07 - location + pos-15-01 - location + pos-15-02 - location + pos-15-03 - location + pos-15-04 - location + pos-15-05 - location + pos-15-06 - location + pos-15-07 - location + stone-01 - stone + stone-02 - stone + stone-03 - stone + stone-04 - stone + ) + (:init + (IS-GOAL pos-04-02) + (IS-GOAL pos-04-03) + (IS-GOAL pos-05-04) + (IS-GOAL pos-06-04) + (IS-NONGOAL pos-01-01) + (IS-NONGOAL pos-01-02) + (IS-NONGOAL pos-01-03) + (IS-NONGOAL pos-01-04) + (IS-NONGOAL pos-01-05) + (IS-NONGOAL pos-01-06) + (IS-NONGOAL pos-01-07) + (IS-NONGOAL pos-02-01) + (IS-NONGOAL pos-02-02) + (IS-NONGOAL pos-02-03) + (IS-NONGOAL pos-02-04) + (IS-NONGOAL pos-02-05) + (IS-NONGOAL pos-02-06) + (IS-NONGOAL pos-02-07) + (IS-NONGOAL pos-03-01) + (IS-NONGOAL pos-03-02) + (IS-NONGOAL pos-03-03) + (IS-NONGOAL pos-03-04) + (IS-NONGOAL pos-03-05) + (IS-NONGOAL pos-03-06) + (IS-NONGOAL pos-03-07) + (IS-NONGOAL pos-04-01) + (IS-NONGOAL pos-04-04) + (IS-NONGOAL pos-04-05) + (IS-NONGOAL pos-04-06) + (IS-NONGOAL pos-04-07) + (IS-NONGOAL pos-05-01) + (IS-NONGOAL pos-05-02) + (IS-NONGOAL pos-05-03) + (IS-NONGOAL pos-05-05) + (IS-NONGOAL pos-05-06) + (IS-NONGOAL pos-05-07) + (IS-NONGOAL pos-06-01) + (IS-NONGOAL pos-06-02) + (IS-NONGOAL pos-06-03) + (IS-NONGOAL pos-06-05) + (IS-NONGOAL pos-06-06) + (IS-NONGOAL pos-06-07) + (IS-NONGOAL pos-07-01) + (IS-NONGOAL pos-07-02) + (IS-NONGOAL pos-07-03) + (IS-NONGOAL pos-07-04) + (IS-NONGOAL pos-07-05) + (IS-NONGOAL pos-07-06) + (IS-NONGOAL pos-07-07) + (IS-NONGOAL pos-08-01) + (IS-NONGOAL pos-08-02) + (IS-NONGOAL pos-08-03) + (IS-NONGOAL pos-08-04) + (IS-NONGOAL pos-08-05) + (IS-NONGOAL pos-08-06) + (IS-NONGOAL pos-08-07) + (IS-NONGOAL pos-09-01) + (IS-NONGOAL pos-09-02) + (IS-NONGOAL pos-09-03) + (IS-NONGOAL pos-09-04) + (IS-NONGOAL pos-09-05) + (IS-NONGOAL pos-09-06) + (IS-NONGOAL pos-09-07) + (IS-NONGOAL pos-10-01) + (IS-NONGOAL pos-10-02) + (IS-NONGOAL pos-10-03) + (IS-NONGOAL pos-10-04) + (IS-NONGOAL pos-10-05) + (IS-NONGOAL pos-10-06) + (IS-NONGOAL pos-10-07) + (IS-NONGOAL pos-11-01) + (IS-NONGOAL pos-11-02) + (IS-NONGOAL pos-11-03) + (IS-NONGOAL pos-11-04) + (IS-NONGOAL pos-11-05) + (IS-NONGOAL pos-11-06) + (IS-NONGOAL pos-11-07) + (IS-NONGOAL pos-12-01) + (IS-NONGOAL pos-12-02) + (IS-NONGOAL pos-12-03) + (IS-NONGOAL pos-12-04) + (IS-NONGOAL pos-12-05) + (IS-NONGOAL pos-12-06) + (IS-NONGOAL pos-12-07) + (IS-NONGOAL pos-13-01) + (IS-NONGOAL pos-13-02) + (IS-NONGOAL pos-13-03) + (IS-NONGOAL pos-13-04) + (IS-NONGOAL pos-13-05) + (IS-NONGOAL pos-13-06) + (IS-NONGOAL pos-13-07) + (IS-NONGOAL pos-14-01) + (IS-NONGOAL pos-14-02) + (IS-NONGOAL pos-14-03) + (IS-NONGOAL pos-14-04) + (IS-NONGOAL pos-14-05) + (IS-NONGOAL pos-14-06) + (IS-NONGOAL pos-14-07) + (IS-NONGOAL pos-15-01) + (IS-NONGOAL pos-15-02) + (IS-NONGOAL pos-15-03) + (IS-NONGOAL pos-15-04) + (IS-NONGOAL pos-15-05) + (IS-NONGOAL pos-15-06) + (IS-NONGOAL pos-15-07) + (MOVE-DIR pos-01-06 pos-01-07 dir-down) + (MOVE-DIR pos-01-07 pos-01-06 dir-up) + (MOVE-DIR pos-01-07 pos-02-07 dir-right) + (MOVE-DIR pos-02-02 pos-02-03 dir-down) + (MOVE-DIR pos-02-02 pos-03-02 dir-right) + (MOVE-DIR pos-02-03 pos-02-02 dir-up) + (MOVE-DIR pos-02-03 pos-02-04 dir-down) + (MOVE-DIR pos-02-04 pos-02-03 dir-up) + (MOVE-DIR pos-02-04 pos-03-04 dir-right) + (MOVE-DIR pos-02-07 pos-01-07 dir-left) + (MOVE-DIR pos-03-02 pos-02-02 dir-left) + (MOVE-DIR pos-03-02 pos-04-02 dir-right) + (MOVE-DIR pos-03-04 pos-02-04 dir-left) + (MOVE-DIR pos-03-04 pos-03-05 dir-down) + (MOVE-DIR pos-03-05 pos-03-04 dir-up) + (MOVE-DIR pos-03-05 pos-04-05 dir-right) + (MOVE-DIR pos-04-02 pos-03-02 dir-left) + (MOVE-DIR pos-04-02 pos-04-03 dir-down) + (MOVE-DIR pos-04-02 pos-05-02 dir-right) + (MOVE-DIR pos-04-03 pos-04-02 dir-up) + (MOVE-DIR pos-04-03 pos-05-03 dir-right) + (MOVE-DIR pos-04-05 pos-03-05 dir-left) + (MOVE-DIR pos-04-05 pos-04-06 dir-down) + (MOVE-DIR pos-04-06 pos-04-05 dir-up) + (MOVE-DIR pos-04-06 pos-05-06 dir-right) + (MOVE-DIR pos-05-02 pos-04-02 dir-left) + (MOVE-DIR pos-05-02 pos-05-03 dir-down) + (MOVE-DIR pos-05-02 pos-06-02 dir-right) + (MOVE-DIR pos-05-03 pos-04-03 dir-left) + (MOVE-DIR pos-05-03 pos-05-02 dir-up) + (MOVE-DIR pos-05-03 pos-05-04 dir-down) + (MOVE-DIR pos-05-03 pos-06-03 dir-right) + (MOVE-DIR pos-05-04 pos-05-03 dir-up) + (MOVE-DIR pos-05-04 pos-06-04 dir-right) + (MOVE-DIR pos-05-06 pos-04-06 dir-left) + (MOVE-DIR pos-05-06 pos-06-06 dir-right) + (MOVE-DIR pos-06-02 pos-05-02 dir-left) + (MOVE-DIR pos-06-02 pos-06-03 dir-down) + (MOVE-DIR pos-06-03 pos-05-03 dir-left) + (MOVE-DIR pos-06-03 pos-06-02 dir-up) + (MOVE-DIR pos-06-03 pos-06-04 dir-down) + (MOVE-DIR pos-06-03 pos-07-03 dir-right) + (MOVE-DIR pos-06-04 pos-05-04 dir-left) + (MOVE-DIR pos-06-04 pos-06-03 dir-up) + (MOVE-DIR pos-06-06 pos-05-06 dir-left) + (MOVE-DIR pos-06-06 pos-07-06 dir-right) + (MOVE-DIR pos-07-03 pos-06-03 dir-left) + (MOVE-DIR pos-07-03 pos-08-03 dir-right) + (MOVE-DIR pos-07-05 pos-07-06 dir-down) + (MOVE-DIR pos-07-05 pos-08-05 dir-right) + (MOVE-DIR pos-07-06 pos-06-06 dir-left) + (MOVE-DIR pos-07-06 pos-07-05 dir-up) + (MOVE-DIR pos-07-06 pos-08-06 dir-right) + (MOVE-DIR pos-08-02 pos-08-03 dir-down) + (MOVE-DIR pos-08-02 pos-09-02 dir-right) + (MOVE-DIR pos-08-03 pos-07-03 dir-left) + (MOVE-DIR pos-08-03 pos-08-02 dir-up) + (MOVE-DIR pos-08-03 pos-08-04 dir-down) + (MOVE-DIR pos-08-03 pos-09-03 dir-right) + (MOVE-DIR pos-08-04 pos-08-03 dir-up) + (MOVE-DIR pos-08-04 pos-08-05 dir-down) + (MOVE-DIR pos-08-05 pos-07-05 dir-left) + (MOVE-DIR pos-08-05 pos-08-04 dir-up) + (MOVE-DIR pos-08-05 pos-08-06 dir-down) + (MOVE-DIR pos-08-05 pos-09-05 dir-right) + (MOVE-DIR pos-08-06 pos-07-06 dir-left) + (MOVE-DIR pos-08-06 pos-08-05 dir-up) + (MOVE-DIR pos-08-06 pos-09-06 dir-right) + (MOVE-DIR pos-09-02 pos-08-02 dir-left) + (MOVE-DIR pos-09-02 pos-09-03 dir-down) + (MOVE-DIR pos-09-02 pos-10-02 dir-right) + (MOVE-DIR pos-09-03 pos-08-03 dir-left) + (MOVE-DIR pos-09-03 pos-09-02 dir-up) + (MOVE-DIR pos-09-03 pos-10-03 dir-right) + (MOVE-DIR pos-09-05 pos-08-05 dir-left) + (MOVE-DIR pos-09-05 pos-09-06 dir-down) + (MOVE-DIR pos-09-05 pos-10-05 dir-right) + (MOVE-DIR pos-09-06 pos-08-06 dir-left) + (MOVE-DIR pos-09-06 pos-09-05 dir-up) + (MOVE-DIR pos-09-06 pos-10-06 dir-right) + (MOVE-DIR pos-10-02 pos-09-02 dir-left) + (MOVE-DIR pos-10-02 pos-10-03 dir-down) + (MOVE-DIR pos-10-03 pos-09-03 dir-left) + (MOVE-DIR pos-10-03 pos-10-02 dir-up) + (MOVE-DIR pos-10-05 pos-09-05 dir-left) + (MOVE-DIR pos-10-05 pos-10-06 dir-down) + (MOVE-DIR pos-10-05 pos-11-05 dir-right) + (MOVE-DIR pos-10-06 pos-09-06 dir-left) + (MOVE-DIR pos-10-06 pos-10-05 dir-up) + (MOVE-DIR pos-10-06 pos-11-06 dir-right) + (MOVE-DIR pos-11-05 pos-10-05 dir-left) + (MOVE-DIR pos-11-05 pos-11-06 dir-down) + (MOVE-DIR pos-11-05 pos-12-05 dir-right) + (MOVE-DIR pos-11-06 pos-10-06 dir-left) + (MOVE-DIR pos-11-06 pos-11-05 dir-up) + (MOVE-DIR pos-11-06 pos-12-06 dir-right) + (MOVE-DIR pos-12-01 pos-12-02 dir-down) + (MOVE-DIR pos-12-01 pos-13-01 dir-right) + (MOVE-DIR pos-12-02 pos-12-01 dir-up) + (MOVE-DIR pos-12-02 pos-12-03 dir-down) + (MOVE-DIR pos-12-02 pos-13-02 dir-right) + (MOVE-DIR pos-12-03 pos-12-02 dir-up) + (MOVE-DIR pos-12-03 pos-13-03 dir-right) + (MOVE-DIR pos-12-05 pos-11-05 dir-left) + (MOVE-DIR pos-12-05 pos-12-06 dir-down) + (MOVE-DIR pos-12-05 pos-13-05 dir-right) + (MOVE-DIR pos-12-06 pos-11-06 dir-left) + (MOVE-DIR pos-12-06 pos-12-05 dir-up) + (MOVE-DIR pos-12-06 pos-13-06 dir-right) + (MOVE-DIR pos-13-01 pos-12-01 dir-left) + (MOVE-DIR pos-13-01 pos-13-02 dir-down) + (MOVE-DIR pos-13-01 pos-14-01 dir-right) + (MOVE-DIR pos-13-02 pos-12-02 dir-left) + (MOVE-DIR pos-13-02 pos-13-01 dir-up) + (MOVE-DIR pos-13-02 pos-13-03 dir-down) + (MOVE-DIR pos-13-02 pos-14-02 dir-right) + (MOVE-DIR pos-13-03 pos-12-03 dir-left) + (MOVE-DIR pos-13-03 pos-13-02 dir-up) + (MOVE-DIR pos-13-03 pos-14-03 dir-right) + (MOVE-DIR pos-13-05 pos-12-05 dir-left) + (MOVE-DIR pos-13-05 pos-13-06 dir-down) + (MOVE-DIR pos-13-05 pos-14-05 dir-right) + (MOVE-DIR pos-13-06 pos-12-06 dir-left) + (MOVE-DIR pos-13-06 pos-13-05 dir-up) + (MOVE-DIR pos-13-06 pos-14-06 dir-right) + (MOVE-DIR pos-14-01 pos-13-01 dir-left) + (MOVE-DIR pos-14-01 pos-14-02 dir-down) + (MOVE-DIR pos-14-01 pos-15-01 dir-right) + (MOVE-DIR pos-14-02 pos-13-02 dir-left) + (MOVE-DIR pos-14-02 pos-14-01 dir-up) + (MOVE-DIR pos-14-02 pos-14-03 dir-down) + (MOVE-DIR pos-14-02 pos-15-02 dir-right) + (MOVE-DIR pos-14-03 pos-13-03 dir-left) + (MOVE-DIR pos-14-03 pos-14-02 dir-up) + (MOVE-DIR pos-14-03 pos-15-03 dir-right) + (MOVE-DIR pos-14-05 pos-13-05 dir-left) + (MOVE-DIR pos-14-05 pos-14-06 dir-down) + (MOVE-DIR pos-14-06 pos-13-06 dir-left) + (MOVE-DIR pos-14-06 pos-14-05 dir-up) + (MOVE-DIR pos-15-01 pos-14-01 dir-left) + (MOVE-DIR pos-15-01 pos-15-02 dir-down) + (MOVE-DIR pos-15-02 pos-14-02 dir-left) + (MOVE-DIR pos-15-02 pos-15-01 dir-up) + (MOVE-DIR pos-15-02 pos-15-03 dir-down) + (MOVE-DIR pos-15-03 pos-14-03 dir-left) + (MOVE-DIR pos-15-03 pos-15-02 dir-up) + (at player-01 pos-07-03) + (at stone-01 pos-08-05) + (at stone-02 pos-09-05) + (at stone-03 pos-11-05) + (at stone-04 pos-13-05) + (clear pos-01-06) + (clear pos-01-07) + (clear pos-02-02) + (clear pos-02-03) + (clear pos-02-04) + (clear pos-02-07) + (clear pos-03-02) + (clear pos-03-04) + (clear pos-03-05) + (clear pos-04-02) + (clear pos-04-03) + (clear pos-04-05) + (clear pos-04-06) + (clear pos-05-02) + (clear pos-05-03) + (clear pos-05-04) + (clear pos-05-06) + (clear pos-06-02) + (clear pos-06-03) + (clear pos-06-04) + (clear pos-06-06) + (clear pos-07-05) + (clear pos-07-06) + (clear pos-08-02) + (clear pos-08-03) + (clear pos-08-04) + (clear pos-08-06) + (clear pos-09-02) + (clear pos-09-03) + (clear pos-09-06) + (clear pos-10-02) + (clear pos-10-03) + (clear pos-10-05) + (clear pos-10-06) + (clear pos-11-06) + (clear pos-12-01) + (clear pos-12-02) + (clear pos-12-03) + (clear pos-12-05) + (clear pos-12-06) + (clear pos-13-01) + (clear pos-13-02) + (clear pos-13-03) + (clear pos-13-06) + (clear pos-14-01) + (clear pos-14-02) + (clear pos-14-03) + (clear pos-14-05) + (clear pos-14-06) + (clear pos-15-01) + (clear pos-15-02) + (clear pos-15-03) + (= (total-cost) 0) + ) + (:goal (and + (at-goal stone-01) + (at-goal stone-02) + (at-goal stone-03) + (at-goal stone-04) + )) + (:metric minimize (total-cost)) +) diff --git a/tests/fixtures/pddl_files/sokoban-sequential-optimal/p16.pddl b/tests/fixtures/pddl_files/sokoban-sequential-optimal/p16.pddl new file mode 100644 index 00000000..292fc172 --- /dev/null +++ b/tests/fixtures/pddl_files/sokoban-sequential-optimal/p16.pddl @@ -0,0 +1,509 @@ +;; #### +;; ######### # +;; # ## $ # +;; # $ ## # +;; ### #. .# ## +;; # #. .#$## +;; # # # # +;; # @ $ # +;; # ####### +;; #### + +(define (problem p134-microban-sequential) + (:domain sokoban-sequential) + (:objects + dir-down - direction + dir-left - direction + dir-right - direction + dir-up - direction + player-01 - player + pos-01-01 - location + pos-01-02 - location + pos-01-03 - location + pos-01-04 - location + pos-01-05 - location + pos-01-06 - location + pos-01-07 - location + pos-01-08 - location + pos-01-09 - location + pos-01-10 - location + pos-02-01 - location + pos-02-02 - location + pos-02-03 - location + pos-02-04 - location + pos-02-05 - location + pos-02-06 - location + pos-02-07 - location + pos-02-08 - location + pos-02-09 - location + pos-02-10 - location + pos-03-01 - location + pos-03-02 - location + pos-03-03 - location + pos-03-04 - location + pos-03-05 - location + pos-03-06 - location + pos-03-07 - location + pos-03-08 - location + pos-03-09 - location + pos-03-10 - location + pos-04-01 - location + pos-04-02 - location + pos-04-03 - location + pos-04-04 - location + pos-04-05 - location + pos-04-06 - location + pos-04-07 - location + pos-04-08 - location + pos-04-09 - location + pos-04-10 - location + pos-05-01 - location + pos-05-02 - location + pos-05-03 - location + pos-05-04 - location + pos-05-05 - location + pos-05-06 - location + pos-05-07 - location + pos-05-08 - location + pos-05-09 - location + pos-05-10 - location + pos-06-01 - location + pos-06-02 - location + pos-06-03 - location + pos-06-04 - location + pos-06-05 - location + pos-06-06 - location + pos-06-07 - location + pos-06-08 - location + pos-06-09 - location + pos-06-10 - location + pos-07-01 - location + pos-07-02 - location + pos-07-03 - location + pos-07-04 - location + pos-07-05 - location + pos-07-06 - location + pos-07-07 - location + pos-07-08 - location + pos-07-09 - location + pos-07-10 - location + pos-08-01 - location + pos-08-02 - location + pos-08-03 - location + pos-08-04 - location + pos-08-05 - location + pos-08-06 - location + pos-08-07 - location + pos-08-08 - location + pos-08-09 - location + pos-08-10 - location + pos-09-01 - location + pos-09-02 - location + pos-09-03 - location + pos-09-04 - location + pos-09-05 - location + pos-09-06 - location + pos-09-07 - location + pos-09-08 - location + pos-09-09 - location + pos-09-10 - location + pos-10-01 - location + pos-10-02 - location + pos-10-03 - location + pos-10-04 - location + pos-10-05 - location + pos-10-06 - location + pos-10-07 - location + pos-10-08 - location + pos-10-09 - location + pos-10-10 - location + pos-11-01 - location + pos-11-02 - location + pos-11-03 - location + pos-11-04 - location + pos-11-05 - location + pos-11-06 - location + pos-11-07 - location + pos-11-08 - location + pos-11-09 - location + pos-11-10 - location + pos-12-01 - location + pos-12-02 - location + pos-12-03 - location + pos-12-04 - location + pos-12-05 - location + pos-12-06 - location + pos-12-07 - location + pos-12-08 - location + pos-12-09 - location + pos-12-10 - location + stone-01 - stone + stone-02 - stone + stone-03 - stone + stone-04 - stone + ) + (:init + (IS-GOAL pos-06-05) + (IS-GOAL pos-06-06) + (IS-GOAL pos-08-05) + (IS-GOAL pos-08-06) + (IS-NONGOAL pos-01-01) + (IS-NONGOAL pos-01-02) + (IS-NONGOAL pos-01-03) + (IS-NONGOAL pos-01-04) + (IS-NONGOAL pos-01-05) + (IS-NONGOAL pos-01-06) + (IS-NONGOAL pos-01-07) + (IS-NONGOAL pos-01-08) + (IS-NONGOAL pos-01-09) + (IS-NONGOAL pos-01-10) + (IS-NONGOAL pos-02-01) + (IS-NONGOAL pos-02-02) + (IS-NONGOAL pos-02-03) + (IS-NONGOAL pos-02-04) + (IS-NONGOAL pos-02-05) + (IS-NONGOAL pos-02-06) + (IS-NONGOAL pos-02-07) + (IS-NONGOAL pos-02-08) + (IS-NONGOAL pos-02-09) + (IS-NONGOAL pos-02-10) + (IS-NONGOAL pos-03-01) + (IS-NONGOAL pos-03-02) + (IS-NONGOAL pos-03-03) + (IS-NONGOAL pos-03-04) + (IS-NONGOAL pos-03-05) + (IS-NONGOAL pos-03-06) + (IS-NONGOAL pos-03-07) + (IS-NONGOAL pos-03-08) + (IS-NONGOAL pos-03-09) + (IS-NONGOAL pos-03-10) + (IS-NONGOAL pos-04-01) + (IS-NONGOAL pos-04-02) + (IS-NONGOAL pos-04-03) + (IS-NONGOAL pos-04-04) + (IS-NONGOAL pos-04-05) + (IS-NONGOAL pos-04-06) + (IS-NONGOAL pos-04-07) + (IS-NONGOAL pos-04-08) + (IS-NONGOAL pos-04-09) + (IS-NONGOAL pos-04-10) + (IS-NONGOAL pos-05-01) + (IS-NONGOAL pos-05-02) + (IS-NONGOAL pos-05-03) + (IS-NONGOAL pos-05-04) + (IS-NONGOAL pos-05-05) + (IS-NONGOAL pos-05-06) + (IS-NONGOAL pos-05-07) + (IS-NONGOAL pos-05-08) + (IS-NONGOAL pos-05-09) + (IS-NONGOAL pos-05-10) + (IS-NONGOAL pos-06-01) + (IS-NONGOAL pos-06-02) + (IS-NONGOAL pos-06-03) + (IS-NONGOAL pos-06-04) + (IS-NONGOAL pos-06-07) + (IS-NONGOAL pos-06-08) + (IS-NONGOAL pos-06-09) + (IS-NONGOAL pos-06-10) + (IS-NONGOAL pos-07-01) + (IS-NONGOAL pos-07-02) + (IS-NONGOAL pos-07-03) + (IS-NONGOAL pos-07-04) + (IS-NONGOAL pos-07-05) + (IS-NONGOAL pos-07-06) + (IS-NONGOAL pos-07-07) + (IS-NONGOAL pos-07-08) + (IS-NONGOAL pos-07-09) + (IS-NONGOAL pos-07-10) + (IS-NONGOAL pos-08-01) + (IS-NONGOAL pos-08-02) + (IS-NONGOAL pos-08-03) + (IS-NONGOAL pos-08-04) + (IS-NONGOAL pos-08-07) + (IS-NONGOAL pos-08-08) + (IS-NONGOAL pos-08-09) + (IS-NONGOAL pos-08-10) + (IS-NONGOAL pos-09-01) + (IS-NONGOAL pos-09-02) + (IS-NONGOAL pos-09-03) + (IS-NONGOAL pos-09-04) + (IS-NONGOAL pos-09-05) + (IS-NONGOAL pos-09-06) + (IS-NONGOAL pos-09-07) + (IS-NONGOAL pos-09-08) + (IS-NONGOAL pos-09-09) + (IS-NONGOAL pos-09-10) + (IS-NONGOAL pos-10-01) + (IS-NONGOAL pos-10-02) + (IS-NONGOAL pos-10-03) + (IS-NONGOAL pos-10-04) + (IS-NONGOAL pos-10-05) + (IS-NONGOAL pos-10-06) + (IS-NONGOAL pos-10-07) + (IS-NONGOAL pos-10-08) + (IS-NONGOAL pos-10-09) + (IS-NONGOAL pos-10-10) + (IS-NONGOAL pos-11-01) + (IS-NONGOAL pos-11-02) + (IS-NONGOAL pos-11-03) + (IS-NONGOAL pos-11-04) + (IS-NONGOAL pos-11-05) + (IS-NONGOAL pos-11-06) + (IS-NONGOAL pos-11-07) + (IS-NONGOAL pos-11-08) + (IS-NONGOAL pos-11-09) + (IS-NONGOAL pos-11-10) + (IS-NONGOAL pos-12-01) + (IS-NONGOAL pos-12-02) + (IS-NONGOAL pos-12-03) + (IS-NONGOAL pos-12-04) + (IS-NONGOAL pos-12-05) + (IS-NONGOAL pos-12-06) + (IS-NONGOAL pos-12-07) + (IS-NONGOAL pos-12-08) + (IS-NONGOAL pos-12-09) + (IS-NONGOAL pos-12-10) + (MOVE-DIR pos-01-01 pos-02-01 dir-right) + (MOVE-DIR pos-01-06 pos-01-07 dir-down) + (MOVE-DIR pos-01-06 pos-02-06 dir-right) + (MOVE-DIR pos-01-07 pos-01-06 dir-up) + (MOVE-DIR pos-01-07 pos-01-08 dir-down) + (MOVE-DIR pos-01-07 pos-02-07 dir-right) + (MOVE-DIR pos-01-08 pos-01-07 dir-up) + (MOVE-DIR pos-01-08 pos-01-09 dir-down) + (MOVE-DIR pos-01-08 pos-02-08 dir-right) + (MOVE-DIR pos-01-09 pos-01-08 dir-up) + (MOVE-DIR pos-01-09 pos-01-10 dir-down) + (MOVE-DIR pos-01-09 pos-02-09 dir-right) + (MOVE-DIR pos-01-10 pos-01-09 dir-up) + (MOVE-DIR pos-01-10 pos-02-10 dir-right) + (MOVE-DIR pos-02-01 pos-01-01 dir-left) + (MOVE-DIR pos-02-01 pos-03-01 dir-right) + (MOVE-DIR pos-02-03 pos-02-04 dir-down) + (MOVE-DIR pos-02-03 pos-03-03 dir-right) + (MOVE-DIR pos-02-04 pos-02-03 dir-up) + (MOVE-DIR pos-02-04 pos-03-04 dir-right) + (MOVE-DIR pos-02-06 pos-01-06 dir-left) + (MOVE-DIR pos-02-06 pos-02-07 dir-down) + (MOVE-DIR pos-02-07 pos-01-07 dir-left) + (MOVE-DIR pos-02-07 pos-02-06 dir-up) + (MOVE-DIR pos-02-07 pos-02-08 dir-down) + (MOVE-DIR pos-02-08 pos-01-08 dir-left) + (MOVE-DIR pos-02-08 pos-02-07 dir-up) + (MOVE-DIR pos-02-08 pos-02-09 dir-down) + (MOVE-DIR pos-02-09 pos-01-09 dir-left) + (MOVE-DIR pos-02-09 pos-02-08 dir-up) + (MOVE-DIR pos-02-09 pos-02-10 dir-down) + (MOVE-DIR pos-02-10 pos-01-10 dir-left) + (MOVE-DIR pos-02-10 pos-02-09 dir-up) + (MOVE-DIR pos-03-01 pos-02-01 dir-left) + (MOVE-DIR pos-03-01 pos-04-01 dir-right) + (MOVE-DIR pos-03-03 pos-02-03 dir-left) + (MOVE-DIR pos-03-03 pos-03-04 dir-down) + (MOVE-DIR pos-03-03 pos-04-03 dir-right) + (MOVE-DIR pos-03-04 pos-02-04 dir-left) + (MOVE-DIR pos-03-04 pos-03-03 dir-up) + (MOVE-DIR pos-03-04 pos-04-04 dir-right) + (MOVE-DIR pos-04-01 pos-03-01 dir-left) + (MOVE-DIR pos-04-01 pos-05-01 dir-right) + (MOVE-DIR pos-04-03 pos-03-03 dir-left) + (MOVE-DIR pos-04-03 pos-04-04 dir-down) + (MOVE-DIR pos-04-04 pos-03-04 dir-left) + (MOVE-DIR pos-04-04 pos-04-03 dir-up) + (MOVE-DIR pos-04-04 pos-04-05 dir-down) + (MOVE-DIR pos-04-04 pos-05-04 dir-right) + (MOVE-DIR pos-04-05 pos-04-04 dir-up) + (MOVE-DIR pos-04-05 pos-04-06 dir-down) + (MOVE-DIR pos-04-06 pos-04-05 dir-up) + (MOVE-DIR pos-04-06 pos-04-07 dir-down) + (MOVE-DIR pos-04-07 pos-04-06 dir-up) + (MOVE-DIR pos-04-07 pos-04-08 dir-down) + (MOVE-DIR pos-04-08 pos-04-07 dir-up) + (MOVE-DIR pos-04-08 pos-04-09 dir-down) + (MOVE-DIR pos-04-08 pos-05-08 dir-right) + (MOVE-DIR pos-04-09 pos-04-08 dir-up) + (MOVE-DIR pos-04-09 pos-05-09 dir-right) + (MOVE-DIR pos-05-01 pos-04-01 dir-left) + (MOVE-DIR pos-05-01 pos-06-01 dir-right) + (MOVE-DIR pos-05-04 pos-04-04 dir-left) + (MOVE-DIR pos-05-04 pos-06-04 dir-right) + (MOVE-DIR pos-05-08 pos-04-08 dir-left) + (MOVE-DIR pos-05-08 pos-05-09 dir-down) + (MOVE-DIR pos-05-08 pos-06-08 dir-right) + (MOVE-DIR pos-05-09 pos-04-09 dir-left) + (MOVE-DIR pos-05-09 pos-05-08 dir-up) + (MOVE-DIR pos-06-01 pos-05-01 dir-left) + (MOVE-DIR pos-06-01 pos-07-01 dir-right) + (MOVE-DIR pos-06-04 pos-05-04 dir-left) + (MOVE-DIR pos-06-04 pos-06-05 dir-down) + (MOVE-DIR pos-06-04 pos-07-04 dir-right) + (MOVE-DIR pos-06-05 pos-06-04 dir-up) + (MOVE-DIR pos-06-05 pos-06-06 dir-down) + (MOVE-DIR pos-06-05 pos-07-05 dir-right) + (MOVE-DIR pos-06-06 pos-06-05 dir-up) + (MOVE-DIR pos-06-06 pos-06-07 dir-down) + (MOVE-DIR pos-06-06 pos-07-06 dir-right) + (MOVE-DIR pos-06-07 pos-06-06 dir-up) + (MOVE-DIR pos-06-07 pos-06-08 dir-down) + (MOVE-DIR pos-06-07 pos-07-07 dir-right) + (MOVE-DIR pos-06-08 pos-05-08 dir-left) + (MOVE-DIR pos-06-08 pos-06-07 dir-up) + (MOVE-DIR pos-06-08 pos-07-08 dir-right) + (MOVE-DIR pos-07-01 pos-06-01 dir-left) + (MOVE-DIR pos-07-01 pos-08-01 dir-right) + (MOVE-DIR pos-07-03 pos-07-04 dir-down) + (MOVE-DIR pos-07-03 pos-08-03 dir-right) + (MOVE-DIR pos-07-04 pos-06-04 dir-left) + (MOVE-DIR pos-07-04 pos-07-03 dir-up) + (MOVE-DIR pos-07-04 pos-07-05 dir-down) + (MOVE-DIR pos-07-05 pos-06-05 dir-left) + (MOVE-DIR pos-07-05 pos-07-04 dir-up) + (MOVE-DIR pos-07-05 pos-07-06 dir-down) + (MOVE-DIR pos-07-05 pos-08-05 dir-right) + (MOVE-DIR pos-07-06 pos-06-06 dir-left) + (MOVE-DIR pos-07-06 pos-07-05 dir-up) + (MOVE-DIR pos-07-06 pos-07-07 dir-down) + (MOVE-DIR pos-07-06 pos-08-06 dir-right) + (MOVE-DIR pos-07-07 pos-06-07 dir-left) + (MOVE-DIR pos-07-07 pos-07-06 dir-up) + (MOVE-DIR pos-07-07 pos-07-08 dir-down) + (MOVE-DIR pos-07-07 pos-08-07 dir-right) + (MOVE-DIR pos-07-08 pos-06-08 dir-left) + (MOVE-DIR pos-07-08 pos-07-07 dir-up) + (MOVE-DIR pos-07-08 pos-08-08 dir-right) + (MOVE-DIR pos-07-10 pos-08-10 dir-right) + (MOVE-DIR pos-08-01 pos-07-01 dir-left) + (MOVE-DIR pos-08-03 pos-07-03 dir-left) + (MOVE-DIR pos-08-03 pos-09-03 dir-right) + (MOVE-DIR pos-08-05 pos-07-05 dir-left) + (MOVE-DIR pos-08-05 pos-08-06 dir-down) + (MOVE-DIR pos-08-06 pos-07-06 dir-left) + (MOVE-DIR pos-08-06 pos-08-05 dir-up) + (MOVE-DIR pos-08-06 pos-08-07 dir-down) + (MOVE-DIR pos-08-07 pos-07-07 dir-left) + (MOVE-DIR pos-08-07 pos-08-06 dir-up) + (MOVE-DIR pos-08-07 pos-08-08 dir-down) + (MOVE-DIR pos-08-08 pos-07-08 dir-left) + (MOVE-DIR pos-08-08 pos-08-07 dir-up) + (MOVE-DIR pos-08-08 pos-09-08 dir-right) + (MOVE-DIR pos-08-10 pos-07-10 dir-left) + (MOVE-DIR pos-08-10 pos-09-10 dir-right) + (MOVE-DIR pos-09-03 pos-08-03 dir-left) + (MOVE-DIR pos-09-03 pos-10-03 dir-right) + (MOVE-DIR pos-09-08 pos-08-08 dir-left) + (MOVE-DIR pos-09-08 pos-10-08 dir-right) + (MOVE-DIR pos-09-10 pos-08-10 dir-left) + (MOVE-DIR pos-09-10 pos-10-10 dir-right) + (MOVE-DIR pos-10-02 pos-10-03 dir-down) + (MOVE-DIR pos-10-02 pos-11-02 dir-right) + (MOVE-DIR pos-10-03 pos-09-03 dir-left) + (MOVE-DIR pos-10-03 pos-10-02 dir-up) + (MOVE-DIR pos-10-03 pos-10-04 dir-down) + (MOVE-DIR pos-10-03 pos-11-03 dir-right) + (MOVE-DIR pos-10-04 pos-10-03 dir-up) + (MOVE-DIR pos-10-04 pos-10-05 dir-down) + (MOVE-DIR pos-10-04 pos-11-04 dir-right) + (MOVE-DIR pos-10-05 pos-10-04 dir-up) + (MOVE-DIR pos-10-05 pos-10-06 dir-down) + (MOVE-DIR pos-10-06 pos-10-05 dir-up) + (MOVE-DIR pos-10-06 pos-10-07 dir-down) + (MOVE-DIR pos-10-07 pos-10-06 dir-up) + (MOVE-DIR pos-10-07 pos-10-08 dir-down) + (MOVE-DIR pos-10-07 pos-11-07 dir-right) + (MOVE-DIR pos-10-08 pos-09-08 dir-left) + (MOVE-DIR pos-10-08 pos-10-07 dir-up) + (MOVE-DIR pos-10-08 pos-11-08 dir-right) + (MOVE-DIR pos-10-10 pos-09-10 dir-left) + (MOVE-DIR pos-10-10 pos-11-10 dir-right) + (MOVE-DIR pos-11-02 pos-10-02 dir-left) + (MOVE-DIR pos-11-02 pos-11-03 dir-down) + (MOVE-DIR pos-11-03 pos-10-03 dir-left) + (MOVE-DIR pos-11-03 pos-11-02 dir-up) + (MOVE-DIR pos-11-03 pos-11-04 dir-down) + (MOVE-DIR pos-11-04 pos-10-04 dir-left) + (MOVE-DIR pos-11-04 pos-11-03 dir-up) + (MOVE-DIR pos-11-07 pos-10-07 dir-left) + (MOVE-DIR pos-11-07 pos-11-08 dir-down) + (MOVE-DIR pos-11-08 pos-10-08 dir-left) + (MOVE-DIR pos-11-08 pos-11-07 dir-up) + (MOVE-DIR pos-11-10 pos-10-10 dir-left) + (MOVE-DIR pos-11-10 pos-12-10 dir-right) + (MOVE-DIR pos-12-10 pos-11-10 dir-left) + (at player-01 pos-05-08) + (at stone-01 pos-08-03) + (at stone-02 pos-04-04) + (at stone-03 pos-10-06) + (at stone-04 pos-07-08) + (clear pos-01-01) + (clear pos-01-06) + (clear pos-01-07) + (clear pos-01-08) + (clear pos-01-09) + (clear pos-01-10) + (clear pos-02-01) + (clear pos-02-03) + (clear pos-02-04) + (clear pos-02-06) + (clear pos-02-07) + (clear pos-02-08) + (clear pos-02-09) + (clear pos-02-10) + (clear pos-03-01) + (clear pos-03-03) + (clear pos-03-04) + (clear pos-04-01) + (clear pos-04-03) + (clear pos-04-05) + (clear pos-04-06) + (clear pos-04-07) + (clear pos-04-08) + (clear pos-04-09) + (clear pos-05-01) + (clear pos-05-04) + (clear pos-05-09) + (clear pos-06-01) + (clear pos-06-04) + (clear pos-06-05) + (clear pos-06-06) + (clear pos-06-07) + (clear pos-06-08) + (clear pos-07-01) + (clear pos-07-03) + (clear pos-07-04) + (clear pos-07-05) + (clear pos-07-06) + (clear pos-07-07) + (clear pos-07-10) + (clear pos-08-01) + (clear pos-08-05) + (clear pos-08-06) + (clear pos-08-07) + (clear pos-08-08) + (clear pos-08-10) + (clear pos-09-03) + (clear pos-09-08) + (clear pos-09-10) + (clear pos-10-02) + (clear pos-10-03) + (clear pos-10-04) + (clear pos-10-05) + (clear pos-10-07) + (clear pos-10-08) + (clear pos-10-10) + (clear pos-11-02) + (clear pos-11-03) + (clear pos-11-04) + (clear pos-11-07) + (clear pos-11-08) + (clear pos-11-10) + (clear pos-12-10) + (= (total-cost) 0) + ) + (:goal (and + (at-goal stone-01) + (at-goal stone-02) + (at-goal stone-03) + (at-goal stone-04) + )) + (:metric minimize (total-cost)) +) diff --git a/tests/fixtures/pddl_files/sokoban-sequential-optimal/p17.pddl b/tests/fixtures/pddl_files/sokoban-sequential-optimal/p17.pddl new file mode 100644 index 00000000..27aadf32 --- /dev/null +++ b/tests/fixtures/pddl_files/sokoban-sequential-optimal/p17.pddl @@ -0,0 +1,347 @@ +;; ###### +;; # ## +;; # $ $ ## +;; ## $$ # +;; # # # +;; # ## ## +;; # . .# +;; # @. .# +;; # #### +;; #### + +(define (problem p083-microban-sequential) + (:domain sokoban-sequential) + (:objects + dir-down - direction + dir-left - direction + dir-right - direction + dir-up - direction + player-01 - player + pos-01-01 - location + pos-01-02 - location + pos-01-03 - location + pos-01-04 - location + pos-01-05 - location + pos-01-06 - location + pos-01-07 - location + pos-01-08 - location + pos-01-09 - location + pos-01-10 - location + pos-02-01 - location + pos-02-02 - location + pos-02-03 - location + pos-02-04 - location + pos-02-05 - location + pos-02-06 - location + pos-02-07 - location + pos-02-08 - location + pos-02-09 - location + pos-02-10 - location + pos-03-01 - location + pos-03-02 - location + pos-03-03 - location + pos-03-04 - location + pos-03-05 - location + pos-03-06 - location + pos-03-07 - location + pos-03-08 - location + pos-03-09 - location + pos-03-10 - location + pos-04-01 - location + pos-04-02 - location + pos-04-03 - location + pos-04-04 - location + pos-04-05 - location + pos-04-06 - location + pos-04-07 - location + pos-04-08 - location + pos-04-09 - location + pos-04-10 - location + pos-05-01 - location + pos-05-02 - location + pos-05-03 - location + pos-05-04 - location + pos-05-05 - location + pos-05-06 - location + pos-05-07 - location + pos-05-08 - location + pos-05-09 - location + pos-05-10 - location + pos-06-01 - location + pos-06-02 - location + pos-06-03 - location + pos-06-04 - location + pos-06-05 - location + pos-06-06 - location + pos-06-07 - location + pos-06-08 - location + pos-06-09 - location + pos-06-10 - location + pos-07-01 - location + pos-07-02 - location + pos-07-03 - location + pos-07-04 - location + pos-07-05 - location + pos-07-06 - location + pos-07-07 - location + pos-07-08 - location + pos-07-09 - location + pos-07-10 - location + pos-08-01 - location + pos-08-02 - location + pos-08-03 - location + pos-08-04 - location + pos-08-05 - location + pos-08-06 - location + pos-08-07 - location + pos-08-08 - location + pos-08-09 - location + pos-08-10 - location + stone-01 - stone + stone-02 - stone + stone-03 - stone + stone-04 - stone + ) + (:init + (IS-GOAL pos-05-07) + (IS-GOAL pos-05-08) + (IS-GOAL pos-07-07) + (IS-GOAL pos-07-08) + (IS-NONGOAL pos-01-01) + (IS-NONGOAL pos-01-02) + (IS-NONGOAL pos-01-03) + (IS-NONGOAL pos-01-04) + (IS-NONGOAL pos-01-05) + (IS-NONGOAL pos-01-06) + (IS-NONGOAL pos-01-07) + (IS-NONGOAL pos-01-08) + (IS-NONGOAL pos-01-09) + (IS-NONGOAL pos-01-10) + (IS-NONGOAL pos-02-01) + (IS-NONGOAL pos-02-02) + (IS-NONGOAL pos-02-03) + (IS-NONGOAL pos-02-04) + (IS-NONGOAL pos-02-05) + (IS-NONGOAL pos-02-06) + (IS-NONGOAL pos-02-07) + (IS-NONGOAL pos-02-08) + (IS-NONGOAL pos-02-09) + (IS-NONGOAL pos-02-10) + (IS-NONGOAL pos-03-01) + (IS-NONGOAL pos-03-02) + (IS-NONGOAL pos-03-03) + (IS-NONGOAL pos-03-04) + (IS-NONGOAL pos-03-05) + (IS-NONGOAL pos-03-06) + (IS-NONGOAL pos-03-07) + (IS-NONGOAL pos-03-08) + (IS-NONGOAL pos-03-09) + (IS-NONGOAL pos-03-10) + (IS-NONGOAL pos-04-01) + (IS-NONGOAL pos-04-02) + (IS-NONGOAL pos-04-03) + (IS-NONGOAL pos-04-04) + (IS-NONGOAL pos-04-05) + (IS-NONGOAL pos-04-06) + (IS-NONGOAL pos-04-07) + (IS-NONGOAL pos-04-08) + (IS-NONGOAL pos-04-09) + (IS-NONGOAL pos-04-10) + (IS-NONGOAL pos-05-01) + (IS-NONGOAL pos-05-02) + (IS-NONGOAL pos-05-03) + (IS-NONGOAL pos-05-04) + (IS-NONGOAL pos-05-05) + (IS-NONGOAL pos-05-06) + (IS-NONGOAL pos-05-09) + (IS-NONGOAL pos-05-10) + (IS-NONGOAL pos-06-01) + (IS-NONGOAL pos-06-02) + (IS-NONGOAL pos-06-03) + (IS-NONGOAL pos-06-04) + (IS-NONGOAL pos-06-05) + (IS-NONGOAL pos-06-06) + (IS-NONGOAL pos-06-07) + (IS-NONGOAL pos-06-08) + (IS-NONGOAL pos-06-09) + (IS-NONGOAL pos-06-10) + (IS-NONGOAL pos-07-01) + (IS-NONGOAL pos-07-02) + (IS-NONGOAL pos-07-03) + (IS-NONGOAL pos-07-04) + (IS-NONGOAL pos-07-05) + (IS-NONGOAL pos-07-06) + (IS-NONGOAL pos-07-09) + (IS-NONGOAL pos-07-10) + (IS-NONGOAL pos-08-01) + (IS-NONGOAL pos-08-02) + (IS-NONGOAL pos-08-03) + (IS-NONGOAL pos-08-04) + (IS-NONGOAL pos-08-05) + (IS-NONGOAL pos-08-06) + (IS-NONGOAL pos-08-07) + (IS-NONGOAL pos-08-08) + (IS-NONGOAL pos-08-09) + (IS-NONGOAL pos-08-10) + (MOVE-DIR pos-01-05 pos-01-06 dir-down) + (MOVE-DIR pos-01-06 pos-01-05 dir-up) + (MOVE-DIR pos-01-06 pos-01-07 dir-down) + (MOVE-DIR pos-01-07 pos-01-06 dir-up) + (MOVE-DIR pos-01-07 pos-01-08 dir-down) + (MOVE-DIR pos-01-08 pos-01-07 dir-up) + (MOVE-DIR pos-01-08 pos-01-09 dir-down) + (MOVE-DIR pos-01-09 pos-01-08 dir-up) + (MOVE-DIR pos-01-09 pos-01-10 dir-down) + (MOVE-DIR pos-01-10 pos-01-09 dir-up) + (MOVE-DIR pos-02-02 pos-02-03 dir-down) + (MOVE-DIR pos-02-02 pos-03-02 dir-right) + (MOVE-DIR pos-02-03 pos-02-02 dir-up) + (MOVE-DIR pos-02-03 pos-03-03 dir-right) + (MOVE-DIR pos-03-02 pos-02-02 dir-left) + (MOVE-DIR pos-03-02 pos-03-03 dir-down) + (MOVE-DIR pos-03-02 pos-04-02 dir-right) + (MOVE-DIR pos-03-03 pos-02-03 dir-left) + (MOVE-DIR pos-03-03 pos-03-02 dir-up) + (MOVE-DIR pos-03-03 pos-03-04 dir-down) + (MOVE-DIR pos-03-03 pos-04-03 dir-right) + (MOVE-DIR pos-03-04 pos-03-03 dir-up) + (MOVE-DIR pos-03-04 pos-03-05 dir-down) + (MOVE-DIR pos-03-04 pos-04-04 dir-right) + (MOVE-DIR pos-03-05 pos-03-04 dir-up) + (MOVE-DIR pos-03-05 pos-03-06 dir-down) + (MOVE-DIR pos-03-06 pos-03-05 dir-up) + (MOVE-DIR pos-03-06 pos-03-07 dir-down) + (MOVE-DIR pos-03-07 pos-03-06 dir-up) + (MOVE-DIR pos-03-07 pos-03-08 dir-down) + (MOVE-DIR pos-03-07 pos-04-07 dir-right) + (MOVE-DIR pos-03-08 pos-03-07 dir-up) + (MOVE-DIR pos-03-08 pos-03-09 dir-down) + (MOVE-DIR pos-03-08 pos-04-08 dir-right) + (MOVE-DIR pos-03-09 pos-03-08 dir-up) + (MOVE-DIR pos-03-09 pos-04-09 dir-right) + (MOVE-DIR pos-04-02 pos-03-02 dir-left) + (MOVE-DIR pos-04-02 pos-04-03 dir-down) + (MOVE-DIR pos-04-02 pos-05-02 dir-right) + (MOVE-DIR pos-04-03 pos-03-03 dir-left) + (MOVE-DIR pos-04-03 pos-04-02 dir-up) + (MOVE-DIR pos-04-03 pos-04-04 dir-down) + (MOVE-DIR pos-04-03 pos-05-03 dir-right) + (MOVE-DIR pos-04-04 pos-03-04 dir-left) + (MOVE-DIR pos-04-04 pos-04-03 dir-up) + (MOVE-DIR pos-04-04 pos-05-04 dir-right) + (MOVE-DIR pos-04-07 pos-03-07 dir-left) + (MOVE-DIR pos-04-07 pos-04-08 dir-down) + (MOVE-DIR pos-04-07 pos-05-07 dir-right) + (MOVE-DIR pos-04-08 pos-03-08 dir-left) + (MOVE-DIR pos-04-08 pos-04-07 dir-up) + (MOVE-DIR pos-04-08 pos-04-09 dir-down) + (MOVE-DIR pos-04-08 pos-05-08 dir-right) + (MOVE-DIR pos-04-09 pos-03-09 dir-left) + (MOVE-DIR pos-04-09 pos-04-08 dir-up) + (MOVE-DIR pos-05-02 pos-04-02 dir-left) + (MOVE-DIR pos-05-02 pos-05-03 dir-down) + (MOVE-DIR pos-05-03 pos-04-03 dir-left) + (MOVE-DIR pos-05-03 pos-05-02 dir-up) + (MOVE-DIR pos-05-03 pos-05-04 dir-down) + (MOVE-DIR pos-05-03 pos-06-03 dir-right) + (MOVE-DIR pos-05-04 pos-04-04 dir-left) + (MOVE-DIR pos-05-04 pos-05-03 dir-up) + (MOVE-DIR pos-05-04 pos-05-05 dir-down) + (MOVE-DIR pos-05-04 pos-06-04 dir-right) + (MOVE-DIR pos-05-05 pos-05-04 dir-up) + (MOVE-DIR pos-05-05 pos-06-05 dir-right) + (MOVE-DIR pos-05-07 pos-04-07 dir-left) + (MOVE-DIR pos-05-07 pos-05-08 dir-down) + (MOVE-DIR pos-05-07 pos-06-07 dir-right) + (MOVE-DIR pos-05-08 pos-04-08 dir-left) + (MOVE-DIR pos-05-08 pos-05-07 dir-up) + (MOVE-DIR pos-05-08 pos-06-08 dir-right) + (MOVE-DIR pos-06-03 pos-05-03 dir-left) + (MOVE-DIR pos-06-03 pos-06-04 dir-down) + (MOVE-DIR pos-06-04 pos-05-04 dir-left) + (MOVE-DIR pos-06-04 pos-06-03 dir-up) + (MOVE-DIR pos-06-04 pos-06-05 dir-down) + (MOVE-DIR pos-06-04 pos-07-04 dir-right) + (MOVE-DIR pos-06-05 pos-05-05 dir-left) + (MOVE-DIR pos-06-05 pos-06-04 dir-up) + (MOVE-DIR pos-06-05 pos-06-06 dir-down) + (MOVE-DIR pos-06-05 pos-07-05 dir-right) + (MOVE-DIR pos-06-06 pos-06-05 dir-up) + (MOVE-DIR pos-06-06 pos-06-07 dir-down) + (MOVE-DIR pos-06-07 pos-05-07 dir-left) + (MOVE-DIR pos-06-07 pos-06-06 dir-up) + (MOVE-DIR pos-06-07 pos-06-08 dir-down) + (MOVE-DIR pos-06-07 pos-07-07 dir-right) + (MOVE-DIR pos-06-08 pos-05-08 dir-left) + (MOVE-DIR pos-06-08 pos-06-07 dir-up) + (MOVE-DIR pos-06-08 pos-07-08 dir-right) + (MOVE-DIR pos-06-10 pos-07-10 dir-right) + (MOVE-DIR pos-07-01 pos-08-01 dir-right) + (MOVE-DIR pos-07-04 pos-06-04 dir-left) + (MOVE-DIR pos-07-04 pos-07-05 dir-down) + (MOVE-DIR pos-07-05 pos-06-05 dir-left) + (MOVE-DIR pos-07-05 pos-07-04 dir-up) + (MOVE-DIR pos-07-07 pos-06-07 dir-left) + (MOVE-DIR pos-07-07 pos-07-08 dir-down) + (MOVE-DIR pos-07-08 pos-06-08 dir-left) + (MOVE-DIR pos-07-08 pos-07-07 dir-up) + (MOVE-DIR pos-07-10 pos-06-10 dir-left) + (MOVE-DIR pos-07-10 pos-08-10 dir-right) + (MOVE-DIR pos-08-01 pos-07-01 dir-left) + (MOVE-DIR pos-08-01 pos-08-02 dir-down) + (MOVE-DIR pos-08-02 pos-08-01 dir-up) + (MOVE-DIR pos-08-10 pos-07-10 dir-left) + (at player-01 pos-04-08) + (at stone-01 pos-03-03) + (at stone-02 pos-05-03) + (at stone-03 pos-04-04) + (at stone-04 pos-05-04) + (clear pos-01-05) + (clear pos-01-06) + (clear pos-01-07) + (clear pos-01-08) + (clear pos-01-09) + (clear pos-01-10) + (clear pos-02-02) + (clear pos-02-03) + (clear pos-03-02) + (clear pos-03-04) + (clear pos-03-05) + (clear pos-03-06) + (clear pos-03-07) + (clear pos-03-08) + (clear pos-03-09) + (clear pos-04-02) + (clear pos-04-03) + (clear pos-04-07) + (clear pos-04-09) + (clear pos-05-02) + (clear pos-05-05) + (clear pos-05-07) + (clear pos-05-08) + (clear pos-06-03) + (clear pos-06-04) + (clear pos-06-05) + (clear pos-06-06) + (clear pos-06-07) + (clear pos-06-08) + (clear pos-06-10) + (clear pos-07-01) + (clear pos-07-04) + (clear pos-07-05) + (clear pos-07-07) + (clear pos-07-08) + (clear pos-07-10) + (clear pos-08-01) + (clear pos-08-02) + (clear pos-08-10) + (= (total-cost) 0) + ) + (:goal (and + (at-goal stone-01) + (at-goal stone-02) + (at-goal stone-03) + (at-goal stone-04) + )) + (:metric minimize (total-cost)) +) diff --git a/tests/fixtures/pddl_files/sokoban-sequential-optimal/p18.pddl b/tests/fixtures/pddl_files/sokoban-sequential-optimal/p18.pddl new file mode 100644 index 00000000..1488f99d --- /dev/null +++ b/tests/fixtures/pddl_files/sokoban-sequential-optimal/p18.pddl @@ -0,0 +1,341 @@ +;; ######## +;; # # +;; # $*** # +;; # * * # +;; # * * # +;; # ***. # +;; # @# +;; ######## + +(define (problem p107-microban-sequential) + (:domain sokoban-sequential) + (:objects + dir-down - direction + dir-left - direction + dir-right - direction + dir-up - direction + player-01 - player + pos-1-1 - location + pos-1-2 - location + pos-1-3 - location + pos-1-4 - location + pos-1-5 - location + pos-1-6 - location + pos-1-7 - location + pos-1-8 - location + pos-2-1 - location + pos-2-2 - location + pos-2-3 - location + pos-2-4 - location + pos-2-5 - location + pos-2-6 - location + pos-2-7 - location + pos-2-8 - location + pos-3-1 - location + pos-3-2 - location + pos-3-3 - location + pos-3-4 - location + pos-3-5 - location + pos-3-6 - location + pos-3-7 - location + pos-3-8 - location + pos-4-1 - location + pos-4-2 - location + pos-4-3 - location + pos-4-4 - location + pos-4-5 - location + pos-4-6 - location + pos-4-7 - location + pos-4-8 - location + pos-5-1 - location + pos-5-2 - location + pos-5-3 - location + pos-5-4 - location + pos-5-5 - location + pos-5-6 - location + pos-5-7 - location + pos-5-8 - location + pos-6-1 - location + pos-6-2 - location + pos-6-3 - location + pos-6-4 - location + pos-6-5 - location + pos-6-6 - location + pos-6-7 - location + pos-6-8 - location + pos-7-1 - location + pos-7-2 - location + pos-7-3 - location + pos-7-4 - location + pos-7-5 - location + pos-7-6 - location + pos-7-7 - location + pos-7-8 - location + pos-8-1 - location + pos-8-2 - location + pos-8-3 - location + pos-8-4 - location + pos-8-5 - location + pos-8-6 - location + pos-8-7 - location + pos-8-8 - location + stone-01 - stone + stone-02 - stone + stone-03 - stone + stone-04 - stone + stone-05 - stone + stone-06 - stone + stone-07 - stone + stone-08 - stone + stone-09 - stone + stone-10 - stone + stone-11 - stone + ) + (:init + (IS-GOAL pos-3-4) + (IS-GOAL pos-3-5) + (IS-GOAL pos-3-6) + (IS-GOAL pos-4-3) + (IS-GOAL pos-4-6) + (IS-GOAL pos-5-3) + (IS-GOAL pos-5-6) + (IS-GOAL pos-6-3) + (IS-GOAL pos-6-4) + (IS-GOAL pos-6-5) + (IS-GOAL pos-6-6) + (IS-NONGOAL pos-1-1) + (IS-NONGOAL pos-1-2) + (IS-NONGOAL pos-1-3) + (IS-NONGOAL pos-1-4) + (IS-NONGOAL pos-1-5) + (IS-NONGOAL pos-1-6) + (IS-NONGOAL pos-1-7) + (IS-NONGOAL pos-1-8) + (IS-NONGOAL pos-2-1) + (IS-NONGOAL pos-2-2) + (IS-NONGOAL pos-2-3) + (IS-NONGOAL pos-2-4) + (IS-NONGOAL pos-2-5) + (IS-NONGOAL pos-2-6) + (IS-NONGOAL pos-2-7) + (IS-NONGOAL pos-2-8) + (IS-NONGOAL pos-3-1) + (IS-NONGOAL pos-3-2) + (IS-NONGOAL pos-3-3) + (IS-NONGOAL pos-3-7) + (IS-NONGOAL pos-3-8) + (IS-NONGOAL pos-4-1) + (IS-NONGOAL pos-4-2) + (IS-NONGOAL pos-4-4) + (IS-NONGOAL pos-4-5) + (IS-NONGOAL pos-4-7) + (IS-NONGOAL pos-4-8) + (IS-NONGOAL pos-5-1) + (IS-NONGOAL pos-5-2) + (IS-NONGOAL pos-5-4) + (IS-NONGOAL pos-5-5) + (IS-NONGOAL pos-5-7) + (IS-NONGOAL pos-5-8) + (IS-NONGOAL pos-6-1) + (IS-NONGOAL pos-6-2) + (IS-NONGOAL pos-6-7) + (IS-NONGOAL pos-6-8) + (IS-NONGOAL pos-7-1) + (IS-NONGOAL pos-7-2) + (IS-NONGOAL pos-7-3) + (IS-NONGOAL pos-7-4) + (IS-NONGOAL pos-7-5) + (IS-NONGOAL pos-7-6) + (IS-NONGOAL pos-7-7) + (IS-NONGOAL pos-7-8) + (IS-NONGOAL pos-8-1) + (IS-NONGOAL pos-8-2) + (IS-NONGOAL pos-8-3) + (IS-NONGOAL pos-8-4) + (IS-NONGOAL pos-8-5) + (IS-NONGOAL pos-8-6) + (IS-NONGOAL pos-8-7) + (IS-NONGOAL pos-8-8) + (MOVE-DIR pos-2-2 pos-2-3 dir-down) + (MOVE-DIR pos-2-2 pos-3-2 dir-right) + (MOVE-DIR pos-2-3 pos-2-2 dir-up) + (MOVE-DIR pos-2-3 pos-2-4 dir-down) + (MOVE-DIR pos-2-3 pos-3-3 dir-right) + (MOVE-DIR pos-2-4 pos-2-3 dir-up) + (MOVE-DIR pos-2-4 pos-2-5 dir-down) + (MOVE-DIR pos-2-4 pos-3-4 dir-right) + (MOVE-DIR pos-2-5 pos-2-4 dir-up) + (MOVE-DIR pos-2-5 pos-2-6 dir-down) + (MOVE-DIR pos-2-5 pos-3-5 dir-right) + (MOVE-DIR pos-2-6 pos-2-5 dir-up) + (MOVE-DIR pos-2-6 pos-2-7 dir-down) + (MOVE-DIR pos-2-6 pos-3-6 dir-right) + (MOVE-DIR pos-2-7 pos-2-6 dir-up) + (MOVE-DIR pos-2-7 pos-3-7 dir-right) + (MOVE-DIR pos-3-2 pos-2-2 dir-left) + (MOVE-DIR pos-3-2 pos-3-3 dir-down) + (MOVE-DIR pos-3-2 pos-4-2 dir-right) + (MOVE-DIR pos-3-3 pos-2-3 dir-left) + (MOVE-DIR pos-3-3 pos-3-2 dir-up) + (MOVE-DIR pos-3-3 pos-3-4 dir-down) + (MOVE-DIR pos-3-3 pos-4-3 dir-right) + (MOVE-DIR pos-3-4 pos-2-4 dir-left) + (MOVE-DIR pos-3-4 pos-3-3 dir-up) + (MOVE-DIR pos-3-4 pos-3-5 dir-down) + (MOVE-DIR pos-3-4 pos-4-4 dir-right) + (MOVE-DIR pos-3-5 pos-2-5 dir-left) + (MOVE-DIR pos-3-5 pos-3-4 dir-up) + (MOVE-DIR pos-3-5 pos-3-6 dir-down) + (MOVE-DIR pos-3-5 pos-4-5 dir-right) + (MOVE-DIR pos-3-6 pos-2-6 dir-left) + (MOVE-DIR pos-3-6 pos-3-5 dir-up) + (MOVE-DIR pos-3-6 pos-3-7 dir-down) + (MOVE-DIR pos-3-6 pos-4-6 dir-right) + (MOVE-DIR pos-3-7 pos-2-7 dir-left) + (MOVE-DIR pos-3-7 pos-3-6 dir-up) + (MOVE-DIR pos-3-7 pos-4-7 dir-right) + (MOVE-DIR pos-4-2 pos-3-2 dir-left) + (MOVE-DIR pos-4-2 pos-4-3 dir-down) + (MOVE-DIR pos-4-2 pos-5-2 dir-right) + (MOVE-DIR pos-4-3 pos-3-3 dir-left) + (MOVE-DIR pos-4-3 pos-4-2 dir-up) + (MOVE-DIR pos-4-3 pos-4-4 dir-down) + (MOVE-DIR pos-4-3 pos-5-3 dir-right) + (MOVE-DIR pos-4-4 pos-3-4 dir-left) + (MOVE-DIR pos-4-4 pos-4-3 dir-up) + (MOVE-DIR pos-4-4 pos-4-5 dir-down) + (MOVE-DIR pos-4-4 pos-5-4 dir-right) + (MOVE-DIR pos-4-5 pos-3-5 dir-left) + (MOVE-DIR pos-4-5 pos-4-4 dir-up) + (MOVE-DIR pos-4-5 pos-4-6 dir-down) + (MOVE-DIR pos-4-5 pos-5-5 dir-right) + (MOVE-DIR pos-4-6 pos-3-6 dir-left) + (MOVE-DIR pos-4-6 pos-4-5 dir-up) + (MOVE-DIR pos-4-6 pos-4-7 dir-down) + (MOVE-DIR pos-4-6 pos-5-6 dir-right) + (MOVE-DIR pos-4-7 pos-3-7 dir-left) + (MOVE-DIR pos-4-7 pos-4-6 dir-up) + (MOVE-DIR pos-4-7 pos-5-7 dir-right) + (MOVE-DIR pos-5-2 pos-4-2 dir-left) + (MOVE-DIR pos-5-2 pos-5-3 dir-down) + (MOVE-DIR pos-5-2 pos-6-2 dir-right) + (MOVE-DIR pos-5-3 pos-4-3 dir-left) + (MOVE-DIR pos-5-3 pos-5-2 dir-up) + (MOVE-DIR pos-5-3 pos-5-4 dir-down) + (MOVE-DIR pos-5-3 pos-6-3 dir-right) + (MOVE-DIR pos-5-4 pos-4-4 dir-left) + (MOVE-DIR pos-5-4 pos-5-3 dir-up) + (MOVE-DIR pos-5-4 pos-5-5 dir-down) + (MOVE-DIR pos-5-4 pos-6-4 dir-right) + (MOVE-DIR pos-5-5 pos-4-5 dir-left) + (MOVE-DIR pos-5-5 pos-5-4 dir-up) + (MOVE-DIR pos-5-5 pos-5-6 dir-down) + (MOVE-DIR pos-5-5 pos-6-5 dir-right) + (MOVE-DIR pos-5-6 pos-4-6 dir-left) + (MOVE-DIR pos-5-6 pos-5-5 dir-up) + (MOVE-DIR pos-5-6 pos-5-7 dir-down) + (MOVE-DIR pos-5-6 pos-6-6 dir-right) + (MOVE-DIR pos-5-7 pos-4-7 dir-left) + (MOVE-DIR pos-5-7 pos-5-6 dir-up) + (MOVE-DIR pos-5-7 pos-6-7 dir-right) + (MOVE-DIR pos-6-2 pos-5-2 dir-left) + (MOVE-DIR pos-6-2 pos-6-3 dir-down) + (MOVE-DIR pos-6-2 pos-7-2 dir-right) + (MOVE-DIR pos-6-3 pos-5-3 dir-left) + (MOVE-DIR pos-6-3 pos-6-2 dir-up) + (MOVE-DIR pos-6-3 pos-6-4 dir-down) + (MOVE-DIR pos-6-3 pos-7-3 dir-right) + (MOVE-DIR pos-6-4 pos-5-4 dir-left) + (MOVE-DIR pos-6-4 pos-6-3 dir-up) + (MOVE-DIR pos-6-4 pos-6-5 dir-down) + (MOVE-DIR pos-6-4 pos-7-4 dir-right) + (MOVE-DIR pos-6-5 pos-5-5 dir-left) + (MOVE-DIR pos-6-5 pos-6-4 dir-up) + (MOVE-DIR pos-6-5 pos-6-6 dir-down) + (MOVE-DIR pos-6-5 pos-7-5 dir-right) + (MOVE-DIR pos-6-6 pos-5-6 dir-left) + (MOVE-DIR pos-6-6 pos-6-5 dir-up) + (MOVE-DIR pos-6-6 pos-6-7 dir-down) + (MOVE-DIR pos-6-6 pos-7-6 dir-right) + (MOVE-DIR pos-6-7 pos-5-7 dir-left) + (MOVE-DIR pos-6-7 pos-6-6 dir-up) + (MOVE-DIR pos-6-7 pos-7-7 dir-right) + (MOVE-DIR pos-7-2 pos-6-2 dir-left) + (MOVE-DIR pos-7-2 pos-7-3 dir-down) + (MOVE-DIR pos-7-3 pos-6-3 dir-left) + (MOVE-DIR pos-7-3 pos-7-2 dir-up) + (MOVE-DIR pos-7-3 pos-7-4 dir-down) + (MOVE-DIR pos-7-4 pos-6-4 dir-left) + (MOVE-DIR pos-7-4 pos-7-3 dir-up) + (MOVE-DIR pos-7-4 pos-7-5 dir-down) + (MOVE-DIR pos-7-5 pos-6-5 dir-left) + (MOVE-DIR pos-7-5 pos-7-4 dir-up) + (MOVE-DIR pos-7-5 pos-7-6 dir-down) + (MOVE-DIR pos-7-6 pos-6-6 dir-left) + (MOVE-DIR pos-7-6 pos-7-5 dir-up) + (MOVE-DIR pos-7-6 pos-7-7 dir-down) + (MOVE-DIR pos-7-7 pos-6-7 dir-left) + (MOVE-DIR pos-7-7 pos-7-6 dir-up) + (at player-01 pos-7-7) + (at stone-01 pos-3-3) + (at stone-02 pos-4-3) + (at stone-03 pos-5-3) + (at stone-04 pos-6-3) + (at stone-05 pos-3-4) + (at stone-06 pos-6-4) + (at stone-07 pos-3-5) + (at stone-08 pos-6-5) + (at stone-09 pos-3-6) + (at stone-10 pos-4-6) + (at stone-11 pos-5-6) + (at-goal stone-02) + (at-goal stone-03) + (at-goal stone-04) + (at-goal stone-05) + (at-goal stone-06) + (at-goal stone-07) + (at-goal stone-08) + (at-goal stone-09) + (at-goal stone-10) + (at-goal stone-11) + (clear pos-2-2) + (clear pos-2-3) + (clear pos-2-4) + (clear pos-2-5) + (clear pos-2-6) + (clear pos-2-7) + (clear pos-3-2) + (clear pos-3-7) + (clear pos-4-2) + (clear pos-4-4) + (clear pos-4-5) + (clear pos-4-7) + (clear pos-5-2) + (clear pos-5-4) + (clear pos-5-5) + (clear pos-5-7) + (clear pos-6-2) + (clear pos-6-6) + (clear pos-6-7) + (clear pos-7-2) + (clear pos-7-3) + (clear pos-7-4) + (clear pos-7-5) + (clear pos-7-6) + (= (total-cost) 0) + ) + (:goal (and + (at-goal stone-01) + (at-goal stone-02) + (at-goal stone-03) + (at-goal stone-04) + (at-goal stone-05) + (at-goal stone-06) + (at-goal stone-07) + (at-goal stone-08) + (at-goal stone-09) + (at-goal stone-10) + (at-goal stone-11) + )) + (:metric minimize (total-cost)) +) diff --git a/tests/fixtures/pddl_files/sokoban-sequential-optimal/p19.pddl b/tests/fixtures/pddl_files/sokoban-sequential-optimal/p19.pddl new file mode 100644 index 00000000..48811dfd --- /dev/null +++ b/tests/fixtures/pddl_files/sokoban-sequential-optimal/p19.pddl @@ -0,0 +1,434 @@ +;; ##### +;; ## ## +;; # $ ## +;; # $ $ ## +;; ###$# . ## +;; # # . # +;; ## ##. # +;; # @ . ## +;; # # # +;; ######## + +(define (problem p118-microban-sequential) + (:domain sokoban-sequential) + (:objects + dir-down - direction + dir-left - direction + dir-right - direction + dir-up - direction + player-01 - player + pos-01-01 - location + pos-01-02 - location + pos-01-03 - location + pos-01-04 - location + pos-01-05 - location + pos-01-06 - location + pos-01-07 - location + pos-01-08 - location + pos-01-09 - location + pos-01-10 - location + pos-02-01 - location + pos-02-02 - location + pos-02-03 - location + pos-02-04 - location + pos-02-05 - location + pos-02-06 - location + pos-02-07 - location + pos-02-08 - location + pos-02-09 - location + pos-02-10 - location + pos-03-01 - location + pos-03-02 - location + pos-03-03 - location + pos-03-04 - location + pos-03-05 - location + pos-03-06 - location + pos-03-07 - location + pos-03-08 - location + pos-03-09 - location + pos-03-10 - location + pos-04-01 - location + pos-04-02 - location + pos-04-03 - location + pos-04-04 - location + pos-04-05 - location + pos-04-06 - location + pos-04-07 - location + pos-04-08 - location + pos-04-09 - location + pos-04-10 - location + pos-05-01 - location + pos-05-02 - location + pos-05-03 - location + pos-05-04 - location + pos-05-05 - location + pos-05-06 - location + pos-05-07 - location + pos-05-08 - location + pos-05-09 - location + pos-05-10 - location + pos-06-01 - location + pos-06-02 - location + pos-06-03 - location + pos-06-04 - location + pos-06-05 - location + pos-06-06 - location + pos-06-07 - location + pos-06-08 - location + pos-06-09 - location + pos-06-10 - location + pos-07-01 - location + pos-07-02 - location + pos-07-03 - location + pos-07-04 - location + pos-07-05 - location + pos-07-06 - location + pos-07-07 - location + pos-07-08 - location + pos-07-09 - location + pos-07-10 - location + pos-08-01 - location + pos-08-02 - location + pos-08-03 - location + pos-08-04 - location + pos-08-05 - location + pos-08-06 - location + pos-08-07 - location + pos-08-08 - location + pos-08-09 - location + pos-08-10 - location + pos-09-01 - location + pos-09-02 - location + pos-09-03 - location + pos-09-04 - location + pos-09-05 - location + pos-09-06 - location + pos-09-07 - location + pos-09-08 - location + pos-09-09 - location + pos-09-10 - location + pos-10-01 - location + pos-10-02 - location + pos-10-03 - location + pos-10-04 - location + pos-10-05 - location + pos-10-06 - location + pos-10-07 - location + pos-10-08 - location + pos-10-09 - location + pos-10-10 - location + stone-01 - stone + stone-02 - stone + stone-03 - stone + stone-04 - stone + ) + (:init + (IS-GOAL pos-07-05) + (IS-GOAL pos-07-06) + (IS-GOAL pos-07-07) + (IS-GOAL pos-07-08) + (IS-NONGOAL pos-01-01) + (IS-NONGOAL pos-01-02) + (IS-NONGOAL pos-01-03) + (IS-NONGOAL pos-01-04) + (IS-NONGOAL pos-01-05) + (IS-NONGOAL pos-01-06) + (IS-NONGOAL pos-01-07) + (IS-NONGOAL pos-01-08) + (IS-NONGOAL pos-01-09) + (IS-NONGOAL pos-01-10) + (IS-NONGOAL pos-02-01) + (IS-NONGOAL pos-02-02) + (IS-NONGOAL pos-02-03) + (IS-NONGOAL pos-02-04) + (IS-NONGOAL pos-02-05) + (IS-NONGOAL pos-02-06) + (IS-NONGOAL pos-02-07) + (IS-NONGOAL pos-02-08) + (IS-NONGOAL pos-02-09) + (IS-NONGOAL pos-02-10) + (IS-NONGOAL pos-03-01) + (IS-NONGOAL pos-03-02) + (IS-NONGOAL pos-03-03) + (IS-NONGOAL pos-03-04) + (IS-NONGOAL pos-03-05) + (IS-NONGOAL pos-03-06) + (IS-NONGOAL pos-03-07) + (IS-NONGOAL pos-03-08) + (IS-NONGOAL pos-03-09) + (IS-NONGOAL pos-03-10) + (IS-NONGOAL pos-04-01) + (IS-NONGOAL pos-04-02) + (IS-NONGOAL pos-04-03) + (IS-NONGOAL pos-04-04) + (IS-NONGOAL pos-04-05) + (IS-NONGOAL pos-04-06) + (IS-NONGOAL pos-04-07) + (IS-NONGOAL pos-04-08) + (IS-NONGOAL pos-04-09) + (IS-NONGOAL pos-04-10) + (IS-NONGOAL pos-05-01) + (IS-NONGOAL pos-05-02) + (IS-NONGOAL pos-05-03) + (IS-NONGOAL pos-05-04) + (IS-NONGOAL pos-05-05) + (IS-NONGOAL pos-05-06) + (IS-NONGOAL pos-05-07) + (IS-NONGOAL pos-05-08) + (IS-NONGOAL pos-05-09) + (IS-NONGOAL pos-05-10) + (IS-NONGOAL pos-06-01) + (IS-NONGOAL pos-06-02) + (IS-NONGOAL pos-06-03) + (IS-NONGOAL pos-06-04) + (IS-NONGOAL pos-06-05) + (IS-NONGOAL pos-06-06) + (IS-NONGOAL pos-06-07) + (IS-NONGOAL pos-06-08) + (IS-NONGOAL pos-06-09) + (IS-NONGOAL pos-06-10) + (IS-NONGOAL pos-07-01) + (IS-NONGOAL pos-07-02) + (IS-NONGOAL pos-07-03) + (IS-NONGOAL pos-07-04) + (IS-NONGOAL pos-07-09) + (IS-NONGOAL pos-07-10) + (IS-NONGOAL pos-08-01) + (IS-NONGOAL pos-08-02) + (IS-NONGOAL pos-08-03) + (IS-NONGOAL pos-08-04) + (IS-NONGOAL pos-08-05) + (IS-NONGOAL pos-08-06) + (IS-NONGOAL pos-08-07) + (IS-NONGOAL pos-08-08) + (IS-NONGOAL pos-08-09) + (IS-NONGOAL pos-08-10) + (IS-NONGOAL pos-09-01) + (IS-NONGOAL pos-09-02) + (IS-NONGOAL pos-09-03) + (IS-NONGOAL pos-09-04) + (IS-NONGOAL pos-09-05) + (IS-NONGOAL pos-09-06) + (IS-NONGOAL pos-09-07) + (IS-NONGOAL pos-09-08) + (IS-NONGOAL pos-09-09) + (IS-NONGOAL pos-09-10) + (IS-NONGOAL pos-10-01) + (IS-NONGOAL pos-10-02) + (IS-NONGOAL pos-10-03) + (IS-NONGOAL pos-10-04) + (IS-NONGOAL pos-10-05) + (IS-NONGOAL pos-10-06) + (IS-NONGOAL pos-10-07) + (IS-NONGOAL pos-10-08) + (IS-NONGOAL pos-10-09) + (IS-NONGOAL pos-10-10) + (MOVE-DIR pos-01-06 pos-01-07 dir-down) + (MOVE-DIR pos-01-06 pos-02-06 dir-right) + (MOVE-DIR pos-01-07 pos-01-06 dir-up) + (MOVE-DIR pos-01-07 pos-01-08 dir-down) + (MOVE-DIR pos-01-08 pos-01-07 dir-up) + (MOVE-DIR pos-01-08 pos-01-09 dir-down) + (MOVE-DIR pos-01-09 pos-01-08 dir-up) + (MOVE-DIR pos-01-09 pos-01-10 dir-down) + (MOVE-DIR pos-01-10 pos-01-09 dir-up) + (MOVE-DIR pos-02-03 pos-02-04 dir-down) + (MOVE-DIR pos-02-03 pos-03-03 dir-right) + (MOVE-DIR pos-02-04 pos-02-03 dir-up) + (MOVE-DIR pos-02-04 pos-03-04 dir-right) + (MOVE-DIR pos-02-06 pos-01-06 dir-left) + (MOVE-DIR pos-03-02 pos-03-03 dir-down) + (MOVE-DIR pos-03-02 pos-04-02 dir-right) + (MOVE-DIR pos-03-03 pos-02-03 dir-left) + (MOVE-DIR pos-03-03 pos-03-02 dir-up) + (MOVE-DIR pos-03-03 pos-03-04 dir-down) + (MOVE-DIR pos-03-03 pos-04-03 dir-right) + (MOVE-DIR pos-03-04 pos-02-04 dir-left) + (MOVE-DIR pos-03-04 pos-03-03 dir-up) + (MOVE-DIR pos-03-04 pos-04-04 dir-right) + (MOVE-DIR pos-03-08 pos-03-09 dir-down) + (MOVE-DIR pos-03-08 pos-04-08 dir-right) + (MOVE-DIR pos-03-09 pos-03-08 dir-up) + (MOVE-DIR pos-03-09 pos-04-09 dir-right) + (MOVE-DIR pos-04-02 pos-03-02 dir-left) + (MOVE-DIR pos-04-02 pos-04-03 dir-down) + (MOVE-DIR pos-04-02 pos-05-02 dir-right) + (MOVE-DIR pos-04-03 pos-03-03 dir-left) + (MOVE-DIR pos-04-03 pos-04-02 dir-up) + (MOVE-DIR pos-04-03 pos-04-04 dir-down) + (MOVE-DIR pos-04-03 pos-05-03 dir-right) + (MOVE-DIR pos-04-04 pos-03-04 dir-left) + (MOVE-DIR pos-04-04 pos-04-03 dir-up) + (MOVE-DIR pos-04-04 pos-04-05 dir-down) + (MOVE-DIR pos-04-04 pos-05-04 dir-right) + (MOVE-DIR pos-04-05 pos-04-04 dir-up) + (MOVE-DIR pos-04-05 pos-04-06 dir-down) + (MOVE-DIR pos-04-06 pos-04-05 dir-up) + (MOVE-DIR pos-04-06 pos-04-07 dir-down) + (MOVE-DIR pos-04-07 pos-04-06 dir-up) + (MOVE-DIR pos-04-07 pos-04-08 dir-down) + (MOVE-DIR pos-04-08 pos-03-08 dir-left) + (MOVE-DIR pos-04-08 pos-04-07 dir-up) + (MOVE-DIR pos-04-08 pos-04-09 dir-down) + (MOVE-DIR pos-04-08 pos-05-08 dir-right) + (MOVE-DIR pos-04-09 pos-03-09 dir-left) + (MOVE-DIR pos-04-09 pos-04-08 dir-up) + (MOVE-DIR pos-04-09 pos-05-09 dir-right) + (MOVE-DIR pos-05-02 pos-04-02 dir-left) + (MOVE-DIR pos-05-02 pos-05-03 dir-down) + (MOVE-DIR pos-05-03 pos-04-03 dir-left) + (MOVE-DIR pos-05-03 pos-05-02 dir-up) + (MOVE-DIR pos-05-03 pos-05-04 dir-down) + (MOVE-DIR pos-05-03 pos-06-03 dir-right) + (MOVE-DIR pos-05-04 pos-04-04 dir-left) + (MOVE-DIR pos-05-04 pos-05-03 dir-up) + (MOVE-DIR pos-05-04 pos-06-04 dir-right) + (MOVE-DIR pos-05-08 pos-04-08 dir-left) + (MOVE-DIR pos-05-08 pos-05-09 dir-down) + (MOVE-DIR pos-05-08 pos-06-08 dir-right) + (MOVE-DIR pos-05-09 pos-04-09 dir-left) + (MOVE-DIR pos-05-09 pos-05-08 dir-up) + (MOVE-DIR pos-06-03 pos-05-03 dir-left) + (MOVE-DIR pos-06-03 pos-06-04 dir-down) + (MOVE-DIR pos-06-04 pos-05-04 dir-left) + (MOVE-DIR pos-06-04 pos-06-03 dir-up) + (MOVE-DIR pos-06-04 pos-06-05 dir-down) + (MOVE-DIR pos-06-04 pos-07-04 dir-right) + (MOVE-DIR pos-06-05 pos-06-04 dir-up) + (MOVE-DIR pos-06-05 pos-06-06 dir-down) + (MOVE-DIR pos-06-05 pos-07-05 dir-right) + (MOVE-DIR pos-06-06 pos-06-05 dir-up) + (MOVE-DIR pos-06-06 pos-07-06 dir-right) + (MOVE-DIR pos-06-08 pos-05-08 dir-left) + (MOVE-DIR pos-06-08 pos-07-08 dir-right) + (MOVE-DIR pos-07-01 pos-08-01 dir-right) + (MOVE-DIR pos-07-04 pos-06-04 dir-left) + (MOVE-DIR pos-07-04 pos-07-05 dir-down) + (MOVE-DIR pos-07-05 pos-06-05 dir-left) + (MOVE-DIR pos-07-05 pos-07-04 dir-up) + (MOVE-DIR pos-07-05 pos-07-06 dir-down) + (MOVE-DIR pos-07-05 pos-08-05 dir-right) + (MOVE-DIR pos-07-06 pos-06-06 dir-left) + (MOVE-DIR pos-07-06 pos-07-05 dir-up) + (MOVE-DIR pos-07-06 pos-07-07 dir-down) + (MOVE-DIR pos-07-06 pos-08-06 dir-right) + (MOVE-DIR pos-07-07 pos-07-06 dir-up) + (MOVE-DIR pos-07-07 pos-07-08 dir-down) + (MOVE-DIR pos-07-07 pos-08-07 dir-right) + (MOVE-DIR pos-07-08 pos-06-08 dir-left) + (MOVE-DIR pos-07-08 pos-07-07 dir-up) + (MOVE-DIR pos-07-08 pos-07-09 dir-down) + (MOVE-DIR pos-07-08 pos-08-08 dir-right) + (MOVE-DIR pos-07-09 pos-07-08 dir-up) + (MOVE-DIR pos-07-09 pos-08-09 dir-right) + (MOVE-DIR pos-08-01 pos-07-01 dir-left) + (MOVE-DIR pos-08-01 pos-08-02 dir-down) + (MOVE-DIR pos-08-01 pos-09-01 dir-right) + (MOVE-DIR pos-08-02 pos-08-01 dir-up) + (MOVE-DIR pos-08-02 pos-09-02 dir-right) + (MOVE-DIR pos-08-05 pos-07-05 dir-left) + (MOVE-DIR pos-08-05 pos-08-06 dir-down) + (MOVE-DIR pos-08-06 pos-07-06 dir-left) + (MOVE-DIR pos-08-06 pos-08-05 dir-up) + (MOVE-DIR pos-08-06 pos-08-07 dir-down) + (MOVE-DIR pos-08-06 pos-09-06 dir-right) + (MOVE-DIR pos-08-07 pos-07-07 dir-left) + (MOVE-DIR pos-08-07 pos-08-06 dir-up) + (MOVE-DIR pos-08-07 pos-08-08 dir-down) + (MOVE-DIR pos-08-07 pos-09-07 dir-right) + (MOVE-DIR pos-08-08 pos-07-08 dir-left) + (MOVE-DIR pos-08-08 pos-08-07 dir-up) + (MOVE-DIR pos-08-08 pos-08-09 dir-down) + (MOVE-DIR pos-08-09 pos-07-09 dir-left) + (MOVE-DIR pos-08-09 pos-08-08 dir-up) + (MOVE-DIR pos-09-01 pos-08-01 dir-left) + (MOVE-DIR pos-09-01 pos-09-02 dir-down) + (MOVE-DIR pos-09-01 pos-10-01 dir-right) + (MOVE-DIR pos-09-02 pos-08-02 dir-left) + (MOVE-DIR pos-09-02 pos-09-01 dir-up) + (MOVE-DIR pos-09-02 pos-09-03 dir-down) + (MOVE-DIR pos-09-02 pos-10-02 dir-right) + (MOVE-DIR pos-09-03 pos-09-02 dir-up) + (MOVE-DIR pos-09-03 pos-10-03 dir-right) + (MOVE-DIR pos-09-06 pos-08-06 dir-left) + (MOVE-DIR pos-09-06 pos-09-07 dir-down) + (MOVE-DIR pos-09-07 pos-08-07 dir-left) + (MOVE-DIR pos-09-07 pos-09-06 dir-up) + (MOVE-DIR pos-10-01 pos-09-01 dir-left) + (MOVE-DIR pos-10-01 pos-10-02 dir-down) + (MOVE-DIR pos-10-02 pos-09-02 dir-left) + (MOVE-DIR pos-10-02 pos-10-01 dir-up) + (MOVE-DIR pos-10-02 pos-10-03 dir-down) + (MOVE-DIR pos-10-03 pos-09-03 dir-left) + (MOVE-DIR pos-10-03 pos-10-02 dir-up) + (MOVE-DIR pos-10-03 pos-10-04 dir-down) + (MOVE-DIR pos-10-04 pos-10-03 dir-up) + (MOVE-DIR pos-10-09 pos-10-10 dir-down) + (MOVE-DIR pos-10-10 pos-10-09 dir-up) + (at player-01 pos-04-08) + (at stone-01 pos-04-03) + (at stone-02 pos-03-04) + (at stone-03 pos-05-04) + (at stone-04 pos-04-05) + (clear pos-01-01) + (clear pos-01-06) + (clear pos-01-07) + (clear pos-01-08) + (clear pos-01-09) + (clear pos-01-10) + (clear pos-02-03) + (clear pos-02-04) + (clear pos-02-06) + (clear pos-03-02) + (clear pos-03-03) + (clear pos-03-08) + (clear pos-03-09) + (clear pos-04-02) + (clear pos-04-04) + (clear pos-04-06) + (clear pos-04-07) + (clear pos-04-09) + (clear pos-05-02) + (clear pos-05-03) + (clear pos-05-08) + (clear pos-05-09) + (clear pos-06-03) + (clear pos-06-04) + (clear pos-06-05) + (clear pos-06-06) + (clear pos-06-08) + (clear pos-07-01) + (clear pos-07-04) + (clear pos-07-05) + (clear pos-07-06) + (clear pos-07-07) + (clear pos-07-08) + (clear pos-07-09) + (clear pos-08-01) + (clear pos-08-02) + (clear pos-08-05) + (clear pos-08-06) + (clear pos-08-07) + (clear pos-08-08) + (clear pos-08-09) + (clear pos-09-01) + (clear pos-09-02) + (clear pos-09-03) + (clear pos-09-06) + (clear pos-09-07) + (clear pos-10-01) + (clear pos-10-02) + (clear pos-10-03) + (clear pos-10-04) + (clear pos-10-09) + (clear pos-10-10) + (= (total-cost) 0) + ) + (:goal (and + (at-goal stone-01) + (at-goal stone-02) + (at-goal stone-03) + (at-goal stone-04) + )) + (:metric minimize (total-cost)) +) diff --git a/tests/fixtures/pddl_files/sokoban-sequential-optimal/p20.pddl b/tests/fixtures/pddl_files/sokoban-sequential-optimal/p20.pddl new file mode 100644 index 00000000..48afeb13 --- /dev/null +++ b/tests/fixtures/pddl_files/sokoban-sequential-optimal/p20.pddl @@ -0,0 +1,323 @@ +;; #### +;; ## # +;; #. $# +;; #.$ # +;; #.$ # +;; #.$ # +;; #. $## +;; # @# +;; ## # +;; ##### + +(define (problem p035-microban-sequential) + (:domain sokoban-sequential) + (:objects + dir-down - direction + dir-left - direction + dir-right - direction + dir-up - direction + player-01 - player + pos-01-01 - location + pos-01-02 - location + pos-01-03 - location + pos-01-04 - location + pos-01-05 - location + pos-01-06 - location + pos-01-07 - location + pos-01-08 - location + pos-01-09 - location + pos-01-10 - location + pos-02-01 - location + pos-02-02 - location + pos-02-03 - location + pos-02-04 - location + pos-02-05 - location + pos-02-06 - location + pos-02-07 - location + pos-02-08 - location + pos-02-09 - location + pos-02-10 - location + pos-03-01 - location + pos-03-02 - location + pos-03-03 - location + pos-03-04 - location + pos-03-05 - location + pos-03-06 - location + pos-03-07 - location + pos-03-08 - location + pos-03-09 - location + pos-03-10 - location + pos-04-01 - location + pos-04-02 - location + pos-04-03 - location + pos-04-04 - location + pos-04-05 - location + pos-04-06 - location + pos-04-07 - location + pos-04-08 - location + pos-04-09 - location + pos-04-10 - location + pos-05-01 - location + pos-05-02 - location + pos-05-03 - location + pos-05-04 - location + pos-05-05 - location + pos-05-06 - location + pos-05-07 - location + pos-05-08 - location + pos-05-09 - location + pos-05-10 - location + pos-06-01 - location + pos-06-02 - location + pos-06-03 - location + pos-06-04 - location + pos-06-05 - location + pos-06-06 - location + pos-06-07 - location + pos-06-08 - location + pos-06-09 - location + pos-06-10 - location + pos-07-01 - location + pos-07-02 - location + pos-07-03 - location + pos-07-04 - location + pos-07-05 - location + pos-07-06 - location + pos-07-07 - location + pos-07-08 - location + pos-07-09 - location + pos-07-10 - location + stone-01 - stone + stone-02 - stone + stone-03 - stone + stone-04 - stone + stone-05 - stone + ) + (:init + (IS-GOAL pos-03-03) + (IS-GOAL pos-03-04) + (IS-GOAL pos-03-05) + (IS-GOAL pos-03-06) + (IS-GOAL pos-03-07) + (IS-NONGOAL pos-01-01) + (IS-NONGOAL pos-01-02) + (IS-NONGOAL pos-01-03) + (IS-NONGOAL pos-01-04) + (IS-NONGOAL pos-01-05) + (IS-NONGOAL pos-01-06) + (IS-NONGOAL pos-01-07) + (IS-NONGOAL pos-01-08) + (IS-NONGOAL pos-01-09) + (IS-NONGOAL pos-01-10) + (IS-NONGOAL pos-02-01) + (IS-NONGOAL pos-02-02) + (IS-NONGOAL pos-02-03) + (IS-NONGOAL pos-02-04) + (IS-NONGOAL pos-02-05) + (IS-NONGOAL pos-02-06) + (IS-NONGOAL pos-02-07) + (IS-NONGOAL pos-02-08) + (IS-NONGOAL pos-02-09) + (IS-NONGOAL pos-02-10) + (IS-NONGOAL pos-03-01) + (IS-NONGOAL pos-03-02) + (IS-NONGOAL pos-03-08) + (IS-NONGOAL pos-03-09) + (IS-NONGOAL pos-03-10) + (IS-NONGOAL pos-04-01) + (IS-NONGOAL pos-04-02) + (IS-NONGOAL pos-04-03) + (IS-NONGOAL pos-04-04) + (IS-NONGOAL pos-04-05) + (IS-NONGOAL pos-04-06) + (IS-NONGOAL pos-04-07) + (IS-NONGOAL pos-04-08) + (IS-NONGOAL pos-04-09) + (IS-NONGOAL pos-04-10) + (IS-NONGOAL pos-05-01) + (IS-NONGOAL pos-05-02) + (IS-NONGOAL pos-05-03) + (IS-NONGOAL pos-05-04) + (IS-NONGOAL pos-05-05) + (IS-NONGOAL pos-05-06) + (IS-NONGOAL pos-05-07) + (IS-NONGOAL pos-05-08) + (IS-NONGOAL pos-05-09) + (IS-NONGOAL pos-05-10) + (IS-NONGOAL pos-06-01) + (IS-NONGOAL pos-06-02) + (IS-NONGOAL pos-06-03) + (IS-NONGOAL pos-06-04) + (IS-NONGOAL pos-06-05) + (IS-NONGOAL pos-06-06) + (IS-NONGOAL pos-06-07) + (IS-NONGOAL pos-06-08) + (IS-NONGOAL pos-06-09) + (IS-NONGOAL pos-06-10) + (IS-NONGOAL pos-07-01) + (IS-NONGOAL pos-07-02) + (IS-NONGOAL pos-07-03) + (IS-NONGOAL pos-07-04) + (IS-NONGOAL pos-07-05) + (IS-NONGOAL pos-07-06) + (IS-NONGOAL pos-07-07) + (IS-NONGOAL pos-07-08) + (IS-NONGOAL pos-07-09) + (IS-NONGOAL pos-07-10) + (MOVE-DIR pos-01-01 pos-01-02 dir-down) + (MOVE-DIR pos-01-01 pos-02-01 dir-right) + (MOVE-DIR pos-01-02 pos-01-01 dir-up) + (MOVE-DIR pos-01-02 pos-01-03 dir-down) + (MOVE-DIR pos-01-03 pos-01-02 dir-up) + (MOVE-DIR pos-01-03 pos-01-04 dir-down) + (MOVE-DIR pos-01-04 pos-01-03 dir-up) + (MOVE-DIR pos-01-04 pos-01-05 dir-down) + (MOVE-DIR pos-01-05 pos-01-04 dir-up) + (MOVE-DIR pos-01-05 pos-01-06 dir-down) + (MOVE-DIR pos-01-06 pos-01-05 dir-up) + (MOVE-DIR pos-01-06 pos-01-07 dir-down) + (MOVE-DIR pos-01-07 pos-01-06 dir-up) + (MOVE-DIR pos-01-07 pos-01-08 dir-down) + (MOVE-DIR pos-01-08 pos-01-07 dir-up) + (MOVE-DIR pos-01-08 pos-01-09 dir-down) + (MOVE-DIR pos-01-09 pos-01-08 dir-up) + (MOVE-DIR pos-01-09 pos-01-10 dir-down) + (MOVE-DIR pos-01-10 pos-01-09 dir-up) + (MOVE-DIR pos-01-10 pos-02-10 dir-right) + (MOVE-DIR pos-02-01 pos-01-01 dir-left) + (MOVE-DIR pos-02-10 pos-01-10 dir-left) + (MOVE-DIR pos-03-03 pos-03-04 dir-down) + (MOVE-DIR pos-03-03 pos-04-03 dir-right) + (MOVE-DIR pos-03-04 pos-03-03 dir-up) + (MOVE-DIR pos-03-04 pos-03-05 dir-down) + (MOVE-DIR pos-03-04 pos-04-04 dir-right) + (MOVE-DIR pos-03-05 pos-03-04 dir-up) + (MOVE-DIR pos-03-05 pos-03-06 dir-down) + (MOVE-DIR pos-03-05 pos-04-05 dir-right) + (MOVE-DIR pos-03-06 pos-03-05 dir-up) + (MOVE-DIR pos-03-06 pos-03-07 dir-down) + (MOVE-DIR pos-03-06 pos-04-06 dir-right) + (MOVE-DIR pos-03-07 pos-03-06 dir-up) + (MOVE-DIR pos-03-07 pos-03-08 dir-down) + (MOVE-DIR pos-03-07 pos-04-07 dir-right) + (MOVE-DIR pos-03-08 pos-03-07 dir-up) + (MOVE-DIR pos-03-08 pos-04-08 dir-right) + (MOVE-DIR pos-04-02 pos-04-03 dir-down) + (MOVE-DIR pos-04-02 pos-05-02 dir-right) + (MOVE-DIR pos-04-03 pos-03-03 dir-left) + (MOVE-DIR pos-04-03 pos-04-02 dir-up) + (MOVE-DIR pos-04-03 pos-04-04 dir-down) + (MOVE-DIR pos-04-03 pos-05-03 dir-right) + (MOVE-DIR pos-04-04 pos-03-04 dir-left) + (MOVE-DIR pos-04-04 pos-04-03 dir-up) + (MOVE-DIR pos-04-04 pos-04-05 dir-down) + (MOVE-DIR pos-04-04 pos-05-04 dir-right) + (MOVE-DIR pos-04-05 pos-03-05 dir-left) + (MOVE-DIR pos-04-05 pos-04-04 dir-up) + (MOVE-DIR pos-04-05 pos-04-06 dir-down) + (MOVE-DIR pos-04-05 pos-05-05 dir-right) + (MOVE-DIR pos-04-06 pos-03-06 dir-left) + (MOVE-DIR pos-04-06 pos-04-05 dir-up) + (MOVE-DIR pos-04-06 pos-04-07 dir-down) + (MOVE-DIR pos-04-06 pos-05-06 dir-right) + (MOVE-DIR pos-04-07 pos-03-07 dir-left) + (MOVE-DIR pos-04-07 pos-04-06 dir-up) + (MOVE-DIR pos-04-07 pos-04-08 dir-down) + (MOVE-DIR pos-04-07 pos-05-07 dir-right) + (MOVE-DIR pos-04-08 pos-03-08 dir-left) + (MOVE-DIR pos-04-08 pos-04-07 dir-up) + (MOVE-DIR pos-04-08 pos-04-09 dir-down) + (MOVE-DIR pos-04-08 pos-05-08 dir-right) + (MOVE-DIR pos-04-09 pos-04-08 dir-up) + (MOVE-DIR pos-04-09 pos-05-09 dir-right) + (MOVE-DIR pos-05-02 pos-04-02 dir-left) + (MOVE-DIR pos-05-02 pos-05-03 dir-down) + (MOVE-DIR pos-05-03 pos-04-03 dir-left) + (MOVE-DIR pos-05-03 pos-05-02 dir-up) + (MOVE-DIR pos-05-03 pos-05-04 dir-down) + (MOVE-DIR pos-05-04 pos-04-04 dir-left) + (MOVE-DIR pos-05-04 pos-05-03 dir-up) + (MOVE-DIR pos-05-04 pos-05-05 dir-down) + (MOVE-DIR pos-05-05 pos-04-05 dir-left) + (MOVE-DIR pos-05-05 pos-05-04 dir-up) + (MOVE-DIR pos-05-05 pos-05-06 dir-down) + (MOVE-DIR pos-05-06 pos-04-06 dir-left) + (MOVE-DIR pos-05-06 pos-05-05 dir-up) + (MOVE-DIR pos-05-06 pos-05-07 dir-down) + (MOVE-DIR pos-05-07 pos-04-07 dir-left) + (MOVE-DIR pos-05-07 pos-05-06 dir-up) + (MOVE-DIR pos-05-07 pos-05-08 dir-down) + (MOVE-DIR pos-05-08 pos-04-08 dir-left) + (MOVE-DIR pos-05-08 pos-05-07 dir-up) + (MOVE-DIR pos-05-08 pos-05-09 dir-down) + (MOVE-DIR pos-05-08 pos-06-08 dir-right) + (MOVE-DIR pos-05-09 pos-04-09 dir-left) + (MOVE-DIR pos-05-09 pos-05-08 dir-up) + (MOVE-DIR pos-05-09 pos-06-09 dir-right) + (MOVE-DIR pos-06-08 pos-05-08 dir-left) + (MOVE-DIR pos-06-08 pos-06-09 dir-down) + (MOVE-DIR pos-06-09 pos-05-09 dir-left) + (MOVE-DIR pos-06-09 pos-06-08 dir-up) + (MOVE-DIR pos-07-01 pos-07-02 dir-down) + (MOVE-DIR pos-07-02 pos-07-01 dir-up) + (MOVE-DIR pos-07-02 pos-07-03 dir-down) + (MOVE-DIR pos-07-03 pos-07-02 dir-up) + (MOVE-DIR pos-07-03 pos-07-04 dir-down) + (MOVE-DIR pos-07-04 pos-07-03 dir-up) + (MOVE-DIR pos-07-04 pos-07-05 dir-down) + (MOVE-DIR pos-07-05 pos-07-04 dir-up) + (MOVE-DIR pos-07-05 pos-07-06 dir-down) + (MOVE-DIR pos-07-06 pos-07-05 dir-up) + (at player-01 pos-06-08) + (at stone-01 pos-05-03) + (at stone-02 pos-04-04) + (at stone-03 pos-04-05) + (at stone-04 pos-04-06) + (at stone-05 pos-05-07) + (clear pos-01-01) + (clear pos-01-02) + (clear pos-01-03) + (clear pos-01-04) + (clear pos-01-05) + (clear pos-01-06) + (clear pos-01-07) + (clear pos-01-08) + (clear pos-01-09) + (clear pos-01-10) + (clear pos-02-01) + (clear pos-02-10) + (clear pos-03-03) + (clear pos-03-04) + (clear pos-03-05) + (clear pos-03-06) + (clear pos-03-07) + (clear pos-03-08) + (clear pos-04-02) + (clear pos-04-03) + (clear pos-04-07) + (clear pos-04-08) + (clear pos-04-09) + (clear pos-05-02) + (clear pos-05-04) + (clear pos-05-05) + (clear pos-05-06) + (clear pos-05-08) + (clear pos-05-09) + (clear pos-06-09) + (clear pos-07-01) + (clear pos-07-02) + (clear pos-07-03) + (clear pos-07-04) + (clear pos-07-05) + (clear pos-07-06) + (= (total-cost) 0) + ) + (:goal (and + (at-goal stone-01) + (at-goal stone-02) + (at-goal stone-03) + (at-goal stone-04) + (at-goal stone-05) + )) + (:metric minimize (total-cost)) +) From fbb0118f0742baae945bc5becd2986f0cf040ff6 Mon Sep 17 00:00:00 2001 From: Francesco Fuggitti Date: Fri, 13 Oct 2023 19:32:20 -0400 Subject: [PATCH 57/65] apply style checks --- pddl/logic/terms.py | 2 +- pddl/parser/typed_list_parser.py | 4 ++-- tests/test_functions.py | 2 +- tests/test_problem.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pddl/logic/terms.py b/pddl/logic/terms.py index b2b577cb..2669d274 100644 --- a/pddl/logic/terms.py +++ b/pddl/logic/terms.py @@ -12,7 +12,7 @@ """This modules implements PDDL terms.""" import functools -from typing import AbstractSet, Collection, Optional, Any +from typing import AbstractSet, Any, Collection, Optional from pddl.custom_types import name as name_type from pddl.custom_types import namelike, parse_name, to_type diff --git a/pddl/parser/typed_list_parser.py b/pddl/parser/typed_list_parser.py index d530effc..444f5b3e 100644 --- a/pddl/parser/typed_list_parser.py +++ b/pddl/parser/typed_list_parser.py @@ -12,9 +12,9 @@ """Utility to handle typed lists.""" import itertools -from typing import Dict, List, Optional, Set, Tuple, TypeVar, Union, cast, Generic, Any +from typing import Any, Dict, Generic, List, Optional, Set, Tuple, TypeVar, Union -from pddl.custom_types import parse_name, parse_type, name +from pddl.custom_types import name, parse_name, parse_type from pddl.helpers.base import check, safe_index from pddl.logic.functions import NumericFunction from pddl.logic.terms import _print_tag_set diff --git a/tests/test_functions.py b/tests/test_functions.py index 08cab99e..b72c5508 100644 --- a/tests/test_functions.py +++ b/tests/test_functions.py @@ -12,10 +12,10 @@ """This module contains tests for PDDL functions.""" import pytest -from pddl.parser.symbols import Symbols from pddl.logic.functions import Metric, NumericFunction, NumericValue from pddl.logic.helpers import variables +from pddl.parser.symbols import Symbols class TestNumericFunction: diff --git a/tests/test_problem.py b/tests/test_problem.py index 31de44ed..c30bac44 100644 --- a/tests/test_problem.py +++ b/tests/test_problem.py @@ -15,7 +15,6 @@ import pickle # nosec import pytest -from pddl.parser.symbols import Symbols from pddl.core import Domain, Problem from pddl.logic.base import And, Not @@ -30,6 +29,7 @@ ) from pddl.logic.helpers import constants, variables from pddl.logic.predicates import Predicate +from pddl.parser.symbols import Symbols from tests.conftest import pddl_objects_problems From 79867020623e776ddc2b11fa851259c7b711ebde Mon Sep 17 00:00:00 2001 From: Francesco Fuggitti Date: Fri, 13 Oct 2023 22:58:33 -0400 Subject: [PATCH 58/65] fix functions requirements validation --- pddl/_validation.py | 3 ++- pddl/requirements.py | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pddl/_validation.py b/pddl/_validation.py index 895d8712..31379901 100644 --- a/pddl/_validation.py +++ b/pddl/_validation.py @@ -439,7 +439,8 @@ def _check_total_cost( for f in function_dict.keys() ): validate( - Requirements.NUMERIC_FLUENTS in requirements, + Requirements.NUMERIC_FLUENTS + in _extend_domain_requirements(requirements), "numeric-fluents requirement is not specified, but numeric fluents are specified.", ) else: diff --git a/pddl/requirements.py b/pddl/requirements.py index 9875e73a..8840822a 100644 --- a/pddl/requirements.py +++ b/pddl/requirements.py @@ -94,4 +94,6 @@ def _extend_domain_requirements( ) if Requirements.ADL in requirements: extended_requirements.update(Requirements.adl_requirements()) + if Requirements.FLUENTS in requirements: + extended_requirements.update(Requirements.fluents_requirements()) return extended_requirements From 6ba14247d97a0272d2b9c0ba6bb3385e77426201 Mon Sep 17 00:00:00 2001 From: Francesco Fuggitti Date: Fri, 13 Oct 2023 22:58:58 -0400 Subject: [PATCH 59/65] fix functions to_string --- pddl/formatter.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/pddl/formatter.py b/pddl/formatter.py index 45cd056f..7c1edcfd 100644 --- a/pddl/formatter.py +++ b/pddl/formatter.py @@ -89,6 +89,23 @@ def _print_predicates_with_types(predicates: Collection): return result.strip() +def _print_function_skeleton(function: NumericFunction) -> str: + """Callable to print a function skeleton with type tags.""" + result = "" + if function.arity == 0: + result += f"({function.name})" + else: + result += f"({function.name}" + for t in function.terms: + result += ( + f" ?{t.name} - {sorted(t.type_tags)[0]}" + if t.type_tags + else f" ?{t.name}" + ) + result += ")" + return result + + def _print_typed_lists( prefix, names_by_obj: Dict[Optional[T], List[name]], @@ -134,7 +151,7 @@ def domain_to_string(domain: Domain) -> str: body += f"(:predicates {_print_predicates_with_types(domain.predicates)})\n" if domain.functions: body += _print_types_or_functions_with_parents( - "(:functions", domain.functions, ")\n" + "(:functions", domain.functions, ")\n", _print_function_skeleton ) body += _sort_and_print_collection( "", From 8a4af8707f481469b3569b694d238689a8105a79 Mon Sep 17 00:00:00 2001 From: Francesco Fuggitti Date: Fri, 13 Oct 2023 22:59:43 -0400 Subject: [PATCH 60/65] add rovers numeric domain and update whitelist --- scripts/whitelist.py | 1 - tests/conftest.py | 3 +- .../rovers-numeric-automatic/domain.pddl | 131 +++ .../rovers-numeric-automatic/p01.pddl | 70 ++ .../rovers-numeric-automatic/p02.pddl | 67 ++ .../rovers-numeric-automatic/p03.pddl | 81 ++ .../rovers-numeric-automatic/p04.pddl | 82 ++ .../rovers-numeric-automatic/p05.pddl | 94 ++ .../rovers-numeric-automatic/p06.pddl | 118 +++ .../rovers-numeric-automatic/p07.pddl | 125 +++ .../rovers-numeric-automatic/p08.pddl | 160 ++++ .../rovers-numeric-automatic/p09.pddl | 183 ++++ .../rovers-numeric-automatic/p10.pddl | 178 ++++ .../rovers-numeric-automatic/p11.pddl | 202 ++++ .../rovers-numeric-automatic/p12.pddl | 191 ++++ .../rovers-numeric-automatic/p13.pddl | 231 +++++ .../rovers-numeric-automatic/p14.pddl | 244 +++++ .../rovers-numeric-automatic/p15.pddl | 284 ++++++ .../rovers-numeric-automatic/p16.pddl | 297 ++++++ .../rovers-numeric-automatic/p17.pddl | 430 +++++++++ .../rovers-numeric-automatic/p18.pddl | 590 ++++++++++++ .../rovers-numeric-automatic/p19.pddl | 614 ++++++++++++ .../rovers-numeric-automatic/p20.pddl | 873 ++++++++++++++++++ 23 files changed, 5247 insertions(+), 2 deletions(-) create mode 100644 tests/fixtures/pddl_files/rovers-numeric-automatic/domain.pddl create mode 100644 tests/fixtures/pddl_files/rovers-numeric-automatic/p01.pddl create mode 100644 tests/fixtures/pddl_files/rovers-numeric-automatic/p02.pddl create mode 100644 tests/fixtures/pddl_files/rovers-numeric-automatic/p03.pddl create mode 100644 tests/fixtures/pddl_files/rovers-numeric-automatic/p04.pddl create mode 100644 tests/fixtures/pddl_files/rovers-numeric-automatic/p05.pddl create mode 100644 tests/fixtures/pddl_files/rovers-numeric-automatic/p06.pddl create mode 100644 tests/fixtures/pddl_files/rovers-numeric-automatic/p07.pddl create mode 100644 tests/fixtures/pddl_files/rovers-numeric-automatic/p08.pddl create mode 100644 tests/fixtures/pddl_files/rovers-numeric-automatic/p09.pddl create mode 100644 tests/fixtures/pddl_files/rovers-numeric-automatic/p10.pddl create mode 100644 tests/fixtures/pddl_files/rovers-numeric-automatic/p11.pddl create mode 100644 tests/fixtures/pddl_files/rovers-numeric-automatic/p12.pddl create mode 100644 tests/fixtures/pddl_files/rovers-numeric-automatic/p13.pddl create mode 100644 tests/fixtures/pddl_files/rovers-numeric-automatic/p14.pddl create mode 100644 tests/fixtures/pddl_files/rovers-numeric-automatic/p15.pddl create mode 100644 tests/fixtures/pddl_files/rovers-numeric-automatic/p16.pddl create mode 100644 tests/fixtures/pddl_files/rovers-numeric-automatic/p17.pddl create mode 100644 tests/fixtures/pddl_files/rovers-numeric-automatic/p18.pddl create mode 100644 tests/fixtures/pddl_files/rovers-numeric-automatic/p19.pddl create mode 100644 tests/fixtures/pddl_files/rovers-numeric-automatic/p20.pddl diff --git a/scripts/whitelist.py b/scripts/whitelist.py index cd3f5a2b..27fa1883 100644 --- a/scripts/whitelist.py +++ b/scripts/whitelist.py @@ -91,4 +91,3 @@ TYPES # unused variable (pddl/parser/symbols.py:52) METRIC # unused variable (pddl/parser/symbols.py:53) ALL_REQUIREMENTS # unused variable (pddl/parser/symbols.py:104) -_.fluents_requirements # unused method (pddl/requirements.py:62) diff --git a/tests/conftest.py b/tests/conftest.py index fbe62a50..b69626b4 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -46,7 +46,7 @@ "blocksworld-ipc08", "blocksworld_fond", "cave-diving-sequential-optimal", - "depots-numeric-automatic", + # "depots-numeric-automatic", "doors", "earth_observation", "elevators", @@ -55,6 +55,7 @@ "islands", "maintenance-sequential-satisficing-ipc2014", "miner", + "rovers-numeric-automatic", "rovers_fond", "sokoban-sequential-optimal", "spiky-tireworld", diff --git a/tests/fixtures/pddl_files/rovers-numeric-automatic/domain.pddl b/tests/fixtures/pddl_files/rovers-numeric-automatic/domain.pddl new file mode 100644 index 00000000..fe3a0b7a --- /dev/null +++ b/tests/fixtures/pddl_files/rovers-numeric-automatic/domain.pddl @@ -0,0 +1,131 @@ +(define (domain Rover) +(:requirements :typing :fluents) +(:types rover waypoint store camera mode lander objective) + +(:predicates (at ?x - rover ?y - waypoint) + (at_lander ?x - lander ?y - waypoint) + (can_traverse ?r - rover ?x - waypoint ?y - waypoint) + (equipped_for_soil_analysis ?r - rover) + (equipped_for_rock_analysis ?r - rover) + (equipped_for_imaging ?r - rover) + (empty ?s - store) + (have_rock_analysis ?r - rover ?w - waypoint) + (have_soil_analysis ?r - rover ?w - waypoint) + (full ?s - store) + (calibrated ?c - camera ?r - rover) + (supports ?c - camera ?m - mode) + (available ?r - rover) + (visible ?w - waypoint ?p - waypoint) + (have_image ?r - rover ?o - objective ?m - mode) + (communicated_soil_data ?w - waypoint) + (communicated_rock_data ?w - waypoint) + (communicated_image_data ?o - objective ?m - mode) + (at_soil_sample ?w - waypoint) + (at_rock_sample ?w - waypoint) + (visible_from ?o - objective ?w - waypoint) + (store_of ?s - store ?r - rover) + (calibration_target ?i - camera ?o - objective) + (on_board ?i - camera ?r - rover) + (channel_free ?l - lander) + (in_sun ?w - waypoint) + +) + +(:functions (energy ?r - rover) (recharges) ) + +(:action navigate +:parameters (?x - rover ?y - waypoint ?z - waypoint) +:precondition (and (can_traverse ?x ?y ?z) (available ?x) (at ?x ?y) + (visible ?y ?z) (>= (energy ?x) 8) + ) +:effect (and (decrease (energy ?x) 8) (not (at ?x ?y)) (at ?x ?z) + ) +) + +(:action recharge +:parameters (?x - rover ?w - waypoint) +:precondition (and (at ?x ?w) (in_sun ?w) (<= (energy ?x) 80)) +:effect (and (increase (energy ?x) 20) (increase (recharges) 1)) +) + +(:action sample_soil +:parameters (?x - rover ?s - store ?p - waypoint) +:precondition (and (at ?x ?p)(>= (energy ?x) 3) (at_soil_sample ?p) (equipped_for_soil_analysis ?x) (store_of ?s ?x) (empty ?s) + ) +:effect (and (not (empty ?s)) (full ?s) (decrease (energy ?x) 3) (have_soil_analysis ?x ?p) (not (at_soil_sample ?p)) + ) +) + +(:action sample_rock +:parameters (?x - rover ?s - store ?p - waypoint) +:precondition (and (at ?x ?p) (>= (energy ?x) 5)(at_rock_sample ?p) (equipped_for_rock_analysis ?x) (store_of ?s ?x)(empty ?s) + ) +:effect (and (not (empty ?s)) (full ?s) (decrease (energy ?x) 5) (have_rock_analysis ?x ?p) (not (at_rock_sample ?p)) + ) +) + +(:action drop +:parameters (?x - rover ?y - store) +:precondition (and (store_of ?y ?x) (full ?y) + ) +:effect (and (not (full ?y)) (empty ?y) + ) +) + +(:action calibrate + :parameters (?r - rover ?i - camera ?t - objective ?w - waypoint) + :precondition (and (equipped_for_imaging ?r) (>= (energy ?r) 2)(calibration_target ?i ?t) (at ?r ?w) (visible_from ?t ?w)(on_board ?i ?r) + ) + :effect (and (decrease (energy ?r) 2)(calibrated ?i ?r) ) +) + + + + +(:action take_image + :parameters (?r - rover ?p - waypoint ?o - objective ?i - camera ?m - mode) + :precondition (and (calibrated ?i ?r) + (on_board ?i ?r) + (equipped_for_imaging ?r) + (supports ?i ?m) + (visible_from ?o ?p) + (at ?r ?p) + (>= (energy ?r) 1) + ) + :effect (and (have_image ?r ?o ?m)(not (calibrated ?i ?r))(decrease (energy ?r) 1) + ) +) + +(:action communicate_soil_data + :parameters (?r - rover ?l - lander ?p - waypoint ?x - waypoint ?y - waypoint) + :precondition (and (at ?r ?x)(at_lander ?l ?y)(have_soil_analysis ?r ?p) + (visible ?x ?y)(available ?r)(channel_free ?l)(>= (energy ?r) 4) + ) + :effect (and (not (available ?r))(not (channel_free ?l)) +(channel_free ?l) (communicated_soil_data ?p)(available ?r)(decrease (energy ?r) 4) + ) +) + +(:action communicate_rock_data + :parameters (?r - rover ?l - lander ?p - waypoint ?x - waypoint ?y - waypoint) + :precondition (and (at ?r ?x)(at_lander ?l ?y)(have_rock_analysis ?r ?p)(>= (energy ?r) 4) + (visible ?x ?y)(available ?r)(channel_free ?l) + ) + :effect (and (not (available ?r))(not (channel_free ?l)) +(channel_free ?l) +(communicated_rock_data ?p)(available ?r)(decrease (energy ?r) 4) + ) +) + + +(:action communicate_image_data + :parameters (?r - rover ?l - lander ?o - objective ?m - mode ?x - waypoint ?y - waypoint) + :precondition (and (at ?r ?x)(at_lander ?l ?y)(have_image ?r ?o ?m)(visible ?x ?y)(available ?r)(channel_free ?l)(>= (energy ?r) 6) + ) + :effect (and (not (available ?r))(not (channel_free ?l)) +(channel_free ?l) +(communicated_image_data ?o ?m)(available ?r)(decrease (energy ?r) 6) + ) +) + +) diff --git a/tests/fixtures/pddl_files/rovers-numeric-automatic/p01.pddl b/tests/fixtures/pddl_files/rovers-numeric-automatic/p01.pddl new file mode 100644 index 00000000..36dba2ba --- /dev/null +++ b/tests/fixtures/pddl_files/rovers-numeric-automatic/p01.pddl @@ -0,0 +1,70 @@ +(define (problem roverprob1234) (:domain Rover) +(:objects + general - Lander + colour high_res low_res - Mode + rover0 - Rover + rover0store - Store + waypoint0 waypoint1 waypoint2 waypoint3 - Waypoint + camera0 - Camera + objective0 objective1 - Objective + ) +(:init + (visible waypoint1 waypoint0) + (visible waypoint0 waypoint1) + (visible waypoint2 waypoint0) + (visible waypoint0 waypoint2) + (visible waypoint2 waypoint1) + (visible waypoint1 waypoint2) + (visible waypoint3 waypoint0) + (visible waypoint0 waypoint3) + (visible waypoint3 waypoint1) + (visible waypoint1 waypoint3) + (visible waypoint3 waypoint2) + (visible waypoint2 waypoint3) + (= (recharges) 0) + (at_soil_sample waypoint0) + (in_sun waypoint0) + (at_rock_sample waypoint1) + (at_soil_sample waypoint2) + (at_rock_sample waypoint2) + (at_soil_sample waypoint3) + (at_rock_sample waypoint3) + (at_lander general waypoint0) + (channel_free general) + (= (energy rover0) 50) + (at rover0 waypoint3) + (available rover0) + (store_of rover0store rover0) + (empty rover0store) + (equipped_for_soil_analysis rover0) + (equipped_for_rock_analysis rover0) + (equipped_for_imaging rover0) + (can_traverse rover0 waypoint3 waypoint0) + (can_traverse rover0 waypoint0 waypoint3) + (can_traverse rover0 waypoint3 waypoint1) + (can_traverse rover0 waypoint1 waypoint3) + (can_traverse rover0 waypoint1 waypoint2) + (can_traverse rover0 waypoint2 waypoint1) + (on_board camera0 rover0) + (calibration_target camera0 objective1) + (supports camera0 colour) + (supports camera0 high_res) + (visible_from objective0 waypoint0) + (visible_from objective0 waypoint1) + (visible_from objective0 waypoint2) + (visible_from objective0 waypoint3) + (visible_from objective1 waypoint0) + (visible_from objective1 waypoint1) + (visible_from objective1 waypoint2) + (visible_from objective1 waypoint3) +) + +(:goal (and +(communicated_soil_data waypoint2) +(communicated_rock_data waypoint3) +(communicated_image_data objective1 high_res) + ) +) + +(:metric minimize (recharges)) +) diff --git a/tests/fixtures/pddl_files/rovers-numeric-automatic/p02.pddl b/tests/fixtures/pddl_files/rovers-numeric-automatic/p02.pddl new file mode 100644 index 00000000..60b3a7fe --- /dev/null +++ b/tests/fixtures/pddl_files/rovers-numeric-automatic/p02.pddl @@ -0,0 +1,67 @@ +(define (problem roverprob4213) (:domain Rover) +(:objects + general - Lander + colour high_res low_res - Mode + rover0 - Rover + rover0store - Store + waypoint0 waypoint1 waypoint2 waypoint3 - Waypoint + camera0 camera1 - Camera + objective0 objective1 - Objective + ) +(:init + (visible waypoint0 waypoint1) + (visible waypoint1 waypoint0) + (visible waypoint1 waypoint2) + (visible waypoint2 waypoint1) + (visible waypoint1 waypoint3) + (visible waypoint3 waypoint1) + (visible waypoint2 waypoint0) + (visible waypoint0 waypoint2) + (visible waypoint2 waypoint3) + (visible waypoint3 waypoint2) + (visible waypoint3 waypoint0) + (visible waypoint0 waypoint3) + (= (recharges) 0) + (at_soil_sample waypoint0) + (at_rock_sample waypoint0) + (in_sun waypoint1) + (in_sun waypoint3) + (at_lander general waypoint1) + (channel_free general) + (= (energy rover0) 50) + (at rover0 waypoint0) + (available rover0) + (store_of rover0store rover0) + (empty rover0store) + (equipped_for_soil_analysis rover0) + (equipped_for_rock_analysis rover0) + (equipped_for_imaging rover0) + (can_traverse rover0 waypoint0 waypoint1) + (can_traverse rover0 waypoint1 waypoint0) + (can_traverse rover0 waypoint0 waypoint2) + (can_traverse rover0 waypoint2 waypoint0) + (can_traverse rover0 waypoint0 waypoint3) + (can_traverse rover0 waypoint3 waypoint0) + (on_board camera0 rover0) + (calibration_target camera0 objective0) + (supports camera0 colour) + (supports camera0 high_res) + (supports camera0 low_res) + (on_board camera1 rover0) + (calibration_target camera1 objective1) + (supports camera1 high_res) + (visible_from objective0 waypoint0) + (visible_from objective1 waypoint0) + (visible_from objective1 waypoint1) + (visible_from objective1 waypoint2) +) + +(:goal (and +(communicated_soil_data waypoint0) +(communicated_rock_data waypoint0) +(communicated_image_data objective1 low_res) + ) +) + +(:metric minimize (recharges)) +) diff --git a/tests/fixtures/pddl_files/rovers-numeric-automatic/p03.pddl b/tests/fixtures/pddl_files/rovers-numeric-automatic/p03.pddl new file mode 100644 index 00000000..921cc86a --- /dev/null +++ b/tests/fixtures/pddl_files/rovers-numeric-automatic/p03.pddl @@ -0,0 +1,81 @@ +(define (problem roverprob3726) (:domain Rover) +(:objects + general - Lander + colour high_res low_res - Mode + rover0 rover1 - Rover + rover0store rover1store - Store + waypoint0 waypoint1 waypoint2 waypoint3 - Waypoint + camera0 camera1 - Camera + objective0 objective1 - Objective + ) +(:init + (visible waypoint0 waypoint1) + (visible waypoint1 waypoint0) + (visible waypoint0 waypoint3) + (visible waypoint3 waypoint0) + (visible waypoint1 waypoint2) + (visible waypoint2 waypoint1) + (visible waypoint1 waypoint3) + (visible waypoint3 waypoint1) + (visible waypoint2 waypoint0) + (visible waypoint0 waypoint2) + (visible waypoint3 waypoint2) + (visible waypoint2 waypoint3) + (= (recharges) 0) + (at_rock_sample waypoint0) + (in_sun waypoint0) + (at_rock_sample waypoint1) + (in_sun waypoint1) + (at_soil_sample waypoint2) + (at_rock_sample waypoint2) + (at_lander general waypoint0) + (channel_free general) + (= (energy rover0) 50) + (at rover0 waypoint1) + (available rover0) + (store_of rover0store rover0) + (empty rover0store) + (equipped_for_soil_analysis rover0) + (equipped_for_rock_analysis rover0) + (equipped_for_imaging rover0) + (can_traverse rover0 waypoint1 waypoint0) + (can_traverse rover0 waypoint0 waypoint1) + (can_traverse rover0 waypoint1 waypoint3) + (can_traverse rover0 waypoint3 waypoint1) + (= (energy rover1) 50) + (at rover1 waypoint3) + (available rover1) + (store_of rover1store rover1) + (empty rover1store) + (equipped_for_soil_analysis rover1) + (equipped_for_rock_analysis rover1) + (equipped_for_imaging rover1) + (can_traverse rover1 waypoint3 waypoint0) + (can_traverse rover1 waypoint0 waypoint3) + (can_traverse rover1 waypoint3 waypoint2) + (can_traverse rover1 waypoint2 waypoint3) + (can_traverse rover1 waypoint0 waypoint1) + (can_traverse rover1 waypoint1 waypoint0) + (on_board camera0 rover0) + (calibration_target camera0 objective1) + (supports camera0 low_res) + (on_board camera1 rover1) + (calibration_target camera1 objective0) + (supports camera1 colour) + (supports camera1 high_res) + (supports camera1 low_res) + (visible_from objective0 waypoint0) + (visible_from objective0 waypoint1) + (visible_from objective1 waypoint0) + (visible_from objective1 waypoint1) +) + +(:goal (and +(communicated_soil_data waypoint2) +(communicated_rock_data waypoint0) +(communicated_image_data objective0 colour) + ) +) + +(:metric minimize (recharges)) +) diff --git a/tests/fixtures/pddl_files/rovers-numeric-automatic/p04.pddl b/tests/fixtures/pddl_files/rovers-numeric-automatic/p04.pddl new file mode 100644 index 00000000..29d5ca52 --- /dev/null +++ b/tests/fixtures/pddl_files/rovers-numeric-automatic/p04.pddl @@ -0,0 +1,82 @@ +(define (problem roverprob6232) (:domain Rover) +(:objects + general - Lander + colour high_res low_res - Mode + rover0 rover1 - Rover + rover0store rover1store - Store + waypoint0 waypoint1 waypoint2 waypoint3 - Waypoint + camera0 camera1 camera2 - Camera + objective0 objective1 objective2 - Objective + ) +(:init + (visible waypoint1 waypoint0) + (visible waypoint0 waypoint1) + (visible waypoint2 waypoint1) + (visible waypoint1 waypoint2) + (visible waypoint2 waypoint3) + (visible waypoint3 waypoint2) + (visible waypoint3 waypoint1) + (visible waypoint1 waypoint3) + (= (recharges) 0) + (at_rock_sample waypoint1) + (in_sun waypoint1) + (at_soil_sample waypoint2) + (in_sun waypoint2) + (at_soil_sample waypoint3) + (at_rock_sample waypoint3) + (at_lander general waypoint2) + (channel_free general) + (= (energy rover0) 50) + (at rover0 waypoint3) + (available rover0) + (store_of rover0store rover0) + (empty rover0store) + (equipped_for_soil_analysis rover0) + (equipped_for_imaging rover0) + (can_traverse rover0 waypoint3 waypoint1) + (can_traverse rover0 waypoint1 waypoint3) + (= (energy rover1) 50) + (at rover1 waypoint2) + (available rover1) + (store_of rover1store rover1) + (empty rover1store) + (equipped_for_soil_analysis rover1) + (equipped_for_rock_analysis rover1) + (equipped_for_imaging rover1) + (can_traverse rover1 waypoint2 waypoint1) + (can_traverse rover1 waypoint1 waypoint2) + (can_traverse rover1 waypoint2 waypoint3) + (can_traverse rover1 waypoint3 waypoint2) + (can_traverse rover1 waypoint1 waypoint0) + (can_traverse rover1 waypoint0 waypoint1) + (on_board camera0 rover1) + (calibration_target camera0 objective0) + (supports camera0 colour) + (supports camera0 high_res) + (on_board camera1 rover0) + (calibration_target camera1 objective0) + (supports camera1 colour) + (supports camera1 low_res) + (on_board camera2 rover0) + (calibration_target camera2 objective1) + (supports camera2 low_res) + (visible_from objective0 waypoint0) + (visible_from objective0 waypoint1) + (visible_from objective0 waypoint2) + (visible_from objective0 waypoint3) + (visible_from objective1 waypoint0) + (visible_from objective1 waypoint1) + (visible_from objective2 waypoint0) + (visible_from objective2 waypoint1) + (visible_from objective2 waypoint2) +) + +(:goal (and +(communicated_soil_data waypoint3) +(communicated_rock_data waypoint1) +(communicated_image_data objective0 high_res) + ) +) + +(:metric minimize (recharges)) +) diff --git a/tests/fixtures/pddl_files/rovers-numeric-automatic/p05.pddl b/tests/fixtures/pddl_files/rovers-numeric-automatic/p05.pddl new file mode 100644 index 00000000..67f911da --- /dev/null +++ b/tests/fixtures/pddl_files/rovers-numeric-automatic/p05.pddl @@ -0,0 +1,94 @@ +(define (problem roverprob2435) (:domain Rover) +(:objects + general - Lander + colour high_res low_res - Mode + rover0 rover1 - Rover + rover0store rover1store - Store + waypoint0 waypoint1 waypoint2 waypoint3 - Waypoint + camera0 camera1 camera2 - Camera + objective0 objective1 objective2 - Objective + ) +(:init + (visible waypoint0 waypoint2) + (visible waypoint2 waypoint0) + (visible waypoint1 waypoint0) + (visible waypoint0 waypoint1) + (visible waypoint1 waypoint3) + (visible waypoint3 waypoint1) + (visible waypoint2 waypoint1) + (visible waypoint1 waypoint2) + (visible waypoint3 waypoint0) + (visible waypoint0 waypoint3) + (visible waypoint3 waypoint2) + (visible waypoint2 waypoint3) + (= (recharges) 0) + (at_rock_sample waypoint0) + (in_sun waypoint0) + (at_soil_sample waypoint1) + (at_rock_sample waypoint1) + (at_soil_sample waypoint2) + (at_soil_sample waypoint3) + (at_lander general waypoint3) + (channel_free general) + (= (energy rover0) 50) + (at rover0 waypoint0) + (available rover0) + (store_of rover0store rover0) + (empty rover0store) + (equipped_for_rock_analysis rover0) + (equipped_for_imaging rover0) + (can_traverse rover0 waypoint0 waypoint1) + (can_traverse rover0 waypoint1 waypoint0) + (can_traverse rover0 waypoint0 waypoint3) + (can_traverse rover0 waypoint3 waypoint0) + (= (energy rover1) 50) + (at rover1 waypoint0) + (available rover1) + (store_of rover1store rover1) + (empty rover1store) + (equipped_for_soil_analysis rover1) + (equipped_for_imaging rover1) + (can_traverse rover1 waypoint0 waypoint1) + (can_traverse rover1 waypoint1 waypoint0) + (can_traverse rover1 waypoint1 waypoint2) + (can_traverse rover1 waypoint2 waypoint1) + (can_traverse rover1 waypoint1 waypoint3) + (can_traverse rover1 waypoint3 waypoint1) + (on_board camera0 rover1) + (calibration_target camera0 objective1) + (supports camera0 high_res) + (supports camera0 low_res) + (on_board camera1 rover1) + (calibration_target camera1 objective1) + (supports camera1 colour) + (supports camera1 high_res) + (on_board camera2 rover0) + (calibration_target camera2 objective1) + (supports camera2 colour) + (supports camera2 high_res) + (supports camera2 low_res) + (visible_from objective0 waypoint0) + (visible_from objective0 waypoint1) + (visible_from objective0 waypoint2) + (visible_from objective0 waypoint3) + (visible_from objective1 waypoint0) + (visible_from objective1 waypoint1) + (visible_from objective1 waypoint2) + (visible_from objective2 waypoint0) + (visible_from objective2 waypoint1) + (visible_from objective2 waypoint2) +) + +(:goal (and +(communicated_soil_data waypoint1) +(communicated_soil_data waypoint2) +(communicated_rock_data waypoint0) +(communicated_rock_data waypoint1) +(communicated_image_data objective0 high_res) +(communicated_image_data objective2 high_res) +(communicated_image_data objective0 colour) + ) +) + +(:metric minimize (recharges)) +) diff --git a/tests/fixtures/pddl_files/rovers-numeric-automatic/p06.pddl b/tests/fixtures/pddl_files/rovers-numeric-automatic/p06.pddl new file mode 100644 index 00000000..56662c9a --- /dev/null +++ b/tests/fixtures/pddl_files/rovers-numeric-automatic/p06.pddl @@ -0,0 +1,118 @@ +(define (problem roverprob2312) (:domain Rover) +(:objects + general - Lander + colour high_res low_res - Mode + rover0 rover1 - Rover + rover0store rover1store - Store + waypoint0 waypoint1 waypoint2 waypoint3 waypoint4 waypoint5 - Waypoint + camera0 camera1 camera2 - Camera + objective0 objective1 - Objective + ) +(:init + (visible waypoint0 waypoint3) + (visible waypoint3 waypoint0) + (visible waypoint1 waypoint0) + (visible waypoint0 waypoint1) + (visible waypoint1 waypoint4) + (visible waypoint4 waypoint1) + (visible waypoint2 waypoint0) + (visible waypoint0 waypoint2) + (visible waypoint2 waypoint3) + (visible waypoint3 waypoint2) + (visible waypoint3 waypoint1) + (visible waypoint1 waypoint3) + (visible waypoint3 waypoint5) + (visible waypoint5 waypoint3) + (visible waypoint4 waypoint3) + (visible waypoint3 waypoint4) + (visible waypoint5 waypoint0) + (visible waypoint0 waypoint5) + (visible waypoint5 waypoint2) + (visible waypoint2 waypoint5) + (visible waypoint5 waypoint4) + (visible waypoint4 waypoint5) + (= (recharges) 0) + (at_rock_sample waypoint0) + (at_soil_sample waypoint1) + (at_soil_sample waypoint2) + (at_rock_sample waypoint2) + (at_soil_sample waypoint3) + (at_rock_sample waypoint3) + (at_soil_sample waypoint4) + (in_sun waypoint4) + (at_soil_sample waypoint5) + (at_rock_sample waypoint5) + (at_lander general waypoint3) + (channel_free general) + (= (energy rover0) 50) + (at rover0 waypoint1) + (available rover0) + (store_of rover0store rover0) + (empty rover0store) + (equipped_for_rock_analysis rover0) + (equipped_for_imaging rover0) + (can_traverse rover0 waypoint1 waypoint0) + (can_traverse rover0 waypoint0 waypoint1) + (can_traverse rover0 waypoint1 waypoint4) + (can_traverse rover0 waypoint4 waypoint1) + (can_traverse rover0 waypoint0 waypoint2) + (can_traverse rover0 waypoint2 waypoint0) + (can_traverse rover0 waypoint0 waypoint3) + (can_traverse rover0 waypoint3 waypoint0) + (can_traverse rover0 waypoint0 waypoint5) + (can_traverse rover0 waypoint5 waypoint0) + (= (energy rover1) 50) + (at rover1 waypoint4) + (available rover1) + (store_of rover1store rover1) + (empty rover1store) + (equipped_for_soil_analysis rover1) + (equipped_for_imaging rover1) + (can_traverse rover1 waypoint4 waypoint1) + (can_traverse rover1 waypoint1 waypoint4) + (can_traverse rover1 waypoint4 waypoint3) + (can_traverse rover1 waypoint3 waypoint4) + (can_traverse rover1 waypoint4 waypoint5) + (can_traverse rover1 waypoint5 waypoint4) + (can_traverse rover1 waypoint1 waypoint0) + (can_traverse rover1 waypoint0 waypoint1) + (can_traverse rover1 waypoint5 waypoint2) + (can_traverse rover1 waypoint2 waypoint5) + (on_board camera0 rover0) + (calibration_target camera0 objective0) + (supports camera0 colour) + (supports camera0 low_res) + (on_board camera1 rover0) + (calibration_target camera1 objective1) + (supports camera1 colour) + (supports camera1 low_res) + (on_board camera2 rover1) + (calibration_target camera2 objective0) + (supports camera2 colour) + (supports camera2 high_res) + (visible_from objective0 waypoint0) + (visible_from objective0 waypoint1) + (visible_from objective0 waypoint2) + (visible_from objective0 waypoint3) + (visible_from objective0 waypoint4) + (visible_from objective0 waypoint5) + (visible_from objective1 waypoint0) + (visible_from objective1 waypoint1) +) + +(:goal (and +(communicated_soil_data waypoint5) +(communicated_soil_data waypoint1) +(communicated_soil_data waypoint4) +(communicated_soil_data waypoint2) +(communicated_rock_data waypoint0) +(communicated_rock_data waypoint2) +(communicated_rock_data waypoint3) +(communicated_image_data objective0 colour) +(communicated_image_data objective1 low_res) +(communicated_image_data objective0 low_res) + ) +) + +(:metric minimize (recharges)) +) diff --git a/tests/fixtures/pddl_files/rovers-numeric-automatic/p07.pddl b/tests/fixtures/pddl_files/rovers-numeric-automatic/p07.pddl new file mode 100644 index 00000000..9467cf24 --- /dev/null +++ b/tests/fixtures/pddl_files/rovers-numeric-automatic/p07.pddl @@ -0,0 +1,125 @@ +(define (problem roverprob4123) (:domain Rover) +(:objects + general - Lander + colour high_res low_res - Mode + rover0 rover1 rover2 - Rover + rover0store rover1store rover2store - Store + waypoint0 waypoint1 waypoint2 waypoint3 waypoint4 waypoint5 - Waypoint + camera0 camera1 - Camera + objective0 objective1 - Objective + ) +(:init + (visible waypoint0 waypoint3) + (visible waypoint3 waypoint0) + (visible waypoint0 waypoint5) + (visible waypoint5 waypoint0) + (visible waypoint1 waypoint0) + (visible waypoint0 waypoint1) + (visible waypoint2 waypoint0) + (visible waypoint0 waypoint2) + (visible waypoint2 waypoint1) + (visible waypoint1 waypoint2) + (visible waypoint2 waypoint5) + (visible waypoint5 waypoint2) + (visible waypoint3 waypoint2) + (visible waypoint2 waypoint3) + (visible waypoint4 waypoint0) + (visible waypoint0 waypoint4) + (visible waypoint4 waypoint3) + (visible waypoint3 waypoint4) + (visible waypoint5 waypoint1) + (visible waypoint1 waypoint5) + (visible waypoint5 waypoint4) + (visible waypoint4 waypoint5) + (= (recharges) 0) + (at_soil_sample waypoint1) + (at_rock_sample waypoint2) + (in_sun waypoint2) + (at_rock_sample waypoint3) + (at_soil_sample waypoint4) + (at_rock_sample waypoint4) + (at_rock_sample waypoint5) + (at_lander general waypoint3) + (channel_free general) + (= (energy rover0) 50) + (at rover0 waypoint2) + (available rover0) + (store_of rover0store rover0) + (empty rover0store) + (equipped_for_soil_analysis rover0) + (equipped_for_rock_analysis rover0) + (equipped_for_imaging rover0) + (can_traverse rover0 waypoint2 waypoint0) + (can_traverse rover0 waypoint0 waypoint2) + (can_traverse rover0 waypoint2 waypoint1) + (can_traverse rover0 waypoint1 waypoint2) + (can_traverse rover0 waypoint2 waypoint3) + (can_traverse rover0 waypoint3 waypoint2) + (can_traverse rover0 waypoint2 waypoint5) + (can_traverse rover0 waypoint5 waypoint2) + (can_traverse rover0 waypoint0 waypoint4) + (can_traverse rover0 waypoint4 waypoint0) + (= (energy rover1) 50) + (at rover1 waypoint3) + (available rover1) + (store_of rover1store rover1) + (empty rover1store) + (equipped_for_rock_analysis rover1) + (can_traverse rover1 waypoint3 waypoint0) + (can_traverse rover1 waypoint0 waypoint3) + (can_traverse rover1 waypoint3 waypoint2) + (can_traverse rover1 waypoint2 waypoint3) + (can_traverse rover1 waypoint3 waypoint4) + (can_traverse rover1 waypoint4 waypoint3) + (can_traverse rover1 waypoint0 waypoint1) + (can_traverse rover1 waypoint1 waypoint0) + (can_traverse rover1 waypoint0 waypoint5) + (can_traverse rover1 waypoint5 waypoint0) + (= (energy rover2) 50) + (at rover2 waypoint4) + (available rover2) + (store_of rover2store rover2) + (empty rover2store) + (equipped_for_soil_analysis rover2) + (equipped_for_rock_analysis rover2) + (equipped_for_imaging rover2) + (can_traverse rover2 waypoint4 waypoint0) + (can_traverse rover2 waypoint0 waypoint4) + (can_traverse rover2 waypoint4 waypoint5) + (can_traverse rover2 waypoint5 waypoint4) + (can_traverse rover2 waypoint0 waypoint1) + (can_traverse rover2 waypoint1 waypoint0) + (can_traverse rover2 waypoint0 waypoint3) + (can_traverse rover2 waypoint3 waypoint0) + (can_traverse rover2 waypoint5 waypoint2) + (can_traverse rover2 waypoint2 waypoint5) + (on_board camera0 rover0) + (calibration_target camera0 objective0) + (supports camera0 colour) + (supports camera0 high_res) + (on_board camera1 rover2) + (calibration_target camera1 objective1) + (supports camera1 high_res) + (visible_from objective0 waypoint0) + (visible_from objective0 waypoint1) + (visible_from objective0 waypoint2) + (visible_from objective0 waypoint3) + (visible_from objective0 waypoint4) + (visible_from objective1 waypoint0) + (visible_from objective1 waypoint1) + (visible_from objective1 waypoint2) + (visible_from objective1 waypoint3) +) + +(:goal (and +(communicated_soil_data waypoint4) +(communicated_soil_data waypoint1) +(communicated_rock_data waypoint3) +(communicated_rock_data waypoint2) +(communicated_rock_data waypoint4) +(communicated_image_data objective0 high_res) + ) +) + +(:metric minimize (recharges)) +) diff --git a/tests/fixtures/pddl_files/rovers-numeric-automatic/p08.pddl b/tests/fixtures/pddl_files/rovers-numeric-automatic/p08.pddl new file mode 100644 index 00000000..a908d744 --- /dev/null +++ b/tests/fixtures/pddl_files/rovers-numeric-automatic/p08.pddl @@ -0,0 +1,160 @@ +(define (problem roverprob1423) (:domain Rover) +(:objects + general - Lander + colour high_res low_res - Mode + rover0 rover1 rover2 rover3 - Rover + rover0store rover1store rover2store rover3store - Store + waypoint0 waypoint1 waypoint2 waypoint3 waypoint4 waypoint5 - Waypoint + camera0 camera1 camera2 camera3 - Camera + objective0 objective1 objective2 - Objective + ) +(:init + (visible waypoint0 waypoint1) + (visible waypoint1 waypoint0) + (visible waypoint0 waypoint3) + (visible waypoint3 waypoint0) + (visible waypoint1 waypoint5) + (visible waypoint5 waypoint1) + (visible waypoint2 waypoint0) + (visible waypoint0 waypoint2) + (visible waypoint2 waypoint1) + (visible waypoint1 waypoint2) + (visible waypoint2 waypoint3) + (visible waypoint3 waypoint2) + (visible waypoint2 waypoint4) + (visible waypoint4 waypoint2) + (visible waypoint3 waypoint4) + (visible waypoint4 waypoint3) + (visible waypoint3 waypoint5) + (visible waypoint5 waypoint3) + (visible waypoint4 waypoint0) + (visible waypoint0 waypoint4) + (visible waypoint4 waypoint1) + (visible waypoint1 waypoint4) + (visible waypoint5 waypoint2) + (visible waypoint2 waypoint5) + (visible waypoint5 waypoint4) + (visible waypoint4 waypoint5) + (= (recharges) 0) + (in_sun waypoint0) + (at_soil_sample waypoint1) + (at_rock_sample waypoint2) + (at_soil_sample waypoint3) + (at_rock_sample waypoint3) + (in_sun waypoint3) + (at_soil_sample waypoint4) + (at_rock_sample waypoint4) + (in_sun waypoint4) + (at_rock_sample waypoint5) + (at_lander general waypoint0) + (channel_free general) + (= (energy rover0) 50) + (at rover0 waypoint2) + (available rover0) + (store_of rover0store rover0) + (empty rover0store) + (equipped_for_soil_analysis rover0) + (equipped_for_rock_analysis rover0) + (can_traverse rover0 waypoint2 waypoint0) + (can_traverse rover0 waypoint0 waypoint2) + (can_traverse rover0 waypoint2 waypoint3) + (can_traverse rover0 waypoint3 waypoint2) + (can_traverse rover0 waypoint2 waypoint4) + (can_traverse rover0 waypoint4 waypoint2) + (can_traverse rover0 waypoint0 waypoint1) + (can_traverse rover0 waypoint1 waypoint0) + (can_traverse rover0 waypoint3 waypoint5) + (can_traverse rover0 waypoint5 waypoint3) + (= (energy rover1) 50) + (at rover1 waypoint2) + (available rover1) + (store_of rover1store rover1) + (empty rover1store) + (equipped_for_rock_analysis rover1) + (equipped_for_imaging rover1) + (can_traverse rover1 waypoint2 waypoint0) + (can_traverse rover1 waypoint0 waypoint2) + (can_traverse rover1 waypoint2 waypoint3) + (can_traverse rover1 waypoint3 waypoint2) + (can_traverse rover1 waypoint2 waypoint5) + (can_traverse rover1 waypoint5 waypoint2) + (can_traverse rover1 waypoint0 waypoint1) + (can_traverse rover1 waypoint1 waypoint0) + (can_traverse rover1 waypoint3 waypoint4) + (can_traverse rover1 waypoint4 waypoint3) + (= (energy rover2) 50) + (at rover2 waypoint2) + (available rover2) + (store_of rover2store rover2) + (empty rover2store) + (equipped_for_rock_analysis rover2) + (equipped_for_imaging rover2) + (can_traverse rover2 waypoint2 waypoint0) + (can_traverse rover2 waypoint0 waypoint2) + (can_traverse rover2 waypoint2 waypoint1) + (can_traverse rover2 waypoint1 waypoint2) + (can_traverse rover2 waypoint2 waypoint4) + (can_traverse rover2 waypoint4 waypoint2) + (can_traverse rover2 waypoint2 waypoint5) + (can_traverse rover2 waypoint5 waypoint2) + (can_traverse rover2 waypoint0 waypoint3) + (can_traverse rover2 waypoint3 waypoint0) + (= (energy rover3) 50) + (at rover3 waypoint3) + (available rover3) + (store_of rover3store rover3) + (empty rover3store) + (equipped_for_soil_analysis rover3) + (equipped_for_rock_analysis rover3) + (equipped_for_imaging rover3) + (can_traverse rover3 waypoint3 waypoint0) + (can_traverse rover3 waypoint0 waypoint3) + (can_traverse rover3 waypoint3 waypoint2) + (can_traverse rover3 waypoint2 waypoint3) + (can_traverse rover3 waypoint3 waypoint4) + (can_traverse rover3 waypoint4 waypoint3) + (can_traverse rover3 waypoint0 waypoint1) + (can_traverse rover3 waypoint1 waypoint0) + (can_traverse rover3 waypoint2 waypoint5) + (can_traverse rover3 waypoint5 waypoint2) + (on_board camera0 rover3) + (calibration_target camera0 objective1) + (supports camera0 colour) + (supports camera0 high_res) + (supports camera0 low_res) + (on_board camera1 rover3) + (calibration_target camera1 objective0) + (supports camera1 colour) + (supports camera1 high_res) + (on_board camera2 rover1) + (calibration_target camera2 objective0) + (supports camera2 colour) + (supports camera2 high_res) + (supports camera2 low_res) + (on_board camera3 rover2) + (calibration_target camera3 objective1) + (supports camera3 colour) + (supports camera3 low_res) + (visible_from objective0 waypoint0) + (visible_from objective0 waypoint1) + (visible_from objective0 waypoint2) + (visible_from objective1 waypoint0) + (visible_from objective2 waypoint0) + (visible_from objective2 waypoint1) + (visible_from objective2 waypoint2) +) + +(:goal (and +(communicated_soil_data waypoint1) +(communicated_soil_data waypoint3) +(communicated_soil_data waypoint4) +(communicated_rock_data waypoint5) +(communicated_rock_data waypoint4) +(communicated_image_data objective0 low_res) +(communicated_image_data objective0 high_res) +(communicated_image_data objective2 low_res) + ) +) + +(:metric minimize (recharges)) +) diff --git a/tests/fixtures/pddl_files/rovers-numeric-automatic/p09.pddl b/tests/fixtures/pddl_files/rovers-numeric-automatic/p09.pddl new file mode 100644 index 00000000..ee92f754 --- /dev/null +++ b/tests/fixtures/pddl_files/rovers-numeric-automatic/p09.pddl @@ -0,0 +1,183 @@ +(define (problem roverprob4132) (:domain Rover) +(:objects + general - Lander + colour high_res low_res - Mode + rover0 rover1 rover2 rover3 - Rover + rover0store rover1store rover2store rover3store - Store + waypoint0 waypoint1 waypoint2 waypoint3 waypoint4 waypoint5 waypoint6 - Waypoint + camera0 camera1 camera2 camera3 camera4 - Camera + objective0 objective1 objective2 - Objective + ) +(:init + (visible waypoint0 waypoint5) + (visible waypoint5 waypoint0) + (visible waypoint0 waypoint6) + (visible waypoint6 waypoint0) + (visible waypoint1 waypoint0) + (visible waypoint0 waypoint1) + (visible waypoint1 waypoint2) + (visible waypoint2 waypoint1) + (visible waypoint1 waypoint4) + (visible waypoint4 waypoint1) + (visible waypoint1 waypoint6) + (visible waypoint6 waypoint1) + (visible waypoint2 waypoint0) + (visible waypoint0 waypoint2) + (visible waypoint2 waypoint5) + (visible waypoint5 waypoint2) + (visible waypoint2 waypoint6) + (visible waypoint6 waypoint2) + (visible waypoint3 waypoint0) + (visible waypoint0 waypoint3) + (visible waypoint3 waypoint1) + (visible waypoint1 waypoint3) + (visible waypoint4 waypoint3) + (visible waypoint3 waypoint4) + (visible waypoint4 waypoint6) + (visible waypoint6 waypoint4) + (visible waypoint5 waypoint1) + (visible waypoint1 waypoint5) + (visible waypoint6 waypoint3) + (visible waypoint3 waypoint6) + (visible waypoint6 waypoint5) + (visible waypoint5 waypoint6) + (= (recharges) 0) + (at_soil_sample waypoint0) + (at_rock_sample waypoint0) + (at_soil_sample waypoint1) + (at_rock_sample waypoint1) + (at_rock_sample waypoint3) + (at_soil_sample waypoint4) + (at_soil_sample waypoint5) + (at_rock_sample waypoint5) + (in_sun waypoint5) + (at_soil_sample waypoint6) + (at_rock_sample waypoint6) + (at_lander general waypoint4) + (channel_free general) + (= (energy rover0) 50) + (at rover0 waypoint5) + (available rover0) + (store_of rover0store rover0) + (empty rover0store) + (equipped_for_imaging rover0) + (can_traverse rover0 waypoint5 waypoint0) + (can_traverse rover0 waypoint0 waypoint5) + (can_traverse rover0 waypoint5 waypoint1) + (can_traverse rover0 waypoint1 waypoint5) + (can_traverse rover0 waypoint5 waypoint2) + (can_traverse rover0 waypoint2 waypoint5) + (can_traverse rover0 waypoint5 waypoint6) + (can_traverse rover0 waypoint6 waypoint5) + (can_traverse rover0 waypoint1 waypoint3) + (can_traverse rover0 waypoint3 waypoint1) + (can_traverse rover0 waypoint1 waypoint4) + (can_traverse rover0 waypoint4 waypoint1) + (= (energy rover1) 50) + (at rover1 waypoint2) + (available rover1) + (store_of rover1store rover1) + (empty rover1store) + (equipped_for_rock_analysis rover1) + (equipped_for_imaging rover1) + (can_traverse rover1 waypoint2 waypoint0) + (can_traverse rover1 waypoint0 waypoint2) + (can_traverse rover1 waypoint2 waypoint1) + (can_traverse rover1 waypoint1 waypoint2) + (can_traverse rover1 waypoint2 waypoint5) + (can_traverse rover1 waypoint5 waypoint2) + (can_traverse rover1 waypoint2 waypoint6) + (can_traverse rover1 waypoint6 waypoint2) + (can_traverse rover1 waypoint1 waypoint3) + (can_traverse rover1 waypoint3 waypoint1) + (can_traverse rover1 waypoint1 waypoint4) + (can_traverse rover1 waypoint4 waypoint1) + (= (energy rover2) 50) + (at rover2 waypoint0) + (available rover2) + (store_of rover2store rover2) + (empty rover2store) + (equipped_for_soil_analysis rover2) + (equipped_for_imaging rover2) + (can_traverse rover2 waypoint0 waypoint1) + (can_traverse rover2 waypoint1 waypoint0) + (can_traverse rover2 waypoint0 waypoint3) + (can_traverse rover2 waypoint3 waypoint0) + (can_traverse rover2 waypoint0 waypoint6) + (can_traverse rover2 waypoint6 waypoint0) + (can_traverse rover2 waypoint1 waypoint2) + (can_traverse rover2 waypoint2 waypoint1) + (can_traverse rover2 waypoint1 waypoint5) + (can_traverse rover2 waypoint5 waypoint1) + (can_traverse rover2 waypoint3 waypoint4) + (can_traverse rover2 waypoint4 waypoint3) + (= (energy rover3) 50) + (at rover3 waypoint2) + (available rover3) + (store_of rover3store rover3) + (empty rover3store) + (equipped_for_soil_analysis rover3) + (equipped_for_imaging rover3) + (can_traverse rover3 waypoint2 waypoint0) + (can_traverse rover3 waypoint0 waypoint2) + (can_traverse rover3 waypoint2 waypoint1) + (can_traverse rover3 waypoint1 waypoint2) + (can_traverse rover3 waypoint2 waypoint6) + (can_traverse rover3 waypoint6 waypoint2) + (can_traverse rover3 waypoint0 waypoint3) + (can_traverse rover3 waypoint3 waypoint0) + (can_traverse rover3 waypoint0 waypoint5) + (can_traverse rover3 waypoint5 waypoint0) + (can_traverse rover3 waypoint1 waypoint4) + (can_traverse rover3 waypoint4 waypoint1) + (on_board camera0 rover3) + (calibration_target camera0 objective2) + (supports camera0 colour) + (supports camera0 low_res) + (on_board camera1 rover0) + (calibration_target camera1 objective2) + (supports camera1 colour) + (on_board camera2 rover0) + (calibration_target camera2 objective0) + (supports camera2 low_res) + (on_board camera3 rover2) + (calibration_target camera3 objective0) + (supports camera3 colour) + (supports camera3 high_res) + (supports camera3 low_res) + (on_board camera4 rover1) + (calibration_target camera4 objective1) + (supports camera4 colour) + (supports camera4 low_res) + (visible_from objective0 waypoint0) + (visible_from objective0 waypoint1) + (visible_from objective0 waypoint2) + (visible_from objective1 waypoint0) + (visible_from objective1 waypoint1) + (visible_from objective1 waypoint2) + (visible_from objective1 waypoint3) + (visible_from objective1 waypoint4) + (visible_from objective1 waypoint5) + (visible_from objective2 waypoint0) + (visible_from objective2 waypoint1) + (visible_from objective2 waypoint2) + (visible_from objective2 waypoint3) + (visible_from objective2 waypoint4) + (visible_from objective2 waypoint5) + (visible_from objective2 waypoint6) +) + +(:goal (and +(communicated_soil_data waypoint6) +(communicated_soil_data waypoint4) +(communicated_soil_data waypoint0) +(communicated_rock_data waypoint6) +(communicated_rock_data waypoint0) +(communicated_rock_data waypoint3) +(communicated_image_data objective2 low_res) +(communicated_image_data objective2 colour) + ) +) + +(:metric minimize (recharges)) +) diff --git a/tests/fixtures/pddl_files/rovers-numeric-automatic/p10.pddl b/tests/fixtures/pddl_files/rovers-numeric-automatic/p10.pddl new file mode 100644 index 00000000..4472b717 --- /dev/null +++ b/tests/fixtures/pddl_files/rovers-numeric-automatic/p10.pddl @@ -0,0 +1,178 @@ +(define (problem roverprob8271) (:domain Rover) +(:objects + general - Lander + colour high_res low_res - Mode + rover0 rover1 rover2 rover3 - Rover + rover0store rover1store rover2store rover3store - Store + waypoint0 waypoint1 waypoint2 waypoint3 waypoint4 waypoint5 waypoint6 - Waypoint + camera0 camera1 camera2 camera3 camera4 camera5 - Camera + objective0 objective1 objective2 objective3 - Objective + ) +(:init + (visible waypoint0 waypoint6) + (visible waypoint6 waypoint0) + (visible waypoint1 waypoint0) + (visible waypoint0 waypoint1) + (visible waypoint1 waypoint2) + (visible waypoint2 waypoint1) + (visible waypoint1 waypoint5) + (visible waypoint5 waypoint1) + (visible waypoint2 waypoint0) + (visible waypoint0 waypoint2) + (visible waypoint2 waypoint4) + (visible waypoint4 waypoint2) + (visible waypoint2 waypoint6) + (visible waypoint6 waypoint2) + (visible waypoint3 waypoint5) + (visible waypoint5 waypoint3) + (visible waypoint4 waypoint0) + (visible waypoint0 waypoint4) + (visible waypoint4 waypoint1) + (visible waypoint1 waypoint4) + (visible waypoint4 waypoint3) + (visible waypoint3 waypoint4) + (visible waypoint5 waypoint0) + (visible waypoint0 waypoint5) + (visible waypoint5 waypoint6) + (visible waypoint6 waypoint5) + (visible waypoint6 waypoint4) + (visible waypoint4 waypoint6) + (= (recharges) 0) + (at_soil_sample waypoint0) + (at_rock_sample waypoint0) + (at_rock_sample waypoint1) + (at_soil_sample waypoint3) + (at_rock_sample waypoint3) + (at_soil_sample waypoint4) + (at_rock_sample waypoint4) + (in_sun waypoint4) + (at_soil_sample waypoint6) + (at_rock_sample waypoint6) + (in_sun waypoint6) + (at_lander general waypoint1) + (channel_free general) + (= (energy rover0) 50) + (at rover0 waypoint4) + (available rover0) + (store_of rover0store rover0) + (empty rover0store) + (equipped_for_soil_analysis rover0) + (equipped_for_rock_analysis rover0) + (can_traverse rover0 waypoint4 waypoint0) + (can_traverse rover0 waypoint0 waypoint4) + (can_traverse rover0 waypoint4 waypoint1) + (can_traverse rover0 waypoint1 waypoint4) + (can_traverse rover0 waypoint4 waypoint2) + (can_traverse rover0 waypoint2 waypoint4) + (can_traverse rover0 waypoint4 waypoint3) + (can_traverse rover0 waypoint3 waypoint4) + (can_traverse rover0 waypoint4 waypoint6) + (can_traverse rover0 waypoint6 waypoint4) + (can_traverse rover0 waypoint1 waypoint5) + (can_traverse rover0 waypoint5 waypoint1) + (= (energy rover1) 50) + (at rover1 waypoint0) + (available rover1) + (store_of rover1store rover1) + (empty rover1store) + (equipped_for_soil_analysis rover1) + (equipped_for_imaging rover1) + (can_traverse rover1 waypoint0 waypoint1) + (can_traverse rover1 waypoint1 waypoint0) + (can_traverse rover1 waypoint0 waypoint2) + (can_traverse rover1 waypoint2 waypoint0) + (can_traverse rover1 waypoint0 waypoint6) + (can_traverse rover1 waypoint6 waypoint0) + (= (energy rover2) 50) + (at rover2 waypoint3) + (available rover2) + (store_of rover2store rover2) + (empty rover2store) + (equipped_for_rock_analysis rover2) + (equipped_for_imaging rover2) + (can_traverse rover2 waypoint3 waypoint4) + (can_traverse rover2 waypoint4 waypoint3) + (can_traverse rover2 waypoint3 waypoint5) + (can_traverse rover2 waypoint5 waypoint3) + (can_traverse rover2 waypoint4 waypoint0) + (can_traverse rover2 waypoint0 waypoint4) + (can_traverse rover2 waypoint4 waypoint1) + (can_traverse rover2 waypoint1 waypoint4) + (can_traverse rover2 waypoint4 waypoint2) + (can_traverse rover2 waypoint2 waypoint4) + (= (energy rover3) 50) + (at rover3 waypoint1) + (available rover3) + (store_of rover3store rover3) + (empty rover3store) + (equipped_for_soil_analysis rover3) + (equipped_for_rock_analysis rover3) + (equipped_for_imaging rover3) + (can_traverse rover3 waypoint1 waypoint0) + (can_traverse rover3 waypoint0 waypoint1) + (can_traverse rover3 waypoint0 waypoint2) + (can_traverse rover3 waypoint2 waypoint0) + (can_traverse rover3 waypoint0 waypoint4) + (can_traverse rover3 waypoint4 waypoint0) + (can_traverse rover3 waypoint0 waypoint6) + (can_traverse rover3 waypoint6 waypoint0) + (can_traverse rover3 waypoint4 waypoint3) + (can_traverse rover3 waypoint3 waypoint4) + (can_traverse rover3 waypoint6 waypoint5) + (can_traverse rover3 waypoint5 waypoint6) + (on_board camera0 rover1) + (calibration_target camera0 objective2) + (supports camera0 low_res) + (on_board camera1 rover1) + (calibration_target camera1 objective3) + (supports camera1 colour) + (on_board camera2 rover1) + (calibration_target camera2 objective1) + (supports camera2 colour) + (supports camera2 low_res) + (on_board camera3 rover1) + (calibration_target camera3 objective2) + (supports camera3 high_res) + (supports camera3 low_res) + (on_board camera4 rover2) + (calibration_target camera4 objective0) + (supports camera4 colour) + (on_board camera5 rover3) + (calibration_target camera5 objective0) + (supports camera5 colour) + (supports camera5 high_res) + (supports camera5 low_res) + (visible_from objective0 waypoint0) + (visible_from objective1 waypoint0) + (visible_from objective1 waypoint1) + (visible_from objective1 waypoint2) + (visible_from objective1 waypoint3) + (visible_from objective2 waypoint0) + (visible_from objective2 waypoint1) + (visible_from objective2 waypoint2) + (visible_from objective2 waypoint3) + (visible_from objective3 waypoint0) + (visible_from objective3 waypoint1) + (visible_from objective3 waypoint2) + (visible_from objective3 waypoint3) + (visible_from objective3 waypoint4) + (visible_from objective3 waypoint5) +) + +(:goal (and +(communicated_soil_data waypoint6) +(communicated_soil_data waypoint0) +(communicated_soil_data waypoint3) +(communicated_soil_data waypoint4) +(communicated_rock_data waypoint4) +(communicated_rock_data waypoint3) +(communicated_rock_data waypoint0) +(communicated_rock_data waypoint1) +(communicated_image_data objective3 colour) +(communicated_image_data objective2 colour) +(communicated_image_data objective3 low_res) + ) +) + +(:metric minimize (recharges)) +) diff --git a/tests/fixtures/pddl_files/rovers-numeric-automatic/p11.pddl b/tests/fixtures/pddl_files/rovers-numeric-automatic/p11.pddl new file mode 100644 index 00000000..7322c012 --- /dev/null +++ b/tests/fixtures/pddl_files/rovers-numeric-automatic/p11.pddl @@ -0,0 +1,202 @@ +(define (problem roverprob7126) (:domain Rover) +(:objects + general - Lander + colour high_res low_res - Mode + rover0 rover1 rover2 rover3 - Rover + rover0store rover1store rover2store rover3store - Store + waypoint0 waypoint1 waypoint2 waypoint3 waypoint4 waypoint5 waypoint6 waypoint7 - Waypoint + camera0 camera1 camera2 camera3 - Camera + objective0 objective1 objective2 - Objective + ) +(:init + (visible waypoint0 waypoint4) + (visible waypoint4 waypoint0) + (visible waypoint0 waypoint7) + (visible waypoint7 waypoint0) + (visible waypoint1 waypoint0) + (visible waypoint0 waypoint1) + (visible waypoint1 waypoint5) + (visible waypoint5 waypoint1) + (visible waypoint1 waypoint7) + (visible waypoint7 waypoint1) + (visible waypoint2 waypoint1) + (visible waypoint1 waypoint2) + (visible waypoint3 waypoint0) + (visible waypoint0 waypoint3) + (visible waypoint3 waypoint1) + (visible waypoint1 waypoint3) + (visible waypoint3 waypoint2) + (visible waypoint2 waypoint3) + (visible waypoint3 waypoint6) + (visible waypoint6 waypoint3) + (visible waypoint4 waypoint1) + (visible waypoint1 waypoint4) + (visible waypoint4 waypoint5) + (visible waypoint5 waypoint4) + (visible waypoint5 waypoint2) + (visible waypoint2 waypoint5) + (visible waypoint5 waypoint3) + (visible waypoint3 waypoint5) + (visible waypoint5 waypoint6) + (visible waypoint6 waypoint5) + (visible waypoint6 waypoint0) + (visible waypoint0 waypoint6) + (visible waypoint6 waypoint2) + (visible waypoint2 waypoint6) + (visible waypoint6 waypoint4) + (visible waypoint4 waypoint6) + (visible waypoint7 waypoint2) + (visible waypoint2 waypoint7) + (visible waypoint7 waypoint3) + (visible waypoint3 waypoint7) + (visible waypoint7 waypoint5) + (visible waypoint5 waypoint7) + (= (recharges) 0) + (at_soil_sample waypoint0) + (at_rock_sample waypoint0) + (in_sun waypoint0) + (at_soil_sample waypoint1) + (at_rock_sample waypoint1) + (at_rock_sample waypoint2) + (at_soil_sample waypoint3) + (at_rock_sample waypoint4) + (in_sun waypoint5) + (at_soil_sample waypoint6) + (at_rock_sample waypoint6) + (in_sun waypoint6) + (at_rock_sample waypoint7) + (in_sun waypoint7) + (at_lander general waypoint1) + (channel_free general) + (= (energy rover0) 50) + (at rover0 waypoint1) + (available rover0) + (store_of rover0store rover0) + (empty rover0store) + (equipped_for_soil_analysis rover0) + (equipped_for_imaging rover0) + (can_traverse rover0 waypoint1 waypoint0) + (can_traverse rover0 waypoint0 waypoint1) + (can_traverse rover0 waypoint1 waypoint3) + (can_traverse rover0 waypoint3 waypoint1) + (can_traverse rover0 waypoint1 waypoint4) + (can_traverse rover0 waypoint4 waypoint1) + (can_traverse rover0 waypoint1 waypoint5) + (can_traverse rover0 waypoint5 waypoint1) + (can_traverse rover0 waypoint0 waypoint6) + (can_traverse rover0 waypoint6 waypoint0) + (can_traverse rover0 waypoint0 waypoint7) + (can_traverse rover0 waypoint7 waypoint0) + (can_traverse rover0 waypoint3 waypoint2) + (can_traverse rover0 waypoint2 waypoint3) + (= (energy rover1) 50) + (at rover1 waypoint3) + (available rover1) + (store_of rover1store rover1) + (empty rover1store) + (equipped_for_soil_analysis rover1) + (equipped_for_rock_analysis rover1) + (equipped_for_imaging rover1) + (can_traverse rover1 waypoint3 waypoint0) + (can_traverse rover1 waypoint0 waypoint3) + (can_traverse rover1 waypoint3 waypoint7) + (can_traverse rover1 waypoint7 waypoint3) + (can_traverse rover1 waypoint0 waypoint6) + (can_traverse rover1 waypoint6 waypoint0) + (can_traverse rover1 waypoint7 waypoint1) + (can_traverse rover1 waypoint1 waypoint7) + (can_traverse rover1 waypoint7 waypoint2) + (can_traverse rover1 waypoint2 waypoint7) + (can_traverse rover1 waypoint6 waypoint4) + (can_traverse rover1 waypoint4 waypoint6) + (can_traverse rover1 waypoint6 waypoint5) + (can_traverse rover1 waypoint5 waypoint6) + (= (energy rover2) 50) + (at rover2 waypoint3) + (available rover2) + (store_of rover2store rover2) + (empty rover2store) + (equipped_for_soil_analysis rover2) + (equipped_for_imaging rover2) + (can_traverse rover2 waypoint3 waypoint0) + (can_traverse rover2 waypoint0 waypoint3) + (can_traverse rover2 waypoint3 waypoint1) + (can_traverse rover2 waypoint1 waypoint3) + (can_traverse rover2 waypoint3 waypoint2) + (can_traverse rover2 waypoint2 waypoint3) + (can_traverse rover2 waypoint3 waypoint5) + (can_traverse rover2 waypoint5 waypoint3) + (can_traverse rover2 waypoint3 waypoint6) + (can_traverse rover2 waypoint6 waypoint3) + (can_traverse rover2 waypoint3 waypoint7) + (can_traverse rover2 waypoint7 waypoint3) + (can_traverse rover2 waypoint0 waypoint4) + (can_traverse rover2 waypoint4 waypoint0) + (= (energy rover3) 50) + (at rover3 waypoint7) + (available rover3) + (store_of rover3store rover3) + (empty rover3store) + (equipped_for_soil_analysis rover3) + (equipped_for_imaging rover3) + (can_traverse rover3 waypoint7 waypoint0) + (can_traverse rover3 waypoint0 waypoint7) + (can_traverse rover3 waypoint7 waypoint1) + (can_traverse rover3 waypoint1 waypoint7) + (can_traverse rover3 waypoint7 waypoint3) + (can_traverse rover3 waypoint3 waypoint7) + (can_traverse rover3 waypoint7 waypoint5) + (can_traverse rover3 waypoint5 waypoint7) + (can_traverse rover3 waypoint0 waypoint4) + (can_traverse rover3 waypoint4 waypoint0) + (can_traverse rover3 waypoint1 waypoint2) + (can_traverse rover3 waypoint2 waypoint1) + (can_traverse rover3 waypoint3 waypoint6) + (can_traverse rover3 waypoint6 waypoint3) + (on_board camera0 rover1) + (calibration_target camera0 objective1) + (supports camera0 high_res) + (supports camera0 low_res) + (on_board camera1 rover2) + (calibration_target camera1 objective0) + (supports camera1 colour) + (supports camera1 high_res) + (on_board camera2 rover3) + (calibration_target camera2 objective0) + (supports camera2 high_res) + (on_board camera3 rover0) + (calibration_target camera3 objective1) + (supports camera3 colour) + (visible_from objective0 waypoint0) + (visible_from objective0 waypoint1) + (visible_from objective0 waypoint2) + (visible_from objective0 waypoint3) + (visible_from objective0 waypoint4) + (visible_from objective0 waypoint5) + (visible_from objective1 waypoint0) + (visible_from objective1 waypoint1) + (visible_from objective1 waypoint2) + (visible_from objective2 waypoint0) + (visible_from objective2 waypoint1) + (visible_from objective2 waypoint2) + (visible_from objective2 waypoint3) + (visible_from objective2 waypoint4) + (visible_from objective2 waypoint5) + (visible_from objective2 waypoint6) +) + +(:goal (and +(communicated_soil_data waypoint6) +(communicated_soil_data waypoint0) +(communicated_soil_data waypoint1) +(communicated_soil_data waypoint3) +(communicated_rock_data waypoint6) +(communicated_rock_data waypoint0) +(communicated_rock_data waypoint4) +(communicated_rock_data waypoint7) +(communicated_image_data objective1 high_res) + ) +) + +(:metric minimize (recharges)) +) diff --git a/tests/fixtures/pddl_files/rovers-numeric-automatic/p12.pddl b/tests/fixtures/pddl_files/rovers-numeric-automatic/p12.pddl new file mode 100644 index 00000000..354bea6c --- /dev/null +++ b/tests/fixtures/pddl_files/rovers-numeric-automatic/p12.pddl @@ -0,0 +1,191 @@ +(define (problem roverprob5146) (:domain Rover) +(:objects + general - Lander + colour high_res low_res - Mode + rover0 rover1 rover2 rover3 - Rover + rover0store rover1store rover2store rover3store - Store + waypoint0 waypoint1 waypoint2 waypoint3 waypoint4 waypoint5 waypoint6 waypoint7 - Waypoint + camera0 camera1 camera2 camera3 - Camera + objective0 objective1 objective2 objective3 - Objective + ) +(:init + (visible waypoint0 waypoint1) + (visible waypoint1 waypoint0) + (visible waypoint0 waypoint3) + (visible waypoint3 waypoint0) + (visible waypoint0 waypoint5) + (visible waypoint5 waypoint0) + (visible waypoint0 waypoint6) + (visible waypoint6 waypoint0) + (visible waypoint0 waypoint7) + (visible waypoint7 waypoint0) + (visible waypoint1 waypoint5) + (visible waypoint5 waypoint1) + (visible waypoint1 waypoint7) + (visible waypoint7 waypoint1) + (visible waypoint2 waypoint0) + (visible waypoint0 waypoint2) + (visible waypoint2 waypoint5) + (visible waypoint5 waypoint2) + (visible waypoint3 waypoint2) + (visible waypoint2 waypoint3) + (visible waypoint3 waypoint7) + (visible waypoint7 waypoint3) + (visible waypoint4 waypoint2) + (visible waypoint2 waypoint4) + (visible waypoint4 waypoint5) + (visible waypoint5 waypoint4) + (visible waypoint4 waypoint6) + (visible waypoint6 waypoint4) + (visible waypoint5 waypoint3) + (visible waypoint3 waypoint5) + (visible waypoint6 waypoint5) + (visible waypoint5 waypoint6) + (visible waypoint6 waypoint7) + (visible waypoint7 waypoint6) + (visible waypoint7 waypoint2) + (visible waypoint2 waypoint7) + (visible waypoint7 waypoint4) + (visible waypoint4 waypoint7) + (visible waypoint7 waypoint5) + (visible waypoint5 waypoint7) + (= (recharges) 0) + (at_soil_sample waypoint0) + (at_rock_sample waypoint0) + (in_sun waypoint0) + (at_rock_sample waypoint2) + (at_rock_sample waypoint3) + (at_rock_sample waypoint5) + (at_rock_sample waypoint6) + (in_sun waypoint6) + (at_rock_sample waypoint7) + (at_lander general waypoint2) + (channel_free general) + (= (energy rover0) 50) + (at rover0 waypoint4) + (available rover0) + (store_of rover0store rover0) + (empty rover0store) + (equipped_for_imaging rover0) + (can_traverse rover0 waypoint4 waypoint2) + (can_traverse rover0 waypoint2 waypoint4) + (can_traverse rover0 waypoint4 waypoint5) + (can_traverse rover0 waypoint5 waypoint4) + (can_traverse rover0 waypoint2 waypoint3) + (can_traverse rover0 waypoint3 waypoint2) + (can_traverse rover0 waypoint2 waypoint7) + (can_traverse rover0 waypoint7 waypoint2) + (can_traverse rover0 waypoint5 waypoint0) + (can_traverse rover0 waypoint0 waypoint5) + (can_traverse rover0 waypoint5 waypoint1) + (can_traverse rover0 waypoint1 waypoint5) + (can_traverse rover0 waypoint5 waypoint6) + (can_traverse rover0 waypoint6 waypoint5) + (= (energy rover1) 50) + (at rover1 waypoint4) + (available rover1) + (store_of rover1store rover1) + (empty rover1store) + (equipped_for_soil_analysis rover1) + (equipped_for_rock_analysis rover1) + (can_traverse rover1 waypoint4 waypoint2) + (can_traverse rover1 waypoint2 waypoint4) + (can_traverse rover1 waypoint4 waypoint5) + (can_traverse rover1 waypoint5 waypoint4) + (can_traverse rover1 waypoint4 waypoint6) + (can_traverse rover1 waypoint6 waypoint4) + (can_traverse rover1 waypoint2 waypoint0) + (can_traverse rover1 waypoint0 waypoint2) + (can_traverse rover1 waypoint2 waypoint3) + (can_traverse rover1 waypoint3 waypoint2) + (can_traverse rover1 waypoint2 waypoint7) + (can_traverse rover1 waypoint7 waypoint2) + (can_traverse rover1 waypoint5 waypoint1) + (can_traverse rover1 waypoint1 waypoint5) + (= (energy rover2) 50) + (at rover2 waypoint7) + (available rover2) + (store_of rover2store rover2) + (empty rover2store) + (equipped_for_soil_analysis rover2) + (equipped_for_imaging rover2) + (can_traverse rover2 waypoint7 waypoint0) + (can_traverse rover2 waypoint0 waypoint7) + (can_traverse rover2 waypoint7 waypoint1) + (can_traverse rover2 waypoint1 waypoint7) + (can_traverse rover2 waypoint7 waypoint2) + (can_traverse rover2 waypoint2 waypoint7) + (can_traverse rover2 waypoint7 waypoint3) + (can_traverse rover2 waypoint3 waypoint7) + (can_traverse rover2 waypoint7 waypoint5) + (can_traverse rover2 waypoint5 waypoint7) + (can_traverse rover2 waypoint7 waypoint6) + (can_traverse rover2 waypoint6 waypoint7) + (= (energy rover3) 50) + (at rover3 waypoint7) + (available rover3) + (store_of rover3store rover3) + (empty rover3store) + (equipped_for_soil_analysis rover3) + (equipped_for_rock_analysis rover3) + (equipped_for_imaging rover3) + (can_traverse rover3 waypoint7 waypoint0) + (can_traverse rover3 waypoint0 waypoint7) + (can_traverse rover3 waypoint7 waypoint1) + (can_traverse rover3 waypoint1 waypoint7) + (can_traverse rover3 waypoint7 waypoint2) + (can_traverse rover3 waypoint2 waypoint7) + (can_traverse rover3 waypoint7 waypoint3) + (can_traverse rover3 waypoint3 waypoint7) + (can_traverse rover3 waypoint7 waypoint4) + (can_traverse rover3 waypoint4 waypoint7) + (can_traverse rover3 waypoint7 waypoint5) + (can_traverse rover3 waypoint5 waypoint7) + (can_traverse rover3 waypoint0 waypoint6) + (can_traverse rover3 waypoint6 waypoint0) + (on_board camera0 rover3) + (calibration_target camera0 objective2) + (supports camera0 high_res) + (on_board camera1 rover2) + (calibration_target camera1 objective1) + (supports camera1 high_res) + (on_board camera2 rover0) + (calibration_target camera2 objective0) + (supports camera2 low_res) + (on_board camera3 rover3) + (calibration_target camera3 objective3) + (supports camera3 colour) + (supports camera3 high_res) + (supports camera3 low_res) + (visible_from objective0 waypoint0) + (visible_from objective0 waypoint1) + (visible_from objective0 waypoint2) + (visible_from objective1 waypoint0) + (visible_from objective1 waypoint1) + (visible_from objective1 waypoint2) + (visible_from objective1 waypoint3) + (visible_from objective2 waypoint0) + (visible_from objective2 waypoint1) + (visible_from objective2 waypoint2) + (visible_from objective2 waypoint3) + (visible_from objective2 waypoint4) + (visible_from objective3 waypoint0) + (visible_from objective3 waypoint1) + (visible_from objective3 waypoint2) + (visible_from objective3 waypoint3) + (visible_from objective3 waypoint4) + (visible_from objective3 waypoint5) +) + +(:goal (and +(communicated_soil_data waypoint0) +(communicated_rock_data waypoint3) +(communicated_rock_data waypoint6) +(communicated_image_data objective2 low_res) +(communicated_image_data objective1 high_res) +(communicated_image_data objective3 low_res) + ) +) + +(:metric minimize (recharges)) +) diff --git a/tests/fixtures/pddl_files/rovers-numeric-automatic/p13.pddl b/tests/fixtures/pddl_files/rovers-numeric-automatic/p13.pddl new file mode 100644 index 00000000..43c59b60 --- /dev/null +++ b/tests/fixtures/pddl_files/rovers-numeric-automatic/p13.pddl @@ -0,0 +1,231 @@ +(define (problem roverprob6152) (:domain Rover) +(:objects + general - Lander + colour high_res low_res - Mode + rover0 rover1 rover2 rover3 - Rover + rover0store rover1store rover2store rover3store - Store + waypoint0 waypoint1 waypoint2 waypoint3 waypoint4 waypoint5 waypoint6 waypoint7 waypoint8 - Waypoint + camera0 camera1 camera2 camera3 camera4 - Camera + objective0 objective1 objective2 objective3 - Objective + ) +(:init + (visible waypoint0 waypoint1) + (visible waypoint1 waypoint0) + (visible waypoint0 waypoint3) + (visible waypoint3 waypoint0) + (visible waypoint0 waypoint5) + (visible waypoint5 waypoint0) + (visible waypoint0 waypoint6) + (visible waypoint6 waypoint0) + (visible waypoint1 waypoint2) + (visible waypoint2 waypoint1) + (visible waypoint1 waypoint3) + (visible waypoint3 waypoint1) + (visible waypoint1 waypoint4) + (visible waypoint4 waypoint1) + (visible waypoint1 waypoint5) + (visible waypoint5 waypoint1) + (visible waypoint1 waypoint7) + (visible waypoint7 waypoint1) + (visible waypoint1 waypoint8) + (visible waypoint8 waypoint1) + (visible waypoint2 waypoint0) + (visible waypoint0 waypoint2) + (visible waypoint2 waypoint4) + (visible waypoint4 waypoint2) + (visible waypoint2 waypoint6) + (visible waypoint6 waypoint2) + (visible waypoint3 waypoint4) + (visible waypoint4 waypoint3) + (visible waypoint3 waypoint7) + (visible waypoint7 waypoint3) + (visible waypoint4 waypoint0) + (visible waypoint0 waypoint4) + (visible waypoint5 waypoint2) + (visible waypoint2 waypoint5) + (visible waypoint5 waypoint3) + (visible waypoint3 waypoint5) + (visible waypoint7 waypoint0) + (visible waypoint0 waypoint7) + (visible waypoint7 waypoint2) + (visible waypoint2 waypoint7) + (visible waypoint7 waypoint6) + (visible waypoint6 waypoint7) + (visible waypoint8 waypoint2) + (visible waypoint2 waypoint8) + (visible waypoint8 waypoint3) + (visible waypoint3 waypoint8) + (visible waypoint8 waypoint4) + (visible waypoint4 waypoint8) + (visible waypoint8 waypoint7) + (visible waypoint7 waypoint8) + (= (recharges) 0) + (at_rock_sample waypoint0) + (at_rock_sample waypoint1) + (at_soil_sample waypoint2) + (at_rock_sample waypoint2) + (in_sun waypoint3) + (at_soil_sample waypoint4) + (at_rock_sample waypoint4) + (at_soil_sample waypoint5) + (at_rock_sample waypoint6) + (at_soil_sample waypoint7) + (at_rock_sample waypoint7) + (in_sun waypoint7) + (at_rock_sample waypoint8) + (at_lander general waypoint2) + (channel_free general) + (= (energy rover0) 50) + (at rover0 waypoint7) + (available rover0) + (store_of rover0store rover0) + (empty rover0store) + (equipped_for_soil_analysis rover0) + (equipped_for_imaging rover0) + (can_traverse rover0 waypoint7 waypoint0) + (can_traverse rover0 waypoint0 waypoint7) + (can_traverse rover0 waypoint7 waypoint1) + (can_traverse rover0 waypoint1 waypoint7) + (can_traverse rover0 waypoint7 waypoint2) + (can_traverse rover0 waypoint2 waypoint7) + (can_traverse rover0 waypoint7 waypoint8) + (can_traverse rover0 waypoint8 waypoint7) + (can_traverse rover0 waypoint0 waypoint6) + (can_traverse rover0 waypoint6 waypoint0) + (can_traverse rover0 waypoint1 waypoint3) + (can_traverse rover0 waypoint3 waypoint1) + (can_traverse rover0 waypoint1 waypoint5) + (can_traverse rover0 waypoint5 waypoint1) + (can_traverse rover0 waypoint2 waypoint4) + (can_traverse rover0 waypoint4 waypoint2) + (= (energy rover1) 50) + (at rover1 waypoint6) + (available rover1) + (store_of rover1store rover1) + (empty rover1store) + (equipped_for_soil_analysis rover1) + (equipped_for_imaging rover1) + (can_traverse rover1 waypoint6 waypoint0) + (can_traverse rover1 waypoint0 waypoint6) + (can_traverse rover1 waypoint0 waypoint2) + (can_traverse rover1 waypoint2 waypoint0) + (can_traverse rover1 waypoint0 waypoint3) + (can_traverse rover1 waypoint3 waypoint0) + (can_traverse rover1 waypoint0 waypoint7) + (can_traverse rover1 waypoint7 waypoint0) + (can_traverse rover1 waypoint2 waypoint4) + (can_traverse rover1 waypoint4 waypoint2) + (can_traverse rover1 waypoint2 waypoint8) + (can_traverse rover1 waypoint8 waypoint2) + (can_traverse rover1 waypoint3 waypoint1) + (can_traverse rover1 waypoint1 waypoint3) + (= (energy rover2) 50) + (at rover2 waypoint6) + (available rover2) + (store_of rover2store rover2) + (empty rover2store) + (equipped_for_soil_analysis rover2) + (equipped_for_rock_analysis rover2) + (equipped_for_imaging rover2) + (can_traverse rover2 waypoint6 waypoint0) + (can_traverse rover2 waypoint0 waypoint6) + (can_traverse rover2 waypoint6 waypoint2) + (can_traverse rover2 waypoint2 waypoint6) + (can_traverse rover2 waypoint6 waypoint7) + (can_traverse rover2 waypoint7 waypoint6) + (can_traverse rover2 waypoint0 waypoint1) + (can_traverse rover2 waypoint1 waypoint0) + (can_traverse rover2 waypoint0 waypoint3) + (can_traverse rover2 waypoint3 waypoint0) + (can_traverse rover2 waypoint0 waypoint4) + (can_traverse rover2 waypoint4 waypoint0) + (can_traverse rover2 waypoint0 waypoint5) + (can_traverse rover2 waypoint5 waypoint0) + (can_traverse rover2 waypoint2 waypoint8) + (can_traverse rover2 waypoint8 waypoint2) + (= (energy rover3) 50) + (at rover3 waypoint3) + (available rover3) + (store_of rover3store rover3) + (empty rover3store) + (equipped_for_soil_analysis rover3) + (equipped_for_rock_analysis rover3) + (equipped_for_imaging rover3) + (can_traverse rover3 waypoint3 waypoint0) + (can_traverse rover3 waypoint0 waypoint3) + (can_traverse rover3 waypoint3 waypoint1) + (can_traverse rover3 waypoint1 waypoint3) + (can_traverse rover3 waypoint3 waypoint5) + (can_traverse rover3 waypoint5 waypoint3) + (can_traverse rover3 waypoint3 waypoint7) + (can_traverse rover3 waypoint7 waypoint3) + (can_traverse rover3 waypoint3 waypoint8) + (can_traverse rover3 waypoint8 waypoint3) + (can_traverse rover3 waypoint0 waypoint4) + (can_traverse rover3 waypoint4 waypoint0) + (can_traverse rover3 waypoint0 waypoint6) + (can_traverse rover3 waypoint6 waypoint0) + (can_traverse rover3 waypoint1 waypoint2) + (can_traverse rover3 waypoint2 waypoint1) + (on_board camera0 rover2) + (calibration_target camera0 objective1) + (supports camera0 colour) + (supports camera0 high_res) + (on_board camera1 rover2) + (calibration_target camera1 objective1) + (supports camera1 colour) + (supports camera1 low_res) + (on_board camera2 rover3) + (calibration_target camera2 objective1) + (supports camera2 high_res) + (on_board camera3 rover1) + (calibration_target camera3 objective2) + (supports camera3 colour) + (supports camera3 low_res) + (on_board camera4 rover0) + (calibration_target camera4 objective1) + (supports camera4 high_res) + (supports camera4 low_res) + (visible_from objective0 waypoint0) + (visible_from objective1 waypoint0) + (visible_from objective1 waypoint1) + (visible_from objective1 waypoint2) + (visible_from objective1 waypoint3) + (visible_from objective1 waypoint4) + (visible_from objective1 waypoint5) + (visible_from objective1 waypoint6) + (visible_from objective1 waypoint7) + (visible_from objective2 waypoint0) + (visible_from objective2 waypoint1) + (visible_from objective2 waypoint2) + (visible_from objective2 waypoint3) + (visible_from objective2 waypoint4) + (visible_from objective2 waypoint5) + (visible_from objective3 waypoint0) + (visible_from objective3 waypoint1) + (visible_from objective3 waypoint2) + (visible_from objective3 waypoint3) + (visible_from objective3 waypoint4) + (visible_from objective3 waypoint5) + (visible_from objective3 waypoint6) + (visible_from objective3 waypoint7) +) + +(:goal (and +(communicated_soil_data waypoint7) +(communicated_soil_data waypoint5) +(communicated_soil_data waypoint2) +(communicated_soil_data waypoint4) +(communicated_rock_data waypoint4) +(communicated_rock_data waypoint6) +(communicated_rock_data waypoint7) +(communicated_rock_data waypoint8) +(communicated_rock_data waypoint1) +(communicated_image_data objective3 high_res) +(communicated_image_data objective1 high_res) +(communicated_image_data objective2 high_res) + ) +) + +(:metric minimize (recharges)) +) diff --git a/tests/fixtures/pddl_files/rovers-numeric-automatic/p14.pddl b/tests/fixtures/pddl_files/rovers-numeric-automatic/p14.pddl new file mode 100644 index 00000000..546065b1 --- /dev/null +++ b/tests/fixtures/pddl_files/rovers-numeric-automatic/p14.pddl @@ -0,0 +1,244 @@ +(define (problem roverprob1425) (:domain Rover) +(:objects + general - Lander + colour high_res low_res - Mode + rover0 rover1 rover2 rover3 - Rover + rover0store rover1store rover2store rover3store - Store + waypoint0 waypoint1 waypoint2 waypoint3 waypoint4 waypoint5 waypoint6 waypoint7 waypoint8 waypoint9 - Waypoint + camera0 camera1 camera2 camera3 camera4 - Camera + objective0 objective1 objective2 objective3 - Objective + ) +(:init + (visible waypoint0 waypoint3) + (visible waypoint3 waypoint0) + (visible waypoint0 waypoint9) + (visible waypoint9 waypoint0) + (visible waypoint1 waypoint8) + (visible waypoint8 waypoint1) + (visible waypoint2 waypoint1) + (visible waypoint1 waypoint2) + (visible waypoint2 waypoint3) + (visible waypoint3 waypoint2) + (visible waypoint2 waypoint6) + (visible waypoint6 waypoint2) + (visible waypoint2 waypoint9) + (visible waypoint9 waypoint2) + (visible waypoint3 waypoint5) + (visible waypoint5 waypoint3) + (visible waypoint3 waypoint6) + (visible waypoint6 waypoint3) + (visible waypoint3 waypoint7) + (visible waypoint7 waypoint3) + (visible waypoint4 waypoint0) + (visible waypoint0 waypoint4) + (visible waypoint4 waypoint1) + (visible waypoint1 waypoint4) + (visible waypoint4 waypoint2) + (visible waypoint2 waypoint4) + (visible waypoint4 waypoint8) + (visible waypoint8 waypoint4) + (visible waypoint4 waypoint9) + (visible waypoint9 waypoint4) + (visible waypoint5 waypoint1) + (visible waypoint1 waypoint5) + (visible waypoint5 waypoint2) + (visible waypoint2 waypoint5) + (visible waypoint5 waypoint4) + (visible waypoint4 waypoint5) + (visible waypoint5 waypoint6) + (visible waypoint6 waypoint5) + (visible waypoint6 waypoint0) + (visible waypoint0 waypoint6) + (visible waypoint6 waypoint1) + (visible waypoint1 waypoint6) + (visible waypoint6 waypoint4) + (visible waypoint4 waypoint6) + (visible waypoint7 waypoint1) + (visible waypoint1 waypoint7) + (visible waypoint7 waypoint5) + (visible waypoint5 waypoint7) + (visible waypoint7 waypoint8) + (visible waypoint8 waypoint7) + (visible waypoint8 waypoint6) + (visible waypoint6 waypoint8) + (visible waypoint8 waypoint9) + (visible waypoint9 waypoint8) + (visible waypoint9 waypoint3) + (visible waypoint3 waypoint9) + (visible waypoint9 waypoint6) + (visible waypoint6 waypoint9) + (= (recharges) 0) + (at_rock_sample waypoint1) + (at_soil_sample waypoint3) + (at_rock_sample waypoint3) + (at_soil_sample waypoint4) + (at_rock_sample waypoint4) + (at_rock_sample waypoint5) + (in_sun waypoint5) + (at_soil_sample waypoint6) + (at_rock_sample waypoint8) + (at_soil_sample waypoint9) + (in_sun waypoint9) + (at_lander general waypoint7) + (channel_free general) + (= (energy rover0) 50) + (at rover0 waypoint1) + (available rover0) + (store_of rover0store rover0) + (empty rover0store) + (equipped_for_soil_analysis rover0) + (equipped_for_imaging rover0) + (can_traverse rover0 waypoint1 waypoint2) + (can_traverse rover0 waypoint2 waypoint1) + (can_traverse rover0 waypoint1 waypoint4) + (can_traverse rover0 waypoint4 waypoint1) + (can_traverse rover0 waypoint1 waypoint6) + (can_traverse rover0 waypoint6 waypoint1) + (can_traverse rover0 waypoint1 waypoint8) + (can_traverse rover0 waypoint8 waypoint1) + (can_traverse rover0 waypoint2 waypoint3) + (can_traverse rover0 waypoint3 waypoint2) + (can_traverse rover0 waypoint4 waypoint0) + (can_traverse rover0 waypoint0 waypoint4) + (can_traverse rover0 waypoint4 waypoint5) + (can_traverse rover0 waypoint5 waypoint4) + (can_traverse rover0 waypoint4 waypoint9) + (can_traverse rover0 waypoint9 waypoint4) + (can_traverse rover0 waypoint8 waypoint7) + (can_traverse rover0 waypoint7 waypoint8) + (= (energy rover1) 50) + (at rover1 waypoint4) + (available rover1) + (store_of rover1store rover1) + (empty rover1store) + (equipped_for_soil_analysis rover1) + (equipped_for_rock_analysis rover1) + (equipped_for_imaging rover1) + (can_traverse rover1 waypoint4 waypoint0) + (can_traverse rover1 waypoint0 waypoint4) + (can_traverse rover1 waypoint4 waypoint2) + (can_traverse rover1 waypoint2 waypoint4) + (can_traverse rover1 waypoint4 waypoint5) + (can_traverse rover1 waypoint5 waypoint4) + (can_traverse rover1 waypoint4 waypoint6) + (can_traverse rover1 waypoint6 waypoint4) + (can_traverse rover1 waypoint4 waypoint9) + (can_traverse rover1 waypoint9 waypoint4) + (can_traverse rover1 waypoint0 waypoint3) + (can_traverse rover1 waypoint3 waypoint0) + (can_traverse rover1 waypoint2 waypoint1) + (can_traverse rover1 waypoint1 waypoint2) + (can_traverse rover1 waypoint5 waypoint7) + (can_traverse rover1 waypoint7 waypoint5) + (can_traverse rover1 waypoint6 waypoint8) + (can_traverse rover1 waypoint8 waypoint6) + (= (energy rover2) 50) + (at rover2 waypoint0) + (available rover2) + (store_of rover2store rover2) + (empty rover2store) + (equipped_for_imaging rover2) + (can_traverse rover2 waypoint0 waypoint3) + (can_traverse rover2 waypoint3 waypoint0) + (can_traverse rover2 waypoint0 waypoint4) + (can_traverse rover2 waypoint4 waypoint0) + (can_traverse rover2 waypoint0 waypoint6) + (can_traverse rover2 waypoint6 waypoint0) + (can_traverse rover2 waypoint0 waypoint9) + (can_traverse rover2 waypoint9 waypoint0) + (can_traverse rover2 waypoint3 waypoint2) + (can_traverse rover2 waypoint2 waypoint3) + (can_traverse rover2 waypoint4 waypoint1) + (can_traverse rover2 waypoint1 waypoint4) + (can_traverse rover2 waypoint4 waypoint5) + (can_traverse rover2 waypoint5 waypoint4) + (can_traverse rover2 waypoint4 waypoint8) + (can_traverse rover2 waypoint8 waypoint4) + (= (energy rover3) 50) + (at rover3 waypoint2) + (available rover3) + (store_of rover3store rover3) + (empty rover3store) + (equipped_for_imaging rover3) + (can_traverse rover3 waypoint2 waypoint1) + (can_traverse rover3 waypoint1 waypoint2) + (can_traverse rover3 waypoint2 waypoint6) + (can_traverse rover3 waypoint6 waypoint2) + (can_traverse rover3 waypoint2 waypoint9) + (can_traverse rover3 waypoint9 waypoint2) + (can_traverse rover3 waypoint1 waypoint4) + (can_traverse rover3 waypoint4 waypoint1) + (can_traverse rover3 waypoint1 waypoint5) + (can_traverse rover3 waypoint5 waypoint1) + (can_traverse rover3 waypoint1 waypoint7) + (can_traverse rover3 waypoint7 waypoint1) + (can_traverse rover3 waypoint6 waypoint0) + (can_traverse rover3 waypoint0 waypoint6) + (can_traverse rover3 waypoint6 waypoint3) + (can_traverse rover3 waypoint3 waypoint6) + (can_traverse rover3 waypoint6 waypoint8) + (can_traverse rover3 waypoint8 waypoint6) + (on_board camera0 rover3) + (calibration_target camera0 objective2) + (supports camera0 colour) + (supports camera0 low_res) + (on_board camera1 rover2) + (calibration_target camera1 objective3) + (supports camera1 colour) + (on_board camera2 rover1) + (calibration_target camera2 objective3) + (supports camera2 low_res) + (on_board camera3 rover1) + (calibration_target camera3 objective0) + (supports camera3 colour) + (supports camera3 low_res) + (on_board camera4 rover0) + (calibration_target camera4 objective3) + (supports camera4 colour) + (supports camera4 low_res) + (visible_from objective0 waypoint0) + (visible_from objective0 waypoint1) + (visible_from objective0 waypoint2) + (visible_from objective0 waypoint3) + (visible_from objective0 waypoint4) + (visible_from objective0 waypoint5) + (visible_from objective0 waypoint6) + (visible_from objective1 waypoint0) + (visible_from objective1 waypoint1) + (visible_from objective1 waypoint2) + (visible_from objective1 waypoint3) + (visible_from objective1 waypoint4) + (visible_from objective1 waypoint5) + (visible_from objective1 waypoint6) + (visible_from objective2 waypoint0) + (visible_from objective2 waypoint1) + (visible_from objective2 waypoint2) + (visible_from objective2 waypoint3) + (visible_from objective2 waypoint4) + (visible_from objective2 waypoint5) + (visible_from objective2 waypoint6) + (visible_from objective2 waypoint7) + (visible_from objective2 waypoint8) + (visible_from objective3 waypoint0) + (visible_from objective3 waypoint1) + (visible_from objective3 waypoint2) + (visible_from objective3 waypoint3) + (visible_from objective3 waypoint4) + (visible_from objective3 waypoint5) + (visible_from objective3 waypoint6) +) + +(:goal (and +(communicated_soil_data waypoint3) +(communicated_soil_data waypoint6) +(communicated_rock_data waypoint5) +(communicated_rock_data waypoint4) +(communicated_rock_data waypoint8) +(communicated_image_data objective0 colour) +(communicated_image_data objective2 low_res) +(communicated_image_data objective0 low_res) + ) +) + +(:metric minimize (recharges)) +) diff --git a/tests/fixtures/pddl_files/rovers-numeric-automatic/p15.pddl b/tests/fixtures/pddl_files/rovers-numeric-automatic/p15.pddl new file mode 100644 index 00000000..91ab7113 --- /dev/null +++ b/tests/fixtures/pddl_files/rovers-numeric-automatic/p15.pddl @@ -0,0 +1,284 @@ +(define (problem roverprob4135) (:domain Rover) +(:objects + general - Lander + colour high_res low_res - Mode + rover0 rover1 rover2 rover3 - Rover + rover0store rover1store rover2store rover3store - Store + waypoint0 waypoint1 waypoint2 waypoint3 waypoint4 waypoint5 waypoint6 waypoint7 waypoint8 waypoint9 waypoint10 - Waypoint + camera0 camera1 camera2 camera3 - Camera + objective0 objective1 objective2 objective3 objective4 - Objective + ) +(:init + (visible waypoint0 waypoint3) + (visible waypoint3 waypoint0) + (visible waypoint0 waypoint4) + (visible waypoint4 waypoint0) + (visible waypoint1 waypoint0) + (visible waypoint0 waypoint1) + (visible waypoint1 waypoint5) + (visible waypoint5 waypoint1) + (visible waypoint1 waypoint6) + (visible waypoint6 waypoint1) + (visible waypoint1 waypoint7) + (visible waypoint7 waypoint1) + (visible waypoint1 waypoint8) + (visible waypoint8 waypoint1) + (visible waypoint1 waypoint10) + (visible waypoint10 waypoint1) + (visible waypoint2 waypoint0) + (visible waypoint0 waypoint2) + (visible waypoint2 waypoint1) + (visible waypoint1 waypoint2) + (visible waypoint2 waypoint6) + (visible waypoint6 waypoint2) + (visible waypoint3 waypoint1) + (visible waypoint1 waypoint3) + (visible waypoint3 waypoint6) + (visible waypoint6 waypoint3) + (visible waypoint3 waypoint9) + (visible waypoint9 waypoint3) + (visible waypoint3 waypoint10) + (visible waypoint10 waypoint3) + (visible waypoint4 waypoint1) + (visible waypoint1 waypoint4) + (visible waypoint4 waypoint2) + (visible waypoint2 waypoint4) + (visible waypoint4 waypoint5) + (visible waypoint5 waypoint4) + (visible waypoint4 waypoint6) + (visible waypoint6 waypoint4) + (visible waypoint4 waypoint8) + (visible waypoint8 waypoint4) + (visible waypoint5 waypoint2) + (visible waypoint2 waypoint5) + (visible waypoint5 waypoint6) + (visible waypoint6 waypoint5) + (visible waypoint7 waypoint0) + (visible waypoint0 waypoint7) + (visible waypoint7 waypoint3) + (visible waypoint3 waypoint7) + (visible waypoint7 waypoint5) + (visible waypoint5 waypoint7) + (visible waypoint7 waypoint9) + (visible waypoint9 waypoint7) + (visible waypoint7 waypoint10) + (visible waypoint10 waypoint7) + (visible waypoint8 waypoint0) + (visible waypoint0 waypoint8) + (visible waypoint8 waypoint3) + (visible waypoint3 waypoint8) + (visible waypoint9 waypoint4) + (visible waypoint4 waypoint9) + (visible waypoint9 waypoint6) + (visible waypoint6 waypoint9) + (visible waypoint9 waypoint8) + (visible waypoint8 waypoint9) + (visible waypoint10 waypoint4) + (visible waypoint4 waypoint10) + (visible waypoint10 waypoint5) + (visible waypoint5 waypoint10) + (visible waypoint10 waypoint6) + (visible waypoint6 waypoint10) + (visible waypoint10 waypoint8) + (visible waypoint8 waypoint10) + (= (recharges) 0) + (at_soil_sample waypoint0) + (in_sun waypoint0) + (at_rock_sample waypoint1) + (at_soil_sample waypoint2) + (at_rock_sample waypoint2) + (in_sun waypoint2) + (in_sun waypoint3) + (at_soil_sample waypoint4) + (at_soil_sample waypoint5) + (in_sun waypoint5) + (at_soil_sample waypoint7) + (at_soil_sample waypoint8) + (at_rock_sample waypoint8) + (at_rock_sample waypoint9) + (in_sun waypoint9) + (at_soil_sample waypoint10) + (at_rock_sample waypoint10) + (in_sun waypoint10) + (at_lander general waypoint9) + (channel_free general) + (= (energy rover0) 50) + (at rover0 waypoint4) + (available rover0) + (store_of rover0store rover0) + (empty rover0store) + (equipped_for_soil_analysis rover0) + (equipped_for_imaging rover0) + (can_traverse rover0 waypoint4 waypoint0) + (can_traverse rover0 waypoint0 waypoint4) + (can_traverse rover0 waypoint4 waypoint1) + (can_traverse rover0 waypoint1 waypoint4) + (can_traverse rover0 waypoint4 waypoint2) + (can_traverse rover0 waypoint2 waypoint4) + (can_traverse rover0 waypoint4 waypoint5) + (can_traverse rover0 waypoint5 waypoint4) + (can_traverse rover0 waypoint4 waypoint8) + (can_traverse rover0 waypoint8 waypoint4) + (can_traverse rover0 waypoint4 waypoint9) + (can_traverse rover0 waypoint9 waypoint4) + (can_traverse rover0 waypoint4 waypoint10) + (can_traverse rover0 waypoint10 waypoint4) + (can_traverse rover0 waypoint0 waypoint3) + (can_traverse rover0 waypoint3 waypoint0) + (can_traverse rover0 waypoint0 waypoint7) + (can_traverse rover0 waypoint7 waypoint0) + (can_traverse rover0 waypoint1 waypoint6) + (can_traverse rover0 waypoint6 waypoint1) + (= (energy rover1) 50) + (at rover1 waypoint6) + (available rover1) + (store_of rover1store rover1) + (empty rover1store) + (equipped_for_imaging rover1) + (can_traverse rover1 waypoint6 waypoint1) + (can_traverse rover1 waypoint1 waypoint6) + (can_traverse rover1 waypoint6 waypoint2) + (can_traverse rover1 waypoint2 waypoint6) + (can_traverse rover1 waypoint6 waypoint3) + (can_traverse rover1 waypoint3 waypoint6) + (can_traverse rover1 waypoint6 waypoint4) + (can_traverse rover1 waypoint4 waypoint6) + (can_traverse rover1 waypoint6 waypoint5) + (can_traverse rover1 waypoint5 waypoint6) + (can_traverse rover1 waypoint6 waypoint10) + (can_traverse rover1 waypoint10 waypoint6) + (can_traverse rover1 waypoint1 waypoint0) + (can_traverse rover1 waypoint0 waypoint1) + (can_traverse rover1 waypoint1 waypoint7) + (can_traverse rover1 waypoint7 waypoint1) + (can_traverse rover1 waypoint1 waypoint8) + (can_traverse rover1 waypoint8 waypoint1) + (can_traverse rover1 waypoint3 waypoint9) + (can_traverse rover1 waypoint9 waypoint3) + (= (energy rover2) 50) + (at rover2 waypoint6) + (available rover2) + (store_of rover2store rover2) + (empty rover2store) + (equipped_for_soil_analysis rover2) + (can_traverse rover2 waypoint6 waypoint1) + (can_traverse rover2 waypoint1 waypoint6) + (can_traverse rover2 waypoint6 waypoint4) + (can_traverse rover2 waypoint4 waypoint6) + (can_traverse rover2 waypoint6 waypoint5) + (can_traverse rover2 waypoint5 waypoint6) + (can_traverse rover2 waypoint6 waypoint9) + (can_traverse rover2 waypoint9 waypoint6) + (can_traverse rover2 waypoint6 waypoint10) + (can_traverse rover2 waypoint10 waypoint6) + (can_traverse rover2 waypoint1 waypoint0) + (can_traverse rover2 waypoint0 waypoint1) + (can_traverse rover2 waypoint1 waypoint7) + (can_traverse rover2 waypoint7 waypoint1) + (can_traverse rover2 waypoint4 waypoint2) + (can_traverse rover2 waypoint2 waypoint4) + (can_traverse rover2 waypoint9 waypoint3) + (can_traverse rover2 waypoint3 waypoint9) + (can_traverse rover2 waypoint9 waypoint8) + (can_traverse rover2 waypoint8 waypoint9) + (= (energy rover3) 50) + (at rover3 waypoint4) + (available rover3) + (store_of rover3store rover3) + (empty rover3store) + (equipped_for_rock_analysis rover3) + (equipped_for_imaging rover3) + (can_traverse rover3 waypoint4 waypoint0) + (can_traverse rover3 waypoint0 waypoint4) + (can_traverse rover3 waypoint4 waypoint1) + (can_traverse rover3 waypoint1 waypoint4) + (can_traverse rover3 waypoint4 waypoint2) + (can_traverse rover3 waypoint2 waypoint4) + (can_traverse rover3 waypoint4 waypoint5) + (can_traverse rover3 waypoint5 waypoint4) + (can_traverse rover3 waypoint4 waypoint6) + (can_traverse rover3 waypoint6 waypoint4) + (can_traverse rover3 waypoint4 waypoint8) + (can_traverse rover3 waypoint8 waypoint4) + (can_traverse rover3 waypoint4 waypoint9) + (can_traverse rover3 waypoint9 waypoint4) + (can_traverse rover3 waypoint0 waypoint7) + (can_traverse rover3 waypoint7 waypoint0) + (can_traverse rover3 waypoint1 waypoint3) + (can_traverse rover3 waypoint3 waypoint1) + (can_traverse rover3 waypoint1 waypoint10) + (can_traverse rover3 waypoint10 waypoint1) + (on_board camera0 rover3) + (calibration_target camera0 objective2) + (supports camera0 low_res) + (on_board camera1 rover0) + (calibration_target camera1 objective4) + (supports camera1 colour) + (supports camera1 high_res) + (supports camera1 low_res) + (on_board camera2 rover1) + (calibration_target camera2 objective4) + (supports camera2 high_res) + (supports camera2 low_res) + (on_board camera3 rover1) + (calibration_target camera3 objective3) + (supports camera3 colour) + (supports camera3 high_res) + (supports camera3 low_res) + (visible_from objective0 waypoint0) + (visible_from objective0 waypoint1) + (visible_from objective0 waypoint2) + (visible_from objective0 waypoint3) + (visible_from objective0 waypoint4) + (visible_from objective0 waypoint5) + (visible_from objective0 waypoint6) + (visible_from objective0 waypoint7) + (visible_from objective0 waypoint8) + (visible_from objective0 waypoint9) + (visible_from objective0 waypoint10) + (visible_from objective1 waypoint0) + (visible_from objective1 waypoint1) + (visible_from objective1 waypoint2) + (visible_from objective1 waypoint3) + (visible_from objective1 waypoint4) + (visible_from objective1 waypoint5) + (visible_from objective1 waypoint6) + (visible_from objective1 waypoint7) + (visible_from objective1 waypoint8) + (visible_from objective1 waypoint9) + (visible_from objective2 waypoint0) + (visible_from objective2 waypoint1) + (visible_from objective2 waypoint2) + (visible_from objective3 waypoint0) + (visible_from objective3 waypoint1) + (visible_from objective3 waypoint2) + (visible_from objective3 waypoint3) + (visible_from objective3 waypoint4) + (visible_from objective4 waypoint0) + (visible_from objective4 waypoint1) + (visible_from objective4 waypoint2) + (visible_from objective4 waypoint3) + (visible_from objective4 waypoint4) + (visible_from objective4 waypoint5) + (visible_from objective4 waypoint6) + (visible_from objective4 waypoint7) + (visible_from objective4 waypoint8) + (visible_from objective4 waypoint9) +) + +(:goal (and +(communicated_soil_data waypoint5) +(communicated_soil_data waypoint2) +(communicated_soil_data waypoint8) +(communicated_soil_data waypoint10) +(communicated_soil_data waypoint0) +(communicated_rock_data waypoint2) +(communicated_rock_data waypoint1) +(communicated_rock_data waypoint8) +(communicated_image_data objective1 low_res) +(communicated_image_data objective1 high_res) + ) +) + +(:metric minimize (recharges)) +) diff --git a/tests/fixtures/pddl_files/rovers-numeric-automatic/p16.pddl b/tests/fixtures/pddl_files/rovers-numeric-automatic/p16.pddl new file mode 100644 index 00000000..c680de5e --- /dev/null +++ b/tests/fixtures/pddl_files/rovers-numeric-automatic/p16.pddl @@ -0,0 +1,297 @@ +(define (problem roverprob5142) (:domain Rover) +(:objects + general - Lander + colour high_res low_res - Mode + rover0 rover1 rover2 rover3 - Rover + rover0store rover1store rover2store rover3store - Store + waypoint0 waypoint1 waypoint2 waypoint3 waypoint4 waypoint5 waypoint6 waypoint7 waypoint8 waypoint9 waypoint10 waypoint11 - Waypoint + camera0 camera1 camera2 camera3 - Camera + objective0 objective1 objective2 objective3 objective4 - Objective + ) +(:init + (visible waypoint0 waypoint10) + (visible waypoint10 waypoint0) + (visible waypoint0 waypoint11) + (visible waypoint11 waypoint0) + (visible waypoint1 waypoint0) + (visible waypoint0 waypoint1) + (visible waypoint1 waypoint3) + (visible waypoint3 waypoint1) + (visible waypoint1 waypoint10) + (visible waypoint10 waypoint1) + (visible waypoint2 waypoint4) + (visible waypoint4 waypoint2) + (visible waypoint2 waypoint5) + (visible waypoint5 waypoint2) + (visible waypoint2 waypoint9) + (visible waypoint9 waypoint2) + (visible waypoint2 waypoint10) + (visible waypoint10 waypoint2) + (visible waypoint3 waypoint2) + (visible waypoint2 waypoint3) + (visible waypoint3 waypoint4) + (visible waypoint4 waypoint3) + (visible waypoint3 waypoint5) + (visible waypoint5 waypoint3) + (visible waypoint3 waypoint8) + (visible waypoint8 waypoint3) + (visible waypoint3 waypoint9) + (visible waypoint9 waypoint3) + (visible waypoint3 waypoint10) + (visible waypoint10 waypoint3) + (visible waypoint4 waypoint5) + (visible waypoint5 waypoint4) + (visible waypoint4 waypoint7) + (visible waypoint7 waypoint4) + (visible waypoint4 waypoint11) + (visible waypoint11 waypoint4) + (visible waypoint6 waypoint1) + (visible waypoint1 waypoint6) + (visible waypoint6 waypoint2) + (visible waypoint2 waypoint6) + (visible waypoint6 waypoint8) + (visible waypoint8 waypoint6) + (visible waypoint7 waypoint0) + (visible waypoint0 waypoint7) + (visible waypoint7 waypoint5) + (visible waypoint5 waypoint7) + (visible waypoint7 waypoint6) + (visible waypoint6 waypoint7) + (visible waypoint7 waypoint10) + (visible waypoint10 waypoint7) + (visible waypoint8 waypoint0) + (visible waypoint0 waypoint8) + (visible waypoint8 waypoint5) + (visible waypoint5 waypoint8) + (visible waypoint8 waypoint7) + (visible waypoint7 waypoint8) + (visible waypoint8 waypoint10) + (visible waypoint10 waypoint8) + (visible waypoint9 waypoint0) + (visible waypoint0 waypoint9) + (visible waypoint9 waypoint1) + (visible waypoint1 waypoint9) + (visible waypoint9 waypoint4) + (visible waypoint4 waypoint9) + (visible waypoint10 waypoint5) + (visible waypoint5 waypoint10) + (visible waypoint10 waypoint9) + (visible waypoint9 waypoint10) + (visible waypoint11 waypoint7) + (visible waypoint7 waypoint11) + (visible waypoint11 waypoint8) + (visible waypoint8 waypoint11) + (visible waypoint11 waypoint9) + (visible waypoint9 waypoint11) + (visible waypoint11 waypoint10) + (visible waypoint10 waypoint11) + (= (recharges) 0) + (at_soil_sample waypoint0) + (at_soil_sample waypoint1) + (at_rock_sample waypoint1) + (at_rock_sample waypoint2) + (in_sun waypoint2) + (at_rock_sample waypoint3) + (at_soil_sample waypoint4) + (at_soil_sample waypoint5) + (at_rock_sample waypoint5) + (at_soil_sample waypoint7) + (at_soil_sample waypoint8) + (at_rock_sample waypoint8) + (at_soil_sample waypoint9) + (at_rock_sample waypoint9) + (at_rock_sample waypoint10) + (in_sun waypoint10) + (at_soil_sample waypoint11) + (at_rock_sample waypoint11) + (in_sun waypoint11) + (at_lander general waypoint6) + (channel_free general) + (= (energy rover0) 50) + (at rover0 waypoint6) + (available rover0) + (store_of rover0store rover0) + (empty rover0store) + (equipped_for_soil_analysis rover0) + (equipped_for_rock_analysis rover0) + (equipped_for_imaging rover0) + (can_traverse rover0 waypoint6 waypoint1) + (can_traverse rover0 waypoint1 waypoint6) + (can_traverse rover0 waypoint6 waypoint2) + (can_traverse rover0 waypoint2 waypoint6) + (can_traverse rover0 waypoint6 waypoint7) + (can_traverse rover0 waypoint7 waypoint6) + (can_traverse rover0 waypoint1 waypoint0) + (can_traverse rover0 waypoint0 waypoint1) + (can_traverse rover0 waypoint1 waypoint3) + (can_traverse rover0 waypoint3 waypoint1) + (can_traverse rover0 waypoint1 waypoint9) + (can_traverse rover0 waypoint9 waypoint1) + (can_traverse rover0 waypoint2 waypoint5) + (can_traverse rover0 waypoint5 waypoint2) + (can_traverse rover0 waypoint7 waypoint4) + (can_traverse rover0 waypoint4 waypoint7) + (can_traverse rover0 waypoint7 waypoint8) + (can_traverse rover0 waypoint8 waypoint7) + (can_traverse rover0 waypoint7 waypoint10) + (can_traverse rover0 waypoint10 waypoint7) + (can_traverse rover0 waypoint7 waypoint11) + (can_traverse rover0 waypoint11 waypoint7) + (= (energy rover1) 50) + (at rover1 waypoint2) + (available rover1) + (store_of rover1store rover1) + (empty rover1store) + (equipped_for_soil_analysis rover1) + (equipped_for_rock_analysis rover1) + (can_traverse rover1 waypoint2 waypoint3) + (can_traverse rover1 waypoint3 waypoint2) + (can_traverse rover1 waypoint2 waypoint4) + (can_traverse rover1 waypoint4 waypoint2) + (can_traverse rover1 waypoint2 waypoint5) + (can_traverse rover1 waypoint5 waypoint2) + (can_traverse rover1 waypoint2 waypoint6) + (can_traverse rover1 waypoint6 waypoint2) + (can_traverse rover1 waypoint2 waypoint9) + (can_traverse rover1 waypoint9 waypoint2) + (can_traverse rover1 waypoint2 waypoint10) + (can_traverse rover1 waypoint10 waypoint2) + (can_traverse rover1 waypoint3 waypoint1) + (can_traverse rover1 waypoint1 waypoint3) + (can_traverse rover1 waypoint3 waypoint8) + (can_traverse rover1 waypoint8 waypoint3) + (can_traverse rover1 waypoint4 waypoint7) + (can_traverse rover1 waypoint7 waypoint4) + (can_traverse rover1 waypoint9 waypoint11) + (can_traverse rover1 waypoint11 waypoint9) + (can_traverse rover1 waypoint1 waypoint0) + (can_traverse rover1 waypoint0 waypoint1) + (= (energy rover2) 50) + (at rover2 waypoint9) + (available rover2) + (store_of rover2store rover2) + (empty rover2store) + (equipped_for_rock_analysis rover2) + (equipped_for_imaging rover2) + (can_traverse rover2 waypoint9 waypoint0) + (can_traverse rover2 waypoint0 waypoint9) + (can_traverse rover2 waypoint9 waypoint1) + (can_traverse rover2 waypoint1 waypoint9) + (can_traverse rover2 waypoint9 waypoint2) + (can_traverse rover2 waypoint2 waypoint9) + (can_traverse rover2 waypoint9 waypoint3) + (can_traverse rover2 waypoint3 waypoint9) + (can_traverse rover2 waypoint9 waypoint4) + (can_traverse rover2 waypoint4 waypoint9) + (can_traverse rover2 waypoint0 waypoint7) + (can_traverse rover2 waypoint7 waypoint0) + (can_traverse rover2 waypoint0 waypoint8) + (can_traverse rover2 waypoint8 waypoint0) + (can_traverse rover2 waypoint0 waypoint10) + (can_traverse rover2 waypoint10 waypoint0) + (can_traverse rover2 waypoint0 waypoint11) + (can_traverse rover2 waypoint11 waypoint0) + (can_traverse rover2 waypoint2 waypoint5) + (can_traverse rover2 waypoint5 waypoint2) + (can_traverse rover2 waypoint2 waypoint6) + (can_traverse rover2 waypoint6 waypoint2) + (= (energy rover3) 50) + (at rover3 waypoint0) + (available rover3) + (store_of rover3store rover3) + (empty rover3store) + (equipped_for_rock_analysis rover3) + (can_traverse rover3 waypoint0 waypoint1) + (can_traverse rover3 waypoint1 waypoint0) + (can_traverse rover3 waypoint0 waypoint8) + (can_traverse rover3 waypoint8 waypoint0) + (can_traverse rover3 waypoint0 waypoint9) + (can_traverse rover3 waypoint9 waypoint0) + (can_traverse rover3 waypoint0 waypoint10) + (can_traverse rover3 waypoint10 waypoint0) + (can_traverse rover3 waypoint0 waypoint11) + (can_traverse rover3 waypoint11 waypoint0) + (can_traverse rover3 waypoint1 waypoint3) + (can_traverse rover3 waypoint3 waypoint1) + (can_traverse rover3 waypoint1 waypoint6) + (can_traverse rover3 waypoint6 waypoint1) + (can_traverse rover3 waypoint9 waypoint4) + (can_traverse rover3 waypoint4 waypoint9) + (can_traverse rover3 waypoint10 waypoint2) + (can_traverse rover3 waypoint2 waypoint10) + (can_traverse rover3 waypoint10 waypoint5) + (can_traverse rover3 waypoint5 waypoint10) + (can_traverse rover3 waypoint10 waypoint7) + (can_traverse rover3 waypoint7 waypoint10) + (on_board camera0 rover2) + (calibration_target camera0 objective3) + (supports camera0 low_res) + (on_board camera1 rover2) + (calibration_target camera1 objective4) + (supports camera1 colour) + (on_board camera2 rover0) + (calibration_target camera2 objective2) + (supports camera2 high_res) + (on_board camera3 rover2) + (calibration_target camera3 objective3) + (supports camera3 colour) + (supports camera3 high_res) + (supports camera3 low_res) + (visible_from objective0 waypoint0) + (visible_from objective0 waypoint1) + (visible_from objective0 waypoint2) + (visible_from objective0 waypoint3) + (visible_from objective0 waypoint4) + (visible_from objective0 waypoint5) + (visible_from objective0 waypoint6) + (visible_from objective0 waypoint7) + (visible_from objective0 waypoint8) + (visible_from objective1 waypoint0) + (visible_from objective1 waypoint1) + (visible_from objective1 waypoint2) + (visible_from objective1 waypoint3) + (visible_from objective1 waypoint4) + (visible_from objective1 waypoint5) + (visible_from objective1 waypoint6) + (visible_from objective2 waypoint0) + (visible_from objective2 waypoint1) + (visible_from objective2 waypoint2) + (visible_from objective2 waypoint3) + (visible_from objective2 waypoint4) + (visible_from objective2 waypoint5) + (visible_from objective2 waypoint6) + (visible_from objective2 waypoint7) + (visible_from objective2 waypoint8) + (visible_from objective2 waypoint9) + (visible_from objective3 waypoint0) + (visible_from objective3 waypoint1) + (visible_from objective4 waypoint0) + (visible_from objective4 waypoint1) + (visible_from objective4 waypoint2) + (visible_from objective4 waypoint3) + (visible_from objective4 waypoint4) + (visible_from objective4 waypoint5) + (visible_from objective4 waypoint6) + (visible_from objective4 waypoint7) + (visible_from objective4 waypoint8) + (visible_from objective4 waypoint9) + (visible_from objective4 waypoint10) +) + +(:goal (and +(communicated_soil_data waypoint4) +(communicated_soil_data waypoint9) +(communicated_soil_data waypoint1) +(communicated_soil_data waypoint7) +(communicated_rock_data waypoint3) +(communicated_rock_data waypoint10) +(communicated_rock_data waypoint5) +(communicated_rock_data waypoint1) +(communicated_image_data objective0 high_res) +(communicated_image_data objective4 high_res) +(communicated_image_data objective2 high_res) + ) +) + +(:metric minimize (recharges)) +) diff --git a/tests/fixtures/pddl_files/rovers-numeric-automatic/p17.pddl b/tests/fixtures/pddl_files/rovers-numeric-automatic/p17.pddl new file mode 100644 index 00000000..b2be4ab0 --- /dev/null +++ b/tests/fixtures/pddl_files/rovers-numeric-automatic/p17.pddl @@ -0,0 +1,430 @@ +(define (problem roverprob5624) (:domain Rover) +(:objects + general - Lander + colour high_res low_res - Mode + rover0 rover1 rover2 rover3 rover4 rover5 - Rover + rover0store rover1store rover2store rover3store rover4store rover5store - Store + waypoint0 waypoint1 waypoint2 waypoint3 waypoint4 waypoint5 waypoint6 waypoint7 waypoint8 waypoint9 waypoint10 waypoint11 waypoint12 waypoint13 waypoint14 - Waypoint + camera0 camera1 camera2 camera3 camera4 camera5 camera6 - Camera + objective0 objective1 objective2 objective3 objective4 objective5 - Objective + ) +(:init + (visible waypoint1 waypoint0) + (visible waypoint0 waypoint1) + (visible waypoint1 waypoint8) + (visible waypoint8 waypoint1) + (visible waypoint1 waypoint11) + (visible waypoint11 waypoint1) + (visible waypoint1 waypoint14) + (visible waypoint14 waypoint1) + (visible waypoint2 waypoint6) + (visible waypoint6 waypoint2) + (visible waypoint2 waypoint9) + (visible waypoint9 waypoint2) + (visible waypoint3 waypoint0) + (visible waypoint0 waypoint3) + (visible waypoint3 waypoint2) + (visible waypoint2 waypoint3) + (visible waypoint3 waypoint6) + (visible waypoint6 waypoint3) + (visible waypoint3 waypoint7) + (visible waypoint7 waypoint3) + (visible waypoint3 waypoint11) + (visible waypoint11 waypoint3) + (visible waypoint3 waypoint13) + (visible waypoint13 waypoint3) + (visible waypoint4 waypoint1) + (visible waypoint1 waypoint4) + (visible waypoint4 waypoint2) + (visible waypoint2 waypoint4) + (visible waypoint4 waypoint10) + (visible waypoint10 waypoint4) + (visible waypoint4 waypoint14) + (visible waypoint14 waypoint4) + (visible waypoint5 waypoint1) + (visible waypoint1 waypoint5) + (visible waypoint5 waypoint2) + (visible waypoint2 waypoint5) + (visible waypoint5 waypoint3) + (visible waypoint3 waypoint5) + (visible waypoint5 waypoint8) + (visible waypoint8 waypoint5) + (visible waypoint5 waypoint14) + (visible waypoint14 waypoint5) + (visible waypoint6 waypoint0) + (visible waypoint0 waypoint6) + (visible waypoint6 waypoint4) + (visible waypoint4 waypoint6) + (visible waypoint6 waypoint5) + (visible waypoint5 waypoint6) + (visible waypoint6 waypoint7) + (visible waypoint7 waypoint6) + (visible waypoint6 waypoint10) + (visible waypoint10 waypoint6) + (visible waypoint6 waypoint12) + (visible waypoint12 waypoint6) + (visible waypoint6 waypoint13) + (visible waypoint13 waypoint6) + (visible waypoint7 waypoint8) + (visible waypoint8 waypoint7) + (visible waypoint7 waypoint9) + (visible waypoint9 waypoint7) + (visible waypoint8 waypoint2) + (visible waypoint2 waypoint8) + (visible waypoint8 waypoint3) + (visible waypoint3 waypoint8) + (visible waypoint8 waypoint10) + (visible waypoint10 waypoint8) + (visible waypoint9 waypoint8) + (visible waypoint8 waypoint9) + (visible waypoint10 waypoint0) + (visible waypoint0 waypoint10) + (visible waypoint10 waypoint3) + (visible waypoint3 waypoint10) + (visible waypoint11 waypoint2) + (visible waypoint2 waypoint11) + (visible waypoint11 waypoint4) + (visible waypoint4 waypoint11) + (visible waypoint11 waypoint8) + (visible waypoint8 waypoint11) + (visible waypoint11 waypoint9) + (visible waypoint9 waypoint11) + (visible waypoint11 waypoint10) + (visible waypoint10 waypoint11) + (visible waypoint12 waypoint0) + (visible waypoint0 waypoint12) + (visible waypoint12 waypoint1) + (visible waypoint1 waypoint12) + (visible waypoint12 waypoint5) + (visible waypoint5 waypoint12) + (visible waypoint12 waypoint7) + (visible waypoint7 waypoint12) + (visible waypoint13 waypoint0) + (visible waypoint0 waypoint13) + (visible waypoint13 waypoint5) + (visible waypoint5 waypoint13) + (visible waypoint13 waypoint14) + (visible waypoint14 waypoint13) + (visible waypoint14 waypoint2) + (visible waypoint2 waypoint14) + (visible waypoint14 waypoint3) + (visible waypoint3 waypoint14) + (visible waypoint14 waypoint9) + (visible waypoint9 waypoint14) + (visible waypoint14 waypoint10) + (visible waypoint10 waypoint14) + (= (recharges) 0) + (at_soil_sample waypoint0) + (in_sun waypoint0) + (at_rock_sample waypoint1) + (at_soil_sample waypoint2) + (at_rock_sample waypoint2) + (at_soil_sample waypoint3) + (at_rock_sample waypoint3) + (in_sun waypoint3) + (at_soil_sample waypoint4) + (at_rock_sample waypoint4) + (at_soil_sample waypoint5) + (at_rock_sample waypoint5) + (at_rock_sample waypoint6) + (at_rock_sample waypoint7) + (in_sun waypoint7) + (at_soil_sample waypoint9) + (at_rock_sample waypoint9) + (at_rock_sample waypoint10) + (at_rock_sample waypoint11) + (at_rock_sample waypoint12) + (at_soil_sample waypoint13) + (at_rock_sample waypoint13) + (at_soil_sample waypoint14) + (at_rock_sample waypoint14) + (at_lander general waypoint13) + (channel_free general) + (= (energy rover0) 50) + (at rover0 waypoint12) + (available rover0) + (store_of rover0store rover0) + (empty rover0store) + (equipped_for_rock_analysis rover0) + (can_traverse rover0 waypoint12 waypoint0) + (can_traverse rover0 waypoint0 waypoint12) + (can_traverse rover0 waypoint12 waypoint1) + (can_traverse rover0 waypoint1 waypoint12) + (can_traverse rover0 waypoint12 waypoint6) + (can_traverse rover0 waypoint6 waypoint12) + (can_traverse rover0 waypoint12 waypoint7) + (can_traverse rover0 waypoint7 waypoint12) + (can_traverse rover0 waypoint0 waypoint3) + (can_traverse rover0 waypoint3 waypoint0) + (can_traverse rover0 waypoint1 waypoint4) + (can_traverse rover0 waypoint4 waypoint1) + (can_traverse rover0 waypoint1 waypoint5) + (can_traverse rover0 waypoint5 waypoint1) + (can_traverse rover0 waypoint1 waypoint8) + (can_traverse rover0 waypoint8 waypoint1) + (can_traverse rover0 waypoint1 waypoint11) + (can_traverse rover0 waypoint11 waypoint1) + (can_traverse rover0 waypoint6 waypoint13) + (can_traverse rover0 waypoint13 waypoint6) + (can_traverse rover0 waypoint7 waypoint9) + (can_traverse rover0 waypoint9 waypoint7) + (= (energy rover1) 50) + (at rover1 waypoint12) + (available rover1) + (store_of rover1store rover1) + (empty rover1store) + (equipped_for_imaging rover1) + (can_traverse rover1 waypoint12 waypoint0) + (can_traverse rover1 waypoint0 waypoint12) + (can_traverse rover1 waypoint12 waypoint1) + (can_traverse rover1 waypoint1 waypoint12) + (can_traverse rover1 waypoint12 waypoint5) + (can_traverse rover1 waypoint5 waypoint12) + (can_traverse rover1 waypoint12 waypoint6) + (can_traverse rover1 waypoint6 waypoint12) + (can_traverse rover1 waypoint0 waypoint3) + (can_traverse rover1 waypoint3 waypoint0) + (can_traverse rover1 waypoint0 waypoint13) + (can_traverse rover1 waypoint13 waypoint0) + (can_traverse rover1 waypoint1 waypoint11) + (can_traverse rover1 waypoint11 waypoint1) + (can_traverse rover1 waypoint1 waypoint14) + (can_traverse rover1 waypoint14 waypoint1) + (can_traverse rover1 waypoint5 waypoint2) + (can_traverse rover1 waypoint2 waypoint5) + (can_traverse rover1 waypoint5 waypoint8) + (can_traverse rover1 waypoint8 waypoint5) + (can_traverse rover1 waypoint6 waypoint4) + (can_traverse rover1 waypoint4 waypoint6) + (can_traverse rover1 waypoint6 waypoint7) + (can_traverse rover1 waypoint7 waypoint6) + (can_traverse rover1 waypoint6 waypoint10) + (can_traverse rover1 waypoint10 waypoint6) + (can_traverse rover1 waypoint11 waypoint9) + (can_traverse rover1 waypoint9 waypoint11) + (= (energy rover2) 50) + (at rover2 waypoint5) + (available rover2) + (store_of rover2store rover2) + (empty rover2store) + (equipped_for_imaging rover2) + (can_traverse rover2 waypoint5 waypoint1) + (can_traverse rover2 waypoint1 waypoint5) + (can_traverse rover2 waypoint5 waypoint2) + (can_traverse rover2 waypoint2 waypoint5) + (can_traverse rover2 waypoint5 waypoint6) + (can_traverse rover2 waypoint6 waypoint5) + (can_traverse rover2 waypoint5 waypoint8) + (can_traverse rover2 waypoint8 waypoint5) + (can_traverse rover2 waypoint5 waypoint13) + (can_traverse rover2 waypoint13 waypoint5) + (can_traverse rover2 waypoint5 waypoint14) + (can_traverse rover2 waypoint14 waypoint5) + (can_traverse rover2 waypoint1 waypoint0) + (can_traverse rover2 waypoint0 waypoint1) + (can_traverse rover2 waypoint1 waypoint4) + (can_traverse rover2 waypoint4 waypoint1) + (can_traverse rover2 waypoint2 waypoint3) + (can_traverse rover2 waypoint3 waypoint2) + (can_traverse rover2 waypoint2 waypoint9) + (can_traverse rover2 waypoint9 waypoint2) + (can_traverse rover2 waypoint2 waypoint11) + (can_traverse rover2 waypoint11 waypoint2) + (can_traverse rover2 waypoint6 waypoint7) + (can_traverse rover2 waypoint7 waypoint6) + (can_traverse rover2 waypoint6 waypoint12) + (can_traverse rover2 waypoint12 waypoint6) + (can_traverse rover2 waypoint8 waypoint10) + (can_traverse rover2 waypoint10 waypoint8) + (= (energy rover3) 50) + (at rover3 waypoint13) + (available rover3) + (store_of rover3store rover3) + (empty rover3store) + (equipped_for_soil_analysis rover3) + (equipped_for_imaging rover3) + (can_traverse rover3 waypoint13 waypoint0) + (can_traverse rover3 waypoint0 waypoint13) + (can_traverse rover3 waypoint13 waypoint3) + (can_traverse rover3 waypoint3 waypoint13) + (can_traverse rover3 waypoint13 waypoint5) + (can_traverse rover3 waypoint5 waypoint13) + (can_traverse rover3 waypoint13 waypoint6) + (can_traverse rover3 waypoint6 waypoint13) + (can_traverse rover3 waypoint0 waypoint1) + (can_traverse rover3 waypoint1 waypoint0) + (can_traverse rover3 waypoint0 waypoint10) + (can_traverse rover3 waypoint10 waypoint0) + (can_traverse rover3 waypoint3 waypoint7) + (can_traverse rover3 waypoint7 waypoint3) + (can_traverse rover3 waypoint3 waypoint8) + (can_traverse rover3 waypoint8 waypoint3) + (can_traverse rover3 waypoint3 waypoint11) + (can_traverse rover3 waypoint11 waypoint3) + (can_traverse rover3 waypoint5 waypoint2) + (can_traverse rover3 waypoint2 waypoint5) + (can_traverse rover3 waypoint5 waypoint12) + (can_traverse rover3 waypoint12 waypoint5) + (can_traverse rover3 waypoint5 waypoint14) + (can_traverse rover3 waypoint14 waypoint5) + (can_traverse rover3 waypoint1 waypoint4) + (can_traverse rover3 waypoint4 waypoint1) + (= (energy rover4) 50) + (at rover4 waypoint1) + (available rover4) + (store_of rover4store rover4) + (empty rover4store) + (equipped_for_rock_analysis rover4) + (equipped_for_imaging rover4) + (can_traverse rover4 waypoint1 waypoint0) + (can_traverse rover4 waypoint0 waypoint1) + (can_traverse rover4 waypoint1 waypoint4) + (can_traverse rover4 waypoint4 waypoint1) + (can_traverse rover4 waypoint1 waypoint5) + (can_traverse rover4 waypoint5 waypoint1) + (can_traverse rover4 waypoint1 waypoint8) + (can_traverse rover4 waypoint8 waypoint1) + (can_traverse rover4 waypoint1 waypoint12) + (can_traverse rover4 waypoint12 waypoint1) + (can_traverse rover4 waypoint1 waypoint14) + (can_traverse rover4 waypoint14 waypoint1) + (can_traverse rover4 waypoint0 waypoint3) + (can_traverse rover4 waypoint3 waypoint0) + (can_traverse rover4 waypoint0 waypoint6) + (can_traverse rover4 waypoint6 waypoint0) + (can_traverse rover4 waypoint0 waypoint10) + (can_traverse rover4 waypoint10 waypoint0) + (can_traverse rover4 waypoint0 waypoint13) + (can_traverse rover4 waypoint13 waypoint0) + (can_traverse rover4 waypoint4 waypoint2) + (can_traverse rover4 waypoint2 waypoint4) + (can_traverse rover4 waypoint4 waypoint11) + (can_traverse rover4 waypoint11 waypoint4) + (can_traverse rover4 waypoint8 waypoint7) + (can_traverse rover4 waypoint7 waypoint8) + (can_traverse rover4 waypoint14 waypoint9) + (can_traverse rover4 waypoint9 waypoint14) + (= (energy rover5) 50) + (at rover5 waypoint8) + (available rover5) + (store_of rover5store rover5) + (empty rover5store) + (equipped_for_rock_analysis rover5) + (equipped_for_imaging rover5) + (can_traverse rover5 waypoint8 waypoint1) + (can_traverse rover5 waypoint1 waypoint8) + (can_traverse rover5 waypoint8 waypoint3) + (can_traverse rover5 waypoint3 waypoint8) + (can_traverse rover5 waypoint8 waypoint5) + (can_traverse rover5 waypoint5 waypoint8) + (can_traverse rover5 waypoint8 waypoint7) + (can_traverse rover5 waypoint7 waypoint8) + (can_traverse rover5 waypoint8 waypoint9) + (can_traverse rover5 waypoint9 waypoint8) + (can_traverse rover5 waypoint8 waypoint10) + (can_traverse rover5 waypoint10 waypoint8) + (can_traverse rover5 waypoint8 waypoint11) + (can_traverse rover5 waypoint11 waypoint8) + (can_traverse rover5 waypoint1 waypoint4) + (can_traverse rover5 waypoint4 waypoint1) + (can_traverse rover5 waypoint1 waypoint12) + (can_traverse rover5 waypoint12 waypoint1) + (can_traverse rover5 waypoint1 waypoint14) + (can_traverse rover5 waypoint14 waypoint1) + (can_traverse rover5 waypoint3 waypoint0) + (can_traverse rover5 waypoint0 waypoint3) + (can_traverse rover5 waypoint3 waypoint6) + (can_traverse rover5 waypoint6 waypoint3) + (can_traverse rover5 waypoint5 waypoint2) + (can_traverse rover5 waypoint2 waypoint5) + (can_traverse rover5 waypoint5 waypoint13) + (can_traverse rover5 waypoint13 waypoint5) + (on_board camera0 rover4) + (calibration_target camera0 objective2) + (supports camera0 high_res) + (supports camera0 low_res) + (on_board camera1 rover3) + (calibration_target camera1 objective2) + (supports camera1 colour) + (on_board camera2 rover5) + (calibration_target camera2 objective1) + (supports camera2 colour) + (supports camera2 high_res) + (on_board camera3 rover3) + (calibration_target camera3 objective5) + (supports camera3 colour) + (on_board camera4 rover5) + (calibration_target camera4 objective3) + (supports camera4 colour) + (supports camera4 high_res) + (supports camera4 low_res) + (on_board camera5 rover1) + (calibration_target camera5 objective0) + (supports camera5 low_res) + (on_board camera6 rover2) + (calibration_target camera6 objective5) + (supports camera6 colour) + (supports camera6 high_res) + (visible_from objective0 waypoint0) + (visible_from objective0 waypoint1) + (visible_from objective0 waypoint2) + (visible_from objective0 waypoint3) + (visible_from objective1 waypoint0) + (visible_from objective1 waypoint1) + (visible_from objective2 waypoint0) + (visible_from objective2 waypoint1) + (visible_from objective2 waypoint2) + (visible_from objective2 waypoint3) + (visible_from objective2 waypoint4) + (visible_from objective2 waypoint5) + (visible_from objective2 waypoint6) + (visible_from objective2 waypoint7) + (visible_from objective2 waypoint8) + (visible_from objective2 waypoint9) + (visible_from objective2 waypoint10) + (visible_from objective2 waypoint11) + (visible_from objective2 waypoint12) + (visible_from objective2 waypoint13) + (visible_from objective2 waypoint14) + (visible_from objective3 waypoint0) + (visible_from objective3 waypoint1) + (visible_from objective3 waypoint2) + (visible_from objective3 waypoint3) + (visible_from objective3 waypoint4) + (visible_from objective3 waypoint5) + (visible_from objective4 waypoint0) + (visible_from objective4 waypoint1) + (visible_from objective4 waypoint2) + (visible_from objective4 waypoint3) + (visible_from objective4 waypoint4) + (visible_from objective4 waypoint5) + (visible_from objective4 waypoint6) + (visible_from objective4 waypoint7) + (visible_from objective4 waypoint8) + (visible_from objective4 waypoint9) + (visible_from objective4 waypoint10) + (visible_from objective4 waypoint11) + (visible_from objective4 waypoint12) + (visible_from objective5 waypoint0) + (visible_from objective5 waypoint1) +) + +(:goal (and +(communicated_soil_data waypoint14) +(communicated_soil_data waypoint5) +(communicated_soil_data waypoint2) +(communicated_soil_data waypoint3) +(communicated_rock_data waypoint3) +(communicated_rock_data waypoint5) +(communicated_rock_data waypoint12) +(communicated_rock_data waypoint9) +(communicated_image_data objective2 colour) +(communicated_image_data objective2 low_res) +(communicated_image_data objective3 colour) +(communicated_image_data objective5 colour) +(communicated_image_data objective4 colour) + ) +) + +(:metric minimize (recharges)) +) diff --git a/tests/fixtures/pddl_files/rovers-numeric-automatic/p18.pddl b/tests/fixtures/pddl_files/rovers-numeric-automatic/p18.pddl new file mode 100644 index 00000000..426c3d89 --- /dev/null +++ b/tests/fixtures/pddl_files/rovers-numeric-automatic/p18.pddl @@ -0,0 +1,590 @@ +(define (problem roverprob4621) (:domain Rover) +(:objects + general - Lander + colour high_res low_res - Mode + rover0 rover1 rover2 rover3 rover4 rover5 - Rover + rover0store rover1store rover2store rover3store rover4store rover5store - Store + waypoint0 waypoint1 waypoint2 waypoint3 waypoint4 waypoint5 waypoint6 waypoint7 waypoint8 waypoint9 waypoint10 waypoint11 waypoint12 waypoint13 waypoint14 waypoint15 waypoint16 waypoint17 waypoint18 waypoint19 - Waypoint + camera0 camera1 camera2 camera3 camera4 camera5 camera6 - Camera + objective0 objective1 objective2 objective3 objective4 objective5 objective6 - Objective + ) +(:init + (visible waypoint0 waypoint1) + (visible waypoint1 waypoint0) + (visible waypoint0 waypoint2) + (visible waypoint2 waypoint0) + (visible waypoint0 waypoint12) + (visible waypoint12 waypoint0) + (visible waypoint0 waypoint13) + (visible waypoint13 waypoint0) + (visible waypoint1 waypoint2) + (visible waypoint2 waypoint1) + (visible waypoint1 waypoint6) + (visible waypoint6 waypoint1) + (visible waypoint1 waypoint11) + (visible waypoint11 waypoint1) + (visible waypoint1 waypoint15) + (visible waypoint15 waypoint1) + (visible waypoint2 waypoint6) + (visible waypoint6 waypoint2) + (visible waypoint2 waypoint9) + (visible waypoint9 waypoint2) + (visible waypoint2 waypoint14) + (visible waypoint14 waypoint2) + (visible waypoint2 waypoint16) + (visible waypoint16 waypoint2) + (visible waypoint2 waypoint18) + (visible waypoint18 waypoint2) + (visible waypoint3 waypoint7) + (visible waypoint7 waypoint3) + (visible waypoint3 waypoint11) + (visible waypoint11 waypoint3) + (visible waypoint3 waypoint13) + (visible waypoint13 waypoint3) + (visible waypoint3 waypoint15) + (visible waypoint15 waypoint3) + (visible waypoint4 waypoint5) + (visible waypoint5 waypoint4) + (visible waypoint4 waypoint9) + (visible waypoint9 waypoint4) + (visible waypoint4 waypoint12) + (visible waypoint12 waypoint4) + (visible waypoint4 waypoint18) + (visible waypoint18 waypoint4) + (visible waypoint5 waypoint6) + (visible waypoint6 waypoint5) + (visible waypoint5 waypoint10) + (visible waypoint10 waypoint5) + (visible waypoint5 waypoint12) + (visible waypoint12 waypoint5) + (visible waypoint5 waypoint14) + (visible waypoint14 waypoint5) + (visible waypoint6 waypoint3) + (visible waypoint3 waypoint6) + (visible waypoint6 waypoint12) + (visible waypoint12 waypoint6) + (visible waypoint6 waypoint13) + (visible waypoint13 waypoint6) + (visible waypoint6 waypoint14) + (visible waypoint14 waypoint6) + (visible waypoint6 waypoint19) + (visible waypoint19 waypoint6) + (visible waypoint7 waypoint1) + (visible waypoint1 waypoint7) + (visible waypoint7 waypoint2) + (visible waypoint2 waypoint7) + (visible waypoint7 waypoint5) + (visible waypoint5 waypoint7) + (visible waypoint7 waypoint9) + (visible waypoint9 waypoint7) + (visible waypoint8 waypoint14) + (visible waypoint14 waypoint8) + (visible waypoint9 waypoint0) + (visible waypoint0 waypoint9) + (visible waypoint9 waypoint3) + (visible waypoint3 waypoint9) + (visible waypoint9 waypoint5) + (visible waypoint5 waypoint9) + (visible waypoint9 waypoint6) + (visible waypoint6 waypoint9) + (visible waypoint9 waypoint8) + (visible waypoint8 waypoint9) + (visible waypoint9 waypoint12) + (visible waypoint12 waypoint9) + (visible waypoint10 waypoint3) + (visible waypoint3 waypoint10) + (visible waypoint10 waypoint7) + (visible waypoint7 waypoint10) + (visible waypoint10 waypoint8) + (visible waypoint8 waypoint10) + (visible waypoint10 waypoint9) + (visible waypoint9 waypoint10) + (visible waypoint10 waypoint16) + (visible waypoint16 waypoint10) + (visible waypoint11 waypoint4) + (visible waypoint4 waypoint11) + (visible waypoint11 waypoint5) + (visible waypoint5 waypoint11) + (visible waypoint11 waypoint7) + (visible waypoint7 waypoint11) + (visible waypoint11 waypoint12) + (visible waypoint12 waypoint11) + (visible waypoint11 waypoint16) + (visible waypoint16 waypoint11) + (visible waypoint12 waypoint1) + (visible waypoint1 waypoint12) + (visible waypoint12 waypoint8) + (visible waypoint8 waypoint12) + (visible waypoint12 waypoint14) + (visible waypoint14 waypoint12) + (visible waypoint12 waypoint19) + (visible waypoint19 waypoint12) + (visible waypoint13 waypoint4) + (visible waypoint4 waypoint13) + (visible waypoint13 waypoint19) + (visible waypoint19 waypoint13) + (visible waypoint14 waypoint9) + (visible waypoint9 waypoint14) + (visible waypoint14 waypoint15) + (visible waypoint15 waypoint14) + (visible waypoint15 waypoint6) + (visible waypoint6 waypoint15) + (visible waypoint16 waypoint0) + (visible waypoint0 waypoint16) + (visible waypoint16 waypoint12) + (visible waypoint12 waypoint16) + (visible waypoint16 waypoint13) + (visible waypoint13 waypoint16) + (visible waypoint17 waypoint0) + (visible waypoint0 waypoint17) + (visible waypoint17 waypoint11) + (visible waypoint11 waypoint17) + (visible waypoint18 waypoint0) + (visible waypoint0 waypoint18) + (visible waypoint18 waypoint9) + (visible waypoint9 waypoint18) + (visible waypoint18 waypoint11) + (visible waypoint11 waypoint18) + (visible waypoint19 waypoint9) + (visible waypoint9 waypoint19) + (visible waypoint19 waypoint14) + (visible waypoint14 waypoint19) + (visible waypoint19 waypoint15) + (visible waypoint15 waypoint19) + (visible waypoint19 waypoint16) + (visible waypoint16 waypoint19) + (visible waypoint19 waypoint17) + (visible waypoint17 waypoint19) + (= (recharges) 0) + (at_soil_sample waypoint0) + (at_rock_sample waypoint1) + (at_rock_sample waypoint2) + (at_soil_sample waypoint3) + (in_sun waypoint3) + (at_rock_sample waypoint4) + (in_sun waypoint4) + (at_rock_sample waypoint5) + (at_rock_sample waypoint6) + (at_rock_sample waypoint7) + (at_soil_sample waypoint8) + (at_soil_sample waypoint9) + (at_rock_sample waypoint9) + (in_sun waypoint9) + (at_soil_sample waypoint10) + (in_sun waypoint10) + (at_soil_sample waypoint11) + (at_soil_sample waypoint12) + (at_rock_sample waypoint12) + (at_soil_sample waypoint13) + (at_rock_sample waypoint13) + (at_soil_sample waypoint14) + (at_soil_sample waypoint15) + (in_sun waypoint16) + (at_soil_sample waypoint17) + (at_rock_sample waypoint17) + (at_soil_sample waypoint18) + (at_rock_sample waypoint18) + (in_sun waypoint18) + (at_soil_sample waypoint19) + (at_lander general waypoint17) + (channel_free general) + (= (energy rover0) 50) + (at rover0 waypoint2) + (available rover0) + (store_of rover0store rover0) + (empty rover0store) + (equipped_for_soil_analysis rover0) + (equipped_for_rock_analysis rover0) + (equipped_for_imaging rover0) + (can_traverse rover0 waypoint2 waypoint0) + (can_traverse rover0 waypoint0 waypoint2) + (can_traverse rover0 waypoint2 waypoint6) + (can_traverse rover0 waypoint6 waypoint2) + (can_traverse rover0 waypoint2 waypoint7) + (can_traverse rover0 waypoint7 waypoint2) + (can_traverse rover0 waypoint2 waypoint9) + (can_traverse rover0 waypoint9 waypoint2) + (can_traverse rover0 waypoint2 waypoint14) + (can_traverse rover0 waypoint14 waypoint2) + (can_traverse rover0 waypoint2 waypoint18) + (can_traverse rover0 waypoint18 waypoint2) + (can_traverse rover0 waypoint0 waypoint12) + (can_traverse rover0 waypoint12 waypoint0) + (can_traverse rover0 waypoint0 waypoint13) + (can_traverse rover0 waypoint13 waypoint0) + (can_traverse rover0 waypoint6 waypoint1) + (can_traverse rover0 waypoint1 waypoint6) + (can_traverse rover0 waypoint6 waypoint15) + (can_traverse rover0 waypoint15 waypoint6) + (can_traverse rover0 waypoint6 waypoint19) + (can_traverse rover0 waypoint19 waypoint6) + (can_traverse rover0 waypoint7 waypoint3) + (can_traverse rover0 waypoint3 waypoint7) + (can_traverse rover0 waypoint7 waypoint11) + (can_traverse rover0 waypoint11 waypoint7) + (can_traverse rover0 waypoint9 waypoint4) + (can_traverse rover0 waypoint4 waypoint9) + (can_traverse rover0 waypoint9 waypoint5) + (can_traverse rover0 waypoint5 waypoint9) + (can_traverse rover0 waypoint9 waypoint8) + (can_traverse rover0 waypoint8 waypoint9) + (can_traverse rover0 waypoint13 waypoint16) + (can_traverse rover0 waypoint16 waypoint13) + (can_traverse rover0 waypoint5 waypoint10) + (can_traverse rover0 waypoint10 waypoint5) + (= (energy rover1) 50) + (at rover1 waypoint9) + (available rover1) + (store_of rover1store rover1) + (empty rover1store) + (equipped_for_rock_analysis rover1) + (equipped_for_imaging rover1) + (can_traverse rover1 waypoint9 waypoint0) + (can_traverse rover1 waypoint0 waypoint9) + (can_traverse rover1 waypoint9 waypoint3) + (can_traverse rover1 waypoint3 waypoint9) + (can_traverse rover1 waypoint9 waypoint4) + (can_traverse rover1 waypoint4 waypoint9) + (can_traverse rover1 waypoint9 waypoint7) + (can_traverse rover1 waypoint7 waypoint9) + (can_traverse rover1 waypoint9 waypoint10) + (can_traverse rover1 waypoint10 waypoint9) + (can_traverse rover1 waypoint9 waypoint12) + (can_traverse rover1 waypoint12 waypoint9) + (can_traverse rover1 waypoint9 waypoint14) + (can_traverse rover1 waypoint14 waypoint9) + (can_traverse rover1 waypoint9 waypoint18) + (can_traverse rover1 waypoint18 waypoint9) + (can_traverse rover1 waypoint9 waypoint19) + (can_traverse rover1 waypoint19 waypoint9) + (can_traverse rover1 waypoint0 waypoint2) + (can_traverse rover1 waypoint2 waypoint0) + (can_traverse rover1 waypoint0 waypoint13) + (can_traverse rover1 waypoint13 waypoint0) + (can_traverse rover1 waypoint0 waypoint16) + (can_traverse rover1 waypoint16 waypoint0) + (can_traverse rover1 waypoint3 waypoint6) + (can_traverse rover1 waypoint6 waypoint3) + (can_traverse rover1 waypoint4 waypoint11) + (can_traverse rover1 waypoint11 waypoint4) + (can_traverse rover1 waypoint7 waypoint5) + (can_traverse rover1 waypoint5 waypoint7) + (can_traverse rover1 waypoint10 waypoint8) + (can_traverse rover1 waypoint8 waypoint10) + (can_traverse rover1 waypoint12 waypoint1) + (can_traverse rover1 waypoint1 waypoint12) + (can_traverse rover1 waypoint14 waypoint15) + (can_traverse rover1 waypoint15 waypoint14) + (can_traverse rover1 waypoint19 waypoint17) + (can_traverse rover1 waypoint17 waypoint19) + (= (energy rover2) 50) + (at rover2 waypoint0) + (available rover2) + (store_of rover2store rover2) + (empty rover2store) + (equipped_for_soil_analysis rover2) + (equipped_for_imaging rover2) + (can_traverse rover2 waypoint0 waypoint1) + (can_traverse rover2 waypoint1 waypoint0) + (can_traverse rover2 waypoint0 waypoint9) + (can_traverse rover2 waypoint9 waypoint0) + (can_traverse rover2 waypoint0 waypoint13) + (can_traverse rover2 waypoint13 waypoint0) + (can_traverse rover2 waypoint0 waypoint16) + (can_traverse rover2 waypoint16 waypoint0) + (can_traverse rover2 waypoint0 waypoint17) + (can_traverse rover2 waypoint17 waypoint0) + (can_traverse rover2 waypoint0 waypoint18) + (can_traverse rover2 waypoint18 waypoint0) + (can_traverse rover2 waypoint1 waypoint2) + (can_traverse rover2 waypoint2 waypoint1) + (can_traverse rover2 waypoint1 waypoint6) + (can_traverse rover2 waypoint6 waypoint1) + (can_traverse rover2 waypoint1 waypoint11) + (can_traverse rover2 waypoint11 waypoint1) + (can_traverse rover2 waypoint1 waypoint12) + (can_traverse rover2 waypoint12 waypoint1) + (can_traverse rover2 waypoint1 waypoint15) + (can_traverse rover2 waypoint15 waypoint1) + (can_traverse rover2 waypoint9 waypoint3) + (can_traverse rover2 waypoint3 waypoint9) + (can_traverse rover2 waypoint9 waypoint4) + (can_traverse rover2 waypoint4 waypoint9) + (can_traverse rover2 waypoint9 waypoint5) + (can_traverse rover2 waypoint5 waypoint9) + (can_traverse rover2 waypoint9 waypoint7) + (can_traverse rover2 waypoint7 waypoint9) + (can_traverse rover2 waypoint9 waypoint10) + (can_traverse rover2 waypoint10 waypoint9) + (can_traverse rover2 waypoint9 waypoint14) + (can_traverse rover2 waypoint14 waypoint9) + (can_traverse rover2 waypoint9 waypoint19) + (can_traverse rover2 waypoint19 waypoint9) + (= (energy rover3) 50) + (at rover3 waypoint18) + (available rover3) + (store_of rover3store rover3) + (empty rover3store) + (equipped_for_rock_analysis rover3) + (equipped_for_imaging rover3) + (can_traverse rover3 waypoint18 waypoint0) + (can_traverse rover3 waypoint0 waypoint18) + (can_traverse rover3 waypoint18 waypoint4) + (can_traverse rover3 waypoint4 waypoint18) + (can_traverse rover3 waypoint18 waypoint11) + (can_traverse rover3 waypoint11 waypoint18) + (can_traverse rover3 waypoint0 waypoint1) + (can_traverse rover3 waypoint1 waypoint0) + (can_traverse rover3 waypoint0 waypoint2) + (can_traverse rover3 waypoint2 waypoint0) + (can_traverse rover3 waypoint0 waypoint9) + (can_traverse rover3 waypoint9 waypoint0) + (can_traverse rover3 waypoint0 waypoint12) + (can_traverse rover3 waypoint12 waypoint0) + (can_traverse rover3 waypoint0 waypoint17) + (can_traverse rover3 waypoint17 waypoint0) + (can_traverse rover3 waypoint11 waypoint16) + (can_traverse rover3 waypoint16 waypoint11) + (can_traverse rover3 waypoint1 waypoint6) + (can_traverse rover3 waypoint6 waypoint1) + (can_traverse rover3 waypoint1 waypoint7) + (can_traverse rover3 waypoint7 waypoint1) + (can_traverse rover3 waypoint1 waypoint15) + (can_traverse rover3 waypoint15 waypoint1) + (can_traverse rover3 waypoint2 waypoint14) + (can_traverse rover3 waypoint14 waypoint2) + (can_traverse rover3 waypoint9 waypoint3) + (can_traverse rover3 waypoint3 waypoint9) + (can_traverse rover3 waypoint9 waypoint5) + (can_traverse rover3 waypoint5 waypoint9) + (can_traverse rover3 waypoint9 waypoint8) + (can_traverse rover3 waypoint8 waypoint9) + (can_traverse rover3 waypoint12 waypoint19) + (can_traverse rover3 waypoint19 waypoint12) + (can_traverse rover3 waypoint16 waypoint13) + (can_traverse rover3 waypoint13 waypoint16) + (can_traverse rover3 waypoint7 waypoint10) + (can_traverse rover3 waypoint10 waypoint7) + (= (energy rover4) 50) + (at rover4 waypoint3) + (available rover4) + (store_of rover4store rover4) + (empty rover4store) + (equipped_for_soil_analysis rover4) + (equipped_for_imaging rover4) + (can_traverse rover4 waypoint3 waypoint6) + (can_traverse rover4 waypoint6 waypoint3) + (can_traverse rover4 waypoint3 waypoint7) + (can_traverse rover4 waypoint7 waypoint3) + (can_traverse rover4 waypoint3 waypoint9) + (can_traverse rover4 waypoint9 waypoint3) + (can_traverse rover4 waypoint3 waypoint10) + (can_traverse rover4 waypoint10 waypoint3) + (can_traverse rover4 waypoint3 waypoint11) + (can_traverse rover4 waypoint11 waypoint3) + (can_traverse rover4 waypoint3 waypoint13) + (can_traverse rover4 waypoint13 waypoint3) + (can_traverse rover4 waypoint3 waypoint15) + (can_traverse rover4 waypoint15 waypoint3) + (can_traverse rover4 waypoint6 waypoint5) + (can_traverse rover4 waypoint5 waypoint6) + (can_traverse rover4 waypoint6 waypoint12) + (can_traverse rover4 waypoint12 waypoint6) + (can_traverse rover4 waypoint6 waypoint14) + (can_traverse rover4 waypoint14 waypoint6) + (can_traverse rover4 waypoint9 waypoint0) + (can_traverse rover4 waypoint0 waypoint9) + (can_traverse rover4 waypoint9 waypoint4) + (can_traverse rover4 waypoint4 waypoint9) + (can_traverse rover4 waypoint9 waypoint8) + (can_traverse rover4 waypoint8 waypoint9) + (can_traverse rover4 waypoint9 waypoint19) + (can_traverse rover4 waypoint19 waypoint9) + (can_traverse rover4 waypoint10 waypoint16) + (can_traverse rover4 waypoint16 waypoint10) + (can_traverse rover4 waypoint11 waypoint17) + (can_traverse rover4 waypoint17 waypoint11) + (can_traverse rover4 waypoint11 waypoint18) + (can_traverse rover4 waypoint18 waypoint11) + (can_traverse rover4 waypoint15 waypoint1) + (can_traverse rover4 waypoint1 waypoint15) + (can_traverse rover4 waypoint14 waypoint2) + (can_traverse rover4 waypoint2 waypoint14) + (= (energy rover5) 50) + (at rover5 waypoint0) + (available rover5) + (store_of rover5store rover5) + (empty rover5store) + (equipped_for_rock_analysis rover5) + (equipped_for_imaging rover5) + (can_traverse rover5 waypoint0 waypoint1) + (can_traverse rover5 waypoint1 waypoint0) + (can_traverse rover5 waypoint0 waypoint12) + (can_traverse rover5 waypoint12 waypoint0) + (can_traverse rover5 waypoint0 waypoint13) + (can_traverse rover5 waypoint13 waypoint0) + (can_traverse rover5 waypoint0 waypoint17) + (can_traverse rover5 waypoint17 waypoint0) + (can_traverse rover5 waypoint0 waypoint18) + (can_traverse rover5 waypoint18 waypoint0) + (can_traverse rover5 waypoint1 waypoint2) + (can_traverse rover5 waypoint2 waypoint1) + (can_traverse rover5 waypoint1 waypoint6) + (can_traverse rover5 waypoint6 waypoint1) + (can_traverse rover5 waypoint1 waypoint7) + (can_traverse rover5 waypoint7 waypoint1) + (can_traverse rover5 waypoint1 waypoint11) + (can_traverse rover5 waypoint11 waypoint1) + (can_traverse rover5 waypoint1 waypoint15) + (can_traverse rover5 waypoint15 waypoint1) + (can_traverse rover5 waypoint12 waypoint4) + (can_traverse rover5 waypoint4 waypoint12) + (can_traverse rover5 waypoint12 waypoint5) + (can_traverse rover5 waypoint5 waypoint12) + (can_traverse rover5 waypoint12 waypoint8) + (can_traverse rover5 waypoint8 waypoint12) + (can_traverse rover5 waypoint12 waypoint9) + (can_traverse rover5 waypoint9 waypoint12) + (can_traverse rover5 waypoint12 waypoint14) + (can_traverse rover5 waypoint14 waypoint12) + (can_traverse rover5 waypoint12 waypoint19) + (can_traverse rover5 waypoint19 waypoint12) + (can_traverse rover5 waypoint13 waypoint16) + (can_traverse rover5 waypoint16 waypoint13) + (can_traverse rover5 waypoint7 waypoint3) + (can_traverse rover5 waypoint3 waypoint7) + (can_traverse rover5 waypoint7 waypoint10) + (can_traverse rover5 waypoint10 waypoint7) + (on_board camera0 rover1) + (calibration_target camera0 objective4) + (supports camera0 high_res) + (on_board camera1 rover2) + (calibration_target camera1 objective6) + (supports camera1 colour) + (supports camera1 low_res) + (on_board camera2 rover4) + (calibration_target camera2 objective0) + (supports camera2 colour) + (supports camera2 high_res) + (on_board camera3 rover3) + (calibration_target camera3 objective6) + (supports camera3 colour) + (on_board camera4 rover3) + (calibration_target camera4 objective4) + (supports camera4 high_res) + (supports camera4 low_res) + (on_board camera5 rover0) + (calibration_target camera5 objective2) + (supports camera5 colour) + (on_board camera6 rover5) + (calibration_target camera6 objective6) + (supports camera6 high_res) + (supports camera6 low_res) + (visible_from objective0 waypoint0) + (visible_from objective0 waypoint1) + (visible_from objective0 waypoint2) + (visible_from objective0 waypoint3) + (visible_from objective0 waypoint4) + (visible_from objective0 waypoint5) + (visible_from objective0 waypoint6) + (visible_from objective0 waypoint7) + (visible_from objective0 waypoint8) + (visible_from objective0 waypoint9) + (visible_from objective0 waypoint10) + (visible_from objective1 waypoint0) + (visible_from objective1 waypoint1) + (visible_from objective1 waypoint2) + (visible_from objective1 waypoint3) + (visible_from objective1 waypoint4) + (visible_from objective1 waypoint5) + (visible_from objective1 waypoint6) + (visible_from objective1 waypoint7) + (visible_from objective1 waypoint8) + (visible_from objective1 waypoint9) + (visible_from objective1 waypoint10) + (visible_from objective1 waypoint11) + (visible_from objective1 waypoint12) + (visible_from objective2 waypoint0) + (visible_from objective2 waypoint1) + (visible_from objective2 waypoint2) + (visible_from objective2 waypoint3) + (visible_from objective2 waypoint4) + (visible_from objective2 waypoint5) + (visible_from objective2 waypoint6) + (visible_from objective2 waypoint7) + (visible_from objective2 waypoint8) + (visible_from objective2 waypoint9) + (visible_from objective2 waypoint10) + (visible_from objective2 waypoint11) + (visible_from objective2 waypoint12) + (visible_from objective2 waypoint13) + (visible_from objective2 waypoint14) + (visible_from objective3 waypoint0) + (visible_from objective3 waypoint1) + (visible_from objective3 waypoint2) + (visible_from objective3 waypoint3) + (visible_from objective3 waypoint4) + (visible_from objective3 waypoint5) + (visible_from objective3 waypoint6) + (visible_from objective3 waypoint7) + (visible_from objective3 waypoint8) + (visible_from objective3 waypoint9) + (visible_from objective3 waypoint10) + (visible_from objective3 waypoint11) + (visible_from objective3 waypoint12) + (visible_from objective3 waypoint13) + (visible_from objective3 waypoint14) + (visible_from objective3 waypoint15) + (visible_from objective3 waypoint16) + (visible_from objective3 waypoint17) + (visible_from objective3 waypoint18) + (visible_from objective3 waypoint19) + (visible_from objective4 waypoint0) + (visible_from objective4 waypoint1) + (visible_from objective4 waypoint2) + (visible_from objective4 waypoint3) + (visible_from objective4 waypoint4) + (visible_from objective4 waypoint5) + (visible_from objective4 waypoint6) + (visible_from objective4 waypoint7) + (visible_from objective4 waypoint8) + (visible_from objective4 waypoint9) + (visible_from objective4 waypoint10) + (visible_from objective4 waypoint11) + (visible_from objective4 waypoint12) + (visible_from objective4 waypoint13) + (visible_from objective4 waypoint14) + (visible_from objective4 waypoint15) + (visible_from objective5 waypoint0) + (visible_from objective5 waypoint1) + (visible_from objective5 waypoint2) + (visible_from objective6 waypoint0) + (visible_from objective6 waypoint1) + (visible_from objective6 waypoint2) + (visible_from objective6 waypoint3) + (visible_from objective6 waypoint4) + (visible_from objective6 waypoint5) + (visible_from objective6 waypoint6) + (visible_from objective6 waypoint7) + (visible_from objective6 waypoint8) + (visible_from objective6 waypoint9) + (visible_from objective6 waypoint10) +) + +(:goal (and +(communicated_soil_data waypoint14) +(communicated_soil_data waypoint0) +(communicated_rock_data waypoint4) +(communicated_rock_data waypoint7) +(communicated_rock_data waypoint2) +(communicated_rock_data waypoint5) +(communicated_rock_data waypoint6) +(communicated_image_data objective5 colour) +(communicated_image_data objective3 low_res) +(communicated_image_data objective2 colour) +(communicated_image_data objective4 high_res) + ) +) + +(:metric minimize (recharges)) +) diff --git a/tests/fixtures/pddl_files/rovers-numeric-automatic/p19.pddl b/tests/fixtures/pddl_files/rovers-numeric-automatic/p19.pddl new file mode 100644 index 00000000..f9365e68 --- /dev/null +++ b/tests/fixtures/pddl_files/rovers-numeric-automatic/p19.pddl @@ -0,0 +1,614 @@ +(define (problem roverprob8327) (:domain Rover) +(:objects + general - Lander + colour high_res low_res - Mode + rover0 rover1 rover2 rover3 rover4 rover5 - Rover + rover0store rover1store rover2store rover3store rover4store rover5store - Store + waypoint0 waypoint1 waypoint2 waypoint3 waypoint4 waypoint5 waypoint6 waypoint7 waypoint8 waypoint9 waypoint10 waypoint11 waypoint12 waypoint13 waypoint14 waypoint15 waypoint16 waypoint17 waypoint18 waypoint19 - Waypoint + camera0 camera1 camera2 camera3 camera4 camera5 camera6 - Camera + objective0 objective1 objective2 objective3 objective4 objective5 objective6 objective7 - Objective + ) +(:init + (visible waypoint0 waypoint6) + (visible waypoint6 waypoint0) + (visible waypoint0 waypoint7) + (visible waypoint7 waypoint0) + (visible waypoint0 waypoint18) + (visible waypoint18 waypoint0) + (visible waypoint1 waypoint11) + (visible waypoint11 waypoint1) + (visible waypoint2 waypoint0) + (visible waypoint0 waypoint2) + (visible waypoint2 waypoint5) + (visible waypoint5 waypoint2) + (visible waypoint2 waypoint7) + (visible waypoint7 waypoint2) + (visible waypoint2 waypoint10) + (visible waypoint10 waypoint2) + (visible waypoint2 waypoint18) + (visible waypoint18 waypoint2) + (visible waypoint2 waypoint19) + (visible waypoint19 waypoint2) + (visible waypoint3 waypoint2) + (visible waypoint2 waypoint3) + (visible waypoint3 waypoint9) + (visible waypoint9 waypoint3) + (visible waypoint3 waypoint10) + (visible waypoint10 waypoint3) + (visible waypoint3 waypoint14) + (visible waypoint14 waypoint3) + (visible waypoint4 waypoint1) + (visible waypoint1 waypoint4) + (visible waypoint4 waypoint2) + (visible waypoint2 waypoint4) + (visible waypoint4 waypoint3) + (visible waypoint3 waypoint4) + (visible waypoint4 waypoint9) + (visible waypoint9 waypoint4) + (visible waypoint4 waypoint12) + (visible waypoint12 waypoint4) + (visible waypoint4 waypoint17) + (visible waypoint17 waypoint4) + (visible waypoint5 waypoint0) + (visible waypoint0 waypoint5) + (visible waypoint5 waypoint3) + (visible waypoint3 waypoint5) + (visible waypoint5 waypoint13) + (visible waypoint13 waypoint5) + (visible waypoint5 waypoint15) + (visible waypoint15 waypoint5) + (visible waypoint5 waypoint16) + (visible waypoint16 waypoint5) + (visible waypoint5 waypoint17) + (visible waypoint17 waypoint5) + (visible waypoint5 waypoint19) + (visible waypoint19 waypoint5) + (visible waypoint6 waypoint1) + (visible waypoint1 waypoint6) + (visible waypoint6 waypoint8) + (visible waypoint8 waypoint6) + (visible waypoint6 waypoint16) + (visible waypoint16 waypoint6) + (visible waypoint6 waypoint19) + (visible waypoint19 waypoint6) + (visible waypoint7 waypoint3) + (visible waypoint3 waypoint7) + (visible waypoint7 waypoint4) + (visible waypoint4 waypoint7) + (visible waypoint7 waypoint8) + (visible waypoint8 waypoint7) + (visible waypoint7 waypoint9) + (visible waypoint9 waypoint7) + (visible waypoint7 waypoint13) + (visible waypoint13 waypoint7) + (visible waypoint8 waypoint2) + (visible waypoint2 waypoint8) + (visible waypoint8 waypoint14) + (visible waypoint14 waypoint8) + (visible waypoint8 waypoint18) + (visible waypoint18 waypoint8) + (visible waypoint9 waypoint0) + (visible waypoint0 waypoint9) + (visible waypoint9 waypoint1) + (visible waypoint1 waypoint9) + (visible waypoint9 waypoint2) + (visible waypoint2 waypoint9) + (visible waypoint9 waypoint10) + (visible waypoint10 waypoint9) + (visible waypoint10 waypoint4) + (visible waypoint4 waypoint10) + (visible waypoint10 waypoint12) + (visible waypoint12 waypoint10) + (visible waypoint10 waypoint14) + (visible waypoint14 waypoint10) + (visible waypoint11 waypoint5) + (visible waypoint5 waypoint11) + (visible waypoint11 waypoint7) + (visible waypoint7 waypoint11) + (visible waypoint11 waypoint8) + (visible waypoint8 waypoint11) + (visible waypoint11 waypoint9) + (visible waypoint9 waypoint11) + (visible waypoint11 waypoint17) + (visible waypoint17 waypoint11) + (visible waypoint11 waypoint19) + (visible waypoint19 waypoint11) + (visible waypoint12 waypoint1) + (visible waypoint1 waypoint12) + (visible waypoint12 waypoint5) + (visible waypoint5 waypoint12) + (visible waypoint12 waypoint7) + (visible waypoint7 waypoint12) + (visible waypoint12 waypoint9) + (visible waypoint9 waypoint12) + (visible waypoint12 waypoint15) + (visible waypoint15 waypoint12) + (visible waypoint12 waypoint16) + (visible waypoint16 waypoint12) + (visible waypoint13 waypoint0) + (visible waypoint0 waypoint13) + (visible waypoint13 waypoint6) + (visible waypoint6 waypoint13) + (visible waypoint14 waypoint11) + (visible waypoint11 waypoint14) + (visible waypoint14 waypoint12) + (visible waypoint12 waypoint14) + (visible waypoint14 waypoint19) + (visible waypoint19 waypoint14) + (visible waypoint15 waypoint6) + (visible waypoint6 waypoint15) + (visible waypoint15 waypoint11) + (visible waypoint11 waypoint15) + (visible waypoint16 waypoint1) + (visible waypoint1 waypoint16) + (visible waypoint16 waypoint11) + (visible waypoint11 waypoint16) + (visible waypoint16 waypoint13) + (visible waypoint13 waypoint16) + (visible waypoint16 waypoint18) + (visible waypoint18 waypoint16) + (visible waypoint17 waypoint2) + (visible waypoint2 waypoint17) + (visible waypoint17 waypoint3) + (visible waypoint3 waypoint17) + (visible waypoint17 waypoint14) + (visible waypoint14 waypoint17) + (visible waypoint18 waypoint7) + (visible waypoint7 waypoint18) + (visible waypoint18 waypoint10) + (visible waypoint10 waypoint18) + (visible waypoint18 waypoint17) + (visible waypoint17 waypoint18) + (visible waypoint19 waypoint0) + (visible waypoint0 waypoint19) + (visible waypoint19 waypoint12) + (visible waypoint12 waypoint19) + (visible waypoint19 waypoint13) + (visible waypoint13 waypoint19) + (= (recharges) 0) + (in_sun waypoint0) + (in_sun waypoint2) + (at_soil_sample waypoint3) + (at_rock_sample waypoint3) + (at_rock_sample waypoint4) + (in_sun waypoint4) + (at_soil_sample waypoint5) + (in_sun waypoint5) + (at_rock_sample waypoint6) + (in_sun waypoint6) + (at_soil_sample waypoint8) + (at_rock_sample waypoint9) + (at_soil_sample waypoint11) + (in_sun waypoint11) + (at_soil_sample waypoint12) + (at_soil_sample waypoint14) + (at_soil_sample waypoint15) + (at_soil_sample waypoint16) + (in_sun waypoint16) + (at_soil_sample waypoint17) + (at_rock_sample waypoint17) + (at_soil_sample waypoint18) + (in_sun waypoint18) + (at_rock_sample waypoint19) + (in_sun waypoint19) + (at_lander general waypoint6) + (channel_free general) + (= (energy rover0) 50) + (at rover0 waypoint2) + (available rover0) + (store_of rover0store rover0) + (empty rover0store) + (equipped_for_imaging rover0) + (can_traverse rover0 waypoint2 waypoint0) + (can_traverse rover0 waypoint0 waypoint2) + (can_traverse rover0 waypoint2 waypoint4) + (can_traverse rover0 waypoint4 waypoint2) + (can_traverse rover0 waypoint2 waypoint5) + (can_traverse rover0 waypoint5 waypoint2) + (can_traverse rover0 waypoint2 waypoint7) + (can_traverse rover0 waypoint7 waypoint2) + (can_traverse rover0 waypoint2 waypoint9) + (can_traverse rover0 waypoint9 waypoint2) + (can_traverse rover0 waypoint2 waypoint18) + (can_traverse rover0 waypoint18 waypoint2) + (can_traverse rover0 waypoint0 waypoint6) + (can_traverse rover0 waypoint6 waypoint0) + (can_traverse rover0 waypoint0 waypoint13) + (can_traverse rover0 waypoint13 waypoint0) + (can_traverse rover0 waypoint0 waypoint19) + (can_traverse rover0 waypoint19 waypoint0) + (can_traverse rover0 waypoint4 waypoint1) + (can_traverse rover0 waypoint1 waypoint4) + (can_traverse rover0 waypoint4 waypoint3) + (can_traverse rover0 waypoint3 waypoint4) + (can_traverse rover0 waypoint4 waypoint12) + (can_traverse rover0 waypoint12 waypoint4) + (can_traverse rover0 waypoint4 waypoint17) + (can_traverse rover0 waypoint17 waypoint4) + (can_traverse rover0 waypoint5 waypoint11) + (can_traverse rover0 waypoint11 waypoint5) + (can_traverse rover0 waypoint5 waypoint15) + (can_traverse rover0 waypoint15 waypoint5) + (can_traverse rover0 waypoint9 waypoint10) + (can_traverse rover0 waypoint10 waypoint9) + (can_traverse rover0 waypoint18 waypoint8) + (can_traverse rover0 waypoint8 waypoint18) + (can_traverse rover0 waypoint6 waypoint16) + (can_traverse rover0 waypoint16 waypoint6) + (can_traverse rover0 waypoint3 waypoint14) + (can_traverse rover0 waypoint14 waypoint3) + (= (energy rover1) 50) + (at rover1 waypoint6) + (available rover1) + (store_of rover1store rover1) + (empty rover1store) + (equipped_for_imaging rover1) + (can_traverse rover1 waypoint6 waypoint0) + (can_traverse rover1 waypoint0 waypoint6) + (can_traverse rover1 waypoint6 waypoint8) + (can_traverse rover1 waypoint8 waypoint6) + (can_traverse rover1 waypoint6 waypoint13) + (can_traverse rover1 waypoint13 waypoint6) + (can_traverse rover1 waypoint6 waypoint15) + (can_traverse rover1 waypoint15 waypoint6) + (can_traverse rover1 waypoint6 waypoint16) + (can_traverse rover1 waypoint16 waypoint6) + (can_traverse rover1 waypoint6 waypoint19) + (can_traverse rover1 waypoint19 waypoint6) + (can_traverse rover1 waypoint0 waypoint2) + (can_traverse rover1 waypoint2 waypoint0) + (can_traverse rover1 waypoint0 waypoint5) + (can_traverse rover1 waypoint5 waypoint0) + (can_traverse rover1 waypoint0 waypoint18) + (can_traverse rover1 waypoint18 waypoint0) + (can_traverse rover1 waypoint8 waypoint11) + (can_traverse rover1 waypoint11 waypoint8) + (can_traverse rover1 waypoint13 waypoint7) + (can_traverse rover1 waypoint7 waypoint13) + (can_traverse rover1 waypoint15 waypoint12) + (can_traverse rover1 waypoint12 waypoint15) + (can_traverse rover1 waypoint16 waypoint1) + (can_traverse rover1 waypoint1 waypoint16) + (can_traverse rover1 waypoint2 waypoint3) + (can_traverse rover1 waypoint3 waypoint2) + (can_traverse rover1 waypoint2 waypoint4) + (can_traverse rover1 waypoint4 waypoint2) + (can_traverse rover1 waypoint2 waypoint9) + (can_traverse rover1 waypoint9 waypoint2) + (can_traverse rover1 waypoint2 waypoint10) + (can_traverse rover1 waypoint10 waypoint2) + (can_traverse rover1 waypoint5 waypoint17) + (can_traverse rover1 waypoint17 waypoint5) + (can_traverse rover1 waypoint11 waypoint14) + (can_traverse rover1 waypoint14 waypoint11) + (= (energy rover2) 50) + (at rover2 waypoint13) + (available rover2) + (store_of rover2store rover2) + (empty rover2store) + (equipped_for_soil_analysis rover2) + (equipped_for_imaging rover2) + (can_traverse rover2 waypoint13 waypoint0) + (can_traverse rover2 waypoint0 waypoint13) + (can_traverse rover2 waypoint13 waypoint6) + (can_traverse rover2 waypoint6 waypoint13) + (can_traverse rover2 waypoint13 waypoint7) + (can_traverse rover2 waypoint7 waypoint13) + (can_traverse rover2 waypoint13 waypoint16) + (can_traverse rover2 waypoint16 waypoint13) + (can_traverse rover2 waypoint13 waypoint19) + (can_traverse rover2 waypoint19 waypoint13) + (can_traverse rover2 waypoint0 waypoint5) + (can_traverse rover2 waypoint5 waypoint0) + (can_traverse rover2 waypoint0 waypoint9) + (can_traverse rover2 waypoint9 waypoint0) + (can_traverse rover2 waypoint0 waypoint18) + (can_traverse rover2 waypoint18 waypoint0) + (can_traverse rover2 waypoint6 waypoint8) + (can_traverse rover2 waypoint8 waypoint6) + (can_traverse rover2 waypoint6 waypoint15) + (can_traverse rover2 waypoint15 waypoint6) + (can_traverse rover2 waypoint7 waypoint2) + (can_traverse rover2 waypoint2 waypoint7) + (can_traverse rover2 waypoint7 waypoint4) + (can_traverse rover2 waypoint4 waypoint7) + (can_traverse rover2 waypoint7 waypoint12) + (can_traverse rover2 waypoint12 waypoint7) + (can_traverse rover2 waypoint16 waypoint1) + (can_traverse rover2 waypoint1 waypoint16) + (can_traverse rover2 waypoint16 waypoint11) + (can_traverse rover2 waypoint11 waypoint16) + (can_traverse rover2 waypoint19 waypoint14) + (can_traverse rover2 waypoint14 waypoint19) + (can_traverse rover2 waypoint5 waypoint3) + (can_traverse rover2 waypoint3 waypoint5) + (can_traverse rover2 waypoint9 waypoint10) + (can_traverse rover2 waypoint10 waypoint9) + (can_traverse rover2 waypoint18 waypoint17) + (can_traverse rover2 waypoint17 waypoint18) + (= (energy rover3) 50) + (at rover3 waypoint11) + (available rover3) + (store_of rover3store rover3) + (empty rover3store) + (equipped_for_soil_analysis rover3) + (equipped_for_rock_analysis rover3) + (equipped_for_imaging rover3) + (can_traverse rover3 waypoint11 waypoint1) + (can_traverse rover3 waypoint1 waypoint11) + (can_traverse rover3 waypoint11 waypoint7) + (can_traverse rover3 waypoint7 waypoint11) + (can_traverse rover3 waypoint11 waypoint9) + (can_traverse rover3 waypoint9 waypoint11) + (can_traverse rover3 waypoint11 waypoint14) + (can_traverse rover3 waypoint14 waypoint11) + (can_traverse rover3 waypoint11 waypoint16) + (can_traverse rover3 waypoint16 waypoint11) + (can_traverse rover3 waypoint11 waypoint17) + (can_traverse rover3 waypoint17 waypoint11) + (can_traverse rover3 waypoint1 waypoint4) + (can_traverse rover3 waypoint4 waypoint1) + (can_traverse rover3 waypoint7 waypoint2) + (can_traverse rover3 waypoint2 waypoint7) + (can_traverse rover3 waypoint7 waypoint3) + (can_traverse rover3 waypoint3 waypoint7) + (can_traverse rover3 waypoint7 waypoint12) + (can_traverse rover3 waypoint12 waypoint7) + (can_traverse rover3 waypoint7 waypoint13) + (can_traverse rover3 waypoint13 waypoint7) + (can_traverse rover3 waypoint7 waypoint18) + (can_traverse rover3 waypoint18 waypoint7) + (can_traverse rover3 waypoint9 waypoint0) + (can_traverse rover3 waypoint0 waypoint9) + (can_traverse rover3 waypoint14 waypoint8) + (can_traverse rover3 waypoint8 waypoint14) + (can_traverse rover3 waypoint14 waypoint10) + (can_traverse rover3 waypoint10 waypoint14) + (can_traverse rover3 waypoint16 waypoint5) + (can_traverse rover3 waypoint5 waypoint16) + (can_traverse rover3 waypoint16 waypoint6) + (can_traverse rover3 waypoint6 waypoint16) + (can_traverse rover3 waypoint2 waypoint19) + (can_traverse rover3 waypoint19 waypoint2) + (can_traverse rover3 waypoint12 waypoint15) + (can_traverse rover3 waypoint15 waypoint12) + (= (energy rover4) 50) + (at rover4 waypoint0) + (available rover4) + (store_of rover4store rover4) + (empty rover4store) + (equipped_for_soil_analysis rover4) + (equipped_for_rock_analysis rover4) + (equipped_for_imaging rover4) + (can_traverse rover4 waypoint0 waypoint2) + (can_traverse rover4 waypoint2 waypoint0) + (can_traverse rover4 waypoint0 waypoint5) + (can_traverse rover4 waypoint5 waypoint0) + (can_traverse rover4 waypoint0 waypoint6) + (can_traverse rover4 waypoint6 waypoint0) + (can_traverse rover4 waypoint0 waypoint18) + (can_traverse rover4 waypoint18 waypoint0) + (can_traverse rover4 waypoint2 waypoint3) + (can_traverse rover4 waypoint3 waypoint2) + (can_traverse rover4 waypoint2 waypoint7) + (can_traverse rover4 waypoint7 waypoint2) + (can_traverse rover4 waypoint2 waypoint8) + (can_traverse rover4 waypoint8 waypoint2) + (can_traverse rover4 waypoint2 waypoint17) + (can_traverse rover4 waypoint17 waypoint2) + (can_traverse rover4 waypoint2 waypoint19) + (can_traverse rover4 waypoint19 waypoint2) + (can_traverse rover4 waypoint5 waypoint11) + (can_traverse rover4 waypoint11 waypoint5) + (can_traverse rover4 waypoint5 waypoint12) + (can_traverse rover4 waypoint12 waypoint5) + (can_traverse rover4 waypoint5 waypoint15) + (can_traverse rover4 waypoint15 waypoint5) + (can_traverse rover4 waypoint5 waypoint16) + (can_traverse rover4 waypoint16 waypoint5) + (can_traverse rover4 waypoint6 waypoint1) + (can_traverse rover4 waypoint1 waypoint6) + (can_traverse rover4 waypoint6 waypoint13) + (can_traverse rover4 waypoint13 waypoint6) + (can_traverse rover4 waypoint18 waypoint10) + (can_traverse rover4 waypoint10 waypoint18) + (can_traverse rover4 waypoint3 waypoint4) + (can_traverse rover4 waypoint4 waypoint3) + (can_traverse rover4 waypoint3 waypoint9) + (can_traverse rover4 waypoint9 waypoint3) + (can_traverse rover4 waypoint8 waypoint14) + (can_traverse rover4 waypoint14 waypoint8) + (= (energy rover5) 50) + (at rover5 waypoint12) + (available rover5) + (store_of rover5store rover5) + (empty rover5store) + (equipped_for_soil_analysis rover5) + (equipped_for_rock_analysis rover5) + (equipped_for_imaging rover5) + (can_traverse rover5 waypoint12 waypoint1) + (can_traverse rover5 waypoint1 waypoint12) + (can_traverse rover5 waypoint12 waypoint4) + (can_traverse rover5 waypoint4 waypoint12) + (can_traverse rover5 waypoint12 waypoint5) + (can_traverse rover5 waypoint5 waypoint12) + (can_traverse rover5 waypoint12 waypoint7) + (can_traverse rover5 waypoint7 waypoint12) + (can_traverse rover5 waypoint12 waypoint9) + (can_traverse rover5 waypoint9 waypoint12) + (can_traverse rover5 waypoint12 waypoint10) + (can_traverse rover5 waypoint10 waypoint12) + (can_traverse rover5 waypoint12 waypoint14) + (can_traverse rover5 waypoint14 waypoint12) + (can_traverse rover5 waypoint12 waypoint15) + (can_traverse rover5 waypoint15 waypoint12) + (can_traverse rover5 waypoint12 waypoint16) + (can_traverse rover5 waypoint16 waypoint12) + (can_traverse rover5 waypoint1 waypoint6) + (can_traverse rover5 waypoint6 waypoint1) + (can_traverse rover5 waypoint1 waypoint11) + (can_traverse rover5 waypoint11 waypoint1) + (can_traverse rover5 waypoint4 waypoint3) + (can_traverse rover5 waypoint3 waypoint4) + (can_traverse rover5 waypoint4 waypoint17) + (can_traverse rover5 waypoint17 waypoint4) + (can_traverse rover5 waypoint5 waypoint0) + (can_traverse rover5 waypoint0 waypoint5) + (can_traverse rover5 waypoint5 waypoint13) + (can_traverse rover5 waypoint13 waypoint5) + (can_traverse rover5 waypoint5 waypoint19) + (can_traverse rover5 waypoint19 waypoint5) + (can_traverse rover5 waypoint7 waypoint2) + (can_traverse rover5 waypoint2 waypoint7) + (can_traverse rover5 waypoint7 waypoint8) + (can_traverse rover5 waypoint8 waypoint7) + (can_traverse rover5 waypoint7 waypoint18) + (can_traverse rover5 waypoint18 waypoint7) + (on_board camera0 rover2) + (calibration_target camera0 objective0) + (supports camera0 colour) + (supports camera0 high_res) + (supports camera0 low_res) + (on_board camera1 rover1) + (calibration_target camera1 objective1) + (supports camera1 high_res) + (on_board camera2 rover1) + (calibration_target camera2 objective0) + (supports camera2 high_res) + (supports camera2 low_res) + (on_board camera3 rover0) + (calibration_target camera3 objective5) + (supports camera3 high_res) + (on_board camera4 rover4) + (calibration_target camera4 objective2) + (supports camera4 colour) + (supports camera4 low_res) + (on_board camera5 rover3) + (calibration_target camera5 objective0) + (supports camera5 colour) + (supports camera5 low_res) + (on_board camera6 rover5) + (calibration_target camera6 objective6) + (supports camera6 colour) + (supports camera6 high_res) + (supports camera6 low_res) + (visible_from objective0 waypoint0) + (visible_from objective0 waypoint1) + (visible_from objective0 waypoint2) + (visible_from objective0 waypoint3) + (visible_from objective0 waypoint4) + (visible_from objective0 waypoint5) + (visible_from objective0 waypoint6) + (visible_from objective0 waypoint7) + (visible_from objective0 waypoint8) + (visible_from objective0 waypoint9) + (visible_from objective0 waypoint10) + (visible_from objective0 waypoint11) + (visible_from objective0 waypoint12) + (visible_from objective0 waypoint13) + (visible_from objective0 waypoint14) + (visible_from objective0 waypoint15) + (visible_from objective1 waypoint0) + (visible_from objective2 waypoint0) + (visible_from objective2 waypoint1) + (visible_from objective2 waypoint2) + (visible_from objective2 waypoint3) + (visible_from objective2 waypoint4) + (visible_from objective2 waypoint5) + (visible_from objective2 waypoint6) + (visible_from objective2 waypoint7) + (visible_from objective2 waypoint8) + (visible_from objective2 waypoint9) + (visible_from objective2 waypoint10) + (visible_from objective3 waypoint0) + (visible_from objective3 waypoint1) + (visible_from objective3 waypoint2) + (visible_from objective3 waypoint3) + (visible_from objective3 waypoint4) + (visible_from objective3 waypoint5) + (visible_from objective3 waypoint6) + (visible_from objective3 waypoint7) + (visible_from objective3 waypoint8) + (visible_from objective4 waypoint0) + (visible_from objective4 waypoint1) + (visible_from objective4 waypoint2) + (visible_from objective4 waypoint3) + (visible_from objective4 waypoint4) + (visible_from objective4 waypoint5) + (visible_from objective4 waypoint6) + (visible_from objective4 waypoint7) + (visible_from objective4 waypoint8) + (visible_from objective4 waypoint9) + (visible_from objective4 waypoint10) + (visible_from objective4 waypoint11) + (visible_from objective4 waypoint12) + (visible_from objective4 waypoint13) + (visible_from objective4 waypoint14) + (visible_from objective4 waypoint15) + (visible_from objective4 waypoint16) + (visible_from objective4 waypoint17) + (visible_from objective4 waypoint18) + (visible_from objective5 waypoint0) + (visible_from objective5 waypoint1) + (visible_from objective5 waypoint2) + (visible_from objective5 waypoint3) + (visible_from objective5 waypoint4) + (visible_from objective5 waypoint5) + (visible_from objective5 waypoint6) + (visible_from objective5 waypoint7) + (visible_from objective5 waypoint8) + (visible_from objective5 waypoint9) + (visible_from objective5 waypoint10) + (visible_from objective5 waypoint11) + (visible_from objective5 waypoint12) + (visible_from objective5 waypoint13) + (visible_from objective6 waypoint0) + (visible_from objective6 waypoint1) + (visible_from objective6 waypoint2) + (visible_from objective6 waypoint3) + (visible_from objective6 waypoint4) + (visible_from objective6 waypoint5) + (visible_from objective6 waypoint6) + (visible_from objective6 waypoint7) + (visible_from objective6 waypoint8) + (visible_from objective6 waypoint9) + (visible_from objective7 waypoint0) + (visible_from objective7 waypoint1) + (visible_from objective7 waypoint2) + (visible_from objective7 waypoint3) + (visible_from objective7 waypoint4) + (visible_from objective7 waypoint5) + (visible_from objective7 waypoint6) + (visible_from objective7 waypoint7) + (visible_from objective7 waypoint8) + (visible_from objective7 waypoint9) + (visible_from objective7 waypoint10) + (visible_from objective7 waypoint11) + (visible_from objective7 waypoint12) + (visible_from objective7 waypoint13) + (visible_from objective7 waypoint14) +) + +(:goal (and +(communicated_soil_data waypoint18) +(communicated_soil_data waypoint8) +(communicated_soil_data waypoint5) +(communicated_rock_data waypoint17) +(communicated_rock_data waypoint6) +(communicated_rock_data waypoint9) +(communicated_rock_data waypoint19) +(communicated_rock_data waypoint3) +(communicated_rock_data waypoint4) +(communicated_image_data objective7 low_res) +(communicated_image_data objective4 high_res) +(communicated_image_data objective0 colour) +(communicated_image_data objective6 low_res) +(communicated_image_data objective7 colour) +(communicated_image_data objective2 low_res) +(communicated_image_data objective0 high_res) +(communicated_image_data objective5 colour) + ) +) + +(:metric minimize (recharges)) +) diff --git a/tests/fixtures/pddl_files/rovers-numeric-automatic/p20.pddl b/tests/fixtures/pddl_files/rovers-numeric-automatic/p20.pddl new file mode 100644 index 00000000..79f9a4ef --- /dev/null +++ b/tests/fixtures/pddl_files/rovers-numeric-automatic/p20.pddl @@ -0,0 +1,873 @@ +(define (problem roverprob7182) (:domain Rover) +(:objects + general - Lander + colour high_res low_res - Mode + rover0 rover1 rover2 rover3 rover4 rover5 rover6 rover7 - Rover + rover0store rover1store rover2store rover3store rover4store rover5store rover6store rover7store - Store + waypoint0 waypoint1 waypoint2 waypoint3 waypoint4 waypoint5 waypoint6 waypoint7 waypoint8 waypoint9 waypoint10 waypoint11 waypoint12 waypoint13 waypoint14 waypoint15 waypoint16 waypoint17 waypoint18 waypoint19 waypoint20 waypoint21 waypoint22 waypoint23 waypoint24 - Waypoint + camera0 camera1 camera2 camera3 camera4 camera5 camera6 - Camera + objective0 objective1 objective2 objective3 objective4 objective5 objective6 objective7 - Objective + ) +(:init + (visible waypoint0 waypoint5) + (visible waypoint5 waypoint0) + (visible waypoint0 waypoint15) + (visible waypoint15 waypoint0) + (visible waypoint0 waypoint23) + (visible waypoint23 waypoint0) + (visible waypoint1 waypoint23) + (visible waypoint23 waypoint1) + (visible waypoint2 waypoint1) + (visible waypoint1 waypoint2) + (visible waypoint2 waypoint5) + (visible waypoint5 waypoint2) + (visible waypoint2 waypoint6) + (visible waypoint6 waypoint2) + (visible waypoint2 waypoint14) + (visible waypoint14 waypoint2) + (visible waypoint2 waypoint16) + (visible waypoint16 waypoint2) + (visible waypoint2 waypoint23) + (visible waypoint23 waypoint2) + (visible waypoint3 waypoint1) + (visible waypoint1 waypoint3) + (visible waypoint3 waypoint13) + (visible waypoint13 waypoint3) + (visible waypoint3 waypoint15) + (visible waypoint15 waypoint3) + (visible waypoint3 waypoint18) + (visible waypoint18 waypoint3) + (visible waypoint3 waypoint20) + (visible waypoint20 waypoint3) + (visible waypoint4 waypoint1) + (visible waypoint1 waypoint4) + (visible waypoint4 waypoint6) + (visible waypoint6 waypoint4) + (visible waypoint4 waypoint13) + (visible waypoint13 waypoint4) + (visible waypoint4 waypoint16) + (visible waypoint16 waypoint4) + (visible waypoint4 waypoint19) + (visible waypoint19 waypoint4) + (visible waypoint4 waypoint20) + (visible waypoint20 waypoint4) + (visible waypoint5 waypoint1) + (visible waypoint1 waypoint5) + (visible waypoint5 waypoint4) + (visible waypoint4 waypoint5) + (visible waypoint5 waypoint8) + (visible waypoint8 waypoint5) + (visible waypoint5 waypoint16) + (visible waypoint16 waypoint5) + (visible waypoint6 waypoint5) + (visible waypoint5 waypoint6) + (visible waypoint6 waypoint8) + (visible waypoint8 waypoint6) + (visible waypoint6 waypoint9) + (visible waypoint9 waypoint6) + (visible waypoint6 waypoint11) + (visible waypoint11 waypoint6) + (visible waypoint6 waypoint21) + (visible waypoint21 waypoint6) + (visible waypoint7 waypoint0) + (visible waypoint0 waypoint7) + (visible waypoint7 waypoint4) + (visible waypoint4 waypoint7) + (visible waypoint7 waypoint8) + (visible waypoint8 waypoint7) + (visible waypoint7 waypoint16) + (visible waypoint16 waypoint7) + (visible waypoint7 waypoint17) + (visible waypoint17 waypoint7) + (visible waypoint8 waypoint4) + (visible waypoint4 waypoint8) + (visible waypoint8 waypoint16) + (visible waypoint16 waypoint8) + (visible waypoint8 waypoint17) + (visible waypoint17 waypoint8) + (visible waypoint9 waypoint2) + (visible waypoint2 waypoint9) + (visible waypoint9 waypoint5) + (visible waypoint5 waypoint9) + (visible waypoint9 waypoint7) + (visible waypoint7 waypoint9) + (visible waypoint9 waypoint14) + (visible waypoint14 waypoint9) + (visible waypoint9 waypoint17) + (visible waypoint17 waypoint9) + (visible waypoint10 waypoint11) + (visible waypoint11 waypoint10) + (visible waypoint10 waypoint15) + (visible waypoint15 waypoint10) + (visible waypoint11 waypoint8) + (visible waypoint8 waypoint11) + (visible waypoint11 waypoint19) + (visible waypoint19 waypoint11) + (visible waypoint12 waypoint3) + (visible waypoint3 waypoint12) + (visible waypoint12 waypoint6) + (visible waypoint6 waypoint12) + (visible waypoint12 waypoint11) + (visible waypoint11 waypoint12) + (visible waypoint12 waypoint13) + (visible waypoint13 waypoint12) + (visible waypoint12 waypoint19) + (visible waypoint19 waypoint12) + (visible waypoint12 waypoint22) + (visible waypoint22 waypoint12) + (visible waypoint12 waypoint23) + (visible waypoint23 waypoint12) + (visible waypoint12 waypoint24) + (visible waypoint24 waypoint12) + (visible waypoint13 waypoint14) + (visible waypoint14 waypoint13) + (visible waypoint13 waypoint15) + (visible waypoint15 waypoint13) + (visible waypoint13 waypoint20) + (visible waypoint20 waypoint13) + (visible waypoint14 waypoint0) + (visible waypoint0 waypoint14) + (visible waypoint14 waypoint1) + (visible waypoint1 waypoint14) + (visible waypoint14 waypoint5) + (visible waypoint5 waypoint14) + (visible waypoint14 waypoint6) + (visible waypoint6 waypoint14) + (visible waypoint14 waypoint8) + (visible waypoint8 waypoint14) + (visible waypoint14 waypoint12) + (visible waypoint12 waypoint14) + (visible waypoint14 waypoint20) + (visible waypoint20 waypoint14) + (visible waypoint15 waypoint1) + (visible waypoint1 waypoint15) + (visible waypoint15 waypoint6) + (visible waypoint6 waypoint15) + (visible waypoint15 waypoint12) + (visible waypoint12 waypoint15) + (visible waypoint15 waypoint16) + (visible waypoint16 waypoint15) + (visible waypoint16 waypoint10) + (visible waypoint10 waypoint16) + (visible waypoint16 waypoint20) + (visible waypoint20 waypoint16) + (visible waypoint17 waypoint11) + (visible waypoint11 waypoint17) + (visible waypoint17 waypoint14) + (visible waypoint14 waypoint17) + (visible waypoint17 waypoint15) + (visible waypoint15 waypoint17) + (visible waypoint17 waypoint18) + (visible waypoint18 waypoint17) + (visible waypoint17 waypoint20) + (visible waypoint20 waypoint17) + (visible waypoint18 waypoint0) + (visible waypoint0 waypoint18) + (visible waypoint18 waypoint1) + (visible waypoint1 waypoint18) + (visible waypoint18 waypoint6) + (visible waypoint6 waypoint18) + (visible waypoint18 waypoint8) + (visible waypoint8 waypoint18) + (visible waypoint18 waypoint9) + (visible waypoint9 waypoint18) + (visible waypoint18 waypoint10) + (visible waypoint10 waypoint18) + (visible waypoint19 waypoint6) + (visible waypoint6 waypoint19) + (visible waypoint19 waypoint21) + (visible waypoint21 waypoint19) + (visible waypoint20 waypoint19) + (visible waypoint19 waypoint20) + (visible waypoint21 waypoint4) + (visible waypoint4 waypoint21) + (visible waypoint21 waypoint5) + (visible waypoint5 waypoint21) + (visible waypoint21 waypoint8) + (visible waypoint8 waypoint21) + (visible waypoint21 waypoint11) + (visible waypoint11 waypoint21) + (visible waypoint21 waypoint13) + (visible waypoint13 waypoint21) + (visible waypoint21 waypoint17) + (visible waypoint17 waypoint21) + (visible waypoint21 waypoint18) + (visible waypoint18 waypoint21) + (visible waypoint22 waypoint11) + (visible waypoint11 waypoint22) + (visible waypoint22 waypoint16) + (visible waypoint16 waypoint22) + (visible waypoint22 waypoint21) + (visible waypoint21 waypoint22) + (visible waypoint23 waypoint10) + (visible waypoint10 waypoint23) + (visible waypoint23 waypoint18) + (visible waypoint18 waypoint23) + (visible waypoint23 waypoint20) + (visible waypoint20 waypoint23) + (visible waypoint24 waypoint5) + (visible waypoint5 waypoint24) + (visible waypoint24 waypoint7) + (visible waypoint7 waypoint24) + (visible waypoint24 waypoint18) + (visible waypoint18 waypoint24) + (visible waypoint24 waypoint20) + (visible waypoint20 waypoint24) + (visible waypoint24 waypoint23) + (visible waypoint23 waypoint24) + (= (recharges) 0) + (at_soil_sample waypoint0) + (in_sun waypoint0) + (at_soil_sample waypoint1) + (at_soil_sample waypoint7) + (at_rock_sample waypoint7) + (at_soil_sample waypoint8) + (at_soil_sample waypoint9) + (at_rock_sample waypoint9) + (at_rock_sample waypoint10) + (in_sun waypoint10) + (at_soil_sample waypoint11) + (at_rock_sample waypoint12) + (in_sun waypoint12) + (at_soil_sample waypoint13) + (at_rock_sample waypoint14) + (in_sun waypoint14) + (at_soil_sample waypoint15) + (at_rock_sample waypoint16) + (in_sun waypoint16) + (at_soil_sample waypoint17) + (at_soil_sample waypoint18) + (at_rock_sample waypoint18) + (in_sun waypoint19) + (at_soil_sample waypoint20) + (at_rock_sample waypoint21) + (at_soil_sample waypoint22) + (at_rock_sample waypoint22) + (at_soil_sample waypoint23) + (in_sun waypoint23) + (at_soil_sample waypoint24) + (in_sun waypoint24) + (at_lander general waypoint1) + (channel_free general) + (= (energy rover0) 50) + (at rover0 waypoint22) + (available rover0) + (store_of rover0store rover0) + (empty rover0store) + (equipped_for_soil_analysis rover0) + (equipped_for_imaging rover0) + (can_traverse rover0 waypoint22 waypoint11) + (can_traverse rover0 waypoint11 waypoint22) + (can_traverse rover0 waypoint22 waypoint12) + (can_traverse rover0 waypoint12 waypoint22) + (can_traverse rover0 waypoint22 waypoint21) + (can_traverse rover0 waypoint21 waypoint22) + (can_traverse rover0 waypoint11 waypoint6) + (can_traverse rover0 waypoint6 waypoint11) + (can_traverse rover0 waypoint11 waypoint8) + (can_traverse rover0 waypoint8 waypoint11) + (can_traverse rover0 waypoint11 waypoint10) + (can_traverse rover0 waypoint10 waypoint11) + (can_traverse rover0 waypoint11 waypoint17) + (can_traverse rover0 waypoint17 waypoint11) + (can_traverse rover0 waypoint11 waypoint19) + (can_traverse rover0 waypoint19 waypoint11) + (can_traverse rover0 waypoint12 waypoint13) + (can_traverse rover0 waypoint13 waypoint12) + (can_traverse rover0 waypoint12 waypoint15) + (can_traverse rover0 waypoint15 waypoint12) + (can_traverse rover0 waypoint12 waypoint24) + (can_traverse rover0 waypoint24 waypoint12) + (can_traverse rover0 waypoint21 waypoint4) + (can_traverse rover0 waypoint4 waypoint21) + (can_traverse rover0 waypoint21 waypoint5) + (can_traverse rover0 waypoint5 waypoint21) + (can_traverse rover0 waypoint21 waypoint18) + (can_traverse rover0 waypoint18 waypoint21) + (can_traverse rover0 waypoint6 waypoint2) + (can_traverse rover0 waypoint2 waypoint6) + (can_traverse rover0 waypoint6 waypoint9) + (can_traverse rover0 waypoint9 waypoint6) + (can_traverse rover0 waypoint6 waypoint14) + (can_traverse rover0 waypoint14 waypoint6) + (can_traverse rover0 waypoint8 waypoint7) + (can_traverse rover0 waypoint7 waypoint8) + (can_traverse rover0 waypoint17 waypoint20) + (can_traverse rover0 waypoint20 waypoint17) + (can_traverse rover0 waypoint13 waypoint3) + (can_traverse rover0 waypoint3 waypoint13) + (can_traverse rover0 waypoint15 waypoint1) + (can_traverse rover0 waypoint1 waypoint15) + (can_traverse rover0 waypoint15 waypoint16) + (can_traverse rover0 waypoint16 waypoint15) + (can_traverse rover0 waypoint24 waypoint23) + (can_traverse rover0 waypoint23 waypoint24) + (can_traverse rover0 waypoint5 waypoint0) + (can_traverse rover0 waypoint0 waypoint5) + (= (energy rover1) 50) + (at rover1 waypoint4) + (available rover1) + (store_of rover1store rover1) + (empty rover1store) + (equipped_for_imaging rover1) + (can_traverse rover1 waypoint4 waypoint1) + (can_traverse rover1 waypoint1 waypoint4) + (can_traverse rover1 waypoint4 waypoint5) + (can_traverse rover1 waypoint5 waypoint4) + (can_traverse rover1 waypoint4 waypoint6) + (can_traverse rover1 waypoint6 waypoint4) + (can_traverse rover1 waypoint4 waypoint13) + (can_traverse rover1 waypoint13 waypoint4) + (can_traverse rover1 waypoint4 waypoint16) + (can_traverse rover1 waypoint16 waypoint4) + (can_traverse rover1 waypoint4 waypoint19) + (can_traverse rover1 waypoint19 waypoint4) + (can_traverse rover1 waypoint4 waypoint20) + (can_traverse rover1 waypoint20 waypoint4) + (can_traverse rover1 waypoint4 waypoint21) + (can_traverse rover1 waypoint21 waypoint4) + (can_traverse rover1 waypoint1 waypoint14) + (can_traverse rover1 waypoint14 waypoint1) + (can_traverse rover1 waypoint1 waypoint15) + (can_traverse rover1 waypoint15 waypoint1) + (can_traverse rover1 waypoint1 waypoint18) + (can_traverse rover1 waypoint18 waypoint1) + (can_traverse rover1 waypoint5 waypoint0) + (can_traverse rover1 waypoint0 waypoint5) + (can_traverse rover1 waypoint5 waypoint2) + (can_traverse rover1 waypoint2 waypoint5) + (can_traverse rover1 waypoint5 waypoint8) + (can_traverse rover1 waypoint8 waypoint5) + (can_traverse rover1 waypoint5 waypoint9) + (can_traverse rover1 waypoint9 waypoint5) + (can_traverse rover1 waypoint5 waypoint24) + (can_traverse rover1 waypoint24 waypoint5) + (can_traverse rover1 waypoint6 waypoint11) + (can_traverse rover1 waypoint11 waypoint6) + (can_traverse rover1 waypoint6 waypoint12) + (can_traverse rover1 waypoint12 waypoint6) + (can_traverse rover1 waypoint13 waypoint3) + (can_traverse rover1 waypoint3 waypoint13) + (can_traverse rover1 waypoint16 waypoint22) + (can_traverse rover1 waypoint22 waypoint16) + (can_traverse rover1 waypoint20 waypoint17) + (can_traverse rover1 waypoint17 waypoint20) + (can_traverse rover1 waypoint18 waypoint10) + (can_traverse rover1 waypoint10 waypoint18) + (can_traverse rover1 waypoint18 waypoint23) + (can_traverse rover1 waypoint23 waypoint18) + (can_traverse rover1 waypoint0 waypoint7) + (can_traverse rover1 waypoint7 waypoint0) + (= (energy rover2) 50) + (at rover2 waypoint3) + (available rover2) + (store_of rover2store rover2) + (empty rover2store) + (equipped_for_rock_analysis rover2) + (equipped_for_imaging rover2) + (can_traverse rover2 waypoint3 waypoint1) + (can_traverse rover2 waypoint1 waypoint3) + (can_traverse rover2 waypoint3 waypoint13) + (can_traverse rover2 waypoint13 waypoint3) + (can_traverse rover2 waypoint3 waypoint18) + (can_traverse rover2 waypoint18 waypoint3) + (can_traverse rover2 waypoint3 waypoint20) + (can_traverse rover2 waypoint20 waypoint3) + (can_traverse rover2 waypoint1 waypoint2) + (can_traverse rover2 waypoint2 waypoint1) + (can_traverse rover2 waypoint1 waypoint5) + (can_traverse rover2 waypoint5 waypoint1) + (can_traverse rover2 waypoint1 waypoint14) + (can_traverse rover2 waypoint14 waypoint1) + (can_traverse rover2 waypoint1 waypoint15) + (can_traverse rover2 waypoint15 waypoint1) + (can_traverse rover2 waypoint13 waypoint4) + (can_traverse rover2 waypoint4 waypoint13) + (can_traverse rover2 waypoint13 waypoint21) + (can_traverse rover2 waypoint21 waypoint13) + (can_traverse rover2 waypoint18 waypoint6) + (can_traverse rover2 waypoint6 waypoint18) + (can_traverse rover2 waypoint18 waypoint9) + (can_traverse rover2 waypoint9 waypoint18) + (can_traverse rover2 waypoint18 waypoint17) + (can_traverse rover2 waypoint17 waypoint18) + (can_traverse rover2 waypoint18 waypoint23) + (can_traverse rover2 waypoint23 waypoint18) + (can_traverse rover2 waypoint18 waypoint24) + (can_traverse rover2 waypoint24 waypoint18) + (can_traverse rover2 waypoint20 waypoint16) + (can_traverse rover2 waypoint16 waypoint20) + (can_traverse rover2 waypoint20 waypoint19) + (can_traverse rover2 waypoint19 waypoint20) + (can_traverse rover2 waypoint5 waypoint0) + (can_traverse rover2 waypoint0 waypoint5) + (can_traverse rover2 waypoint5 waypoint8) + (can_traverse rover2 waypoint8 waypoint5) + (can_traverse rover2 waypoint14 waypoint12) + (can_traverse rover2 waypoint12 waypoint14) + (can_traverse rover2 waypoint15 waypoint10) + (can_traverse rover2 waypoint10 waypoint15) + (can_traverse rover2 waypoint4 waypoint7) + (can_traverse rover2 waypoint7 waypoint4) + (can_traverse rover2 waypoint21 waypoint11) + (can_traverse rover2 waypoint11 waypoint21) + (can_traverse rover2 waypoint21 waypoint22) + (can_traverse rover2 waypoint22 waypoint21) + (= (energy rover3) 50) + (at rover3 waypoint3) + (available rover3) + (store_of rover3store rover3) + (empty rover3store) + (equipped_for_soil_analysis rover3) + (equipped_for_rock_analysis rover3) + (can_traverse rover3 waypoint3 waypoint1) + (can_traverse rover3 waypoint1 waypoint3) + (can_traverse rover3 waypoint3 waypoint12) + (can_traverse rover3 waypoint12 waypoint3) + (can_traverse rover3 waypoint3 waypoint13) + (can_traverse rover3 waypoint13 waypoint3) + (can_traverse rover3 waypoint3 waypoint18) + (can_traverse rover3 waypoint18 waypoint3) + (can_traverse rover3 waypoint3 waypoint20) + (can_traverse rover3 waypoint20 waypoint3) + (can_traverse rover3 waypoint1 waypoint2) + (can_traverse rover3 waypoint2 waypoint1) + (can_traverse rover3 waypoint1 waypoint4) + (can_traverse rover3 waypoint4 waypoint1) + (can_traverse rover3 waypoint1 waypoint5) + (can_traverse rover3 waypoint5 waypoint1) + (can_traverse rover3 waypoint1 waypoint14) + (can_traverse rover3 waypoint14 waypoint1) + (can_traverse rover3 waypoint1 waypoint15) + (can_traverse rover3 waypoint15 waypoint1) + (can_traverse rover3 waypoint1 waypoint23) + (can_traverse rover3 waypoint23 waypoint1) + (can_traverse rover3 waypoint12 waypoint6) + (can_traverse rover3 waypoint6 waypoint12) + (can_traverse rover3 waypoint12 waypoint19) + (can_traverse rover3 waypoint19 waypoint12) + (can_traverse rover3 waypoint12 waypoint22) + (can_traverse rover3 waypoint22 waypoint12) + (can_traverse rover3 waypoint12 waypoint24) + (can_traverse rover3 waypoint24 waypoint12) + (can_traverse rover3 waypoint13 waypoint21) + (can_traverse rover3 waypoint21 waypoint13) + (can_traverse rover3 waypoint18 waypoint0) + (can_traverse rover3 waypoint0 waypoint18) + (can_traverse rover3 waypoint18 waypoint9) + (can_traverse rover3 waypoint9 waypoint18) + (can_traverse rover3 waypoint18 waypoint17) + (can_traverse rover3 waypoint17 waypoint18) + (can_traverse rover3 waypoint20 waypoint16) + (can_traverse rover3 waypoint16 waypoint20) + (can_traverse rover3 waypoint4 waypoint7) + (can_traverse rover3 waypoint7 waypoint4) + (can_traverse rover3 waypoint4 waypoint8) + (can_traverse rover3 waypoint8 waypoint4) + (can_traverse rover3 waypoint6 waypoint11) + (can_traverse rover3 waypoint11 waypoint6) + (can_traverse rover3 waypoint16 waypoint10) + (can_traverse rover3 waypoint10 waypoint16) + (= (energy rover4) 50) + (at rover4 waypoint16) + (available rover4) + (store_of rover4store rover4) + (empty rover4store) + (equipped_for_rock_analysis rover4) + (equipped_for_imaging rover4) + (can_traverse rover4 waypoint16 waypoint2) + (can_traverse rover4 waypoint2 waypoint16) + (can_traverse rover4 waypoint16 waypoint4) + (can_traverse rover4 waypoint4 waypoint16) + (can_traverse rover4 waypoint16 waypoint5) + (can_traverse rover4 waypoint5 waypoint16) + (can_traverse rover4 waypoint16 waypoint7) + (can_traverse rover4 waypoint7 waypoint16) + (can_traverse rover4 waypoint16 waypoint8) + (can_traverse rover4 waypoint8 waypoint16) + (can_traverse rover4 waypoint16 waypoint10) + (can_traverse rover4 waypoint10 waypoint16) + (can_traverse rover4 waypoint16 waypoint15) + (can_traverse rover4 waypoint15 waypoint16) + (can_traverse rover4 waypoint16 waypoint22) + (can_traverse rover4 waypoint22 waypoint16) + (can_traverse rover4 waypoint2 waypoint9) + (can_traverse rover4 waypoint9 waypoint2) + (can_traverse rover4 waypoint2 waypoint14) + (can_traverse rover4 waypoint14 waypoint2) + (can_traverse rover4 waypoint4 waypoint1) + (can_traverse rover4 waypoint1 waypoint4) + (can_traverse rover4 waypoint4 waypoint13) + (can_traverse rover4 waypoint13 waypoint4) + (can_traverse rover4 waypoint4 waypoint20) + (can_traverse rover4 waypoint20 waypoint4) + (can_traverse rover4 waypoint5 waypoint0) + (can_traverse rover4 waypoint0 waypoint5) + (can_traverse rover4 waypoint5 waypoint21) + (can_traverse rover4 waypoint21 waypoint5) + (can_traverse rover4 waypoint5 waypoint24) + (can_traverse rover4 waypoint24 waypoint5) + (can_traverse rover4 waypoint7 waypoint17) + (can_traverse rover4 waypoint17 waypoint7) + (can_traverse rover4 waypoint8 waypoint11) + (can_traverse rover4 waypoint11 waypoint8) + (can_traverse rover4 waypoint8 waypoint18) + (can_traverse rover4 waypoint18 waypoint8) + (can_traverse rover4 waypoint15 waypoint3) + (can_traverse rover4 waypoint3 waypoint15) + (can_traverse rover4 waypoint15 waypoint6) + (can_traverse rover4 waypoint6 waypoint15) + (can_traverse rover4 waypoint15 waypoint12) + (can_traverse rover4 waypoint12 waypoint15) + (can_traverse rover4 waypoint20 waypoint23) + (can_traverse rover4 waypoint23 waypoint20) + (can_traverse rover4 waypoint21 waypoint19) + (can_traverse rover4 waypoint19 waypoint21) + (= (energy rover5) 50) + (at rover5 waypoint10) + (available rover5) + (store_of rover5store rover5) + (empty rover5store) + (equipped_for_imaging rover5) + (can_traverse rover5 waypoint10 waypoint11) + (can_traverse rover5 waypoint11 waypoint10) + (can_traverse rover5 waypoint10 waypoint15) + (can_traverse rover5 waypoint15 waypoint10) + (can_traverse rover5 waypoint10 waypoint16) + (can_traverse rover5 waypoint16 waypoint10) + (can_traverse rover5 waypoint10 waypoint18) + (can_traverse rover5 waypoint18 waypoint10) + (can_traverse rover5 waypoint10 waypoint23) + (can_traverse rover5 waypoint23 waypoint10) + (can_traverse rover5 waypoint11 waypoint6) + (can_traverse rover5 waypoint6 waypoint11) + (can_traverse rover5 waypoint11 waypoint8) + (can_traverse rover5 waypoint8 waypoint11) + (can_traverse rover5 waypoint11 waypoint12) + (can_traverse rover5 waypoint12 waypoint11) + (can_traverse rover5 waypoint11 waypoint21) + (can_traverse rover5 waypoint21 waypoint11) + (can_traverse rover5 waypoint11 waypoint22) + (can_traverse rover5 waypoint22 waypoint11) + (can_traverse rover5 waypoint15 waypoint0) + (can_traverse rover5 waypoint0 waypoint15) + (can_traverse rover5 waypoint15 waypoint1) + (can_traverse rover5 waypoint1 waypoint15) + (can_traverse rover5 waypoint15 waypoint13) + (can_traverse rover5 waypoint13 waypoint15) + (can_traverse rover5 waypoint15 waypoint17) + (can_traverse rover5 waypoint17 waypoint15) + (can_traverse rover5 waypoint16 waypoint2) + (can_traverse rover5 waypoint2 waypoint16) + (can_traverse rover5 waypoint16 waypoint4) + (can_traverse rover5 waypoint4 waypoint16) + (can_traverse rover5 waypoint16 waypoint7) + (can_traverse rover5 waypoint7 waypoint16) + (can_traverse rover5 waypoint18 waypoint3) + (can_traverse rover5 waypoint3 waypoint18) + (can_traverse rover5 waypoint23 waypoint20) + (can_traverse rover5 waypoint20 waypoint23) + (can_traverse rover5 waypoint23 waypoint24) + (can_traverse rover5 waypoint24 waypoint23) + (can_traverse rover5 waypoint6 waypoint5) + (can_traverse rover5 waypoint5 waypoint6) + (can_traverse rover5 waypoint6 waypoint9) + (can_traverse rover5 waypoint9 waypoint6) + (can_traverse rover5 waypoint6 waypoint14) + (can_traverse rover5 waypoint14 waypoint6) + (can_traverse rover5 waypoint6 waypoint19) + (can_traverse rover5 waypoint19 waypoint6) + (= (energy rover6) 50) + (at rover6 waypoint4) + (available rover6) + (store_of rover6store rover6) + (empty rover6store) + (equipped_for_soil_analysis rover6) + (equipped_for_imaging rover6) + (can_traverse rover6 waypoint4 waypoint1) + (can_traverse rover6 waypoint1 waypoint4) + (can_traverse rover6 waypoint4 waypoint6) + (can_traverse rover6 waypoint6 waypoint4) + (can_traverse rover6 waypoint4 waypoint8) + (can_traverse rover6 waypoint8 waypoint4) + (can_traverse rover6 waypoint4 waypoint13) + (can_traverse rover6 waypoint13 waypoint4) + (can_traverse rover6 waypoint4 waypoint16) + (can_traverse rover6 waypoint16 waypoint4) + (can_traverse rover6 waypoint4 waypoint19) + (can_traverse rover6 waypoint19 waypoint4) + (can_traverse rover6 waypoint4 waypoint20) + (can_traverse rover6 waypoint20 waypoint4) + (can_traverse rover6 waypoint1 waypoint3) + (can_traverse rover6 waypoint3 waypoint1) + (can_traverse rover6 waypoint1 waypoint5) + (can_traverse rover6 waypoint5 waypoint1) + (can_traverse rover6 waypoint1 waypoint14) + (can_traverse rover6 waypoint14 waypoint1) + (can_traverse rover6 waypoint1 waypoint18) + (can_traverse rover6 waypoint18 waypoint1) + (can_traverse rover6 waypoint1 waypoint23) + (can_traverse rover6 waypoint23 waypoint1) + (can_traverse rover6 waypoint6 waypoint2) + (can_traverse rover6 waypoint2 waypoint6) + (can_traverse rover6 waypoint6 waypoint9) + (can_traverse rover6 waypoint9 waypoint6) + (can_traverse rover6 waypoint6 waypoint11) + (can_traverse rover6 waypoint11 waypoint6) + (can_traverse rover6 waypoint6 waypoint12) + (can_traverse rover6 waypoint12 waypoint6) + (can_traverse rover6 waypoint6 waypoint15) + (can_traverse rover6 waypoint15 waypoint6) + (can_traverse rover6 waypoint6 waypoint21) + (can_traverse rover6 waypoint21 waypoint6) + (can_traverse rover6 waypoint8 waypoint17) + (can_traverse rover6 waypoint17 waypoint8) + (can_traverse rover6 waypoint16 waypoint7) + (can_traverse rover6 waypoint7 waypoint16) + (can_traverse rover6 waypoint16 waypoint10) + (can_traverse rover6 waypoint10 waypoint16) + (can_traverse rover6 waypoint16 waypoint22) + (can_traverse rover6 waypoint22 waypoint16) + (can_traverse rover6 waypoint20 waypoint24) + (can_traverse rover6 waypoint24 waypoint20) + (can_traverse rover6 waypoint23 waypoint0) + (can_traverse rover6 waypoint0 waypoint23) + (= (energy rover7) 50) + (at rover7 waypoint16) + (available rover7) + (store_of rover7store rover7) + (empty rover7store) + (equipped_for_rock_analysis rover7) + (can_traverse rover7 waypoint16 waypoint2) + (can_traverse rover7 waypoint2 waypoint16) + (can_traverse rover7 waypoint16 waypoint4) + (can_traverse rover7 waypoint4 waypoint16) + (can_traverse rover7 waypoint16 waypoint8) + (can_traverse rover7 waypoint8 waypoint16) + (can_traverse rover7 waypoint16 waypoint10) + (can_traverse rover7 waypoint10 waypoint16) + (can_traverse rover7 waypoint16 waypoint20) + (can_traverse rover7 waypoint20 waypoint16) + (can_traverse rover7 waypoint2 waypoint5) + (can_traverse rover7 waypoint5 waypoint2) + (can_traverse rover7 waypoint2 waypoint6) + (can_traverse rover7 waypoint6 waypoint2) + (can_traverse rover7 waypoint2 waypoint9) + (can_traverse rover7 waypoint9 waypoint2) + (can_traverse rover7 waypoint2 waypoint14) + (can_traverse rover7 waypoint14 waypoint2) + (can_traverse rover7 waypoint2 waypoint23) + (can_traverse rover7 waypoint23 waypoint2) + (can_traverse rover7 waypoint4 waypoint13) + (can_traverse rover7 waypoint13 waypoint4) + (can_traverse rover7 waypoint4 waypoint19) + (can_traverse rover7 waypoint19 waypoint4) + (can_traverse rover7 waypoint8 waypoint7) + (can_traverse rover7 waypoint7 waypoint8) + (can_traverse rover7 waypoint8 waypoint17) + (can_traverse rover7 waypoint17 waypoint8) + (can_traverse rover7 waypoint8 waypoint18) + (can_traverse rover7 waypoint18 waypoint8) + (can_traverse rover7 waypoint10 waypoint11) + (can_traverse rover7 waypoint11 waypoint10) + (can_traverse rover7 waypoint10 waypoint15) + (can_traverse rover7 waypoint15 waypoint10) + (can_traverse rover7 waypoint20 waypoint3) + (can_traverse rover7 waypoint3 waypoint20) + (can_traverse rover7 waypoint20 waypoint24) + (can_traverse rover7 waypoint24 waypoint20) + (can_traverse rover7 waypoint5 waypoint21) + (can_traverse rover7 waypoint21 waypoint5) + (can_traverse rover7 waypoint6 waypoint12) + (can_traverse rover7 waypoint12 waypoint6) + (can_traverse rover7 waypoint14 waypoint0) + (can_traverse rover7 waypoint0 waypoint14) + (can_traverse rover7 waypoint14 waypoint1) + (can_traverse rover7 waypoint1 waypoint14) + (on_board camera0 rover0) + (calibration_target camera0 objective6) + (supports camera0 colour) + (supports camera0 high_res) + (on_board camera1 rover1) + (calibration_target camera1 objective1) + (supports camera1 colour) + (supports camera1 high_res) + (on_board camera2 rover4) + (calibration_target camera2 objective0) + (supports camera2 colour) + (supports camera2 high_res) + (supports camera2 low_res) + (on_board camera3 rover2) + (calibration_target camera3 objective2) + (supports camera3 high_res) + (supports camera3 low_res) + (on_board camera4 rover1) + (calibration_target camera4 objective4) + (supports camera4 colour) + (supports camera4 high_res) + (on_board camera5 rover5) + (calibration_target camera5 objective4) + (supports camera5 high_res) + (on_board camera6 rover6) + (calibration_target camera6 objective5) + (supports camera6 colour) + (supports camera6 high_res) + (supports camera6 low_res) + (visible_from objective0 waypoint0) + (visible_from objective0 waypoint1) + (visible_from objective0 waypoint2) + (visible_from objective0 waypoint3) + (visible_from objective0 waypoint4) + (visible_from objective0 waypoint5) + (visible_from objective0 waypoint6) + (visible_from objective0 waypoint7) + (visible_from objective0 waypoint8) + (visible_from objective0 waypoint9) + (visible_from objective0 waypoint10) + (visible_from objective0 waypoint11) + (visible_from objective0 waypoint12) + (visible_from objective0 waypoint13) + (visible_from objective0 waypoint14) + (visible_from objective0 waypoint15) + (visible_from objective0 waypoint16) + (visible_from objective1 waypoint0) + (visible_from objective1 waypoint1) + (visible_from objective1 waypoint2) + (visible_from objective1 waypoint3) + (visible_from objective2 waypoint0) + (visible_from objective2 waypoint1) + (visible_from objective2 waypoint2) + (visible_from objective2 waypoint3) + (visible_from objective2 waypoint4) + (visible_from objective2 waypoint5) + (visible_from objective2 waypoint6) + (visible_from objective2 waypoint7) + (visible_from objective2 waypoint8) + (visible_from objective2 waypoint9) + (visible_from objective2 waypoint10) + (visible_from objective2 waypoint11) + (visible_from objective2 waypoint12) + (visible_from objective2 waypoint13) + (visible_from objective2 waypoint14) + (visible_from objective2 waypoint15) + (visible_from objective2 waypoint16) + (visible_from objective2 waypoint17) + (visible_from objective3 waypoint0) + (visible_from objective3 waypoint1) + (visible_from objective3 waypoint2) + (visible_from objective3 waypoint3) + (visible_from objective3 waypoint4) + (visible_from objective3 waypoint5) + (visible_from objective3 waypoint6) + (visible_from objective3 waypoint7) + (visible_from objective3 waypoint8) + (visible_from objective3 waypoint9) + (visible_from objective3 waypoint10) + (visible_from objective3 waypoint11) + (visible_from objective3 waypoint12) + (visible_from objective3 waypoint13) + (visible_from objective3 waypoint14) + (visible_from objective3 waypoint15) + (visible_from objective3 waypoint16) + (visible_from objective3 waypoint17) + (visible_from objective3 waypoint18) + (visible_from objective3 waypoint19) + (visible_from objective4 waypoint0) + (visible_from objective4 waypoint1) + (visible_from objective4 waypoint2) + (visible_from objective4 waypoint3) + (visible_from objective4 waypoint4) + (visible_from objective4 waypoint5) + (visible_from objective4 waypoint6) + (visible_from objective4 waypoint7) + (visible_from objective4 waypoint8) + (visible_from objective4 waypoint9) + (visible_from objective4 waypoint10) + (visible_from objective4 waypoint11) + (visible_from objective4 waypoint12) + (visible_from objective4 waypoint13) + (visible_from objective4 waypoint14) + (visible_from objective4 waypoint15) + (visible_from objective4 waypoint16) + (visible_from objective4 waypoint17) + (visible_from objective4 waypoint18) + (visible_from objective4 waypoint19) + (visible_from objective4 waypoint20) + (visible_from objective4 waypoint21) + (visible_from objective4 waypoint22) + (visible_from objective4 waypoint23) + (visible_from objective5 waypoint0) + (visible_from objective5 waypoint1) + (visible_from objective5 waypoint2) + (visible_from objective5 waypoint3) + (visible_from objective5 waypoint4) + (visible_from objective5 waypoint5) + (visible_from objective5 waypoint6) + (visible_from objective5 waypoint7) + (visible_from objective5 waypoint8) + (visible_from objective5 waypoint9) + (visible_from objective5 waypoint10) + (visible_from objective5 waypoint11) + (visible_from objective5 waypoint12) + (visible_from objective5 waypoint13) + (visible_from objective5 waypoint14) + (visible_from objective6 waypoint0) + (visible_from objective6 waypoint1) + (visible_from objective6 waypoint2) + (visible_from objective6 waypoint3) + (visible_from objective6 waypoint4) + (visible_from objective6 waypoint5) + (visible_from objective6 waypoint6) + (visible_from objective6 waypoint7) + (visible_from objective6 waypoint8) + (visible_from objective6 waypoint9) + (visible_from objective6 waypoint10) + (visible_from objective7 waypoint0) + (visible_from objective7 waypoint1) + (visible_from objective7 waypoint2) + (visible_from objective7 waypoint3) + (visible_from objective7 waypoint4) + (visible_from objective7 waypoint5) + (visible_from objective7 waypoint6) + (visible_from objective7 waypoint7) + (visible_from objective7 waypoint8) + (visible_from objective7 waypoint9) + (visible_from objective7 waypoint10) + (visible_from objective7 waypoint11) + (visible_from objective7 waypoint12) + (visible_from objective7 waypoint13) + (visible_from objective7 waypoint14) + (visible_from objective7 waypoint15) + (visible_from objective7 waypoint16) + (visible_from objective7 waypoint17) + (visible_from objective7 waypoint18) + (visible_from objective7 waypoint19) + (visible_from objective7 waypoint20) +) + +(:goal (and +(communicated_soil_data waypoint8) +(communicated_soil_data waypoint23) +(communicated_soil_data waypoint7) +(communicated_soil_data waypoint11) +(communicated_soil_data waypoint13) +(communicated_soil_data waypoint20) +(communicated_rock_data waypoint7) +(communicated_rock_data waypoint14) +(communicated_rock_data waypoint22) +(communicated_rock_data waypoint16) +(communicated_rock_data waypoint12) +(communicated_rock_data waypoint10) +(communicated_rock_data waypoint9) +(communicated_rock_data waypoint21) +(communicated_rock_data waypoint18) +(communicated_image_data objective2 high_res) +(communicated_image_data objective0 high_res) +(communicated_image_data objective3 colour) +(communicated_image_data objective7 colour) +(communicated_image_data objective5 high_res) + ) +) + +(:metric minimize (recharges)) +) From 9b57554782f8748870aa4c255f451f0b0382a796 Mon Sep 17 00:00:00 2001 From: Francesco Fuggitti Date: Fri, 13 Oct 2023 23:26:03 -0400 Subject: [PATCH 61/65] decapitalize objects types rovers --- .../pddl_files/rovers-numeric-automatic/p01.pddl | 14 +++++++------- .../pddl_files/rovers-numeric-automatic/p02.pddl | 14 +++++++------- .../pddl_files/rovers-numeric-automatic/p03.pddl | 14 +++++++------- .../pddl_files/rovers-numeric-automatic/p04.pddl | 14 +++++++------- .../pddl_files/rovers-numeric-automatic/p05.pddl | 14 +++++++------- .../pddl_files/rovers-numeric-automatic/p06.pddl | 14 +++++++------- .../pddl_files/rovers-numeric-automatic/p07.pddl | 14 +++++++------- .../pddl_files/rovers-numeric-automatic/p08.pddl | 14 +++++++------- .../pddl_files/rovers-numeric-automatic/p09.pddl | 14 +++++++------- .../pddl_files/rovers-numeric-automatic/p10.pddl | 14 +++++++------- .../pddl_files/rovers-numeric-automatic/p11.pddl | 14 +++++++------- .../pddl_files/rovers-numeric-automatic/p12.pddl | 14 +++++++------- .../pddl_files/rovers-numeric-automatic/p13.pddl | 14 +++++++------- .../pddl_files/rovers-numeric-automatic/p14.pddl | 14 +++++++------- .../pddl_files/rovers-numeric-automatic/p15.pddl | 14 +++++++------- .../pddl_files/rovers-numeric-automatic/p16.pddl | 14 +++++++------- .../pddl_files/rovers-numeric-automatic/p17.pddl | 14 +++++++------- .../pddl_files/rovers-numeric-automatic/p18.pddl | 14 +++++++------- .../pddl_files/rovers-numeric-automatic/p19.pddl | 14 +++++++------- .../pddl_files/rovers-numeric-automatic/p20.pddl | 14 +++++++------- 20 files changed, 140 insertions(+), 140 deletions(-) diff --git a/tests/fixtures/pddl_files/rovers-numeric-automatic/p01.pddl b/tests/fixtures/pddl_files/rovers-numeric-automatic/p01.pddl index 36dba2ba..d06bc0ce 100644 --- a/tests/fixtures/pddl_files/rovers-numeric-automatic/p01.pddl +++ b/tests/fixtures/pddl_files/rovers-numeric-automatic/p01.pddl @@ -1,12 +1,12 @@ (define (problem roverprob1234) (:domain Rover) (:objects - general - Lander - colour high_res low_res - Mode - rover0 - Rover - rover0store - Store - waypoint0 waypoint1 waypoint2 waypoint3 - Waypoint - camera0 - Camera - objective0 objective1 - Objective + general - lander + colour high_res low_res - mode + rover0 - rover + rover0store - store + waypoint0 waypoint1 waypoint2 waypoint3 - waypoint + camera0 - camera + objective0 objective1 - objective ) (:init (visible waypoint1 waypoint0) diff --git a/tests/fixtures/pddl_files/rovers-numeric-automatic/p02.pddl b/tests/fixtures/pddl_files/rovers-numeric-automatic/p02.pddl index 60b3a7fe..e6b1d426 100644 --- a/tests/fixtures/pddl_files/rovers-numeric-automatic/p02.pddl +++ b/tests/fixtures/pddl_files/rovers-numeric-automatic/p02.pddl @@ -1,12 +1,12 @@ (define (problem roverprob4213) (:domain Rover) (:objects - general - Lander - colour high_res low_res - Mode - rover0 - Rover - rover0store - Store - waypoint0 waypoint1 waypoint2 waypoint3 - Waypoint - camera0 camera1 - Camera - objective0 objective1 - Objective + general - lander + colour high_res low_res - mode + rover0 - rover + rover0store - store + waypoint0 waypoint1 waypoint2 waypoint3 - waypoint + camera0 camera1 - camera + objective0 objective1 - objective ) (:init (visible waypoint0 waypoint1) diff --git a/tests/fixtures/pddl_files/rovers-numeric-automatic/p03.pddl b/tests/fixtures/pddl_files/rovers-numeric-automatic/p03.pddl index 921cc86a..16c6c87e 100644 --- a/tests/fixtures/pddl_files/rovers-numeric-automatic/p03.pddl +++ b/tests/fixtures/pddl_files/rovers-numeric-automatic/p03.pddl @@ -1,12 +1,12 @@ (define (problem roverprob3726) (:domain Rover) (:objects - general - Lander - colour high_res low_res - Mode - rover0 rover1 - Rover - rover0store rover1store - Store - waypoint0 waypoint1 waypoint2 waypoint3 - Waypoint - camera0 camera1 - Camera - objective0 objective1 - Objective + general - lander + colour high_res low_res - mode + rover0 rover1 - rover + rover0store rover1store - store + waypoint0 waypoint1 waypoint2 waypoint3 - waypoint + camera0 camera1 - camera + objective0 objective1 - objective ) (:init (visible waypoint0 waypoint1) diff --git a/tests/fixtures/pddl_files/rovers-numeric-automatic/p04.pddl b/tests/fixtures/pddl_files/rovers-numeric-automatic/p04.pddl index 29d5ca52..7273fb16 100644 --- a/tests/fixtures/pddl_files/rovers-numeric-automatic/p04.pddl +++ b/tests/fixtures/pddl_files/rovers-numeric-automatic/p04.pddl @@ -1,12 +1,12 @@ (define (problem roverprob6232) (:domain Rover) (:objects - general - Lander - colour high_res low_res - Mode - rover0 rover1 - Rover - rover0store rover1store - Store - waypoint0 waypoint1 waypoint2 waypoint3 - Waypoint - camera0 camera1 camera2 - Camera - objective0 objective1 objective2 - Objective + general - lander + colour high_res low_res - mode + rover0 rover1 - rover + rover0store rover1store - store + waypoint0 waypoint1 waypoint2 waypoint3 - waypoint + camera0 camera1 camera2 - camera + objective0 objective1 objective2 - objective ) (:init (visible waypoint1 waypoint0) diff --git a/tests/fixtures/pddl_files/rovers-numeric-automatic/p05.pddl b/tests/fixtures/pddl_files/rovers-numeric-automatic/p05.pddl index 67f911da..b3702d9c 100644 --- a/tests/fixtures/pddl_files/rovers-numeric-automatic/p05.pddl +++ b/tests/fixtures/pddl_files/rovers-numeric-automatic/p05.pddl @@ -1,12 +1,12 @@ (define (problem roverprob2435) (:domain Rover) (:objects - general - Lander - colour high_res low_res - Mode - rover0 rover1 - Rover - rover0store rover1store - Store - waypoint0 waypoint1 waypoint2 waypoint3 - Waypoint - camera0 camera1 camera2 - Camera - objective0 objective1 objective2 - Objective + general - lander + colour high_res low_res - mode + rover0 rover1 - rover + rover0store rover1store - store + waypoint0 waypoint1 waypoint2 waypoint3 - waypoint + camera0 camera1 camera2 - camera + objective0 objective1 objective2 - objective ) (:init (visible waypoint0 waypoint2) diff --git a/tests/fixtures/pddl_files/rovers-numeric-automatic/p06.pddl b/tests/fixtures/pddl_files/rovers-numeric-automatic/p06.pddl index 56662c9a..5480c2ae 100644 --- a/tests/fixtures/pddl_files/rovers-numeric-automatic/p06.pddl +++ b/tests/fixtures/pddl_files/rovers-numeric-automatic/p06.pddl @@ -1,12 +1,12 @@ (define (problem roverprob2312) (:domain Rover) (:objects - general - Lander - colour high_res low_res - Mode - rover0 rover1 - Rover - rover0store rover1store - Store - waypoint0 waypoint1 waypoint2 waypoint3 waypoint4 waypoint5 - Waypoint - camera0 camera1 camera2 - Camera - objective0 objective1 - Objective + general - lander + colour high_res low_res - mode + rover0 rover1 - rover + rover0store rover1store - store + waypoint0 waypoint1 waypoint2 waypoint3 waypoint4 waypoint5 - waypoint + camera0 camera1 camera2 - camera + objective0 objective1 - objective ) (:init (visible waypoint0 waypoint3) diff --git a/tests/fixtures/pddl_files/rovers-numeric-automatic/p07.pddl b/tests/fixtures/pddl_files/rovers-numeric-automatic/p07.pddl index 9467cf24..58879f7c 100644 --- a/tests/fixtures/pddl_files/rovers-numeric-automatic/p07.pddl +++ b/tests/fixtures/pddl_files/rovers-numeric-automatic/p07.pddl @@ -1,12 +1,12 @@ (define (problem roverprob4123) (:domain Rover) (:objects - general - Lander - colour high_res low_res - Mode - rover0 rover1 rover2 - Rover - rover0store rover1store rover2store - Store - waypoint0 waypoint1 waypoint2 waypoint3 waypoint4 waypoint5 - Waypoint - camera0 camera1 - Camera - objective0 objective1 - Objective + general - lander + colour high_res low_res - mode + rover0 rover1 rover2 - rover + rover0store rover1store rover2store - store + waypoint0 waypoint1 waypoint2 waypoint3 waypoint4 waypoint5 - waypoint + camera0 camera1 - camera + objective0 objective1 - objective ) (:init (visible waypoint0 waypoint3) diff --git a/tests/fixtures/pddl_files/rovers-numeric-automatic/p08.pddl b/tests/fixtures/pddl_files/rovers-numeric-automatic/p08.pddl index a908d744..389aff26 100644 --- a/tests/fixtures/pddl_files/rovers-numeric-automatic/p08.pddl +++ b/tests/fixtures/pddl_files/rovers-numeric-automatic/p08.pddl @@ -1,12 +1,12 @@ (define (problem roverprob1423) (:domain Rover) (:objects - general - Lander - colour high_res low_res - Mode - rover0 rover1 rover2 rover3 - Rover - rover0store rover1store rover2store rover3store - Store - waypoint0 waypoint1 waypoint2 waypoint3 waypoint4 waypoint5 - Waypoint - camera0 camera1 camera2 camera3 - Camera - objective0 objective1 objective2 - Objective + general - lander + colour high_res low_res - mode + rover0 rover1 rover2 rover3 - rover + rover0store rover1store rover2store rover3store - store + waypoint0 waypoint1 waypoint2 waypoint3 waypoint4 waypoint5 - waypoint + camera0 camera1 camera2 camera3 - camera + objective0 objective1 objective2 - objective ) (:init (visible waypoint0 waypoint1) diff --git a/tests/fixtures/pddl_files/rovers-numeric-automatic/p09.pddl b/tests/fixtures/pddl_files/rovers-numeric-automatic/p09.pddl index ee92f754..8d82d39a 100644 --- a/tests/fixtures/pddl_files/rovers-numeric-automatic/p09.pddl +++ b/tests/fixtures/pddl_files/rovers-numeric-automatic/p09.pddl @@ -1,12 +1,12 @@ (define (problem roverprob4132) (:domain Rover) (:objects - general - Lander - colour high_res low_res - Mode - rover0 rover1 rover2 rover3 - Rover - rover0store rover1store rover2store rover3store - Store - waypoint0 waypoint1 waypoint2 waypoint3 waypoint4 waypoint5 waypoint6 - Waypoint - camera0 camera1 camera2 camera3 camera4 - Camera - objective0 objective1 objective2 - Objective + general - lander + colour high_res low_res - mode + rover0 rover1 rover2 rover3 - rover + rover0store rover1store rover2store rover3store - store + waypoint0 waypoint1 waypoint2 waypoint3 waypoint4 waypoint5 waypoint6 - waypoint + camera0 camera1 camera2 camera3 camera4 - camera + objective0 objective1 objective2 - objective ) (:init (visible waypoint0 waypoint5) diff --git a/tests/fixtures/pddl_files/rovers-numeric-automatic/p10.pddl b/tests/fixtures/pddl_files/rovers-numeric-automatic/p10.pddl index 4472b717..ca7dd2a7 100644 --- a/tests/fixtures/pddl_files/rovers-numeric-automatic/p10.pddl +++ b/tests/fixtures/pddl_files/rovers-numeric-automatic/p10.pddl @@ -1,12 +1,12 @@ (define (problem roverprob8271) (:domain Rover) (:objects - general - Lander - colour high_res low_res - Mode - rover0 rover1 rover2 rover3 - Rover - rover0store rover1store rover2store rover3store - Store - waypoint0 waypoint1 waypoint2 waypoint3 waypoint4 waypoint5 waypoint6 - Waypoint - camera0 camera1 camera2 camera3 camera4 camera5 - Camera - objective0 objective1 objective2 objective3 - Objective + general - lander + colour high_res low_res - mode + rover0 rover1 rover2 rover3 - rover + rover0store rover1store rover2store rover3store - store + waypoint0 waypoint1 waypoint2 waypoint3 waypoint4 waypoint5 waypoint6 - waypoint + camera0 camera1 camera2 camera3 camera4 camera5 - camera + objective0 objective1 objective2 objective3 - objective ) (:init (visible waypoint0 waypoint6) diff --git a/tests/fixtures/pddl_files/rovers-numeric-automatic/p11.pddl b/tests/fixtures/pddl_files/rovers-numeric-automatic/p11.pddl index 7322c012..565e3d5f 100644 --- a/tests/fixtures/pddl_files/rovers-numeric-automatic/p11.pddl +++ b/tests/fixtures/pddl_files/rovers-numeric-automatic/p11.pddl @@ -1,12 +1,12 @@ (define (problem roverprob7126) (:domain Rover) (:objects - general - Lander - colour high_res low_res - Mode - rover0 rover1 rover2 rover3 - Rover - rover0store rover1store rover2store rover3store - Store - waypoint0 waypoint1 waypoint2 waypoint3 waypoint4 waypoint5 waypoint6 waypoint7 - Waypoint - camera0 camera1 camera2 camera3 - Camera - objective0 objective1 objective2 - Objective + general - lander + colour high_res low_res - mode + rover0 rover1 rover2 rover3 - rover + rover0store rover1store rover2store rover3store - store + waypoint0 waypoint1 waypoint2 waypoint3 waypoint4 waypoint5 waypoint6 waypoint7 - waypoint + camera0 camera1 camera2 camera3 - camera + objective0 objective1 objective2 - objective ) (:init (visible waypoint0 waypoint4) diff --git a/tests/fixtures/pddl_files/rovers-numeric-automatic/p12.pddl b/tests/fixtures/pddl_files/rovers-numeric-automatic/p12.pddl index 354bea6c..ba0c33be 100644 --- a/tests/fixtures/pddl_files/rovers-numeric-automatic/p12.pddl +++ b/tests/fixtures/pddl_files/rovers-numeric-automatic/p12.pddl @@ -1,12 +1,12 @@ (define (problem roverprob5146) (:domain Rover) (:objects - general - Lander - colour high_res low_res - Mode - rover0 rover1 rover2 rover3 - Rover - rover0store rover1store rover2store rover3store - Store - waypoint0 waypoint1 waypoint2 waypoint3 waypoint4 waypoint5 waypoint6 waypoint7 - Waypoint - camera0 camera1 camera2 camera3 - Camera - objective0 objective1 objective2 objective3 - Objective + general - lander + colour high_res low_res - mode + rover0 rover1 rover2 rover3 - rover + rover0store rover1store rover2store rover3store - store + waypoint0 waypoint1 waypoint2 waypoint3 waypoint4 waypoint5 waypoint6 waypoint7 - waypoint + camera0 camera1 camera2 camera3 - camera + objective0 objective1 objective2 objective3 - objective ) (:init (visible waypoint0 waypoint1) diff --git a/tests/fixtures/pddl_files/rovers-numeric-automatic/p13.pddl b/tests/fixtures/pddl_files/rovers-numeric-automatic/p13.pddl index 43c59b60..26384fc9 100644 --- a/tests/fixtures/pddl_files/rovers-numeric-automatic/p13.pddl +++ b/tests/fixtures/pddl_files/rovers-numeric-automatic/p13.pddl @@ -1,12 +1,12 @@ (define (problem roverprob6152) (:domain Rover) (:objects - general - Lander - colour high_res low_res - Mode - rover0 rover1 rover2 rover3 - Rover - rover0store rover1store rover2store rover3store - Store - waypoint0 waypoint1 waypoint2 waypoint3 waypoint4 waypoint5 waypoint6 waypoint7 waypoint8 - Waypoint - camera0 camera1 camera2 camera3 camera4 - Camera - objective0 objective1 objective2 objective3 - Objective + general - lander + colour high_res low_res - mode + rover0 rover1 rover2 rover3 - rover + rover0store rover1store rover2store rover3store - store + waypoint0 waypoint1 waypoint2 waypoint3 waypoint4 waypoint5 waypoint6 waypoint7 waypoint8 - waypoint + camera0 camera1 camera2 camera3 camera4 - camera + objective0 objective1 objective2 objective3 - objective ) (:init (visible waypoint0 waypoint1) diff --git a/tests/fixtures/pddl_files/rovers-numeric-automatic/p14.pddl b/tests/fixtures/pddl_files/rovers-numeric-automatic/p14.pddl index 546065b1..a3fb7ced 100644 --- a/tests/fixtures/pddl_files/rovers-numeric-automatic/p14.pddl +++ b/tests/fixtures/pddl_files/rovers-numeric-automatic/p14.pddl @@ -1,12 +1,12 @@ (define (problem roverprob1425) (:domain Rover) (:objects - general - Lander - colour high_res low_res - Mode - rover0 rover1 rover2 rover3 - Rover - rover0store rover1store rover2store rover3store - Store - waypoint0 waypoint1 waypoint2 waypoint3 waypoint4 waypoint5 waypoint6 waypoint7 waypoint8 waypoint9 - Waypoint - camera0 camera1 camera2 camera3 camera4 - Camera - objective0 objective1 objective2 objective3 - Objective + general - lander + colour high_res low_res - mode + rover0 rover1 rover2 rover3 - rover + rover0store rover1store rover2store rover3store - store + waypoint0 waypoint1 waypoint2 waypoint3 waypoint4 waypoint5 waypoint6 waypoint7 waypoint8 waypoint9 - waypoint + camera0 camera1 camera2 camera3 camera4 - camera + objective0 objective1 objective2 objective3 - objective ) (:init (visible waypoint0 waypoint3) diff --git a/tests/fixtures/pddl_files/rovers-numeric-automatic/p15.pddl b/tests/fixtures/pddl_files/rovers-numeric-automatic/p15.pddl index 91ab7113..1de79170 100644 --- a/tests/fixtures/pddl_files/rovers-numeric-automatic/p15.pddl +++ b/tests/fixtures/pddl_files/rovers-numeric-automatic/p15.pddl @@ -1,12 +1,12 @@ (define (problem roverprob4135) (:domain Rover) (:objects - general - Lander - colour high_res low_res - Mode - rover0 rover1 rover2 rover3 - Rover - rover0store rover1store rover2store rover3store - Store - waypoint0 waypoint1 waypoint2 waypoint3 waypoint4 waypoint5 waypoint6 waypoint7 waypoint8 waypoint9 waypoint10 - Waypoint - camera0 camera1 camera2 camera3 - Camera - objective0 objective1 objective2 objective3 objective4 - Objective + general - lander + colour high_res low_res - mode + rover0 rover1 rover2 rover3 - rover + rover0store rover1store rover2store rover3store - store + waypoint0 waypoint1 waypoint2 waypoint3 waypoint4 waypoint5 waypoint6 waypoint7 waypoint8 waypoint9 waypoint10 - waypoint + camera0 camera1 camera2 camera3 - camera + objective0 objective1 objective2 objective3 objective4 - objective ) (:init (visible waypoint0 waypoint3) diff --git a/tests/fixtures/pddl_files/rovers-numeric-automatic/p16.pddl b/tests/fixtures/pddl_files/rovers-numeric-automatic/p16.pddl index c680de5e..7b7fcb3f 100644 --- a/tests/fixtures/pddl_files/rovers-numeric-automatic/p16.pddl +++ b/tests/fixtures/pddl_files/rovers-numeric-automatic/p16.pddl @@ -1,12 +1,12 @@ (define (problem roverprob5142) (:domain Rover) (:objects - general - Lander - colour high_res low_res - Mode - rover0 rover1 rover2 rover3 - Rover - rover0store rover1store rover2store rover3store - Store - waypoint0 waypoint1 waypoint2 waypoint3 waypoint4 waypoint5 waypoint6 waypoint7 waypoint8 waypoint9 waypoint10 waypoint11 - Waypoint - camera0 camera1 camera2 camera3 - Camera - objective0 objective1 objective2 objective3 objective4 - Objective + general - lander + colour high_res low_res - mode + rover0 rover1 rover2 rover3 - rover + rover0store rover1store rover2store rover3store - store + waypoint0 waypoint1 waypoint2 waypoint3 waypoint4 waypoint5 waypoint6 waypoint7 waypoint8 waypoint9 waypoint10 waypoint11 - waypoint + camera0 camera1 camera2 camera3 - camera + objective0 objective1 objective2 objective3 objective4 - objective ) (:init (visible waypoint0 waypoint10) diff --git a/tests/fixtures/pddl_files/rovers-numeric-automatic/p17.pddl b/tests/fixtures/pddl_files/rovers-numeric-automatic/p17.pddl index b2be4ab0..11662793 100644 --- a/tests/fixtures/pddl_files/rovers-numeric-automatic/p17.pddl +++ b/tests/fixtures/pddl_files/rovers-numeric-automatic/p17.pddl @@ -1,12 +1,12 @@ (define (problem roverprob5624) (:domain Rover) (:objects - general - Lander - colour high_res low_res - Mode - rover0 rover1 rover2 rover3 rover4 rover5 - Rover - rover0store rover1store rover2store rover3store rover4store rover5store - Store - waypoint0 waypoint1 waypoint2 waypoint3 waypoint4 waypoint5 waypoint6 waypoint7 waypoint8 waypoint9 waypoint10 waypoint11 waypoint12 waypoint13 waypoint14 - Waypoint - camera0 camera1 camera2 camera3 camera4 camera5 camera6 - Camera - objective0 objective1 objective2 objective3 objective4 objective5 - Objective + general - lander + colour high_res low_res - mode + rover0 rover1 rover2 rover3 rover4 rover5 - rover + rover0store rover1store rover2store rover3store rover4store rover5store - store + waypoint0 waypoint1 waypoint2 waypoint3 waypoint4 waypoint5 waypoint6 waypoint7 waypoint8 waypoint9 waypoint10 waypoint11 waypoint12 waypoint13 waypoint14 - waypoint + camera0 camera1 camera2 camera3 camera4 camera5 camera6 - camera + objective0 objective1 objective2 objective3 objective4 objective5 - objective ) (:init (visible waypoint1 waypoint0) diff --git a/tests/fixtures/pddl_files/rovers-numeric-automatic/p18.pddl b/tests/fixtures/pddl_files/rovers-numeric-automatic/p18.pddl index 426c3d89..99a3fb93 100644 --- a/tests/fixtures/pddl_files/rovers-numeric-automatic/p18.pddl +++ b/tests/fixtures/pddl_files/rovers-numeric-automatic/p18.pddl @@ -1,12 +1,12 @@ (define (problem roverprob4621) (:domain Rover) (:objects - general - Lander - colour high_res low_res - Mode - rover0 rover1 rover2 rover3 rover4 rover5 - Rover - rover0store rover1store rover2store rover3store rover4store rover5store - Store - waypoint0 waypoint1 waypoint2 waypoint3 waypoint4 waypoint5 waypoint6 waypoint7 waypoint8 waypoint9 waypoint10 waypoint11 waypoint12 waypoint13 waypoint14 waypoint15 waypoint16 waypoint17 waypoint18 waypoint19 - Waypoint - camera0 camera1 camera2 camera3 camera4 camera5 camera6 - Camera - objective0 objective1 objective2 objective3 objective4 objective5 objective6 - Objective + general - lander + colour high_res low_res - mode + rover0 rover1 rover2 rover3 rover4 rover5 - rover + rover0store rover1store rover2store rover3store rover4store rover5store - store + waypoint0 waypoint1 waypoint2 waypoint3 waypoint4 waypoint5 waypoint6 waypoint7 waypoint8 waypoint9 waypoint10 waypoint11 waypoint12 waypoint13 waypoint14 waypoint15 waypoint16 waypoint17 waypoint18 waypoint19 - waypoint + camera0 camera1 camera2 camera3 camera4 camera5 camera6 - camera + objective0 objective1 objective2 objective3 objective4 objective5 objective6 - objective ) (:init (visible waypoint0 waypoint1) diff --git a/tests/fixtures/pddl_files/rovers-numeric-automatic/p19.pddl b/tests/fixtures/pddl_files/rovers-numeric-automatic/p19.pddl index f9365e68..a534ee1f 100644 --- a/tests/fixtures/pddl_files/rovers-numeric-automatic/p19.pddl +++ b/tests/fixtures/pddl_files/rovers-numeric-automatic/p19.pddl @@ -1,12 +1,12 @@ (define (problem roverprob8327) (:domain Rover) (:objects - general - Lander - colour high_res low_res - Mode - rover0 rover1 rover2 rover3 rover4 rover5 - Rover - rover0store rover1store rover2store rover3store rover4store rover5store - Store - waypoint0 waypoint1 waypoint2 waypoint3 waypoint4 waypoint5 waypoint6 waypoint7 waypoint8 waypoint9 waypoint10 waypoint11 waypoint12 waypoint13 waypoint14 waypoint15 waypoint16 waypoint17 waypoint18 waypoint19 - Waypoint - camera0 camera1 camera2 camera3 camera4 camera5 camera6 - Camera - objective0 objective1 objective2 objective3 objective4 objective5 objective6 objective7 - Objective + general - lander + colour high_res low_res - mode + rover0 rover1 rover2 rover3 rover4 rover5 - rover + rover0store rover1store rover2store rover3store rover4store rover5store - store + waypoint0 waypoint1 waypoint2 waypoint3 waypoint4 waypoint5 waypoint6 waypoint7 waypoint8 waypoint9 waypoint10 waypoint11 waypoint12 waypoint13 waypoint14 waypoint15 waypoint16 waypoint17 waypoint18 waypoint19 - waypoint + camera0 camera1 camera2 camera3 camera4 camera5 camera6 - camera + objective0 objective1 objective2 objective3 objective4 objective5 objective6 objective7 - objective ) (:init (visible waypoint0 waypoint6) diff --git a/tests/fixtures/pddl_files/rovers-numeric-automatic/p20.pddl b/tests/fixtures/pddl_files/rovers-numeric-automatic/p20.pddl index 79f9a4ef..f0e63421 100644 --- a/tests/fixtures/pddl_files/rovers-numeric-automatic/p20.pddl +++ b/tests/fixtures/pddl_files/rovers-numeric-automatic/p20.pddl @@ -1,12 +1,12 @@ (define (problem roverprob7182) (:domain Rover) (:objects - general - Lander - colour high_res low_res - Mode - rover0 rover1 rover2 rover3 rover4 rover5 rover6 rover7 - Rover - rover0store rover1store rover2store rover3store rover4store rover5store rover6store rover7store - Store - waypoint0 waypoint1 waypoint2 waypoint3 waypoint4 waypoint5 waypoint6 waypoint7 waypoint8 waypoint9 waypoint10 waypoint11 waypoint12 waypoint13 waypoint14 waypoint15 waypoint16 waypoint17 waypoint18 waypoint19 waypoint20 waypoint21 waypoint22 waypoint23 waypoint24 - Waypoint - camera0 camera1 camera2 camera3 camera4 camera5 camera6 - Camera - objective0 objective1 objective2 objective3 objective4 objective5 objective6 objective7 - Objective + general - lander + colour high_res low_res - mode + rover0 rover1 rover2 rover3 rover4 rover5 rover6 rover7 - rover + rover0store rover1store rover2store rover3store rover4store rover5store rover6store rover7store - store + waypoint0 waypoint1 waypoint2 waypoint3 waypoint4 waypoint5 waypoint6 waypoint7 waypoint8 waypoint9 waypoint10 waypoint11 waypoint12 waypoint13 waypoint14 waypoint15 waypoint16 waypoint17 waypoint18 waypoint19 waypoint20 waypoint21 waypoint22 waypoint23 waypoint24 - waypoint + camera0 camera1 camera2 camera3 camera4 camera5 camera6 - camera + objective0 objective1 objective2 objective3 objective4 objective5 objective6 objective7 - objective ) (:init (visible waypoint0 waypoint5) From 144b615f6e38626a72479a26bd62bdfeac3fa5b1 Mon Sep 17 00:00:00 2001 From: Francesco Fuggitti Date: Sun, 15 Oct 2023 16:25:15 -0400 Subject: [PATCH 62/65] address some of the review comments on the PR --- pddl/_validation.py | 84 ++--------------------------------------- pddl/parser/common.lark | 2 +- pddl/parser/domain.py | 1 + 3 files changed, 6 insertions(+), 81 deletions(-) diff --git a/pddl/_validation.py b/pddl/_validation.py index 31379901..bc96fe52 100644 --- a/pddl/_validation.py +++ b/pddl/_validation.py @@ -25,22 +25,11 @@ from pddl.logic import Predicate from pddl.logic.base import BinaryOp, QuantifiedCondition, UnaryOp from pddl.logic.effects import AndEffect, Forall, When -from pddl.logic.functions import Assign, Decrease, Divide -from pddl.logic.functions import EqualTo as FunctionEqualTo from pddl.logic.functions import ( + BinaryFunction, FunctionExpression, - GreaterEqualThan, - GreaterThan, - Increase, - LesserEqualThan, - LesserThan, - Minus, NumericFunction, NumericValue, - Plus, - ScaleDown, - ScaleUp, - Times, ) from pddl.logic.predicates import DerivedPredicate, EqualTo from pddl.logic.terms import Term @@ -263,74 +252,9 @@ def _(self, _: NumericValue) -> None: return None @check_type.register - def _(self, equal_to: FunctionEqualTo) -> None: - """Check types annotations of a PDDL numeric equal to operator.""" - self.check_type(equal_to.operands) - - @check_type.register - def _(self, lesser: LesserThan) -> None: - """Check types annotations of a PDDL numeric lesser operator.""" - self.check_type(lesser.operands) - - @check_type.register - def _(self, lesser_equal: LesserEqualThan) -> None: - """Check types annotations of a PDDL numeric lesser or equal operator.""" - self.check_type(lesser_equal.operands) - - @check_type.register - def _(self, greater: GreaterThan) -> None: - """Check types annotations of a PDDL numeric greater operator.""" - self.check_type(greater.operands) - - @check_type.register - def _(self, greater_equal: GreaterEqualThan) -> None: - """Check types annotations of a PDDL numeric greater or equal to.""" - self.check_type(greater_equal.operands) - - @check_type.register - def _(self, assign: Assign) -> None: - """Check types annotations of a PDDL numeric assign to.""" - self.check_type(assign.operands) - - @check_type.register - def _(self, scale_up: ScaleUp) -> None: - """Check types annotations of a PDDL numeric assign to.""" - self.check_type(scale_up.operands) - - @check_type.register - def _(self, scale_down: ScaleDown) -> None: - """Check types annotations of a PDDL numeric assign to.""" - self.check_type(scale_down.operands) - - @check_type.register - def _(self, increase: Increase) -> None: - """Check types annotations of a PDDL numeric increase to.""" - self.check_type(increase.operands) - - @check_type.register - def _(self, decrease: Decrease) -> None: - """Check types annotations of a PDDL numeric decrease operator.""" - self.check_type(decrease.operands) - - @check_type.register - def _(self, minus: Minus) -> None: - """Check types annotations of a PDDL numeric minus operator.""" - self.check_type(minus.operands) - - @check_type.register - def _(self, plus: Plus) -> None: - """Check types annotations of a PDDL numeric plus operator.""" - self.check_type(plus.operands) - - @check_type.register - def _(self, times: Times) -> None: - """Check types annotations of a PDDL numeric times operator.""" - self.check_type(times.operands) - - @check_type.register - def _(self, divide: Divide) -> None: - """Check types annotations of a PDDL numeric divide operator.""" - self.check_type(divide.operands) + def _(self, binary_function: BinaryFunction) -> None: + """Check types annotations of a PDDL numeric binary operator.""" + self.check_type(binary_function.operands) @check_type.register def _(self, equal_to: EqualTo) -> None: diff --git a/pddl/parser/common.lark b/pddl/parser/common.lark index 64513f05..17f209dc 100644 --- a/pddl/parser/common.lark +++ b/pddl/parser/common.lark @@ -58,7 +58,7 @@ DECREASE: "decrease" MAXIMIZE: "maximize" MINIMIZE: "minimize" TOTAL_COST: "total-cost" -NUMBER: /[0-9]+/ +NUMBER: /[0-9]+(.[0-9]+)*/ // available requirements STRIPS: ":strips" diff --git a/pddl/parser/domain.py b/pddl/parser/domain.py index dd600dfd..e08bfdd5 100644 --- a/pddl/parser/domain.py +++ b/pddl/parser/domain.py @@ -119,6 +119,7 @@ def predicates(self, args): def functions(self, args): """Process the 'functions' rule.""" function_definition = args[2] + # arg[2] is a dict with NumericFunction as keys and types as values, e.g., {(fuel ?l): number, (cost): number} return dict(functions=function_definition) def action_def(self, args): From 7eacf3237ba0ed66e2fc636fa0442371f1661311 Mon Sep 17 00:00:00 2001 From: Francesco Fuggitti Date: Sun, 15 Oct 2023 16:31:23 -0400 Subject: [PATCH 63/65] fix issue #96 (thanks @marcofavorito) and remove old comments --- pddl/logic/base.py | 13 ++++++++----- pddl/logic/functions.py | 22 +++++++++++++--------- pddl/logic/predicates.py | 3 --- 3 files changed, 21 insertions(+), 17 deletions(-) diff --git a/pddl/logic/base.py b/pddl/logic/base.py index 5ff3e199..decec9a7 100644 --- a/pddl/logic/base.py +++ b/pddl/logic/base.py @@ -115,31 +115,34 @@ class Atomic(Formula): """Atomic formula.""" -class MonotoneOp(type): +class BinaryOpMetaclass(type): """Metaclass to simplify monotone operator instantiations.""" _absorbing: Optional[Formula] = None + idempotency: bool = False def __call__(cls, *args, **kwargs): """Init the subclass object.""" operands = _simplify_monotone_op_operands(cls, *args) - if len(operands) == 1: + if len(operands) == 1 and cls.idempotency: return operands[0] - return super(MonotoneOp, cls).__call__(*operands, **kwargs) + return super(BinaryOpMetaclass, cls).__call__(*operands, **kwargs) -class And(BinaryOp, metaclass=MonotoneOp): +class And(BinaryOp, metaclass=BinaryOpMetaclass): """And operator.""" _absorbing = False + idempotency = True SYMBOL = "and" -class Or(BinaryOp, metaclass=MonotoneOp): +class Or(BinaryOp, metaclass=BinaryOpMetaclass): """Or operator.""" _absorbing = True + idempotency = True SYMBOL = "or" diff --git a/pddl/logic/functions.py b/pddl/logic/functions.py index 9a9cbf12..e55fd1ea 100644 --- a/pddl/logic/functions.py +++ b/pddl/logic/functions.py @@ -17,7 +17,7 @@ from pddl.custom_types import namelike, parse_function from pddl.helpers.base import assert_ from pddl.helpers.cache_hash import cache_hash -from pddl.logic.base import Atomic, MonotoneOp +from pddl.logic.base import Atomic, BinaryOpMetaclass from pddl.logic.terms import Term from pddl.parser.symbols import Symbols @@ -52,9 +52,6 @@ def arity(self) -> int: """Get the arity of the function.""" return len(self.terms) - # TODO: check whether it's a good idea... - # TODO: allow also for keyword-based replacement - # TODO: allow skip replacement with None arguments. def __call__(self, *terms: Term): """Replace terms.""" assert_(len(terms) == self.arity, "Wrong number of terms.") @@ -95,6 +92,7 @@ def __lt__(self, other): @cache_hash +@functools.total_ordering class NumericValue(FunctionExpression): """A class for a numeric value.""" @@ -111,6 +109,12 @@ def __eq__(self, other): """Compare with another object.""" return isinstance(other, NumericValue) and self.value == other.value + def __lt__(self, other): + """Compare with another object.""" + if not isinstance(other, NumericValue): + return NotImplemented + return self.value < other.value + def __hash__(self) -> int: """Compute the hash of the object.""" return hash(self._value) @@ -210,7 +214,7 @@ def __hash__(self): return hash((self.expression, self.optimization)) -class EqualTo(BinaryFunction, metaclass=MonotoneOp): +class EqualTo(BinaryFunction, metaclass=BinaryOpMetaclass): """Equal to operator.""" SYMBOL = Symbols.EQUAL @@ -310,7 +314,7 @@ def __init__(self, *operands: FunctionExpression): super().__init__(*operands) -class Minus(BinaryFunction, metaclass=MonotoneOp): +class Minus(BinaryFunction, metaclass=BinaryOpMetaclass): """Minus operator.""" SYMBOL = Symbols.MINUS @@ -324,7 +328,7 @@ def __init__(self, *operands: FunctionExpression): super().__init__(*operands) -class Plus(BinaryFunction, metaclass=MonotoneOp): +class Plus(BinaryFunction, metaclass=BinaryOpMetaclass): """Plus operator.""" SYMBOL = Symbols.PLUS @@ -338,7 +342,7 @@ def __init__(self, *operands: FunctionExpression): super().__init__(*operands) -class Times(BinaryFunction, metaclass=MonotoneOp): +class Times(BinaryFunction, metaclass=BinaryOpMetaclass): """Times operator.""" SYMBOL = Symbols.TIMES @@ -352,7 +356,7 @@ def __init__(self, *operands: FunctionExpression): super().__init__(*operands) -class Divide(BinaryFunction, metaclass=MonotoneOp): +class Divide(BinaryFunction, metaclass=BinaryOpMetaclass): """Divide operator.""" SYMBOL = Symbols.DIVIDE diff --git a/pddl/logic/predicates.py b/pddl/logic/predicates.py index dc124bec..48270867 100644 --- a/pddl/logic/predicates.py +++ b/pddl/logic/predicates.py @@ -67,9 +67,6 @@ def arity(self) -> int: """Get the arity of the predicate.""" return len(self.terms) - # TODO check whether it's a good idea... - # TODO allow also for keyword-based replacement - # TODO allow skip replacement with None arguments. def __call__(self, *terms: Term): """Replace terms.""" assert_(len(terms) == self.arity, "Number of terms not correct.") From 2682e2f51f89b920f697896ae485e58b6d4f3296 Mon Sep 17 00:00:00 2001 From: Francesco Fuggitti Date: Mon, 16 Oct 2023 15:50:30 -0400 Subject: [PATCH 64/65] add idempotency into flattening method of operands and fix spotting nested duplicated elements (found by @marcofavorito, thanks!). --- pddl/logic/base.py | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/pddl/logic/base.py b/pddl/logic/base.py index decec9a7..c0f0d6a3 100644 --- a/pddl/logic/base.py +++ b/pddl/logic/base.py @@ -12,7 +12,7 @@ """Base classes for PDDL logic formulas.""" import functools -from typing import AbstractSet, Collection, Optional, Sequence +from typing import AbstractSet, Any, Collection, List, Optional, Sequence from pddl.helpers.base import ensure_set from pddl.helpers.cache_hash import cache_hash @@ -123,7 +123,9 @@ class BinaryOpMetaclass(type): def __call__(cls, *args, **kwargs): """Init the subclass object.""" - operands = _simplify_monotone_op_operands(cls, *args) + operands = _simplify_monotone_op_operands( + cls, *args, idempotency=cls.idempotency + ) if len(operands) == 1 and cls.idempotency: return operands[0] @@ -263,20 +265,25 @@ def is_literal(formula: Formula) -> bool: ) -def _simplify_monotone_op_operands(cls, *operands): - operands = list(dict.fromkeys(operands)) - if len(operands) == 0: +def _simplify_monotone_op_operands(cls, *operands, idempotency: bool = False): + old_operands: List[Any] = ( + list(dict.fromkeys(operands)) if idempotency else list(operands) + ) + if len(old_operands) == 0: return [] - elif len(operands) == 1: - return [operands[0]] + elif len(old_operands) == 1: + return [old_operands[0]] # shift-up subformulas with same operator. DFS on expression tree. + seen = set() new_operands = [] - stack = operands[::-1] # it is reversed in order to preserve order. + stack = old_operands[::-1] # it is reversed in order to preserve order. while len(stack) > 0: element = stack.pop() if not isinstance(element, cls): - new_operands.append(element) + if element not in seen: + seen.add(element) + new_operands.append(element) continue stack.extend(reversed(element.operands)) # see above regarding reversed. From a18263c5b2f3458b8f7a00765ae7bd875c40302f Mon Sep 17 00:00:00 2001 From: Francesco Fuggitti Date: Mon, 16 Oct 2023 18:43:51 -0400 Subject: [PATCH 65/65] remove duplicated code (thanks @haz) --- pddl/parser/problem.lark | 11 +----- pddl/parser/problem.py | 27 ++------------ scripts/whitelist.py | 81 ++++++++++++++++------------------------ 3 files changed, 37 insertions(+), 82 deletions(-) diff --git a/pddl/parser/problem.lark b/pddl/parser/problem.lark index c6951a87..fee8a552 100644 --- a/pddl/parser/problem.lark +++ b/pddl/parser/problem.lark @@ -29,15 +29,6 @@ gd_name: atomic_formula_name | LPAR AND gd_name* RPAR | LPAR binary_comp f_exp f_exp RPAR -f_exp: NUMBER - | LPAR binary_op f_exp f_exp RPAR - | LPAR multi_op f_exp f_exp+ RPAR - | LPAR MINUS f_exp RPAR - | f_head - -f_head: NAME - | LPAR NAME term* RPAR - metric_spec: LPAR METRIC optimization metric_f_exp RPAR ?optimization: MAXIMIZE @@ -62,6 +53,8 @@ GOAL: ":goal" %import .domain.require_key -> require_key %import .domain.typed_list_name -> typed_list_name %import .domain.predicate -> predicate +%import .domain.f_head -> f_head +%import .domain.f_exp -> f_exp %import .domain.binary_comp -> binary_comp %import .domain.binary_op -> binary_op %import .domain.multi_op -> multi_op diff --git a/pddl/parser/problem.py b/pddl/parser/problem.py index f3ea36e7..2ca8856f 100644 --- a/pddl/parser/problem.py +++ b/pddl/parser/problem.py @@ -35,7 +35,7 @@ Times, ) from pddl.logic.predicates import EqualTo, Predicate -from pddl.logic.terms import Constant, Variable +from pddl.logic.terms import Constant from pddl.parser import PARSERS_DIRECTORY, PROBLEM_GRAMMAR_FILE from pddl.parser.domain import DomainTransformer from pddl.parser.symbols import BINARY_COMP_SYMBOLS, Symbols @@ -192,32 +192,11 @@ def atomic_formula_name(self, args): def f_exp(self, args): """Process the 'f_exp' rule.""" - if len(args) == 1: - if not isinstance(args[0], NumericFunction): - return NumericValue(args[0]) - return args[0] - op = None - if args[1] == Symbols.MINUS.value: - op = Minus - if args[1] == Symbols.PLUS.value: - op = Plus - if args[1] == Symbols.TIMES.value: - op = Times - if args[1] == Symbols.DIVIDE.value: - op = Divide - return ( - op(*args[2:-1]) - if op is not None - else PDDLParsingError("Operator not recognized") - ) + return self._domain_transformer.f_exp(args) def f_head(self, args): """Process the 'f_head' rule.""" - if len(args) == 1: - return NumericFunction(args[0]) - function_name = args[1] - variables = [Variable(x, {}) for x in args[2:-1]] - return NumericFunction(function_name, *variables) + return self._domain_transformer.f_head(args) def metric_spec(self, args): """Process the 'metric_spec' rule.""" diff --git a/scripts/whitelist.py b/scripts/whitelist.py index 27fa1883..9c453bc2 100644 --- a/scripts/whitelist.py +++ b/scripts/whitelist.py @@ -1,36 +1,23 @@ -_._ # unused method (pddl/_validation.py:238) +_._ # unused method (pddl/_validation.py:227) +_._ # unused method (pddl/_validation.py:233) +_._ # unused method (pddl/_validation.py:239) _._ # unused method (pddl/_validation.py:244) -_._ # unused method (pddl/_validation.py:250) -_._ # unused method (pddl/_validation.py:255) -_._ # unused method (pddl/_validation.py:260) +_._ # unused method (pddl/_validation.py:249) +_._ # unused method (pddl/_validation.py:254) +_._ # unused method (pddl/_validation.py:259) _._ # unused method (pddl/_validation.py:265) -_._ # unused method (pddl/_validation.py:270) -_._ # unused method (pddl/_validation.py:275) -_._ # unused method (pddl/_validation.py:280) -_._ # unused method (pddl/_validation.py:285) -_._ # unused method (pddl/_validation.py:290) -_._ # unused method (pddl/_validation.py:295) -_._ # unused method (pddl/_validation.py:300) -_._ # unused method (pddl/_validation.py:305) -_._ # unused method (pddl/_validation.py:310) -_._ # unused method (pddl/_validation.py:315) -_._ # unused method (pddl/_validation.py:320) -_._ # unused method (pddl/_validation.py:325) -_._ # unused method (pddl/_validation.py:330) -_._ # unused method (pddl/_validation.py:335) -_._ # unused method (pddl/_validation.py:341) -_._ # unused method (pddl/_validation.py:347) -_._ # unused method (pddl/_validation.py:352) -_._ # unused method (pddl/_validation.py:357) -_._ # unused method (pddl/_validation.py:363) -_._ # unused method (pddl/_validation.py:368) -_._ # unused method (pddl/_validation.py:374) -_._ # unused method (pddl/_validation.py:380) -_.all_functions # unused property (pddl/_validation.py:409) +_._ # unused method (pddl/_validation.py:271) +_._ # unused method (pddl/_validation.py:276) +_._ # unused method (pddl/_validation.py:281) +_._ # unused method (pddl/_validation.py:287) +_._ # unused method (pddl/_validation.py:292) +_._ # unused method (pddl/_validation.py:298) +_._ # unused method (pddl/_validation.py:304) +_.all_functions # unused property (pddl/_validation.py:333) to_names # unused function (pddl/custom_types.py:99) safe_get # unused function (pddl/helpers/base.py:111) find # unused function (pddl/helpers/base.py:116) -ensure_formula # unused function (pddl/logic/base.py:234) +ensure_formula # unused function (pddl/logic/base.py:239) PEffect # unused variable (pddl/logic/effects.py:168) Effect # unused variable (pddl/logic/effects.py:170) CondEffect # unused variable (pddl/logic/effects.py:171) @@ -39,23 +26,21 @@ _.start # unused method (pddl/parser/domain.py:65) _.domain_def # unused method (pddl/parser/domain.py:86) _._predicates_by_name # unused attribute (pddl/parser/domain.py:116) -_.action_def # unused method (pddl/parser/domain.py:124) -_.action_parameters # unused method (pddl/parser/domain.py:142) -_.emptyor_pregd # unused method (pddl/parser/domain.py:149) -_.gd # unused method (pddl/parser/domain.py:232) -_.emptyor_effect # unused method (pddl/parser/domain.py:249) -_.c_effect # unused method (pddl/parser/domain.py:264) -_.p_effect # unused method (pddl/parser/domain.py:279) -_.cond_effect # unused method (pddl/parser/domain.py:286) -_.num_effect # unused method (pddl/parser/domain.py:294) -_.atomic_formula_term # unused method (pddl/parser/domain.py:309) -_.atomic_formula_skeleton # unused method (pddl/parser/domain.py:346) -_.atomic_function_skeleton # unused method (pddl/parser/domain.py:352) -_.f_exp # unused method (pddl/parser/domain.py:362) -_.f_head # unused method (pddl/parser/domain.py:383) -_.typed_list_variable # unused method (pddl/parser/domain.py:399) -_.f_typed_list_atomic_function_skeleton # unused method (pddl/parser/domain.py:414) -_.type_def # unused method (pddl/parser/domain.py:430) +_.action_def # unused method (pddl/parser/domain.py:125) +_.action_parameters # unused method (pddl/parser/domain.py:143) +_.emptyor_pregd # unused method (pddl/parser/domain.py:150) +_.gd # unused method (pddl/parser/domain.py:233) +_.emptyor_effect # unused method (pddl/parser/domain.py:250) +_.c_effect # unused method (pddl/parser/domain.py:265) +_.p_effect # unused method (pddl/parser/domain.py:280) +_.cond_effect # unused method (pddl/parser/domain.py:287) +_.num_effect # unused method (pddl/parser/domain.py:295) +_.atomic_formula_term # unused method (pddl/parser/domain.py:310) +_.atomic_formula_skeleton # unused method (pddl/parser/domain.py:347) +_.atomic_function_skeleton # unused method (pddl/parser/domain.py:353) +_.typed_list_variable # unused method (pddl/parser/domain.py:400) +_.f_typed_list_atomic_function_skeleton # unused method (pddl/parser/domain.py:415) +_.type_def # unused method (pddl/parser/domain.py:431) _.start # unused method (pddl/parser/problem.py:55) _.problem_def # unused method (pddl/parser/problem.py:68) _.problem_domain # unused method (pddl/parser/problem.py:72) @@ -66,10 +51,8 @@ _.basic_function_term # unused method (pddl/parser/problem.py:135) _.gd_name # unused method (pddl/parser/problem.py:164) _.atomic_formula_name # unused method (pddl/parser/problem.py:177) -_.f_exp # unused method (pddl/parser/problem.py:193) -_.f_head # unused method (pddl/parser/problem.py:214) -_.metric_spec # unused method (pddl/parser/problem.py:222) -_.metric_f_exp # unused method (pddl/parser/problem.py:231) +_.metric_spec # unused method (pddl/parser/problem.py:201) +_.metric_f_exp # unused method (pddl/parser/problem.py:210) OpSymbol # unused variable (pddl/parser/symbols.py:17) OpRequirement # unused variable (pddl/parser/symbols.py:18) ROUND_BRACKET_LEFT # unused variable (pddl/parser/symbols.py:24)