User Tools

Site Tools


groimp-platform:xl-rules

GroIMP includes three rules.

Rule symbol What it does
==> Rule in Lindenmayer-form. Simple replacement rule, where one subgraph (often only one object) is replaced by another graph. The relationships are recovered. That means that if 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 relationship of the node B: [ A G C D ]. The blank space always indicates a successor edge in XL. Axiom ==> A B C D; B ==> G; Note this is a different than the instantiation rules (which also use ==>)
==>> Rule in SPO-form. Complex replacement rule, where one subgraph is replaced by another graph. The relationships need to be recovered by the programmer. That means that if in a one-dimensional graph [ A B C D ] the node B is replaced by the node G, then the original relationships of B in the graph will not be maintained. If the relationship to C is not explicitly stated, then there will be no connection of the nodes C D to the graph. This entails that the nodes are no more visible, which means they are effectively deleted. Only the (unconnected) nodes A and G remain. 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 relationships to A and 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 subgraphs. 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 rule. 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; }
==> Instantiation rule. It is NOT used after a query, but after a class/ module declaration. It adds geometric information to all Node of that type
groimp-platform/xl-rules.txt · Last modified: 2025/01/10 14:31 by gaetan