Skip to content

Commit

Permalink
Refactor predicates in Hyper_Compiler compile_problem
Browse files Browse the repository at this point in the history
  • Loading branch information
Maumagnaguagno committed Oct 12, 2024
1 parent 7cb904b commit e52df60
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions compilers/Hyper_Compiler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e52df60

Please sign in to comment.