where

The where clause specifies a condition that can be applied to a variable or transition(edge).

Syntax

The syntax of a where clause is as follows:

where <expression>;

The expression here must be a boolean expression.

Scope

A where clause can only be used with the declaration of a variable or an edge.

Semantics

A where can be used in the following two ways:

Examples

int a where a>=0;

The variable a must satisfy the condition a>=0 before, during and after each computation in the specification.

IMPORTANT: a where clause checks the initializer of an variable. See the following example:

const int LOWER_BOUND = 10;

int a = 0 where a >= LOWER_BOUND;

Cyclone cannot find a path to satisfy the condition specified by the where clause since variable a is initialized with 0 here.

The following example shows a where clause is used with a transition.

trans t {In -> Out where door_open==true;}

The transition In -> Out can only happen when the condition door_open==true is met.

 


@2020-2022 Hao Wu. All rights reserved. Last update: January 29, 2022