3.3.3. Handling of conflicts

If conflicting behavior is defined for a model element in the effect set, then it is a run-time exception, and the execution is terminated. Conflicts and ambiguities arise between the following elementary operations:

It is also a run-time exception if a constraint in the check set is violated after resolving the postcondition pattern. Here constraint violation is caused in the following cases:

Note that the pattern matching phase and the model manipulation phase (i.e handling of precondition and postcondition patterns, respectively) are separate phases, and a conflict only arises if the model manipulation part contains ambiguous modifications.

Remark.  In theory, the effect set and check set is passed to the action part of a GT rule to enable the detection of conflicts between the postcondition pattern and ASM model manipulation rules in the action part. However, this is not checked in the current release. Furthermore, since transaction handling is also not part of the current release, not all conflicts are guaranteed to be detected by the engine at run-time. However, as a main rule of thumb, non-deleting GT rules invoked by a forall rule are deterministic and free of undetectable conflicts (by their construction) already in the current release.

Table 2.1, “Behavior table for entity manipulation” and Table 2.2, “Behavior table for relation manipulation (both the source A and target B are entities)” below summarizes how model manipulation can be carried out by the postcondition.

Table 2.1. Behavior table for entity manipulation

EffectPattern body (Post)Pattern parameters (Post)Further Conditions on XConditions on MSide effects
Leaves entity X unchangedentity(X) in M; X is a ground parameter of Post The parent of X is (already) M prior to rule application M is bound to an entity None
Moves entity X to new parent Mentity(X) in M; X is a ground parameter of Post The parent of X is not M prior to rule application M is bound to an entity or entity M is to be created by Post None
Creates new entity X with M as parententity(X) in M; X is not a parameter of Post, or if so, it is not ground None M is either bound to an entity or entity M is to be created by Post None
move_content Deletes entity X (with semantics)X does not appear in pattern body X is a ground parameter of Post X is bound to an entity None delete(X) ASM rule is called with move_contents semantics, i.e. all incoming and outgoing relations and relationships are also deleted, but the children of X are preserved


Table 2.2. Behavior table for relation manipulation (both the source A and target B are entities)

EffectPattern body (Post)Pattern parameters (Post)Further Conditions on RConditions on source (A) and target (B)Side effects
Leaves relation R unchangedrelation(R, A, B); R is a ground parameter of Post A and B is (already) the source and target of R prior to rule application (1) A and B are ground variables, (2) none of them is to be deleted by Post None
Redirects relation R to lead out from A (setFrom)relation(R, A, B); R is a ground parameter of Post A is not the source of R prior to rule application (1) A and B are ground variables, or (2) they are created by Post, (3) none of them is to be deleted by Post If the type of R is an aggregation, then B is moved to the new parent A
Redirects relation R to lead into B (setTo)relation(R, A, B); R is a ground parameter of Post B is not the target of R prior to rule application (1) A and B are ground variables, or (2) they are created by Post, (3) none of them is to be deleted by Post If the type of R is an aggregation, then B is moved to parent A
Creates relation R with A as source and B as targetrelation(R, A, B); R is not a parameter of Post, or if so, it is not ground None (1) A and B are ground variables, or (2) they are created by Post, (3) none of them is to be deleted by Post If the type of R is an aggregation, then B is moved to parent A
Deletes relation RR does not appear in pattern body R is a ground parameter of Post R is bound to a relation None None, i.e. B is not moved from A