Franck Cassez
email: franck.cassez@irccyn.ec-nantes.fr

Olivier-H Roux
email: olivier-h.roux@irccyn.ec-nantes.fr

From Time Petri Nets to Timed Automata

Keywords: Time Petri Nets, Timed Automata, Model-Checking, Temporal logics

In this paper, we consider Time Petri Nets (TPN) where time is associated with transitions. We give a formal semantics for TPNs in terms of Timed Transition Systems. Then, we propose a translation from TPNs to Timed Automata (TA) that preserves the behavioural semantics (timed bisimilarity) of the TPNs. For the theory of TPNs this result is two-fold: i) reachability problems and more generally TCTL model-checking are decidable for bounded TPNs; ii) allowing strict time constraints on transitions for TPNs preserves the results described in i). The practical applications of the translation are: i) one can specify a system using both TPNs and Timed Automata and a precise semantics is given to the composition; ii) one can use existing tools for analysing timed automata (like KRONOS or UPPAAL or CMC) to analyse TPNs.

Introduction

Classes of Petri Nets with Time.

The two main extensions of Petri Nets with time are Time Petri Nets (TPNs) [START_REF] Merlin | A study of the recoverability of computing systems[END_REF] and Timed Petri Nets [START_REF] Ramchandani | Analysis of asynchronous concurrent systems by timed Petri nets[END_REF]. For TPNs a transition can fire within a time interval whereas for Timed Petri Nets it fires as soon as possible. Among Timed Petri Nets, time can be considered relative to places or transitions [START_REF] Sifakis | Performance Evaluation of Systems using Nets[END_REF][START_REF] Pezzé | Time Petri Nets: A Primer Introduction[END_REF]. The two corresponding subclasses namely P-Timed Petri Nets and T-Timed Petri Nets are expressively equivalent [START_REF] Sifakis | Performance Evaluation of Systems using Nets[END_REF][START_REF] Pezzé | Time Petri Nets: A Primer Introduction[END_REF]. The same classes are defined for TPNs i.e. T-TPNs and P-TPNs, but both classes of Timed Reachability for Time Petri Nets.

As for TA, the behavior of a TPN can be defined by timed firing sequences which are sequences of pairs (t, d) where t is a transition of the TPN and d ∈ R ≥0 . Then a sequence of transitions ω = (t 1 , d 1 )(t 2 , d 2 ) • • • (t n , d n ) indicates that t 1 is fired after d 1 time units, then t 2 is fired after d 2 time units, and so on, so that transition t i is fired at absolute time i k=1 d k . A marking M is reachable in a TPN iff there is a timed firing sequence ω leading from the initial marking M 0 to M. It is common for TA to define the untimed sequence from the timed one: if ω = (t 1 , d 1 )(t 2 , d 2 )

• • • (t n , d n ) then Untimed(ω) = t 1 t 2 • • • t n .
Reachability analysis of TPNs relies on the construction of the so-called States Classes Graph (SCG) that was introduced in [START_REF] Berthomieu | An enumerative approach for analyzing time Petri nets[END_REF] and later refined in [START_REF] Berthomieu | Modeling and verification of time dependant systems using time petri nets[END_REF]. It has been recently improved in [START_REF] Lilius | Efficient state space search for time petri nets[END_REF] by using partial-order reduction methods.

For bounded TPNs, the SCG construction obviously solves marking reachability. State reachability can be decided using the alternative strong state classes constructions introduced in [START_REF] Berthomieu | State class constructions for branching analysis of time Petri nets[END_REF], and liveness can be decided using the atomic state classes introduced in the same paper. Strong state classes differ from the state classes in that they canonically represent state sets, while the latter represent state sets modulo some equivalence relation. Atomic state classes are obtained by partition refinement of strong state classes, their graph is bisimilar with the state graph of the net (with temporal annotations omitted), so they preserve branching properties (these include CT L properties).

The nodes of the SCG are sets of states (a state is a pair consisting of a marking and a firing constraint) of the TPN and the edges are labeled with transitions' names from T (the set of transitions of the TPN). C 0 is the states class containing the initial marking M 0 . The SCG defined in [START_REF] Berthomieu | Modeling and verification of time dependant systems using time petri nets[END_REF] has the following property: there is a path C 0 σ -→ C in the SCG with σ ∈ T * iff there is a timed path ω ∈ (T × R ≥0 ) * s.t. M 0 ω -→ M with M ∈ C and Untimed(ω) = σ. This can be rephrased in terms of language acceptance for TA, assuming all markings are final states. If L ⊆ T * is the language accepted by the SCG and L ′ is the timed language accepted by the TPN, then L = Untimed(L ′ ). Henceforth the SCG can only be used to check untimed reachability properties3 but is not accurate enough for checking quantitative real-time properties e.g. "it is not possible to stay in marking M more than n time units" or "from marking M marking M ′ is always reached within n time units".

Timed Automata.

Timed Automata (TA) were introduced by Alur & Dill [START_REF] Alur | A theory of timed automata[END_REF] and have since been extensively studied [START_REF] Fix | A determinizable class of timed automata[END_REF][START_REF] Kim | Model-Checking for Real-Time Systems[END_REF][START_REF] Alur | Event-clock automata: A determinizable class of timed automata[END_REF][START_REF] Bouyer | Are timed automata updatable ?[END_REF]. This model is an extension of finite automata with (dense time) clocks and enables one to specify real-time systems. It has been shown that model-checking for TCTL properties is decidable [START_REF] Alur | Model-checking in dense real-time[END_REF][START_REF] Henzinger | Symbolic model checking for real-time systems[END_REF] for TA and some extensions of TA [START_REF] Bouyer | Are timed automata updatable ?[END_REF]. There also exist several efficient tools like UPPAAL [START_REF] Larsen | UPPAAL in a Nutshell[END_REF][START_REF] Pettersson | Uppaal2k[END_REF], KRONOS [START_REF] Yovine | Kronos: A Verification Tool for real-Time Systems[END_REF] and CMC [START_REF] Laroussinie | CMC: A tool for compositional modelchecking of real-time systems[END_REF] for model-checking TA and many real-time industrial applications have been specified and successfully verified with them [START_REF] Bengtsson | Verification of an audio protocol with bus collision using uppaal[END_REF][START_REF] Maler | Hardware timing verification using KRONOS[END_REF][START_REF] Lindahl | Formal Design and Analysis of a Gear-Box Controller[END_REF].

