Skip to content
Snippets Groups Projects
Commit ba887390 authored by Michael Leuschel's avatar Michael Leuschel
Browse files

use ProB’s IF-THEN-ELSE rather than lambda construction

parent 8031aff5
Branches
Tags
No related merge requests found
...@@ -685,15 +685,15 @@ public class ASTPrettyPrinter extends ExtendedDFAdapter { ...@@ -685,15 +685,15 @@ public class ASTPrettyPrinter extends ExtendedDFAdapter {
@Override @Override
public void caseAIfThenElseExpression(AIfThenElseExpression node) { public void caseAIfThenElseExpression(AIfThenElseExpression node) {
sb.append("(%t_.( t_ = 0 & "); sb.append("IF "); // (%t_.( t_ = 0 & ");
node.getCondition().apply(this); node.getCondition().apply(this);
sb.append(" | "); sb.append(" THEN "); // | ");
node.getThen().apply(this); node.getThen().apply(this);
sb.append(")\\/%t_.( t_ = 0 & not("); sb.append(" ELSE "); // )\\/%t_.( t_ = 0 & not(");
node.getCondition().apply(this); //node.getCondition().apply(this);
sb.append(") | "); //sb.append(") | ");
node.getElse().apply(this); node.getElse().apply(this);
sb.append(" ))(0)"); sb.append(" END"); // "))(0)");
} }
@Override @Override
......
...@@ -34,7 +34,7 @@ public class SimpleExpressionTest { ...@@ -34,7 +34,7 @@ public class SimpleExpressionTest {
@Test @Test
public void testIfThenElse() throws Exception { public void testIfThenElse() throws Exception {
compareExpr( compareExpr(
"(%t_.( t_ = 0 & 1 = 1 | 1 )\\/%t_.( t_ = 0 & not(1 = 1) | 2 ))(0)", "IF 1 = 1 THEN 1 ELSE 2 END", //"(%t_.( t_ = 0 & 1 = 1 | 1 )\\/%t_.( t_ = 0 & not(1 = 1) | 2 ))(0)",
"IF 1 = 1 THEN 1 ELSE 2"); "IF 1 = 1 THEN 1 ELSE 2");
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment