Automatic Structure-Based Code Generation from Coloured Petri Nets: A Proof of Concept

  • Abstract
  • Literature Map
  • Similar Papers
Abstract
Translate article icon Translate Article Star icon

Automatic code generation based on Coloured Petri Net (CPN) models is challenging because CPNs allow for the construction of abstract models that intermix control flow and data processing, making translation into conventional programming constructs difficult.We introduce Process-Partitioned CPNs (PP-CPNs) which is a subclass of CPNs equipped with an explicit separation of process control flow, message passing, and access to shared and local data. We show how PP-CPNs caters for a four phase structure-based automatic code generation process directed by the control flow of processes. The viability of our approach is demonstrated by applying it to automatically generate an Erlang implementation of the Dynamic MANET On-demand (DYMO) routing protocol specified by the Internet Engineering Task Force (IETF).

Similar Papers
  • PDF Download Icon
  • Research Article
  • 10.1088/1742-6596/2503/1/012100
Implementation of Automatic DSP Code Generation Based on Closed-loop Algorithm for Three-level Inverters
  • May 1, 2023
  • Journal of Physics: Conference Series
  • Yu Zhang + 2 more

Wind energy has the advantages of wide distribution, renewable, and non-polluting, so it is receiving more and more attention from more and more countries. As more and more wind power systems are integrated into the grid, it has an impact on the stability of the grid. To keep the power system stable, there is an urgent need for a grid simulator that can simulate various behaviors of the grid and test the reliability of the wind turbine before grid integration. Inverters, especially multilevel inverters, as the core part of the grid simulator, have been widely studied by scholars in recent years. However, compared to conventional inverters, multilevel inverters are characterized by high code development effort, great difficulty, and a long development period. In this paper, we adopt an automatic DSP code generation method with MATLAB hardware support package and give a complete system design method and development flow based on MATLAB and TMSF28335 automatic code generation. Finally, we take the closed-loop three-level MMC inverter as an example, propose an equalization algorithm suitable for automatic code generation for the capacitor-voltage balancing part, and verify the feasibility of the DSP automatic code generation in a multilevel inverter development. The feasibility of DSP automatic code generation in the development of a multilevel inverter is verified. The experimental results show that the proposed equalization algorithm with variable reference coefficient and DSP automatic code generation method can be used in the development of a multilevel inverter, which can improve development efficiency and reduce development costs.

  • Book Chapter
  • Cite Count Icon 40
  • 10.1007/978-3-642-04856-2_5
On Modelling and Analysing the Dynamic MANET On-Demand (DYMO) Routing Protocol
  • Jan 1, 2009
  • Jonathan Billington + 1 more

The Dynamic MANET On-demand (DYMO) routing protocol, being developed by the Internet Engineering Task Force, is a reactive routing protocol for mobile ad-hoc networks (MANETs). The basic operations of DYMO are route discovery and route maintenance. Constructing an analysable model of the DYMO protocol specification is a challenge because the routing operations are complex and the network topology changes dynamically. This paper presents a formal model of DYMO using Coloured Petri Nets. The model has a compact net structure, with functions in the arc inscriptions representing DYMO’s routing algorithms. The paper shows how careful crafting of the model results in smaller state spaces, compared with models using intuitively appealing hierarchical constructs. Initial results of state space analysis of the model are presented.

  • Research Article
  • 10.5121/ijcsit.2012.4201
MppSoCGEN: A Framework for automatic generation of MppSoC Architecture
  • Apr 30, 2012
  • International Journal of Computer Science and Information Technology
  • Emna Kallel

Automatic code generation is a standard method in software engineering since it improves the code consistency and reduces the overall development time. In this context, this paper presents a design flow for automatic VHDL code generation of mppSoC (massively parallel processing System-on-Chip) configuration. Indeed, depending on the application requirements, a framework of Netbeans Platform Software Tool named MppSoCGEN was developed in order to accelerate the design process of complex mppSoC. Starting from an architecture parameters design, VHDL code will be automatically generated using parsing method. Configuration rules are proposed to have a correct and valid VHDL syntax configuration. Finally, an automatic generation of Processor Elements and network topologies models of mppSoC architecture will be done for Stratix II device family. Our framework improves its flexibility on Netbeans 5.5 version and centrino duo Core 2GHz with 22 Kbytes and 3 seconds average runtime. Experimental results for reduction algorithm validate our MppSoCGEN design flow and demonstrate the efficiency of generated architectures.

  • Conference Article
  • Cite Count Icon 1
  • 10.1145/1850771.1850783
