Skip to content

Commit

Permalink
Avoid free variables modification in Hyper/Cyber compilers
Browse files Browse the repository at this point in the history
  • Loading branch information
Maumagnaguagno committed Apr 26, 2024
1 parent 5f0ce7d commit 175bab3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion compilers/Cyber_Compiler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def compile_domain(domain_name, problem_name, operators, methods, predicates, st
define_methods << "\n\nstatic bool #{name}_#{dec[0]}_(const Task *task)\n{\n const VALUE *parameters = task->parameters;#{param_str}"
equality = []
define_methods_comparison = ''
f = dec[1]
f = dec[1].dup
precond_pos = dec[2].sort_by {|pre| (pre & param).size * -100 - (pre & f).size}
precond_pos.reject! {|pre,*terms|
if (terms & f).empty?
Expand Down
2 changes: 1 addition & 1 deletion compilers/Hyper_Compiler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def compile_domain(domain_name, problem_name, operators, methods, predicates, st
define_methods << "\n def #{name}_#{dec[0]}#{variables}"
equality = []
define_methods_comparison = ''
f = dec[1]
f = dec[1].dup
precond_pos = dec[2].sort_by {|pre| (pre & param).size * -100 - (pre & f).size}
precond_pos.reject! {|pre,*terms|
if (terms & f).empty?
Expand Down

0 comments on commit 175bab3

Please sign in to comment.