Can UPPAAL offer a special variable for Guard-statements? #311
Replies: 1 comment
-
Yes, the proper abstraction is a function call: define a function computing the value of the expression and then call that function in the guards instead. For example, in declarations (either in global or local): bool isAllowed() {
return isSystemOn == true && (isOccupied == false || temperature > INC_FULLINC && temperature < DEC_FULLDEC);
} Then call it on the guard: Functions work only over boolean and integer variables (the clock constraints must still be written on the guard). Note that boolean variables can be used directly in expressions. For example Also UPPAAL uses C rules for converting between boolean and integer expressions so even integer expressions can be shortened. For example, given declaration: int i = 5; Guard expression |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I've been modelling my system in UPPAAL and I encountered a problem which is sometimes
Guard
-statements are too long in Models. And that leads to complicated view of the model. Which could be visually hard to unterstand.As can be seen in the image. statements marked with red are too long.

So can UPPAAL offer a special variable for
Guard
-statements which is defined in Declarations (or maybe in an another file you can offer), so that we define the variable in that file and we write to theGuard
only the name of the variable.For example:
instead of writing to the
Guard
this statement:isSystemOn == true && (isOccupied == false || temperature > INC_FULLINC && temperature < DEC_FULLDEC)
We define the Statement-Variable in Declarations or in another file like this:
var ifStatement = isSystemOn == true && (isOccupied == false || temperature > INC_FULLINC && temperature < DEC_FULLDEC)
And then we write only the variable name to the Guard:
ifStatement
Beta Was this translation helpful? Give feedback.
All reactions