diff --git a/setup.py b/setup.py index 21473ec..cd7cfbc 100644 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ author_email='tamer@fbk.eu', url='https://tamer.fbk.eu', packages=['up_tamer'], - install_requires=['pytamer==0.1.19', 'ConfigSpace'], + install_requires=['pytamer==0.1.20', 'ConfigSpace'], python_requires='>=3.7', license='APACHE' ) diff --git a/up_tamer/__init__.py b/up_tamer/__init__.py index 1e9dcda..31b4190 100644 --- a/up_tamer/__init__.py +++ b/up_tamer/__init__.py @@ -16,7 +16,7 @@ import re -VERSION = (1, 1, 3) +VERSION = (1, 1, 4) __version__ = ".".join(str(x) for x in VERSION) try: diff --git a/up_tamer/converter.py b/up_tamer/converter.py index 055a4ff..0f3d8fb 100644 --- a/up_tamer/converter.py +++ b/up_tamer/converter.py @@ -15,7 +15,7 @@ import unified_planning as up from unified_planning.model import FNode -from unified_planning.model.walkers import DagWalker +from unified_planning.model.walkers import DagWalker, Dnf import pytamer # type: ignore from fractions import Fraction from typing import Dict, List @@ -30,6 +30,7 @@ def __init__(self, env: pytamer.tamer_env, parameters: Dict['up.model.Parameter', pytamer.tamer_param]={}): DagWalker.__init__(self) self._env = env + self._to_dnf = Dnf(problem.environment) self._fluents = fluents self._constants = constants self._instances = instances @@ -42,7 +43,7 @@ def __init__(self, env: pytamer.tamer_env, def convert(self, expression: 'FNode') -> pytamer.tamer_expr: """Converts the given expression.""" - return self.walk(expression) + return self.walk(self._to_dnf.get_dnf_expression(expression)) def convert_back(self, expression: pytamer.tamer_expr) -> 'FNode': if pytamer.tamer_expr_is_boolean_constant(self._env, expression) == 1: