<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>StateWORKS Blog &#187; Finite state machine</title>
	<atom:link href="http://www.stateworks.net/category/finite-state-machine/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.stateworks.net</link>
	<description>StateWORKS blog about software engineering using virtual finite state machines</description>
	<lastBuildDate>Mon, 24 Aug 2009 15:38:45 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>What is a state machine, again?</title>
		<link>http://www.stateworks.net/2009/02/what-is-a-state-machine-again/</link>
		<comments>http://www.stateworks.net/2009/02/what-is-a-state-machine-again/#comments</comments>
		<pubDate>Mon, 23 Feb 2009 18:28:26 +0000</pubDate>
		<dc:creator>Ferdinand Wagner</dc:creator>
				<category><![CDATA[Finite state machine]]></category>
		<category><![CDATA[concurrency]]></category>
		<category><![CDATA[event driven]]></category>

		<guid isPermaLink="false">http://stateworksnet.cmarc.net/2009/02/what-is-a-state-machine-again/</guid>
		<description><![CDATA[For many years we have been trying to popularize the correct concept of a finite state machine. In fact, we do not invent anything, we just present a state machine as defined ca. 60 years ago. In the beginning it had been applied to a design of hardware systems as software did not exist at [...]]]></description>
			<content:encoded><![CDATA[<p>For many years we have been trying to popularize the correct concept of a finite state machine. In fact, we do not invent anything, we just present a state machine as defined ca. 60 years ago. In the beginning it had been applied to a design of hardware systems as software did not exist at that time. But the concept of a finite state machine is not bound in any way to the hardware; it is just a notation to describe a behavior and as such it is not bound to the physical implementation.</p>
<p><span id="more-10"></span><br />
Unfortunately, the state machine concept in software has been firstly used for theoretical purposes in the mathematical foundation of computer science where obviously only the event driven parser model is useful. This model assumes that a state machine is triggered by an event to do something and possibly change a state. This model applied to application software where a control systems are modeled is totally useless: in our book (Wagner F. et al.: Modeling Software with Finite State Machines) we discussed in details the limitations of that model, especially the problem of state number explosion.<br />
A recent email has provoked us to show the solution of a <a href="http://www.stateworks.com/technology/solutions/">traffic light controller</a> in the Solution page on our web site. This email shows again the damage that is produced by tools which use the UML syntax for specifying state machines. The base is a statecharts idea that assumes the above mentioned parser model.<br />
I do not want to repeat here any extracts from the book or numerous technical notes and case studies available on our web site. I would limit my comments only to two topics that are the essence of all the misunderstandings that surround the state machine concept.<br />
1. An event is a signal that triggers the state machine to work: to do something and change a state (I do not want to go now into the different models with input action, entry actions, etc. as these are secondary issues). The conditions that determine what to do and whether to change a state is not the event itself but the value of one or more state machine inputs (see for instance Chapter 7 in the book). In the Traffic Light example the transition condition from the state Hgreen_FRed to the state HYellow_FRed is Vehicle_DETECTED &#038; Ti_Green_OVER, i.e. the transition condition is an AND operation of two input values: Vehicle_DETECTED and Ti_Green_OVER. If you try to do it using only the event as a condition you end up in a lunatic world with a state machine inside a state, flags in a state machine, inventing “guards” on transitions, concurrencies, and so on.<br />
2. There is very rarely a need for concurrent state machines. First of all a system of concurrent state machines makes sense only if you have a true multiprocessor system and you are able to partition the (multiple) state machine execution onto several processors. Secondly, you need to have a reason to do it. In reality you normally need three levels of parallelism: the system of state machines, the input handling system and the output handling system. The input handling system processes the inputs, makes them available to the state machines and generates events to trigger state machines if any input changes. The output handling system performs action as ordered by state machines. If those two time-consuming tasks run concurrently to the system of state machines this system is just a decision machine, to order the output handling system what to do on the basis of the actual input conditions and a state, and is very fast in operation. In such a model it is difficult to discover any motive for requiring concurrency of state machines.<br />
Any comments will be appreciated.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stateworks.net/2009/02/what-is-a-state-machine-again/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>What is a state machine?</title>
		<link>http://www.stateworks.net/2008/03/what-is-a-state-machine/</link>
		<comments>http://www.stateworks.net/2008/03/what-is-a-state-machine/#comments</comments>
		<pubDate>Mon, 03 Mar 2008 06:00:00 +0000</pubDate>
		<dc:creator>Ferdinand Wagner</dc:creator>
				<category><![CDATA[Finite state machine]]></category>
		<category><![CDATA[automata]]></category>
		<category><![CDATA[state]]></category>
		<category><![CDATA[state machine]]></category>
		<category><![CDATA[stateworks]]></category>
		<category><![CDATA[thread]]></category>

		<guid isPermaLink="false">http://stateworksnet.cmarc.net/2008/03/what-is-a-state-machine/</guid>
		<description><![CDATA[Our web site contains several technical notes and papers that discuss some aspects of software engineering associated with the concept of a finite state machine. On introducing our blog we have decided to present you a few topics covered by a group of our documents. We started with the  Mealy and Moore models of [...]]]></description>
			<content:encoded><![CDATA[<p>Our web site contains several technical notes and papers that discuss some aspects of software engineering associated with the concept of a finite state machine. On introducing our blog we have decided to present you a few topics covered by a group of our documents. We started with the  Mealy and Moore models of a finite state machine, honoring the fact that it is a favorite topic according to visitors&#8217; statistics. The topic that we would like to present you today is &#8220;What is a state machine&#8221;.</p>
<p><span id="more-5"></span><br />
The concept of a state machine is old; its definition belongs to the basics of Automata Theory. In principle it seems to be a simple definition and requires understanding of the &#8220;state&#8221; concept. In spite of its simplicity the concept has been deformed, corrupted, misunderstood and up now the well known <a href="http://www.stateworks.com/active/download/wagf04-2-state-machine-misunderstandings.pdf"> misunderstandings</a> about a state machine result in a relatively modest use of the state machine idea in the specification and design of software. In our publications we try to indicate that a state machine is so well defined (see for instance <a href="http://www.stateworks.com/book/book/">the book</a> or <a href="http://www.stateworks.com/technology/TN15-Whats-All-This-State-Machine-Stuff/">the technical note</a> and the the already mentioned document about <a href="http://www.stateworks.com/technology/TN10-Moore-Or-Mealy-Model/">Moore and Mealy models</a>) that it does not require re-definitions or (mis-)interpretations, especially that:<br />
- <a href="http://www.stateworks.com/technology/TN9-Flowchart-is-not-State-Machine/">a flow chart is not a state machine</a><br />
- a Petri net is not a state machine<br />
- a statechart is not a state machine<br />
- there is no need to define an incomplete state machine under a new name (see for instance <a href="http://www.stateworks.com/technology/TN11-Going-Beyond-Limitations-Of-IEC-61131/"> the technical note</a>)<br />
- it is possible to create a complex control system <a href="http://www.stateworks.com/technology/TN3-HierarchicalSystem/">modeled </a> by a system of state machines<br />
to name only some topics discussed in our documents.<br />
We are convinced that the concept of a finite state machine is one of the strongest ideas in the world of modelling control tasks in general and specifically in the design of a software control flow. A typical implementation of software control flow using the if-then-else and switch like mechanisms supported by numerous flags is a primitive style of development difficult to understand and accept in the 21 century.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stateworks.net/2008/03/what-is-a-state-machine/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Moore or Mealy model</title>
		<link>http://www.stateworks.net/2008/02/moore-or-mealy-model/</link>
		<comments>http://www.stateworks.net/2008/02/moore-or-mealy-model/#comments</comments>
		<pubDate>Fri, 22 Feb 2008 15:58:06 +0000</pubDate>
		<dc:creator>Ferdinand Wagner</dc:creator>
				<category><![CDATA[Finite state machine]]></category>
		<category><![CDATA[Mealy]]></category>
		<category><![CDATA[Moore]]></category>
		<category><![CDATA[state machine]]></category>
		<category><![CDATA[stateworks]]></category>

		<guid isPermaLink="false">http://stateworksnet.cmarc.net/2008/02/moore-or-mealy-model/</guid>
		<description><![CDATA[Moore and Mealy models are the basic two models of state machines as defined in the literature. To understand the differences between them the actions (outputs) must be defined and bound to state changes. The technical note &#8220;Moore or Mealy model?&#8221; discusses both models and shows that the optimal solution is achieved when features of [...]]]></description>
			<content:encoded><![CDATA[<p>Moore and Mealy models are the basic two models of state machines as defined in the literature. To understand the differences between them the actions (outputs) must be defined and bound to state changes. The technical note &#8220;<a href="http://www.stateworks.com/active/download/TN10-Moore-Or-Mealy-Model.pdf">Moore or Mealy model?</a>&#8221; discusses both models and shows that the optimal solution is achieved when features of both models are used in a mixed model. Although the concepts of these two models are useful when performing certain theoretical studies, they are also interesting for software developers, and StateWORKS makes the use of a mixed model easy and effective.</p>
<p><span id="more-4"></span><br />
Mealy and Moore models are the basic models of state machines. A state machine which uses only Entry Actions, so that its output depends on the state, is called a Moore model. A state machine which uses only Input Actions, so that the output depends on the state and also on inputs, is called a Mealy model. The models selected will influence a design but there are no general indications as to which model is better. Choice of a model depends on the application, execution means (for instance, hardware systems are usually best realized as Moore models) and personal preferences of a designer or programmer. In practice, mixed models are often used with several action types.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stateworks.net/2008/02/moore-or-mealy-model/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

