Open baierd opened 1 month ago
As one example of what I see that could be improved, I looked at the current JavaDoc of Integer modulo: https://github.com/sosy-lab/java-smt/blob/fed0e55e44243a26cc0ca00b90d6835aef6e5d55/src/org/sosy_lab/java_smt/api/IntegerFormulaManager.java#L29-L46
My thoughts:
n = k*d + r
that specify exactly which condition the result fulfills. Can't you write something like that here, i.e., an actual formal definition? Something like "modulo(n, d) == r
holds iff ...".%
in the examples. This may still be ok here, but why suddenly use an operator symbol in the examples that does not appear anywhere else in the text and is therefore not defined at all? And with smodulo/remainder it really causes confusion. The examples should simply use the function name, i.e., modulo(10, 5) == 0
etc.%
operator in common programming languages? Then it would be helpful for users to discuss this. Something like "Note that this function implements the same semantics as the %
operator in programming languages like C or Java (with the obvious exception of applying it to unbounded integers instead of bitvectors)."
Some operations in SMTLib2, for example Integer
modulo()
and BVsmodulo()
(signed modulo), behave differently. Our documentation does not reflect this properly or fails to explain the differences in a well-understandable way. Additionally, we could update the documentation of some operations that are not well understandable. We should take a closer look at our public API documentation and update it accordingly.Examples: