Behaviour equivalent max-plus automata for timed petri nets under open-loop race-policy semantics

Timed Petri nets and max-plus automata are well known modelling frameworks for timed discrete-event systems. In this paper we present an iterative procedure that constructs a max-plus automaton from a timed Petri net while retaining the timed behaviour. Regarding the Petri net, we essentially impose three assumptions: (a) the Petri net must be bounded, i.e, the reachability graph must be finite; (b) we interpret the Petri net with single server semantics; and (c) the Petri net operates according to the race policy, i.e., the earliest possible transition will fire and thereby possibly consume tokens required by other competing transitions. Under these assumptions we show that the proposed procedure terminates with a finite deterministic max-plus automaton that realises the same timed behaviour as the Petri net. As a variation of the plain race policy, we also consider that a subsequently designed supervisor may temporarily disable distinguished transitions. Again, we present a terminating procedure that constructs a behaviour equivalent deterministic max-plus automaton. We demonstrate by example how the latter automaton can be utilised as an open-loop model in the context of supervisor control.

discrete-event systems; see Gaubert (1995). Although max-plus automata are not as expressive as general timed automata introduced by Alur and Dill (1994), they can be conveniently analysed within an algebraic setting, e.g., considering power series with coefficients from the idempotent semiring over the reals with addition and maximum as the two binary operations. Max-plus automata must not be confused with linear max-plus dynamic systems and variations thereof; see e.g. Baccelli et al. (1992) or Hardouin et al. (2018).
Max-plus automata have also been utilised in the context of supervisory control. Here, a given max-plus automaton represents the plant behaviour and one seeks to synthesise a supervisory controller such that the closed-loop behaviour satisfies a prescribed specification; e.g. Komenda et al. (2009) and Su et al. (2012). As with un-timed supervisory control introduced by Ramadge and Wonham (1989), the basic case of complete observation corresponds to a deterministic plant automaton. However, it is well known that not all max-plus automata are determinisable. Algorithms that enable determinisation of max-plus automata under restrictive conditions have been presented by Gaubert (1995) and Mohri (1997), where weighted automata are applied to speech recognition and their determinisation is possible if the so-called twin property holds. A less restrictive condition for termination of the procedure has been introduced in Lahaye et al. (2020). The classical algorithm for determinisation based on normalisation of the state vector has been extended by Kirsten (2008) for polynomially ambiguous max-plus automata, where a more general clone property guarantees the determinisation. For the more restrictive class of unambiguous max-plus automata a concept for observer construction has been proposed recently by Lai et al. (2021). Nevertheless, for non polynomially ambiguous max-plus automata even the decidability of determinisation is still open. Weighted automata have also been used in image processing; see Culik and Kari (1997).
Similar to max-plus automata, timed Petri nets are introduced by assigning durations to individual transitions in a Petri net; see Ramchandani (1973). There are a number of alternative firing rules commonly applied to plain Petri nets, and this variety is inherited by timed Petri nets. For example, Gaubert and Mairesse (1999) and Lahaye et al. (2015) consider so called safe timed Petri nets under preselection policy and show how they can be converted to behaviour equivalent max-plus automata. Although this is a relevant result for the purpose of analysis, the obtained automata in general fail to be deterministic and are, hence, of limited use in the context of controller synthesis. In contrast, Komenda et al. (2016) consider so called bounded Petri nets under race policy and provide a semi-algorithm that in the case of termination generates behaviour equivalent deterministic max-plus automata. To this end, Komenda et al. (2016), p. 427, impose a fairness condition on the Petri net and show that this condition is sufficient to imply termination of the semi-algorithm.
The present paper is based on our earlier conference contribution (Triska and Moor 2020), where we follow the line of thought by Komenda et al. (2016). However, we do propose some strategic variations of the algorithm that allow us to drop the fairness requirement. In particular, our algorithm terminates for all bounded Petri nets under race policy with rational timing parameters, and thereby generalises the results by Komenda et al. (2016). Our conversion result is still a deterministic max-plus automaton and technically can serve as the basis for a subsequent supervisory controller design. However, plain race-policy semantics leave little leverage for a supervisor to control the system under consideration. Extending our earlier conference contribution, we therefore propose to explicitly account for supervisors, that may temporarily disable distinguished transitions and thereby give pri-ority to alternative transitions that could not occur under plain race policy. Since these considerations take place before any specific decision is made by the supervisor, we refer to our semantics as open-loop race policy. As with our base result for plain race-policy semantics, we present an algorithm for the construction of a behaviour equivalent deterministic max-plus automaton that terminates for bounded Petri nets with rational timing parameters.
The paper is organised as follows. After providing some elementary notation in Section 2, we recall common definitions regarding max-plus automata and timed Petri nets. In preparation of the following discussion, we also derive a formal representation for the behaviour of timed Petri nets. Section 4 then presents our first main result in that we construct a behaviour equivalent max-plus automaton for a given timed Petri net with race-policy semantics. Here, the discussion includes a formal proof of termination for our algorithm, provided that the Petri net is bounded. This result is extended in Section 5, where we address open-loop racepolicy semantics, again including a proof of termination for bounded Petri nets. Subsequent controller design is demonstrated by a simple example in Section 6.

