ArticleslgStudy

computer science

Communicating finite-state machine

Communicating finite-state machine is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Communicating finite-state machine rather than just read about it. In short: In computer science, a communicating finite-state machine is a finite-state machine labeled with "receive" and "send" operations over some alphabet of channels. They were introduced by Brand and Zafiropulo, and can be used as a model of concurrent processes like Petri nets.

Key takeaways

  • Communicating finite-state machine belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Communicating finite-state machine to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Communicating finite-state machine from memory before moving on to harder problems.

Reference excerpt

In computer science, a communicating finite-state machine is a finite-state machine labeled with "receive" and "send" operations over some alphabet of channels. They were introduced by Brand and Zafiropulo, and can be used as a model of concurrent processes like Petri nets. Communicating finite-state machines are used frequently for modeling a communication protocol since they make it possible to detect major protocol design errors, including boundedness, deadlocks, and unspecified receptions. The advantage of communicating finite-state machines is that they make it possible to decide many properties in communication protocols, beyond the level of just detecting such properties. This advantage rules out the need for human assistance or restriction in generality. Communicating finite-state machines can be more powerful than finite-state machines in situations where the propagation delay is not negligible (so that several messages can be in transit at one time) and in situations where it is natural to describe the protocol parties and the communication medium as separate entities.

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 has 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.

Definition

Protocol For an arbitrary positive integer N, a protocol with N process(es) is a quadruple {(Si)i=1N, (oi)i=1N, (Mi,j)i,j=1N, (𝚜𝚞𝚌𝚌)i=1N} with:

(Si)i=1N, a sequence of N disjoint finite sets. Each set is used to represent a process, and each element of Si represents a possible state of the i-th process. (oi)i=1N (with oi∈Si), a sequence representing the initial state of each process. (Mi,j)i,j=1N, a finite sequence of N2 disjoint finite sets such that each set Mi,j represents the possible messages which may be sent from process i to process j. If i=j, then Mi,j is empty. (𝚜𝚞𝚌𝚌)i=1N:Si×⋃j=1N(Mj,i[+]∪Mi,j[−])↦Si is a sequence of transition functions. Each function modelizes the transition which can be taken by emitting or receiving any message. With respect to process i, the symbol [+] is used to note a message that can be received and [−] a message that can be sent.

Global state A global state is a pair ⟨S,C⟩ where

S=(s1,...,sN) is an ordered collection of states such that each si represents a state of the i-th process. C is an N×N matrix such that each ci,j∈C is a subsequence of Mi,j. The initial global state is a pair ⟨O,E⟩ where

O=(o1,...,oN) E is defined to be an N×N matrix such that for all i,j∈{1,...,N}, Ei,j equals the empty word, ϵ.

Step There are two kinds of steps, steps in which message are received and steps in which messages are sent. A step in which the j process receive a message previously sent by the i-th process is a pair of the form ⟨(s1,…,sj,…,sn),(c1,1…c1,n…………mi,jci,j…………cn,1…cn,n)⟩⊢⟨(s1,…,s'j,…,sn),(c1,1…c1,n…………ci,j…………cn,1…cn,n)⟩ when 𝚜𝚞𝚌𝚌i(sj,+mi,j)=s'j, with m'i,j∈Mi,j. Similarly, a pair in which a message is sent by the i-th process to the j-th one is a pair of the form ⟨(s1,…,si,…,sn),(c1,1…c1,n…………ci,j…………cn,1…cn,n)⟩⊢⟨(s1,…,s'i,…,sn),(c1,1…c1,n…………mi,jci,j…………cn,1…cn,n)⟩ when 𝚜𝚞𝚌𝚌i(si,−mi,j)=s'i

Run A run is a sequence of global states such that a step relate a state to the next one, and such that the first state is initial. It is said that a global state ⟨S,C⟩ is reachable if there exists a run passing through this state.

Problems It has been proved with the introduction of the concept itself that when two finite-state machines communicate with only one type of messages, boundedness, deadlocks, and unspecified reception state can be decided and identified while such is not the case when the machines communicate with two or more types of messages. Later, it has been further proved that when only one finite-state machine communicates with single type of message while the communication of its partner is unconstrained, we can still decide and identify boundedness, deadlocks, and unspecified reception state. It has been further proved that when the message priority relation is empty, boundedness, deadlocks and unspecified reception state can be decided even under the condition in which there are two or more types of messages in the communication between finite-state machines. Boundedness, deadlocks, and unspecified reception state are all decidable in polynomial time (which means that a particular problem can be solved in tractable, not infinite, amount of time) since the decision problems regarding them are nondeterministic logspace complete.

Extensions Some extensions considered are:

having a notation to state that some states may not receive any message, messages are received in different orders, such as FILO, some messages may get lost,

Channel system

A channel system is essentially a version of communicating finite-state machine in which the machine is not divided into distinct process. Thus, there is a single state of state, and there is no restriction relating which system can read/write on any channel. Formally, given a protocol ⟨(Si)i=1n,(oi)i=1n,(Mi,j)i,j=1n,(𝚜𝚞𝚌𝚌)i⟩, its associated channel system is ⟨∏(Si)i=1n,(oi)i=1n,⋃i,j=1n(Mi,j),Δ⟩, where Δ is the set of ((s1,…,sj,…,sn),?mi,j,(s1,…,𝚜𝚞𝚌𝚌j(sj,+mi,j),…,sn) and of ((s1,…,si,…,sn),!mi,j,(s1,…,𝚜𝚞𝚌𝚌i(si,−mi,j),…,sn).

References

Worked examples

Example 1 — a first encounter with Communicating finite-state machine

Start with the simplest possible case. Write down what Communicating finite-state machine claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Communicating finite-state machine before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Communicating finite-state machine ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Communicating finite-state machine

In research
Communicating finite-state machine appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Communicating finite-state machine in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Communicating finite-state machine is common in secondary-school and first-year university syllabi. It links to neighbouring topics Concurrency (computer science), Models of computation, so understanding it makes those chapters shorter.
In everyday life
Look for Communicating finite-state machine outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Communicating finite-state machine” →

How to study Communicating finite-state machine in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Communicating finite-state machine means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Communicating finite-state machine out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Communicating finite-state machine in simple terms?

In computer science, a communicating finite-state machine is a finite-state machine labeled with "receive" and "send" operations over some alphabet of channels. They were introduced by Brand and Zafiropulo, and can be used as a model of concurrent processes like Petri nets.

Why does Communicating finite-state machine matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Communicating finite-state machine?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Communicating finite-state machine.

Tags

  • Concurrency (computer science)
  • Models of computation

Keep exploring