Type-error with TensorQuantityValue vs ScalarValues::NumericalValue in constraint expressions

We encountered a type-error compilation issue in Syside v0.10.1 regarding attribute subsetting (:>) from the ISQ library within a constraint definition. The exact same model compiles successfully in both the official SysML v2 Jupyter evaluation environment (sysmlv2-release) and CATIA Magic Systems of Systems Architect (SysML v2 Community 2026x).

Environment

  • Extension Version: Syside v0.10.1 (VS Code)

  • OS: Windows

Error Message

Plaintext

Quantities::TensorQuantityValue does not conform to ScalarValues::NumericalValue syside(type-error)
AttributeUsage ElectricalEnergySystem::VoltageSafetyRule::nominal

Minimal Reproducible Example (MRE)

package ElectricalEnergySystem {
private import ISQ::;
private import ScalarValues::;
private import NumericalFunctions::*;

item def ElectricalEnergy {
    attribute voltage :> ISQ::voltage;
}

constraint def VoltageSafetyRule {
    in item energy : ElectricalEnergy;
    // The error triggers here or inside the expression below
    in attribute nominal : Real :> ISQ::voltage; 
    in attribute allowableVariation : Real;
    
    abs(energy.voltage - nominal) <= nominal * allowableVariation
}

port def EnergyPort {
    out item electricalEnergy : ElectricalEnergy;
    attribute nominalVoltage :> ISQ::voltage;
    attribute allowableVoltageVariation : Real default 0.1;

    ref assert constraint : VoltageSafetyRule {
        in energy             = electricalEnergy;
        in nominal            = nominalVoltage;
        in allowableVariation = allowableVoltageVariation;
    }
}

}

Issue Description

In VoltageSafetyRule, the attribute nominal is declared as : Real :> ISQ::voltage;.

  • energy.voltage resolves correctly as a quantity value.

  • However, when subtracting nominal from energy.voltage inside the abs() function, Syside’s type checker flags a strict type mismatch, stating that Quantities::TensorQuantityValue does not conform to ScalarValues::NumericalValue.

It seems that Syside strictly enforces Real (ScalarValues) and treats it as incompatible with the dimensioned quantity type inherited via :> ISQ::voltage, whereas the official reference implementation allows this implicit conversion or resolves the subsetting more flexibly.

Could you please look into whether this type-checking behavior can be aligned with the standard SysML v2 reference execution toolset?

Quantity support in Syside is not yet implemented - they are all decayed down to TensorQuantityValue, the base definition of all quantity values, to silence most type checker errors. This case is an exception because the expression should result in another ISQ::voltage value which is ScalarQuantityValue, and thus a NumericalValue. We are working towards more complete quantity support.

Yes, Real is a (dimensionless) number, while voltage is a typed number - they are incompatible in any case but we do not flag it (yet). Instead, quantity representation type is supposed to be set by modifying the type of TensorQuantityValue::num.

Actually, the Pilot implementation just ignores most type mismatches.

Thanks for the explanation — Syside is a great tool indeed. Looking forward to the complete quantity support coming soon!

Simon_Huskier,

Look at the Syside web page Differences to Pilot Implementation for Syside limitations and differences from the Pilot implementation, and by derivative, the CATIA Magic/CAMEO product. Note that while the OMG group and Ed do a fine job, the type checking in the Pilot implementation isn’t as rigorous as it should be for the KerML language constructs.

Best regards,

“Doc”
Richard Wallace