Related Work.

The relationship between TPNs and TA has not been often investigated. In [START_REF] Sifakis | Compositional specification of timed systems (extended abstract)[END_REF] J. Sifakis and S. Yovine are mainly concerned with composionality problems. They show that for a subclass of 1-safe Time Stream Petri Nets, the usual notion of composition used for TA is not suitable to describe this type of Petri Nets as the composition of TA. Consequently, they propose Timed Automata with Deadlines and flexible notions of compositions. In [START_REF] Bornot | Modeling urgency in timed systems[END_REF] authors consider Petri nets with deadlines (PND) that are 1-safe Petri nets extended with clocks. A PND is a timed automaton with deadlines (TAD) where the discrete transition structure is the corresponding marking graph. The transitions of the marking graph are subject to the same timing constraints as the transitions of the PND. The PND and the TAD have the same number of clocks. They propose a translation of safe TPN into PND with a clock for each input arc of the initial TPN. It defines (by transitivity) a translation of safe TPN into TAD (that can be considered as standard timed automata). Sava [START_REF] Tiberiu | Sur la synthèse de la commande des systèmes à évènements discrets temporisés[END_REF] considers bounded TPN where the associated underlying Petri net is not necessarily safe and proposes an algorithm to compute the region graph of a TPN. The result is a timed automaton with a clock for each transition of the original TPN. This automaton is then restricted for the command by supervision. However, they do not give any result to stop the automaton computation when the TPN is not bounded (which one does not know a priori ) and when it is bounded, they do not prove that the algorithm stop. Lime and Roux [START_REF] Lime | State class timed automaton of a time Petri net[END_REF] propose an extension of the state class graph construction that allows to build the state class graph as a timed automaton. They prove that this timed automaton and the TPN are timed-bisimilar and they also prove a relative minimality of the number of clocks of the obtained automaton. The first two approaches are structural but are limited to Petri nets whose underlying net is 1-safe. The last two approaches rely on the computation of the state space of the TPN and are limited to bounded TPN. In this article, we consider a structural translation from TPN (not necessary bounded) to TA. Our purpose is focussed on the semantics of TPNs, on their relations with TAs and on the verification of temporal properties on Time Petri Nets.

Our Contribution.

First we give a formal semantics for Time Petri Nets [START_REF] Merlin | A study of the recoverability of computing systems[END_REF] in terms of Timed Transition Systems [START_REF] Kim | Model-Checking for Real-Time Systems[END_REF]. Then we present a structural translation of a TPN into a synchronized product of timed automata that preserves the semantics (in the sense of timed bisimilarity) of the TPN. This yields theoretical and practical applications of this translation : i) TCTL [START_REF] Alur | Model-checking in dense real-time[END_REF][START_REF] Henzinger | Symbolic model checking for real-time systems[END_REF] model-checking is decidable for bounded TPNs and TCTL properties can now be checked (efficiently) for TPNs with existing tools for analyzing timed automata (like KRONOS or UPPAAL or CMC) We have developed a tool for translating TPNs to UPPAAL input format; ii) allowing strict time constraints on transitions for TPNs preserves the results described in i); iii) one can specify a system using both TPNs and Timed Automata and a precise semantics is given to the composition; iv) as the translation is structural, one can use unboundedness testing methods to detect behavior leading to the unboundedness of a TPN.

Outline of the paper.

Section 2 introduces the semantics of TPNs in terms of timed transition systems and the basics of TA. In section 3 we show how to build a synchronized product of TA that is equivalent to a TPN. We also prove that the semantics of the TPN and its associated product of TA are timed bisimilar. This enables us to check for real-time properties expressed in TCTL in section 4, where we also address the problem of reducing the number of clocks used in the translation. We present our translator and an example of model-checking with UPPAAL. Finally we conclude with our ongoing work and perspectives in section 5.

Time Petri Nets and Timed Automata

Notations.

We denote B A the set of mappings from A to B. If A is finite and |A| = n, an element of B A is also a vector in B n . The usual operators +, -, <, = used on vectors of A n with A = N, Q, R are the point-wise extensions of their counterparts in A. For a valuation ν ∈ A n , d ∈ A, ν + d denotes the vector (ν + d) i = ν i + d, and for A ′ ⊆ A, ν[A ′ → 0] denotes the valuation ν ′ with ν ′ (x) = 0 for x ∈ A ′ and ν ′ (x) = ν(x) otherwise. We denote C(V ) for the simple constraints over a set of variables V . C(V ) is defined to be the set of boolean combinations (with the connectives {∧, ∨, ¬}) of terms of the form vv ′ ⊲⊳ c or v ⊲⊳ c for v, v ′ ∈ V and c ∈ N and ⊲⊳∈ {<, ≤, =, ≥, >}. For a transition system we write transitions as s a -→ s ′ and sequence of transitions of the form s 0

a 1 -→ s 1 -→ • • • an --→ s n as s 0 w =⇒ s n with w = a 1 a 2 • • • a n .

Time Petri Nets

The model.