Notation
The positive integers are denoted by N and we let N 0 := N∪{0}. The rationales are denoted by Q and the reals R. The non-negative rationals are denoted by Q ≥0 and the non-negative reals R ≥0 . For a neutral element ε regarding the max operation, we also consider Q max := Q∪{−∞} and R max := R∪{−∞} with ε := −∞ and the convention that An alphabet A is a finite set of symbols. We denote A * the Kleene-closure of A, i.e., the set of finite-length words composed from symbols in A, including the empty word λ ∈ A * , λ ∈ A. Subsets of A * are referred to as languages over A.
Throughout this paper we identify a map f : X → Y with the associated vector g = (g x ) x∈X ∈ Y X , g x = f (x) ∈ Y for all x ∈ X; i.e., we do not distinguish between f and g and use either notation whenever convenient.
An equivalence relation ≡ on a set Q is a reflexive, symmetric and transitive relation, technically defined as a subset ≡ ⊆ Q × Q. We use common infix notation q ≡ q for (q , q ) ∈ ≡. The associated equivalence classes are denoted by [q] := { q ∈ Q | q ≡ q }. Given two equivalence relations ≡ 1 , ≡ 2 ⊆ Q × Q, we say that ≡ 1 is at least as fine as ≡ 2 , if for all q , q ∈ Q with q ≡ 1 q we have that q ≡ 2 q .

Max-plus automata and timed petri nets
In this section we first recall common definitions regarding max-plus automata and timed Petri nets. Notational conventions are kept in line with Komenda et al. (2016). A more extensive introduction to this topic is given by Gaubert (1995) and Seatzu et al. (2012). Subsequently we demonstrate how a representation of the semantic state of a timed Petri net can be obtained and how the behaviour of the timed Petri net can be formally defined in terms thereof. This amounts to an automaton representation, which, however, at this stage may not be finite.

Deterministic max-plus automata
Max-plus automata are introduced as a generalisation of plain automata with durations assigned to transitions. We regard the timing component in R max with the binary operations max and +, which entail the respective neutral elements ε := −∞ and e := 0. 1 Definition 1 A max-plus automaton is defined as a quadruple G = (Q, A, Q 0 , δ), where • Q is the set of states, • A is the alphabet of event symbols, • Q 0 is the set of initial states, and The max-plus automaton G is finite if Q is a finite set.
The transition function in a max-plus automaton associates with each transition a nonnegative duration and thereby generalises the common transition relation of plain automata. Technically, we require that for q, q ∈ Q and a ∈ A either δ(q, a, q ) = d ≥ 0 ( 1 ) to indicate that the respective transition takes no more than d time units, or that to indicate that the respective transition cannot take place at all. A path or run in the max-plus automaton G is defined as a sequence π = q 0 a 1 q 1 a 2 q 2 · · · a n q n such that q 0 ∈ Q 0 and q i ∈ Q, a i ∈ A, δ(q i , a i+1 , q i+1 ) = ε for all i ∈ N 0 , i < n. With the run π we associate the word w = a 1 a 2 · · · a n . A word w ∈ A * is recognised by G if there exists at least one run π with associated word w. Note that the empty word λ is recognised by any max-plus automaton via the trivial run π = q 0 . The logical behaviour L(G) ⊆ A * of G is then defined as the set of all words recognised by G. A max-plus automaton is deterministic if it has exactly one initial state and if, given a state and an event symbol, there can be at most one successor state. Throughout this paper, we only consider deterministic automata. Technically, we then have that Q 0 = {q 0 } and that for all q, q , p ∈ Q and for all a ∈ A δ(q, a, q ) ∈ R ≥0 and δ(q, a, p ) ∈ R ≥0 =⇒ δ(q, a, q ) = δ(q, a, p ) and q = p .
(4) In particular, we have that for each w ∈ L(G) there exists exactly one run of G with w the associated word.
The timed behaviour of max-plus automata is defined via a dater function that returns the date at which a sequence of events has definitely been executed. For the situation of deterministic max-plus automata, the technical construction simplifies considerably.
Referring to the transition durations as weights, the timed behaviour amounts to the sum of the transition weights along the unique run associated with each individual recognised word. Taking this perspective, we define the labeled and weighted transition relation '→' by letting for q, q ∈ Q and a ∈ A if and only if d = δ(q, a, q ) ≥ 0. This transition relation is commonly extended to words in A * by taking the transitive closure while accumulating weights. Technically, we begin with the empty word λ ∈ A * and define the transitions for all q ∈ Q. We then iteratively define further transitions with q, q ∈ Q, w ∈ A * and a ∈ A if and only if are both defined for some q ∈ Q and d = d + d .
For the deterministic max-plus automata considered in this paper, it can be seen by induction over the length of words that, given q ∈ Q and w ∈ A * , there exists at most one duration d ∈ R ≥0 and one successor state q ∈ Q such that Moreover, considering the initial state q = q 0 and a word w ∈ A * , the existence of d and q that qualify for Eq. 10 is equivalent to y G (w) = d ≥ 0.

