1 Introduction

Detectability is a basic property of dynamic systems: when it holds an observer can use the current and past values of the observed output signal produced by a system to reconstruct its current state (Giua and Seatzu 2002; Shu et al. 2007; Shu and Lin 2011, 2013a; Fornasini and Valcher 2013; Xu and Hong 2013; Zhang et al. 2016; Ru and Hadjicostis 2010; Yin and Lafortune 2017b; Masopust 2018; Keroglou and Hadjicostis 2015; Sasi and Lin 2018). This property plays a fundamental role in many related control problems such as observer design and controller synthesis. Hence for different applications, it is meaningful to characterize different notions of detectability. This property also has different terminologies, e.g., Giua and Seatzu (2002), Xu and Hong (2013), and Ru and Hadjicostis (2010), call it “observability” while Fornasini and Valcher (2013) and Zhang et al. (2016), call it “reconstructibility”. In this paper, we uniformly call this property “detectability”, and call another similar property “observability” implying that the initial state can be determined by the observed output signal produced by a system (e.g., Yin 2017; Shu and Lin 2013b; Zhang et al. 2018; Zhang and Zhang 2016).

1.1 Literature review

1.1.1 Finite automata

For discrete-event systems (DESs) modeled by finite automata, the detectability problem has been widely studied (Shu et al. 2007; Shu and Lin 2011; Zhang 2017; Masopust 2018; Yin and Lafortune 2017b) in the context of ω-languages, i.e., taking into account all output sequences of infinite length generated by a DES. These results are usually based on two assumptions that a system is deadlock-free and that it cannot generate an infinitely long subsequence of unobservable events. These requirements are collected in Assumption 1 formally stated in Section 3.2: when it holds, a system will always run and generate an infinitely long observation.

Two fundamental definitions are those of strong detectability and weak detectability (Shu et al. 2007). Strong detectability impliesFootnote 1 that:

(A) there exists a positive integer k such that for all infinite output sequences σ generated by a system, all prefixes of σ of length greater than k allow reconstructing the current states.

Weak detectability implies that:

(B) there exists a positive integer k and some infinite output sequence σ generated by a system such that all prefixes of σ of length greater than k allow reconstructing the current states.

Weak detectability is strictly weaker than strong detectability. Consider the finite automaton shown in Fig. 1, where events a and b can be directly observed. It is weakly detectable but not strongly detectable. The automaton can generate infinite event sequences aω and bω, where (⋅)ω denotes the concatenation of infinitely many copies of ⋅. When any number of a’s are observed but no b is observed, the automaton could be only in state s0. Hence it is weakly detectable. When any number of b’s are observed but no a is observed, it could be in states s1 or s2. Hence it is not strongly detectable.

Fig. 1
figure 1

A finite automaton

Strong detectability can be verified in polynomial time while weak detectability can be verified in exponential time (Shu et al. 2007; Shu and Lin 2011) under Assumption 1 given in Section 3.2.

In addition, checking weak detectability is PSPACE-complete in the numbers of states and events for finite automata, where the hardness result holds for deterministic finite automata whose events can be directly observed (Zhang 2017). The hardness result even holds for more restricted deterministic finite automata having only two events that can be directly observed (Masopust 2018).

1.1.2 Petri nets

Detectability of free-labeled Petri nets with unknown initial markings (i.e., states) has been studied by Giua and Seatzu (2002), where several types of detectability called “(strong) marking observability”, “uniform (strong) marking observability”, and “structural (strong) marking observability” are proved to be decidableFootnote 2 by reducing them to several decidable home space properties (Escrig and Johnen 1989) that are more general than the reachability problem of Petri nets (with respect to a given marking).

Some detectability properties of labeled Petri netsFootnote 3 have also been studied. In Ru and Hadjicostis (2010), a notion of detectability called “structural observability” is characterized. This property implies that for every initial marking, each observed label (i.e., output) sequence determines the current marking. It is pointed out that the “structural observability” is important, because “the majority of existing control schemes for Petri nets rely on complete knowledge of the system state at any given time step” (Ru and Hadjicostis 2010). It is shown that structural observability can be verified in polynomial time (Ru and Hadjicostis 2010). In the same paper, in order to make a labeled Petri net structurally observable, the problem of placing the minimal number of sensors on places and the problem of placing the minimal number of sensors on transitions are studied, respectively. The former problem is proved to be NP-complete, while the latter is shown to be solvable in polynomial time, both in the numbers of places and transitions.

In (Jančar 1994), for labeled Petri nets, a concept of determinism is characterized, where this concept implies that each label sequence generated by a net can be used to determine the current marking. It is proved that verifying determinism is as hard as verifying coverability for Petri nets (Rackoff 1978; Lipton 1976), hence EXPSPACE-complete. Note that the “structural observability” studied in Ru and Hadjicostis (2010) requires a labeled Petri net to satisfy the determinism property at each initial marking.

The above mentioned detectability results for labeled Petri nets apply to finite-length languages of the nets, i.e., the set of all words (of finite length) that a net can generate. In the sequel, we always use terminology “language” to denote “finite-length language” for short, and use “ω-language” to denote a “language” consisting of infinite-length label sequences. However, a few authors have recently studied detectability properties of ω-languages extending to labeled Petri net models the notions of strong and weak detectability which Shu and Lin have originally studied in the context of finite automata.

Weak detectability of labeled Petri nets with inhibitor arcs has been proved to be undecidable by Zhang and Giua (2018) by reducing the well known undecidable language equivalence problem (Hack 1976, Theorem 8.2) of labeled Petri nets to the inverse problem of the weak detectability problem, i.e., the non-weak detectability problem.

Decidability and complexity of strong detectability and weak detectability for labeled Petri nets are also studied by Masopust and Yin (2019). Under the first item of Assumption 1 given in Section 3.2 and another assumption that a net cannot generate an infinite unobservable sequence which is actually equivalent to the second item of Assumption 1 for Petri nets, strong detectability has been proved to be decidable with EXPSPACE-hard complexity by Masopust and Yin (2019) by reducing its negation to the satisfiability of a Yen’s path formula (Yen 1992; Atig and Habermehl 2009). Weak detectability has been proved to be undecidable by reducing the undecidable language inclusion problem (Hack 1976, Theorem 8.2) to the non-weak detectability problem, thus improving the related result given by Zhang and Giua (2018).

1.2 Contribution of the paper

In this paper, we propose some new notions of detectability in the context of ω-languages, and characterize the related decision problems (in terms of decidability or computational complexity) for both finite automata and labeled Petri nets.

To motivate the interest for this work, let us recall that the theory of ω-languages is a rich and important domain of computer science (Pin and Perrin 2004). We mention, in addition, that these languages have a practical interest in automatic control because they can describe the infinite behavior of a system: for this reason they find significant applications in the very active area of verification with discrete-event and hybrid systems — in particular model checking with temporal logic.

1.2.1 Eventual detectability

Let us consider again the notion of strong dectability implied by condition (A) stated above. An alternative definition could be based on the following definition:

(A’) for every infinite output sequence σ generated by a system, there exists a positive integer kσ such that all prefixes of σ of length greater than kσ allow reconstructing the current states,

where the length kσ of the transient before the state can be reconstructed may depend on a particular output sequence σ.

Obviously, condition (A) implies condition (A’) but the converse implication does not hold, because there may exist infinitely many strings of infinite length and thus a maximal value among all kσ may not be computed (this will be formally proved in Proposition 4).

We point out some similarities with the notion of diagnosability introduced by Lafortune and co-authors (Sampath et al. 1995) which requires the occurrence of a fault to be detected within a finite delay. The original definition by Sampath et al. (1995) assumes this delay may depend on the string that produces the fault, i.e., it is similar to condition (A’) above. A different condition, similar to condition (A) above and called K-step diagnosability or uniform diagnosability, is considered by Cabasino et al. (2012) or Yoo and Garcia (2004): it assumes the length of the delay is bounded for all strings. Note however a difference with respect to the detectability results we present here: the two notions of diagnosability and K-step diagnosability are equivalent in the case of finite automata, thanks to the well-known Myhill-Nerode characterization of a regular language by the finiteness of its set of residuals. They only differ for infinite-state systems, such as labeled Peri nets. Recent diagnosability results have also been presented by Ammour et al. (2018), Takai and Kumar (2018), Fabre et al. (2018), and Nunes et al. (2018), etc.

Based on condition (A’), we consider a new type of detectability, which we call eventual strong detectability. Formally, eventual strong detectability implies that for every infinite output sequence σ generated by a system, there exists a positive integer kσ such that each prefix \(\sigma ^{\prime }\) of σ with length greater than kσ allows reconstructing the current state. We will prove that eventual strong detectability is strictly weaker than strong detectability and strictly stronger than weak detectability, for labeled Petri nets and even for deterministic finite automata satisfying Assumption 1.

We will also prove that eventual strong detectability can be verified in polynomial time for finite automata. For labeled Petri nets, we show that the property is decidable and the corresponding decision problem is EXPSPACE-hard: note that this decidability result holds under the promptness assumption (collected in (ii) of Assumption 2) that is actually equivalent to condition (ii) of Assumption 1 for labeled Petri nets.

1.2.2 Approximate detectability

State estimation is usually a preliminary step that a plant operator must address so that, depending on the state value, a suitable action may be taken, which is also similar to the state disambiguation problem in the literature (Yin and Lafortune 2018; Sears and Rudie 2014; Wang et al. 2007). Examples include computing a control input in supervisory control, raising an alarm in fault diagnosis, inferring a secret in an opacity problem, reacting to the detection of a cyber-attack, etc. The number of these possible actions is usually finite and this naturally determines a finite partition of the system’s state space into equivalence classes, each one corresponding to states for which the same action should be taken. In such a context, it is not necessary to solve a detectability problem, i.e., determine the exact value of the state, but just to solve an approximate version of it, i.e., determine to which class the state belongs.

The notion of approximate detectability applies to all previously defined detectability notions, weak or strong. Here we just study one of them, namely weak approximate detectability which implies that, given a finite partition of the state space, there exists an integer k and an infinite output sequence generated by a system each of whose prefixes of length greater than k allows determining the partition cell to which the current state belongs. In this paper, we will prove that weak approximate detectability is undecidable for labeled P/T nets. For finite automata, we will prove that deciding this property is PSPACE-complete. The undecidable result is obtained by reducing the undecidable language equivalence problem for labeled P/T nets to negation of the weak approximate detectability problem. The result for finite automata is obtained by using related results for weak detectability of finite automata (Zhang 2017; Shu et al. 2007).

1.3 Paper structure

To help the reader better understand the contribution of the paper, the relations among the different detectability properties studied in this work are shown in Tables 1 and 2. The table also includes known results on strong detectability and weak detectability of finite automata and labeled Petri nets proved by Masopust and Yin (2019) and Zhang (2017).

Table 1 Relationships among different detectability notions for labeled Petri nets, where ⇒ means “the notion on the tail is stronger than the notion on the head”, ≠ means “the two notions are not equivalent by the counterexample shown in the figure beside ≠”, the decidability result for strong detectability proved by Masopust and Yin (2019) is based on Assumption 1, and can be strengthened to hold only based on the promptness assumption which is actually (ii) of Assumption 1 for labeled Petri nets by using our proposed extended concurrent composition method similarly as in the proof of Theorem 4. The decidability result for eventual strong detectability is also based on the promptness assumption
Table 2 Relationships among different detectability notions for finite automata, where s and e are the numbers of states and events, ⇒ means “the notion on the tail is stronger than the notion on the head”, ≠ means “the two notions are not equivalent by the counterexample shown in the figure beside ≠”; the polynomial-time verification algorithm for strong detectability given in Shu and Lin (2011) applies to finite automata satisfying Assumption 1, but generally does not apply to finite automata that violate Assumption 1; by using the proposed method in our paper, one can design a polynomial-time verification algorithm for strong detectability of all finite automata; the exponential-time verification algorithm for weak detectability given in Shu and Lin (2011) actually applies to finite automata satisfying the assumption of non-emptiness of generated ω-languages that is weaker than Assumption 1, and in this paper we characterize how to verify the weaker assumption and how to deal with the case when the weaker assumption is not satisfied

The remainder of the paper is as follows. Section 2 introduces necessary preliminaries, including finite automata, labeled Petri nets, the language equivalence problem, and the coverability problem, together with necessary tools such as Dickson’s lemma, Yen’s path formulae, etc. Section 3 collects the results on weak approximate detectability for finite automata and labeled Petri nets. Section 4 consists of the results on eventual strong detectability also for both models. Section 5 ends up with a short conclusion. We first study weak approximate detectability because fewer tools are needed than in studying eventual strong detectability.

2 Preliminaries

Next we introduce necessary notions that will be used throughout this paper. Symbols \(\mathbb {N}\) and \(\mathbb {Z}_{+}\) denote the sets of natural numbers and positive integers, respectively. For a set S, S and Sω are used to denote the sets of finite sequences (called words) of elements of S including the empty word 𝜖 and infinite sequences (called configurations) of elements of S, respectively. As usual, we denote S+ = S∖{𝜖}. For a word sS, |s| stands for its length, and we set \(|s^{\prime }|=+\infty \) for all \(s^{\prime }\in S^{\omega }\). For sS and natural number k, sk and sω denote the k-length word and configuration consisting of copies of s’s, respectively. For a word (configuration) sS(Sω), a word \(s^{\prime }\in S^{*}\) is called a prefix of s, denoted as \(s^{\prime }\sqsubset s\), if there exists another word (configuration) \(s^{\prime \prime }\in S^{*}(S^{\omega })\) such that \(s=s^{\prime }s^{\prime \prime }\). For two natural numbers ij, [i,j] denotes the set of all integers between i and j including i and j; and for a set S, |S| its cardinality and 2S its power set. For a word sS, where \(S=\{s_{1},\dots ,s_{n}\}\), (s)(si) denotes the number of si’s occurrences in s, i ∈ [1,n]. A partition of a set S is a set of nonempty subsets of S such that these subsets are pairwise disjoint and their union equals S.

2.1 Labeled state-transition systems

In order to formulate detectability notions in a uniform manner, we introduce labeled state-transition systems (LSTSs) as follows, which contain finite automata and labeled Petri nets as special cases. An LSTS is formulated as a sextuple

$$ {\mathcal S}=(X,T,X_{0},\to,{\Sigma},\ell), $$

