Statements
Evaluation
Addition
Subtraction
Multiplication
Division
Dividend
Divisor
AdditionData
SubtractionData
MultiplicationData
General
Only data items of a numeric type may be evaluated.
A data item specified in an Evaluation statement on the left hand side can only appear once in this position in an assignment statement.
Data statements should always appear before the other evaluation statements. This is not currently enforced by the Model Compiler but will be at some point in the future.
Type casting evaluation statements may be used to convert the result of a calculation to another compatible type.
Evaluation Statement
Assignment
Evaluation:Entity.Attribute
Addition
AdditionData
process_data
Entity.Attribute
Permitted item field formats:
Evaluation (left hand side):
Entity.Integer_attribute
Entity.Fixed_attribute
Entity.Float_attribute
integer_process_data
fixed_process_data
float_process_data
Calculation (right hand side):
<<IntegerOne>>
<<FixedOne>>
<<FloatOne>>
Entity.Integer_attribute
Entity.Fixed_attribute
Entity.Float_attribute
Integer_state_data
Fixed_state_data
Float_state_data
integer_process_data
fixed_process_data
float_process_data
+Entity.Integer_attribute
+Entity.Fixed_attribute
+Entity.Float_attribute
+Integer_state_data
+Fixed_state_data
+Float_state_data
+integer_process_data
+fixed_process_data
+float_process_data
-Entity.Integer_attribute
-Entity.Fixed_attribute
-Entity.Float_attribute
-Integer_state_data
-Fixed_state_data
-Float_state_data
-integer_process_data
-fixed_process_data
-float_process_data
Addition Statement
Assignment
Evaluation:integer_data
Addition
AdditionData
<<IntegerOne>>
Integer_data
Entity.Integer_attribute
Code Generation:
| +(... + ... + ...)
|
\Addition +(
... +...
| +
... +...
| +
... +...
/Addition )
Subtraction Statement
Assignment
Evaluation:integer_data
Subtraction
AdditionData
<<IntegerOne>>
Integer_data
Entity.Integer_attribute
Code Generation:
| -(... + ... + ...)
|
\Subtraction -(
... +...
| +
... +...
| +
... +...
/Subtraction )
Multiplication Statement
Assignment
Evaluation:integer_data
Multiplication
AdditionData
<<IntegerOne>>
Integer_data
Entity.Integer_attribute
Code Generation:
| +(... * ... * ...)
|
\Multiplication +(
... +...
| *
... +...
| *
... +...
/Multiplication )
Division Statement
Assignment
Evaluation:aaaa
Division
Dividend
Addition
AdditionData
bbbb
Divisor
Addition
AdditionData
cccc
Code Generation:
| +(+(...) / +(...))
|
\Division +(
\Dividend +(
... ...
/Dividend )
| /
\Divisor +(
... ...
/Divisor )
/Division )
Dividend Statement
Assignment
Evaluation:aaaa
Division
Dividend
Addition
AdditionData
bbbb
Divisor
Addition
AdditionData
cccc
Code Generation:
| +(...)
|
\Dividend +(
... ...
/Dividend )
Divisor Statement
Assignment
Evaluation:aaaa
Division
Dividend
Addition
AdditionData
bbbb
Divisor
Addition
AdditionData
cccc
Code Generation:
| +(...)
|
\Divisor +(
... ...
/Divisor )
AdditionData Statement
Assignment
Evaluation:integer_data
Addition
AdditionData
<<IntegerOne>>
-Integer_data
Entity.Integer_attribute
Code Generation:
| +(1 + -Integer_data + Entity.Integer_attribute)
|
\AdditionData +(
1 +1
| +
-Integer_data -Integer_data
| +
Entity.Integer_attribute +Entity.Integer_attribute
/AdditionData )
SubtractionData Statement
Assignment
Evaluation:integer_data
Addition
SubtractionData
<<IntegerOne>>
-Integer_data
Entity.Integer_attribute
Code Generation:
| -(1 + -Integer_data + Entity.Integer_attribute)
|
\SubtractionData -(
1 +1
| +
-Integer_data -Integer_data
| +
Entity.Integer_attribute +Entity.Integer_attribute
/SubtractionData )
MultiplicationData Statement
Assignment
Evaluation:integer_data
Addition
MultiplicationData
<<IntegerOne>>
-Integer_data
Entity.Integer_attribute
Code Generation:
| +(1 * -Integer_data * Entity.Integer_attribute)
|
\MultiplicationData +(
1 +1
| *
-Integer_data -Integer_data
| *
Entity.Integer_attribute +Entity.Integer_attribute
/MultiplicationData )
Example of Division
| aaaa := (bbbb/cccc) / dddd;
|
\Assignment
\Evaluation:aaaa aaaa =
\Division +(
\Dividend +(
\Addition +(
\Division +(
\Dividend +(
\Addition +(
\AdditionData +(
bbbb +bbbb
/AdditionData )
/Addition )
/Dividend )
| /
\Divisor +(
\Addition +(
\AdditionData +(
cccc +cccc
/AdditionData )
/Addition )
/Divisor )
/Division )
/Addition )
/Dividend )
| /
\Divisor +(
\Addition +(
\AdditionData +(
dddd +dddd
/AdditionData )
/Addition )
/Divisor )
/Division )
/Evaluation ;
/Assignment
|