Time Petri Nets were introduced in [START_REF] Merlin | A study of the recoverability of computing systems[END_REF] and extend Petri Nets with timing constraints on the firings of transitions.

Definition 2.1 A Time Petri Net T is a tuple (P, T, • (.), (.) • , M 0 , (α, β))
where:

• P = {p 1 , p 2 , • • • , p m } is a finite set of places, • T = {t 1 , t 2 , • • • , t n } is a finite set of transitions, • • (.) ∈ (N P ) T is the backward incidence mapping, • (.) • ∈ (N P ) T is the forward incidence mapping, • M 0 ∈ N P is the initial marking, • α ∈ (Q ≥0 ) T and β ∈ (Q ≥0 ∪ {∞})
T are respectively the earliest and latest firing time mappings. 2

Semantics of Time Petri Nets.

The semantics of TPNs can be given in term of Timed Transition Systems (TTS) [START_REF] Kim | Model-Checking for Real-Time Systems[END_REF] which are usual transition systems with two types of labels: discrete labels for events and positive reals labels for time elapsing.

ν ∈ (R ≥0 ) n is a valuation such that each value ν i is the elapsed time since the last time transition t i was enabled. 0 is the initial valuation with ∀i ∈ [1..n], 0 i = 0. A marking M of a TPN is a mapping in N P and if

M ∈ N P , M(p i ) is the number of tokens in place p i . A transition t is enabled in a marking M iff M ≥ • t. ↑ enabled(t k , M, t i ) ∈ B is true if t k is
enabled by the firing of transition t i from marking M, and false otherwise. This definition of enabledness is based on [START_REF] Berthomieu | Modeling and verification of time dependant systems using time petri nets[END_REF][START_REF]A causal semantics for time petri nets[END_REF] which is the most common one. In this framework, a transition t k is newly enabled after firing t i from marking M if "it is not enabled by M -• t i and is enabled by

M ′ = M -• t i + t i
• " [START_REF] Berthomieu | Modeling and verification of time dependant systems using time petri nets[END_REF]. Formally this gives:

↑ enabled(t k , M, t i ) = M -• t i + t i • ≥ • t k ∧ (M -• t i < • t k ) ∨ (t k = t i ) (1) Definition 2.2
The semantics of a TPN T is a timed transition system S T = (Q, q 0 , →) where:

• Q = N P × (R ≥0 ) n ,
• q 0 = (M 0 , 0),

• -→∈ Q × (T ∪ R ≥0 ) × Q consists of
the discrete and continuous transition relations:

• the discrete transition relation is defined ∀t i ∈ T :

(M, ν)

t i -→ (M ′ , ν ′ ) iff            M ≥ • t i ∧ M ′ = M -• t i + t i • α(t i ) ≤ ν i ≤ β(t i ) ν ′ k = 0 if ↑ enabled(t k , M, t i ), ν k otherwise.
• the continuous transition relation is defined ∀d ∈ R ≥0 :

(M, ν)

ǫ(d) --→ (M, ν ′ ) iff ν ′ = ν + d ∀k ∈ [1..n], M ≥ • t k =⇒ ν ′ k ≤ β(t k )
A run of a time Petri net T is a path in S T starting in q 0 . The set of runs of

T is denoted [[T ]]. The set of reachable markings of T is denoted Reach(T ).
If the set Reach(T ) is finite we say that T is bounded. As a shorthand we write (M, ν) -→ d e (M ′ , ν ′ ) for a sequence of time elapsing and discrete steps like (M, ν)

ǫ(d) --→ (M ′′ , ν ′′ ) e -→ (M ′ , ν ′ ). 2
This definition appeals for several comments. Our semantics is based on the common definition of [START_REF] Berthomieu | Modeling and verification of time dependant systems using time petri nets[END_REF][START_REF]A causal semantics for time petri nets[END_REF] for safe TPNs.

First, previous formal semantics [START_REF] Berthomieu | Modeling and verification of time dependant systems using time petri nets[END_REF][START_REF] Lilius | Efficient state space search for time petri nets[END_REF][START_REF] Pezzé | Time Petri Nets: A Primer Introduction[END_REF][START_REF]A causal semantics for time petri nets[END_REF] for TPNs usually require the TPNs to be safe. Our semantics encompasses the whole class of TPNs and is fully consistent with the previous semantics when restricted to safe TPNs4 . Thus, we have given a semantics to multiple enabledness of transitions which seems the most simple and adequate. Indeed, several interpretations can be given to multiple enabledness [START_REF] Berthomieu | Modeling and verification of time dependant systems using time petri nets[END_REF].

Second, some variations can be found in the literature about TPNs concerning the firing of transitions. [START_REF] Pezzé | Time Petri Nets: A Primer Introduction[END_REF] considers two distinct semantics: Weak Time Semantics (WTS) and Strong Time Semantics (STS). According to WTS, a transition can be fired only in its time interval whereas in STS, a transition must fire within its firing interval unless disabled by the firing of others. The most commonly used semantics is STS as in [START_REF] Merlin | A study of the recoverability of computing systems[END_REF][START_REF] Berthomieu | Modeling and verification of time dependant systems using time petri nets[END_REF][START_REF] Pezzé | Time Petri Nets: A Primer Introduction[END_REF][START_REF]A causal semantics for time petri nets[END_REF].

Third, it is possible for the TPN to be zeno or unbounded. In the case it is unbounded, the discrete component of the state space of the timed transition system is infinite. If ∀i, α(t i ) > 0 then the TPN is non-zeno and the requirement that time diverges on each run is fulfilled. Otherwise, if the TPN is bounded and at least one lower bound is 0, the zeno or non-zeno property can be decided [START_REF] Henzinger | Symbolic model checking for real-time systems[END_REF] for the TPN using the equivalent timed automaton we build in section 3.

