diff --git a/UHyper_Compiler.rb b/UHyper_Compiler.rb index 7d17311..da3ad2b 100644 --- a/UHyper_Compiler.rb +++ b/UHyper_Compiler.rb @@ -9,10 +9,7 @@ module UHyper_Compiler def expression_to_hyper(precond_expression, axioms) case precond_expression[0] - when 'and', 'or' - if precond_expression.size == 2 then expression_to_hyper(precond_expression[1], axioms) - else '(' << precond_expression.drop(1).map! {|exp| expression_to_hyper(exp, axioms)}.join(" #{precond_expression[0]} ") << ')' - end + when 'and', 'or' then '(' << precond_expression.drop(1).map! {|exp| expression_to_hyper(exp, axioms)}.join(" #{precond_expression[0]} ") << ')' when 'not' then (term = expression_to_hyper(precond_expression[1], axioms)).delete_prefix!('not ') or 'not ' << term when 'call' then call(precond_expression) when 'assign' then '(_' << precond_expression[1].delete_prefix('?') << ' = ' << evaluate(precond_expression[2]) << ')'