GrGen

{{Short description|Software development tool}}

{{External links|date=January 2023}}

{{Infobox programming language

| name = GrGen.NET

| logo = 220px

| paradigm = Multi-paradigm: declarative, imperative, object-oriented

| year = {{Start date|2003}}

| developer = Sebastian Hack, Rubino Geiss, Moritz Kroll, Edgar Jakumeit, and others

| written_in = Java, C#

| latest release version = GrGen.NET 4.5

| latest release date = {{Start date and age|2017|04|09}}

| turing-complete = Yes

| typing = Static, partly dynamic, strong, safe, nominative

| operating_system = Cross-platform (multi-platform)

| license = GNU Lesser General Public License

| website = {{URL|https://grgen.de/}}

}}

File:GrGenNETKochSnowflakeMatch.png

File:GrGenNETKochSnowflakeRewrite.png

GrGen.NET is a software development tool that offers programming languages (domain-specific languages) that are optimized for the processing of graph structured data.

The core of the languages consists of modular graph rewrite rules, which are built on declarative graph pattern matching and rewriting; they are supplemented by many of the constructs that are used in imperative and object-oriented programming,

and are completed with language devices known from database query languages.

The Graph Rewrite GENerator compiles the languages into efficient CLI assemblies (via C#-Code in an intermediate step), which can be integrated via an API into code written in any .NET-language.

GrGen can be executed under Windows and Linux (Mono needed) and is open source available under LGPL v3.

For rapid prototyping and debugging, an interactive shell and a (VCG-)graph viewer are included in the package.

With its languages and its visual and stepwise debugging, GrGen allows one to develop at the natural level of abstraction of graph-based representations, such as those employed in engineering, model transformation, computational linguistics, or compiler construction (as intermediate representation).

GrGen increases productivity for those kinds of tasks far beyond what can be achieved by programming in a traditional programming language; due to many implemented performance optimizations it still allows one to achieve high-performance solutions.

Its authors claim that the system offers the highest combined speed of development and execution available for the algorithmic processing of graph-based representations (based on their performance regarding diverse tasks posed at different editions of the Transformation Tool Contest (/GraBaTs)).

Specification sample

Below is an example containing a graph model and rule specifications from the GrGen.NET-solution to the [http://www.fots.ua.ac.be/events/grabats2008/cases/grabats2008performancecase.pdf AntWorld-case] {{Webarchive|url=https://web.archive.org/web/20110810090211/http://fots.ua.ac.be/events/grabats2008/cases/grabats2008performancecase.pdf |date=2011-08-10 }} posed at [http://www.fots.ua.ac.be/events/grabats2008 Grabats 08] {{Webarchive|url=https://archive.today/20121129023248/http://www.fots.ua.ac.be/events/grabats2008 |date=2012-11-29 }}.

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

}

Conference papers

  • [https://doi.org/10.1007%2F11841883_27 GrGen: A Fast SPO-Based Graph Rewriting Tool]/[http://www.info.uni-karlsruhe.de/papers/grgen_icgt2006.pdf] - ICGT 06
  • [https://web.archive.org/web/20110606104449/http://www-users.cs.york.ac.uk/~det/Papers/agtive.07.pdf Generation of Sierpinski Triangles: A Case Study for Graph Transformation Tools] - AGTIVE 07
  • [http://www.info.uni-karlsruhe.de/papers/agtive_2007_firm.pdf Graph Rewriting for Hardware Dependent Program Optimizations] - AGTIVE 07
  • [http://www.info.uni-karlsruhe.de/papers/agtive_2007_search_plan.pdf A First Experimental Evaluation of Search Plan Driven Graph Pattern Matching] - AGTIVE 07
  • [http://www.ipd.uka.de/Tichy/uploads/publikationen/180/gramot2-gelhausen.pdf Customizing GrGen.NET for Model Transformation] - GraMoT 08
  • [http://www.informatik.uni-bremen.de/~hof/papers/08-GCM.pdf Graph Rewrite Rules with Structural Recursion] - ICGT/GCM 08

See also