diff --git a/compilers/Cyber_Compiler.rb b/compilers/Cyber_Compiler.rb index 2e7cebc..1524c0a 100644 --- a/compilers/Cyber_Compiler.rb +++ b/compilers/Cyber_Compiler.rb @@ -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? diff --git a/compilers/Hyper_Compiler.rb b/compilers/Hyper_Compiler.rb index 9f6ea68..6da76c2 100644 --- a/compilers/Hyper_Compiler.rb +++ b/compilers/Hyper_Compiler.rb @@ -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?