Variables

Variables

Term definitions A variable is an identifier whose value can be changed during the execution of the model. A binding is the association of a value with a variable. A binding has both scope and content. A scope is the locations in a model in which a particular binding can be referenced. An extent is the interval during which a particular binding is in effect. […]

Read Me Leave comment

Value declaration

Value declaration

A value declaration binds a value to an identifier (which then works as a constant). Declaration Syntax val id = exp; where id is an identifier and exp is a CPN ML expression, including multiset expressions. The expression represents the value to be associated with the identifier. Declaration Examples Value declarations expressions may use any value representation that is syntactically unique, without a prior color […]

Read Me Leave comment

Reserved identifiers

Reserved identifiers

Several identifiers are reserved, and this means that they may not be used as: variable names color set names new values for unit in unit color sets new values for true and false in boolean color sets identifiers in enumerated color sets, index color sets, record color sets, or union color sets The following identifiers are reserved: Arc abstype action all and andalso as bool […]

Read Me Leave comment

Model parameters

Model parameters

The behavior of a CPN often depends on the values of several parameters in the model. Changing the values of the parameters will usually change the behavior of the model. Parameters can be used to define many kinds of values, such as: the number of resources in a model, time delays, intervals of time between certain events, the probability of certain events happening, and the […]

Read Me Leave comment

Loading declarations from file

Loading declarations from file

Declarations can be loaded from text files using the use declaration. Declaration Syntax use filename; where filename is a string indicating the name of the file to be loaded. Example use “/models/HierarchicalProtocol/functions.sml”; use “valueDeclarations.sml”; The file name can contain either absolute or relative paths. For additional details about paths see the OS.Path structure in the SML Basis Library Manual. Limitations Declarations of color sets and […]

Read Me Leave comment

CPN ML identifier

CPN ML identifier

The CPN ML identifiers are alphanumeric sequences of letters, digits, primes/apostrophes (‘), and underscores (_) — starting with a letter. They are used for: Color sets Record color set field labels Value constructors Variables Operators and function symbols Prefixes of place, transition, and page names when using the state space tool. Examples These identifiers are legal: SmallOrder e3’f4 big_bertha These are illegal, because they do […]

Read Me Leave comment

Functions, declarations, and control structures

Functions, declarations, and control structures

This page contains descriptions of declaring functions, local declarations, and control structures. Declaration Syntax fun id pat1 = exp1 | id pat2 = exp2 | … | id patn = expn; where exp1, exp2, …, expn all have the same type. Declaration Examples The _ (underscore) can be used to omit fields in the pattern. As an example look at the following function. It is […]

Read Me Leave comment

Example declarations

Example declarations

This page provides a detailed description of the set of declarations from the CPN for the Distributed database which is one of the example nets. Explanation val n = 4;: Declares a value (i.e., a constant). In this case the constant n is bound to the value 4. colset DBM = index d with 1..n;: Declares an index color set named DBM. The color set […]

Read Me Leave comment

Error in declarations

Error in declarations

If there is an error in the declarations, the declaration with the error will be underlined with red. The net entry and all affected pages will also be underlined with red. To see the error message for a declaration with an error, move the mouse over the declaration. Overwriting declarations It is not allowed for two declarations to share the same name. If a declaration […]

Read Me Leave comment