DoubleInequalityTheory uses BigDecimal type #91
Unanswered
mtf90
asked this question in
Learnlib Q & A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Contrary to its name,
DoubleInequalityTheory
is aTypedTheory<BigDecimal>
. This causes issues when you want to set up type-safe theories in situations such asLearnMixedIOTest
where the RA hasDouble
-typed registers.Currently, this doesn't cause any issues at runtime because JConstraint's
Variable
s store the values inString
representation and parse them via the specifiedBuiltinType
once it is accessed (andBigDecimal
can parse aDouble
-represented value). However, once the theory generates fresh values (BigDecimals
), storing them in the respective RA may cause problems because both data types have different precision (andBigDecimal
andDouble
do not have an inheritance relation).I think there are two obvious solutions to this problem:
BigDecimal
-based registers (requires some re-factoring of the XML models and the parser),DoubleInequalityTheory
to actually work onBuiltinTypes.DoubleType
. This could also be interesting from a performance point of view since operations on doubles should be faster than onBigDecimal
.I don't have a preference for any of the solutions, but we should do something about this. The current implicit conversion is primed for some hard-to-detect issues in the future.
Beta Was this translation helpful? Give feedback.
All reactions