Petri nets
A Petri net is a bipartite graph with places and transitions as nodes. Places can hold any number of tokens and the token configuration determines which transitions are enabled. We recall the formal definition and comment on aspects relevant for the present paper.
• P is a finite set of places, • T is a finite set of transitions, is the incidence relation, and • M 0 : P → N 0 is the initial marking.
The configuration of a Petri net is given by a marking M : P → N 0 , which specifies the number of tokens present at each place. Whenever convenient, we identify the function M with the corresponding vector in N P 0 . The evolution of the marking over logic time adheres to the following rules: (S1) Transition t ∈ T is enabled by a marking M if each input place of t has at least one token; i.e., if M p > 0 for all p ∈ P with (p, t) ∈ F. This is denoted by M t →. Given a marking M, we write for the set of all enabled transitions. (S2) Considering the Petri net with marking M, an enabled transition t ∈ En(M) can fire.
The firing of t transforms the marking M into M , where one token is eliminated from each input place of t and, subsequently, one token is generated for each output place. Technically, we denote Elm(M, t) ∈ N P 0 the intermediate marking after token elimination, i.e., for all p ∈ P. Likewise, token generation is expressed by Gen(M, t) ∈ N P 0 with for all p ∈ P. Then, the successor marking M is obtained as M := Gen(Elm(M, t)). The overall process is denoted by M t → M .
Conforming with the above rules, a firing sequence is specified by markings M i ∈ N P 0 , i = 0, . . . , n ∈ N, and transitions t i ∈ T such that M i t i → M i+1 for i = 0, . . . , n − 1 ∈ N, and we associate the word w := t 0 t 1 · · · t n−1 ∈ T * with this firing sequence. The logical behaviour L(G) ⊆ T * of the Petri net G is then defined as the set of all words associated with some firing sequence.
A Petri net is called bounded if for all markings reachable by some firing sequence the token count at each place does not exceed a uniform bound.

Definition 4
The reachability graph or marking graph of a bounded Petri net G is the deterministic finite automaton Reach • the state set M is the set of markings reachable by some firing sequence, • the alphabet is the set of transitions T , • the initial state is the initial marking M 0 , and • the partial transition function t r : M × T → M is defined for M ∈ M and t ∈ T by Note that the determinism of the reachability graph crucially depends on the direct use to the set of transitions as alphabet. When applying the same approach in the presence of explicit transition labels, such a labeling needs to be injective for us to obtain a deterministic reachability graph. Since an explicit labeling is quite common in the literature, we refer to our setting as injectively labeled.

