graph-rewriting-gl-0.5.1: OpenGL interface for interactive hypergraph rewriting



This module provides an easy-to-use interface to create an interactive, graphical front-end for you graph rewriting system. The controls of the GUI are:

  • left-click on a menu entry: rule selection. At all times for each redex (according to the selected rule) one node of the redex (the first node that is matched) is marked red in the graph.
  • right-click on a menu entry: applies the rule once for each redex currently existing in the graph. No contractions take place for redexes deleted or arisen during this process.
  • right-click on a (red) node: applies the selected rule to the redex containing the node.
  • drag a node: by this you can manually help out the graph drawing mechanism to find a better layout.
  • drag outside of a node: scroll around.
  • mouse wheel: zoom
  • z: autozoom
  • space: pause/resume layouting

Please have a look the graph-rewriting-ski package for an example application that makes use of this library.



initialise :: IO (String, [String])Source

Initialises GLUT. Returns program name and command line arguments.



:: (View [Port] n, Render n, View Position n, PortSpec n, View Rotation n) 
=> Int

The number of layout steps to apply before displaying the graph

-> (Graph n -> Graph n)

A projection function that is applied just before displaying the graph

-> Rewrite n a

The monadic graph transformation code for a layout step

-> Graph n 
-> LabeledTree (Rule n)

The rule menu given as a tree of named rules

-> IO () 

After initialisation run can be used to start the GUI