Rule
In order to combine queries and production statements to rules, the XL programming language defines three arrow symbols ==>, ==>> and ::>. The first two are structural rules whose
right-hand sides consist of production statements which define a successor graph. The third one is an execution rule which executes the statement for every match.
Additionally, rules using ==> extend rules using ==>> by implicit connection transformations. I.e. with ==> we can write L-system rules just as we would do this in an L-system environment.
Lindenmayer-form
==>
Graph replacement rule, where one sub-graph (often only one object) is replaced by another graph. The connections between the host graph and the newly-inserted graph are recovered. That means that if, e.g., in a one-dimensional graph [ A B C D ] the node B is replaced by a node G, then G will be inserted into the graph with the original connecting edges to the neighbourhood of the node B: [ A G C D ]. The blank space indicates here a successor edge in XL. Axiom ==> A B C D; B ==> G;
Note: This is a from the module instantiation declarations (which also use the symbol ==>).
SPO
==>>
The Single Push Out (SPO) Graph replacement rule replace one sub-graph by another graph. The connections between the host graph and the newly-inserted graph need to be specified by the programmer. That means that if, e.g., in a one-dimensional graph [ A B C D ] the node B is replaced by the node G, then the original connections (in- and outgoing edges) of B to the host graph will not be maintained. If an edge going from A to G is not explicitly stated, then there will be no connection between the nodes A and G in the rewritten graph. This entails that the nodes G (formerly B), C and D will be no more visible, which means they are effectively deleted. Only the (unconnected) node A remains. Axiom ==> A B C D; B ==>> G; In order to achieve the same result as in the example above (Lindenmayer-form), it is necessary to explicitly list the connecting edges from A to G and from G to C on the right-hand side of the rule: Axiom ==> A B C D; a:A B c:C ==>> a G c; This rule type is frequently used to delete sub-graphs. Axiom ==> A A [ B A A A ] A A [ C A A ] A; B ==>> ; The resulting graph reads as follows: A A A A [ C A A ] A.
Update
::>
This rule type does not change the structure of the graph. It is used to change the attributes of the objects (nodes) of the graph. c:C ::> {c[length] = c[length] * 20; }