Timed Automata and Products of Timed Automata

Timed automata [START_REF] Alur | A theory of timed automata[END_REF] are used to model systems which combine discrete and continuous evolutions.

Definition 2.3 [Timed Automaton]

A Timed Automaton H is a 6-tuple (N, l 0 , C, A, E, Inv) where:

• N is a finite set of locations,

• l 0 ∈ N is the initial location,

• C is a finite set of positive real-valued clocks,

• A is a finite set of actions,

• E ⊆ N × C(V ) × A × 2 C × N is a finite set of edges; e = l, γ, a, R, l ′ ∈ E
represents an edge from the location l to the location l ′ with the guard γ, the label a and the reset set R.

• Inv ∈ C(V ) N assigns an invariant to any location. We restrict the invariants to conjuncts of terms of the form c ≤ r for c ∈ C and r ∈ N. 2

The semantics of a timed automaton is also a timed transition system.

Definition 2.4 [Semantics of a Timed Automaton] The semantics of a timed automaton H = (N, l 0 , C, A, E, Act, Inv) is a timed transition system S H = (Q, q 0 , →) with Q = N × (R ≤0 ) C , q 0 = (l 0 , 0) is the initial state and → is defined by:

(l, v) a -→ (l ′ , v ′ ) iff ∃ (l, γ, a, R, l ′ ) ∈ E s.t. γ(v) = tt, v ′ = v[R → 0] and Inv(l ′ )(v ′ ) = tt (l, v) ǫ(t) --→ (l ′ , v ′ ) iff l = l ′ v ′ = v + t and ∀ 0 ≤ t ′ ≤ t, Inv(l)(v + t ′ ) = tt A run of a timed automaton H is a path in S H starting in q 0 . The set of runs of H is denoted [[H]]. 2
Product of Timed Automata.

It is convenient to describe a system as a parallel composition of timed automata. To this end, we use the classical composition notion based on a synchronization function à la Arnold-Nivat [START_REF] Arnold | Finite Transition System[END_REF]. Let H 1 , . . . , H n be n timed automata with

H i = (N i , l i,0 , C i , A, E i , Inv i ). A synchronization function f is a partial function from (A ∪ {•}) n ֒→ A
where • is a special symbol used when an automaton is not involved in a step of the global system. Note that f is a synchronization function with renaming. We denote by (H

1 | . . . |H n ) f the parallel composition of the H i 's w.r.t. f . The configurations of (H 1 | . . . |H n ) f are pairs (l, v) with l = (l 1 , . . . , l n ) ∈ N 1 ×. . .×N n and v = v 1 • • • v n with 5 v i ∈ Cassez & Roux (R ≥0 ) C i (
we assume that all sets C i of clocks are disjoint.) Then the semantics of a synchronized product of timed automata is also a timed transition system: the synchronized product can do a discrete transition if all the components agree to and time can progress in the synchronized product also if all the components agree to. This is formalized by the following definition: Definition 2.5 [Semantics of a Product of Timed Automata] Let H 1 , . . . , H n be n timed automata with H i = (N i , l i,0 , C i , A, E i , Inv i ), and f a (partial) synchronization function (A∪{•}) n ֒→ A. The semantics of (H

1 | . . . |H n ) f is a timed transition system S = (Q, q 0 , →) with Q = N 1 × . . . × N n × (R ≥0 ) C , q 0 is
the initial state ((l 1,0 , . . . , l n,0 ), 0) and → is defined by:

• (l, v) b -→ (l ′ , v ′ ) iff there exists (a 1 , . . . , a n ) ∈ (A∪{•}) n s.t. f (a 1 , . . . , a n ) = b
and for any i we have: . If

a i = •, then l ′ i = l i and v ′ i = v i , . If a i ∈ A, then (l i , v i ) a i -→ (l ′ i , v ′ i ). • (l, v) ǫ(t) --→ (l, v ′ ) iff ∀ i ∈ [1..n], we have (l i , v i ) ǫ(t) --→ (l i , v ′ i ) 2
We could equivalently define the product of n timed automata syntactically, building a new timed automaton [START_REF] Kim | Model-Checking for Real-Time Systems[END_REF] from the n initial ones. In the sequel we consider a product (H 1 | . . . |H n ) f to be a timed automaton the semantics of which is timed bisimilar to the semantics of the product we have given in definition 2.5.

From Time Petri Nets to Timed Automata

In this section, we build a synchronized product of timed automata from a TPN so that the behaviors of the two are in a one-to-one correspondence.

Translating Time Petri Nets into Timed Automata

We start with a time petri net T = (P, T, • (.), (.)

• , M 0 , (α, β)) with P = {p 1 , • • • , p m } and T = {t 1 , • • • , t n }.

Timed Automaton for one Transition.

We define one timed automaton A i for each transition t i of T (see Fig. 1). This timed automaton has one clock x i . Also the states of the automaton A i give the state of the transition t i : in state t the transition is enabled; in state t it is disabled and in Firing it is being fired. The initial state of each A i depends on the initial marking M 0 of the petri net we want to translate. If M 0 ≥ • t i then the initial state is t otherwise it is t. This automaton updates an array of integers p (s.t. p[i] is the number of tokens in place p i ) which is shared by all the A i 's. This is not covered by the definition 2.5 but this one is very often extended ( [START_REF] Larsen | UPPAAL in a Nutshell[END_REF][START_REF] Pettersson | Uppaal2k[END_REF]) with integer variables (this does not affect the expressiveness of the model).

The Supervisor.

The supervisor SU is depicted on Fig. 2. The locations 1 to 3 subscripted with a c are assumed to be urgent or committed 6 which means that no time can elapse while visiting them. The initial state of the supervisor is 0.