Preliminary feasibility analysis of component based modelling and automatic Java code generation for nanosatellite on-board software
  • Aug 19, 2010
  • O R Polo + 5 more

Nanosatellite on-board software is a real-time system that schedules and executes control actions over the platform and the payload subsystems during the mission stages. Its development is a complex task that can be better approached using advanced software engineering techniques as graphical component based modelling and automatic code generation.Nanosat1B is a scientific nanosatellite developed by the Spanish National Institute of Aerospace Technology (INTA) that was launched on July 09. This paper introduces the component base modelling and automatic code generation of Nanosat1B on-board software using a CASE tool named EDROOM. It shows the UML2 diagrams used for specifying the system components, their interfaces and behaviour, emphasizing on their reuse possibilities on the same domain.The paper describes also the main characteristics of the EDROOM tool and analyses the feasibility of its adaptation for automatic Java code generation. The benefits of using the EDROOM automatic Java code generation for nanosatellites on-board software development are also enumerated.

  • Research Article
  • Cite Count Icon 9
  • 10.17533/udea.redin.n77a10
An analysis of tools for automatic software development and automatic code generation
  • Dec 1, 2015
  • Revista Facultad de Ingeniería Universidad de Antioquia
  • Viviana Yarel Rosales-Morales + 4 more

"Software development is an important area in software engineering, which is why a wide range of techniques, methods, and approaches has emerged to facilitate software development automation. This paper presents an analysis and evaluation of tools for automated software development and automatic code generation in order to determine whether they meet a set of quality metrics. Diverse quality metrics were considered such as effectiveness, productivity, safety, and satisfaction in order to carry out a qualitative and quantitative evaluation. The tools evaluated are CASE tools, frameworks, and Integrated Development Environments (IDEs). The evaluation was conducted to measure not only the tools’ ability to be employed, but also their support for automated software development and automatic source code generation. The aim of this work is to provide a methodology and a brief review of the most important works to identify the main features of these works and present a comparative evaluation in qualitative and quantitative terms of quality metrics. This would provide software developers with the information they need to decide the tools that can be useful for them."

  • Conference Article
  • Cite Count Icon 8
  • 10.1109/infocom.2006.200
Ad Hoc Routing with Distributed Ordered Sequences
  • Jan 1, 2006
  • M Mosko + 1 more

Ad Hoc Routing with Distributed Ordered Sequences

  • Book Chapter
  • Cite Count Icon 38
  • 10.1007/978-3-540-68746-7_13
Modelling and Initial Validation of the DYMO Routing Protocol for Mobile Ad-Hoc Networks
  • Jan 1, 2008
  • Kristian L Espensen + 2 more

A mobile ad-hoc network (MANET) is an infrastructureless network established by a set of mobile devices using wireless communication. The Dynamic MANET On-demand (DYMO) protocol is a routing protocol for multi-hop communication in MANETs currently under development by the Internet Engineering Task Force (IETF). This paper presents a Coloured Petri Net (CPN) model of the mandatory parts of the DYMO protocol, and shows how scenario-based state space exploration has been used to validate key properties of the protocol. Our CPN modelling and verification work has spanned two revisions of the DYMO protocol specification and have had direct impact on the most recent version of the protocol specification.

  • Book Chapter
  • Cite Count Icon 7
  • 10.1007/978-3-319-39086-4_10
Transforming CPN Models into Code for TinyOS: A Case Study of the RPL Protocol
  • Jan 1, 2016
  • Lars Michael Kristensen + 1 more

TinyOS is a widely used platform for the development of networked embedded systems offering a programming model targeting resource constrained devices. We present a semi-automatic software engineering approach where Coloured Petri Net (CPNs) models are used as a starting point for developing protocol software for the TinyOS platform. The approach consists of five refinement steps that allow a developer to gradually transform a platform-independent CPN model into a platform-specific model that enables automatic code generation. To evaluate our approach, we use it to obtain an implementation of the IETF RPL routing protocol for sensor networks.

  • Research Article
  • Cite Count Icon 1
  • 10.1038/s41598-025-34350-3
