User Tools

Site Tools


02_user_tutorials:03_graph_xl:common_rewriting_rules

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
02_user_tutorials:03_graph_xl:common_rewriting_rules [2025/01/24 15:51] – ↷ Page moved from 02_user_tutorials:graph_xl:common_rewriting_rules to 02_user_tutorials:03_graph_xl:common_rewriting_rules tim202_user_tutorials:03_graph_xl:common_rewriting_rules [2025/12/10 12:54] (current) – removed gaetan
Line 1: Line 1:
-====== Structural rules ====== 
  
-===== L-System style ===== 
- 
-Of the two structural rules this one is much more commonly used in GroIMP.  
-It replaces each instance of the pattern defined on the left side with the new created graph structure on the right side. 
-<code> 
-<pattern> ==> <structure>; 
-</code> 
- 
-So if all A's in the model should be replaced by F's the patterns a the A's and the new structure is an F: 
- 
-<code> 
-A ==> F; 
-</code> 
-==== pattern side ==== 
- 
- 
-The definition of the pattern that should be replaced can be defined by using [[01_user_documentation:groimp-platform:graph_queries| xl syntax]] and [[01_user_documentation:groimp-platform:xl-builtin-methods|XL builtin methods]]. 
- 
-<code> 
-A[F] ==> F; 
-</code> 
- 
-<code> 
-first((*A*)) ==> F; 
-</code> 
- 
-Additionally the pattern can be defined using conditions: 
- 
-<code> 
-A(1)==>F; 
-</code> 
- 
-<code> 
-a:A,(a.len!=1)==>F; 
-</code> 
- 
-==== structure side ==== 
- 
-A more complex structure can be created by using the  [[01_user_documentation:3d-guide:3d-manipulations#turtle_commands|turtle geometry]] and  [[01_user_documentation:3d-guide:3d-manipulations#graph-syntax|graph-syntax]].  
-<code> 
-A ==> F [RL(90) F A] F +> A; 
-</code> 
-With the addition of modules and 3d objects more object oriented nodes can be added: 
-<code> 
-A ==> F [RL(90) Cylinder(1,4) A] F +> MyNewNode(2.4); 
-</code> 
-  
- 
- 
-===== SPO style ===== 
- 
-SPO: Single pushout graph rewriting 
- 
- 
- 
-====== Execution rule ====== 
- 
-<code java> 
- 
-[ <pattern> ::> <java code> ] 
- 
-</code> 
- 
-e.g.  
- 
-<code java> 
- 
-[ a:A ::> println( a ); ] 
- 
-</code> 
02_user_tutorials/03_graph_xl/common_rewriting_rules.1737730316.txt.gz · Last modified: 2025/01/24 15:51 by tim2