Skip to content

Commit

Permalink
fix(interpreted functions): variables declared and overwritten in wro…
Browse files Browse the repository at this point in the history
…ng places
  • Loading branch information
Samuel Gobbi committed Oct 18, 2024
1 parent ce8ecd6 commit c15e331
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,10 @@ def _compile(
# for each possible combination (known function combinations)
new_action = a.clone()
new_action.name = get_fresh_name(new_problem, a.name)

new_condition = None
new_precondition_list = list()

for kf in kfc:

substituter_instantaneous_action: up.model.walkers.Substituter = up.model.walkers.Substituter(
Expand Down Expand Up @@ -288,8 +292,6 @@ def _compile(
new_action.add_precondition(new_precondition)

argumentcounter = 0
new_condition = None
new_precondition_list = list()
while argumentcounter < len(kf.args):
for aif in all_ifs_in_instantaneous_action:
if (
Expand Down Expand Up @@ -796,8 +798,8 @@ def _compile(

else:
raise NotImplementedError

Check warning on line 800 in unified_planning/engines/compilers/interpreted_functions_remover.py

View check run for this annotation

Codecov / codecov/patch

unified_planning/engines/compilers/interpreted_functions_remover.py#L800

Added line #L800 was not covered by tests
# print("compilation complete!")
# print(new_problem)
print("compilation complete!")
print(new_problem)
return CompilerResult(
new_problem, partial(replace_action, map=new_to_old), self.name
)
Expand Down

0 comments on commit c15e331

Please sign in to comment.