<?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>keeping simple &#187; state machines</title>
	<atom:link href="http://www.yodaiken.com/tag/state-machines/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.yodaiken.com</link>
	<description>Systems software technology and business</description>
	<lastBuildDate>Sun, 01 Jan 2012 18:30:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>More computer science as humbug [updated with Brazil dream sequence]</title>
		<link>http://www.yodaiken.com/2010/03/more-computer-science-as-humbug/</link>
		<comments>http://www.yodaiken.com/2010/03/more-computer-science-as-humbug/#comments</comments>
		<pubDate>Mon, 15 Mar 2010 23:12:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[academics]]></category>
		<category><![CDATA[architecture]]></category>
		<category><![CDATA[software engineering]]></category>
		<category><![CDATA[specification]]></category>
		<category><![CDATA[theoretical computer science]]></category>
		<category><![CDATA[cav2010]]></category>
		<category><![CDATA[digital circuits]]></category>
		<category><![CDATA[state machines]]></category>

		<guid isPermaLink="false">http://www.yodaiken.com/?p=863</guid>
		<description><![CDATA[Continuing my experiments in academic papers, I sent a paper on automata and circuit verification to CAV2010 (here&#8217;s an updated version with some corrections and better references). I actually got one carefully written and well informed review. Sending a paper &#8230; <a href="http://www.yodaiken.com/2010/03/more-computer-science-as-humbug/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Continuing my experiments in academic papers, I sent a <a title="CAV" href="http://www.yodaiken.com/papers/cav2010a.pdf" target="_blank">paper on automata and circuit verification </a>to CAV2010 (here&#8217;s an <a href="http://www.yodaiken.com/papers/circuits.pdf">updated version </a>with some corrections and better references). I actually got one carefully written and well informed review. Sending a paper to an academic conference with no references more recent than 20 years, was probably more of a deliberate provocation than needed, but I&#8217;m still amazed at the low quality of the reviewing. First, it&#8217;s absurd and frankly shameful that so-called academics can make an unsupported claim that something is well known in the literature. One of the reviewers at CAV2010, was kind enough to write:</p>
<blockquote><p>There is nothing wrong with the approach described but I fail to see  that there is anything novel here either. Circuits have been modeled as  state machines since the 60s (e.g. Booth 67), there is a wealth of  literature on the correspondence between state machines, automata and  strings, and so forth. All of this has been done before, and more  completely.</p>
<p>I am sure that one could look in most computer science curricula and  find almost all of this material being taught at the undergraduate  level.</p></blockquote>
<p><span style="color: #800000;"><span style="color: #000000;">I&#8217;m really embarrassed for the entire profession here. Of course circuits have been modeled as state machines &#8211; well before 1967 in fact. Booth&#8217;s 1967 book is one of innumerable surveys.  The paper showed an alternative way of representing state machines and illustrated their use on the time sensitive behavior of combinational circuits where they are not usually employed because the number of states is so great as to overwhelm standard methods.  The specific methods used in this papers, as far as I know, are not used elsewhere in the literature &#8211; and I still don&#8217;t know any different because the CAV2010 reviewer was unable to <a href="http://www.yodaiken.com/wp-content/uploads/2010/01/humbug_350x387.gif"><img class="alignright size-medium wp-image-657" title="humbug_350x387" src="http://www.yodaiken.com/wp-content/uploads/2010/01/humbug_350x387-271x300.gif" alt="" width="157" height="174" /></a>provide a reference. To me, this is a mark of humbug. Look, if you are going to tell some poor author that their work is retelling some well known tale, you should at the very least be able to point to the well known explications. </span> <span style="color: #000000;">Creditably enough, CAV2010 offers a rebuttal period for reviews: but even given a second chance, and an explicit request for a reference, both the author of the review and the program committee failed.  An assertion is made that the material is covered in &#8220;most computer science curricula&#8221; and when challenged, the assertion is just left as is. No wonder so much of academic computer science is mired in stale repetition of old material when basic standards of scientific rigor are discarded by the people who are supposed to be enforcing the rules. </span></span></p>
<p><span style="color: #800000;"><span style="color: #000000;">I don&#8217;t want to seem entirely ungrateful for the work of the reviewers: one of whom gave a perfectly rational and solid reason for rejecting the paper.</span></span></p>
<blockquote><p>Conclusion: an elegant paper, but doomed for CAV by lack of any attempt at automation or convincing evidence that automation of the methods described would be a scientific advance.</p></blockquote>
<p>I can&#8217;t really argue with that. The paper does not either describe automation or attempt to make an argument of why automation would succeed &#8211; although I am in no doubt about the second question. Perhaps the paper is not suitable by reason of the focus of the conference. But of 4 reviews, this reviewer was the only one who appeared to understand the material. One of the other reviewers actually responded to the rebuttal with this:</p>
<blockquote><p><span style="color: #800000;">About the KR theorem and feedback, an ordinary finite state automaton &#8220;encodes&#8221; implicitly the feedback information of the underlying sequential circuit in its states, so I would be surprised that the theorem is not applicable to digital circuits with feedback</span></p></blockquote>
<p><span style="color: #800000;"><span style="color: #000000;">Ok. The KR (Krohn-Rhodes) theory is based on a decomposition called <strong>&#8220;loop free&#8221;. </strong>Let me type that again <strong><span style="color: #ff00ff;">LOOP FREE</span></strong>.  The theory is concerned with the decomposition of state machines into pipelines where components can be ordered so that the output of component <em>i </em>depends only on the input to the system and the outputs of components<em> j&lt;i</em> . What I show in the paper is how to describe one of the simplest and most beautiful achievements of Computer Engineering, a SR-latch via the interconnection of state machines that represent logic gates. The SR-latch is constructed with <strong>cross-coupled </strong>gates where the output of each gate feeds back into the input of the other gate. When the output of gate G1 feeds into the input of gate G2 and the output of G2 feeds into the input of G1, we have what is known in the technical literature as a &#8220;loop&#8221;. While the reviewer would not be surprised if a loop-free product could be used to describe a loop,  the comment makes me doubt his/her grasp on the basics of the material </span></span>(BTW: the  identity of this reviewer is known to me, but I&#8217;ll leave to him/her to  respond or not).</p>
<p>One of the other reviewers included (among others) two comments  that I noted were wrong, but were not modified or defended.</p>
<blockquote><p>2. The term &#8220;propagation delay&#8221;: It seems that you blend different   concepts into this single term, namely the duration that an input   has to be held stable in order to be sure that it will be reflected   by the output and the latency of a circuit in forwarding such a   sufficiently stable input to its outputs. While your model, by   lumping together the two into a single latency, is a conservative   approximation of more detailed models, you may want to make sure   that your terminology is in accordance with accepted terminology.   it.</p></blockquote>
<p><span style="color: #800000;"><span style="color: #000000;">Here the reviewer apparently does not understand the difference between latch time and propagation delay. Have those definitions changed since I last looked at a digital circuits book? &#8220;<em>The propagation delay t_p of a signal path is the amount of time that is takes for a change in the input signal to produce a change in the output signal</em>&#8221; (Wakerly, 1990, P 76).</span><br />
</span></p>
<blockquote><p>3. The abstraction of your latch leaves the case (set,reset): (0,0) -&gt;   (1,1) unspecified, which is fine. You may, however, want to mention   this detail in the accompanying text.</p></blockquote>
<p><span style="color: #800000;"><span style="color: #000000;">Ah well, the second week of Digital Electronics II is not for everyone. &#8220;<em>However if we negate both inputs simultaneously, the latch goes into an unpredictable next state and it may in fact oscillate or enter the metastable state.</em>&#8221; (Wakerly 1990 P355). See it&#8217;s really not so hard to provide a citation.</span></span></p>
<p>There&#8217;s actually a lot more to ridicule in these reviews &#8211; I&#8217;ll post more on request, but I do want to look at one more comment from Reviewer4.</p>
<blockquote><p>I still believe that this paper lacks motivation and new results for being accepted. As the author says himself, the paper is about a technique for specifying automata, and I am not convinced why not doing it directly with automata, using standard and well-studied techniques. For instance, given that the propagation delays of the gates are modeled using discrete time, why embedding them directly into the definition of gates (even underspecified), instead of modelling them directly with I/O finite state machines (or sequential circuits with feedback)?</p></blockquote>
<p>It&#8217;s not at all clear to me what  modeling a gate as a sequential circuit with feedback even means. In terms of digital circuit engineering, a gate is a combinational circuit, not a sequential circuit. The cool thing about a cross-coupled latch is that the feedback produces sequential properties from combinational circuits. So this comment is quite obscure. On the other hand, I/O automata (from Lynch/Tuttle) are a good example of the augmented automata that I&#8217;m deliberately avoiding because of their mathematical ugliness. You can take classical state machines and add all sorts of stuff to them: clocks, fairness conditions, oracles depending on the Axiom of Choice, steroids, flavor enhancers, and so on.  The &#8220;standard and well-studied techniques&#8221; Reviewer4 has in mind are almost certainly timed and hybrid automata which are types of augmented automata. But the argument made in my paper is that the austere flavor of classical automata theory is strong enough to model timing without additives. Rather than responding to this argument, the Reviewer asks why I don&#8217;t use the &#8220;standard&#8221; methods with additives.</p>
<p>It&#8217;s certainly possible that the work described in the paper lacks  interest to anyone but me ( the &#8220;crank&#8221; hypothesis). But lacking  credible reviews, it&#8217;s hard to make any conclusion at all.</p>
<p>A response.</p>
<blockquote><p>Hi Victor, good to hear from you.</p>
<p>About your CAV paper, don&#8217;t get pathetic. Each PC member has to review  in a short time numerous papers and he cannot afford the time needed to  give full feedback to the author of a paper which shows strict  disconnectedness with contemporary verification. Instead of thanking (or  even apologizing) to the PC members for the fact that they bothered to  read your paper and give you some feedback (one minute browsing was  sufficient to predict its rejection) you still complain and make useless  noise.</p>
<p>I will send you my rejected paper and its reviews, if you enjoy reading  such things.</p></blockquote>
<p>Pathetic! Ouch.</p>
<h3>In other matters</h3>
<p>For a variety of reasons, this reminds me of  a conference I attended in Salvador Brazil many years ago which was like something out of a Magical Realism<a href="http://www.yodaiken.com/wp-content/uploads/2010/03/antarctica-beer.jpg"><img class="alignright size-full  wp-image-885" title="antarctica-beer" src="http://www.yodaiken.com/wp-content/uploads/2010/03/antarctica-beer.jpg" alt="" width="66" height="87" /></a> novel involving lachrymose Argentines who longed to teach meringue, drum bands, unbearably tedious talks, dreamlike missed airplane sequences,  a moment when I was sure that Amir Pnueli, his wife, and myself were about to be assaulted while we were discussing the Israeli novel Blue Mountain which according to Pnueli,<a href="http://www.yodaiken.com/wp-content/uploads/2010/03/3861701-Pelorinho_Salvador_da_Bahia-Salvador_da_Bahia.jpg"><img class="alignleft size-medium wp-image-881" title="3861701-Pelorinho_Salvador_da_Bahia-Salvador_da_Bahia" src="http://www.yodaiken.com/wp-content/uploads/2010/03/3861701-Pelorinho_Salvador_da_Bahia-Salvador_da_Bahia-300x197.jpg" alt="" width="300" height="197" /></a> was set in his home town, random appearances of gigantic fashion models, an abandoned building in which rooster fighting was taking place,  the most delicious beer ever drunk in world history, a peculiar lecture on Fra Angelico and the relationship between New Mexico and Hassidism (&#8220;you must look at the white spaces between the words&#8221;) , a hero named Hercules, and much more. I returned from the trip to a faculty meeting chaired by <a href="http://www.kibazen.com/" onclick="pageTracker._trackPageview('/outgoing/www.kibazen.com/?referer=');">Jean Louis Lassez</a>.  Did any of it even really happen? The conference also provided me with an astounding article review: the reviewer explained that I had made an elementary error when I proved something about a set without taking into account the ordering of the set. Even the Baal Shem Tov would not be able to discern meaning in such a comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yodaiken.com/2010/03/more-computer-science-as-humbug/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>sequential and combinational state machines</title>
		<link>http://www.yodaiken.com/2010/02/sequential-and-combinational-state-machines/</link>
		<comments>http://www.yodaiken.com/2010/02/sequential-and-combinational-state-machines/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 18:36:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[architecture]]></category>
		<category><![CDATA[theoretical computer science]]></category>
		<category><![CDATA[combinational logic]]></category>
		<category><![CDATA[jordan-holder theorem]]></category>
		<category><![CDATA[monoids]]></category>
		<category><![CDATA[sequential circuits]]></category>
		<category><![CDATA[state machines]]></category>

		<guid isPermaLink="false">http://www.yodaiken.com/?p=668</guid>
		<description><![CDATA[There&#8217;s a correspondence between the notions of &#8220;combinational&#8221; and &#8220;sequential&#8221; in digital circuit engineering and some structure in state machines (and therefore monoids)  that seems interesting. In digital logic, a &#8220;combinational&#8221; circuit like a logic gate has can be associated &#8230; <a href="http://www.yodaiken.com/2010/02/sequential-and-combinational-state-machines/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s a correspondence between the notions of &#8220;combinational&#8221; and &#8220;sequential&#8221; in digital circuit engineering and some structure in state machines (and therefore monoids)  that seems interesting.</p>
<p><a href="http://www.yodaiken.com/wp-content/uploads/2010/02/logicgates.png"><img class="alignleft size-thumbnail wp-image-680" title="logicgates" src="http://www.yodaiken.com/wp-content/uploads/2010/02/logicgates-150x150.png" alt="" width="150" height="150" /></a>In digital logic, a &#8220;combinational&#8221; circuit like a logic gate has can be associated with a time T so that the output depends only on input signals applied over the last T time units. If the propagation delay is T, then signals applied T+n time units ago are irrelevant to current state.  For example, an AND gate with propagation delay T has output 1 if all inputs have been set HIGH over the last T time units. For a <em>sequential </em>circuit, like a latch, there is no magic time T. Suppose we set the stored value in the  latch at time T1 and then signal it to hold the value. No matter how long the latch is held, we have to go back to absolute time T1 to find out what is in the latch. It&#8217;s worth noting however, that it&#8217;s often very useful to make a sequential circuit have a reset mode where it behaves like a combinatorial circuit. That is, we want to be able to say: no matter what previous signals have done to a memory device, some sequence of signals will clear it and, for example,  put the number 3 in it. More on this below.</p>
<p>Take a Moore machine M and write <em>State(M,w) </em>for the state reached by following input string &#8220;w&#8221; from the initial state. I&#8217;m limiting us to complete Moore machines where State(M,w) must be defined for every w.  Say M is <em>combinational</em> if there is some T so that if <em>w=uz</em> and <em>length(z)&gt;T</em> then <em>State(M,w)= State(M,z) </em>. So the idea is that there is a <em>T</em> so that the last<em> T</em> inputs determine state for <em>M</em>. Call <em>T</em> the &#8220;depth&#8221; of<em> M</em>. As an example, suppose M represents a memory location and the inputs are just data values to store. Then we only need the last input, <em>T=1</em>.  If M is an AND gate with two pins and a delay of 2, then we can think of inputs as numbers 0,1,2,3 representing their 2 bit encodings: 0 for 00, 1 for 01, 2 for 10 and 3 for 11.  States can be pairs [x1,x2] representing the last two inputs so that if the state is [a,b] and input &#8220;c&#8221; is received, the new state is [c,b].  The state is actually a shift register. Suppose that the states are all pairs [x1,x2] where x1 and x2 are in the set {-1,0,1,2,3} with &#8220;-1&#8243; representing  an unknown signal. Then [3,3]  has output 1, [x1,x2] where both x1 and x2 are greater than -1 and less than 3 outputs 0 and the others have undefined output. The initial state is [-1,-1]. Obviously this machine is combinational with depth T=2. The intuition here is that combinatorial state machines will always <a href="http://www.yodaiken.com/wp-content/uploads/2010/02/vonneumann.jpg"><img class="alignright size-thumbnail wp-image-681" title="vonneumann" src="http://www.yodaiken.com/wp-content/uploads/2010/02/vonneumann-150x150.jpg" alt="" width="150" height="150" /></a>&#8220;swim&#8221; to a fixed state given a fixed sequence of inputs of sufficient length. Obviously, this is a useful property of a device and even for sequential devices we are going to want some single or sequence of &#8220;reset&#8221; operations that, no matter what the current state, will force a reset to a known state. That is, for our latch, we&#8217;d want to force it to an assigned latched value, no matter what, if anything, it had previously latched. So properly designed sequential circuits are going to look like some combination of combinatorial and sequential circuit.</p>
<p>Now consider products of state machines. The method I&#8217;ve been using for representing state machines as maps <em>f:InputSequences -&gt;Outputs</em> is convenient for products. If<em> f</em> represents a state machine <em>M</em>, then<em> f(w) = Output(State(M,w))</em>. If <em>f</em> represents a combinational state machine of depth T then<em> f(wuz)= f(uz)</em> whenever<em> length(u)&gt;T</em> because <em>State(M,wu)=State(M,u)</em> so <em>State(M,wuz)=State(M,uz)</em> so the outputs must be the same.  Say<em> F(w) = (g1(w1) &#8230;, gn(wn)</em>) is a product under connection function Phi and map<em> w |-&gt; w1 &#8230; ,wn</em> if when <em>w=empty</em> then<em> wi = empty</em> for all <em>i</em> and if when<em> w</em> maps to <em>wi</em> then <em>wa</em> maps to <em>wi.Phi(a,i,F(w)) </em>with &#8216;.&#8217; representing string concatenation. Say that F is a cascade product if and only if  <em>Phi(a,i,(x1 &#8230; xn))</em> depends only on <em>xj for j &lt; i. </em>That is, in a cascade product, information only flows from lower numbered factors to higher numbered ones: there is no feedback in a cascade product. If g1 &#8230;,gn are combinatorial AND<em> Phi(a,i,(x1 &#8230;,xn)) !=empty </em>for any combination of parameters, and F is a cascade product, then F must be combinatorial. For proof, suppose Ti is the depth of each component gi and suppose w=uv where length(v)&gt; T1. Then w1= u1.v1 where length(v1)&gt; T1 so g1(v1)=g1(w1) and more than that g1(w1.z)=g1(v1.z) for all z.  That means Phi(a,i,F(wa))=Phi(a,F(va)) by the cascade property. And so on &#8211; eventually we see that the depth of F is the sum of the depths of the factors! For intuition, first we need enough inputs to steer factor 1 to a known state, then factor 2 and so on.</p>
<p>Given a state machine M with states S, we can associate a map from S to S with every string of inputs w so that F(M,w)(s)=s&#8217; if and only if w leads from s to s&#8217;. This set of maps forms a monoid under ordinary function compositions  and since F(M,w)(F(z)(s))= F(M,wz)(s) then F(M,w)+F(M,z)= F(M,wz) where + is the monoid operation and not anything necessarily related to arithmetic. The empty string produces the monoid identity F(M,empty)(s)=s.  Look at the monoid structure of combinatorial state machines and note that unless the monoid is trivial, then  F(M,w)=F(M,empty) only if w=empty &#8211; there are no other identities.</p>
<p>The proof is easy. Suppose M is combinatorial  with depth T, the monoid is not trivial so that for some v we have F(M,v) != F(M,empty)and suppose F(M,z)=F(M,empty).  Then if z is not empty let Z consist of a string of concatenated z&#8217;s that is longer than T  so Z=zzzzzz &#8230;. stretched out to a length greater than T. By the combinatorial property, for any u, F(M,uZ)(s)=F(M,Z)(s) but because F(M,z)=F(M,empty) we also know F(M,uZ)(s)=s so F(M,w)(s)=s for all w and s which implies the monoid is trivial after all. It&#8217;s also worth pointing out that the combinatorial monoids seem to be a proper subset of the aperiodic monoids ( <a href="http://www.liafa.jussieu.fr/~jep/PDF/HandBook.pdf " target="_blank" onclick="pageTracker._trackPageview('/outgoing/www.liafa.jussieu.fr/_jep/PDF/HandBook.pdf?referer=');">http://www.liafa.jussieu.fr/~jep/PDF/HandBook.pdf </a>). Consider the state machine with states {0,1,2} and inputs {a,b} so that, treating the inputs at maps from state to state, a(0)=1 and b(0)=2 for any non-zero state we have x(s)=s. The monoid is clearly aperiodic since a<sup>2</sup>=a<sup> 3</sup> , a<sup>2</sup>(0)=1 and a<sup>2</sup>(s!=0)=s. But the state machine is not combinatorial.</p>
<p>Well, more later, but that&#8217;s what I have semi-clearly explicated for now. I&#8217;ll leave you with this photograph of<a title="Camille Jordan" href="http://en.wikipedia.org/wiki/Camille_Jordan" target="_blank" onclick="pageTracker._trackPageview('/outgoing/en.wikipedia.org/wiki/Camille_Jordan?referer=');"> Camille Jordan</a> who lived in an unenlightened era that did not make clear demarcations between mathematics and mere engineering.<a href="http://www.yodaiken.com/wp-content/uploads/2010/02/camillejordan.jpeg"><img class="size-thumbnail wp-image-682 alignleft" title="camillejordan" src="http://www.yodaiken.com/wp-content/uploads/2010/02/camillejordan-150x150.jpg" alt="" width="150" height="150" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.yodaiken.com/2010/02/sequential-and-combinational-state-machines/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Recursion and state</title>
		<link>http://www.yodaiken.com/2009/07/recursion-and-state/</link>
		<comments>http://www.yodaiken.com/2009/07/recursion-and-state/#comments</comments>
		<pubDate>Thu, 02 Jul 2009 21:32:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[specification]]></category>
		<category><![CDATA[automata]]></category>
		<category><![CDATA[formal methods]]></category>
		<category><![CDATA[moore machines]]></category>
		<category><![CDATA[state machines]]></category>

		<guid isPermaLink="false">http://www.yodaiken.com/?p=351</guid>
		<description><![CDATA[Despite some deep results, algebraic automata theory has fallen out of favor in theoretical computer science. Reasons include the disciplines failings such as a love of over-generality, weak mathematical background of people working on &#8220;formal methods&#8221;, and gap between theoreticians &#8230; <a href="http://www.yodaiken.com/2009/07/recursion-and-state/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-medium wp-image-352" style="margin-left: 10px; margin-right: 10px;" title="automata 071" src="http://www.yodaiken.com/wp-content/uploads/2009/07/automata-071-225x300.jpg" alt="automata 071" width="183" height="243" /> Despite some deep results, algebraic automata theory has fallen out of favor in theoretical computer science. Reasons include the disciplines failings such as a love of over-generality, weak mathematical background of people working on &#8220;formal methods&#8221;, and gap between theoreticians and engineers. But perhaps the key reason is that traditional state machine presentations in terms of state sets and transition maps are awkward and carry too much irrelevant information.</p>
<p>The standard presentation of a Moore machine isÂ  M=(A,X,S,st,Î´,Î³)Â  whereÂ  &#8220;A&#8221; is the alphabet of events, &#8220;X&#8221; is the set of outputs, &#8220;st&#8221; is the start state,Â  Î´:S x Aâ†’ S is the transition function and Î³:S â†’ X is the output function.Â  ButÂ  we really don&#8217;t care about the state set in all but the simplest state machines. Interesting systems have ridiculously large numbers of states.Â  Names of states don&#8217;t matter.Â  Extra states don&#8217;t matter. Suppose &#8220;s&#8221; is an element of &#8220;S&#8221; that is unreachable &#8211; no sequence of inputs will drive M to &#8220;s&#8221; from &#8220;st&#8221;. In that case what difference does removing &#8220;s&#8221; from &#8220;S&#8221; make? Or suppose <em>s</em> and<em> s&#8217;</em> are both reachable but not only is <em>Î³(s)=Î³(s&#8217;) </em>but for any sequence of inputs that can drive the machine from <em>s</em> to a new state, the output of that new state is identical to the output of the state reached by following the same sequence of inputs from<em> s&#8217;</em>.Â  In that case, we could simplify S and Î´ by removing one of the duplicative states and merging paths.</p>
<p>What&#8217;s more interesting is to consider what output a Moore machine will produce from a sequence of inputs: thinking of the Moore machine as a map from input <strong>strings</strong> to outputs. This isÂ  a function that can be constructed by primitive recursion on strings.Â  First, extend Î´ to strings to define a new function Î”. TheÂ Â  empty string that has zero length doesn&#8217;t cause any state change Î”(s,empty)=sÂ Â  and if &#8220;w&#8221; is a string and &#8220;wa&#8221; is the string obtained by appending &#8220;a&#8221; to &#8220;w&#8221;, then Î”(s,wa)= Î´(Î”(s,w),a).Â  DefineÂ  M*(w) = Î³(Î”(st,w)). The idea is that M*(w) is the output produced by M in the state reached by following &#8220;w&#8221; from the initial state.Â  If you look at M* you see it contains all the interesting information in M -Â  because the names of states and unreachable states and duplicate states are not interesting. In fact in the 1950s Myhill and Nerode described how to generate a state machine (not necessarily a finite state one) from any function on the set of strings over an alphabet.<img class="alignright size-medium wp-image-360" title="milenr 001" src="http://www.yodaiken.com/wp-content/uploads/2009/07/milenr-001-300x230.png" alt="milenr 001" width="300" height="230" /></p>
<p>These functions are much more useful in describing complex state systems than are Moore machines &#8211; not least because they can be partially specified when we don&#8217;t know or care about all the possible behaviors of the system and because they can be composed in a way to represent any interconnection.</p>
<p>In the next post, I&#8217;m going to discuss composition of message passing processes and compare to the &#8220;formal methods&#8221; approach which is based on the incorrect assumption that automata need to be &#8220;enhanced&#8221; in some way and that replaces automata with things that have very little mathematical structure at all.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yodaiken.com/2009/07/recursion-and-state/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New paper &#8220;H2&#8243; on operating system semantics</title>
		<link>http://www.yodaiken.com/2008/05/new-paper-on-operating-system-semantics/</link>
		<comments>http://www.yodaiken.com/2008/05/new-paper-on-operating-system-semantics/#comments</comments>
		<pubDate>Sun, 18 May 2008 14:47:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[operating systems]]></category>
		<category><![CDATA[software engineering]]></category>
		<category><![CDATA[formal methods]]></category>
		<category><![CDATA[moore machines]]></category>
		<category><![CDATA[specification]]></category>
		<category><![CDATA[state machines]]></category>

		<guid isPermaLink="false">http://www.yodaiken.com/?p=152</guid>
		<description><![CDATA[Please see a new version here. I am continuing to try to develop a practical engineering mathematics for operating system and other complex system code.]]></description>
			<content:encoded><![CDATA[<p>Please see a new version <a title="History 2" href="http://www.yodaiken.com/papers/h2.pdf" target="_blank">here</a>. I am continuing to try to develop a practical engineering mathematics for operating system and other complex system code.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yodaiken.com/2008/05/new-paper-on-operating-system-semantics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

