ArticleslgStudy

computer science

Virtual finite-state machine

Virtual 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 Virtual finite-state machine rather than just read about it. In short: A virtual finite-state machine (VFSM) is a finite-state machine (FSM) defined in a virtual environment. The VFSM concept provides a software specification method to describe the behaviour of a control system using assigned names of input control properties and output actions.

Virtual finite-state machine — main illustration
Virtual finite-state machine — illustration

Key takeaways

  • Virtual 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 Virtual finite-state machine to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Virtual finite-state machine from memory before moving on to harder problems.

Reference excerpt

A virtual finite-state machine (VFSM) is a finite-state machine (FSM) defined in a virtual environment. The VFSM concept provides a software specification method to describe the behaviour of a control system using assigned names of input control properties and output actions. The VFSM method introduces an execution model and facilitates the idea of an executable specification. This technology is mainly used in complex machine control, instrumentation, and telecommunication applications.

Why Implementing a state machine necessitates the generation of logical conditions (state transition conditions and action conditions). In the hardware environment, where state machines found their original use, this is trivial: all signals are Boolean. In contrast state machines specified and implemented in software require logical conditions that are per se multivalued:

Temperature could be Low, OK, High Commands may have several values: Init, Start, Stop, Break, Continue In a hierarchical control system the subordinate state machines can have many states that are used as conditions of the superior state machine In addition input signals can be unknown due to errors or malfunctions, meaning even digital input signals (considered as classical Boolean values) are in fact 3 values: Low, High, Unknown. A Positive Logical Algebra solves this problem via virtualization, by creating a Virtual Environment which allows specification of state machines for software using multivalued variables.

Control properties A state variable in the VFSM environment may have one or more values which are relevant for the Control—in such a case it is an input variable. Those values are the control properties of this variable. Control properties are not necessarily specific data values but are rather certain states of the variable. For instance, a digital variable could provide three control properties: TRUE, FALSE and UNKNOWN according to its possible boolean values. A numerical (analog) input variable has control properties such as: LOW, HIGH, OK, BAD, UNKNOWN according to its range of desired values. A timer can have its OVER state (time-out occurred) as its most significant control value; other values could be STOPPED or RUNNING.

Actions Other state variables in the VFSM environment may be activated by actions—in such a case it is an output variable. For instance, a digital output has two actions: True and False. A numerical (analog) output variable has an action: Set. A timer which is both: an input and output variable can be triggered by actions like: Start, Stop or Reset.

Virtual environment

The virtual environment characterises the runtime environment in which a virtual machine operates. It is defined by three sets of names:

input names represent the control properties of all available variables output names represent the available actions on the variables state names, as defined for each of the states of the FSM. The input names build virtual conditions to perform state transitions or input actions. The virtual conditions are built using the positive logic algebra. The output names trigger actions; entry actions, exit actions, input actions or transition actions.

Positive logic algebra The rules to build a virtual condition are as follows:

Input names and virtual input A state of an input is described by Input Names which create a set:

input A: Anames = {A1, A2, A3} input B: Bnames = {B1, B2} input C: Cnames = {C1, C2, C3, C4, C5} etc. Virtual input VI is a set of mutually exclusive elements of input names. A VI always contains the element always:

VI = {always} VI = {always, A1} VI = {always, A1, B2, C4}

Logical operations on input names & (AND) operation is a set of input names: A1 & B3 & C2 => {A1, B3, C2}

| (OR) operation is a table of sets of input names: A1 | B3 | C2 => [{A1}{B3}{C2}] ~ (Complement) is a complement of a set of input names: ~A2 = {A1, A3}

Logical expression A logical expression is an OR-table of AND-sets (a disjunctive normal form): A1 & B3 | A1 & B2 & C4 | C2 => [{A1B3}{A1B2C4}{C2}] Logical expressions are used to express any logical function.

Evaluation of a logical expression The logical value (true, false) of a logical expression is calculated by testing whether any of the AND-sets in the OR-table is a subset of VI.

Output names and virtual output A state of an output is described by Output Names which create a set:

output X: Xnames = {X1, X2} output Y: Ynames = {Y1, Y2, Y3} Virtual output VO is a set of mutually exclusive elements of output names.

Virtual environment The Virtual Name and Virtual Output completed by State Names create the Virtual Environment VE where the behaviour is specified.

VFSM execution model

A subset of all defined input names, which can exist only in a certain situation, is called virtual input or VI. For instance temperature can be either "too low", "good" or "too high". Although there are three input names defined, only one of them can exist in a real situation. This one builds the VI. A subset of all defined output names, which can exist only in a certain situation is called virtual output or VO. This is built by the current action(s) of the VFSM. The behavior specification is built by a state table which describes all details of all states of the VFSM. The VFSM executor is triggered by VI and the current state of the VFSM. In consideration of the behavior specification of the current state, the VO is set. Figure 2 shows one possible implementation of a VFSM executor. Based on this implementation a typical behavior characteristics must be considered.

State table

A state table defines all details of the behavior of a state of a VFSM. It consists of three columns; the first column names the state, the second lists virtual conditions built out of input names using the positive logic algebra, and the third column contains the output names:

Read the table as following: the first two lines define the entry and exit actions of the current state. The following lines which do not provide the next state represent the input actions. Finally the lines providing the next state represent the state transition conditions and transition actions. All fields are optional. A pure combinatorial VFSM is possible in cases only where input actions are used, but no state transitions are defined. The transition action can be replaced by the proper use of other actions.

… excerpt ends here. Continue reading the full article.

Illustrations

Virtual finite-state machine: Figure 2: VFSM executor flow chart
Figure 2: VFSM executor flow chart

Worked examples

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

Start with the simplest possible case. Write down what Virtual 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 Virtual 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 Virtual 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 Virtual finite-state machine

In research
Virtual 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 Virtual 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
Virtual finite-state machine is common in secondary-school and first-year university syllabi. It links to neighbouring topics Models of computation, so understanding it makes those chapters shorter.
In everyday life
Look for Virtual 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 “Virtual finite-state machine” →

How to study Virtual finite-state machine in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Virtual 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 Virtual finite-state machine out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Virtual finite-state machine in simple terms?

A virtual finite-state machine (VFSM) is a finite-state machine (FSM) defined in a virtual environment. The VFSM concept provides a software specification method to describe the behaviour of a control system using assigned names of input control properties and output actions.

Why does Virtual 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 Virtual 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 Virtual finite-state machine.

Tags

  • Models of computation

Keep exploring