Aarhus University Seal / Aarhus Universitets segl

AC/DC, Automatic Code Generation

Automatic Code Generation from Design/CPN



CPN Group at DAIMI
Dalcotech A/S
Delta Software Engineering
Danish National Centre for IT-Research


Duration of project: April 97 - April 99

The purpose of this CIT-project was to develop techniques and tools for automatic generation of code from Coloured Petri Net models. In this way it was made be possible to obtain an automatic implementation of systems that are designed/specified by means of CP-nets and the Design/CPN tools. This substitutes a time-consuming and error-prone manual implementation. It also implies that the final system is behaviourally equivalent to the system design and specification that was validated and verified by means of simulation and state space analysis.

In an earlier project we made an experiment with automatic code generation for a complex alarm system. Standard ML code was extracted from a CPN model and burned into two PROMs that were mounted in a prototype of the final hardware. The experiment showed that automatic code generation from CPN models can be used in practice, but the experiment also showed a need to produce more efficient code and to develop additional tool support, e.g., for debugging and test. This is done in the AC/DC project developing a new system for control of buildings (access control, alarm system, energy control, energy measurement, etc.). The system is designed and specified by one or more CPN models, and it will be implemented by means of automatic code generation from these models.

Dalcotech A/S

Dalcotech A/S is a small company located in Nørresundby (in the northern part of Jutland, close to Aalborg). The company develops high-quality alarm systems and systems for energy measurements. Both kinds of systems communicate via a special part of the Danish public telephone system, known as the alarm net. In 1994-96 Dalcotech made a new version of their alarm system. The design and specification of the new system was done by means Coloured Petri Nets, while the implementation was done in C++. The system is now being certified for the German market, and the first test installations are made.

Delta Software Engineering

DELTA is a research and technology institute that has been in business for more than 50 years and performs accredited testing and consultancy for customers throughout Europe. DELTA has a staff of 200 and is a totally independent self-governing foundation. The Software Engineering division works with assessment of software products and software life-cycle processes and conducts research in these fields. Specific competence areas are software quality systems, software best practice and software product certification.

Project Group

Research manager:
Søren Christensen, Assoc. Prof., PhD, DAIMI
Phone: +45 8942 5627, E-mail: schristensen@cs.au.dk
Business manager:
Torben Andersen, Dalcotech A/S
Phone: +45 9819 1799, E-mail: torben.andersen@dalcotech.dk  
Other members of the project group:
Søren Vester Hansen, Dalcotech A/S (soren.vester@dalcotech.dk)
Kurt Jensen, Prof., Dr. Scient, DAIMI (kjensen@cs.au.dk)
Kjeld Høyer Mortensen, PostDoc., DAIMI (khm@cs.au.dk)
John Mølgaard, Civ. Ing., DELTA Software Engineering (jm@delta.dk)
Jan-Henrik Paulsen, Student Programmer, DAIMI (jpaulsen@cs.au.dk)


  • K.H. Mortensen: Automatic Code Generation Method Based on Coloured Petri Net Models Applied on an Access Control System, In M. Nielsen and D. Simpson (eds.): Application and Theory of Petri Nets 2000. Proceedings of the 21st International Petri Net Conference, Aarhus, Denmark, 2000, Lecture Notes in Computer Science Vol. 1825, Springer-Verlag, pp. 367-386, 2000.
  • K.H. Mortensen: Automatic Code Generation from Coloured Petri Nets for an Access Control System, In Kurt Jensen (ed.): Second Workshop on Practical Use of Coloured Petri Nets and Design/CPN, Aarhus, Denmark, October 11-15, 1999.
  • University of Aarhus and Dalcotech A/S and DELTA and CIT: Automatisk kodegenerering fra Farvede Petri Net, May 1999, Final report for CIT-project number 106. In Danish.
  • J.L. Rasmussen and M. Singh: Designing a Security System by Means of Coloured Petri Nets. In: J. Billington and W. Reisig (eds.): Application and Theory of Petri Nets 1996. Proceedings of the 17th International Petri Net Conference, Osaka 1996, Lecture Notes in Computer Science Vol. 1091, Springer-Verlag 1996, 400-419.
  • ESSI Project No. 10937: Improved Methodology for the Design of Communication Protocols in Security Systems (download as PDF).