Systems-Modeling / SysML-v2-Pilot-Implementation

Proof-of-concept pilot implementation of the SysML v2 textual notation and visualization
GNU Lesser General Public License v3.0
114 stars 23 forks source link

ST6RI-695/696 Integer division and unary Real operator evaluation are implemented incorrectly #488

Closed seidewitz closed 11 months ago

seidewitz commented 11 months ago

This pull request fixes two bugs in the evaluation of model-level evaluable expressions:

  1. ST6RI-695 Integer division is implemented incorrectly. The org.omg.sysml.expressions.functions.DivideFunction class implemented the division of two integers using truncating Java integer division. However, the KerML IntegerFunctions::'/' function returns a Rational number is intended to not be truncating.
  2. ST6RI-696 Unary Real operator evaluation is implemented incorrectly. The org.omg.sysml.expressions.functions.ArithmeticFunction::invoke made the call unaryRealOp((Integer)y) to evaluate a unary Real operator. This should instead have been unaryRealOp((Double)x).