groimp-platform:xl-rules
GroIMP includes four sorts of rules.
Rule symbol | What it does |
==> | Rule in Lindenmayer-form. Graph replacement rule, where one subgraph (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 different type of rule than the instantiation rules (which also use ==>) | |
==>> | Rule in SPO-form. Graph replacement rule, where one subgraph is replaced 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 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 (or other sort of) information to all nodes of the declared type. |
groimp-platform/xl-rules.txt · Last modified: 2025/01/20 18:06 by wkurth