Timed Petri nets under race policy
In the context of time extensions for Petri nets multiple approaches have been introduced that are based on assigning durations to places, transitions, or both, see e.g. Merlin (1974) and Ramchandani (1973), and Cerone and Maggiolo-Schettini (1999). In our specific setting we consider a class of timed Petri nets that is obtained from plain Petri nets by associating with each individual transition a duration. This style of generalisation is similar to when moving from plain automata to max-plus automata.
≥0 is a parameter vector representing the durations associated with each individual transition.
In contrast to the setting with max-plus automata, the duration τ t here is interpreted as the firing time of transition t ∈ T . Since holding times are not considered throughout this paper, the duration τ t is the minimum delay between enabling and firing of t. This interpretation leads to the following informal extension of firing rules.
(S3) The tokens belonging to the initial marking become available at time instant zero. (S4) All transitions are considered to be single server, meaning that a transition can only process one token from each input place at a time. (S5) If multiple transitions are enabled, the one that can fire the earliest has priority. This rule is also known as race policy. In the case several transitions qualify under this policy, either one can fire next. (S6) Transitions are fired as soon as possible, which is referred to as the earliest functioning firing rule.
These semantics are effectively the same as in Komenda et al. (2016). For a general discussion of alternative settings, such as multi server, see e.g. Seatzu et al. (2012). At this point we are looking to find a formal representation of the timed behaviour. Our approach here is to extend the discrete state set from the reachability graph by a continuous component C to strategically encode clock values in order to address the timing rules (S3)-(S6). Technically, we let to maintain one clock per transition that shows the time for which the transition has been continuously enabled or, alternatively, the distinguished symbol ‡ to explicitly indicate that the respective transition is disabled and, hence, the clock is inactive. While the initial marking M 0 is specified by the Petri net, we define the initial clock vector as Thus, the overall set of semantic states amounts to the product M × C with initial state We define a number of operations on these states that turn out useful in the subsequent discussion.
• As a means to update the values of all clocks after the elapse of some finite amount of time we define the operation Inc for a clock vector C = (c t ) t∈T ∈ C and a duration for all t ∈ T . • In the interest of comparing clock values and for better readability, we define for d ∈ R ≥0 min( ‡, d) = ‡ (18) The min operator is extended to vector valued arguments in the obvious elementwise way.
• To reset the value of specific clocks we define the operation Reset for a set of transitions R ⊆ T and a clock vector C = (c t ) t∈T ∈ C. The clocks corresponding to transitions in R are reset and other clocks are not effected; that is Reset(C, R) ∈ C with for all t ∈ T . The single server transition semantics are then implemented by resetting the respective clock value after every firing of a transition. • Since the timing is only relevant for enabled transitions, we deactivate a clock referring to disabled transitions by substituting said clock with the indicator symbol ‡. This operation is performed by Sub, defined for S ⊆ T and C = (c t ) t∈T ∈ C with Sub(C, S) ∈ C and for all t ∈ T . • In order to adequately reset and start relevant clocks, we need to identify newly enabled transitions. Given a marking M ∈ M with M t →M for some transition t ∈ T and the unique successor marking M ∈ M, a transition t ∈ T is obviously newly enabled if it is enabled in M but not in M, i.e., if t ∈ En(M ) \ En(M). In this case, the corresponding entry in the clock vector shall be set to 0. However, we also need to account for the situation where the elimination of tokens as required by firing t temporally disables a transition t which otherwise is enabled by both markings M and M . Technically, we then obtain Note that systematically resetting clocks of newly enabled transitions ensures that clocks of enabled transitions are always active, and hence, show a real value as opposed to the distinguished symbol ‡. Note also that our construct here crucially relies on the assumption of single server semantics.
In this regard the expression d = τ t − c t for t ∈ FirstFired(M, C) represents the minimal remaining firing delay among transitions enabled by the marking M. Hence, before the elapse of d time units, no transition can fire and after the elapse of d time units some transition a ∈ FirstFired(M, C) will fire provided that En(M) = ∅.
We are now in the position to formally define the overall timed Petri nets semantics by introducing weighted transitions between two semantic states with M, M ∈ M, C, C ∈ C, a ∈ T and d ∈ R ≥0 if and only if Note that the above transition relation is deterministic by construction in the sense that implies d = d , M = M and C = C . In particular, the transitions can be interpreted as state transitions in a deterministic max-plus automata with state set Q = M × C and we will follow this up in the subsequent section. To this end, we refer to the common extension of weighted transition relations to words as presented at the end of Section 3.1 for a formal definition of the timed behaviour of the Petri net. Technically, we begin with the empty word λ ∈ T * and define the transitions for all M ∈ M, C ∈ C. Referring to Eq. 23 with conditions (i)-(vi), we then iteratively introduce further transitions with w ∈ T * , a ∈ T and d ∈ R ≥0 whenever there exist M ∈ M, C ∈ C and d , d ∈ R ≥0 such that and d = d + d . Note that the determinism as observed above carries over to the extension to words. In particular, given a word w ∈ T * there exists at most one matching sequence of transitions beginning at the initial state (M 0 , C 0 ) and, if so, a unique corresponding overall duration d.

Definition 6
The behaviour of a timed Petri net (G, τ ) is defined as the dater function for some M ∈ M and C ∈ C, and referring to the transition relation defined by Eqs. 23-27, or, else, y G (w) := ε.

Finite state representation
Based on the semantics defined in the previous section, we are now looking to obtain a maxplus automaton with equal behavior to a given bounded, timed Petri net operating under race policy with single server semantics. For our main result, Theorem 1, we show that a suitable automaton with a finite number of states always exists and we demonstrate how to obtain such an automaton.

Behaviour considerations
As a first step in constructing the desired max-plus automaton we propose an initial candidate with an infinite state set that realizes the same behavior as the respective timed Petri net. This is done be re-interpreting the transition relation on the semantic states, Section 3.3, Eq. 23, as the transition function of a max-plus automaton with state set Q = M × C, i.e., the set of all pairs of markings and clock vectors with regard to a given bounded timed Petri net (G, τ ), G = (P, T , F, M 0 ). Given a state q = (M, C) ∈ Q, we ask for all possible successor states under the restriction of the race policy and with single server semantics.
Referring to the determinism of the transition relation on semantic states, Eq. 23, recall that given q = (M, C) ∈ Q and t ∈ T there exists at most one duration d ∈ R ≥0 and one successor state q = (M , C ) ∈ Q such that Hence, we can define the max-plus transition function δ : and consider the deterministic max-plus automaton It is evident from the construction that the weighted transition relation, Eq. 30, associated with G matches the transition relation on the semantic states defined in Section 3.3, Eq. 23. Hence, we have that In other words, the timed behaviour of the max-plus automaton G equals the behaviour of the timed Petri net (G, τ ).

Restriction to a finite automaton
Although the state set Q = M × C of G is technically infinite due to the C-component, our conjecture is that the set of reachable states is only finite. In support of a formal argument, we conduct a forward-reachability analysis on G. Consider the operator defined for sets of states P ⊆ Q. Then the set of reachable states in G is obtained by the following iteration i.e., there exists a path π in G that ends in a state q ∈ Q if and only if q ∈ Q * . Since nonreachable states do not contribute to the behaviour, we can restrict G to the state set Q * . Technically, we consider the max-plus automaton where the transition function δ * : Q * × T × Q * → R max equals δ on the restricted domain, i.e., and we conclude that y G (w) = y G (w) = y G * (w) for all w ∈ T * . From the boundedness assumption of the Petri net G it follows that the set of reachable markings M in Reach(G) is finite. In order to establish that Q * is finite, we show that the range of the C-component over all states in Q * is finite, too. To this end, consider the following Lemma.