where X is a set of states, T a set of events, X0X a set of initial states, →⊂ X × T × X a transition relation, Σ a set of outputs (labels), and : T →Σ∪{𝜖} a labeling function. As usual, we use − 1(σ) to denote the preimage {tT|(t) = σ} of an output σ ∈Σ. A state xX is called deadlock if \((x,t,x^{\prime })\notin \to \) for any tT and \(x^{\prime }\in X\). \(\mathcal {S}\) is called deadlock-free if it has no deadlock state. Events with label 𝜖 are called unobservable. Other events are called observable. Denote \(T=:T_{o}\dot {\cup } T_{\epsilon }\), where To and T𝜖 are the sets of observable events, and unobservable events, respectively. For an observable event tT, we say tcan be directly observed if (t) differs from \(\ell (t^{\prime })\) for any other \(t^{\prime }\in T\). Labeling function : T →Σ∪{𝜖} can be recursively extended to : TTω →Σ∪Σω as \(\ell (t_{1}t_{2}\dots )=\ell (t_{1}) \ell (t_{2})\dots \) and (𝜖) = 𝜖. For all \(x,x^{\prime }\in X\) and tT, we also denote \(x\xrightarrow []{t}x^{\prime }\) if \((x,t,x^{\prime })\in \to \). More generally, we denote all transitions \(x\xrightarrow []{t_{1}}x_{1}\), \(x_{1}\xrightarrow []{t_{2}}x_{2}\), \(\dots \), \(x_{n-1}\xrightarrow []{t_{n}}x_{n}\) by \(x\xrightarrow []{t_{1} {\dots } t_{n}}x_{n}\) for short, where n is a positive integer. We say a state \(x^{\prime }\in X\)is reachable from a statexX if there exist \(t_{1},\dots ,t_{n}\in T\) such that \(x\xrightarrow []{t_{1}{\dots } t_{n}}x^{\prime }\), where n is a positive integer. We say a subset \(X^{\prime }\)of X is reachable from a statexX if some state of \(X^{\prime }\) is reachable from x. Similarly a state xX is reachable from a subset \(X^{\prime }\)of X if x is reachable from some state of \(X^{\prime }\). We call a state xXreachable if either xX0 or it is reachable from some initial state. For an LSTS \(\mathcal {S}\), we call the new LSTS the accessible part (denoted by \(\text {Acc}(\mathcal {S})\)) of \(\mathcal {S}\) that is obtained from \(\mathcal {S}\) by removing all non-reachable states. An LSTS \(\mathcal {S}\) is called deterministic if for all \(x,x^{\prime },x^{\prime \prime }\in X\) and all tT, if \((x,t,x^{\prime })\in \to \) and \((x,t,x^{\prime \prime })\in \to \) then \(x^{\prime }=x^{\prime \prime }\).

For each σ ∈Σ, we denote by \({\mathscr{M}}({\mathcal S},\sigma )\) the set of states that the system can be in after σ has been observed, i.e., \({\mathscr{M}}({\mathcal S},\sigma ):= \{x\in X|(\exists x_{0}\in X_{0})(\exists s\in T^{+})[ (\ell (s)=\sigma )\wedge (x_{0}\xrightarrow []{s}x)]\}\). In addition, we set \({\mathscr{M}}({\mathcal S},\epsilon ):={\mathscr{M}}({\mathcal S},\epsilon )\cup X_{0}\). Particularly, for all \(X^{\prime }\subset X\) we denote \({\mathscr{M}}(X^{\prime },\epsilon ):=X^{\prime }\cup \{x\in X|(\exists x^{\prime }\in X^{\prime }) (\exists s\in T^{+})[(\ell (s)=\epsilon )\wedge (x^{\prime }\xrightarrow []{s}x)]\}\); and for all σ ∈Σ+, we denote \({\mathscr{M}}(X^{\prime },\sigma ):=\{ x\in X|(\exists x^{\prime }\in X^{\prime })(\exists s\in T^{+})[(\ell (s)=\sigma ) \wedge (x^{\prime }\xrightarrow []{s}x)]\}\). \({\mathscr{L}}({\mathcal S})\) denotes the language generated by system \(\mathcal S\), i.e., \({\mathscr{L}}({\mathcal S}):=\{\sigma \in {\Sigma }^{*}|{\mathscr{M}}({\mathcal S},\sigma )\ne \emptyset \}\). An infinite event sequence \(t_{1}t_{2}{\dots } \in T^{\omega }\) is called generated by\(\mathcal S\) if there exist states \(x_{0},x_{1},{\dots } \in X\) with x0X0 such that for all \(i\in \mathbb {N}\), (xi,ti+ 1,xi+ 1) ∈→. We use \({\mathscr{L}}^{\omega }({\mathcal S})\) to denote the ω-language generated by \(\mathcal S\), i.e., \({\mathscr{L}}^{\omega }(\mathcal { S}):=\{\sigma \in {\Sigma }^{\omega }|(\exists t_{1}t_{2}\dots \in T^{\omega } \text { generated by }\mathcal {S})[\ell (t_{1}t_{2}\dots )=\sigma ]\}\).

2.2 Finite automata

A DES can be modeled by a finite automaton or a labeled Petri net. In order to represent a DES, we consider a finite automaton as a finite LSTS \({\mathcal S}=(X,T,X_{0},\to ,{\Sigma },\ell )\), i.e., when X,T,Σ are finite. Such a finite automaton is also obtained from a standard finite automaton (Sipser 1996) by removing all accepting states, replacing a unique initial state by a set X0 of initial states, and adding a labeling function . In the sequel, a finite automaton always means a finite LSTS. Transitions \(x\xrightarrow []{t}x^{\prime }\) with (t) = 𝜖 are called 𝜖-transitions (or unobservable transitions), and other transitions are called observable transitions.

2.3 Labeled Petri nets

A net is a quadruple N = (P,T,Pre,Post), where P is a finite set of places graphically represented by circles; T is a finite set of transitions graphically represented by bars; PT, PT = ; \(Pre: P \times T\to \mathbb {N}\) and \(Post : P \times T \to \mathbb {N}\) are the pre- and post-incidence functions that specify the arcs directed from places to transitions, and vice versa. Graphically Pre(p,t) is the weight of the arc pt and Post(p,t) is the weight of the arc tp for all (p,t) ∈ P × T. The incidence function is defined as C = PostPre.

