From e52df60536c25236193c671cbc420f2a25e3a22c Mon Sep 17 00:00:00 2001 From: Mau Magnaguagno Date: Sat, 12 Oct 2024 15:28:15 -0300 Subject: [PATCH] Refactor predicates in Hyper_Compiler compile_problem --- compilers/Hyper_Compiler.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compilers/Hyper_Compiler.rb b/compilers/Hyper_Compiler.rb index 2e66378..bec7149 100644 --- a/compilers/Hyper_Compiler.rb +++ b/compilers/Hyper_Compiler.rb @@ -278,11 +278,11 @@ def compile_problem(domain_name, problem_name, operators, methods, predicates, s if type problem_str << "#{pre.upcase} = #{counter += 1}\n" start_str << ' [' - start_str << "\n #{'[' unless unary}" << k.join(unary ? ",\n " : "],\n [") << "#{']' unless unary}\n " if k + start_str << (unary ? "\n " << k.join(",\n ") << "\n " : "\n [" << k.join("],\n [") << "]\n ") if k start_str << "],\n" elsif k - problem_str << "#{pre == '=' ? 'EQUAL' : pre.upcase} = [" - problem_str << "\n #{'[' unless unary}" << k.join(unary ? ",\n " : "],\n [") << (unary ? "\n]\n" : "]\n]\n") + problem_str << "#{pre == '=' ? 'EQUAL' : pre.upcase} = [\n " + problem_str << (unary ? k.join(",\n ") << "\n]\n" : '[' << k.join("],\n [") << "]\n]\n") end } # Tasks