A generative AI cybersecurity risks mitigation model for code generation: using ANN-ISM hybrid approach.
  • Jan 14, 2026
  • Scientific reports
  • Hussein A Al-Hashimi

The increasing reliance on automatic code generation integrated with Generative AI technology has raised new challenges for cybersecurity defense against code injection, insecure code templates, and adversarial manipulation of an AI model. These risks make developing advanced frameworks imperative to ensure secure, reliable, and privacy-preserving code generation processes. The paper presents a novel Hybrid Artificial Neural Network (ANN)-Interpretive Structural Modeling (ISM) Framework to alleviate the cybersecurity risks associated with the automatic code generation using Generative AI. The proposed framework integrates the predictive capability of ANN and structured analysis of ISM for the identification, evaluation, and treatment of common vulnerabilities and risks in automatic code generation. We first conduct a multivocal literature review (MLR) to identify cybersecurity risks and generative AI practices for addressing these risks in automatic code generation. Then we conduct a questionnaire survey to identify and validate the identified risks and practices. An expert panel review was then assigned for the process of ANN-ISM. The ANN model can predict potential security risks by learning from historical data and code generation patterns. ISM is used to (1) structure and visualize (2) relations between identified risks and mitigation approaches and (3) offer a combined, multi-layered risk management methodology. We then perform an in-depth examination of the framework with a case study of an AI-based code generation company. We further determine its practicality and usefulness in real-world settings. The case study results show that the framework efficiently handles the primary cybersecurity challenges, such as injection attacks, code quality, backdoors, and lack of input validation. The analysis characterizes the maturity of several mitigation practices and areas for improvement for security integration with automatic code generation functionality. Advanced risk mitigation is enabled in the framework across multiple process areas, where techniques such as static code analysis, automated penetration testing, and adversarial training hold much promise. The Hybrid ANN-ISM Mechanism is a stable and flexible solution for cybersecurity risk reduction in automatic code generation environments. The coupling of ANN and ISM, in terms of predictive analysis and structured risk management, respectively, contributes effectively towards the security of AI-based code generation tools. More research is required to improve the scalability, privacy preserving, and dynamic integration of the framework with cybersecurity threat intelligence.

  • Conference Article
  • 10.1109/icmlc.2007.4370141
Using CPN Modeling and Simulating the Task-Oriented C2 Organization
  • Aug 1, 2007
  • Chun-Hui Yang + 3 more

Task-oriented command and control organization (TC2O) aims to deal with the uncertain war environment. It is a very important problem to evaluating the performance of TC2Os to choose and apply the best one which is most congruent with the mission environment. It is presented that a methodology for setting up the Colored Petri Net (CPN) model of TC2O and simulating the organizational performance. The CPN model of TC2O uses object oriented design approach and it is composed of 3 objects: mission environment, TC2O structure, and resources. In CPN model, the concept of control variable is defined and the model represents all kinds of TC2O parameters by the initial tokens of control variable. At the same time, the switch rules are extracted which can turn the relation of tasks into tokens. Furthermore, the CPN model of TC2O structure is based on Computational and Mathematical Organization Theory (CMOT) and the organization contingency theory. TC2O structure is composed of DMs. Each DM has the same model structure and carries out the tasks with other DMs by communication that includes 5 kinds of messages (i.e. resource requirement message, resource response message, resource movement message, task finish message, information transfer message). Resources are controlled by DMs and used to execute tasks. The CPN model of TC2O is adaptive to the military environment of high time pressure, because the related parameters of TC2O are presented by the initial marking of control variable, and then the CPN model structure of TC2O hasn't to be changed under different mission environments or organization structures. After simulating the CPN model, the performance of TC2Os can be obtained by analyzing the simulation results.

  • Conference Article
  • Cite Count Icon 15
  • 10.1145/1050330.1050387
Metadata driven code generation using .NET framework
  • Jan 1, 2004
  • Ivo Damyanov + 1 more

In this paper incorporating manual and automatic code generation is discussed. A solution for automatic metadata-driven code generation is presented illustrated with multi tier Enterprise Resource Planning System. We intend to make our solution available to public in order to encourage investigation of code generation and schema-driven tools for .NET Framework.

  • Research Article
  • Cite Count Icon 5
  • 10.4271/2009-01-0747
Applying Model-Based Design and Automatic Production Code Generation to Safety-Critical System Development
  • Apr 20, 2009
  • SAE International Journal of Passenger Cars - Electronic and Electrical Systems
  • Dirk Fleischer + 2 more

