Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Are state machines just for parsing?

by Anonymous Monk
on Dec 08, 2004 at 15:00 UTC ( [id://413214]=note: print w/replies, xml ) Need Help??


in reply to Are state machines just for parsing?

All state machines are used to parse. Parsing doesn't have to be "parse text from a text file". For instance, a TCP/IP stack uses a state machine as well. It's "parsing" the network packets, and it's using the content of the headers, combined with the current state, to determine what its next state (if different from the current) will be.

In a broader sense, state machines (which can or cannot have memory - FAs don't have memory, PDAs and TMs do), parsing (aka recognizing languages) and calculability are all the same.

Classical literature about these subjects include the Dragon book and the Cinderella book.

  • Comment on Re: Are state machines just for parsing?

Replies are listed 'Best First'.
Re^2: Are state machines just for parsing?
by talexb (Chancellor) on Dec 08, 2004 at 15:25 UTC
      All state machines are used to parse.

    Don't think so. See my reply below.

    Alex / talexb / Toronto

    "Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

      To mis-quote a former US President:

      It depends on how you parse "Parse".

      In some sense receiving an event is very much like looking at the next character in a file. You either expect it or you don't. It all depends on what your language is.

      Someone pointed out FOLDOC eariler so here's a reference to Parser.


      "Look, Shiny Things!" is not a better business strategy than compatibility and reuse.


      OSUnderdog

        Well, m-w defines parse as follows:

          1. : to resolve (as a sentence) into component parts of speech and describe them grammatically
          2. : to describe grammatically by stating the part of speech and explaining the inflection and syntactical relationships
        1. : to examine in a minute way : analyze critically [parses appellate court opinions]
        So to use 'parse' as the verb that means 'look at what actions are happening and respond in a certain manner' is being generous.

        I think this is a case where we'll have to agree to disagree.

        Alex / talexb / Toronto

        "Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

      And your example differs from the TCP/IP state machine example in which way? Your example is doing what every other state machine does: it uses the current state and the current input to determine what the next state will be (that is, it's performing a "calculation"). Your example only strengthens my point.
Re^2: Are state machines just for parsing?
by Anonymous Monk on Oct 21, 2008 at 22:59 UTC
    I disagree. State machines are used in many fields, not just in software that evaluates data. As a tiny selection of applications, they are used to drive washing machines and dishwashers, as well as most battery-driven toys. In those cases, they certainly don't parse anything, but simply perform timed steps of a program to wash your dishes or clothes (I hope they are not being parsed!), or move a toy car while making some fitting noises. Similarly, in software, they are used in practically all programs in one form or another. Just think of any game you know, and it certainly is based on a state machine.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://413214]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2024-04-20 02:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found