Lemma 1
The entries of the clock vector C in every state (M, C) ∈ Q * of the automaton G * are bounded by the respective entry in the vector of transition durations τ ∈ R T ≥0 , i.e.
Proof For the case of Q * = {(M 0 , C 0 )} the claim is trivially true since each entry c 0,t of C 0 by definition either equals ‡ or 0 ≤ τ t , with the latter inequality as a consequence of τ t being non negative. For a proof by contradiction, suppose there exists a state q = (M , C ) ∈ Q * different from the initial state, and such that c t > τ t for some transition t ∈ T . Since q is not the initial state, there exists i ∈ N 0 such that q ∈ Q i but q ∈ Q i+1 . Hence, by Eq. 35, we have that q ∈ NextState(Q i ). By the definition of NextState, Eq. 33, we can choose a predecessor state q = (M, C) ∈ Q i ⊆ Q * such that δ(q, a, q ) = d ≥ 0 for some a ∈ T . With Eq. 30 this implies and we can refer to conditions (i)-(vi) below (23) to derive further consequences. In order for c t to be greater than zero, transition t has to be enabled for marking M as well as the predecessor marking M, otherwise transition t would be considered obviously newly enabled or disabled and the clock value c t is reset; see conditions (v) and (vi), respectively. In particular, we have t ∈ En(M). Referring to condition (i), we have a ∈ En(M) and, since transition a was chosen according to the race policy semantics, condition (ii), we also have a ∈ FirstFired(M, C), i.e., for all b ∈ En(M). From the definition of clock values via conditions (iv)-(vi), we obtain c t + d = c t to conclude As t ∈ En(M) holds true, Eq. 44 constitutes a contradiction with Eq. 41.
Regarding the above lemma we consider the restricted range of clock values with τ max = max t∈T τ t to observe that If all entries in the timing vector τ are non-negative integers, i.e., τ ∈ N T 0 , then the clock vector C of any state q = (M, C) ∈ Q * is also in N T 0 . Since the intersection of C * with N T 0 is a finite set, this implies that Q * is a finite set, too. For the case of a rational timing τ ∈ Q T ≥0 , we uniformly scale clocks to refer to the least common denominator of all entries in τ to again obtain a finite set Q * by the same argument. Note that this observation does not carry over to general real-valued timings τ ∈ R T ≥0 . We now state our main result.
Theorem 1 Consider a bounded, injectively labeled, timed Petri net (G, τ ) under racepolicy and with single server semantics. Assuming a rational timing vector τ ∈ Q T ≥0 , there exists a finite deterministic max-plus automaton with equal behaviour. One such automaton is given by as defined in Eq. 37 via the iteration (34)-(36). In particular, the iteration attains a fixpoint after finitely many steps, i.e., we have Q * = Q i for some i ∈ N 0 .
Proof Finiteness of Q * is a consequence of Lemma 1 and the discussion for rational timings thereafter. Behavioural equivalence has been discussed in Section 4.1 concluding with Eq. 32. Attaining a fixpoint Q * = Q i for some i ∈ N 0 is a consequence of finiteness of Q * and monotonicity Q i ⊆ Q i+1 ⊆ Q * in the iteration (34)-(36).

Algorithm and example
With the intent to have the necessary computational steps be clearly accessible we present an equivalent representation in the form of an algorithm; see Procedure 1.
In order to illustrate the application of the proposed procedure we will detail relevant construction steps for the Petri net depicted in Fig. 1. Here, all relevant vectors are triples of single digit integers and we can concisely write xyz for the vector (x, y, z) ∈ (N 0 ∪ { ‡}) 3 ; i.e., for the initial state with the marking as depicted we have (M 0 , C 0 ) = (201, 0 ‡0) and we start our reachability analysis with Q 0 = {(201, 0 ‡0)}. Following the algorithmic procedure we note that For the next iteration we additionally need to consider successors of the newly obtained state (111, 002). Therefore, we note Continuing in the same vein until the termination condition is reached at Q 5 = Q 4 , results in the max-plus automaton portrayed in Fig. 2.

Generalisation to open-loop race-policy semantics
In oder to address subsequent supervisory controller design, we now distinguish controllable and uncontrollable transitions; i.e., we consider a Petri net G = (P, T , F, M 0 ) as in Definition 3, however, the set of transitions is composed as a disjoint union T := T c∪ T u of Fig. 2 Resulting max-plus automaton G * controllable and uncontrollable transitions T c and T u , respectively. As in the purely logical setting, a supervisor can then be designed to disable any controllable transition at any instant of time. In contrast to the purely logical setting, such a supervisor potentially enlarges the timed behaviour under race-policy: disabling a transition that would otherwise win the race effectively enables alternative transitions that are not accounted for in the timed behaviour considered so far.
To obtain an open-loop model suitable as a basis for a subsequent supervisor design, such additional transitions must be included when transforming the Petri net into a max-plus automaton. In this section, we review and adapt our approach in this regard.

