GrGen

GrGen.NET ( Graph Rewrite GENerator. NET version ) is generated a graph rewriting system that efficiently from declarative graph rewriting rules C # code (or. NET assemblies ). Graphs and graph rewrite rules are intuitive technical languages ​​( DSL) based on the SPO approach semantics (DPO is also available) specified. They can be used on graph rewriting sequences, a simple but sufficient for many graph rewrite tasks control language, or via a programming interface through each. NET language. GrGen is provided for this purpose, to generate the algorithmic core of applications that deal with graph -like data ( program graphs, social networks, chemical structures, ...). For rapid prototyping and debugging the program package includes an interactive command line and one ( VCG ) Graphvisualisierer; it on both Windows and Linux ( mono needed ) and use is as open source under the LGPL v3 available.

Example specification

The following is an excerpt from the graph model and specification of the replacement rule GrGen.NET solution for AntWorld task ( PDF; 105 kB), which was placed on the Grabats 08.

Graph model:

Node class GridNode {       food: int;       pheromones: int;   }   node class GridCornerNode extends GridNode;   node class AntHill extends GridNode {       food countdown: int = 10;   }   node class Ant {       hasFood: boolean;   }     edge class Grid Edge connect GridNode -> GridNode;   edge class PathToHill extends Grid Edge;   edge class AntPosition; Replacement rules:

Rule Take Food ( Curant: Ant)   {       Curant -: AntPosition -> n: GridNode \ AntHill;       if { curAnt.hasFood && n.food > 0! ; }         modify {           eval {               curAnt.hasFood = true;               n.food n.food = - 1;           }       }   }     Search rule Along Pheromones ( 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 );   } Web Links

  • Main GrGen.NET project
  • GrGen.NET User Manual (English ) (PDF file, 1.64 MB )
  • Brief introduction to GrGen.NET (English ) (PDF file, 174 kB)
  • Scientific publications on GrGen
  • Graph rewriting
  • Declarative programming
  • Free programming tool
279709
de