Let us define the synchronization function f with n + 1 parameters defined by:

• f (!pre, •, • • • , ?pre, •, • • • ) = pre i if ?
pre is the (i + 1)th argument and all the other arguments are •,

• f (!post, •, • • • , ?post, •, • • • ) = post i if ?post is the (i + 1)
th argument and all the other arguments are •,

• f (!update, ?update, • • • , ?update) = update.

x i ≤ β(t i ) t Firing t α(t i ) ≤ x i ≤ β(t i ) ?pre p := p -• t i p < • t i ?update ?post p := p + t i • p ≥ • t i ?update x i := 0 p ≥ • t i ?update p < • t i ?update ?update

We denote ∆(T ) = (SU

× A 1 × • • •× A n ) f
the timed automaton associated to the TPN T . We will prove in the next subsection that the semantics of ∆(T ) is closely related to the semantics of T . For this we have to relate the states of T to the states of ∆(T ) and we define the following equivalence:

Cassez & Roux Definition 3.1 [States Equivalence] Let (M, ν) and ((s, p), q, v) be respectively a state of S T and a configuration7 of S ∆(T ) . Then (M, ν) ≈ ((s, p), q, v) iff

               s = 0, ∀i ∈ [1..m], p[i] = M(p i ), ∀k ∈ [1..n], q k = t if M ≥ • t k , t otherwise ∀k ∈ [1..n], ν k = v k 2

Soundness of the Translation

We now prove that our translation preserves the behaviors of the initial TPN in the sense that the semantics of the TPN and its translation are timed bisimilar. We assume a TPN T and S T = (Q, q 0 , →) its semantics. Let A i be the automaton associated with transition t i of T as described by Fig. 1, SU the supervisor automaton of Fig. 2 and f the synchronization function defined previously. The semantics of ∆(T ) = (SU

× A 1 × • • • × A n ) f is the TTS S ∆(T ) = (Q ∆(T ) , q ∆(T ) 0 , →).
Theorem 3.2 (Timed Bisimilarity) For all (M, ν) ∈ S T and ((0, p), q, v) ∈ S ∆(T ) such that (M, ν) ≈ ((0, p), q, v) we have:

(M, ν) t i -→ (M ′ , ν ′ ) iff     
((0, p), q, v)

w i =⇒ ((0, p ′ ), q′ , v ′ ) with w i = pre i .update.post i .update and (M ′ , ν ′ ) ≈ ((0, p ′ ), q′ , v ′ ) (2) (M, ν) ǫ(d) --→ (M ′ , ν ′ ) iff ((0, p), q, v) ǫ(d) --→ ((0, p ′ ), q′ , v ′ ) and (M ′ , ν ′ ) ≈ ((0, p ′ ), q′ , v ′ ) (3) 2
Proof. We first prove statement 2. Assume (M, ν) ≈ ((0, p), q, v). Then as t i can be fired from (M, ν) we have:

(i) M ≥ • t i (ii) α(t i ) ≤ ν i ≤ β(t i ) (iii) M ′ = M -• t i + t i • (iv) ν ′ k = 0 if ↑ enabled(t k , M, t i ) and ν ′ k = ν k other- wise.
From (i) and (ii) and the state equivalence we deduce that qi = t and α(t i ) ≤ v i ≤ β(t i ). Hence ?pre is enabled in A i . In state 0 for the supervisor, !pre is the only possible transition. As the synchronization function f allows (!pre, •, • • • , ?pre, • • • , •) the global action pre i is possible. After this move ∆(T ) reaches state ((1, p 1 ), q1 , v 1 ) with q1 k = qk , ∀k = i and q1 i = Firing. Also p 1 = p -• t i and v 1 = v. Now the only possible transition when the supervisor is in state 1 is an update transition where all the A i 's synchronize according to f . From

We can now define TCTL [START_REF] Alur | Model-checking in dense real-time[END_REF][START_REF] Henzinger | Symbolic model checking for real-time systems[END_REF] for TPNs. The only difference with the versions of [START_REF] Alur | Model-checking in dense real-time[END_REF][START_REF] Henzinger | Symbolic model checking for real-time systems[END_REF] is that the atomic propositions usually associated to states are properties of markings. For practical applications with model-checkers we assume that the TPNs we check are bounded. TCTL for TPNs.

TPN-TCTL ::= M ⊲⊳ V | false | t k +c ≤ t j +d | ¬ϕ | ϕ → ψ | ϕ ∃U ⊲⊳c ψ | ϕ ∀U ⊲⊳c ψ
where M and false are keywords, ϕ, ψ ∈ TPN-TCTL,

t k , t j ∈ T , c, d ∈ Z, V ∈ (Q ∪ {∞}) n and 8 ⊲⊳∈ {<, ≤, =, >, ≥}. 2
Intuitively the meaning of M ⊲⊳ V is that the current marking vector is in relation ⊲⊳ with V . The meaning of the other operators is the usual one. We use the usual shorthands true = ¬false, 3 ⊲⊳c φ = true ∃U ⊲⊳c φ and 2 ⊲⊳c = ¬3 ⊲⊳c ¬φ.

The semantics of TPN-TCTL is defined on timed transition systems. Let T = (P, T, • (.), (.) • , M 0 , (α, β)) be a TPN and S T = (Q, q 0 , →) the semantics of T . The truth value of a formula ϕ of TPN-TCTL for a state (M, ν) is given on Tab. 1.

The TPN T satisfies the formula ϕ of TPN-TCTL which is denoted T |= ϕ iff the first state of S T satisfies ϕ i.e. (M 0 , ν 0 ) |= ϕ.

We will see that thanks to corollary 3.3, model-checking for TPNs amounts to model-checking for timed automata.

