How tapaal/tapaal-gui works
The TAPAAL GUI project is essentially a desktop GUI application built in Java that provides a graphical environment for creating, editing, verifying, and simulating timed Petri nets. Its design integrates a rich set of components that cover the user interface, core modeling and simulation engines, I/O, parsing, and verification functionalities.
Main Components
• Core Modeling & Business Logic Layer – Found primarily in dk/aau/cs/model (and its subpackages like CPN, NTA, tapn) as well as the translation modules under dk/aau/cs/translations. This layer contains the data structures, simulation classes, and translation code that govern how Petri net elements are modeled, manipulated, and verified.
• Verification and Simulation Engine – Contained in dk/aau/cs/verification and dk/aau/cs/approximation, along with the executables in the UPPAAL and VerifyTAPN subpackages. This is responsible for model checking (including boundedness analysis, simulation runs, and verification result processing).
• Input/Output Operations – Encompassing the dk/aau/cs/io package and its batch processing and query subpackages. These classes handle loading of Petri net files (e.g., pnml, XML formats), writing outputs, and integrating with external verifiers.
• Parsing and Compiler-Like Components – Distributed across the javacc directories (e.g., dk/aau/cs/TCTL and its related parser subdirectories) to parse temporal logic queries and Petri net definitions.
• Utilities & Helpers – Additional low-level support such as logging (Logger.java), debugging (Logger in debug subpackage), memory monitoring, and other utility functions to support the entire application.
Relationships and Data Flow
• The User Interface interacts with the Controller layer to capture user actions (e.g., editing a net or running a verification) and translates these events into commands.
• The Controller/Command layer dispatches these actions to the Core Engine, which processes operations on Petri net models, simulation settings, and verification requests.
• The I/O layer interacts both with the Core Engine (loading/saving Petri nets and queries) and external resources (such as invoking external verifiers like UPPAAL).
• Parsing components ensure that both user-generated (or imported) query files and net files are converted into internal representations for further processing.
• Utility classes support cross-cutting concerns like logging, error handling, and memory monitoring.
Architectural Patterns and Design Principles
• MVC (Model-View-Controller) Concepts – The application separates the GUI (view) from the business logic (model) and uses controllers and command/undo mechanisms to bridge the two.
• Layered Architecture – The clear separation into presentation (GUI), application logic (controller/commands), domain/model (Petri net representation, simulation, verification), and infrastructure (I/O, parsing) supports maintainability.
• Extensibility – The use of visitors (for example, in the dk/aau/cs/TCTL/visitors package) indicates a design that is open to new operations on the model without altering object structures.
Relevant Technologies
• Java with Gradle as the build system.
• Swing components for the GUI.
• JavaCC for parser generation.
• Integration with external tools such as UPPAAL (and possibly other model checking engines) through dedicated packages.