blob: 1f6d07a498216b96d1212059a2e402b0602301e8 [file] [log] [blame]
<html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>3.3.3.&nbsp;Handling of conflicts</title><link href="style.css" rel="stylesheet" type="text/css"><meta content="DocBook XSL Stylesheets V1.72.0" name="generator"><link rel="start" href="index.html" title="The VIATRA2 Model Transformation Framework"><link rel="up" href="sec_GTRuleBehaviour.html" title="3.3.&nbsp;Behavioural Specification of Graph Transformation Rules"><link rel="prev" href="sec_PostconditionSpec.html" title="3.3.2.&nbsp;Complete behavioral specification of postcondition patterns"><link rel="next" href="sec_InvokeGTRule.html" title="3.4.&nbsp;Invocation of Graph Transformation Rules"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table summary="Navigation header" width="100%"><tr><th align="center" colspan="3">3.3.3.&nbsp;Handling of conflicts</th></tr><tr><td align="left" width="20%"><a accesskey="p" href="sec_PostconditionSpec.html">Prev</a>&nbsp;</td><th align="center" width="60%">3.3.&nbsp;Behavioural Specification of Graph Transformation Rules</th><td align="right" width="20%">&nbsp;<a accesskey="n" href="sec_InvokeGTRule.html">Next</a></td></tr></table><hr></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="sec_ConflictHandling"></a>3.3.3.&nbsp;Handling of conflicts</h4></div></div></div><p>
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:
</p><div class="itemizedlist"><ul type="disc"><li><p>
<code class="computeroutput">keep(X)</code>
and
<code class="computeroutput">deleteEntity(X)</code>
or
<code class="computeroutput">deleteRelation(R)</code>
(delete-use conflict)
</p></li><li><p>
<code class="computeroutput">newRelation(R, A, B)</code>
and
<code class="computeroutput">deleteEntity(A)</code>
or
<code class="computeroutput">deleteEntity(B)</code>
(or
<code class="computeroutput">deleteRelation(A)</code>
or
<code class="computeroutput">deleteRelation(B)</code>
) (create-delete conflict)
</p></li><li><p>
<code class="computeroutput">move(X, A)</code>
and
<code class="computeroutput">move(X,B)</code>
if
<code class="computeroutput">A B</code>
</p></li><li><p>
<code class="computeroutput">setFrom(R,A)</code>
and
<code class="computeroutput">setFrom(R,B)</code>
if
<code class="computeroutput">A B</code>
</p></li><li><p>
<code class="computeroutput">setTo(R,A)</code>
and
<code class="computeroutput">setTo(R,B)</code>
if
<code class="computeroutput">A B</code>
</p></li><li><p>
<code class="computeroutput">newEntity(X)</code>
and no
<code class="computeroutput">move(X,A)</code>
in the effect set (thus when creating an entity, it should be assigned to a parent entity)
</p></li></ul></div><p>
It is also a run-time exception if a constraint in the <span class="emphasis"><em>check set</em></span> is
violated after resolving the postcondition pattern. Here constraint violation is
caused in the following cases:
</p><div class="itemizedlist"><ul type="disc"><li><p>
<code class="computeroutput">move(X, A)</code>
and
<code class="computeroutput">descendantOf(X,B)</code>
if
<code class="computeroutput">A</code>
is not a descendant of
<code class="computeroutput">B</code>
</p></li><li><p>
<code class="computeroutput">newInstanceOf(X,A)</code>
and
<code class="computeroutput">instanceOf(X,B)</code>
if
<code class="computeroutput">A B</code>
</p></li></ul></div><p>
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.
</p><div class="highlights"><a name="def_GTRuleBehaviour_Remark"></a><p><b>Remark.&nbsp;</b>
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
<a href="def_ForallRule.html" title="4.3.7.&nbsp;Forall Rule">forall rule</a> are deterministic and free of undetectable
conflicts (by their construction) already in the current release.
</p></div><p>
<a href="sec_ConflictHandling.html#tab:VTCL_EntManipBehav" title="Table&nbsp;2.1.&nbsp;Behavior table for entity manipulation">Table&nbsp;2.1, &ldquo;Behavior table for entity manipulation&rdquo;</a> and <a href="sec_ConflictHandling.html#tab:VTCL_RelManipBehav" title="Table&nbsp;2.2.&nbsp;Behavior table for relation manipulation (both the source A and target B are entities)">Table&nbsp;2.2, &ldquo;Behavior table for relation manipulation (both the source A and target B are entities)&rdquo;</a>
below summarizes how model manipulation can be carried out by the
postcondition.
</p><p>
</p><div class="table"><a name="tab:VTCL_EntManipBehav"></a><p class="title"><b>Table&nbsp;2.1.&nbsp;Behavior table for entity manipulation</b></p><div class="table-contents"><table summary="Behavior table for entity manipulation" border="1"><colgroup><col><col><col></colgroup><thead><tr><th><span class="strong"><strong>Effect</strong></span></th><th><span class="strong"><strong>Pattern body (Post)</strong></span></th><th><span class="strong"><strong>Pattern parameters (Post)</strong></span></th><th><span class="strong"><strong>Further Conditions on X</strong></span></th><th><span class="strong"><strong>Conditions on M</strong></span></th><th><span class="strong"><strong>Side effects</strong></span></th></tr></thead><tbody><tr><td><span class="strong"><strong>Leaves entity X unchanged</strong></span></td><td>entity(X) in M; </td><td>X is a ground parameter of Post </td><td>The parent of X is (already) M prior to rule application </td><td>M is bound to an entity </td><td>None </td></tr><tr><td><span class="strong"><strong>Moves entity X to new parent M</strong></span></td><td>entity(X) in M; </td><td>X is a ground parameter of Post </td><td>The parent of X is not M prior to rule application </td><td>M is bound to an entity or entity M is to be created by Post </td><td>None </td></tr><tr><td><span class="strong"><strong>Creates new entity X with M as parent</strong></span></td><td>entity(X) in M; </td><td>X is <span class="emphasis"><em>not</em></span> a parameter of Post, or if so, it is <span class="emphasis"><em>not</em></span> ground </td><td>None </td><td>M is either bound to an entity or entity M is to be created by Post </td><td>None </td></tr><tr><td><span class="emphasis"><em>move_content</em></span> <span class="strong"><strong>Deletes entity X (with semantics)</strong></span></td><td>X does not appear in pattern body </td><td>X is a ground parameter of Post </td><td>X is bound to an entity </td><td>None </td><td>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 </td></tr></tbody></table></div><p></p></div><br class="table-break"><div class="table"><a name="tab:VTCL_RelManipBehav"></a><p class="title"><b>Table&nbsp;2.2.&nbsp;Behavior table for relation manipulation (both the source A and target B are entities)</b></p><div class="table-contents"><table summary="Behavior table for relation manipulation (both the source A and target B are entities)" border="1"><colgroup><col><col><col></colgroup><thead><tr><th><span class="strong"><strong>Effect</strong></span></th><th><span class="strong"><strong>Pattern body (Post)</strong></span></th><th><span class="strong"><strong>Pattern parameters (Post)</strong></span></th><th><span class="strong"><strong>Further Conditions on R</strong></span></th><th><span class="strong"><strong>Conditions on source (A) and target (B)</strong></span></th><th><span class="strong"><strong>Side effects</strong></span></th></tr></thead><tbody><tr><td><span class="strong"><strong>Leaves relation R unchanged</strong></span></td><td>relation(R, A, B); </td><td>R is a ground parameter of Post </td><td>A and B is (already) the source and target of R prior to rule application </td><td>(1) A and B are ground variables, (2) none of them is to be deleted by Post </td><td>None </td></tr><tr><td><span class="strong"><strong>Redirects relation R to lead out from A (setFrom)</strong></span></td><td>relation(R, A, B); </td><td>R is a ground parameter of Post </td><td>A is not the source of R prior to rule application </td><td>(1) A and B are ground variables, or (2) they are created by Post, (3) none of them is to be deleted by Post </td><td>If the type of R is an aggregation, then B is moved to the new parent A </td></tr><tr><td><span class="strong"><strong>Redirects relation R to lead into B (setTo)</strong></span></td><td>relation(R, A, B); </td><td>R is a ground parameter of Post </td><td>B is not the target of R prior to rule application </td><td>(1) A and B are ground variables, or (2) they are created by Post, (3) none of them is to be deleted by Post </td><td>If the type of R is an aggregation, then B is moved to parent A </td></tr><tr><td><span class="strong"><strong>Creates relation R with A as source and B as target</strong></span></td><td>relation(R, A, B); </td><td>R is <span class="emphasis"><em>not</em></span> a parameter of Post, or if so, it is <span class="emphasis"><em>not</em></span> ground </td><td>None </td><td>(1) A and B are ground variables, or (2) they are created by Post, (3) none of them is to be deleted by Post </td><td>If the type of R is an aggregation, then B is moved to parent A </td></tr><tr><td><span class="strong"><strong>Deletes relation R</strong></span></td><td>R does not appear in pattern body </td><td>R is a ground parameter of Post </td><td>R is bound to a relation </td><td>None </td><td>None, i.e. B is not moved from A </td></tr></tbody></table></div><p></p></div><br class="table-break"></div><div class="navfooter"><hr><table summary="Navigation footer" width="100%"><tr><td align="left" width="40%"><a accesskey="p" href="sec_PostconditionSpec.html">Prev</a>&nbsp;</td><td align="center" width="20%"><a accesskey="u" href="sec_GTRuleBehaviour.html">Up</a></td><td align="right" width="40%">&nbsp;<a accesskey="n" href="sec_InvokeGTRule.html">Next</a></td></tr><tr><td valign="top" align="left" width="40%">3.3.2.&nbsp;Complete behavioral specification of postcondition patterns&nbsp;</td><td align="center" width="20%"><a accesskey="h" href="index.html">Home</a></td><td valign="top" align="right" width="40%">&nbsp;3.4.&nbsp;Invocation of Graph Transformation Rules</td></tr></table></div></body></html>