Prism 6.0 Reference Manual

define pset

In MP Prism, creates a named pset.

SYNTAX

define pset name definition

DESCRIPTION

The define pset command is available only in MP Prism.

Use the define pset command to create a pset with the name and definition you specify.

For the name argument, you can use any name except the predefined names all, running, error, interrupted, break, stopped, done, current, and cycle. The name must begin with a letter; it can contain any alphanumeric character, plus the dollar sign and underscore.

For the definition, you can specify any of the following:

Prism evaluates these expressions from left to right. For a union, if a process returns true for the first part of the expression, it is not evaluated further. For an intersection, if a process returns false for the first part of the expression, it is not evaluated further.

If a variable isn't active in a process, Prism prints an error message and does not execute the command. To ensure that the command is executed, use the intrinsic isactive in the pset definition. The expression isactive(variable) returns true if variable is on the stack for a process or is a global.

If a process that Prism tries to evaluate is running, the evaluation fails and the command is not executed. To avoid this, you can use the intersection of the predefined set stopped and the expression you want to evaluate. For example,

define pset xon stopped && { isactive(x) \
&& (x .NE. 0) }

This command defines a pset xon consisting of processes that are stopped and in which x is active and not equal to 0.

You cannot use this command in an event action.

Use the command delete pset to delete a pset that you have created using define pset.

EXAMPLES

This command creates a pset foo containing the processes 0, 4, and 7:

define pset foo 0, 4, 7

This command defines a pset odd containing the odd-numbered processes between 1 and 31:

define pset odd 1:31:2

This command defines a pset quux that contains processes that are members of either pset foo or pset bar:

define pset quux foo | bar

This command defines a pset noty that consists of all processes that are stopped except those in which y is equal to 1:

define pset noty stopped - { y == 1 }