From 6f3b25d0b85346ac3d52e572ea1f3159f49a4152 Mon Sep 17 00:00:00 2001 From: Joachim Klein Date: Fri, 13 Oct 2017 15:41:18 +0200 Subject: [PATCH] Property, constants in RESULTs: support BigRationals Support matching of constants in RESULT strings for the case that constants in the model are exact rational numbers (implemented in subsequent commits). --- prism/src/parser/ast/Property.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/prism/src/parser/ast/Property.java b/prism/src/parser/ast/Property.java index 8469d8d1..4d4ff881 100644 --- a/prism/src/parser/ast/Property.java +++ b/prism/src/parser/ast/Property.java @@ -190,6 +190,9 @@ public class Property extends ASTElement // Check doubles numerically else if (constValToMatch instanceof Double) match = PrismUtils.doublesAreCloseRel(((Double) constValToMatch).doubleValue(), Double.parseDouble(constVal), 1e-10); + // if constant is exact rational number, compare exactly + else if (constValToMatch instanceof BigRational) + match = BigRational.from(constVal).equals(constValToMatch); // Otherwise just check for exact string match for now else match = constValToMatch.toString().equals(constVal);