Describe the bug
p2 = PDDLReader().parse_problem(PDDLWriter(p1).get_domain(), None) can produce a p2 that's different from p1.
As a matter of fact, it seems like anything defined with (:function) is always parsed as real fluent regardless of its usage.
To Reproduce
from unified_planning.shortcuts import *
from unified_planning.io import PDDLWriter, PDDLReader
Counter = UserType('Counter')
value = Fluent('value', IntType(), m=Counter)
inc = InstantaneousAction('increment',c=Counter)
c = inc.parameter('c')
inc.add_precondition(LE(value(c), 10))
inc.add_increase_effect(value(c), 1)
problem = Problem('problem')
problem.add_fluent(value, default_initial_value=1)
C0 = Object('c0', Counter)
problem.add_object(C0)
problem.add_action(inc)
p2 = PDDLReader().parse_problem_string(PDDLWriter(problem).get_domain())
print("Original problem:")
print(problem.kind)
print("Parsed problem:")
print(p2.kind, "<-- this is different")
Output:
Original problem:
PROBLEM_CLASS: ['ACTION_BASED']
PROBLEM_TYPE: ['SIMPLE_NUMERIC_PLANNING']
EFFECTS_KIND: ['INCREASE_EFFECTS']
TYPING: ['FLAT_TYPING']
FLUENTS_TYPE: ['INT_FLUENTS']
Parsed problem:
PROBLEM_CLASS: ['ACTION_BASED']
PROBLEM_TYPE: ['SIMPLE_NUMERIC_PLANNING']
EFFECTS_KIND: ['INCREASE_EFFECTS']
TYPING: ['FLAT_TYPING']
FLUENTS_TYPE: ['REAL_FLUENTS'] <-- this is different
Expected behavior
problem -> PDDLWriter -> problem_str -> PDDLReader -> problem should not create discrepancies.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
N/A
Smartphone (please complete the following information):
N/A
Additional context
Add any other context about the problem here.
Describe the bug
p2 = PDDLReader().parse_problem(PDDLWriter(p1).get_domain(), None)can produce a p2 that's different from p1.As a matter of fact, it seems like anything defined with
(:function)is always parsed asrealfluent regardless of its usage.To Reproduce
Output:
Expected behavior
problem -> PDDLWriter -> problem_str -> PDDLReader -> problem should not create discrepancies.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
N/A
Smartphone (please complete the following information):
N/A
Additional context
Add any other context about the problem here.