Model-Checking for TPN-TCTL.

Let us assume we have to model-check formula ϕ on a TPN T . Our method consists in using the equivalent timed automata ∆(T ) defined in section 3. For instance, suppose we want to check T |= 2 ≤3 (M ≥ (1, 2)). It means that all the states reached within the next 3 time units will have a marking such that p 1 has more than one token and p 2 more than 2. Actually, this is equivalent to checking 2 ≤3 (SU.0

→ (p[1] ≥ 1 ∧ p[2] ≥ 2)) on the equivalent timed automaton. Notice that 3 ≤3 (M ≥ (1, 2)) reduces to 3 ≤3 (SU.0∧(p[1] ≥ 1 ∧ p[2] ≥ 2)
). We can then define the translation of a formula in TPN-TCTL to standard TCTL for timed automata.

(M, ν) |= M ⊲⊳ V iff M ⊲⊳ V (M, ν) |= false (M, ν) |= t k + c ≤ t j + d iff ν k + c ≤ ν j + d (M, ν) |= ¬ϕ iff (M, ν) |= ϕ (M, ν) |= ϕ → ψ iff (M, ν) |= ϕ implies (M, ν) |= ψ (M, ν) |= ϕ ∃U ⊲⊳c ψ iff ∃σ = (s 0 , ν 0 ) -→ d 1 a 1 • • • -→ dn an (s n , ν n ) ∈[[T ]] s.t.      (s 0 , ν 0 ) = (M, ν) ∀i ∈ [1..n], ∀d ∈ [0, d i ), (s i , ν i + d) |= ϕ n i=1 d i ⊲⊳ c and (s n , v n ) |= ψ (M, ν) |= ϕ ∀U ⊲⊳c ψ iff ∀σ = (s 0 , ν 0 ) -→ d 1 a 1 • • • -→ dn an (s n , ν n ) ∈[[T ]] s.t.      (s 0 , ν 0 ) = (M, ν) ∀i ∈ [1..n], ∀d ∈ [0, d i ), (s i , ν i + d) |= ϕ n i=1 d i ⊲⊳ c and (s n , v n ) |= ψ Table 1
Semantics of TPN-TCTL Definition 4.2 [Translation of TPN-TCTL into TCTL] Let ϕ be a formula of TPN-TCTL. Then the translation ∆(ϕ) of ϕ is inductively defined by:

∆(M ⊲⊳ V ) = n i=1 (p[i] ⊲⊳ Vi ) ∆(false) = false ∆(t k + c ⊲⊳ t j + d) = = x k + c ⊲⊳ x j + d ∆(¬ϕ) = = ¬∆(ϕ) ∆(ϕ → ψ) = SU.0 ∧ (∆(ϕ) → ∆(ψ)) ∆(ϕ ∃U ⊲⊳c ψ) = (SU.0 → ∆(ϕ)) ∃U ⊲⊳c (SU.0 ∧ ∆(ψ)) ∆(ϕ ∀U ⊲⊳c ψ) = (SU.0 → ∆(ϕ)) ∀U ⊲⊳c (SU.0 ∧ ∆(ψ))
SU.0 means that the supervisor is in state 0 and the clocks x k are the ones associated with every transition t k in the translation scheme.

2

We can now state the following theorem:

Theorem 4.3 Let T be a TPN and ∆(T ) the equivalent timed automaton. Let (M, ν) be a state of S T and ((s, p), q, v) = ∆((M, ν)) the equivalent state of S ∆(T ) (i.e. (M, ν) ≈ ((s, p), q, v)). Then

∀ϕ ∈ TPN-TCTL (M, ν) |= ϕ iff ((s, p), q, v) |= ∆(ϕ) 2
Proof. The proof is done by structural induction on the formula of TPN-TCTL.

= (s 0 , ν 0 ) -→ d 1 a 1 (s 1 , ν 1 ) • • • -→ dn an (s n , ν n ) and (s 0 , ν 0 ) = (M, ν), n i=1 d i ⊲⊳ c, ∀i ∈ [1..n], ∀d ∈ [0, d i ), (s i , ν i + d) |= ϕ and (s n , ν n ) |= ψ. With corollary 3.3, we conclude that there is a run σ = ∆(ρ) in [[S ∆(T ) ]] s.t. σ = ((l 0 , p 0 ), q0 , v 0 )) =⇒ d 1 w 1 ((l 1 , p 1 ), q1 , v 1 )) • • • =⇒ dn wn ((l n , p n ), qn , v n ))
and ∀i ∈ [1.

.n], ((l i , p i ), qi , v i )) ≈ (s i , ν i ) (this entails that l i = 0.) Since (s n , ν n ) ≈ ((l n , p n ), qn , v n )), using the induction hypothesis on ψ, we can assume (s n , ν n ) |= ψ iff ((l n , p n ), qn , v n )) |= ∆(ψ) and thus conclude that ((l n , p n ), qn , v n )) |= ∆(ψ). Moreover as l n = 0 we have ((l n , p n ), qn , v n )) |= SU.0 ∧ ∆(ψ). It remains to prove that all intermediate states satisfy SU.0 → ∆(ϕ). Just notice that all the intermediate states in σ not satisfying SU.0 between ((l i , p i ), qi , v i ) and (((l i+1 , p i+1 ), qi+1 , v i+1 )) satisfy SU.0 → ∆(ψ). Then we just need to prove that the intermediate states satisfying SU.0, i.e. the states ((l i , p i ), qi , v i ) satisfy ∆(ϕ). As ∀i ∈ [1..n], ((l i , p i ), qi , v i )) ≈ (s i , ν i ), with the induction hypothesis on ϕ, we have ∀i ∈ [1..n], ((l i , p i ), qi , v i )) |= ∆(ϕ). Moreover, again applying theorem 3.2, ∀d ∈ [0, d i ), ((l i , p i ), qi , v i + d)) ≈ (s i , ν i + d) and applying the induction hypothesis again yields ∀d ∈ [0, d i ), ((l i , p i ), qi , v i +d)) |= ∆(ϕ). Hence ((l 0 , p 0 ), q0 , v 0 )) |= (SU.0 → ϕ) ∃U ⊲⊳c (SU.0∧ ψ).