Behaviour considerations
Recalling the informal semantics (S1)-(S6), Section 3, we propose the below variations for (S5) and (S6) in order to address the open-loop configuration and to account for the potential effect of a supervisor. We refer to this variation as open-loop race policy.
(S5') As with plain race-policy semantics, a transition that can fire no later than any other enabled transition can always fire next. This accounts for supervisors, that do not disable the respective transition. Additionally, transitions that can fire no later than any uncontrollable transition can also fire next. This accounts for supervisors, that disable all earlier controllable transitions. If multiple transitions qualify under this policy, either one of them can fire next. (S6') Transitions will fire as soon as possible, while respecting the priorities imposed by Rule (S5').
Not that in the absence of controllable transitions, i.e. T c = ∅, rule (S5') matches plain race policy (S5) and, in turn (S6') matches the earliest firing rule (S6). In this sense, the proposed open-loop race semantics are a generalisation of plain race semantics.
We are now in the position to set up transitions in terms of semantic states similar to the case of plain race-semantics.
Technically, we let for M, M ∈ M, C, C ∈ C, a ∈ T and d ∈ R ≥0 if and only if Here, technical condition (ii') corresponds to rule (S5'), while (iii') ensures nonnegative weights. The latter could occur due to a supervisor disabling otherwise qualifying transitions.
The open-loop behaviour y G of the timed Petri net (G, τ ) under open-loop race policy is then defined literally as in the previous Definition 6, except that we now refer to the transitions defined by Eq. 50 as opposed to Eq. 23. Likewise, we set up the transition function δ literally as in Eq. 30 to obtain a behaviour equivalent max-plus automaton G = (Q, T , {(M 0 , C 0 )}, δ), i.e., we again have y G (w) = y G (w) for all w ∈ T * ; see also Section 4.1.

Finite realisation
Our aim in this section is to identify states with identical future behaviour. In order to proof that a realization of G with a finite state set exists, we show that all states of G can be assigned to a finite number of equivalence classes without changing the behaviour. Technically, our construction is based on the notion of quotient automata and language equivalent states. Both concepts are well known for plain automata (see e.g. Hopcroft and Ullman 1979), and we present a nearby adaption for our use case of deterministic max-plus automata.
Definition 7 For a given equivalence relation ≈ on the set of states Q of the max- In general, a quotient automaton realizes a "larger" behaviour than the original automaton in that it (a) picks up words in the logical behaviour that are not possible in the original automaton and in that it (b) provides a pessimistic estimate on the respective minimum duration; i.e., we have y G ≈ (w) ≥ y G (w) for all w ∈ A * . However, the behaviour is maintained exactly, provided that we only merge so called behavioural equivalent states.
Definition 8 Let G = (Q, A, {q 0 }, δ) be a max-plus automaton. For r, s ∈ Q we denote G r = (Q, A, r, δ) and G s = (Q, A, s, δ) the respective automaton obtained by substituting the initial state. Then, the two states r and s are called behavioural equivalent if y G r (w) = y G s (w) for all w ∈ A * . This is denoted by r bhv ∼ s and defines the behaviour equivalency bhv ∼ on Q associated with the automaton G.
As with plain automata (see e.g. Hopcroft and Ullman 1979), it can be verified by induction over the length of words that G and G bhv ∼ and G exhibit the same behaviour; note that this fact crucially relies on determinism and does not carry over to the general case of non-deterministic max-plus automata.
Lemma 2 Let G = (Q, A, {q 0 }, δ) be a max-plus automaton with behaviour equivalency bhv ∼ on Q and consider the quotient automaton G bhv ∼ . Then y G bhv ∼ (w) = y G (w) for all w ∈ A * .
Proof As a preliminary observation, we note that bhv ∼ is a right congruence, i.e., the equivalence of two states is retained under the execution of transitions with the same label.
For the induction hypothesis, assume that y G (w) = y G bhv ∼ (w) for some w ∈ A * . If y G bhv ∼ (w) = y G (w) ≥ 0, there exists a unique run π G of G associated with w that ends in a final state q ∈ Q and, as part of our induction hypothesis, we assume that there also exists a unique run π G bhv ∼ of G bhv ∼ associated with w that ends in the final state [q] ∈ Q ≈ .
For the base case, we have w = λ and observe y G (λ) = 0 = y G bhv ∼ (λ) with the unique trivial runs π G bhv ∼ and π G bhv ∼ consisting of the respective initial states q 0 ∈ Q and [q 0 ] ∈ Q ≈ .
This established the induction hypothesis for w = λ. For the induction step, consider the hypothesis for a specific w ∈ A * and one extra symbol a ∈ A. In the case of y G (w) = y G bhv ∼ (w) = , there exists no matching run and we observe y G (wa) = y G bhv ∼ (wa) = to conclude the induction step. From now on we consider y G (w) = y G bhv ∼ (w) = d ≥ 0, i.e., by determinism of G we have a unique run π G of G with associated word w and some final state q ∈ Q and by the induction hypothesis we have a unique run π G bhv ∼ of G bhv ∼ with associated word w and final state [q] ∈ Q ≈ . We again distinguish two cases. For case (a) we assume that G can execute a in state q. By the determinism of G, we pick the unique q ∈ Q and d ≥ 0 such that δ(q, a, q ) = d . Thus, we obtain a run π G of G with associated word wa and with final state q and we observe that y G (wa) = d + d .
By the definition of bhv ∼ , we observe that y G q (a) = y G p (a) = d for all p ∈ [q]. Now pick an arbitrary p ∈ [q]. Determinism of G then implies the unique existence of p ∈ Q with δ(p, a, p ) = d . Referring to our preliminary observation that bhv ∼ is a right congruence, we also have p ∈ [q ]. Since p ∈ [q] was chosen arbitrarily, we obtain δ ≈ ([q], a, [q ]) = d and δ ≈ ([q], a, r) = for all r = [q ]. Hence, there exists a unique run π G bhv ∼ of G bhv ∼ with associated word wa and final state [q ] ∈ Q ≈ . In particular, and we have that y G bhv ∼ (wa) = d + d = y G (wa). This concludes the induction step for case (a). For case (b), we assume that G can not execute a in state q. We then have y G q (a) = and, hence, y G (wa) = . By the definition of bhv ∼ , this implies y G p (a) = for any p ∈ [q] and, thus, δ(p, a, p ) = for any p ∈ [q] and any p ∈ Q. Thus, we obtain δ ≈ ([q], a, [q ]) = for any q ∈ Q. Regarding G bhv ∼ , this implies y G bhv ∼ (wa) = . This concludes the induction step for case (b).
For our specific use-case, we now seek for an equivalence relation on Q = M × C that is (a) at least as fine as the behaviour equivalence and that (b) obviously leads to a finite quotient automaton. To this end, our conjecture is that we can limit the value c t of each entry in the clock component by the corresponding duration parameter τ t without affecting the future behaviour. This is expressed by the following candidate equivalence.
In other words, two states are declared clock equivalent if their marking matches and if all clock entries either match exactly or are both at least as high as the corresponding timing parameter, i.e., the clock entries can only differ for two transitions which are both eligible to fire. For integer valued timing parameters, the quotient automaton w.r.t. clock equivalence clk ∼ is obviously finite. As with pure race-semantics, this carries over to rational timing parameters by suitable scaling. The following technical lemma is in support of our main result, in which we establish that clock equivalence is indeed at least as fine as behaviour equivalence.

Lemma
By the iterative definition of the weighted transitions for words this implies the existence of d 1 ∈ R ≥0 such that and, more specifically, that we must have d 2 = d +d 1 . Turning to the definition of individual transitions, we observe that conditions (i)-(vi) in Eq. 50 are to be satisfied, e.g., we clearly have that a ∈ En(M ). We now seek to establish a corresponding transition from state (M ,C ). For an argument by contradiction, assume that transition a cannot fire in state (M ,C ). Inspecting again conditions (i)-(vi) in Eq. 50, and recalling that a ∈ En(M ), this implies that condition (ii') is violated, i.e., transition a is not fast enough. Then, there exists a transition t ∈ En(M ) ∩ T u such that τ t −c t < τ a −c a . Since t is uncontrollable, its firing cannot be delayed or disabled and thus corresponds to race policy behaviour. With regard to Lemma 1 we conclude thatc t is bounded by τ t . Utilizing (M , C ) and as suchc a = min(τ a ,c a ) = min(τ a , c a ) = c a . Thus, we have τ t − c t < τ a − c a , and, hence, a contradiction to Eq. 55, more specifically to condition (ii') in Eq. 50. This concludes our argument by contradiction, and hence there must exist some somẽ To show that both durations d 1 andd 1 match, we refer to Eq. 50, condition (iii'), and indeed obtain by utilizing (51) and, hence, This in turn implies Observe that incrementing both clock vectors C andC , see Eqs. 17 and 50, condition (iv), with the same d 1 ∈ R ≥0 retains clock equivalency. Furthermore, as the marking component initially is i.e., clock equivalence is at least as fine as behaviour equivalence.
Proof We denote r = (M, C) and s = (M,C) and consider any w ∈ T * . In the case of y G r (w) = d ∈ R ≥0 , we refer to Lemma 3 and choose r , s ∈ Q such that and, hence, y G s (w) = d = y G r (w). If, on the other hand, y G r (w) = ε we must also have y G s (w) = ε, since y G s (w) = ε by Lemma 3 would imply y G r (w) = y G s (w) ∈ R ≥0 . In both cases, we have obtained y G s (w) = y G r (w). This constitutes behaviour equivalence of r and s.
As a consequence the quotient automaton G clk ∼ realizes the same behaviour as G while having a finite set of states. The resulting upper bound on the number of states is the same as in the race policy considerations.

Algorithmic procedure
Akin to the first procedure we now present an equivalent representation in the form of an algorithm; see Procedure 2. In the iterative construction process we choose for each equivalence class one state as a representative. This is done in line 12 by imposing the transition durations as an upper bound. Note that Procedure 2 yields the same result as Procedure 1, if no transitions are considered controllable, i.e., if T = T u .

Example in the context of supervisor design
In the situation where the timed Petri net represents a plant model and if its behaviour fails to satisfy a prescribed specification, we seek a supervisory controller to enforce the specification in closed-loop configuration. As with conventional controllers, a supervisor can only restrict the plant behaviour. Hence, the latter must be given as an open-loop behaviour to serve the purpose of controller design. In this section we demonstrate by a simple engineering application how max-plus automata obtained from timed Petri nets under open-loop race policy forms an adequate basis for the design of a supervisor.
Consider the timed Petri net (G, τ ) given by Fig. 3 as the model of a thermal cycle, where work pieces are alternatively heated or cooled. The work pieces are represented by tokens in the left loop. In compliance with single server semantics only one work piece can be processed at a time. In this regard the heating process b is only possible if a work piece has arrived and the waste heat valve is closed for two time units, indicated by a token in P 3 used by b. Thereafter the work piece has reached its desired temperature and has to leave the oven in order to avoid damage, i.e., the supervisor shall not disable transition b, hence our choice of b ∈ T u . As a means to reset the temperature in the oven, waste heat can be removed over one time unit to be used for other purposes. The token in P 3 acting as a shared resource implements this aspect of the physical plant. Furthermore, a work piece getting cooled for longer than three time units does no harm and the valve position can be set as desired, i.e. a, c ∈ T c . To this end, our transitions are partitioned by T c = {a, c} and T u = {b}.
We now invoke Procedure 2 to build a max-plus automaton with timed behaviour that represents all feasible sequences of transitions in the timed Petri net under open-loop race policy. The resulting max-plus automaton G * = (Q, T , Q 0 , δ) is depicted in Fig. 4. For   Fig. 4 max-plus automaton G * easier identification, the states of G * are additionally labelled with Roman numerals. A path in G * represents a firing sequence of transitions and the associated duration in the timed Petri net. For the given input data we observe a greatly increased behaviour compared to Procedure 1, addressing plain race policy, as in this case only transition c would ever be able to fire.
To further illustrate the usage of the constructed automaton we consider the following additional requirements: 1) the cooling station can only accommodate one work piece, i.e., capacity of P 1 is one; 2) two work pieces have to remain in the left loop at all times; 3) the heating and cooling processes have to alternate and complete two iterations; 4) the process is to be executed with minimal duration.
Requirement 2) is achieved by virtue of the chosen initial marking. Upholding 3) automatically implies that 1) is guaranteed. Time optimality and 4) will be attended after the logical requirements are met. Thus, at this stage we are left to address a purely logical closed-loop language-inclusion specification given by the upper bound L spec = (c * bc * ac * ) 2 , i.e., we require two cycles of transitions b followed by a and do not need to care about c. Technically, this can be expressed by the plain automaton G spec = (X, Σ, x 0 , f, X m ) with state set X = {A, B, C, D, E}, alphabet Σ = {a, b}, initial state x 0 = A, partial transition function f : X × Σ → X and set of marked states X m = {E}; see Fig. 5 for a graphical representation.
We can now use the parallel composition of G * and G spec to obtain all paths in G * that satisfy the language-inclusion specification, technically defined by where The result of this operation is represented in Fig. 6. The accepted language of G * G spec consists of all possible open-loop sequences of transitions that fulfil the specification. Note that at this stage a supervisor at instances can also disable uncontrollable transitions by prioritising a faster alternative transition. E.g., in state II a supervisor may schedule the faster transition c and thereby disable the uncontrollabale transition b. At a final stage, we may apply Dijkstra's algorithm in order to find time optimal solutions. In this context we are interested in the path with the lowest weight from the initial state to any accepted state. For this example, we obtain the following five time optimal paths w 1 = bcabca, y G * ||G spec (w 1 ) = 8, w 2 = bcabcac, y G * ||G spec (w 2 ) = 8, w 3 = bcabcca, y G * ||G spec (w 3 ) = 8, w 4 = bcabccac, y G * ||G spec (w 4 ) = 8, w 5 = bcabccca, y G * ||G spec (w 5 ) = 8.  A supervisor that enforces any of the above sequences of transitions will guarantee that the given requirements are upheld.

Conclusion
The main technical contribution of this paper, Theorems 1 and 2, establishes terminating procedures for the conversion of a timed Petri net to a deterministic finite max-plus automaton while retaining the timed behaviour. The assumptions imposed on the Petri net are boundedness, single server semantics, injective labelling, rational timing parameters, and operation under race policy. Although our argument follows the same line of thought as Komenda et al. (2016), our result is more general in that we do not need to impose fairness requirements on the Petri net. Moreover, we optionally account for controllable transitions, i.e., transitions that can be temporarily disabled by a supervisory controller. For this situation, our algorithm constructs a deterministic finite max-plus automaton which in open-loop is behaviour equivalent to the provided timed Petri net. Hence, the automaton representation is a suitable basis for supervisory controller design. This is demonstrated by example. For future work, we envisage a more formal discussion of control objectives and the resulting controller synthesis problem.
Funding Open Access funding enabled and organized by Projekt DEAL.
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder.
To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/. He is maintainer and principle developer of the discrete-event systems software library libFAUDES, with a particular focus on supervisory control in an industrial application context.