Previous Up Next

17.3  Syntax

The most general attributed variable syntax is

Var{Name_1:Attr_1Name_2:Attr_2, …, Name_n:Attr_n}

where the syntax of Var is like that of a variable, Name_i are attribute names and Attr_i are the values of the corresponding attributes. The expression Var{Attr} is a shorthand for Var{Module:Attr} where Module is the current module name. The former is called unqualified and the latter qualified attribute specification. As the attribute name is usually identical with the source module name, all occurrences of an attributed variable in the source module may use the unqualified specification.

If there are several occurrences of the same attributed variable in a single term, only one occurrence is written with the attribute, the others just refer to the variable’s name, e.g.,

p(X, X{attr:Attr})


p(X{attr:Attr}, X)

both describe the same term, which has two occurrences of a single attributed variable with attribute attr:Attr. The following is a syntax error (even when the attributes are identical):

p(X{attr:Attr}, X{attr:Attr})

Previous Up Next