Skip to content

Commit

Permalink
Keep irrelevant predicates in Pullup
Browse files Browse the repository at this point in the history
  • Loading branch information
Maumagnaguagno committed Mar 17, 2024
1 parent a676f55 commit 26b5f75
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions extensions/Pullup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -195,22 +195,21 @@ def apply(operators, methods, predicates, state, tasks, goal_pos, goal_not, debu
op[3].select! {|pre,| predicates[pre]}
}
# Update mutability
new_predicates = {}
predicates.transform_values! {}
operators.each {|_,_,precond_pos,precond_not,effect_add,effect_del|
precond_pos.each {|pre,| new_predicates[pre.freeze] ||= false}
precond_not.each {|pre,| new_predicates[pre.freeze] ||= false}
effect_add.each {|pre,| new_predicates[pre.freeze] = true}
effect_del.each {|pre,| new_predicates[pre.freeze] = true}
precond_pos.each {|pre,| predicates[pre.freeze] ||= false}
precond_not.each {|pre,| predicates[pre.freeze] ||= false}
effect_add.each {|pre,| predicates[pre.freeze] = true}
effect_del.each {|pre,| predicates[pre.freeze] = true}
}
methods.each {|decompositions|
decompositions.drop(2).each {|m|
m[2].each {|pre,| new_predicates[pre.freeze] ||= false}
m[3].each {|pre,| new_predicates[pre.freeze] ||= false}
m[2].each {|pre,| predicates[pre.freeze] ||= false}
m[3].each {|pre,| predicates[pre.freeze] ||= false}
}
}
goal_pos.each {|pre,| new_predicates[pre.freeze] ||= false}
goal_not.each {|pre,| new_predicates[pre.freeze] ||= false}
predicates.replace(new_predicates)
goal_pos.each {|pre,| predicates[pre.freeze] ||= false}
goal_not.each {|pre,| predicates[pre.freeze] ||= false}
tasks.unshift(ordered) unless tasks.empty?
end

Expand Down

0 comments on commit 26b5f75

Please sign in to comment.