In MP Prism, creates a named pset.
define pset name definition
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:
An individual process number.
The name of a pset. The new pset will have the same definition as the existing set.
A list of process numbers. Separate the numbers with commas. Use a colon between two process numbers to indicate a range. Use a second colon to indicate the stride to be used within this range.
A union, difference, or intersection of psets. To specify the union, use the symbol +, |, or ||. To specify the difference, use the minus sign (-). To specify the intersection, use the symbol &, &&, or *.
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.
A condition to be met. Put braces around an expression that evaluates to true or false on each process. Processes in which the expression is true are part of the set. This is referred to as a variable pset, since membership in it can vary depending on the current state of your program. Use the command eval pset to update the membership of a variable pset.
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.
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 }