LLM-based Framework for Generating and Verifying Parallel DEVS Statecharts
Organizations: Arizona State University, Tempe, Arizona, USA · Intel Corporation, Chandler, Arizona, USA
Abstract
The development of models demands sound modeling and simulation knowledge as well as domain knowledge. Every model should accurately represent a system's dynamics and be verifiable. Toward this objective, this research introduces an agentic PDEVS-LLM framework to assist human modelers in generating and verifying PDEVS statecharts for behavior modeling of atomic Parallel Discrete Event System Specification (PDEVS) models. The framework supports (re)generating plausible facts from a system description prompt using the agentic LLM used for generating plausible facts. Inconsistencies in plausible facts lead to incorrect PDEVS statecharts having logical structure and behavioral inaccuracies. A controlled-correction mechanism is developed to verify the logical consistency of the plausible facts. The agentic LLM is used to generate key behavioral conditions from the system description prompt. The plausible facts are then verified against the behavioral conditions using propositional logic entailment for a finite number of times. The verification results enable the generation of modification prompts that can reduce errors in generated plausible facts, resulting in more accurate PDEVS statecharts. To verify a statechart's logical correctness, its Timed Automata counterpart is manually created and verified for deadlock and reachability properties. The human modeler may regenerate plausible facts and PDEVS statecharts iteratively and incrementally. A basic correctness metric is introduced to quantify the completeness and accuracy of the expected behavioral traits of the PDEVS statechart models. A collection of example systems with varying levels of complexity is developed to demonstrate the capabilities and limitations of LLMs. The evaluation of the proposed verification mechanism shows a substantial improvement in the logical consistency of generated statecharts.
Figures & tables
| Proposition | Definition |
| Processor is in busy state | |
| Job is generated by generator | |
| Processor is in idle state | |
| Job signal is received by processor | |
| Processed job is sent to output port | |
| Job is being processed by processor |
| PDEVS Specifications | Natural Language | Propositional Logic |
| Internal Transitions | whenever state is “busy” and “queue” is empty, the state must be “idle” and time_advance must be infinity (duration to wait for the next job). | |
| whenever state is “busy” and “queue” is not empty, the state must be “busy” and time_advance must be 2 (to process the next job). | ||
| External Transitions | whenever a job is received at job_in and the state is “idle”, the state must be “busy” and time_advance must be 2 (indicating processing time). | |
| whenever a job is received at job_in , the state is “busy”, the job is added to the “queue” and time_advance must be the remaining processing time for the current job. | ||
| Output Function | whenever the state is “busy”, the first job must be removed from the “queue”, the job is sent to processed_job_out . |
| Proposition | Definition |
| Phone is active | |
| Call is received by phone | |
| Service is found | |
| Phone is interrupted by another call | |
| Interrupting call is stored in memory | |
| Phone is on |
| PDEVS Statecharts | UPPAAL Timed Automata |
| Phases | Locations |
| State variables | defined as Local Declarations . |
| Input/output ports and messages | defined as synchronization channels . |
| External Transition Function | External events can be defined using channels . Guard and Action can be declared in Guard and Update properties of the UPPAAL transition respectively. Time Advance can be handled using a clock variable locally declared. |
| Internal Transition Function | Triggered by adding the invariant in the Guard property of the transition. Guard and Action can be declared in the Guard and Update properties. |
| Output Function | Omitted |
| No. of Systems suffering with Deadlock | No. of Systems not satisfying Phase reachability | |||
| LLM | BV | AV | BV | AV |
| Llama-3.1-8b † | 5 | 2 | 5 | 2 |
| Ministral-3b † | 1 | 1 | 1 | 0 |
| Ministral-8b † | 4 | 2 | 1 | 0 |
| Llama-3.3-70b | 1 | 0 | 1 | 0 |
| Mistral-7b-instruct * | 2 | 3 | 2 | 0 |
| External Transition Fn. | Internal Transition Fn. | Output Fn. | ||||
| Model | BV | AV | BV | AV | BV | AV |
| Llama-3.1-8b | 0.9434 | 0.8809 | 0.6416 | 0.7736 | 0.7935 | 0.8571 |
| Ministral-3b | 0.8065 | 0.7755 | 0.6427 | 0.7801 | 0.8809 | 0.9047 |
| Ministral-8b | 0.8392 | 0.8142 | 0.7857 | 0.7857 | 0.8571 | 0.8571 |
| Llama-3.3-70b | 0.8244 | 0.8928 | 0.6548 | 0.7991 | 0.7856 | 0.9285 |
| Mistral-7b-instruct | 0.8100 | 0.8100 | 0.7976 | 0.8214 | 0.7142 | 0.7142 |
Appendix figures & tables1 asset
Supplementary material from the paper’s appendix.
Appendix
| System | Description |
| Processor | Processes incoming jobs with a 2-second delay, transitioning between idle and busy states. |
| Processor with Queue | Another variant of processor with a queuing mechanism. |
| CarWash | A carwash that services cars and trucks with a 20-time-unit wash duration for cars and 40-time-unit for trucks; queues cars and denies service to trucks if busy. |
| Phone | Manages power, service search, and call handling while maintaining active conversations and handling interruptions using FIFO order. |
| Counter | Counts up, resets, stops, or provides the current count based on received inputs. |
| Coordinator (MiniFab) | Manages overall workflow by routing jobs between machines and synchronizing their operations. |