



Examples
The distribution of GRACEland contains the listed examples.The documentation
will be soon available.
Petri-Networks
Petri-Networks are a method to describe concurrent and parallel processes.
Normaly the underlying graph must be static so dynamic processes can't
be modelled. But with this graph rewriting approach it is possible to modell
it.
In this example the mathematical function fak is calculated. The function
is defined as fak(n) = n*fak(n-1) and stops if n is one.
The fibonacci number is defined as fib(n) = fib(n-1) + fib(n-2) and
fib(1) = 1 and fib(2) = 2. This is the classic way to calculate the number
but is not the fastest because paths are calculated twice. For example
if we examine fib(5) then fib(3) is evaluated twice. A faster way to calculate
fib is to use shared nodes, that eliminate duplicate processing.
Specification
This example shows how to specify an dynamic system. The example consists
of three different objects: a printer, a channel and a client. The client
is a hard-working hero who produces endless number of documents and sends
them to the printer to preserve them for the next generation.
Channel
Client
Printer
System
Pacman
Pattern matching (next
time)
This example shows how to implement pattern matching with a graph rewriting
system.
Last modified on 24th of June 1998. Copyright by Martin Faust