<div class="htmlview paragraph">Model-based software development and automatic code generation have become increasingly established in recent years. The automotive industry has widely adopted and successfully deployed these methods in many different series production programs worldwide. This brought various benefits, such as a reduction in development times, improved quality due to more precise specifications, and early verification and validation by means of simulation.</div> <div class="htmlview paragraph">At the same time, more and more safety-related and safety-critical systems have been - and will be -introduced into modern vehicles. Common examples are active front steering, adaptive cruise-control, and integrated chassis control.</div> <div class="htmlview paragraph">This leads to the question, if and how model-based design and automatic production code generation can be applied to the development of safety-critical systems.</div>

  • Research Article
  • 10.4018/ijsi.2017010101
OpenMP-Based Approach for High Level C Loops Synthesis
  • Jan 1, 2017
  • International Journal of Software Innovation
  • Emna Kallel + 2 more

The complexity of embedded systems design is continuously augmented, due to the increasing quantity of components and distinct functionalities incorporated into a single system. To deal with this situation, abstraction level of projects is incessantly raised. In addition, techniques to accelerate the code production process have appeared. In this context, the automatic code generation is an interesting technique for the embedded systems project. This work presents an automatic VHDL code generation method based on the OpenMP parallel programming specification. In order to synthesize C code for loops into hardware, the authors applied the directives of OpenMP, which specifies portable implementations of shared memory parallel programs. A case study focused on the use of embedded systems for the DCT algorithm is presented in this paper to demonstrate the feasibility of the proposed approach.

  • Research Article
  • Cite Count Icon 16
  • 10.1007/s11704-017-6477-y
Template-based AADL automatic code generation
  • Jun 18, 2019
  • Frontiers of Computer Science
  • Kai Hu + 4 more

Embedded real-time systems employ a variety of operating system platforms. Consequently, for automatic code generation, considerable redevelopment is needed when the platform changes. This results in major challenges with respect to the automatic code generation process of the architecture analysis and design language (AADL). In this paper, we propose a method of template-based automatic code generation to address this issue. Templates are used as carriers of automatic code generation rules from AADL to the object platform. These templates can be easily modified for different platforms. Automatic code generation for different platforms can be accomplished by formulating the corresponding generation rules and transformation templates. We design a set of code generation templates from AADL to the object platform and develop an automatic code generation tool. Finally, we take a typical Data Processing Unit (DPU) system as a case study to test the tool. It is demonstrated that the auto-generated codes can be compiled and executed successfully on the object platform.

  • Conference Article
  • Cite Count Icon 5
  • 10.1145/3637792.3637795
Analysis and Comparison of Automatic Code Generation and Transformation Techniques on Low-Code Platforms
  • Oct 20, 2023
  • Burak Uyanık + 1 more

The low-code approach is an important area of research being developed to improve the rapid creation and performance of software applications. This approach allows developers and users to easily create software applications through an interactive interface. Existing research shows that the low-code approach accelerates the development process in innovative ways, saves effort and time, and reduces code complexity. This study analyses and compares automatic code generation and transformation techniques in low-code platforms. The study analyses the contributions of automatic code generation and transformation to software engineering processes and evaluates the impact of these techniques on software product quality and development speed. The importance of the Model-Based Development (MBD) approach in automated code generation processes is highlighted. It is stated that MBD provides benefits such as speeding up the software development process and reducing errors by enabling automatic code generation from high-level abstract models. In the study, various literature studies were evaluated to examine the impact of automatic code generation and transformation techniques on the application development process. These studies have shown how automatic code generation and transformation techniques are applied, what results are achieved and what contributions these techniques make to the software development process. The results of the study show that automatic code generation and transformation techniques have a great impact on the application development process. In particular, the acceleration of the software development process, the reduction of errors and the ability to produce more effective and efficient software products are important benefits of these techniques. In addition, it has been found that this approach increases the success of software projects by enabling software developers to produce fast and accurate solutions in complex systems. In this context, the importance of automatic code generation and transformation techniques plays an important role in software development processes.

Save Icon
Up Arrow
Open/Close
Notes

Save Important notes in documents

Highlight text to save as a note, or write notes directly

You can also access these Documents in Paperpal, our AI writing tool

Powered by our AI Writing Assistant