package (Z.100)

In order for a type definition to be used in different systems it has to be defined as part of a package.

Definitions as parts of a package define types, data generators, signal lists, remote specifications and synonyms.

Definitions within a package are made visible to a system or other packages by a package reference clause.

<package diagram> ::=
<package reference area> is associated with
<frame symbol> contains
{ <package heading>
{<package text area>}*
<diagram in package> set }

<package reference area> ::=
<text symbol> contains { <package reference clause>}*

<package heading> ::=
package <package name> [<interface>]

<package text area>::=
<text symbol> contains { <entity in package>}*

<diagram in package> ::=
<system type diagram>
| <system type reference>
| <type in system area>
| <macro diagram>
| <option area>
The <package reference area> must be placed on the top of the <frame symbol>.

 

Semantics

For each <package name> mentioned in a <package reference clause>, there must exist a corresponding <package>. If this <package> is not part of <package list>, there must exist a mechanism for accessing the referenced <package>, just as if it were a textual part of the <package list>. This mechanism is not defined in this recommendation.

Likewise, if the <system definition> is omitted in an <sdl specification>, there must exist a mechanism for using the <package>s in the <package list> in other <sdl specification>s. Before the <package list> is used in other <sdl specification>s, the model for macros and referenced definitions is applied. The mechanism is not otherwise defined in this recommendation.

The name of an entity defined within a <package> is visible in another <package> or the <system definition> if and only if:

1) The <package> or <system definition> has a <package reference clause> mentioning the <package> and the <package reference clause> either has the <definition selection list> omitted or the name is mentioned in a <definition selection>, and

2) The <package> defining the name either has the <interface> package interface (G)omitted or the name is mentioned in the <interface>.

Resolution by context in expressions will take into account also those sorts in packages which are not made visible in a <package reference clause>. Signals which are not made visible in a use clause, can be part of a signal list via a <signal list identifier> made visible in a use clause and these signals can thereby affect the complete valid input signal set of a process or service.

If a name in a <definition selection> denotes a <sort>, the <definition selection> also implicitly denotes all the literals and operators defined for the <sort> or <parent sort identifier> in case of a syntype.

If a name in a <definition selection> denotes a signal, the <definition selection> also implicitly denotes all the subsignals of that signal.

Names having their defining occurrence in a <package> are referred to by means of <identifier>s having package <package name> as the leftmost <path item>. However, the <path item> may be omitted if either the <package name> denotes the enclosing package, if (name, entity kind) is visible only from one package or if resolution by context applies.

The <entity kind> in <definition selection> denotes the entity kind of the <name>. Any pair of (<entity kind>,<name>) must be distinct within a <definition selection list>. For a <definition selection> in an <interface>, the <entity kind> may be omitted only if there is no other name having its defining occurrence directly in the <package>. For a <definition selection> in a <package reference clause>, <entity kind> may be omitted if and only if either exactly one entity of that name is mentioned in any <definition selection list> for the package or the package has no <definition selection list> and directly contains a unique definition of that name.

A <system definition> and every <package definition> has an implicit <package reference clause>:

use Predefined;

where Predefined denotes a package containing the predefined data as defined in Annex D.

Model

If a package is mentioned in several <package reference clause>s of a <package definition> this corresponds to one <package reference clause> which selects the union of the definitions selected in the <package reference clause>s.

An <sdl specification> with <system definition> and a non-empty <package list> corresponds to a <system definition>, where

1) all occurrences of the same name (including the defining occurrence) of any entity defined within a <package> have been renamed to the same, unique anonymous name.

2) all definitions within the <package>s have been included on the system level.

3) all occurrences of package <package name> in qualifiers have been replaced by system <system name>, where <system name> is the name for <system definition>.

The transformation is detailed in § 7. The relation of <system definition> to Abstract Grammar is defined in §2.4.2.