Browse Source

Enabled short circuit optimization for & (and) and | (or) in ExprtkExpressionEvaluator

tempestpy_adaptions
Tim Quatmann 5 years ago
parent
commit
e79035c71b
  1. 6
      src/storm/storage/expressions/ToExprtkStringVisitor.cpp

6
src/storm/storage/expressions/ToExprtkStringVisitor.cpp

@ -29,14 +29,14 @@ namespace storm {
case BinaryBooleanFunctionExpression::OperatorType::And: case BinaryBooleanFunctionExpression::OperatorType::And:
stream << "("; stream << "(";
expression.getFirstOperand()->accept(*this, data); expression.getFirstOperand()->accept(*this, data);
stream << " and ";
stream << " & ";
expression.getSecondOperand()->accept(*this, data); expression.getSecondOperand()->accept(*this, data);
stream << ")"; stream << ")";
break; break;
case BinaryBooleanFunctionExpression::OperatorType::Or: case BinaryBooleanFunctionExpression::OperatorType::Or:
stream << "("; stream << "(";
expression.getFirstOperand()->accept(*this, data); expression.getFirstOperand()->accept(*this, data);
stream << " or ";
stream << " | ";
expression.getSecondOperand()->accept(*this, data); expression.getSecondOperand()->accept(*this, data);
stream << ")"; stream << ")";
break; break;
@ -50,7 +50,7 @@ namespace storm {
case BinaryBooleanFunctionExpression::OperatorType::Implies: case BinaryBooleanFunctionExpression::OperatorType::Implies:
stream << "(not("; stream << "(not(";
expression.getFirstOperand()->accept(*this, data); expression.getFirstOperand()->accept(*this, data);
stream << ") or ";
stream << ") | ";
expression.getSecondOperand()->accept(*this, data); expression.getSecondOperand()->accept(*this, data);
stream << ")"; stream << ")";
break; break;

Loading…
Cancel
Save