If part.

Assume ((l 0 , p 0 ), q0 , v 0 )) |= (SU.0 → ∆(ϕ)) ∃U ⊲⊳c (SU.0 ∧ ∆(ψ)). Then there is a run

σ = ((l 0 , p 0 ), q0 , v 0 )) =⇒ d 1 w 1 ((l 1 , p 1 ), q1 , v 1 )) • • • =⇒ dn wn ((l n , p n ), qn , v n )) with ((l n , p n ), qn , v n )) |= SU.0 ∧ ∆(ψ) and ∀i ∈ [1..n], ∀d ∈ [0, d i ), ((l i , p i ), qi , v i )) |= (SU.0 → ∆(ϕ))
As ((l n , p n ), qn , v n )) |= SU.0, we can use corollary 3.3 and we know there exists a run in [

[T ]] ρ = ∆ -1 (σ) = (s 0 , ν 0 ) → d 1 a 1 (s 1 , ν 1 ) • • • → dn an (s n , ν n ) with ∀i ∈ [1..n], ((l i , p i ), qi , v i )) ≈ (s i , ν i ). The induction hypothesis on SU.0 ∧ ∆(ψ) combined with ((l n , p n ), qn , v n )) |= S.0 ∧ ∆(ψ) implies (s n , ν n ) |= ψ.
For all the intermediate states of ρ we also apply the induction hypothesis: each ((l i , p i ), qi , v i )) is equivalent to (s i , ν i ) and all the states (s i , ν

i + d), d ∈ [0, d i ) satisfy ϕ. Hence (s 0 , ν 0 ) |= ϕ ∃U ⊲⊳c ψ. 2 2
Example of model-checking.

• • T 0 [0, 4] T 1 [4, 6]
T 2 [3, 4] If we want to model-check a TPN we obviously have to assume it is bounded. We can ensure this by computing the SCG for instance. Here after we give an example of a TPN and its translation to a timed automaton obtained with our translator [START_REF] Gardey | Roméo: A tool for Time Petri Nets Analysis[END_REF]. Roméo is a tool for TPNs analysis which can perform the translation of a TPN into the equivalent TA in the UPPAAL input format. It is then possible to check efficiently real-time properties. Let us focus on the TPN of the figure 3 and its translation with Roméo. The translation gives one timed automaton for each transition (see the automaton of the transition t 0 Fig. 4) and one automaton for the supervisor SU (see Fig. 5). These automata update an array of integer p[i] (the number of tokens in place i). The first action of the supervisor gives the initial marking p[0] = 1, p[1] = 1, p[2] = 0. UPPAAL accepts only two synchronized actions, then the synchronization function defined in section 3 is implemented with a loop in the supervisor where i is the index of the transition and n+ 1 the number of transition. The automaton of the transition t 0 is depicted on Fig. 4. As • t 0 = (1, 0, 0) and t 0 • = (0, 0, 1) , then p ≥ • t 0 (t 0 is enabled) is implemented by p[0] ≥ 1 ; p := p + t 0

P 2 P 0 P 1 Fig. 3. A time Petri net x ≤ 4 t Firing t 0 ≤ x ≤ 4 ?pre p[0] := p[0] -1 i = 0, p[0] < 1 ?update ?post p[2] := p[2] + 1 i = 0, p[0] ≥ 1 ?update x := 0 i = 0, p[0] ≥ 1 ?update i = 0, p[0] < 1 ?update i = 0 ?update
• is implemented by p[2] := p[2] + 1 and so on. The first property means that all the states reached after 4 time units will have a marking such that p 0 has no token. The second property means that it's possible to fire t 2 while t 1 is not firable. Note that this property can't be checked with the SCG that just allows to check that it's possible to fire t 1 after the firing of t 2 .

0 1 U 2 U Ini U 2 U !pre i := 0 !post i := 0 i = n !update i = n !update p[0] := 1, p[1] := 1, p[2] := 0, n:=2,i:=0 i < n !update i := i + 1 i < n !update i := i + 1

Conclusion

In this paper, we have given a structural translation from TPNs to TA. Any TPN T and its associated TA ∆(T ) are timed bisimilar.

Such a translation has many theoretical implications. Most of the theoretical results on TA carry on to TPNs. The class of TPNs can be extended by allowing strict constraints (open, half-open or closed intervals) to specify the firing dates of the transitions; for this extended class, the following results follow from our translation and from theorem 3.2:

• TCTL model checking is decidable for bounded TPNs. Moreover efficient algorithms used in UPPAAL [START_REF] Larsen | UPPAAL in a Nutshell[END_REF][START_REF] Pettersson | Uppaal2k[END_REF] and KRONOS [START_REF] Yovine | Kronos: A Verification Tool for real-Time Systems[END_REF] are exact for TPNs (see recent results [START_REF] Bouyer | Untameable timed automata![END_REF] by P. Bouyer);

• it is decidable whether a TA is non-zeno or not [START_REF] Henzinger | Symbolic model checking for real-time systems[END_REF] and thus our result provides a way to decide non-zenoness for bounded TPNs;

