User Tools

Site Tools


01_user_documentation:07_rgg_xl:03_query_graph:01_derivation

Derivation

Rules of the XL programming language are executed when the control flow reaches them. The execution of a rule finds all matches of the left-hand side and, for each match, performs the statements of the right-hand side. Thus, for a producer implementation which constructs a parallel production, the control flow in the sense of relational growth grammars the family of all executed rules and applies each rule via every possible match in the current graph. This is a true parallel mode of derivation. The different derivation modes enable to use a different control flow.

To choose the derivation mode, the class Graph (Model graph) of the base implementation provides the method setDerivationMode and a set of constants to use as argument, namely

  1. PARALLEL MODE
  2. PARALLEL NON DETERMINISTIC MODE
  3. SEQUENTIAL MODE
  4. SEQUENTIAL NON DETERMINISTIC MODE

These constants can be combined with two flags as modifiers:

  1. EXCLUDE DELETED FLAG
  2. INTERPRETIVE FLAG

The default derivation mode is : graph.setDerivationMode(PARALLEL_MODE | EXCLUDE_DELETED_FLAG);

Parallel

All rules are applied via every possible match in parallel. A single node may be deleted by several rule applications.

Parallel non deterministic

It is ensured that a single node is deleted by at most one actual rule application. If several potential rule applications delete the same node, one actual application is chosen pseudo-randomly.

Sequential

Only one rule application is performed in a single step (as marked by {@link #derive()}). If several applications are possible, only the first one is chosen.

Sequential non deterministic

Only one rule application is performed in a single step (as marked by {@link #derive()}). If several applications are possible, one is chosen pseudo-randomly.

Interpretive

The modifier INTERPRETIVE FLAG for the derivation mode activates a special embedding mechanism which emulates interpretive productions as known from L-systems.

Exclude deleted

The flag EXCLUDE DELETED FLAG is useful in combination with PARALLEL MODE to obtain a variant of the deter- ministic parallel mode where a node is deleted at most once. Namely, when the execution of the right-hand side for a match leads to the deletion of a node, this is remembered, and this node is excluded from the set of candidates for further matches in the query state (i. e., the method excludeFromMatch of the query state returns true for such nodes).

In effect, this means that the first match which deletes a node is used and all further possible matches are disabled.

01_user_documentation/07_rgg_xl/03_query_graph/01_derivation.txt · Last modified: 2025/11/21 12:00 by gaetan