GrGen
GrGen.NET (Graph Rewrite GENerator, .NET version) is a graph transformation tool which generates efficient C#-code (or .NET-assemblies) out of declarative graph rewrite rule specifications. Graphs and graph rewrite rules are specified by intuitive domain specific languages (semantics based on the SPO-approach, DPO available as well); they may get used from graph rewrite sequences, a simple, yet for most graph transformation tasks sufficient, special purpose programming language, or via an API by any .NET language. GrGen is meant to be used for generating the algorithmic kernel of applications processing graph structured data (program graphs, social nets, chemical structures, ...). For rapid prototyping and debugging, an interactive shell and a (VCG-)graph viewer are included in the package, which executes under Windows and Linux (Mono required) and is open source available under GPL v3.
Specification sample
An example containing some graph model and rule specifications from the GrGen.NET-solution to the AntWorld-challenge posed at Grabats 08.
Graph model:
node class GridNode { food:int; pheromones:int; } node class GridCornerNode extends GridNode; node class AntHill extends GridNode { foodCountdown:int = 10; } node class Ant { hasFood:boolean; } edge class GridEdge connect GridNode[1] -> GridNode[1]; edge class PathToHill extends GridEdge; edge class AntPosition;
Rewrite Rules:
rule TakeFood(curAnt:Ant) { curAnt -:AntPosition-> n:GridNode\AntHill; if { !curAnt.hasFood && n.food > 0; } modify { eval { curAnt.hasFood = true; n.food = n.food - 1; } } } rule SearchAlongPheromones(curAnt:Ant) { curAnt -oldPos:AntPosition-> old:GridNode <-:PathToHill- new:GridNode; if { new.pheromones > 9; } modify { delete(oldPos); curAnt -:AntPosition-> new; } } test ReachedEndOfWorld(curAnt:Ant) : (GridNode) { curAnt -:AntPosition-> n:GridNode\AntHill; negative { n <-:PathToHill-; } return (n); }
External links
- Homepage of the GrGen.NET-project
- GrGen.NET User Manual
- Short introduction into GrGen.NET
Conference papers
- GrGen: A Fast SPO-Based Graph Rewriting Tool/[1] - ICGT 06
- Generation of Sierpinski Triangles: A Case Study for Graph Transformation Tools - AGTIVE 07
- Graph Rewriting for Hardware Dependent Program Optimizations - AGTIVE 07
- A First Experimental Evaluation of Search Plan Driven Graph Pattern Matching - AGTIVE 07
- Customizing GrGen.NET for Model Transformation - GraMoT 08
- Graph Rewrite Rules with Structural Recursion - ICGT/GCM 08