Channel system (computer science)

From HandWiki
Short description: Finite-state machine with fifo buffers for memory

In computer science, a channel system is a finite state machine similar to communicating finite-state machine in which there is a single system communicating with itself instead of many systems communicating with each other. A channel system is similar to a pushdown automaton where a queue is used instead of a stack. Those queues are called channels. Intuitively, each channel represents a sequence a message to be sent, and to be read in the order in which they are sent.

Definition

Channel system

Formally, a channel system (or perfect channel system) [math]\displaystyle{ S }[/math] is defined as a tuple [math]\displaystyle{ \langle Q,C,\Sigma,\Delta \rangle }[/math] with:

  • [math]\displaystyle{ Q=\{q_1,\dots,q_m\} }[/math] a finite set of control states,
  • [math]\displaystyle{ q_0\in Q }[/math] an initial state,
  • [math]\displaystyle{ A }[/math] a finite alphabet (for the sake of notation simplicity, let [math]\displaystyle{ \epsilon \in A }[/math]),
  • [math]\displaystyle{ C=\{c_1,\dots,c_n\} }[/math] a finite set of channels,
  • [math]\displaystyle{ \Sigma=\{a_1,\dots,a_p\} }[/math] a finite alphabet of messages,
  • [math]\displaystyle{ \Delta\subseteq Q\times C\times\{?,!\}\times\Sigma^*\times A \times Q }[/math] a finite set of transition rules with [math]\displaystyle{ \Sigma^* }[/math] being the set of finite (potentially empty) words over the alphabet [math]\displaystyle{ \Sigma }[/math].[1]

Depending on the author, a channel system may have no initial state and may have an empty alphabet.[2]

Configuration

A configuration or global state of the channel system is a [math]\displaystyle{ n+1 }[/math] tuple belonging to [math]\displaystyle{ Q\times\prod_{i=1}^n(\Sigma^*) }[/math]. Intuitively, a configuration [math]\displaystyle{ \gamma=(q,w_1,\dots,w_m) }[/math] represents that a run is in state [math]\displaystyle{ q }[/math] and that its [math]\displaystyle{ i }[/math]-th channel contains the word [math]\displaystyle{ w_i }[/math].

The initial configuration is [math]\displaystyle{ (q_0,\epsilon,\dots,\epsilon) }[/math], with [math]\displaystyle{ \epsilon }[/math] the empty word.

Step