• the controller synthesis problem is partially solvable for TPNs: there is an algorithm [START_REF] Maler | On the synthesis of discrete controllers for timed systems[END_REF] for computing the winning states of a Timed Automaton Game and thus we can use it on the timed automaton ∆(T ) associated to a time Petri net T . This way we can compute a controller that is timed automaton for our time Petri net T . This does not prove that there exists

Cassez & Roux a controller for T that is a time Petri net. In this sense we partially solve the controller synthesis problem for time Petri nets;

• lastly, as our translation is structural, it is possible to use a model-checker to find sufficient conditions of unboundedness of the TPN.

These results enable us to use algorithms and tools developed for TA to check properties on TPNs. For instance, it is possible to check real-time properties expressed in TCTL on bounded TPNs. We have implemented our translation in the tool [START_REF] Gardey | Roméo: A tool for Time Petri Nets Analysis[END_REF] which can perform the translation of a TPN into the equivalent TA in UPPAAL input format. It is then possible to check efficiently real-time properties with this tool, and to benefit from all the advantages of it: efficiency, counter example generation when a property is false, simulation environment. Also, it bridges a gap between TPNs and TA and for instance enables one to specify a real-time system as a mixture of TPNs and TA, and then derive a TA modeling the behavior of the whole system.

Fig. 1 .

 1 Fig. 1. The automaton A i for transition t i

Fig. 2 .

 2 Fig. 2. The automaton of the supervisor SU

Definition 4 . 1 [

 41 TCTL for TPN] Assume a TPN with n places, and m transitions it the set T = {t 1 , t 2 , • • • , t m }. The temporal logics TPN-TCTL is inductively defined by:

Fig. 4 .

 4 Fig. 4. The automaton A 0 for transition t 0

Fig. 5 .

 5 Fig. 5. The automaton of the supervisor SU

  The cases of M ⊲⊳ V , false, t k + c ≤ t j + d, ¬ϕ and ϕ → ψ areCassez & Roux straightforward. We give the full proof for ϕ ∃U ⊲⊳c ψ (the same proof can be carried out for ϕ ∀U ⊲⊳c ψ).

	Only if part.
	Assume (M, ν) |= ϕ ∃U ⊲⊳c ψ. Then by definition, there is a run ρ in [[T ]]
	s.t.:
	ρ

The use of observers is of little help as it requires to specify a property as a TPN; thus it is really hard to specify properties on markings.

If we except the difference with[START_REF] Lilius | Efficient state space search for time petri nets[END_REF] in the definition of the reset instants for newly enabled transitions.

v i is the restriction of v to C i .

Cassez & Roux

in SU , committed or urgent locations are equivalent; also this type of locations can be simulated by adding a clock x which is reset to 0 when entering the location and adding the invariant x = 0 to the location.

(s, p) is the state of SU , q gives the state of A 1 × • • • × A n (so qi is the state of A 1 ) and v the values of the clocks x i , i ∈ [1..n].

the use of ∞ in V allows us to handle comparisons like M (p 1 ) ≤ 2 ∧ M (p 2 ) ≥ 3 by writing M ≤ (2, ∞) ∧ M ≥ (0, 3).

Cassez & Roux ((1, p 1 ), q1 , v 1 ) we reach ((2, p 2 ), q2 , v 2 ) with p 2 = p 1 , v 2 = v 1 . For k = i, q2k = if p 1 ≥ • t k and q2k = t otherwise and q2i = Firing.

The next global transition must be a post i transition leading to ((3, p 3 ), q3 , v 3 ) with p 3 = p 2 + t i

• , v 3 = v 2 and q3k = q2k , ∀k = i and q3i = t. From this last state only an update transition leading to ((0, p 4 ), q4 , v 4 ) is allowed, with p 4 = p 3 , v 4 and q 4 given by: q4k = t if p 3 ≥ • t k and t otherwise. v 4k = 0 if q3 k = t and q4 k = t and v 4k = v 1k otherwise. We then just notice that q3k = t iff p -

The converse of statement 2 is straightforward following the same steps as the previous ones.

We now focus on statement 3. According to the semantics of TPNs, a continuous transition (M, ν)

From the states equivalence (M, ν) ≈ ((0, p), q, v), if M ≥ • t k then qk = t and the continuous evolution for A k is constrained by the invariant x k ≤ β(t k ). Otherwise qk = t and the continuous evolution is unconstrained for A k . No constraints apply for the supervisor in state 0. Hence the result.

2

We can now state a useful corollary which enables us in the next section to do TCTL model-checking for TPNs. We denote ∆((M, ν)) = ((0, p), q, v) if (M, ν) ≈ ((0, p), q, v) and ∆(t i ) = pre i .update.post i .update and ∆(ǫ(d)) = ǫ(d). Just notice that ∆ is one-to-one and we can use ∆ -1 as well. Then we extend ∆ to transitions as: ∆((M, ν)

---→ ∆((M ′ , ν ′ )) with e ∈ T ∪ R ≥0 (as ∆(t i ) is a word, this transition might be a 4 step transition). Again we can extend ∆ to runs: if ρ ∈[[T ]] we denote ∆(ρ) the associated run in [[∆(T )]]. Notice that ∆ -1 is only defined for runs σ of [[∆(T )]] the last state of which is of the form ((0, p), q, v) where the supervisor is in state 0. We denote this property last(σ) |= SU.0.

Proof. The proof is a direct consequence of theorem 3.2. It suffices to notice that all the runs of ∆(T ) are of the form

with w i = pre i .update.post i .update and consequently using theorem 3.2, if the last state satisfy last(σ) |= SU.0, there exists a corresponding run ρ in T s.t. σ = ∆(ρ).

2

Consequently all the runs in ∆(T ) ending in SU.0 have a corresponding run in T . This property will be used in section 4 when we address the problem of model-checking TCTL for TPNs.