GrGen.NET

from Wikipedia, the free encyclopedia
GrGen.NET
Paradigms : Multiparadigm : declarative , imperative , object-oriented
Publishing year: 2003
Developer: Sebastian Hack, Rubino Geiss, Moritz Kroll, Edgar Jakumeit, a. v. a.
Current  version : 4.5   (April 9, 2017)
Typing : static, partly dynamic, strong, nominative
Operating system : Windows , Linux
License : LGPL v3
http://grgen.net/
Debugging the sequence for generating a Koch snowflake (on the left the rules, below the GrShell with highlighted current rule, on the right yComp with highlighted fit in the working graph)
Execution of the replacement step

GrGen.NET is a software development tool that offers programming languages ( technical languages ​​(DSL) ) that have been optimized for processing graph-like data . At their core, the languages ​​consist of modular graph replacement rules based on declarative graph pattern search and replacement; they are supplemented by many constructs that are common in imperative and object-oriented programming, and completed with linguistic means known from database query languages.

The Graph Rewrite GENerator translates the languages ​​into efficient .NET assemblies (via C # code as an intermediate step), which can be integrated into the code of any .NET language via a programming interface . GrGen can be run under Windows and Linux ( Mono required) and is available as open source under LGPL v3.

For rapid prototyping and debugging , the program package contains an interactive command line and a (VCG) graph visualizer. With its languages ​​and its graphical and step-by-step debugging, GrGen allows development on the natural level of abstraction of graph-based representations. These are used, for example, in engineering , model transformation , computational linguistics , or compiler construction (as intermediate representation ).

GrGen increases productivity for this type of task well beyond what can be achieved by programming in an ordinary programming language; Due to the many implemented optimizations, it still allows quick solutions to be achieved. Its developers advertise the system with the statement that it offers the highest combined development and execution speed available for the algorithmic processing of graphs (based on their performance in relation to various tasks that were discussed in different editions of the Transformation Tool Contest (/ GraBaTs) were provided).

Sample specification

The following is an excerpt from the graph model and replacement rule specification of the GrGen.NET solution for the ( page no longer available , search in web archives: AntWorld task (PDF; 105 kB) ), which was presented at Grabats 08. @1@ 2Template: Dead Link / www.fots.ua.ac.be

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;

Replacement 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);
 }

Web links

Individual evidence

  1. Grabats 08 ( Memento from July 23, 2012 in the Internet Archive )