Claus Reinke
Tool Support for Haskell-Coloured Petri Nets (extended abstract)
Implementation and Applications of Functional Languages, IFL'2004 Lübeck, Germany, September 7-10, 2004, draft proceedings (PDF)

Abstract: Haskell-Coloured Petri Nets (HCPNs) are one instance of a class of high-level Petri Nets which combines graphical description of concurrent system structure (causal dependencies, concurrency, conflict over shared resources, data transport) with functional specification of data manipulation. In an earlier paper \cite{Reinke99}, we introduced HCPN to demonstrate how any functional language supporting a few common features (such as records and list comprehensions) can support Petri nets with inscriptions in that language via a straightforward embedding, thus giving functional programmers easy access to a rich hybrid graphical/textual specification formalism. We report on work in progress to provide tool support for the specific example of HCPN, including a concrete example implementation of our embedding together with support for graphical editing and simulation. Graphical user interfaces add their own complexities, but the focus continues to be on simple implementation, supporting easy experimentation with language design options, with a view on strengthening the functional programming aspects of this hybrid specification formalism. After about a month, the tools have already reached a state in which they can be used for small examples and demonstrations, e.g., for teaching purposes. To bring project work, workflow systems, and general system modelling within reach, we will add support for hierarchical nets. By providing Haskellers with their own graphical modelling language, we also hope to encourage parallel implementations of the ideas in other functional languages (especially those concerned with concurrent systems, such as Erlang). The aspect of Haskell that most complicates the development (apart from the nitty-gritty of graphical user interfaces) is its lack of support for runtime reflection, for which workarounds are just becoming available.

Claus Reinke
Haskell-Coloured Petri Nets © Springer-Verlag
Implementation of Functional Languages, 11th International Workshop, IFL'99 Lochem, The Netherlands, September 7-10, 1999, Selected Papers, Springer LNCS, vol. 1868, pp. 165-180 (PDF)

Abstract: Coloured Petri Nets are a high-level form of Petri Nets, in which transition inscriptions in some programming language operate on individual tokens, i.e., tokens attributed with values of the inscription language. We introduce the variant of Haskell-Coloured Petri Nets (HCPNs) and show that they have a simple mapping to Haskell. HCPNs can thus be used for system modelling in preparation of system implementation in Haskell, following a process of stepwise refinement in which all intermediate specifications are executable Haskell programs. Similar mappings can be used to introduce functional Petri Nets as graphical specification languages on top of other functional languages.