1Scope
The Action Language for Foundational UML (or “Alf”) is a textual surface representation for UML modeling elements. The execution semantics for Alf are given by mapping the Alf concrete syntax to the abstract syntax of the standard Foundational Subset for Executable UML Models (known as “Foundational UML” or “fUML”). The result of executing an Alf input text is thus given by the semantics of the fUML model to which it is mapped, as defined in the fUML specification.
A primary goal of an action language is to act as the surface notation for specifying executable behaviors within a wider model that is primarily represented using the usual graphical notations of UML. For example, this might include methods on the operations of classes or transition effect behaviors on state machines.
However, Alf also provides an extended notation that may be used to represent structural modeling elements. Therefore, it is possible to represent a UML model entirely using Alf, though Alf syntax only directly covers the limited subset of UML structural modeling available in the fUML subset.
Key guiding principles in the design of Alf include the following.
-
Alf has a largely C-legacy (“Java like”) syntax, since that is most familiar to the community that programs detailed behaviors. Nevertheless, Alf allows UML textual syntax when it exists (e.g., colon syntax for typing, double colon syntax for name qualification, etc.).
-
Alf does not require graphical models to change in order to accommodate use of the action language (e.g., special characters are allowed in names, arbitrary names are allowed for constructors, etc.). Further, while Alf maps to the fUML subset in order to provide its execution semantics, it is usable in context of models not limited to the fUML subset.
-
Alf provides a naming system that is based on UML namespaces for referencing elements outside of an activity but also provides for the consistent use of local names to reference flows of values within an activity.
-
Alf uses an implicit type system that allows but does not require the explicit declaration of typing within an activity, always providing for static type checking, based at least on typing declared in the structural model elements.
-
Alf has the expressivity of OCL in the use and manipulation of sequences of values. These sequence expressions are fully executable in terms of fUML expansion regions, allowing the simple and natural specification of highly concurrent computations.
-
While the primary goal of Alf is to be an action language, Alf also provides concrete syntax for structural modeling, largely within the bounds of the fUML subset.
There are two main aspects of conformance to the Alf standard.
-
Syntactic Conformance. Alf input text must conform syntactically to one of the levels defined below in Subclause 2.1.
-
Semantic Conformance. A conforming modeling tool must process syntactically conforming Alf text in one of the ways defined below in Subclause 2.2.
In addition, Subclause 2.3 defines two further mandatory conformance points.
2.1Syntactic Conformance
Clause 6 discusses the overall requirements for processing of Alf input text. For the purposes of the present discussion of syntactic conformance, “syntactic processing” includes lexical analysis, as specified in Clause 7, the parsing of the various Alf features specified in Clauses 8 through 10 and the static semantic analysis of Alf abstract syntax trees specified in Clauses 12 through 14.2.
There are three levels of syntactic conformance, depending on whether syntactic processing must be supported for all features specified in Clauses 8 through 10, or only some subset of them.
-
Minimum Conformance. Conformance at this level requires the ability to process a subset of the syntax defined in Clauses 8 and 9, but none of the syntax defined in Clause 10. The exact subset that must be supported is identified in each of the syntactic grammar specifications in Clauses 8 and 9. The intent of Minimum Conformance is to provide a subset of Alf that is usable for writing textual action language snippets within a larger graphical UML model and that includes only the capabilities available in a traditional, procedural programming language.
-
Full Conformance. Conformance at this level requires the ability to process all the syntax defined in Clauses 8 and 9, but none of the syntax defined in Clause 10. At Full Conformance, Alf provides a complete action language for representing behavior within a structural model represented in a typical UML modeling environment outside of Alf (see Subclause 6.1).
-
Extended Conformance. Conformance level requires the ability to process all the syntax defined in Clauses 8, 9 and 10. This includes not only the action language capabilities of Full Conformance, but also the structural modeling capabilities defined in Clause 10.
2.2Semantic Conformance
The execution semantics for Alf are described informally in Clauses 8 through 10 and specified by a formal mapping to fUML in Clauses 16 through 19. A conforming execution tool must implement the specified semantics for the syntactic subset of Alf to which the tool conforms.
The execution semantics for all Alf constructs are formally specified via their mapping to fUML (see Subclause 6.6) and the execution of the resulting fUML model per the semantics of the fUML Specification. However, a conforming modeling tool does not need to actually perform this mapping in order to execute Alf input text. Indeed, there are three ways in which the tool may implement the specified Alf execution semantics.
-
Interpretive Execution. The modeling tool directly interprets and executes the Alf input text.
-
Compilative Execution. The modeling tool compiles the Alf text to a UML model conforming to the fUML subset (at level L3) and executes that per the semantics specified in the fUML Specification, perhaps in the context of the execution of a larger model that may not conform to the fUML subset.
NOTE. The compiled model resulting from the Alf text does not have to be the same as that resulting from the standard mapping to fUML defined in the Alf specification (though it must have an equivalent effect—see below), but it must be conformant to the fUML subset and thus executable by a fUML-conforming execution tool.
-
Translational Execution. The modeling tool translates the Alf text, as well as any surrounding larger UML model as appropriate, into some executable form on a non-UML target platform, and executes the translation on that platform.
In all cases, the portion of the execution corresponding to an Alf input text must have the equivalent effect to mapping that text to fUML per the Alf specification and executing the resulting model per the semantics specified in the fUML Specification. For the purposes of semantic conformance as defined here, this means that:
-
The effect of executing the Alf text within any larger containing model is per the equivalent fUML semantics.
-
Any visible effect produced by executing the Alf text within the target execution environment is per the equivalent fUML semantics (where, for the purposes of fUML semantics, the execution environment is as defined in Clause 2 of the fUML Specification).
Share with your friends: |