Error Hierarchy

From AG CPS MediaWiki
Jump to navigation Jump to search

In SysMD errors are categorised in a hierarchy. The Agenda only shows errors of the lowest level, i.e. if Syntax Errors exist no Semantic Errors are displayed. This leads to new errors of a higher level starting to show up if the lover level errors are solved.

Error Hierarchy Levels[edit]

Syntax Errors

Initialise Errors


Consistency Errors

Why Hierarchy Levels[edit]

Not all existing errors of all levels are shown in the Agenda because errors on a lower level become meaningless if errors on a higher level exist. Take this small code example:

1  CarParts::Engine hasA Value mass: Real(200.0) [kg].
2  CarParts::Wheel  hasA Value mass: Real(50.0) [kg].
3  CarParts::Body   hasA Value mass: Real(100.0) [kg].
5  Vehicles::Car hasA 
6    Part body:   CarParts::Body; 
7    Part wheels: [4 .. 4] CarParts::Wheel; 
8    Part engine: [1 .. 2] ::Engine; 
9    Value mass:       SI::Mass (500 .. 700) [kg]. 

The error is a missing CarParts in Line 8. This results in a Syntax Error and theoretically also in a Consistency Error due to the Value of the mass not being in the specified range. Trying to fix the Consistency Error is unhelpful, as the Syntax Error is the only reason leading to this Consistency Error, being solved when the Syntax Error is resolved. Lower level errors can both lead to the existence as well as non-existence of higher level errors. Therefore higher level error analysis is omitted when lower level errors are found, saving evaluation time.