Recommendation ITU-T X.683 International Standard 8824-4
Recommendation ITU-T X.683 International Standard 8824-4
Recommendation ITU-T X.683 International Standard 8824-4
683
International Standard 8824-4
Information technology –
Abstract Syntax Notation One (ASN.1):
Parameterization of ASN.1 specifications
INTERNATIONAL STANDARD ISO/IEC 8824-4
RECOMMENDATION ITU-T X.683
Information technology –
Abstract Syntax Notation One (ASN.1):
Parameterization of ASN.1 specifications
Summary
Recommendation ITU-T X.683 | ISO/IEC 8824-4 defines the provisions for parameterized reference names and
parameterized assignments for data types which are useful for the designer when writing specifications where some
aspects are left undefined at certain stages of the development to be filled in at a later stage to produce a complete
definition of an abstract syntax.
Source
Recommendation ITU-T X.683 was prepared by ITU-T Study Group 17 (2017-2020) and approved on 13 February
2021. An identical text is also published as ISO/IEC International Standard 8824-4.
In the extreme case, some aspects of the specification may be left for the implementer to complete, and would then be
specified as part of the Protocol Implementation Conformance Statement.
While the provisions of Rec. ITU-T X.681 | ISO/IEC 8824-2 and Rec. ITU-T X.682 | ISO/IEC 8824-3 provide a
framework for the later completion of parts of a specification, they do not of themselves solve the above requirements.
Additionally, a single designer sometimes requires to define many types, or many information object classes, or many
information object sets, or many information objects, or many values, which have the same outer level structure, but
differ in the types, or information object classes, or information object sets, or information objects, or values, that are
used at an inner level. Instead of writing out the outer level structure for every such occurrence, it is useful to be able to
write it out once, with parts left to be defined later, then to refer to it and provide the additional information.
All these requirements are met by the provision for parameterized reference names and parameterized assignments by
this Recommendation | International Standard.
The syntactic form of a parameterized reference name is the same as that of the corresponding normal reference name,
but the following additional considerations apply:
– When it is assigned in a parameterized assignment statement, it is followed by a list of dummy reference
names in braces, each possibly accompanied by a governor; these reference names have a scope which is
the right-hand side of the assignment statement, and the parameter list itself.
NOTE 2 – This is what causes it to be recognized as a parameterized reference name.
– When it is exported or imported, it is followed by a pair of empty braces to distinguish it as a
parameterized reference name.
– When it is used in any construct, it is followed by a list of syntactic constructions, one for each dummy
reference name, that provide an assignment to the dummy reference name for the purposes of that use
only.
Dummy reference names have the same syntactic form as the corresponding normal reference name, and can be used
anywhere on the right-hand side of the assignment statement that the corresponding normal reference name could be
used. All such usages are required to be consistent.
INTERNATIONAL STANDARD
ITU-T RECOMMENDATION
Information technology –
Abstract Syntax Notation One (ASN.1):
Parameterization of ASN.1 specifications
1 Scope
This Recommendation | International Standard is part of Abstract Syntax Notation One (ASN.1) and defines notation
for parameterization of ASN.1 specifications.
2 Normative references
The following Recommendations and International Standards contain provisions which, through reference in this text,
constitute provisions of this Recommendation | International Standard. At the time of publication, the editions indicated
were valid. All Recommendations and Standards are subject to revision, and parties to agreements based on this
Recommendation | International Standard are encouraged to investigate the possibility of applying the most recent
edition of the Recommendations and Standards listed below. Members of IEC and ISO maintain registers of currently
valid International Standards. The Telecommunication Standardization Bureau of the ITU maintains a list of currently
valid ITU-T Recommendations.
3 Definitions
For the purposes of this Recommendation | International Standard, the following definitions apply.
3.4.3 parameterized type: A type defined using a parameterized type assignment and thus whose components are
incomplete definitions which must be supplied with actual parameters when the type is used.
3.4.4 parameterized value: A value defined using a parameterized value assignment and thus whose value is
incompletely specified and must be supplied with actual parameters when used.
3.4.5 parameterized value set: A value set defined using a parameterized value set assignment and thus whose
values are incompletely specified and must be supplied with actual parameters when used.
3.4.6 parameterized object class: An information object class defined using a parameterized object class
assignment and thus whose field specifications are incompletely specified and must be supplied with actual parameters
when used.
3.4.7 parameterized object: An information object defined using a parameterized object assignment and thus
whose components are incompletely specified and must be supplied with actual parameters when used.
3.4.8 parameterized object set: An information object set defined using a parameterized object set assignment and
thus whose objects are incompletely specified and must be supplied with actual parameters when used.
3.4.9 variable constraint: A constraint employed in specifying a parameterized abstract syntax, and which depends
on some parameter of the abstract syntax.
4 Abbreviations
For the purposes of this Recommendation | International Standard, the following abbreviation applies:
ASN.1 Abstract Syntax Notation One
5 Convention
This Recommendation | International Standard employs the notational convention defined in Rec. ITU-T X.680 |
ISO/IEC 8824-1, clause 5.
6 Notation
This clause summarizes the notation defined in this Recommendation | International Standard.
6.1 Assignments
The following notation which can be used as an alternative for "Assignment" (see Rec. ITU-T X.680 | ISO/IEC 8824-1,
clause 13) is defined in this Recommendation | International Standard:
– ParameterizedAssignment (see 8.1).
6.3 Symbols
The following notation which can be used as an alternative for "Symbol" (see Rec. ITU-T X.680 | ISO/IEC 8824-1,
13.1) is defined in this Recommendation | International Standard:
– ParameterizedReference (see 9.1).
8 Parameterized assignments
8.1 There are parameterized assignment statements corresponding to each of the assignment statements specified
in Rec. ITU-T X.680 | ISO/IEC 8824-1 and Rec. ITU-T X.681 | ISO/IEC 8824-2. The "ParameterizedAssignment"
construct is:
ParameterizedAssignment ::=
ParameterizedTypeAssignment
| ParameterizedValueAssignment
| ParameterizedValueSetTypeAssignment
| ParameterizedObjectClassAssignment
| ParameterizedObjectAssignment
| ParameterizedObjectSetAssignment
8.2 Each "Parameterized<X>Assignment" has the same syntax as "<X>Assignment" except that following the
initial lexical item there is a "ParameterList". The initial item thereby becomes a parameterized reference name
(see 3.4.2):
NOTE 1 – Rec. ITU-T X.680 | ISO/IEC 8824-1 imposes the requirement that all reference names assigned within a module,
whether parameterized or not, must be distinct.
NOTE 2 – Where value notation is governed by a parameterized type (or a type that is a parameter) the validity of value notation
within the parameterized assignment can only be determined after instantiation of the parameterized type, and may be valid for
some instantiations and invalid for others.
ParameterizedTypeAssignment ::=
typereference
ParameterList
"::="
Type
ParameterizedValueAssignment ::=
valuereference
ParameterList
Type
"::="
Value
ParameterizedValueSetTypeAssignment ::=
typereference
ParameterList
Type
"::="
ValueSet
ParameterizedObjectClassAssignment ::=
objectclassreference
ParameterList
"::="
ObjectClass
ParameterizedObjectAssignment ::=
objectreference
ParameterList
DefinedObjectClass
"::="
Object
ParameterizedObjectSetAssignment ::=
objectsetreference
ParameterList
DefinedObjectClass
"::="
ObjectSet
8.3 A "ParameterList" is a list of "Parameter"s between braces:
ParameterList ::= "{" Parameter "," + "}"
Each "Parameter" consists of a "DummyReference" and possibly a "ParamGovernor":
Parameter ::= ParamGovernor ":" DummyReference | DummyReference
ParamGovernor ::= Governor | DummyGovernor
Governor ::= Type | DefinedObjectClass
DummyGovernor ::= DummyReference
DummyReference ::= Reference
A "DummyReference" in "Parameter" may stand for:
a) a "Type" or "DefinedObjectClass", in which case there shall be no "ParamGovernor";
b) a "Value" or "ValueSet", in which case the "ParamGovernor" shall be present, and in case
"ParamGovernor" is a "Governor" it shall be a "Type", and in case "ParamGovernor" is a
"DummyGovernor" the actual parameter for the "ParamGovernor" shall be a "Type";
c) an "Object" or "ObjectSet", in which case the "ParamGovernor" shall be present, and in case
"ParamGovernor" is a "Governor" it shall be a "DefinedObjectClass", and in case "ParamGovernor" is a
"DummyGovernor" the actual parameter for the "ParamGovernor" shall be a "DefinedObjectClass".
A "DummyGovernor" shall be a "DummyReference" that has no "Governor".
8.4 The scope of a "DummyReference" appearing in a "ParameterList" is the "ParameterList" itself, together with
that part of the "ParameterizedAssignment" which follows the "ParameterList". The "DummyReference" hides any
other "Reference" with the same name in that scope in any given instantiation.
NOTE – This subclause does not apply to "identifier"s defined in "NamedNumberList"s, "Enumeration"s and "NamedBitList"s,
since they are not "Reference"s. The "DummyReference" does not hide these "identifier"s (see Rec. ITU-T X.680 | ISO/IEC
8824- 1, 19.12 and 20.11).
8.5 The usage of a "DummyReference" within its scope shall be consistent with its syntactic form, and, where
applicable, governor, and all usages of the same "DummyReference" shall be consistent with one another.
NOTE – Where the syntactic form of a dummy reference name is ambiguous (for example, between whether it is an
"objectclassreference" or "typereference"), the ambiguity can normally be resolved on the first use of the dummy reference name
on the right-hand side of the assignment statement. Thereafter, the nature of the dummy reference name is known. The nature of
the dummy reference is, however, not determined solely by the right-hand side of the assignment statement when it is in turn
used only as an actual parameter in a parameterized reference; in this case, the nature of the dummy reference must be
determined by examining the definition of this parameterized reference. Users of the notation are warned that such a practice can
make ASN.1 specifications less clear, and it is suggested that adequate comments are provided to explain this for human readers.
Example
Consider the following parameterized object class assignment:
PARAMETERIZED-OBJECT-CLASS { TypeParam, INTEGER:valueParam, INTEGER:ValueSetParam } ::=
CLASS {
&valueField1 TypeParam,
&valueField2 INTEGER DEFAULT valueParam,
&valueField3 INTEGER (ValueSetParam),
For the purpose of determining proper usage of the "DummyReference"s in the scope of the "Parameterized
Assignment", and for that purpose only, the "DummyReference"s can be regarded to be defined as follows:
TypeParam ::= UnspecifiedType
valueParam INTEGER ::= unspecifiedIntegerValue
ValueSetParam INTEGER ::= { UnspecifiedIntegerValueSet }
where:
a) TypeParam is a "DummyReference" which stands for a "Type". Therefore TypeParam can be used
wherever a "typereference" can be used, e.g. as a "Type" for the fixed-type value field valueField1.
b) valueParam is a "DummyReference" which stands for a value of an integer type. Therefore
valueParam can be used wherever a "valuereference" of an integer value can be used, e.g. as a default
value for the fixed-type value field valueField2.
c) ValueSetParam is a "DummyReference" which stands for a value set of an integer type. Therefore
ValueSetParam can be used wherever a "typereference" of an integer value can be used, e.g. as a
"Type" in the "ContainedSubtype" notation for valueField3 and ValueSetField.
8.6 Each "DummyReference" shall be employed at least once within its scope.
NOTE – If the "DummyReference" did not so appear, then the corresponding "ActualParameter" would have no effect on the
definition, and would simply be "discarded", while to the user it might seem that some specification was taking place.
9.2 Other than in "Exports" or "Imports", a parameterized definition shall be referenced by a "Parameterized<X>"
construct, which can be used as an alternative for the corresponding "<X>":
ParameterizedType ::=
SimpleDefinedType
ActualParameterList
SimpleDefinedType ::=
ExternalTypeReference |
typereference
ParameterizedValue ::=
SimpleDefinedValue
ActualParameterList
SimpleDefinedValue ::=
ExternalValueReference |
valuereference
ParameterizedValueSetType ::=
SimpleDefinedType
ActualParameterList
ParameterizedObjectClass ::=
DefinedObjectClass
ActualParameterList
ParameterizedObjectSet ::=
DefinedObjectSet
ActualParameterList
ParameterizedObject ::=
DefinedObject
ActualParameterList
9.3 The reference name in the "Defined<X>" shall be a reference name to which an assignment is made in a
"ParameterizedAssignment".
9.4 The restrictions on the "Defined<X>" alternative to be used, which are specified in Rec. ITU-T X.680 |
ISO/IEC 8824-1 and Rec. ITU-T X.681 | ISO/IEC 8824-2 as normal reference names, apply equally to the
corresponding parameterized reference names.
NOTE – In essence, the restrictions are as follows: each "Defined<X>" has two alternatives, "<x>reference" and
"External<x>Reference". The former is used within the module of definition or if the definition has been imported and there is no
name conflict; the latter is used where there is no imports listed (deprecated), or if there is a conflict between the imported name
and a local definition (also deprecated) or between imports.
9.7 The actual parameter takes the place of the dummy reference name in determining the actual type, value,
value set, object class, object, or object set that is being referenced by this instance of use of the parameterized reference
name.
9.8 The meaning of any references which appear in the "ActualParameter", and the tag default applicable to any
tags which so appear, are determined according to the tagging environment of the "ActualParameter" rather than that of
the corresponding "DummyReference".
NOTE – Thus, parameterization, like referencing, selection types, and COMPONENTS OF, among others, is not exactly textual
substitution.
Example
Consider the following modules:
M1 DEFINITIONS AUTOMATIC TAGS ::= BEGIN
EXPORTS T1;
T1 ::= SET {
f1 INTEGER,
f2 BOOLEAN
}
END
M2 DEFINITIONS EXPLICIT TAGS ::= BEGIN
IMPORTS T1 FROM M1;
T3 ::= T2{T1}
T2{X} ::= SEQUENCE {
a INTEGER,
b X
}
END
Application of 9.8 implies that the tag for the component f1 of T3 (i.e. @T3.b.f1) will be implicitly tagged because the
tagging environment of the dummy parameter X, namely explicit tagging, does not affect the tagging of the components
of the actual parameter T1.
Consider the module M3:
M3 DEFINITIONS AUTOMATIC TAGS ::= BEGIN
IMPORTS T1 FROM M1;
T5 ::= T4{T1}
T4{Y} ::= SEQUENCE {
a INTEGER,
b Y
}
END
Application of Rec. ITU-T X.680 | ISO/IEC 8824-1, 31.2.7, implies that the tag for the component b of T5 (i.e. @T5.b)
will be explicitly tagged because the dummy parameter Y is always explicitly tagged, hence T5 is equivalent to:
T5 ::= SEQUENCE {
a [0] IMPLICIT INTEGER,
b [1] EXPLICIT SET {
f1 [0] INTEGER,
f2 [1] BOOLEAN
}
}
defines a parameterized abstract syntax in which the object set has been resolved, but bound remains as a parameter of
the abstract syntax.
An abstract syntax parameter shall be used:
a) directly or indirectly in the context of a constraint;
b) directly or indirectly as actual parameters that eventually are used in the context of a constraint.
NOTE – See the example in A.2, and the example in Rec. ITU-T X.680 | ISO/IEC 8824-1, H.5.
10.3 A constraint whose value set depends on one or more parameters of the abstract syntax is a variable
constraint. Such constraints are determined after the definition of the abstract syntax (perhaps by International
Standardized Profiles or in Protocol Implementation Conformance Statements).
NOTE – If somewhere in the chain of definitions involved in the specification of the constraint values a parameter of the abstract
syntax appears, the constraint is a variable constraint. It is a variable constraint even if the value set of the resulting constraint is
independent of the actual value of the parameter of the abstract syntax.
Example
The value of (((1..3) EXCEPT a) UNION (1 .. 3)) is always 1..3 no matter what the value of a is, nonetheless it
is still a variable constraint if a is a parameter of the abstract syntax.
10.4 Formally, a variable constraint does not constrain the set of values in the abstract syntax.
NOTE – It is strongly recommended that constraints that are expected to remain as variable constraints in an abstract syntax have
an exception specification using the notation provided by Rec. ITU-T X.680 | ISO/IEC 8824-1, 53.4.
Annex A
Examples
(This annex does not form an integral part of this Recommendation | International Standard.)
Suppose further that for some fields, the sender is to have the option of adding the authenticator or not. This could be
achieved by making the BIT STRING optional, but a more elegant solution (less bits on the line) would be to define
another parameterized type:
OPTIONALLY-SIGNED {ToBeSigned} ::= CHOICE
{
unsigned-data [0] ToBeSigned,
signed-data [1] SIGNED { ToBeSigned }
}
NOTE – The tagging in the CHOICE is not necessary if the writer ensures that none of the uses of the parameterized type produce
an actual argument which is a BIT STRING (the type of SIGNED), but is useful in preventing errors in other parts of the
specification.
A.2 Example of use of parameterized definitions together with an information object class
Use information object classes to collect all the parameters for an abstract syntax. In that way the number of parameters
for an abstract syntax can be reduced to one which is an instance of the collection class. The "InformationFromObject"
production can be used to extract information from the parameter object.
Example
-- An instance of this class contains all the parameters for the abstract
-- syntax, Message-PDU.
MESSAGE- PARAMETERS ::= CLASS {
&maximum-priority-level INTEGER,
&maximum-message-buffer-size INTEGER,
&maximum-reference-buffer-size INTEGER
}
WITH SYNTAX {
THE MAXIMUM PRIORITY LEVEL IS &maximum-priority-level
THE MAXIMUM MESSAGE BUFFER SIZE IS &maximum-message-buffer-size
THE MAXIMUM REFERENCE BUFFER SIZE IS &maximum-reference-buffer-size
}
-- The "ValueFromObject" production is used to extract values
The class MESSAGE-PARAMETERS and the parameterized abstract syntax object, message-Abstract-Syntax, are used
as follows:
-- This instance of MESSAGE- PARAMETERS defines parameter values
-- for the abstract syntax.
my-message-parameters MESSAGE-PARAMETERS ::= {
THE MAXIMUM PRIORITY LEVEL IS 10
THE MAXIMUM MESSAGE BUFFER SIZE IS 2000
THE MAXIMUM REFERENCE BUFFER SIZE IS 100
}
-- The abstract syntax can now be defined with all variable constraints specified.
my-message-Abstract-Syntax ABSTRACT-SYNTAX ::=
message-Abstract-Syntax { my-message-parameters }
Notice that a value set is always specified within braces, even when it is a parameterized value set reference. By
omitting the braces from a reference to an "identifier" that was created in a value set assignment or from a reference to a
"ParameterizedValueSetType" the notation is that of a "Type", not a value set.
The parameterized class definition can be used as follows to define different classes which share some characteristics
like the same defined syntax:
ERROR-1 ::= GENERIC-ERROR { INTEGER, { 1 | 2 | 3 } }
ERROR-2 ::= GENERIC-ERROR { ErrorCodeString, { StringErrorCodes } }
ERROR-3 ::= GENERIC-ERROR { EnumeratedErrorCode, { fatal | error } }
ErrorCodeString ::= IA5String (SIZE (4))
-- This object set lists all the possible pairs of values and type-ids
-- for the instance-of type. The object set is used as an actual parameter
-- for the parameterized abstract syntax definition.
My- Body- Types MHS-BODY-CLASS ::= {
{ My-First-Type IDENTIFIED BY my-first-obj-id } |
{ My-Second-Type IDENTIFIED BY my-second-obj-id }
}
my-message-abstract-syntax ABSTRACT-SYNTAX ::=
message-abstract-syntax { { My-Body-Types } }
Annex B
The following lexical items are defined in Rec. ITU-T X.680 | ISO/IEC 8824-1 and used in this Recommendation |
International Standard:
typereference
valuereference
"::="
"{"
"}"
","
The following lexical items are defined in Rec. ITU-T X.681 | ISO/IEC 8824-2 and used in this Recommendation |
International Standard:
objectclassreference
objectreference
objectsetreference
The following productions are defined in Rec. ITU-T X.680 | ISO/IEC 8824-1 and used in this Recommendation |
International Standard:
DefinedType
DefinedValue
Reference
Type
Value
ValueSet
The following productions are defined in Rec. ITU-T X.681 | ISO/IEC 8824-2 and used in this Recommendation |
International Standard:
DefinedObjectClass
DefinedObject
DefinedObjectSet
ObjectClass
Object
ObjectSet
The following productions are defined in this Recommendation | International Standard:
ParameterizedAssignment ::=
ParameterizedTypeAssignment
| ParameterizedValueAssignment
| ParameterizedValueSetTypeAssignment
| ParameterizedObjectClassAssignment
| ParameterizedObjectAssignment
| ParameterizedObjectSetAssignment
ParameterizedTypeAssignment ::=
typereference ParameterList "::=" Type
ParameterizedValueAssignment ::=
valuereference ParameterList Type "::=" Value
ParameterizedValueSetTypeAssignment ::=
typereference ParameterList Type "::=" ValueSet
ParameterizedObjectClassAssignment ::=
objectclassreference ParameterList "::=" ObjectClass
ParameterizedObjectAssignment ::=
objectreference ParameterList DefinedObjectClass "::=" Object
ParameterizedObjectSetAssignment ::=
objectsetreference ParameterList DefinedObjectClass "::=" ObjectSet
ParameterList ::= "{" Parameter "," + "}"
Parameter ::= ParamGovernor ":" DummyReference | DummyReference
ParamGovernor ::= Governor | DummyGovernor
Governor ::= Type | DefinedObjectClass
DummyGovernor ::= DummyReference
DummyReference ::= Reference
ParameterizedReference ::=
Reference | Reference "{" "}"
SimpleDefinedType ::= ExternalTypeReference | typereference
SimpleDefinedValue ::= ExternalValueReference | valuereference
ParameterizedType ::= SimpleDefinedType ActualParameterList
ParameterizedValue ::= SimpleDefinedValue ActualParameterList
ParameterizedValueSetType ::= SimpleDefinedType ActualParameterList
ParameterizedObjectClass ::= DefinedObjectClass ActualParameterList
ParameterizedObjectSet ::= DefinedObjectSet ActualParameterList
ParameterizedObject ::= DefinedObject ActualParameterList
ActualParameterList ::= "{" ActualParameter "," + "}"
ActualParameter ::= Type | Value | ValueSet | DefinedObjectClass | Object | ObjectSet