A marking is a map \(M: P \to \mathbb {N}\) that assigns to each place of a net a natural number of tokens, graphically represented by black dots. For a marking \(M\in \mathbb {N}^{P}\), the restriction of M to a subset \(P^{\prime }\) of P is denoted by \(M|_{P^{\prime }}\). For a marking \(M\in \mathbb {N}^ P\), a transition tT is called enabled at M if M(p) ≥ Pre(p,t) for all pP, and is denoted by M[t〉, where as usual \(\mathbb {N}^{P}\) denotes the set of maps from P to \(\mathbb {N}\). An enabled transition t at M may fire and yield a new making \(M^{\prime }(p)=M(p)+C(p,t)\) for all pP, written as \(M[t\rangle M^{\prime }\). As usual, we assume that at each marking and each time step, at most one transition fires. For a marking M, a sequence \(t_{1}{\dots } t_{n}\) of transitions is called enabled at M if t1 is enabled at M, t2 is enabled at the unique M2 satisfying M[t1M2, …, tn is enabled at the unique Mn− 1 satisfying M[t1〉⋯[tn− 1Mn− 1. We write the firing of \(t_{1}{\dots } t_{n}\) at M as \(M[t_{1}{\dots } t_{n}\rangle \) for short, and similarly denote the firing of \(t_{1}{\dots } t_{n}\) at M yielding \(M^{\prime }\) by \(M[t_{1}{\dots } t_{n}\rangle M^{\prime }\). \(\mathcal {T}(N,M_{0}) := \{s\in T^{*}|M_{0}[s\rangle \}\) is used to denote the set of transition sequences enabled at M0. Particularly we have M0[𝜖M0. A pair (N,M0) is called a Petri net or a place/transition net (P/T net), where N = (P,T,Pre,Post) is a net, \(M_{0}:P\to \mathbb {N}\) is called the initial marking, and the Petri net evolves initially at M0 as transition sequences fire. Denote the set of reachable markings of the Petri net by \(\mathcal {R}(N,M_{0}):=\{M\in \mathbb {N}^{P}|\exists s\in T^{*},M_{0}[s\rangle M\}\).

A labeled P/T net is a quadruple (N,M0,Σ,), where N is a net, M0 is an initial marking, Σ is an alphabet (a finite set of labels), and : T →Σ∪{𝜖} is a labeling function that assigns to each transition tT a symbol of Σ or the empty word 𝜖, which means when a transition t fires, its label (t) can be observed if (t) ∈Σ; and nothing can be observed if (t) = 𝜖. A transition tT is called observable if (t) ∈Σ, and called unobservable otherwise. Particularly, a labeling function : T →Σ is called 𝜖-free, and a P/T net with an 𝜖-free labeling function is called an 𝜖-free labeled P/T net. A Petri net is actually an 𝜖-free labeled P/T net with an injective labeling function. For a labeled P/T net G = (N,M0,Σ,), the language generated by G is denoted by \({\mathscr{L}}(G):=\{\sigma \in {\Sigma }^{*}|\exists s\in T^{*},M_{0}[s\rangle ,\ell (s)=\sigma \}\), i.e., the set of labels of finite transition sequences enabled at the initial marking M0. We also say for each \(\sigma \in {\mathscr{L}}(G)\), G generates σ. For σ ∈Σω, we say G generates σ if an infinite event sequence \(t_{1}t_{2}\dots \in T^{\omega }\) is enabled at M0 (denoted \(M_{0}[t_{1}t_{2}{\dots } \rangle \)) and \(\ell (t_{1}t_{2}\dots )=\sigma \). The set of infinite label sequences generated by G is denoted by \({\mathscr{L}}^{\omega }(G)\) (which is an ω-language).

Note that for a labeled P/T net G = (N,M0,Σ,), when we observe a label sequence σ ∈Σ, there may exist infinitely many firing transition sequences labeled by σ. However, for an 𝜖-free labeled P/T net, when we observe a label sequence σ, there exist at most finitely many firing transition sequences labeled by σ. Denote by \({\mathscr{M}}(G,\sigma ):=\{M\in \mathbb {N}^{P}|\exists s\in T^{*},M_{0}[s\rangle M,\ell (s)=\sigma \}\), the set of markings in which G can be when σ is observed. Then for each σ ∈Σ, \({\mathscr{M}}(G,\sigma )\) is finite for an 𝜖-free labeled P/T net G.

2.4 The language equivalence problem

The undecidable result proved in this paper is obtained by using the following language equivalence problem.

Proposition 1

(Hack 1976, Theorem 8.2) It is undecidable to verify whether two 𝜖-free labeled P/T nets with the same alphabet generate the same language.

2.5 Dickson’s lemma

Let P be a finite set. For every two elements x and y of \(\mathbb {N}^{P}\), we say xy if and only if x(p) ≤ y(p) for all p in P. We write x < y if xy and xy. For a subset S of \(\mathbb {N}^{P}\), an element xS is called minimal if for all y in S, yx implies y = x. Dickson’s lemma (Dickson 1913) shows that for each subset S of \(\mathbb {N}^{P}\), there exist at most finitely many distinct minimal elements. This lemma follows from the fact that every infinite sequence with all elements in \(\mathbb {N}^{P}\) has an increasing infinite subsequence, where such an increasing subsequence can be chosen component-wise (Reutenauer 1990, Theorem 2.5). We will use Dickson’s lemma to prove some decidable results for labeled P/T nets.

2.6 The coverability problem

We also need the following Proposition 2 on the coverability problem to obtain some main results on complexity.

Proposition 2

(Rackoff 1978; Lipton 1976) It is EXPSPACE-complete to decide for a Petri net G = (N,M0) and a destination marking\(M\in \mathbb {N}^{P}\) whether G covers M, i.e., whether there exists a marking \(M^{\prime }\in \mathcal {R}(N,M_{0})\) such that \(M\le M^{\prime }\).

In Lipton (1976), it is proved that deciding coverability for Petri nets requires at least 2cn space infinitely often for some constant c > 0, where n is the number of transitions. In Rackoff (1978), it is shown that deciding this property for a Petri net requires at most space \(2^{cm\log m}\) for some constant c, where m is the size of the set of all transitions. For a Petri net ((P,T,Pre,Post),M0), each transition tT corresponds to a |P|-length vector Post(⋅,t) − Pre(⋅,t) =: c(t) whose components are integers. The size of t is the sum of the lengths of the binary representations of the components of c(t) (where the length of 0 is 1). The size of T is the sum of the sizes of all transitions of T, and is set to be the above m.

The coverability problem belongs to EXPSPACE (Rackoff 1978). Proposition 2 has been used to prove the EXPSPACE-hardness of checking diagnosability (Yin and Lafortune 2017a) and prognosability (Yin 2018) of labeled Petri nets.

2.7 Infinite graphs

Let (V,E) be a directed graph, where V is the vertex set, and EV × V the edge set. For each edge \((v,v^{\prime })\in E\), also denoted by \(v\to v^{\prime }\), v and \(v^{\prime }\) are called the tail and the head of the edge, respectively, v is called a parent of \(v^{\prime }\) and \(v^{\prime }\) is called a child of v. A directed graph is called infinite if it has infinitely many vertices. A path is a sequence of vertices connected by edges with the same direction, i.e., a path is of one of the forms: (1) ⋯ → v− 1v0v1 →⋯ (bi-infinite), (2) v0v1 →⋯ (infinite), (3) ⋯ → v− 1v0 (anti-infinite), or (4) v1 →⋯ → vn (finite). For each finite path v1 →⋯ → vn, v1 is called an ancestor of vn, and vn is called a descendant of v1. A directed graph (V,E) is called a tree if there is a vertex v0 without any parent (called root), any other vertex is a descendant of v0 and the head of exactly one edge. A tree is called locally finite if each vertex has at most finitely many children.

2.8 Yen’s path formulae for Petri nets

The final tool that we will use to prove some decidable results is Yen’s path formula (Yen 1992; Atig and Habermehl 2009) for Petri nets. In Yen (1992), a concept of Yen’s path formulae is proposed and some upper bounds for verifying the satisfiability of the formulae are studied. In addition, it is shown that many problems, e.g., the boundedness problem, the coverability problem for Petri nets, can be reduced to the satisfiability problem of some Yen’s path formulae. In Atig and Habermehl (2009), a special class of Yen’s path formulae called increasing Yen’s path formulae is proposed. The main results of Atig and Habermehl (2009) are stated as follows.

Proposition 3

(Atig and Habermehl 2009) The reachability problem for Petri nets can be reduced to the satisfiability problem of some Yen’s path formula, and the satisfiability problem of each Yen’s path formula can be reduced to the reachability problem for Petri nets with respect to the marking with all places empty, all in polynomial time. In addition, the satisfiability of each increasing Yen’s path formula can be verified in EXPSPACE.

For a Petri net (N,M0), where N = (P,T,Pre,Post) is a net, each Yen’s path formula consists of the following elements:

  1. 1.

    Variables. There are two types of variables, namely, marking variables\(M_{1},M_{2},\dots \) and variables for transition sequences\(s_{1},s_{2},\dots \), where each Mi denotes an indeterminate function in \(\mathbb {Z}^{P}\) and each si denotes an indeterminate finite sequence of transitions, \(\mathbb {Z}\) is the set of integers.

  2. 2.

    Terms. Terms are defined recursively as follows.

    1. (a)

      ∀ constant \(c\in \mathbb {N}^{P}\), c is a term.

    2. (b)

      j > i, MjMi is a term, where Mi and Mj are marking variables.

    3. (c)

      T1 + T2 and T1T2 are terms if T1 and T2 are terms.

  3. 3.

    Atomic Predicates. There are two types of atomic predicates, namely transition predicates and marking predicates.

    1. (a)

      Transition predicates.

      • y(si) < c, y(si) = c, and y(si) > c are predicates, where i > 1, constant y\(\in \mathbb {Z}^{T}\), constant \(c\in \mathbb {N}\), and ⊙ denotes the inner product (i.e., \((a_{1},\dots ,a_{|T|}) \odot (b_{1},\dots ,b_{|T|})={\sum }_{i=1}^{|T|}a_{k}b_{k}\)).

      • (s1)(t) ≤ c and (s1)(t) ≥ c are predicates, where constant \(c\in \mathbb {N}\), tT.

    2. (b)

      Marking predicates.

      • Type 1. M(p) ≥ c and M(p) > c are predicates, where M is a marking variable and \(c\in \mathbb {Z}\) is constant.

      • Type 2. T1(i) = T2(j), T1(i) < T2(j), and T1(i) > T2(j) are predicates, where T1,T2 are terms and i,jT.

  4. 4.

    F1F2 and F1F2 are predicates if F1 and F2 are predicates.

A Yen’s path formula f is of the following form (with respect to Petri net (N,M0), where N = (P,T,Pre,Post)):

$$ \begin{array}{@{}rcl@{}} &&(\exists M_{1},\dots,M_{n}\in\mathbb{N}^{P})(\exists s_{1},\dots,s_{n}\in T^{*}) [ (M_{0}[s_{1}\rangle M_{1}[s_{2}\rangle\cdots[s_{n}\rangle M_{n})\\ &&\quad\wedge F(M_{1},\dots,M_{n},s_{1},\dots,s_{n})], \end{array} $$
(1)

where \(F(M_{1},\dots ,M_{n},s_{1},\dots ,s_{n})\) is a predicate.

Given a Petri net G and a Yen’s path formula f, we use Gf to denote that f is true in G. The satisfiability problem is the problem of determining, given a Petri net G and a Yen’s path formula f, whether Gf.

A Yen’s path formula (1) is called increasing if F does not contain transition predicates and implies MnM1. When n = 1, it naturally holds MnM1, then in this case an increasing Yen’s path formula is (∃M1)(∃s1)[(M0[s1M1) ∧ F(M1)].

The unboundedness problem can be formulated as the satisfiability of the increasing Yen’s path formula (∃M1,M2)(∃s1,s2)[(M0[s1M1[s2M2) ∧ (M2 > M1)].

The coverability problem can be formulated as the satisfiability of the increasing Yen’s path formula (∃M1)(∃s1)[(M0[s1M1) ∧ (M1M)], where M is the destination marking.

3 Weak approximate detectability

The concept of weak detectability is formulated as follows.

Definition 1 (WD)

Consider an LSTS \({\mathcal S}=(X,T,X_{0},\to ,{\Sigma },\ell )\). System \(\mathcal {S}\) is called weakly detectable if \({\mathscr{L}}^{\omega }(\mathcal {S})\ne \emptyset \) implies there exists a label sequence \(\sigma \in {\mathscr{L}}^{\omega }(\mathcal S)\) such that for some positive integer k, \(|{\mathscr{M}}({\mathcal S},\sigma ^{\prime })|=1\) for every prefix \(\sigma ^{\prime }\) of σ satisfying \(|\sigma ^{\prime }|\ge k\).

Sometimes, we do not need to determine the current state of an LSTS, but only need to know whether the current state belongs to some prescribed subset of reachable states. Then the concept of weak approximate detectability is formulated as below.

Definition 2 (WAD)

Consider an LSTS \({\mathcal S}=(X,T,X_{0},\to ,{\Sigma },\ell )\). Given a positive integer n > 1 and a partition \(\{R_{1},\dots ,R_{n}\}\) of the set of its reachable states, \(\mathcal S\) is called weakly approximately detectable with respect to partition \(\{R_{1},\dots ,R_{n}\}\) if \({\mathscr{L}}^{\omega }(\mathcal {S})\ne \emptyset \) implies there exists a label sequence \(\sigma \in {\mathscr{L}}^{\omega }(\mathcal S)\) such that for some positive integer k, for every prefix \(\sigma ^{\prime }\) of σ satisfying \(|\sigma ^{\prime }|\ge k\), \(\emptyset \ne {\mathscr{M}}({\mathcal S},\sigma ^{\prime })\subset R_{i_{\sigma ^{\prime }}}\) for some \(i_{\sigma ^{\prime }}\in [1,n]\).

Fig. 2
figure 2

A labeled P/T net G, where letters beside transitions denote their labels, each arc is with weight 1

3.1 Labeled Petri nets

One directly sees that if an LSTS is weakly detectable, then it is weakly approximately detectable with respect to every finite partition of its state space. However, if it is weakly approximately detectable with respect to some finite partition of its state space, then it is not necessarily weakly detectable. See the following example.

Example 1

Consider a labeled Petri net G in Fig. 2. We have \({\mathscr{L}}^{\omega }(G)=\{a^{\omega },b^{\omega }\}\). We also have for all \(k\in \mathbb {Z}_{+}\), \({\mathscr{M}}(G,a^{k})=\{(0,1,0,0,0),(1,0,0,0,0)\}\), \({\mathscr{M}}(G,b^{k})=\{(0,0,0,1,0),(0,0,0,0,1)\}\), where the components of a marking is in the order (p− 2,p− 1,p0,p1,p2). These observations show that the net is not weakly detectable. It is weakly approximately detectable with respect to the partition:

$$ \begin{array}{@{}rcl@{}} &&R_{1}=\{(0,0,1,0,0)\},\\ &&R_{2}=\{(0,0,0,1,0),(0,0,0,0,1)\},\\ &&R_{3}=\{(0,1,0,0,0),(1,0,0,0,0)\} \end{array} $$
(2)

of the set of its reachable markings. Also, this net is a nondeterministic finite automaton with (0,0,1,0,0) being the unique initial state. Similarly we have the automaton is also weakly approximately detectable with respect to partition (2) but not weakly detectable. In addition, this net becomes a deterministic finite automaton if we regard a and b as labels of four different events, respectively, and the corresponding deterministic finite automaton is also weakly approximately detectable with respect to partition (2) but not weakly detectable.

For the weak approximate detectability of labeled P/T nets, the following result holds.

Theorem 1

Let n > 1 be a positive integer. It is undecidable to verify for an 𝜖-free labeled P/T net and a partition \(\{R_{1},\dots ,R_{n}\}\) of the set of its reachable markings, whether the labeled P/T net is weakly approximately detectable with respect to \(\{R_{1},\dots ,R_{n}\}\).

Proof

We prove this result by reducing the language equivalence problem of labeled Petri nets (Proposition 1) to the problem under consideration. We only need to prove the case n = 2, since the undecidability of the case for any n greater than 2 trivially follows from that. In addition, in our reduction, the partition is computable by using the reachability algorithm (Kosaraju 1982; Mayr 1984; Lambert 1992).

Arbitrarily given two 𝜖-free labeled P/T nets \(G_{i}=(N_{i},{M_{0}^{i}},{\Sigma },\ell _{i})\), where Ni = (Pi,Ti,Prei,Posti), i = 1,2, P1P2 = , T1T2 = , we next construct a new 𝜖-free labeled P/T net \(G=(N_{G},{M_{0}^{G}},{\Sigma }\cup \{\sigma _{G}\},\ell _{G})\) from G1 and G2. G is specified as follows: (1) Add 5 places \(p_{0},{p_{1}^{1}},{p_{1}^{2}},p_{2},p_{3}\) to G1 and G2, where initially p0 has one token, and all the other places have no token. (2) Add 6 transitions \({t_{0}^{1}},{t_{0}^{2}}, {t_{1}^{1}},{t_{1}^{2}},t_{2},t_{3}\), and arcs \(p_{0}\to {t_{0}^{1}}\to {p_{1}^{1}}\to {t_{1}^{1}}\to p_{2}\to t_{2}\to p_{3}\to t_{3}\to p_{2}\), and \(p_{0}\to {t_{0}^{2}}\to {p_{1}^{2}}\to {t_{1}^{2}}\to p_{3}\), where these transitions are labeled by σG∉Σ. (3) For each transition tTi, add arcs \({p_{1}^{i}}\to t\to {p_{1}^{i}}\), i = 1,2. (4) All these newly added arcs are with weight 1. See Fig. 3 as a sketch.

Fig. 3
figure 3

Sketch for the reduction in the proof of Theorem 1, where all transitions outside G1G2 are with the same label.

For net G, initially only transition \({t_{0}^{1}}\) or \({t_{0}^{2}}\) can fire. After \({t_{0}^{1}}\) (\({t_{0}^{2}}\)) fires, the unique token in place p0 moves to place \({p_{1}^{1}}\) (\({p_{1}^{2}}\)), initializing net G1 (G2). While G1 (G2) is running, only transition \({t_{1}^{1}}\) (\({t_{1}^{2}}\)) outside T1T2 can fire. The firing of \({t_{1}^{1}}\) (\({t_{1}^{2}}\)) moves the token in place \({p_{1}^{1}}\) (\({p_{1}^{2}}\)) to place p2 (p3), and terminates the running of G1 (G2), yielding that the token in p2 (p3) can move along the direction p2p3p2 periodically forever, but G1 (G2) will never run again. Hence net G may fire only infinite transition sequences \({t_{0}^{1}} s {t_{1}^{1}}(t_{2}t_{3})^{\omega }\), \({t_{0}^{1}} s^{\prime }\), \({t_{0}^{2}} r {t_{1}^{2}}(t_{3}t_{2})^{\omega }\), or \({t_{0}^{2}} r^{\prime }\), where s ∈ (T1), \(s^{\prime }\in (T_{1})^{\omega }\), r ∈ (T2), \(r^{\prime }\in (T_{2})^{\omega }\). So G can generate only configurations σGσ(σG)ω or \(\sigma _{G}\sigma ^{\prime }\) where σ ∈Σ, \(\sigma ^{\prime }\in {\Sigma }^{\omega }\). Note that for some nets G1 and G2, the corresponding net G never fires \({t_{0}^{1}}s^{\prime }\) or \({t_{0}^{2}}r^{\prime }\) as above, e.g., when \({\mathscr{L}}(G_{1})\cup {\mathscr{L}}(G_{2})\) is finite; but for all G1 and G2, the corresponding G fires \({t_{0}^{1}} s {t_{1}^{1}}(t_{2}t_{3})^{\omega }\) and \({t_{0}^{2}} r {t_{1}^{2}}(t_{3}t_{2})^{\omega }\) as above.

We partition the set \(\mathcal {R}(N_{G},{M_{0}^{G}})\) of reachable markings of net G as follows:

$$ \begin{array}{@{}rcl@{}} R_{1} &=& \{M\in\mathbb{N}^{P_{G}}|M(p_{0})\text{ or }M({p_{1}^{1}})\text{ or }M(p_{2})=1, M({p_{1}^{2}})=M(p_{3})=0\}\\ &&\cap\mathcal{R}(N_{G},{M_{0}^{G}}),\\ R_{2} &=& \{M\in\mathbb{N}^{P_{G}}|M({p_{1}^{2}})\text{ or }M(p_{3})=1, M(p_{0})=M({p_{1}^{1}})=M(p_{2})=0\}\\ &&\cap \mathcal{R}(N_{G},{M_{0}^{G}}). \end{array} $$
(3)

By using the reachability algorithm in the literature, one can decide whether an arbitrary given marking belongs to R1, R2, or neither R1 nor R2.

If \({\mathscr{L}}(G_{1})\ne {\mathscr{L}}(G_{2})\), without loss of generality, we assume that there exists \(\sigma \in {\mathscr{L}}(G_{1})\setminus {\mathscr{L}}(G_{2})\). Then when G generates configuration σGσ(σG)ω, it can fire only transition sequences \({t_{0}^{1}} s{t_{1}^{1}}(t_{2}t_{3})^{\omega }\), where s ∈ (T1), G(s) = σ. It can be directly seen for each positive integer k, \(\emptyset \ne {\mathscr{M}}(G,\sigma _{G}\sigma (\sigma _{G})^{k})\subset R_{k \mod 2+1}\), where k mod 2 means the remainder of k divided by 2. That is, net G is weakly approximately detectable with respect to partition (3).

Next we assume that \({\mathscr{L}}(G_{1})={\mathscr{L}}(G_{2})\). Note that net G generates only configurations \(\sigma _{G}\sigma ^{\prime }\) or σGσ(σG)ω, where \(\sigma ^{\prime }\in {\Sigma }^{\omega }\), σ ∈Σ. For the former case, for each prefix \(\sigma ^{\prime \prime }\) of \(\sigma ^{\prime }\), there exist firing sequences s ∈ (T1) of net G1 and r ∈ (T2) of net G2 such that \(\ell _{G}(s)=\ell _{G}(r)=\sigma ^{\prime \prime }\), and markings \(M_{G},M_{G}^{\prime }\in \mathbb {N}^{P_{G}}\) such that \({M_{0}^{G}}[{t_{0}^{1}} s\rangle M_{G}\), \({M_{0}^{G}}[{t_{0}^{2}} r\rangle M_{G}^{\prime }\), \(M_{G}({p_{1}^{1}})=1\), \(M_{G}({p_{1}^{2}})=0\), \(M_{G}^{\prime }({p_{1}^{1}})=0\), and \(M_{G}^{\prime }({p_{1}^{2}})=1\), then we have \({\mathscr{M}}(G,\sigma ^{\prime \prime })\cap R_{1}\ne \emptyset \) and \({\mathscr{M}}(G,\sigma ^{\prime \prime })\cap R_{2}\ne \emptyset \). For the latter case, chosen an arbitrary prefix σGσ(σG)k of σGσ(σG)ω, where k is an arbitrary positive integer, we have there exist firing sequences s ∈ (T1) of net G1 and r ∈ (T2) of net G2 such that G(s) = G(r) = σ and net G can fire both \({t_{0}^{1}} ss^{\prime }\) and \({t_{0}^{2}} rr^{\prime }\), where \(s^{\prime }\) and \(r^{\prime }\) are k length prefixes of (t2t3)ω and (t3t2)ω, respectively. Since G will fire both \({t_{0}^{1}} ss^{\prime }\) and \({t_{0}^{2}} rr^{\prime }\), we have \({\mathscr{M}}(G,\sigma _{G}\sigma (\sigma _{G})^{k})\cap R_{1}\ne \emptyset \) and \({\mathscr{M}}(G,\sigma _{G}\sigma (\sigma _{G})^{k})\cap R_{2}\ne \emptyset \). Hence for each positive integer k, \({\mathscr{M}}(G,\sigma _{G}\sigma (\sigma _{G})^{k})\) intersects both R1 and R2. We have checked all label sequences generated by G, hence G is not weakly approximately detectable with respect to partition (3). □

3.2 Finite automata

Next, we study the complexity of deciding weak approximate detectability of finite automata.

An exponential-time algorithm for verifying weak detectability of a finite automaton \(\mathcal {S}\) under Assumption 1 is given in Shu and Lin (2011), but the algorithm actually applies to every \(\mathcal {S}\) satisfying \({\mathscr{L}}^{\omega }(\mathcal {S})\ne \emptyset \) which is weaker than Assumption 1. Automaton \(\mathcal {S}\) satisfying \({\mathscr{L}}^{\omega }(\mathcal {S})=\emptyset \) is naturally weakly detectable and hence weakly approximately detectable with respect to very finite partition of its set of reachable states as well, and the condition \({\mathscr{L}}^{\omega }(\mathcal {S})=\emptyset \) can be verified in linear time of the size of \(\mathcal {S}\) by computing all strongly connected components of \(\mathcal {S}\). Note that in Assumption 1, (ii) is actually a little weaker than the counterpart in Shu et al. (2007) and Shu and Lin (2011), as in these two papers, there is no requirement “reachable from an initial state”. However, one easily sees that existence of a cycle not reachable from an initial state consisting of only unobservable events does not violate the verification results for weak detectability given in Shu and Lin (2011).

Assumption 1

An LSTS \({\mathcal S}=(X,T,X_{0},\to ,{\Sigma },\ell )\) satisfies

  1. (i)

    \(\mathcal S\) is deadlock-free,

  2. (ii)

    no cycle in \(\mathcal S\) reachable from an initial state contains only unobservable events, i.e., for every reachable state xX and every nonempty unobservable event sequence s, there exists no transition sequence \(x\xrightarrow []{s}x\) in \(\mathcal S\).

In Assumption 1, (i) guarantees that the automaton never halts, (ii) ensures that for each infinite event sequence generated by the automaton, the corresponding label sequence is also of infinite length.

It is not difficult to see that weak approximate detectability is PSPACE-complete for finite automata. In order to show the PSPACE-hardness of weak approximate detectability with respect to a partition of cardinality n, we can slightly change the reduction in our paper (Zhang 2017) to reduce the finite automaton intersection problem to weak approximate detectability in polynomial time. To prove the PSPACE membership, we can reduce weak approximate detectability to weak detectability in polynomial time by constructing a quotient automaton from the original automaton, where elements of the corresponding partition are states of the quotient automaton. Hence the following theorem holds.

Theorem 2

  1. 1.

    The weak approximate detectability of finite automata can be verified in PSPACE.

  2. 2.

    Deciding weak approximate detectability of deterministic finite automata whose events can be directly observed is PSPACE-hard.

Remark 1

The notion of weak approximate detectability can be extended from a finite partition of the set of reachable states to a finite cover of that set. Such an extension may have potential applications in supervisor reduction of supervisory control theory. In supervisory control theory, the optimal solution to the control problem associated with a DES is the supremal supervisor (the supremal controllable sublanguage), and it is important to reduce the size of the supremal supervisor together with preserving some corresponding control actions (Cai and Wonham 2016; Su and Wonham 2004; Vaz and Wonham 1986), where the reduction is done based on a notion of control cover that is actually a cover of the state set. Under this extension, it is not difficult to see that the extended weak approximate detectability of finite automata can also be verified in PSPACE by the powerset construction used to verify weak detectability in Shu and Lin (2011), and it is undecidable to verify this notion for labeled Petri nets (from Theorem 1).

4 Eventual strong detectability

The concepts of strong detectability and eventual strong detectability are given as follows. The former implies there exists a positive integer k such that for each infinite label sequence generated by a system, each prefix of the label sequence of length greater than k allows reconstructing the current state. The latter implies that for each infinite label sequence generated by a system, there exists a positive integer k (depending on the label sequence) such that each prefix of the label sequence of length greater than k allows doing that. Hence the former is stronger than the latter.

Definition 3 (SD)

Consider an LSTS \({\mathcal S}=(X,T,X_{0},\to ,{\Sigma },\ell )\). System \(\mathcal S\) is called strongly detectable if there exists a positive integer k such that for each label sequence \(\sigma \in {\mathscr{L}}^{\omega }({\mathcal S})\), \(|{\mathscr{M}}({\mathcal S},\sigma ^{\prime })|=1\) for every prefix \(\sigma ^{\prime }\) of σ satisfying \(|\sigma ^{\prime }|>k\).

Definition 4 (ESD)

Consider an LSTS \({\mathcal S}=(X,T,X_{0},\to ,{\Sigma },\ell )\). System \({\mathcal S}\) is called eventually strongly detectable if for each label sequence \(\sigma \in {\mathscr{L}}^{\omega }({\mathcal S})\), there exists a positive integer kσ such that \(|{\mathscr{M}}({\mathcal S},\sigma ^{\prime })|=1\) for every prefix \(\sigma ^{\prime }\) of σ satisfying \(|\sigma ^{\prime }|>k_{\sigma }\).

By definition, strong detectability implies eventual strong detectability. The following Proposition 4 shows that they are not equivalent.

Proposition 4

Strong detectability strictly implies eventual strong detectability for labeled P/T nets and finite automata.

Proof

Consider the labeled P/T net G in Fig. 4, where a and b are labels of transitions. It can be seen that \({\mathscr{L}}^{\omega }(G)=a^{\omega }+a^{*}b^{\omega }+a^{*}ba^{\omega }:= \{a^{\omega }\}\cup \{a^{n}b^{\omega }|n\in \mathbb {N}\}\cup \{a^{n}ba^{\omega }|n\in \mathbb {N}\}\). One also has that \({\mathscr{M}}(G,a^{n})=\{(1,0,0)\}\), \({\mathscr{M}}(G,a^{n}b)=\{(0,1,0),(0,0,1)\}\), \({\mathscr{M}}(G,a^{n}bb^{m+1})=\{(0,1,0)\}\), \({\mathscr{M}}(G,a^{n}ba^{m+1})=\{(0,0,1)\}\) for all \(m,n\in \mathbb {N}\). Hence G is eventually strongly detectable, but not strongly detectable.

Fig. 4
figure 4

A labeled P/T net G that is eventually strongly detectable, but not strongly detectable

The net can be regarded as a deterministic finite automaton satisfying Assumption 1 when a and b are regarded as labels of events. By a direct observation, it is also eventually strongly detectable, but not strongly detectable. □

4.1 Finite automata

In order to give an easily understandable way to verify eventual strong detectability of finite automata, for a finite automaton \(\mathcal {S}=(X,T,X_{0},\to ,{\Sigma },\ell )\), we next construct three new automata from \(\mathcal {S}\).

Firstly, we construct its concurrent composition

$$ \text{CC}_{\mathrm{A}}(\mathcal{S})=(X^{\prime},T^{\prime},X_{0}^{\prime},\to^{\prime}) $$
(4)

as follows:

  1. 1.

    \(X^{\prime }=X\times X\);

  2. 2.

    \(T^{\prime }=T_{o}^{\prime }\cup T_{\epsilon }^{\prime }\), where \(T_{o}^{\prime }=\{(\breve {t},\breve {t}^{\prime })|\breve {t},\breve {t}^{\prime }\in T, \ell (\breve {t})=\ell (\breve {t}^{\prime })\in {\Sigma }\}\), \(T_{\epsilon }^{\prime }=\{(\breve {t},\epsilon )|\breve {t}\in T,\ell (\breve {t})=\epsilon \}\cup \{(\epsilon ,\breve {t})|\breve {t}\in T,\ell (\breve {t})=\epsilon \}\);

  3. 3.

    \(X_{0}^{\prime }=X_{0}\times X_{0}\);

  4. 4.

    for all \((\breve {x}_{1},\breve {x}_{1}^{\prime }),(\breve {x}_{2},\breve {x}_{2}^{\prime })\in X^{\prime }\), \((\breve {t},\breve {t}^{\prime }) \in T_{o}^{\prime }\), \((\breve {t}^{\prime \prime },\epsilon )\in T_{\epsilon }^{\prime }\), and \((\epsilon ,\breve {t}^{\prime \prime \prime })\in T_{\epsilon }^{\prime }\),

    • \(((\breve {x}_{1},\breve {x}_{1}^{\prime }),(\breve {t},\breve {t}^{\prime }),(\breve {x}_{2},\breve {x}_{2}^{\prime }))\in \to ^{\prime }\) if and only if \((\breve {x}_{1},\breve {t},\breve {x}_{2}),(\breve {x}_{1}^{\prime },\breve {t}^{\prime },\breve {x}_{2}^{\prime })\in \to \),

    • \(((\breve {x}_{1},\breve {x}_{1}^{\prime }),(\breve {t}^{\prime \prime },\epsilon ),(\breve {x}_{2},\breve {x}_{2}^{\prime }))\in \to ^{\prime }\) if and only if \((\breve {x}_{1},\breve {t}^{\prime \prime },\breve {x}_{2})\in \to \), \(\breve {x}_{1}^{\prime }=\breve {x}_{2}^{\prime }\),

    • \(((\breve {x}_{1},\breve {x}_{1}^{\prime }),(\epsilon ,\breve {t}^{\prime \prime \prime }),(\breve {x}_{2},\breve {x}_{2}^{\prime }))\in \to ^{\prime }\) if and only if \(\breve {x}_{1}=\breve {x}_{2}\), \((\breve {x}_{1}^{\prime },\breve {t}^{\prime \prime \prime },\breve {x}_{2}^{\prime })\in \to \).

For an event sequence \(s^{\prime }\in (T^{\prime })^{*}\), we use \(s^{\prime }(L)\) and \(s^{\prime }(R)\) to denote its left and right components, respectively. Similar notation is applied to states of \(X^{\prime }\). In addition, for every \(s^{\prime }\in (T^{\prime })^{*}\), we use \(\ell (s^{\prime })\) to denote \(\ell (s^{\prime }(L))\) or \(\ell (s^{\prime }(R))\), since \(\ell (s^{\prime }(L))=\ell (s^{\prime }(R))\). In the above construction, \(\text {CC}_{\mathrm {A}}(\mathcal {S})\) aggregates every pair of transition sequences of \(\mathcal {S}\) producing the same label sequence. In addition, \(\text {CC}_{\mathrm {A}}(\mathcal {S})\) has at most |X|2 states and at most \(|X|^{2}(2|T_{\epsilon }||X|+{\sum }_{\sigma \in {\Sigma }}|\ell ^{-1}(\sigma )|^{2} |X|^{2})\) transitions, where the number does not exceed |X|2(2|T𝜖||X| + |To|2|X|2). Hence it takes time \(O(2|X|^{3}|T_{\epsilon }|+|X|^{4}{\sum }_{\sigma \in {\Sigma }}|\ell ^{-1}(\sigma )|^{2})\) to construct \(\text {CC}_{\mathrm {A}}(\mathcal {S})\). For the special case when all observable events can be directly observed studied in Shu and Lin (2011), the complexity reduces to O(2|X|3|T𝜖| + |X|4|To|). See the following example.

Example 2

A finite automaton \({\mathcal S}\) and its concurrent composition \(\text {CC}_{\mathrm {A}}(\mathcal {S})\) are shown in Fig. 5.

Fig. 5
figure 5

A finite automaton (left) and its concurrent composition (right, only the accessible part illustrated)

Secondly, we construct its observation automaton

$$ \text{Obs}(\mathcal{S})=(X,\{\varepsilon,\hat\epsilon\},X_{0},\to^{\prime},\{\hat\epsilon\},\ell^{\prime}) $$
(5)

in linear time of the size of \(\mathcal {S}\), where \(\to ^{\prime }\subset X\times \{\varepsilon ,\hat \epsilon \}\times X\), \(\ell ^{\prime }(\varepsilon )=\epsilon \), \(\ell ^{\prime }(\hat \epsilon )=\hat \epsilon \), for every two states \(x,x^{\prime }\in X\), \((x,\hat \epsilon ,x^{\prime })\in \to ^{\prime }\) if there exists tT such that \((x,t,x^{\prime })\in \to \) and (t)≠𝜖; \((x,\varepsilon ,x^{\prime }) \in \to ^{\prime }\) if there exists tT such that \((x,t,x^{\prime })\in \to \) and for all \(t^{\prime }\in T\) with \((x,t^{\prime },x^{\prime })\in \to \), \(\ell (t^{\prime })=\epsilon \). Here the labeling function \(\ell ^{\prime }\) is also naturally extended to \(\ell ^{\prime }:\{\varepsilon ,\hat \epsilon \}^{*}\cup \{\varepsilon ,\hat \epsilon \}^{\omega }\to \{\hat \epsilon \}^{*}\cup \{\hat \epsilon \}^{\omega }\). One sees that \({\mathscr{L}}^{\omega }(\mathcal S)\ne \emptyset \) if and only if in \(\text {Obs}(\mathcal {S})\) there is a transition sequence \(x_{0}\xrightarrow []{s}x \xrightarrow []{s^{\prime }}x\) such that x0X0, \(s,s^{\prime }\in \{\varepsilon ,\hat \epsilon \}^{*}\), and \(\ell ^{\prime }(s^{\prime })\ne \epsilon \).

Thirdly, we also need to construct its bifurcation automaton

$$ \text{Bifur}(\mathcal{S})=(X,\{\bar\epsilon,\check\epsilon\},X_{0},\to^{\prime},\{\bar\epsilon,\check\epsilon\},\ell^{\prime}) $$
(6)

in linear time of the size of \(\mathcal {S}\), where \(\to ^{\prime }\subset X\times \{\bar \epsilon ,\check \epsilon \}\times X\), \(\ell ^{\prime }(\bar \epsilon )=\bar \epsilon \), \(\ell ^{\prime }(\check \epsilon )=\check \epsilon \), \(\ell ^{\prime }\) is also naturally extended to \(\ell ^{\prime }:\{\bar \epsilon ,\check \epsilon \}^{*}\cup \{\bar \epsilon ,\check \epsilon \}^{\omega }\to \{\bar \epsilon ,\check \epsilon \}^{*}\cup \{\bar \epsilon ,\check \epsilon \}^{\omega }\), transitions \(x\xrightarrow []{\bar \epsilon }x^{\prime }\) are called fair transitions, transitions \(x\xrightarrow []{\check \epsilon }x^{\prime }\) are called bifurcation transitions, for every two states i,jX, (1) \((j,\bar \epsilon ,i),(j,\check \epsilon ,i)\notin \to ^{\prime }\) if ¬A1, (2) \((x,\bar \epsilon ,x^{\prime })\in \to ^{\prime }\) if A1A2A3, (3) \((x,\check \epsilon ,x^{\prime })\in \to ^{\prime }\) otherwise, where

$$ \begin{array}{@{}rcl@{}} A_{1} &=& (\exists t\in T)[(j,t,i)\in\to],\\ A_{2} &=& (\nexists t\in T,j^{\prime}\in X)[((j,t,j^{\prime})\in\to)\wedge(\ell(t)=\epsilon) \wedge(j^{\prime}\ne j)],\\ A_{3} &=& (\forall t\in T)[(((j,t,i)\in\to)\wedge(\ell(t)\ne\epsilon))\implies\\ && (\nexists t^{\prime}\in T,j^{\prime}\in X)[((j,t^{\prime},j^{\prime})\in\to)\wedge(\ell(t^{\prime})=\ell(t)) \wedge(j^{\prime}\ne i)]]. \end{array} $$

Ones sees that both fair transitions and bifurcation transitions can be 𝜖-transitions or observable transitions. Next we explain the relation between \(\text {Bifur}(\mathcal {S})\), the original automaton \(\mathcal {S}\), and the concurrent composition \(\text {CC}_{\mathrm {A}}(\mathcal {S})\). Here (1) holds if there is no transition from state j to state i in \(\mathcal {S}\); (2) holds if there exists a transition from j to i, and none of such transitions has a bifurcation in \(\mathcal {S}\); and (3) holds if there is a transition from j to i that has a bifurcation also in \(\mathcal {S}\). For the case that (3) holds, if A1 holds but A2 does not hold, then for \(\mathcal {S}\) one has \(\{j\}\subsetneq {\mathscr{M}}(\{j\},\epsilon )\) and hence \(|{\mathscr{M}}(\{j\},\epsilon )|>1\), for \(\text {CC}_{\mathrm {A}}(\mathcal {S})\) there is a transition \((j,j)\xrightarrow []{(\epsilon ,\tilde t)}(j,i^{\prime })\) with \(\ell (\tilde t)=\epsilon \) and \(i^{\prime }\ne j\); if A1 and A2 hold but A3 does not hold, then for \(\mathcal {S}\) one has \(|{\mathscr{M}}(\{j\},\epsilon )|=1\), \(\{i\}\subsetneq {\mathscr{M}}(\{j\},\ell (\tilde t^{\prime }))\), and hence \(|{\mathscr{M}}(\{j\},\ell (\tilde t^{\prime }))|>1\) for some \(\tilde t^{\prime }\in T\) with \(\ell (\tilde t^{\prime })\ne \epsilon \) and \((j,\tilde t^{\prime },i)\in \to \); for \(\text {CC}_{\mathrm {A}}(\mathcal {S})\) there is a transition \((j,j)\xrightarrow []{(\tilde t^{\prime },\tilde t^{\prime \prime })}(i,i^{\prime })\) with \(i^{\prime }\ne i\) and \(\ell (\tilde t^{\prime })=\ell (\tilde t^{\prime \prime })\) for the above \(\tilde t^{\prime }\).

One also has that for all states x and \(x^{\prime }\), there is a transition from x to \(x^{\prime }\) in \(\mathcal {S}\) if and only if there is a transition from x to \(x^{\prime }\) in \(\text {Obs}(\mathcal {S})\) if and only if there is a transition from x to \(x^{\prime }\) in \(\text {Bifur}(\mathcal {S})\). This obvious observation is helpful in verifying eventual strong detectability for finite automata.

Example 3

Reconsider the finite automaton \(\mathcal {S}\) in Example 2 (in the left part of Fig. 5). Its observation automaton and bifurcation automaton are seen in Fig. 6. It has a unique initial state and generates a nonempty ω-language. In addition, all its states are reachable.

Fig. 6
figure 6

Observation automaton (left) and bifurcation automaton (right) of the automaton in the left part of Fig. 5

We next use the concurrent composition, the observation automaton, and the bifurcation automaton of a finite automaton \(\mathcal {S}\) defined by (4), (5), and (6) to verify its eventual strong detectability without any assumption. Note that by using a similar way, one can design a polynomial-time algorithm for verifying strong detectability, which strengthens the polynomial-time verification algorithm given in Shu and Lin (2011) under Assumption 1. In addition, the method in Shu and Lin (2011) can also be used to check eventual strong detectability, but also only under Assumption 1.

Theorem 3

The eventual strong detectability of finite automata can be verified in polynomial time.

Proof

Consider a finite automaton \({\mathcal S}=(X,T,X_{0},\to ,{\Sigma },\ell )\) and another finite automaton \(\text {Acc}(\text {CC}_{\mathrm {A}}(\mathcal {S}))=(X^{\prime },T^{\prime },X_{0}^{\prime },\to ^{\prime })\). We use \(\text {Acc}(\text {CC}_{\mathrm {A}}(\mathcal {S}))\), \(\text {Obs}(\text {Acc}(\mathcal {S}))\), and \(\text {Bifur}(\text {Acc}(\mathcal {S}))\) to verify its eventual strong detectability.

One observes by definition that \(\mathcal {S}\) is not eventually strongly detectable if and only if

$$ \begin{array}{@{}rcl@{}} &&\text{there is an infinite transition sequence }x_{0}\xrightarrow[]{s_{1}}\text{ such that} \end{array} $$
(7a)
$$ \begin{array}{@{}rcl@{}} &&x_{0}\in X_{0},\text{ }\ell(s_{1})\in{\Sigma}^{\omega}\text{ and for every }n\in\mathbb{Z}_{+}, \text{ there is a prefix } \end{array} $$
(7b)
$$ \begin{array}{@{}rcl@{}} &&s_{1}^{\prime}\text{ of }s_{1}\text{ satisfying } |\ell(s_{1}^{\prime})|>n\text{ and }|\mathcal{M}(\mathcal{S},\ell(s_{1}^{\prime}))|>1. \end{array} $$
(7c)

We claim that (7) holds if and only if one of the following items holds:

  1. (1)

    In \(\text {Acc}(\text {CC}_{\mathrm {A}}(\mathcal {S}))\), there exists an infinite transition sequence

    $$ \begin{array}{@{}rcl@{}} x_{0}^{\prime}\xrightarrow[]{s_{1}^{\prime}}x_{1}^{\prime}\xrightarrow[]{s_{2}^{\prime}}\cdots \end{array} $$
    (8)

    such that \(x_{0}^{\prime }\in X_{0}^{\prime }\), for every \(i\in \mathbb {Z}_{+}\), \(s_{i}^{\prime }\in (T^{\prime })^{*}\), \(\ell (s_{i}^{\prime })\in {\Sigma }^{+}\), and \(s_{i}^{\prime }(L)\ne s_{i}^{\prime }(R)\).

  2. (2)

    In \(\mathcal {S}\), there exists an infinite transition sequence

    $$ \begin{array}{@{}rcl@{}} x_{0}\xrightarrow[]{s_{1}}x_{1}\xrightarrow[]{s_{2}}x_{2}\xrightarrow[]{s_{3}}\cdots \end{array} $$
    (9)

    such that x0X0, for all \(i\in \mathbb {Z}_{+}\), siT, \(\ell (s_{i+1})\in {\Sigma }^{+}\), and \(|{\mathscr{M}}(\{x_{i}\},\sigma )|>1\) for some \(\sigma \sqsubset \ell (s_{i+1})\).

It is trivial to see that either Item (1) or Item (2) implies (7).

Conversely suppose that (7) holds but Item (2) does not hold. Then for \(\mathcal {S}\), there is an infinite transition sequence

$$ \begin{array}{@{}rcl@{}} \bar x_{0}\xrightarrow[]{\bar s_{1}}\bar x_{1}\xrightarrow[]{\bar s_{2}}\bar x_{2}\xrightarrow[]{\bar s_{3}}\cdots \end{array} $$
(10)

satisfying (7b) and (7c) such that for every \(i\in \mathbb {Z}_{+}\), \(\bar s_{i}\in T^{*}\), \(\ell (\bar s_{i+1})\in {\Sigma }^{+}\), and \(|{\mathscr{M}}(\{\bar x_{i}\},\bar \sigma )|=1\) for all \(\bar \sigma \sqsubset \ell (\bar s_{i+1})\). Fix such a sequence (10). Then for every \(i\in \mathbb {Z}_{+}\), there exists a finite transition sequence

$$ \bar {x_{0}^{i}}\xrightarrow[]{\bar {s_{1}^{i}}}\cdots\xrightarrow[]{\bar {s_{i}^{i}}}\bar {x_{i}^{i}} $$
(11)

such that \(\bar {x_{0}^{i}}\in X_{0}\), for all j ∈ [1,i], one has \(\ell (\bar {s_{j}^{i}})=\ell (\bar s_{j})\), \(\bar {x_{j}^{i}}\ne \bar x_{j}\). Choose k sufficiently large, by the finiteness of X, we obtain a transition sequence

$$ \bar x_{0}^{\prime}\xrightarrow[]{\bar s_{1}^{\prime}}\cdots\xrightarrow[]{\bar s_{k}^{\prime}}\bar x_{k}^{\prime} $$
(12)

of \(\text {Acc}(\text {CC}_{\mathrm {A}}(\mathcal {S}))\) such that \(\bar x_{0}^{\prime }\in X_{0}^{\prime }\), the left component and the right component of Eq. 12 are a prefix of (10) and (11) with i = k; for all i ∈ [1,k], \(\bar x_{i}^{\prime }(L)\ne \bar x_{i}^{\prime }(R)\), and \(\bar x_{l^{\prime }}^{\prime }=\bar x_{l^{\prime \prime }}^{\prime }\) for some \(0< l^{\prime }<l^{\prime \prime }\le k\). Then the prefix \(\bar x_{0}^{\prime }\xrightarrow []{\bar s_{1}^{\prime }}{\cdots } \xrightarrow []{\bar s_{l^{\prime }}^{\prime }}\bar x_{l^{\prime }}^{\prime }\xrightarrow []{\bar s_{l^{\prime }+1}^{\prime }}{\cdots } \xrightarrow []{\bar s_{l^{\prime \prime }}^{\prime }}\bar x_{l^{\prime \prime }}^{\prime }\) of Eq. 12 can be extended to an infinite transition sequence of the form (8) by repeating \(\bar x_{l^{\prime }}^{\prime } \xrightarrow []{\bar s_{l^{\prime }+1}^{\prime }}\cdots \xrightarrow []{\bar s_{l^{\prime \prime }}^{\prime }}\bar x_{l^{\prime \prime }}^{\prime }\) for infinitely many times, i.e., Item (1) holds.

Next we show that both Item (1) and Item (2) can be verified in polynomial time.

Observe that Item (1) holds if and only if in \(\text {Acc}(\text {CC}_{\mathrm {A}}(\mathcal {S}))\), there is a finite transition sequence

$$ \tilde x_{0}^{\prime}\xrightarrow[]{\tilde s_{1}^{\prime}}\tilde x_{1}^{\prime}\xrightarrow[]{\tilde s_{2}^{\prime}}\tilde x_{1}^{\prime} $$
(13)

with \(\tilde x_{0}^{\prime }\in X_{0}^{\prime }\), \(\tilde s_{1}^{\prime },\tilde s_{2}^{\prime }\in (T^{\prime })^{*}\) such that \(\ell (\tilde s_{2}^{\prime })\in {\Sigma }^{+}\) and \(\tilde x_{1}^{\prime }(L)\ne \tilde x_{1}^{\prime }(R)\). Next we verify (13) in polynomial time. See Fig. 7 for a sketch.

  1. 1.

    Compute \(\text {Obs}(\text {Acc}(\text {CC}_{\mathrm {A}}(\mathcal {S})))\).

  2. 2.

    Compute all strongly connected components of \(\text {Obs}(\text {Acc}(\text {CC}_{\mathrm {A}}(\mathcal {S})))\).

  3. 3.

    Denote the set of states \((x,\bar x)\) of \(\text {Obs}(\text {Acc}(\text {CC}_{\mathrm {A}}(\mathcal {S})))\) with \(x\ne \bar x\) that belong to a cycle with nonempty label sequence by \(X_{c}^{\prime }\), check whether \(X_{c}^{\prime }\ne \emptyset \).

Each of the first two steps costs linear time of \(\text {CC}_{\mathrm {A}}(\mathcal {S})\). Note that \(X_{c}^{\prime }\ne \emptyset \) if and only if (13) holds. Observe that \(X_{c}^{\prime }\ne \emptyset \) if and only if in one of the obtained strongly connected components, there is an observable transition and a state \((x^{\prime },\bar x^{\prime })\) with \(x^{\prime }\ne \bar x^{\prime }\). Hence the third step also costs linear time. Overall, verifying Item (1) costs linear time of \(\text {CC}_{\mathrm {A}}(\mathcal {S})\), at most O(|X|4|T|2).

Fig. 7
figure 7

A sketch for verifying (13).

Also observe that Item (2) holds if and only if in \(\mathcal {S}\), there exists a finite transition sequence

$$ \begin{array}{@{}rcl@{}} \tilde x_{0}\xrightarrow[]{\tilde s_{1}}\tilde x_{1}\xrightarrow[]{\tilde s_{2}}\tilde x_{1} \end{array} $$
(14)

such that \(\tilde x_{0}\in X_{0}\), \(\tilde s_{1},\tilde s_{2}\in T^{*}\), \(\ell (\tilde s_{2})\in {\Sigma }^{+}\), and \(|{\mathscr{M}}(\{\tilde x_{1}\},\sigma )|>1\) for some \(\sigma \sqsubset \ell (\tilde s_{2})\).

Next we show that Eq. 14 can be verified in polynomial time. See Fig. 8 for a sketch.

  1. 1.

    Compute \(\text {Obs}(\text {Acc}(\mathcal {S}))\) and \(\text {Bifur}(\text {Acc}(\mathcal {S}))\).

  2. 2.

    Compute Xoc and Xbc, where Xoc (resp. Xbc) is the set of states of \(\text {Acc}(\mathcal {S})\) that belong to a cycle containing an observable transition (resp. a bifurcation transition).

  3. 3.

    Check whether XocXbc = .

Note that a state x of \(\text {Acc}(\mathcal {S})\) belongs to a cycle containing an observable transition (resp. a bifurcation transition) if and only if x is any state of any strongly connected component of \(\text {Obs}(\text {Acc}(\mathcal {S}))\) (resp. \(\text {Bifur}(\text {Acc}(\mathcal {S}))\)) that contains an observable transition (resp. a bifurcation transition). Then one has XocXbc if and only if (14) holds. Hence it takes linear time of \(\mathcal {S}\) to check whether Item (2) holds. □

Example 4

Recall the finite automaton \(\mathcal {S}\) in the left part of Fig. 5. Following the procedure in the proof of Theorem 3, by Figs. 5 and 6, we have Xoc = {s0,s1}, Xbc = , XocXbc = (implying that Item (2) does not hold), and \(X_{c}^{\prime }=\emptyset \) (implying that Item (1) does not hold either), then \(\mathcal {S}\) is eventually strongly detectable.

Remark 2

By using a similar method as in the proof of Theorem 3, one can design a polynomial-time verification algorithm for strong detectability of finite automata without any assumption, with complexity linear of the size of \(\text {Obs}(\text {Acc}(\text {CC}_{\mathrm {A}}(\mathcal {S})))\), hence at most O(|X|4|T|2).

Fig. 8
figure 8

A sketch for verifying (14)

Let us analyse the computational complexity of using (Shu and Lin 2011, Theorem 5) to verify strong detectability of finite automata satisfying Assumption 1. In Shu and Lin (2011), for a finite automaton \(\mathcal {S}\) (satisfying Assumption 1), a nondeterministic finite automaton Gdet with at most |X|2/2 + |X|/2 + 1 states and at most (|X|2/2 + |X|/2 + 1)2|T| transitions is constructed to verify its strong detectability, where every state of Gdet is a subset of states of \(\mathcal {S}\) with cardinality 1 or 2, except for the initial state of Gdet being a superset of X0. The time consumption for computing Gdet is as follows:

i.e., at most O(2|X|3|To| + |X|4|Σ||T𝜖| + |X|4|Σ|). For the special case when all observable events can be directly observed studied in Shu and Lin (2011), the complexity is O(2|X|3|To| + |X|4|To||T𝜖| + |X|4|To|). Actually, this construction tracks sets of states of \(\mathcal {S}\) with consistent observations, which is similar to the powerset construction that is of exponential size of \(\mathcal {S}\). It is proved that \(\mathcal {S}\) is strongly detectable if and only if every state of Gdet reachable from a cycle is a singleton. This condition can be check in linear time of Gdet by computing strongly connected components of Gdet.

However, this method generally does not apply to a finite automaton that does not satisfy Assumption 1. For example, let us consider the finite automaton \(\mathcal {S}\) in the left part of Fig. 5. Remove the self-loop on s1, and denote the new automaton by \(\bar {\mathcal {S}}\). Then one directly sees that \({\mathscr{L}}^{\omega } (\bar {\mathcal {S}})=\{a^{\omega }\}\), and \(\bar {\mathcal {S}}\) is strongly detectable. However, in the corresponding Gdet, which consists of a self-loop with label a on {s0} and a transition from {s0} to {s1,s2} with label b, there is a state {s1,s2} with cardinality 2 reachable from a cycle, hence \(\bar {\mathcal {S}}\) is not strongly detectable by Shu and Lin (2011, Theorem 5). Actually, the verification method does not apply to this example because, two deadlock states s1 and s2 are not in any infinite-length transition sequence, but reachable from a state s0 that belongs to an infinite-length transition sequence with infinite-length label sequence.

Remark 3

Eventual strong detectability is a uniform concept. That is, a labeled Petri net is eventually strongly detectable if and only if it is eventually strongly detectable when its initial marking is replaced by any of its reachable markings. Formally, for a labeled Petri net G = (N,M0,Σ,), G is eventually strongly detectable if and only if \(G^{\prime }=(N,M,{\Sigma },\ell )\) is eventually strongly detectable for each \(M\in \mathcal {R}(N,M_{0})\).

Example 5

Consider a labeled P/T net G as shown in Fig. 9, where a,b are labels. We have \({\mathscr{L}}^{\omega }(G)=a^{\omega }+ a^{*}b^{\omega }\), \(|{\mathscr{M}}(G,a^{n})|=1\), \(|{\mathscr{M}}(G,a^{n}b^{m})|=2\) for all \(m,n\in \mathbb {Z}_{+}\). Hence the net is weakly detectable, but not eventually strongly detectable. The deterministic finite automaton obtained from the net when a and b are regarded as labels of events (particularly b as the label of four different events) is also weekly detectable, but not eventually strongly detectable.

Fig. 9
figure 9

A labeled P/T net G that is weakly detectable, but not eventually strongly detectable.

4.2 Labeled Petri nets

In this subsection we discuss the decidability and complexity of eventual strong detectability for labeled Petri nets.

If a labeled Petri net G satisfies \({\mathscr{L}}^{\omega }(G)=\emptyset \), then it is naturally eventually strongly detectable. Actually whether the property \({\mathscr{L}}^{\omega }(G)=\emptyset \) holds can be verified in EXPSPACE, and can also be guaranteed by the following Assumption 2 that is weaker than the widely used Assumption 1 in detectability studies of DESs.

Proposition 5

Verifying whether a labeled Petri net G satisfies \({\mathscr{L}}^{\omega }(G)=\emptyset \) belongs to EXPSPACE.

Proof

Consider a labeled Petri net G = (N = (P,T,Pre,Post),M0,Σ,). Observe that \({\mathscr{L}}^{\omega }(G)\ne \emptyset \) if and only if there exists an infinite firing sequence

$$ M_{0}[s_{1}\rangle M_{1}[s_{2}\rangle\cdots $$
(19)

such that for each \(i\in \mathbb {Z}_{+}\), \(\ell (s_{i})\in {\Sigma }^{+}\).

For G, a sequence (19) exists if and only if G satisfies the following Yen’s path formula

$$ (\exists \widetilde{M}_{1},\widetilde{M}_{2})(\exists \widetilde{s}_{1},\widetilde{s}_{2}) [(M_{0}[\widetilde{s}_{1}\rangle \widetilde{M}_{1}[\widetilde{s}_{2}\rangle \widetilde{M}_{2})\wedge(\widetilde{M}_{2} \ge \widetilde{M}_{1})\wedge(\ell(\widetilde{s}_{2})\in{\Sigma}^{+})]. $$
(20)

The “if” part follows from \(\widetilde {M}_{1}[\widetilde {s}_{2}\rangle \widetilde {M}_{2}\) being a repetitive firing sequence (hence can consecutively fire for infinitely many times) and \(|\ell (\widetilde {s}_{2})|>0\).

For the “only if” part: Arbitrarily fix a sequence (19). By Dickson’s lemma, in the set \(\{M_{0},M_{1},\dots \}\), there are totally finitely many distinct minimal elements. Choose k > 0 such that \(\{M_{0},\dots ,M_{k}\}\) contains the maximal number of distinct minimal elements of \(\{M_{0},M_{1},\dots \}\), then there exist \(0\le k^{\prime }\le k< k^{\prime \prime }\) such that \(M_{k^{\prime }}\le M_{k^{\prime \prime }}\). Then the firing sequence \(M_{0}[s_{1}{\dots } s_{k^{\prime \prime }}\rangle M_{k^{\prime \prime }}[s_{k^{\prime }+1}\dots s_{k^{\prime \prime }}\rangle M^{\prime }\) satisfies \(M_{k^{\prime \prime }}\le M^{\prime }\) and \(\ell (s_{k^{\prime }+1}{\dots } s_{k^{\prime \prime }})\in {\Sigma }^{+}\).

The satisfiability of (20) is actually a fair nondetermination problem and hence belongs to EXPSPACE (Atig and Habermehl 2009, Subsection 6.1). □

Assumption 2

  1. (i)

    A labeled P/T net G does not terminate, i.e., there exists an infinite firing sequence at the initial marking, and

  2. (ii)

    it is prompt, i.e., there exists no repetitive firing sequence labeled by the empty string.

Note that the deadlock-freeness assumption (see (i) of Assumption 1) implies (i) of Assumption 2, but not vice versa; (ii) of Assumption 2 is actually equivalent to (ii) of Assumption 1 for labeled Petri Petri nets. Note also that for a labeled P/T net G, \({\mathscr{L}}^{\omega }(G)\ne \emptyset \) implies that G does not terminate, but not vice versa, because transitions could be labeled by 𝜖. Verifying termination of Petri nets (the first part of Assumption 2) is EXPSPACE-complete by the results of Rackoff (1978) and Lipton (1976). Verifying promptness of labeled Petri nets belongs to EXPSPACE (Atig and Habermehl 2009). In addition, promptness is equivalent to all infinite firing sequences being labeled by infinite-length sequences.

In order to characterize eventual strong detectability for labeled Petri nets, we introduce the concurrent composition of a labeled Petri net. Given a labeled P/T net G = (N = (P,T,Pre,Post),M0,Σ,), we construct in polynomial time its concurrent composition as a Petri net

$$ \text{CC}_{\mathrm{N}}(G)=(N^{\prime}=(P^{\prime},T^{\prime},Pre^{\prime},Post^{\prime}),M_{0}^{\prime}) $$
(21)

which aggregates every pair of firing sequences of G producing the same label sequence. Denote \(P=\{\breve {p}_{1},\dots ,\breve {p}_{|P|}\}\) and \(T=\{\breve {t}_{1},\dots ,\breve {t}_{|T|}\}\), duplicate them to \(P_{i}=\{\breve {p}_{1}^{i},\dots ,\breve {p}_{|P|}^{i}\}\) and \(T_{i}=\{\breve {t}_{1}^{i},\dots ,\breve {t}_{|T|}^{i}\}\), i = 1,2, where we let \(\ell (\breve {t}_{i}^{1})=\ell (\breve {t}_{i}^{2})=\ell (\breve {t}_{i})\) for all i in [1,|T|]. Then we specify \(G^{\prime }\) as follows:

  1. 1.

    \(P^{\prime }=P_{1}\cup P_{2}\);

  2. 2.

    \(T^{\prime }=T_{o}^{\prime }\cup T_{\epsilon }^{\prime }\), where \(T_{o}^{\prime }=\{(\breve {t}_{i}^{1},\breve {t}_{j}^{2})\in T_{1}\times T_{2}|i,j\in [1,|T|],\ell (\breve {t}_{i}^{1})= \ell (\breve {t}_{j}^{2})\in {\Sigma }\}\), \(T_{\epsilon }^{\prime }=\{(\breve {t}_{1},\epsilon )|\breve {t}_{1}\in T_{1},\ell (\breve {t}_{1})=\epsilon \} \cup \{(\epsilon ,\breve {t}_{2})|\breve {t}_{2}\in T_{2},\ell (\breve {t}_{2})=\epsilon \}\);

  3. 3.

    for all k ∈ [1,2], all l ∈ [1,|P|], and all i,j ∈ [1,|T|] such that \(\ell (\breve {t}_{i}^{1})= \ell (\breve {t}_{j}^{2})\in {\Sigma }\),

    $$ \begin{array}{@{}rcl@{}} Pre^{\prime}(\breve{p}_{l}^{k},(\breve{t}_{i}^{1},\breve{t}_{j}^{2})) &=& \left\{ \begin{array}[]{ll} Pre(\breve{p}_{l}^{k},\breve{t}_{i}^{1}) &\text{if }k=1,\\ Pre(\breve{p}_{l}^{k},\breve{t}_{j}^{2}) &\text{if }k=2, \end{array} \right.\\ Post^{\prime}(\breve{p}_{l}^{k},(\breve{t}_{i}^{1},\breve{t}_{j}^{2})) &= &\left\{ \begin{array}[]{ll} Post(\breve{p}_{l}^{k},\breve{t}_{i}^{1}) &\text{if }k=1,\\ Post(\breve{p}_{l}^{k},\breve{t}_{j}^{2}) &\text{if }k=2; \end{array} \right. \end{array} $$
  4. 4.

    for all l ∈ [1,|P|], all i ∈ [1,|T|] such that \(\ell (\breve {t}_{i}^{1})=\ell (\breve {t}_{i}^{2})=\epsilon \),

    $$ \begin{array}{@{}rcl@{}} Pre^{\prime}(\breve{p}_{l}^{1},(\breve{t}_{i}^{1},\epsilon)) &=& Pre(\breve{p}_{l}^{1},\breve{t}_{i}^{1}),\\ Pre^{\prime}(\breve{p}_{l}^{2},(\epsilon,\breve{t}_{i}^{2})) &=& Pre(\breve{p}_{l}^{2},\breve{t}_{i}^{2}),\\ Post^{\prime}(\breve{p}_{l}^{1},(\breve{t}_{i}^{1},\epsilon)) &=& Post(\breve{p}_{l}^{1},\breve{t}_{i}^{1}),\\ Post^{\prime}(\breve{p}_{l}^{2},(\epsilon,\breve{t}_{i}^{2})) &=& Post(\breve{p}_{l}^{2},\breve{t}_{i}^{2}); \end{array} $$
  5. 5.

    \(M_{0}^{\prime }(\breve {p}_{l}^{k})=M_{0}(\breve {p}_{l})\) for any k in [1,2] and any l in [1,|P|].

A labeled Petri net and its concurrent composition are shown in Figs. 10 and 11, respectively.

Fig. 10
figure 10

A labeled Petri net G, where event a is unobservable, but b can be directly observed

Fig. 11
figure 11

Concurrent composition of the net in Fig. 10

Assume that there exists a label sequence \(\sigma \in {\mathscr{L}}(G)\) such that \(|{\mathscr{M}}(G,\sigma )|>1\), then there exist transitions \(t_{\mu _{1}},\dots ,t_{\mu _{n}},t_{\omega _{1}},\dots ,t_{\omega _{n}}\in T\cup \{\epsilon \}\), where n ≥ 1, such that \(\ell (t_{\mu _{i}})=\ell (t_{\omega _{i}})\) for all i ∈ [1,n], \(\ell (t_{\mu _{1}}{\dots } t_{\mu _{n}})=\ell (t_{\omega _{1}}{\dots } t_{\omega _{n}})=\sigma \), \(M_{0}[t_{\mu _{1}}{\dots } t_{\mu _{n}}\rangle M_{1}\) and \(M_{0}[t_{\omega _{1}}\dots t_{\omega _{n}}\rangle M_{2}\) for different M1 and M2 both in \(\mathbb {N}^{P}\). Then for CCN(G), we have \(M_{0}^{\prime }[(t_{\mu _{1}}^{1},t_{\omega _{1}}^{2})\dots (t_{\mu _{n}}^{1},t_{\omega _{n}}^{2})\rangle M^{\prime }\), where \(M^{\prime }(\breve {p}_{l}^{k})=M_{k}(\breve {p}_{l})\), k ∈ [1,2], l ∈ [1,|P|], and \(M^{\prime }(\breve {p}^{1}_{l^{\prime }})\ne M^{\prime }(\breve {p}^{2}_{l^{\prime }})\) for some \(l^{\prime }\in [1,|P|]\) (briefly denoted by \(M^{\prime }|_{P_{1}}\ne M^{\prime }|_{P_{2}}\)).

Assume that for each label sequence \(\sigma \in {\mathscr{L}}(G)\), we have \(|{\mathscr{M}}(G,\sigma )|=1\). Then for all \(M^{\prime }\in \mathcal {R}(N^{\prime },M_{0}^{\prime })\), \(M^{\prime }(\breve {p}^{1}_{l})=M^{\prime }(\breve {p}^{2}_{l})\) for each l in [1,|P|] (briefly denoted by \(M^{\prime }|_{P_{1}}=M^{\prime }|_{P_{2}}\)).

We next characterize eventual strong detectability for labeled P/T nets. If a labeled Petri net G satisfies \({\mathscr{L}}^{\omega }(G)=\emptyset \), then it is eventually strongly detectable.

Checking strong detectability for labeled P/T nets is proved to be decidable and EXPSPACE-hard in the size of a labeled P/T net (Masopust and Yin 2019) under Assumption 1 (it is not difficult to see that the assumption “there does not exist an infinite unobservable sequence” used in Masopust and Yin (2019) is equivalent to promptness by Dickson’s lemma). Here the size of a P/T net G = (N = (P,T,Pre,Post),M0) is \(\lceil \log |P|\rceil +\lceil {\log |T|}\rceil +\) the size of {Pre(p,t)|pP,tT}∪{Post(p,t)|pP,tT}∪{M0(p)|pP}, where the last term means the sum of the lengths of the binary representations of the elements of {Pre(p,t)|pP,tT}∪{Post(p,t)|pP,tT}∪{M0(p)|pP} (Atig and Habermehl 2009; Yen 1992). Hence the size of a labeled P/T net can be defined as the sum of the size of its underlying P/T net and that of its labeling function : T →Σ∪{𝜖}, where the latter is actually no greater than |T|.

Consider a labeled Petri net G. Consider a reachable marking M1 of G and a firing sequence ψ = M1[t2M2[t3〉⋯[tlMl, where l > 1 ti is a transition of G for every i ∈ [2,l]. We say that ψ has a bifurcation if there exists k ∈ [2,l] such that in the concurrent composition CCN(G) of G, there is a firing sequence \(M_{1}^{\prime }[t_{2}^{\prime }\rangle M_{2}^{\prime }[ t_{3}^{\prime }\rangle \cdots [t_{n}^{\prime }\rangle M_{n}^{\prime }\) for some n > 1 and with all \(t_{2}^{\prime },\dots ,t_{n}^{\prime }\) being transitions of CCN(G) such that \(M_{1}^{\prime }|_{P_{1}}=M_{1}^{\prime }|_{P_{2}}=M_{1}\), \(M_{n}^{\prime }|_{P_{1}}=M_{k}\), the left component of \(t_{2}^{\prime }{\dots } t_{n}^{\prime }\) equals \(t_{2}{\dots } t_{k}\), and \(M_{k^{\prime }}^{\prime }|_{P_{1}}\ne M_{k^{\prime }}^{\prime }|_{P_{2}}\) for some \(k^{\prime }\in [2,n]\).

For G, for two infinite firing sequences

$$ \begin{array}{@{}rcl@{}} &&M_{0}[\widetilde{t}_{1}\rangle \widetilde{M}_{1}[\widetilde{t}_{2}\rangle\cdots\text{ and } \end{array} $$
(22a)
$$ \begin{array}{@{}rcl@{}} &&M_{0}[\widehat{t}_{1}\rangle \widehat{M}_{1}[\widehat{t}_{2}\rangle\cdots, \end{array} $$
(22b)

where \(\widetilde {t}_{i},\widehat {t}_{i}\) are transitions of G for all \(i\in \mathbb {Z}_{+}\), we call they merge after a finite time if in CCN(G), there is an infinite firing sequence \(M_{0}^{\prime }[t_{1}^{\prime }\rangle M_{1}^{\prime }[t_{2}^{\prime }\rangle \cdots \) with \(t_{1}^{\prime },t_{2}^{\prime },\dots \) all being transitions of CCN(G) such that the left component and right component of \(t_{1}^{\prime }t_{2}^{\prime }\dots \) equal \(\widetilde {t}_{1} \widetilde {t}_{2}\dots \) and \(\widehat {t}_{1}\widehat {t}_{2}\dots \), respectively, and there exists \(k\in \mathbb {Z}_{+}\) such that \(M_{j}^{\prime }|_{P_{1}}={M}_{j}^{\prime }|_{P_{2}}\) for all j > k.

Theorem 4

  1. (1)

    The eventual strong detectability of a labeled P/T net G under (ii) of Assumption 2 is decidable.

  2. (2)

    Deciding whether a labeled P/T net G with \({\mathscr{L}}^{\omega }(G)\ne \emptyset \) is eventually strongly detectable is EXPSPACE-hard.

Proof

(1) Proof of the decidability result:

By Proposition 5, we first verify whether G satisfies \({\mathscr{L}}^{\omega }(G)\ne \emptyset \) in EXPSPACE. If no, then G is eventually strongly detectable. Otherwise, continue the following procedure.

Consider a labeled Petri net G = (N = (P,T,Pre,Post),M0,Σ,) with \({\mathscr{L}}^{\omega }(G)\) being nonempty. By definition, G is not eventually strongly detectable if and only if there exists \(\sigma \in {\mathscr{L}}^{\omega }(G)\) such that for all \(k\in \mathbb {N}\) there exists a prefix \(\bar \sigma \) of σ satisfying \(|\bar \sigma |>k\) and \(|{\mathscr{M}}(G,\bar \sigma )|>1\). We construct the concurrent composition \(\text {CC}_{\mathrm {N}}(G)=(N^{\prime }=(P^{\prime },T^{\prime },Pre^{\prime },Post^{\prime }),M_{0}^{\prime })\) of G as in (21).

We claim that G is not eventually strongly detectable if and only if one of the following two items holds (see Examples 6 and 7):

  1. (1)

    In CCN(G), there exists an infinite firing sequence

    $$ \begin{array}{@{}rcl@{}} M_{0}^{\prime}[s_{1}^{\prime}\rangle M_{1}^{\prime}[s_{2}^{\prime}\rangle\cdots, \end{array} $$
    (23)

    where for every \(i\in \mathbb {Z}_{+}\), \(s_{i}^{\prime }\) contains a transition of \(T_{o}^{\prime }\), and \(M_{i}^{\prime }|_{P_{1}}\ne M_{i}^{\prime }|_{P_{2}}\).

  2. (2)

    In G, there exists an infinite firing sequence

    $$ \begin{array}{@{}rcl@{}} M_{0}[s_{1}\rangle M_{1}[s_{2}\rangle M_{2}[s_{3}\rangle \cdots \end{array} $$
    (24)

    such that M0[s1M1 has a bifurcation, for each \(i\in \mathbb {Z}_{+}\), \(\ell (s_{i})\in {\Sigma }^{+}\), and Mi[si+ 1Mi+ 1 also has a bifurcation.

Apparently if Item (1) or Item (2) holds, then G is not eventually strongly detectable.

Suppose that G is not eventually strongly detectable. Then there exists an infinite firing sequence

$$ \begin{array}{@{}rcl@{}} M_{0}[\bar s_{1}\rangle \overline{M}_{1}[\bar s_{2}\rangle \overline{M}_{2}[\bar s_{3}\rangle \cdots \end{array} $$
(25)

such that \(\ell (\bar s_{i})\in {\Sigma }^{+}\) and \(|{\mathscr{M}}(G,\ell (\bar s_{1}\dots \bar s_{i}))|>1\) for all \(i\in \mathbb {Z}_{+}\). Next we fix such a sequence (25).

Furthermore, suppose that Item (1) does not hold. Then (25) and each infinite firing sequence of G staring at M0 and having the same label sequence as (25) has will merge after a finite time, since the label sequence of (25) is of infinite length. Next we prove that Item (2) holds. If in (25), infinitely many of \(M_{0}[\bar s_{1}\rangle \overline {M}_{1}\), \(\overline {M}_{1}[\bar s_{2}\rangle \overline {M}_{2}\), \(\dots \) have bifurcations, then (25) is a firing sequence satisfying the requirement in Item (2). Next we assume that there are only finitely many of them having bifurcations, and reach a contradiction. Without loss of generality, we assume that only \(M_{0}[\bar s_{1}\rangle \overline {M}_{1}\) has a bifurcation. Then for each \(k\in \mathbb {Z}_{+}\), there exists a firing sequence \(M_{0}[\widetilde {s}_{k}\rangle \widetilde { M}_{k}\) such that \(\ell (\widetilde {s}_{k})\sqsubset \ell (\bar s_{1}\bar s_{2}\dots )\), \(|\ell (\widetilde {s}_{k})|>k\), and some prefix of (25) and \(M_{0}[\widetilde {s}_{k}\rangle \widetilde { M}_{k}\) can be combined to obtain a firing sequence \(M_{0}^{\prime }[\overline {s}_{k}^{\prime }\rangle \overline {M}_{k}^{\prime }\) of CCN(G) such that the label sequence of the right component of \(\overline {s}_{k}^{\prime }\) equals \(\ell (\widetilde {s}_{k})\), \(\overline {M}_{k}^{\prime }|_{P_{2}}=\widetilde {M}_{k}\), and \(\overline {M}_{k}^{\prime }|_{P_{1}}\ne \overline {M}_{k}^{\prime }|_{P_{2}}\). Collecting all such firing sequences \(M_{0}[\widetilde {s}_{k}\rangle \widetilde {M}_{k}\), \(k\in \mathbb {Z}_{+}\), we obtain a locally finite, infinite tree \(\mathbb T\) with M0 the root. Also collect all such markings \(\widetilde {M}_{k}\), \(k\in \mathbb {Z}_{+}\), to obtain a set \(\mathbb {M}\). Observe that in \(\mathbb {T}\), M0 has infinitely many descendants of \(\mathbb {M}\). Also observe in \(\mathbb {T}\) that one of the finitely many children of M0 also has infinitely many descendants of \(\mathbb {M}\), denote such a child of M0 by \(\widehat {M}_{1}\), then we obtain a firing sequence \(M_{0}[\widehat {t}_{1}\rangle \widehat {M}_{1}\) of G, where \(\widehat {t}_{1}\in T\). Since \(\mathbb {T}\) is locally finite, repeating the process of looking for \(M_{0}[\widehat {t}_{1}\rangle \widehat {M}_{1}\), we can obtain an infinite firing sequence

$$ M_{0}[\widehat{t}_{1}\rangle \widehat{M}_{1}[\widehat{t}_{2}\rangle\cdots $$
(26)

of G such that for each \(i\in \mathbb {Z}_{+}\), \(\widehat {M}_{i}\) has infinitely many descendants of \(\mathbb {M}\) in \(\mathbb {T}\). By (ii) of Assumption 2, we have (26) is labeled by an infinite-length label sequence. Also, since for each \(i\in \mathbb {Z}_{+}\), \(M_{0}[\widehat {t}_{1}\dots \widehat {t}_{i}\rangle \widehat {M}_{i}\) is a prefix of some path of \(\mathbb T\), we have \(\ell (\widehat {t}_{1}\widehat {t}_{2}\dots )=\ell (\bar s_{1}\bar s_{2}\dots )\). Then it is not difficult to see that (26) and (25) can be combined into an infinite firing sequence of CCN(G) satisfying the requirement in Item (1), which is a contradiction.

Next we prove that the satisfiability of Item (1) or Item (2) are both decidable, completing the proof of the decidability result of eventual strong detectability.

For Item (1):

We claim that Item (1) holds if and only if there exists a firing sequence

$$ M_{0}^{\prime}{[s_{1}^{\prime}\rangle} M_{1}^{\prime}{[s_{2}^{\prime}\rangle}M_{2}^{\prime} $$
(27)

in CCN(G) satisfying

$$ (M_{2}^{\prime}\ge M_{1}^{\prime})\wedge(s_{2}^{\prime}\text{ contains a transition in }T_{o}^{\prime}) \wedge (M_{2}^{\prime}|_{P_{1}}\ne M_{2}^{\prime}|_{P_{2}}), $$
(28)

where \(T_{o}^{\prime }\subset T^{\prime }\) is shown in (21). That is, we next prove that Item (1) holds if and only if

$$ (\exists M_{1}^{\prime},M_{2}^{\prime})(\exists s_{1}^{\prime},s_{2}^{\prime})[(27) \wedge (28)] $$
(29)

is satisfied.

“if”: Assume that for CCN(G), Eq. (29) holds. Then Item (1) holds, because \(M_{2}^{\prime }|_{P_{1}}\ne M_{2}^{\prime }|_{P_{2}}\), \(s_{2}^{\prime }\) contains a transition in T0 (hence \(\ell (s_{2}^{\prime })\) is of positive length), and \(M_{1}^{\prime }[s_{2}^{\prime }\rangle M_{2}^{\prime }\) is a repetitive firing sequence and can fire consecutively for infinitely many times.

“only if”: Assume that Item (1) holds, and fix a sequence (23).

By Dickson’s lemma, the set \(\{M_{0}^{\prime },M_{1}^{\prime },\dots \}\) contains at most finitely many distinct minimal elements. Then there exists \(k\in \mathbb {Z}_{+}\) such that \(\{M_{0}^{\prime },\dots ,M_{k}^{\prime }\}\) contains the maximal number of distinct minimal elements of \(\{M_{0}^{\prime },M_{1}^{\prime },\dots \}\). Hence there exists 0 ≤ lk such that \(M_{l}^{\prime }\le M_{k+1}^{\prime }\). Then the firing sequence

$$ M_0^{\prime}[s_1^{\prime}{\dots} s_l^{\prime}\rangle M_l^{\prime}[s_{l+1}^{\prime}{\dots} s_{k+1}^{\prime}\rangle M^{\prime}_{k+1} $$

satisfies that \(M^{\prime }_{k+1}\ge M^{\prime }_{l}\), \(s_{l+1}^{\prime }{\dots } s_{k+1}^{\prime }\) contains at least one transition of \(T_{o}^{\prime }\), and \(M^{\prime }_{k+1}|_{P_{1}}\ne M^{\prime }_{k+1}|_{P_{2}}\), i.e., (29) holds.

In (28), “\(M_{2}^{\prime }\ge M_{1}^{\prime }\)” can be expressed as combination of marking predicates, “\(s_{2}^{\prime }\text { contains a transition in }T_{o}^{\prime }\)” is a transition predicate, only “\(M_{2}^{\prime }|_{P_{1}}\ne M_{2}^{\prime }|_{P_{2}}\)” is not a predicate.

Add two new places \(p_{0}^{\prime \prime }\) and \(p_{1}^{\prime \prime }\) into CCN(G), where initially \(p_{0}^{\prime \prime }\) contains exactly 1 token, but \(p_{1}^{\prime \prime }\) contains no token; add one new transition \(r_{1}^{\prime \prime }\), and arcs \(p_{0}^{\prime \prime }\to r_{1}^{\prime \prime }\to p_{1}^{\prime \prime }\), both with weight 1. Also, for each transition t in CCN(G), add arcs \(p_{1}^{\prime \prime }\to t\to p_{1}^{\prime \prime }\), both with weight 1. Then we obtain a new Petri net \(\text {CC}_{\mathrm {N}}(G)^{\prime }\). We have CCN(G) satisfies (29) if and only if CCN(G) satisfies the Yen’s path formula

$$ \begin{array}{@{}rcl@{}} &&(\exists M_{1}^{\prime\prime},M_{2}^{\prime\prime},M_{3}^{\prime\prime})(\exists s_{1}^{\prime\prime},s_{2}^{\prime\prime},s_{3}^{\prime\prime})[\\ &&(M_{0}^{\prime\prime}[s_{1}^{\prime\prime}\rangle M_{1}^{\prime\prime}[s_{2}^{\prime\prime}\rangle M_{2}^{\prime\prime}[s_{3}^{\prime\prime}\rangle M_{3}^{\prime\prime})\wedge\\ &&(s_{1}^{\prime\prime}=r_{1}^{\prime\prime})\wedge(M_{3}^{\prime\prime}\ge M_{2}^{\prime\prime})\wedge (s_{3}^{\prime\prime}\text{ contains a transition of }T_{o}^{\prime})\wedge\\ &&((M_{3}^{\prime\prime}-M_{1}^{\prime\prime})|_{P_{1}}\ne (M_{3}^{\prime\prime}-M_{1}^{\prime\prime})|_{P_{2}})], \end{array} $$
(30)

where note that one always has \(M_{1}^{\prime \prime }|_{P_{1}}=M_{1}^{\prime \prime }|_{P_{2}}\).

Then by Proposition 3, the satisfiability of (29) is decidable, implying that the satisfiability of Item (1) is decidable.

Next we prove that the satisfiability of Item (2) is decidable.

Fig. 12
figure 12

Extended concurrent composition of the net in Fig. 10

We claim that for G, Item (2) holds if and only if

$$ \begin{array}{@{}rcl@{}} &&\text{there exists a firing sequence }M_{0}[\underline{s}_{1}\rangle \underline{M}_{1}[\underline{s}_{2}\rangle \underline{M}_{2}\text{ satisfying} \end{array} $$
(31a)
$$ \begin{array}{@{}rcl@{}} &&\underline{M}_{1}\le \underline{M}_{2}, \end{array} $$
(31b)
$$ \begin{array}{@{}rcl@{}} &&\underline{s}_{2}\text{ contains an observable transition, and } \end{array} $$
(31c)
$$ \begin{array}{@{}rcl@{}} &&\underline{M}_{1}[\underline{s}_{2}\rangle \underline{M}_{2}\text{ contains a bifurcation}. \end{array} $$
(31d)

Assume that for G, Item (2) holds. Again by Dickson’s lemma, there exist 0 ≤ l < k such that the firing sequence \(M_{0}[s_{1}{\dots } s_{l}\rangle M_{l}[s_{l+1}\dots s_{k}\rangle M_{k}\) satisfies that MlMk, \(s_{l+1}{\dots } s_{k}\) contains an observable transition, and \(M_{l}[s_{l+1}{\dots } s_{k}\rangle M_{k}\) has a bifurcation. That is, Eq. (31) holds.

Assume that (5) holds. By (31b), (31c), and (31d), the sequence in (31a) can be extended to an infinite firing sequence

$$s M_0[\underline{s}_1\rangle \underline{M}_1[\underline{s}_2\rangle \underline{M}_2 [\underline{s}_2\rangle (\underline{M}_2+(\underline{M}_2-\underline{M}_1))[\underline{s}_2\rangle\cdots[\underline{s}_2\rangle (\underline{M}_2+k(\underline{M}_2-\underline{M}_1))[\underline{s}_2\rangle\cdots $$

satisfying for each \(l\in \mathbb {Z}_{+}\), one has \((\underline {M}_{2}+l(\underline {M}_{2}-\underline {M}_{1}))[\underline {s}_{2}\rangle (\underline {M}_{2}+(l+1)(\underline {M}_{2}-\underline {M}_{1}))\) has a bifurcation. That is, Item (2) holds.

Add a new set

$$ T_{\phi}=T_{\phi}^1\cup T_{\phi}^2 $$

of transitions into CCN(G), where ϕT1T2, \(T_{\phi }^1=\{(\breve {t}_1,\phi )|\breve {t}_1\in T_1\}\), \(T_{\phi }^2=\{(\phi ,\breve {t}_2)|\breve {t}_2\in T_2\}\). Add the following rules: for all l ∈ [1,|P|], all i ∈ [1,|T|],

$$ \begin{array}{@{}rcl@{}} Pre^{\prime}(\breve{p}_{l}^{1},(\breve{t}_{i}^{1},\phi)) &=& Pre(\breve{p}_{l}^{1},\breve{t}_{i}^{1}),\\ Pre^{\prime}(\breve{p}_{l}^{2},(\phi,\breve{t}_{i}^{2})) &=& Pre(\breve{p}_{l}^{2},\breve{t}_{i}^{2}),\\ Post^{\prime}(\breve{p}_{l}^{1},(\breve{t}_{i}^{1},\phi)) &=& Post(\breve{p}_{l}^{1},\breve{t}_{i}^{1}),\\ Post^{\prime}(\breve{p}_{l}^{2},(\phi,\breve{t}_{i}^{2})) &=& Post(\breve{p}_{l}^{2},\breve{t}_{i}^{2}). \end{array} $$

The newly obtained extended concurrent composition is denoted by

$$ \text{CC}_{\mathrm{N}^{\mathrm{E}}}(G)=(N^{\prime\prime}=(P^{\prime\prime},T^{\prime\prime},Pre^{\prime\prime},Post^{\prime\prime}),M_{0}^{\prime\prime}), $$
(32)

where \(P^{\prime \prime }=P^{\prime }\), \(T^{\prime \prime }=T^{\prime }\cup T_{\phi }\), \(M_0^{\prime \prime }=M_0^{\prime }\). For example, the corresponding extended concurrent composition of the net in Fig. 10 is shown in Fig. 12.

Then for G, (31) holds if and only if for \(\text {CC}_{\mathrm {N}^{\mathrm {E}}}(G)\),

$$ \begin{array}{@{}rcl@{}} &&\text{there exists a firing sequence }M_{0}^{\prime\prime\prime}[s_{1}^{\prime\prime\prime}\rangle M_{1}^{\prime\prime\prime}[s_{2}^{\prime\prime\prime}\rangle M_{2}^{\prime\prime\prime}[s_{3}^{\prime\prime\prime}\rangle M_{3}^{\prime\prime\prime} \text{ such that} \end{array} $$
(33a)
$$ \begin{array}{@{}rcl@{}} &&M_{1}^{\prime\prime\prime}\le M_{3}^{\prime\prime\prime}, \end{array} $$
(33b)
$$ \begin{array}{@{}rcl@{}} &&s_{3}^{\prime\prime\prime}\text{ contains a transition }(t_{1},*)\text{ with }\ell(t_{1})\in{\Sigma}, \end{array} $$
(33c)
$$ \begin{array}{@{}rcl@{}} &&M_{2}^{\prime\prime\prime}|_{P_{1}}\ne M_{2}^{\prime\prime\prime}|_{P_{2}}, \end{array} $$
(33d)
$$ \begin{array}{@{}rcl@{}} &&s_{1}^{\prime\prime\prime},s_{2}^{\prime\prime\prime}\in(T^{\prime})^{*}, \end{array} $$
(33e)
$$ \begin{array}{@{}rcl@{}} &&s_{3}^{\prime\prime\prime}\in(T^{\prime}\cup T_{\phi}^{1})^{*}, \end{array} $$
(33f)

where we omit a similar proof for the equivalence compared to the previous claim. Among (33b)–(33f), only (33d) is not a predicate. Using a similar construction to the one that is used to reduce the satisfiability of (29) for CCN(G) to the satisfiability of a Yen’s path formula for CCN(G), we can reduce the satisfiability of (33) to the satisfiability of a Yen’s path formula for a new Petri net. Hence, the satisfiability of Item (2) for G is decidable.

(2) Proof of the hardness result:

To prove conclusion 2 of Theorem 4, we are given a Petri net G = (N = (P,T,Pre,Post),M0) and a destination marking \(M\in \mathbb {N}^{P}\), and construct a labeled P/T net

$$ G^{\prime}=(N^{\prime}=(P^{\prime},T^{\prime},Pre^{\prime},Post^{\prime}),M_{0}^{\prime},T\cup\{\sigma_{G}\},\ell) $$
(34)

as follows (see Fig. 13 as a sketch):

  1. 1.

    Add three places p0,p1,p2, where initially p0 contains exactly one token, but p1 and p2 contain no token;

  2. 2.

    add three transitions t0,t1,t2, and arcs p0t0p0, t1p1, t2p2, all with weight 1; for every pP, add arcs pt1 and pt2, both with weight M(p);

  3. 3.

    add label σGT ∪{t0,t1,t2}, (t) = t for each tT ∪{t0}, (t) = σG for each t ∈{t1,t2}.

Fig. 13
figure 13

Sketch for the reduction in the hardness proof of Theorem 4

It is clear that if M is not covered by G then \(G^{\prime }\) shown in (34) is eventually strongly detectable. If M is covered by G, then there exists a firing sequence M0[σ1M1 with M1M. Furthermore, there exist two infinite firing sequences

$$ \begin{array}{@{}rcl@{}} &M_{0}^{\prime}[\sigma_{1}\rangle M_{1}^{\prime}[t_{1}\rangle M_{2}^{\prime}[t_{0}\rangle M_{2}^{\prime}[t_{0}\rangle \cdots,\\ &M_{0}^{\prime}[\sigma_{1}\rangle M_{1}^{\prime}[t_{2}\rangle M_{2}^{\prime\prime}[t_{0}\rangle M_{2}^{\prime\prime}[t_{0}\rangle\cdots, \end{array} $$

where \(M_2^{\prime }\ne M_2^{\prime \prime }\) since \(M_2^{\prime }(p_1)>0\), \(M_2^{\prime }(p_2)=0\), \(M_2^{\prime \prime }(p_2)>0\), \(M_2^{\prime \prime }(p_1)=0\). Also by (t1) = (t2), we have \(G^{\prime }\) is not eventually strongly detectable. This reduction runs in time linear of the number of places of G and the number of tokens of the destination marking M. Since the coverability problem is EXPSPACE-hard in the number of transitions of G, deciding non-eventual strong detectability is EXPSPACE-hard in the numbers of places and transitions of \(G^{\prime }\) and the number of tokens of M, hence deciding eventual strong detectability is also EXPSPACE-hard, which completes the proof. □

Remark 4

By using the extended concurrent composition and a similar procedure as the proof of Theorem 4, the decidability result for strong detectability of labeled Petri nets proved in Masopust and Yin (2019) can be strengthened to hold only based on the promptness assumption.

Example 6

Consider a labeled Petri net G shown in Fig. 14, where event a can be directly observed, but b and c share the same label b. One directly sees that \({\mathscr{L}}^{\omega }(G)=\{(ab)^{\omega }\}\), and \({\mathscr{M}}(G,(ab)^n)=\{(1,0),(0,0)\}\) for all \(n\in \mathbb {Z}_{+}\). Hence G is not weakly detectable, and hence not eventually strongly detectable. By its reachability graph shown in Fig. 15, one sees that this net satisfies Item (2) in the proof of Theorem 4, but not Item (1) in the proof. However, the net in Fig. 9 satisfies Item (1) but not Item (2).

Example 7

Consider a labeled Petri net G shown in Fig. 16. Its reachability graph is shown in Fig. 17, one has \({\mathscr{L}}^{\omega }(G)=\{ab^{\omega }\}\). By the reachability graph, one sees that the net is not prompt, since there is a repetitive firing sequence in \((1,0,0,0,0)\xrightarrow []{t_2(a)}(0,0,1,0,0)\xrightarrow []{t_4(\epsilon )} (0,0,1,1,0)\) labeled by the empty string. This net is not eventually strongly detectable, since for each \(n\in \mathbb {Z}_{+}\), \(|{\mathscr{M}}(G,ab^n)|=\infty >1\). However, the net does not satisfy Item (1) or Item (2) in the proof of Theorem 4.

Fig. 14
figure 14

A labeled P/T net G

Fig. 15
figure 15

Reachability graph of the labeled Petri net in Fig. 14

Fig. 16
figure 16

A labeled P/T net G

Fig. 17
figure 17

Reachability graph of the labeled Petri net in Fig. 16

5 Conclusion

In this paper, we obtained a series of results on detectability of discrete-event systems. We proposed one new notion of weak detectability and one new notion of strong detectability. We proved that (1) the problem of verifying weak approximate detectability of labeled Petri nets is undecidable; (2) the problem of verifying eventual strong detectability of labeled Petri nets is decidable and EXPSPACE-hard under the promptness assumption; (3) for finite automata, the problem of verifying weak approximate detectability is PSPACE-complete, and the other property can be verified in polynomial time. (4) The relationships between thse notions of detectability were also characterized, and it was proved that no two of them are equivalent.

The decidability of strong detectability and eventual strong detectability of labeled Petri nets without the promptness assumption are two interesting open problems. It is also an open problem whether there is a reduction from weak detectability to weak approximate detectability, or vice versa, for labeled Petri nets. Other variants of notions of detectability, e.g., different notions of approximate detectability are left for further study. Uniform versions of these notions of detectability are left for further study. It is also an interesting topic to look for fast algorithms for verifying these notions for (bounded) labeled Petri nets.