Intuitively, a transition [math]\displaystyle{ (q,c_i,!,u,a,q') }[/math] means that the system may goes to control state [math]\displaystyle{ q }[/math] to [math]\displaystyle{ q' }[/math] by writing an [math]\displaystyle{ u }[/math] to the end of the channel [math]\displaystyle{ c_i }[/math]. Similarly [math]\displaystyle{ (q,c_i,?,u,a,q') }[/math] means that the system may goes to control state [math]\displaystyle{ q }[/math] to [math]\displaystyle{ q' }[/math] by removing a [math]\displaystyle{ u }[/math] starting the word [math]\displaystyle{ c_i }[/math].

Formally, given a configuration [math]\displaystyle{ (q,w_1,\dots,w_m) }[/math], and a transition [math]\displaystyle{ (q,c_i,!,u,q') }[/math], there is a perfect step [math]\displaystyle{ (q,w_1,\dots, w_{i-1}, w_i, w_{i+1},\dots,w_m)\xrightarrow{a}_{\mathtt{perf}}(q',w_1,\dots,w_{i-1},w_iu,w_{i+1},\dots,w_m) }[/math], where the step adds a letter [math]\displaystyle{ u }[/math] to the end of the [math]\displaystyle{ i }[/math]-th word. Similarly, given a transition [math]\displaystyle{ (q,c_i,?,u,q') }[/math], there is a perfect step [math]\displaystyle{ (q,w_1,\dots,w_{i-1},uw_i,w_{i+1},w_m)\xrightarrow{a}_{\mathtt{perf}}(q',w_1,\dots,w_{i-1}, w_i, w_{i+1},\dots,w_m) }[/math] where the first letter of the [math]\displaystyle{ i }[/math]-th word is [math]\displaystyle{ u }[/math] and has been removed during the step.

Run

A perfect run is a sequence of perfect step, of the form [math]\displaystyle{ \gamma_0\xrightarrow{a_0}_{\mathtt{perf}}\gamma_1\dots }[/math]. We let [math]\displaystyle{ \gamma\xrightarrow[\mathtt{perf}]{*}\gamma' }[/math] denote that there is a perfect run starting at [math]\displaystyle{ \gamma }[/math] and ending at [math]\displaystyle{ \gamma' }[/math].

Languages

Given a perfect or a lossy channel system [math]\displaystyle{ S }[/math], multiple languages may be defined.

A word over [math]\displaystyle{ A^* }[/math] is accepted by [math]\displaystyle{ S }[/math] if it is the concatenation of the labels of a run of [math]\displaystyle{ S }[/math]. The language defined by [math]\displaystyle{ S }[/math] is the set of words accepted by [math]\displaystyle{ S }[/math].

The set of reachable configuration of [math]\displaystyle{ S }[/math], denoted [math]\displaystyle{ R(S) }[/math] is defined as the set of configuration [math]\displaystyle{ \gamma }[/math] reachable from the initial state. I.e. as the set of configurations [math]\displaystyle{ \gamma' }[/math] such that [math]\displaystyle{ (q_0,\epsilon,\dots,\epsilon)\xrightarrow{*}\gamma' }[/math].

Given a channel [math]\displaystyle{ c }[/math], the channel of [math]\displaystyle{ c }[/math] is the set of tuples [math]\displaystyle{ (w_1,\dots w_m) }[/math] such that [math]\displaystyle{ (c,w_1,\dots,w_m)\in R(S) }[/math].

Channel system and Turing machine

Most problem related to perfect channel system are undecidable[1]:92.[3]:22 This is due to the fact that such a machine may simulates the run of a Turing machine. This simulation is now sketched.

Given a Turing machine [math]\displaystyle{ M }[/math], there exists a perfect channel system [math]\displaystyle{ S }[/math] such that any run of [math]\displaystyle{ M }[/math] of length [math]\displaystyle{ n }[/math] can be simulated by a run of [math]\displaystyle{ S }[/math] of length [math]\displaystyle{ O(n^2) }[/math]. Intuitively, this simulation consists simply in having the entire tape of the simulated Turing machine in a channel. The content channel is then entirely read and immediately rewritten in the channel, with one exception, the part of the content representing the head of the Turing machine is changed, to simulate a step of the Turing machine computation.

Variants

Multiple variants of channel systems have been introduced. The two variants introduced below does not allow to simulate a Turing machine and thus allows multiple problem of interest to be decidable.

One channel machine

A one-channel machine is a channel system using a single channel. The same definition also applies for all variants of channel system.

Counter machine

When the alphabet of a channel system contains a single message, then each channel is essentially a counter. It follows that those systems are essentially Minsky machines. We call such systems counter machines. This same definition applies for all variants of channel system.[4]:337

Completely specified protocol

A completely specified protocol (CSP) is defined exactly as a channel system. However, the notion of step and of run are defined differently.

A CSP admits two kinds of steps. Perfect steps, as defined above, and a message loss transition step. We denote a message loss transition step by [math]\displaystyle{ (q,w_1,\dots,a\cdot w_i,\dots,w_m)\rightsquigarrow(q,w_1,\dots,w_i,\dots,w_m) }[/math].

Looseness

A lossy channel system or machine capable of lossiness error is an extension of completely specified protocol in which letters may disappear anywhere.

A lossy channel system admits two kinds of steps. Perfect steps, as defined above, and lossy step. We denote a lossy step, [math]\displaystyle{ (q,w_1,\dots,w_i\cdot a\cdot w'_i\dots,,w_m)\rightsquigarrow(q,w_1,\dots,w_i\cdot w'_i,w'_m) }[/math].

A run in which channel are emptied as soon as messages are sent into them is a valid run according to this definition. For this reason, some fairness conditions may be introduced to those systems.

Channel fairness

Given a message a channel [math]\displaystyle{ c }[/math], a run is said to be channel fair with respect to [math]\displaystyle{ c }[/math] if, assuming there are infinitely many steps in which a letter is sent to [math]\displaystyle{ c }[/math] then there are infinitely many steps in which a letter is read from [math]\displaystyle{ c }[/math]. [5]:88

A computation is said to be channel fair if it is channel fair with respect to each channel [math]\displaystyle{ c }[/math].

Impartiality

The impartiality condition is a restriction to the channel fairness condition in which both the channel and the letter are considered.

Given a message [math]\displaystyle{ m }[/math] and a channel [math]\displaystyle{ c }[/math], a run is said to be impartial with respect to [math]\displaystyle{ c }[/math] and [math]\displaystyle{ m }[/math] if, assuming there are infinitely many steps in which [math]\displaystyle{ m }[/math] is sent to [math]\displaystyle{ c }[/math] then there are infinitely many steps in which [math]\displaystyle{ m }[/math] is read from [math]\displaystyle{ c }[/math]. [5]:83

A computation is said to be impartial with respect to a channel [math]\displaystyle{ c }[/math] if it is impartial with respect to [math]\displaystyle{ c }[/math] and a messages [math]\displaystyle{ m }[/math]. It is said to be impartial if it is impartial with respect to every channels [math]\displaystyle{ c }[/math].

Message fairness

The message fairness property is similar to impartiality, but the condition only have to hold if there is an infinite number of step at which [math]\displaystyle{ m }[/math] may be read. Formally, a run is said to be message faire with respect to [math]\displaystyle{ c }[/math] and [math]\displaystyle{ m }[/math] if, assuming there are infinitely many steps in which [math]\displaystyle{ m }[/math] is sent to [math]\displaystyle{ c }[/math], and infinitely many step [math]\displaystyle{ i }[/math] which occurs in a state [math]\displaystyle{ q }[/math] such that there exists a transition [math]\displaystyle{ (q,m,q') }[/math], then there are infinitely many steps in which [math]\displaystyle{ m }[/math] is read from [math]\displaystyle{ c }[/math]. [5]:88

Boundedness

The run is said to have bounded lossiness if the number of letter removed between two perfect steps is bounded.[4]:339

Insertion of errors

A machine capable of insertion of error is an extension of channel system in which letters may appear anywhere.

A machine capable of insertion of error admits two kinds of steps. Perfect steps, as defined above, and insertion steps. We denote an insertion step by [math]\displaystyle{ (q,w_1,\dots,w_i\cdot w'_i\dots,,w_m)\rightsquigarrow(q,w_1,\dots,w_i\cdot a\cdot w'_i,w'_m) }[/math].[3]:25

Duplication errors

A machine capable of duplication error is an extension of machine capable of insertion of error in which the inserted letter is a copy of the previous letter.

A machine capable of insertion of error admits two kinds of steps. Perfect steps, as defined above, and duplication steps. We denote an insertion step by [math]\displaystyle{ (q,w_1,\dots,w_i\cdot a\cdot w'_i\dots,,w_m)\rightsquigarrow(q,w_1,\dots,w_i\cdot a\cdot a\cdot w'_i,w'_m) }[/math].[3]:26

A non-duplicate machine capable of duplication error is a machine which ensures that in each channel, the letters alternate between a special new letter #, and a regular letter from the alphabet of message. If it is not the caes, it means a duplication occurred and the run rejects. This process allow to encode any channel system into a machine capable of duplication error, while forcing it not to have errors. Since channel systems can simulate machines, it follows that machines capable of duplication error can simulate Turing machine.

Properties

The set of reachable configurations is recognizable for lossy channel machines[3]:23 and machines capable of insertions of errors[3]:26. It is recursively enumerable for machine capable of duplication error[3]:27.

Problems and their complexity

This section contain a list of problems over channel system, and their decidability of complexity over variants of such systems.

Termination problem

The termination problem consists in deciding, given a channel system [math]\displaystyle{ S }[/math] and an initial configuration [math]\displaystyle{ \gamma }[/math] whether all runs of [math]\displaystyle{ S }[/math] starting at [math]\displaystyle{ \gamma }[/math] are finite. This problem is undecidable over perfect channel systems, even when the system is a counter machine[4] or when it is a one-channel machine[3]:26.

This problem is decidable but nonprimitive recursive over lossy channel system.[2]:10 This problem is trivially decidable over machine capable of insertion of errors[3]:26.

Reachability problem

The reachability problem consists in deciding, given a channel system [math]\displaystyle{ S }[/math] and two initial configurations [math]\displaystyle{ \gamma }[/math] and [math]\displaystyle{ \gamma' }[/math] whether there is a run of [math]\displaystyle{ S }[/math] from [math]\displaystyle{ \gamma }[/math] to [math]\displaystyle{ \gamma' }[/math]. This problem is undecidable over perfect channel systems and decidable but nonprimitive recursive over lossy channel system.[2]:10 This problem is decidable over machine capable of insertion of errors .[3]:26

Reachability problem

The deadlock problem consists in deciding whether there is a reachable configuration without successor. This problem is decidable over lossy channel system[2]:10 and trivially decidable over machine capable of insertion of errors[3]:26. It is also decidable over counter machine.[6]

Model checking problem

The model checking problem consists in deciding whether given a system [math]\displaystyle{ S }[/math] and a CTL**-formula or a LTL-formula [math]\displaystyle{ \phi }[/math] or a whether the language defined by [math]\displaystyle{ S }[/math] satisfies [math]\displaystyle{ \phi }[/math]. This problem is undecidable over lossy channel system.[3]:23[5]

Recurrent state problem

The recurrent state problem consists in deciding, given a channel system [math]\displaystyle{ S }[/math] and an initial configuration [math]\displaystyle{ \gamma }[/math] and a state [math]\displaystyle{ s }[/math] whether there exists a run of [math]\displaystyle{ S }[/math], starting at [math]\displaystyle{ \gamma }[/math], going infinitely often through state [math]\displaystyle{ s }[/math]. This problem is undecidable over lossy channel system, even with a single channel.[3]:23[5]:80

Equivalent finite state machine

Given a system [math]\displaystyle{ S }[/math], there is no algorithm which computes a finite state machine representing [math]\displaystyle{ R(S) }[/math] for the class of lossy channel system.[3]:24 This problem is decidable over machine capable of insertion of error .[3]:26

Boundedness problem

The boundedness problem consists in deciding whether the set of reachable configuration is finite. I.e. the length of the content of each channel is bounded. This problem is trivially decidable over machine capable of insertion of errors[3]:26. It is also decidable over counter machine.[6]

Eventually properties

The eventuality property, or inevitability property problem consists in deciding, given a channel system [math]\displaystyle{ S }[/math] and a set [math]\displaystyle{ \Gamma }[/math] of configurations whether all run of [math]\displaystyle{ S }[/math] starting at [math]\displaystyle{ \gamma }[/math] goes through a configuration of [math]\displaystyle{ \Gamma }[/math]. This problem is undecidable for lossy channel system with impartiality[5]:84 and with the two other fairness constraints.[5]:87

Safety property

The safety property problem consists in deciding, given a channel system [math]\displaystyle{ S }[/math] and a regular set [math]\displaystyle{ R }[/math] whether

Structural termination

The structural termination problem consists in deciding, given a channel system [math]\displaystyle{ S }[/math] if the termination problem holds for [math]\displaystyle{ S }[/math] for every initial configuration. This problem is undecidable even over counter machine.[4]:342

Communicating Hierarchical State Machine

Hierarchical state machines are finite state machines whose states themselves can be other machines. Since a communicating finite state machine is characterized by concurrency, the most notable trait in a communicating hierarchical state machine is the coexistence of hierarchy and concurrency. This had been considered highly suitable as it signifies stronger interaction inside the machine.

However, it was proved that the coexistence of hierarchy and concurrency intrinsically costs language inclusion, language equivalence, and all of universality.[7]

References

  1. 1.0 1.1 Abdulla, Parosh Aziz; Jonsson, Bengt (1996). "Verifying Programs with Unreliable Channels". Information and Computation 127 (2): 91–101. doi:10.1006/inco.1996.0053. 
  2. 2.0 2.1 2.2 2.3 Schnoebelen, Ph (15 September 2002). "Verifying Lossy Channel Systems has Nonprimitive Recursive Complexity". Information Processing Letters 83 (5): 251–261. doi:10.1016/S0020-0190(01)00337-4. 
  3. 3.00 3.01 3.02 3.03 3.04 3.05 3.06 3.07 3.08 3.09 3.10 3.11 3.12 3.13 3.14 Cécé, Gérard; Finkel, Alain (10 January 1996). "Unreliable Channels Are Easier to Verify Than Perfect Channels". Information and Computation 124 (1): 20–31. doi:10.1006/inco.1996.0003. 
  4. 4.0 4.1 4.2 4.3 Mayr, Richard (17 March 2008). "Undecidable problems in unreliable computations". Theoretical Computer Science 297 (1–3): 337–354. doi:10.1016/S0304-3975(02)00646-1. 
  5. 5.0 5.1 5.2 5.3 5.4 5.5 5.6 Abdulla, Parosh Aziz; Jonsson, Bengt (10 October 1996). "Undecidable Verification Problems for Programs with Unreliable Channels". Information and Computation 130 (1): 71–90. doi:10.1006/inco.1996.0083. 
  6. 6.0 6.1 Rosier, Louis E.; Gouda, Mohamed G (1983). Deciding progress for a class of communicating finite state machines (Report). 
  7. Alur, Rajeev; Kannan, Sampath; Yannakakis, Mihalis. "Communicating hierarchical state machines," Automata, Languages and Programming. Prague: ICALP, 1999