Skip to content

Commit

Permalink
Fixed PDDL true predicate for adl compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
LBonassi95 committed Sep 5, 2024
1 parent ce48e1e commit 307555c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions plan4past/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
]
Expand Down
4 changes: 2 additions & 2 deletions plan4past/utils/pylogics2pddl.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 307555c

Please sign in to comment.