From 7b8a4628d06666dcf4f2da3982cfb201fe32b36f Mon Sep 17 00:00:00 2001 From: Joachim Klein Date: Wed, 6 Feb 2019 12:38:52 +0100 Subject: [PATCH] Fix evaluateExact for unary minus We should propagate the EvaluateContext into the inner expression. The missing 'ec' led to exceptions in model construction for exact/parametric mode, as variable valuations are then not available, e.g., when used in guards ('-s' where 's' is a state variable). Checked the other evaluateExact calls, those are fine. --- prism/src/parser/ast/ExpressionUnaryOp.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prism/src/parser/ast/ExpressionUnaryOp.java b/prism/src/parser/ast/ExpressionUnaryOp.java index b13566df..bf742eaa 100644 --- a/prism/src/parser/ast/ExpressionUnaryOp.java +++ b/prism/src/parser/ast/ExpressionUnaryOp.java @@ -144,7 +144,7 @@ public class ExpressionUnaryOp extends Expression case NOT: return BigRational.from(!operand.evaluateExact(ec).toBoolean()); case MINUS: - return operand.evaluateExact().negate(); + return operand.evaluateExact(ec).negate(); case PARENTH: return operand.evaluateExact(ec); }