DEVS, abbreviating discrete event system specification, is a modular and hierarchical formalism for modeling and analyzing general systems that can be discrete event systems which might be described by state transition tables, and continuous state systems which might be described by differential equations, and hybrid continuous state and discrete event systems. DEVS is a timed event system.
Contents
History
DEVS is a formalism for modeling and analysis of discrete event systems (DESs). The DEVS formalism was invented by Bernard P. Zeigler, who is emeritus professor at the University of Arizona. DEVS was introduced to the public in Zeigler's first book, Theory of Modeling and Simulation in 1976, while Zeigler was an associate professor at University of Michigan. DEVS can be seen as an extension of the Moore machine formalism, which is a finite state automaton where the outputs are determined by the current state alone (and do not depend directly on the input). The extension was done by
associating a lifespan with each state,
providing a hierarchical concept with an operation, called coupling,
Since the lifespan of each state is a real number (more precisely, non-negative real) or infinity, it is distinguished from discrete time systems, sequential machines, and Moore machines, in which time is determined by a tick time multiplied by non-negative integers. Moreover, the lifespan can be a random variable; for example the lifespan of a given state can be distributed exponentially or uniformly. The state transition and output functions of DEVS can also be stochastic.
Zeigler proposed a hierarchical algorithm for DEVS model simulation in 1984 which was published in Simulation journal in 1987. Since then, many extended formalism from DEVS have been introduced with their own purposes: DESS/DEVS for combined continuous and discrete event systems, P-DEVS for parallel DESs, G-DEVS for piecewise continuous state trajectory modeling of DESs, RT-DEVS for realtime DESs, cell-DEVS for cellular DESs, fuzzy-DEVS for fuzzy DESs, dynamic structuring DEVS for DESs changing their coupling structures dynamically, and so on. In addition to its extensions, there are some subclasses such as SP-DEVS and FD-DEVS have been researched for achieving decidability of system properties.
Due to the modular and hierarchical modeling views, as well as its simulation-based analysis capability, the DEVS formalism and its variations have been used in many application of engineering (such as hardware design, hardware/software codesign, communications systems, manufacturing systems) and science (such as biology, and sociology)
Formalism
Intuitive example
DEVS defines system behavior as well as system structure. System behavior in DEVS formalism is described using input and output events as well as states. For example, for the ping-pong player of Fig. 1, the input event is ?receive, and the output event is !send. Each player, A, B, has its states: Send and Wait. Send state takes 0.1 seconds to send back the ball that is the output event !send, while the Wait state lasts until the player receives the ball that is the input event ?receive.
The structure of ping-pong game is to connect two players: player A's output event !send is transmitted to player B's input event ?receive, and vice versa.
In the classic DEVS formalism, atomic DEVS captures the system behavior, while coupled DEVS describes the structure of system.
The following formal definition is for classic DEVS. In this article, we will use the time base, 𝕋=[0,∞) that is the set of non-negative real numbers; the extended time base,𝕋∞=[0,∞] that is the set of non-negative real numbers plus infinity.
Event segment
A segment of a system variable in computing shows a homogenous status of system dynamics over a time period. Here, a homogenous status of a variable is a state which can be described by a set of coefficients of a formula. For example, of homogenous statuses, we can bring status of constant ('ON' of a switch) and linear (60 miles or 96 km per hour for speed). Mathematically, a segment is a function mapping from a set of times which can be defined by a real interval, to the set Z [Zeigler76], [ZPK00], [Hwang13]. A trajectory of a system variable is a sequence of segments concatenated. We call a trajectory constant (respectively linear) if its concatenating segments are constant (respectively linear).
An event segment is a special class of the constant segment with a constraint in which the constant segment is either one of a timed event or a null-segment. The event segments are used to define timed event systems such as DEVS, timed automata, and timed Petri nets.
The time base of the concerning systems is denoted by 𝕋, and definedas the set of non-negative real numbers.
An event is a label that abstracts a change. Given an event set Z, the null event denoted by ϵ∉Z stands for nothing change.
A timed event is a pair (t,z) where t∈𝕋 and z∈Z denotes that an event z∈Z occurs at time t∈𝕋.
The null segment over time interval [tl,tu]⊂𝕋 is denoted by ϵ[tl,tu] which means nothing in Z occurs over [tl,tu].
A unit event segment is either a null event segment or a timed event.
Given an event set Z, concatenation of two unit event segments ω over [t1,t2] and ω′ over [t3,t4] is denoted by ωω′ whose time interval is [t1,t4], and implies t2=t3.
An event trajectory (t1,z1)(t2,z2)⋯(tn,zn) over an event set Z and a time interval [tl,tu]⊂𝕋 is concatenation of unit event segments ϵ[tl,t1],(t1,z1),ϵ[t1,t2],(t2,z2),…,(tn,zn), and ϵ[tn,tu] where tl≤t1≤t2≤⋯≤tn−1≤tn≤tu.
Atomic DEVS
An atomic DEVS model is defined as a 7-tuple where
X is the set of input events;
Y is the set of output events;
S is the set of sequential states (or also called the set of partial states);
s0∈S is the initial state;
ta:S→𝕋∞ is the time advance function which is used to determine the lifespan of a state;
δext:Q×X→S is the external transition function which defines how an input event changes a state of the system, where Q={(s,te)|s∈S,te∈(𝕋∩[0,ta(s)])} is the set of total states, and te is the elapsed time since the last event;
δint:S→S is the internal transition function which defines how a state of the system changes internally (when the elapsed time reaches to the lifetime of the state);
λ:S→Yϕ is the output function where Yϕ=Y∪{ϕ} and ϕ∉Y is a silent event or an unobserved event. This function defines how a state of the system generates an output event (when the elapsed time reaches to the lifetime of the state);
The atomic DEVS model for ping-pong players
The atomic DEVS model for player A of Fig. 1 is given player=<X,Y,S,s0,ta,δext,δint,λ> such thatX={?𝑟𝑒𝑐𝑒𝑖𝑣𝑒}Y={!𝑠𝑒𝑛𝑑}S={(d,σ)|d∈{𝑊𝑎𝑖𝑡,𝑆𝑒𝑛𝑑},σ∈𝕋∞}s0=(𝑆𝑒𝑛𝑑,0.1)ta(s)=σ for all s∈Sδext(((𝑊𝑎𝑖𝑡,σ),te),?𝑟𝑒𝑐𝑒𝑖𝑣𝑒)=(𝑆𝑒𝑛𝑑,0.1)δint(𝑆𝑒𝑛𝑑,σ)=(𝑊𝑎𝑖𝑡,∞)δint(𝑊𝑎𝑖𝑡,σ)=(𝑆𝑒𝑛𝑑,0.1)λ(𝑆𝑒𝑛𝑑,σ)=!𝑠𝑒𝑛𝑑λ(𝑊𝑎𝑖𝑡,σ)=ϕBoth player A and player B are atomic DEVS models.
Simply speaking, there are two cases that an atomic DEVS model M can change its state s∈S: (1) when an external input x∈X comes into the system M; (2) when the elapsed time te reaches the lifespan of s which is defined by ta(s). At the same time of (2), M generates an output y∈Y which is defined by λ(s).
Coupled DEVS
The coupled DEVS defines which sub-components belong to it and how they are connected with each other. A coupled DEVS model is defined as an 8-tuplewhere
X is the set of input events;
Y is the set of output events;
D is the name set of sub-components;
{Mi} is the set of sub-components where for each i∈D,Mi can be either an atomic DEVS model or a coupled DEVS model.
Cxx⊆X×⋃i∈DXi is the set of external input couplings;
Cyx⊆⋃i∈DYi×⋃i∈DXi is the set of internal couplings;
Cyy:⋃i∈DYi→Yϕ is the external output coupling function;
Select:2D→D is the tie-breaking function which defines how to select the event from the set of simultaneous events;
The coupled DEVS model for ping-pong game
The ping-pong game of Fig. 1 can be modeled as a coupled DEVS model N=<X,Y,D,{Mi},Cxx,Cyx,Cyy,Select> where X={};Y={};D={A,B}; MA and MB is described as above; Cxx={}; Cyx={(A.!send,B.?receive),(B.!send,A.?receive)}; and Cyy(A.!send)=ϕ,Cyy(B.!send)=ϕ.
Simply speaking, like the behavior of the atomic DEVS class, a coupled DEVS model N changes its components' states (1) when an external event x∈X comes into N; (2) when one of components Mi where i∈D executes its internal state transition and generates its output yi∈Yi. In both cases (1) and (2), a triggering event is transmitted to all influences which are defined by coupling sets Cxx,Cyx, and Cyy.
For formal definition of behavior of the coupled DEVS, you can refer to the section about behavior of coupled DEVS. Computer algorithms to implement the behavior of a given coupled DEVS mode are available at the section about simulation algorithms for coupled DEVS.
Analysis methods
Simulation for discrete event systems
The simulation algorithm of DEVS models considers two issues: time synchronization and message propagation. Time synchronization of DEVS is to control all models to have the identical current time. However, for an efficient execution, the algorithm makes the current time jump to the most urgent time when an event is scheduled to execute its internal state transition as well as its output generation. Message propagation is to transmit a triggering message which can be either an input or output event along the associated couplings which are defined in a coupled DEVS model. For more detailed information, the reader can refer to simulation algorithms for atomic DEVS and simulation algorithms for coupled DEVS.
Simulation for continuous state systems
By introducing a quantization method which abstracts a continuous segment as a piecewise const segment, DEVS can simulate behaviors of continuous state systems which are described by networks of differential algebraic equations. This research has been initiated by Zeigler in 1990s. Many properties have been clarified by Prof. Kofman in 2000s and Dr. Nutaro. In 2006, Prof. Cellier who is the author of Continuous System Modeling, and Prof. Kofman wrote a text book, Continuous System Simulation, in which chapters 11 and 12 cover how DEVS simulates continuous state systems. Dr. Nutaro's book, covers the discrete event simulation of continuous state systems too.
The quantized state systems (QSS) methods are a family of numerical integration solvers based on the idea of state quantization, dual to the traditional idea of time discretization.
Unlike traditional numerical solution methods, which approach the problem by discretizing time and solving for the next (real-valued) state at each successive time step, QSS methods keep time as a continuous entity and instead quantize the system's state, instead solving for the time at which the state deviates from its quantized value by a quantum.
They can also have many advantages compared to classical algorithms.
They inherently allow for modeling discontinuities in the system due to their discrete-event nature and asynchronous nature. They also allow for explicit root-finding and detection of zero-crossing using explicit algorithms, avoiding the need for iteration---a fact which is especially important in the case of stiff systems, where traditional time-stepping methods require a heavy computational penalty due to the requirement to implicitly solve for the next system state. Finally, QSS methods satisfy remarkable global stability and error bounds, described below, which are not satisfied by classical solution techniques.
In 2001, Ernesto Kofman proved a remarkable property of the quantized-state system simulation method: namely, that when the technique is used to solve a stable linear time-invariant (LTI) system, the global error is bounded by a constant that is proportional to the quantum, but (crucially) independent of the duration of the simulation. More specifically, for a stable multidimensional LTI system with the state-transition matrix A and input matrix B, it was shown that the absolute error vector e→(t) is bounded above by:
Verification for discrete event systems
As an alternative analysis method against the sampling-based simulation method, an exhaustive generating behavior approach, generally called verification has been applied for analysis of DEVS models. It is proven that infinite states of a given DEVS model (especially a coupled DEVS model) can be abstracted by behaviorally isomorphic finite structure, called a reachability graph when the given DEVS model is a sub-class of DEVS such as schedule-preserving DEVS (SP-DEVS), finite & deterministic DEVS (FD-DEVS), and finite & real-time DEVS (FRT-DEVS). As a result, based on the reachability graph, (1) dead-lock and live-lock freeness as qualitative properties are decidable with SP-DEVS, FD-DEVS, and FRT-DEVS; and (2) min/max processing time bounds as a quantitative property are decidable with SP-DEVS so far by 2012.
Timed event system
The general system has been described by Zeigler with the standpoints to define (1) the time base, (2) the admissible input segments, (3) the system states, (4) the state trajectory with an admissible input segment, (5) the output for a given state. A timed event system defining the state trajectory associated with the current and event segments came from the class of general system to allows non-deterministic behaviors in it. Since the behaviors of DEVS can be described by timed event system, DEVS and RTDEVS is a sub-class or an equivalent class of timed event system.
A timed event system is a structurewhere
Z is the set of events;
Q is the set of states;
Q0⊆Q is the set of initial states;
QA⊆Q is the set of accepting states;
Δ⊆Q×ΩZ,[tl,tu]×Q is the set of state trajectories in which (q,ω,q′)∈Δ indicates that a state q∈Q can change into q′∈Q along with an event segment ω∈ΩZ,[tl,tu]. If two state trajectories (q1,ω1,q2) and (q3,ω2,q4)∈Δ are called contiguous if q2=q3, and two event trajectories ω1 and ω2 are contiguous. Two contiguous state trajectories (q,ω1,p) and (p,ω2,q′)∈Δ implies (q,ω1ω2,q′)∈Δ.
Given a timed event system 𝒢=<Z,Q,Q0,QA,Δ>, the set of its behaviors is called its language depending on the observation time length. Let t be the observation time length. If 0≤t<∞, t-length observation language of 𝒢 is denoted by L(𝒢,t), and defined asWe call an event segment ω∈ΩZ,[0,t] a t-length behavior of 𝒢, if ω∈L(𝒢,t).
By sending the observation time length t to infinity, we define infinite length observation language of 𝒢 is denoted by L(𝒢,∞), and defined asWe call an event segment ω∈limt→∞ΩZ,[0,t] an infinite-length behavior of 𝒢, if ω∈L(𝒢,∞) ω∈L(𝒢,∞).
Variations of DEVS
Extensions (superclassing)
Numerous extensions of the classic DEVS formalism have been developed in the last decades. Among them formalisms which allow to have changing model structures while the simulation time evolves.
G-DEVS, parallel DEVS, dynamic structuring DEVS, cell-DEVS, dynDEVS, fuzzy-DEVS, GK-DEVS, ml-DEVS, symbolic DEVS, real-time DEVS, rho-DEVS
Restrictions (subclassing)
There are some sub-classes known as schedule-preserving DEVS (SP-DEVS) and finite and deterministic DEVS (FD-DEVS) which were designated to support verification analysis. SP-DEVS and FD-DEVS whose expressiveness are E(SP-DEVS) ⊂ E(FD-DEVS)⊂ E(DEVS) where E(formalism) denotes the expressiveness of formalism.
Behavior
Atomic DEVS
The behavior of a given DEVS model is a set of sequences of timed events including null events, called event segments, which make the model move from one state to another within a set of legal states. To define it this way, the concept of a set of illegal state as well a set of legal states needs to be introduced.
In addition, since the behavior of a given DEVS model needs to define how the state transition change both when time is passed by and when an event occurs, it has been described by a much general formalism, called general system. In this article, we use a sub-class of general system formalism, called timed event system instead.
Depending on how the total state and the external state transition function of a DEVS model are defined, there are two ways to define the behavior of a DEVS model using timed event system. Since the behavior of a coupled DEVS model is defined as an atomic DEVS model, the behavior of coupled DEVS class is also defined by timed event system.
Suppose that a DEVS model, ℳ=<X,Y,S,s0,ta,δext,δint,λ> has
the external state transition δext:Q×X→S.
the total state set Q={(s,te)|s∈S,te∈(𝕋∩[0,ta(s)])} where te denotes elapsed time since last event and 𝕋=[0,∞) denotes the set of non-negative real numbers, and
Then the DEVS model, ℳ is a timed event system 𝒢=<Z,Q,Q0,QA,Δ> where
The event set Z=X∪Yϕ.
The state set Q=QA∪QN where QN={s¯∉S}.
The set of initial states Q0={(s0,0)}.
The set of accepting states QA=ℳ.Q.
The set of state trajectories Δ⊆Q×ΩZ,[tl,tu]×Q is defined for two different cases: q∈QN and q∈QA. For a non-accepting state q∈QN, there is no change together with any even segment ω∈ΩZ,[tl,tu] so (q,ω,q)∈Δ.
Coupled DEVS
DEVS is closed under coupling. In other words, given a coupled DEVS model N, its behavior is described as an atomic DEVS model M. For a given coupled DEVS N, once we have an equivalent atomic DEVS M, behavior of M can be referred to behavior of atomic DEVS which is based on timed event system.
Similar to behavior of atomic DEVS, behavior of the coupled DEVS class is described depending on definition of the total state set and its handling as follows.
Given a coupled DEVS model N=<X,Y,D,{Mi},Cxx,Cyx,Cyy,Select>, its behavior is described as an atomic DEVS model M=<X,Y,S,s0,ta,δext,δint,λ>
where
X and Y are the input event set and the output event set, respectively.
S=×i∈DQi is the partial state set where Qi={(si,tei)|si∈Si,tei∈(𝕋∩[0,tai(si)])} is the total state set of component i∈D (Refer to view1 of behavior of DEVS), where 𝕋=[0,∞) is the set of non-negative real numbers.
s0=×i∈Dq0i is the initial state set where q0i=(s0i,0) is the total initial state of component i∈D.
ta:S→𝕋∞ is the time advance function, where 𝕋∞=[0,∞] is the set of non-negative real numbers plus infinity. Given s=(…,(si,tei),…),
δext:Q×X→S is the external state function. Given a total state q=(s,te) where s=(…,(si,tei),…),te∈(𝕋∩[0,ta(s)]), and input event x∈X, the next state is given by
whereGiven the partial state s=(…,(si,tei),…)∈S, let IMM(s)={i∈D|tai(si)=ta(s)} denote the set of imminent components. The firing component i∗∈D which triggers the internal state transition and an output event is determined by
δint:S→S is the internal state function. Given a partial state s=(…,(si,tei),…), the next state is given by
Simulation algorithms
Atomic DEVS
Given an atomic DEVS model, simulation algorithms are methods to generate the model's legal behaviors which are trajectories not to reach to illegal states. (see Behavior of DEVS). Zeigler originally introduced the algorithms that handle time variables related to lifespan ts∈[0,∞] and elapsed time te∈[0,∞) by introducing two other time variables, last event time, tl∈[0,∞), and next event time tn∈[0,∞] with the following relations:andwhere t∈[0,∞) denotes the current time. And the remaining time,is equivalently computed as, apparently tr∈[0,∞].
Since the behavior of a given atomic DEVS model can be defined in two different views depending on the total state and the external transition function (refer to behavior of DEVS section), the simulation algorithms are also introduced in two different views as below.
Regardless of two different views of total states, algorithms for initialization and internal transition cases are commonly defined as below.
DEVS-simulator
variables:
parent // parent coordinator
tl // time of last event
tn // time of next event
A=(X,Y,S,ta,δext,δint,λ)// the associated Atomic DEVS model
when receive init-message(Time t)
tl←t;
tn←tl+ta(s);
when receive star-message(Time t)
if t≠tn then
error: bad synchronization;
y←λ(s);
send y-message(y,t) to parent;
Coupled DEVS
Given a coupled DEVS model, simulation algorithms are methods to generate the model's legal behaviors, which are a set of trajectories not to reach illegal states. (see behavior of a coupled DEVS model.) Zeigler originally introduced the algorithms that handle time variables related to lifespan ts∈[0,∞] and elapsed time te∈[0,∞) by introducing two other time variables, last event time, tl∈[0,∞), and next event time tn∈[0,∞] with the following relations:andwhere t∈[0,∞) denotes the current time. And the remaining time,is equivalently computed asapparently tr∈[0,∞]. Based on these relationships, the algorithms to simulate the behavior of a given coupled DEVS are written as follows.
algorithm DEVS-coordinator
Variables:
parent // parent coordinator
tl: // time of last event
tn: // time of next event
N=(X,Y,D,{Mi},Cxx,Cyx,Cyy,Select) // the associated coupled DEVS model
when receive init-message(Time t)
for each i∈D do
send init-message(t) to child i
tl←max{tli:i∈D};
tn←min{tni:i∈D};
when receive star-message(Time t)
if t≠tn then
error: bad synchronization;
i∗←Select({i∈D:tni=tn});
send star-message(t)to i∗
tl←max{tli:i∈D};
tn←min{tni:i∈D};
FD-DEVS
FD-DEVS (finite & deterministic discrete event system specification) is a formalism for modeling and analyzing discrete event dynamic systems in both simulation and verification ways. FD-DEVS also provides modular and hierarchical modeling features which have been inherited from Classic DEVS.
History
FD-DEVS was originally named as schedule-controllable DEVS and designed to support verification analysis of its networks which had been an open problem of DEVS formalism for 30 years. In addition, it was also designated to resolve the so-called "OPNA" problem of SP-DEVS. From the viewpoint of classic DEVS, FD-DEVS has three restrictions
finiteness of event sets and state set,
the lifespan of a state can be scheduled by a rational number or infinity, and
the internal schedule can be either preserved or updated by an input event.
The third restriction can be also seen as a relaxation from SP-DEVS where the schedule is always preserved by any input events. Due to this relaxation there is no longer OPNA problem, but there is also one limitation that a time-line abstraction which can be used for abstracting elapsed times of SP-DEVS networks is no longer useful for FD-DEVS network. But another time abstraction method which was invented by Prof. D. Dill can be applicable to obtain a finite-vertex reachability graph for FD-DEVS networks.
Examples
Consider a single ping-pong match in which there are two players. Each player can be modeled by FD-DEVS such that the player model has an input event ?receive and an output event !send, and it has two states: Send and Wait. Once the player gets into "Send", it will generates "!send" and go back to "Wait" after the sending time which is 0.1 time unit. When staying at "Wait" and if it gets "?receive", it changes into "Send" again. In other words, the player model stays at "Wait" forever unless it gets "?receive".
To make a complete ping-pong match, one player starts as an offender whose initial state is "Send" and the other starts as a defender whose initial state is "Wait". Thus in Fig. 1. player A is the initial offender and player B is the initial defender. In addition, to make the game continue, each player's "?send" event should be coupled to the other player's "?receive" as shown in Fig. 1.
Consider a toaster in which there are two slots that have their own start knobs as shown in Fig. 2(a). Each slot has the identical functionality except their toasting time. Initially, the knob is not pushed, but if one pushes the knob, the associated slot starts toasting for its toasting time: 20 seconds for the left slot, 40 seconds for the right slot. After the toasting time, each slot and its knobs pop up. Notice that even though one tries to push a knob when its associated slot is toasting, nothing happens.
One can model it with FD-DEVS as shown in Fig. 2(b). Two slots are modeled as atomic FD-DEVS whose input event is "?push" and output event is "!pop", states are "Idle" (I) and "Toast" (T) with the initial state is "idle". When it is "Idle" and receives "?push" (because one pushes the knob), its state changes to "Toast". In other words, it stays at "Idle" forever unless it receives "?push" event. 20 (res. 40) seconds later the left (res. right) slot returns to "Idle".
Atomic FD-DEVS
M=<X,Y,S,s0,τ,δx,δy>
where
X is a finite set of input events;
Y is a finite set of output events;
S is a finite set of states;
s0∈S is the initial state;
τ:S→ℚ[0,∞] is the time advance function which defines the lifespan of a state where ℚ[0,∞] is the set of non-negative rational numbers plus infinity.
δx:S×X→S×{0,1} is the external transition function which defines how an input event changes the schedule as well as a state of the system. The internal schedule of a state s∈S is updated by τ(s′) if δx(s)=(s′,1), otherwise(i.e., δx(s)=(s′,0)), the schedule is preserved.
δy:S→Yϕ×S is the output and internal transition function where Yϕ=Y∪{ϕ} and ϕ∉Y denotes the silent event. The output and internal transition function defines how a state generates an output event, at the same time, how the state changes internally.
Formal representation of ping-pong player
The formal representation of the player in the ping-pong example shown in Fig. 1 can be given as follows. M=<X,Y,S,s0,τ,δx,δy> where X={?receive}; Y={!send}; S={Send, Wait}; s0=Send for player A, Wait for player B; τ(Send)=0.1,τ(Wait)=∞; δx(Wait,?receive)=(Send,1), δx(Send,?receive)=(Send,0); δy(Send)=(!send, Wait), δy(Wait)=(ϕ, Wait).
Formal representation of one slot toaster
The formal representation of the slot of Two-slot Toaster Fig. 2(a) and (b) can be given as follows. M=<X,Y,S,s0,τ,δx,δy> where X={?push}; Y={!pop}; S={I, T}; s0=I; τ(T)=20 for the left slot, 40 for the right slot, τ(I)=∞; δx(I, ?push)=(T,1), δx(T,?push)=(T,0); δy(T)=(!pop, I), δy(I)=(ϕ, I).
Advantages
The property of non-negative rational-valued lifespans which can be preserved or changed by input events along with finite numbers of states and events guarantees that the behavior of FD-DEVS networks can be abstracted as an equivalent finite-vertex reachability graph by abstracting the infinitely-many values of the elapsed times using the time abstracting technique introduced by Prof. D. Dill. An algorithm generating a finite-vertex reachability graph (RG) has been introduced by Zeigler.
Fig. 5. shows the reachability graph of two-slot toaster which was shown in Fig. 2. In the reachability graph, each vertex has its own discrete state and time zone which are ranges of te1,te2 and te1−te2. For example, for node (6) of Fig. 5, discrete state information is ((E,∞),(T,40)), and time zone is 0≤te1≤40,0≤te2≤40,−20≤te1−t21≤0. Each directed arch shows how its source vertex changes into the destination vertex along with an associated event and a set of reset models. For example, the transition arc (6) to (5) is triggered by push1 event. At that time, the set {1} of the arc denotes that elapsed time of 1 (that is te1 is reset by 0 when transition (6) to (5) occurs.
As a qualitative property, safety of a FD-DEVS network is decidable by (1) generating RG of the given network and (2) checking whether some bad states are reachable or not.
As a qualitative property, liveness of a FD-DEVS network is decidable by (1) generating RG of the given network, (2) from RG, generating kernel directed acyclic graph (KDAG) in which a vertex is strongly connected component, and (3) checking if a vertex of KDAG contains a state transition cycle which contains a set of liveness states.
Disadvantages
The features that all characteristic functions,τ,δx,δy of FD-DEVS are deterministic can be seen as somehow a limitation to model the system that has non-deterministic behaviors. For example, if a player of the ping-pong game shown in Fig. 1. has a stochastic lifespan at "Send" state, FD-DEVS doesn't capture the non-determinism effectively.
Tool
There are two open source libraries DEVS# written in C# and XSY written in Python that support some reachability graph-based verification algorithms for finding safeness and liveness.
For standardization of DEVS, especially using FDDEVS, Dr. Saurabh Mittal together with co-workers has worked on defining of XML format of FDDEVS. This standard XML format was used for UML execution.
SP-DEVS
SP-DEVS (schedule-preserving discrete event system specification) is a formalism for modeling and analyzing discrete event systems in both simulation and verification ways. SP-DEVS also provides modular and hierarchical modeling features which have been inherited from the classic DEVS.
History
SP-DEVS has been designed to support verification analysis of its networks by guaranteeing to obtain a finite-vertex reachability graph of the original networks, which had been an open problem of DEVS formalism for roughly 30 years. To get such a reachability graph of its networks, SP-DEVS has been imposed the three restrictions:
finiteness of event sets and state set,
the lifespan of a state can be scheduled by a rational number or infinity, and
preserving the internal schedule from any external events.
Thus, SP-DEVS is a sub-class of both DEVS and FD-DEVS. These three restrictions lead that SP-DEVS class is closed under coupling even though the number of states are finite. This property enables a finite-vertex graph-based verification for some qualitative properties and quantitative property, even with SP-DEVS coupled models.
Crosswalk controller example
System requirements
Consider a crosswalk system. Since a red light (resp. don't-walk light) behaves the opposite way of a green light (resp. walk light), for simplicity, we consider just two lights: a green light (G) and a walk light (W); and one push button as shown in Fig. 1. We want to control two lights of G and W with a set of timing constraints.
To initialize two lights, it takes 0.5 seconds to turn G on and 0.5 seconds later, W gets off. Then, every 30 seconds, there is a chance that G becomes off and W on if someone pushed the push button. For a safety reason, W becomes on two seconds after G got off. 26 seconds later, W gets off and then two seconds later G gets back on. These behaviors repeats.
Controller Design
To build a controller for above requirements, we can consider one input event 'push-button' (abbreviated by ?p) and four output events 'green-on' (!g:1), 'green-off' (!g:0), 'walk-on' (!w:1) and 'walk-off (!w:0) which will be used as commands signals for the green light and the walk light. As a set of states of the controller, we considers 'booting-green' (BG), 'booting-walk' (BW), 'green-on' (G), 'green-to-red' (GR), 'red-on' (R), 'walk-on' (W), 'delay' (D). Let's design the state transitions as shown in Fig. 2. Initially, the controller starts at BG whose lifespan is 0.5 seconds. After the lifespan, it moves to BW state at this moment, it generates the 'green-on' event, too. After 0.5 seconds staying at BW, it moves to G state whose lifespan is 30 seconds. The controller can keep staying at G by looping G to G without generating any output event or can move to GR state when it receives the external input event ?p. But, the actual staying time at GR is the remaining time for looping at G. From GR, it moves to R state with generating an output event !g:0 and its R state last two seconds then it will move to W state with output event !w:1. 26 seconds later, it moves to D state with generating !w:0 and after staying 2 seconds at D, it moves back to G with output event !g:1.
Atomic SP-DEVS
The above controller for crosswalk lights can be modeled by an atomic SP-DEVS model. Formally, an atomic SP-DEVS is a 7-tuple M=<X,Y,S,s0,τ,δx,δy>
where
X is a finite set of input events;
Y is a finite set of output events;
S is a finite set of states;
s0∈S is the initial state;
τ:S→ℚ[0,∞] is the time advanced function which defines the lifespan of a state where ℚ[0,∞] is the set of non-negative rational numbers plus infinity.
δx:S×X→S is the external transition function which defines how an input event changes a state of the system.
δy:S→Yϕ×S is the output and internal transition function where Yϕ=Y∪{ϕ} and ϕ∉Y denotes the silent event. The output and internal transition function defines how a state generates an output event, at the same time, how the state changes internally.
Formal representation of crosswalk controller
The above controller shown in Fig. 2 can be written as M=<X,Y,S,s0,τ,δx,δy> where X={?p}; Y={!g:0, !g:1, !w:0, !w:1}; S={BG, BW, G, GR, R, W, D}; s0=BG, τ(BG)=0.5,τ(BW)=0.5, τ(G)=30, τ(GR)=30,τ(R)=2, τ(W)=26, τ(D)=2; δx(G,?p)=GR, δx(s,?p)=s if s ≠G; δy(BG)=(!g:1, BW), δy(BW)=(!w:0, G),δy(G)=(ϕ, G), δy(GR)=(!g:0, R), δy(R)=(!w:1, W), δy(W)=(!w:0, D), δy(D)=(!g:1, G);
To captured the dynamics of an atomic SP-DEVS, we need to introduce two variables associated to time. One is the lifespan, the other is the elapsed time since the last resetting. Let ts∈ℚ[0,∞] be the lifespan which is not continuously increasing but set by when a discrete event happens. Let te∈[0,∞] denote the elapsed time which is continuously increasing over time if there is no resetting.
Advantages
Applicability of time-line abstraction
The property of non-negative rational-valued lifespans which are not changed by input events along with finite numbers of states and events guarantees that the behavior of SP-DEVS networks can be abstracted as an equivalent finite-vertex reachability graph by abstracting the infinitely-many values of the elapsed times.
To abstract the infinitely-many cases of elapsed times for each components of SP-DEVS networks, a time-abstraction method, called the time-line abstraction has been introduced in which the orders and relative difference of schedules are preserved. By using the time-line abstraction technique, the behavior of any SP-DEVS network can be abstracted as a reachability graph whose numbers of vertices and edges are finite.
Decidability of safety
As a qualitative property, safety of a SP-DEVS network is decidable by (1) generating the finite-vertex reachability graph of the given network and (2) checking whether some bad states are reachable or not.
Decidability of liveness
As a qualitative property, liveness of a SP-DEVS network is decidable by (1) generating the finite-vertex reachability graph (RG) of the given network, (2) from RG, generating kernel directed acyclic graph (KDAG) in which a vertex is strongly connected component, and (3) checking if a vertex of KDAG contains a state transition cycle which contains a set of liveness states.
Decidability of min/max processing time bounds
As a quantitative property, minimum and maximum processing time bounds from two events in SP-DEVS networks can be computed by (1) generating the finite-vertex reachability graph and (2.a) by finding the shortest paths for the minimum processing time bound and (2.b) by finding the longest paths (if available) for the maximum processing time bound.
Disadvantages
Less expressiveness: OPNA problem
Let a total state (s,ts,te) of a SP-DEVS model be passive if ts=∞; otherwise, it be active.
One of known SP-DEVS's limitation is a phenomenon that "once an SP-DEVS model becomes passive, it never returns to become active (OPNA)". This phenomenon was found first by Hwang, although it was originally called ODNR ("once it dies, it never returns"). The reason why this one happens is because of the restriction (3) above in which no input event can change the schedule so the passive state can not be awaken into the active state.
For example, the toaster models drawn in Fig. 3(b) are not SP-DEVS because the total state associated with "idle" (I), is passive but it moves to an active state, "toast" (T) whose toasting time is 20 seconds or 40 seconds. Actually, the model shown in Fig. 3(b) is FD-DEVS.
Tools
There is an open source library, called DEVS# that supports some algorithms for finding safeness and liveness as well as min/max processing time bounds.



