From 307555cf232d828892cfabf8a1d8ff36610586a2 Mon Sep 17 00:00:00 2001 From: LBonassi95 Date: Thu, 5 Sep 2024 10:54:58 +0200 Subject: [PATCH] Fixed PDDL true predicate for adl compilation --- plan4past/compiler.py | 3 +-- plan4past/utils/pylogics2pddl.py | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/plan4past/compiler.py b/plan4past/compiler.py index 7d27af3..e9c85bb 100644 --- a/plan4past/compiler.py +++ b/plan4past/compiler.py @@ -285,7 +285,6 @@ def compile(self): cm = CompilationManager(self.formula) new_fluents, new_effs, new_goal = cm.get_problem_extension() - new_fluents.append(TRUE_ATOM) self._fresh_atoms = set(new_fluents) self._yesterday_mapping = cm.get_yesterday_mapping() self._yesterday_dictionary = cm.yesterday_dictionary @@ -306,7 +305,7 @@ def _compile_domain( self, new_fluents, new_effs, new_goal ): # pylint: disable=arguments-differ """Compute the new domain.""" - new_predicates = [self.pylogics2pddl(fluent) for fluent in new_fluents] + new_predicates = [self.pylogics2pddl(fluent) for fluent in new_fluents] + [TRUE_PREDICATE] new_whens_positive = [ self.effect_conversion(eff, positive=True) for eff in new_effs ] diff --git a/plan4past/utils/pylogics2pddl.py b/plan4past/utils/pylogics2pddl.py index 714cda3..c504c6d 100644 --- a/plan4past/utils/pylogics2pddl.py +++ b/plan4past/utils/pylogics2pddl.py @@ -33,7 +33,7 @@ from pylogics.syntax.pltl import Atomic as PLTLAtomic from pylogics.syntax.pltl import PropositionalTrue -from plan4past.constants import TRUE_ATOM +from plan4past.constants import TRUE_PREDICATE from plan4past.helpers.utils import check_ from plan4past.helpers.yesterday_atom_helper import YesterdayAtom @@ -62,7 +62,7 @@ def translate(self, obj: Formula) -> PddlFormula: @translate.register def translate_true(self, _formula: PropositionalTrue) -> PddlFormula: """Compute the PDDL version of a true formula.""" - return TRUE_ATOM + return TRUE_PREDICATE @translate.register def translate_atomic(self, formula: PLTLAtomic) -> PddlFormula: