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:
keep(X)
and
deleteEntity(X)
or
deleteRelation(R)
(delete-use conflict)
newRelation(R, A, B)
and
deleteEntity(A)
or
deleteEntity(B)
(or
deleteRelation(A)
or
deleteRelation(B)
) (create-delete conflict)
move(X, A)
and
move(X,B)
if
A B
setFrom(R,A)
and
setFrom(R,B)
if
A B
setTo(R,A)
and
setTo(R,B)
if
A B
newEntity(X)
and no
move(X,A)
in the effect set (thus when creating an entity, it should be assigned to a parent entity)
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:
move(X, A)
and
descendantOf(X,B)
if
A
is not a descendant of
B
newInstanceOf(X,A)
and
instanceOf(X,B)
if
A B
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
Effect | Pattern body (Post) | Pattern parameters (Post) | Further Conditions on X | Conditions on M | Side effects |
---|---|---|---|---|---|
Leaves entity X unchanged | entity(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 M | entity(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 parent | entity(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)
Effect | Pattern body (Post) | Pattern parameters (Post) | Further Conditions on R | Conditions on source (A) and target (B) | Side effects |
---|---|---|---|---|---|
Leaves relation R unchanged | relation(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 target | relation(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 R | R 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 |