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,
DoubleInequalityTheoryis aTypedTheory<BigDecimal>. This causes issues when you want to set up type-safe theories in situations such asLearnMixedIOTestwhere the RA hasDouble-typed registers.Currently, this doesn't cause any issues at runtime because JConstraint's
Variables store the values inStringrepresentation and parse them via the specifiedBuiltinTypeonce it is accessed (andBigDecimalcan 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 (andBigDecimalandDoubledo 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),DoubleInequalityTheoryto 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