Do any of you know the Finite State Machine technique for programming? Has anyone used it to do programming?
Nick Geti
---
This email is free from viruses and malware because avast! Antivirus protection is active.
--- StripMime Report -- processed MIME parts ---
multipart/alternative
text/plain (text body -- kept)
text/html
---
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/9F17FCAEACA24E22882A73E638E11B19@dual
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
I think I do ! In fact I am not sure with the translation.
When you have a lot of 'states' and a lot of conditions, you built an array.
With one line per state and one column per condition. In each cell of this
array, you get the index of the next state you must go and the name of the
procedure you must execute.
Is that what you are dealing with ?
The Foxil
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/52B2826D.6070004@wanadoo.fr
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
I only knew you could use it to write a compiler, or to process
command-line parameters. Popular among Unix/Linux .... :)
I did use state-transition diagram to describe some business behavior,
for example, the states of an insurance contract.
On Thu, Dec 19, 2013 at 12:34 PM, Nicholas Geti <ngeti@optonline.net> wrote:
> Do any of you know the Finite State Machine technique for programming? Has anyone used it to do programming?
>
> Nick Geti
>
>
> ---
> This email is free from viruses and malware because avast! Antivirus protection is active.
>
>
> --- StripMime Report -- processed MIME parts ---
> multipart/alternative
> text/plain (text body -- kept)
> text/html
> ---
>
[excessive quoting removed by server]
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/CAGv=MJCjd2g6eSRN=5y8beQam-fyhUrJoz+putQk1GKg50uoMg@mail.gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
A finite state machine/system is one that:
a. knows the current status of the "machine" at all times
b. can recognise a state change of the machine
c. reacts to a state change via a predetermined set of rules
d. triggers a change in state for any state change in (c) above
Although this would seem to be how any program/system can be defined, the Finite State Machine (FSM) is very rigid in how it models the "system". You need very structured code patterns and usually these are driven via an events table where each event can have a number of states with events being rows and states being columns.
The table is scanned via the events handler and the combination of row/column values at any instant in time dictate either a state change or a requirement for a state change. This state change is then handled, normally in an alternative programming thread and the results of the change fed back into the events table.
What happens is that the system becomes virtually dynamic with regards to "consequential events" as there will be a finite but usually very large number of "states" that have to be processed or recognised.
Lots of the mainframe operating systems that I used to work on at Singer used this methodology as did the early microcode mainframes at ICL.
The biggest difficulty in writing software this way is not the programming, it is actually defining the finite number of events, states and combinations of the two that will generate a state change that may or may not affect the actual state of the thread that is currently processing the change.
Hope this makes sense as although it is a simple concept, the implementation of it is not a trivial task.
Dave
-----Original Message-----
From: ProFox [mailto:profox-bounces@leafe.com] On Behalf Of Nicholas Geti
Sent: 19 December 2013 04:35
To: profox@leafe.com
Subject: Finite State Machine
Do any of you know the Finite State Machine technique for programming? Has anyone used it to do programming?
Nick Geti
---
This email is free from viruses and malware because avast! Antivirus protection is active.
--- StripMime Report -- processed MIME parts --- multipart/alternative
text/plain (text body -- kept)
text/html
---
[excessive quoting removed by server]
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/18725B8CD2D5D247873A2BAF401D4AB22A476F8C@EX2010-A-FPL.FPL.LOCAL
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Nicholas,
I guess that the simplest way of describing it is that:
"Anything can happen at any time, anywhere, with any thing" the rules that govern the changes may or may not be changed in real time by the "things" which in turn generate a modified set of rules that may or may not act in the way of the original rules. i.e a Dynamic system
Note that Finite State doesn't mean finite when it comes to reacting to rules or the number of rules, as the rules themselves can become dynamic.
Dave
-----Original Message-----
From: ProFox [mailto:profox-bounces@leafe.com] On Behalf Of Nicholas Geti
Sent: 19 December 2013 04:35
To: profox@leafe.com
Subject: Finite State Machine
Do any of you know the Finite State Machine technique for programming? Has anyone used it to do programming?
Nick Geti
---
This email is free from viruses and malware because avast! Antivirus protection is active.
--- StripMime Report -- processed MIME parts --- multipart/alternative
text/plain (text body -- kept)
text/html
---
[excessive quoting removed by server]
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/18725B8CD2D5D247873A2BAF401D4AB22A476FAD@EX2010-A-FPL.FPL.LOCAL
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Many years ago I programmed factory-floor PLCs (programmable logic
controllers) using 'ladder logic'. This sounds sort of like that.
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/1387448485.11395.61481045.1D62D8FD@webmail.messagingengine.com
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Dave,
did the IBM mainframe and early microprocessor model of instruction
pointer; address / data registers map onto a finite-state machine? I
can see how it might be done(e.g. by mapping op codes to microcoded
OR/NAND/SHIFT/JUMP etc.), but I don't see why it /would/ be done that way.
On 19/12/2013 15:39, Dave Crozier wrote:
> A finite state machine/system is one that:
>
> a. knows the current status of the "machine" at all times
> b. can recognise a state change of the machine
> c. reacts to a state change via a predetermined set of rules
> d. triggers a change in state for any state change in (c) above
>
> Although this would seem to be how any program/system can be defined, the Finite State Machine (FSM) is very rigid in how it models the "system". You need very structured code patterns and usually these are driven via an events table where each event can have a number of states with events being rows and states being columns.
>
> The table is scanned via the events handler and the combination of row/column values at any instant in time dictate either a state change or a requirement for a state change. This state change is then handled, normally in an alternative programming thread and the results of the change fed back into the events table.
>
> What happens is that the system becomes virtually dynamic with regards to "consequential events" as there will be a finite but usually very large number of "states" that have to be processed or recognised.
>
> Lots of the mainframe operating systems that I used to work on at Singer used this methodology as did the early microcode mainframes at ICL.
>
> The biggest difficulty in writing software this way is not the programming, it is actually defining the finite number of events, states and combinations of the two that will generate a state change that may or may not affect the actual state of the thread that is currently processing the change.
>
> Hope this makes sense as although it is a simple concept, the implementation of it is not a trivial task.
>
> Dave
>
>
> -----Original Message-----
> From: ProFox [mailto:profox-bounces@leafe.com] On Behalf Of Nicholas Geti
> Sent: 19 December 2013 04:35
> To: profox@leafe.com
> Subject: Finite State Machine
>
> Do any of you know the Finite State Machine technique for programming? Has anyone used it to do programming?
>
> Nick Geti
>
>
> ---
> This email is free from viruses and malware because avast! Antivirus protection is active.
>
>
> --- StripMime Report -- processed MIME parts --- multipart/alternative
> text/plain (text body -- kept)
> text/html
> ---
>
[excessive quoting removed by server]
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/52B2D6B9.2050603@hawthorncottage.com
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Andy,
Certainly the Singer 10 (which as a stripped IBM 360/148 Front end processor in its native form) when it was upgraded to the 220 by ICL did and it still maintained it's 10 bit architecture which made programming real fun! All the DRS 50 microcode was based on FSM architecture and this was lifted I believe from the 2903 which was ICL's first microcoded mini/mainframe. I can't vouch for the early 2900 ICL series as I never did any work on them to any degree.
The wierd thing is that when you are using a FSM system then it can't have any "properties" if it is to remain pure. A propery merely becomes an additional state but many times have I seen a "halfway house" solution where properties are used when dealing with software FSM's. One good thing about FSM is that it can only ever possess one state and that is the "current state" apart from when multi threading, but that adds a whole new bag of worms. The nice thing about the Singer 10 was that FSM handling was extremely rapid because of the 10 bit architecture and we could shift around data much quicker than the IMB equivalent machines ... and we were also completely solid state with genuine "core memory" so shutting off the machine mid run was not a problem. I do remember though, when the 220 came out, forgetting that it had volatile memory and going through my regular Singer 10 demo and turning off the power, much to the annoyance of my allocated salesman who went pale ... and lots of guffawing and piss taking as I knew what I had done as soon as I pulled the switch! I remember the customer (the Co-Op) actually said that the cock up actually sold them the system as they realised that we were in fact human, unlike the IBM "slicko's" who had demonstrated their 360 some days before.
Happy days indeed..
Anyway, on a lighter note, how are you doing with your living in, is it Goa lots of the time? Hope you are both well and enjoying the sunshine. Must admit it is a place I'd love to visit and it's on my bucket list!
Dave
-----Original Message-----
From: ProFox [mailto:profox-bounces@leafe.com] On Behalf Of AndyHC
Sent: 19 December 2013 11:21
To: profox@leafe.com
Subject: Re: Finite State Machine
Dave,
did the IBM mainframe and early microprocessor model of instruction pointer; address / data registers map onto a finite-state machine? I can see how it might be done(e.g. by mapping op codes to microcoded OR/NAND/SHIFT/JUMP etc.), but I don't see why it /would/ be done that way.
On 19/12/2013 15:39, Dave Crozier wrote:
> A finite state machine/system is one that:
>
> a. knows the current status of the "machine" at all times b. can
> recognise a state change of the machine c. reacts to a state change
> via a predetermined set of rules d. triggers a change in state for any
> state change in (c) above
>
> Although this would seem to be how any program/system can be defined, the Finite State Machine (FSM) is very rigid in how it models the "system". You need very structured code patterns and usually these are driven via an events table where each event can have a number of states with events being rows and states being columns.
>
> The table is scanned via the events handler and the combination of row/column values at any instant in time dictate either a state change or a requirement for a state change. This state change is then handled, normally in an alternative programming thread and the results of the change fed back into the events table.
>
> What happens is that the system becomes virtually dynamic with regards to "consequential events" as there will be a finite but usually very large number of "states" that have to be processed or recognised.
>
> Lots of the mainframe operating systems that I used to work on at Singer used this methodology as did the early microcode mainframes at ICL.
>
> The biggest difficulty in writing software this way is not the programming, it is actually defining the finite number of events, states and combinations of the two that will generate a state change that may or may not affect the actual state of the thread that is currently processing the change.
>
> Hope this makes sense as although it is a simple concept, the implementation of it is not a trivial task.
>
> Dave
>
>
> -----Original Message-----
> From: ProFox [mailto:profox-bounces@leafe.com] On Behalf Of Nicholas
> Geti
> Sent: 19 December 2013 04:35
> To: profox@leafe.com
> Subject: Finite State Machine
>
> Do any of you know the Finite State Machine technique for programming? Has anyone used it to do programming?
>
> Nick Geti
>
>
> ---
> This email is free from viruses and malware because avast! Antivirus protection is active.
>
>
> --- StripMime Report -- processed MIME parts --- multipart/alternative
> text/plain (text body -- kept)
> text/html
> ---
>
[excessive quoting removed by server]
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/18725B8CD2D5D247873A2BAF401D4AB22A47700D@EX2010-A-FPL.FPL.LOCAL
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Sorry, I think this should probably go [NF] now.....
Dave
-----Original Message-----
From: ProFox [mailto:profox-bounces@leafe.com] On Behalf Of Dave Crozier
Sent: 19 December 2013 11:35
To: ProFox Email List
Subject: RE: Finite State Machine
Andy,
Certainly the Singer 10 (which as a stripped IBM 360/148 Front end processor in its native form) when it was upgraded to the 220 by ICL did and it still maintained it's 10 bit architecture which made programming real fun! All the DRS 50 microcode was based on FSM architecture and this was lifted I believe from the 2903 which was ICL's first microcoded mini/mainframe. I can't vouch for the early 2900 ICL series as I never did any work on them to any degree.
The wierd thing is that when you are using a FSM system then it can't have any "properties" if it is to remain pure. A propery merely becomes an additional state but many times have I seen a "halfway house" solution where properties are used when dealing with software FSM's. One good thing about FSM is that it can only ever possess one state and that is the "current state" apart from when multi threading, but that adds a whole new bag of worms. The nice thing about the Singer 10 was that FSM handling was extremely rapid because of the 10 bit architecture and we could shift around data much quicker than the IMB equivalent machines ... and we were also completely solid state with genuine "core memory" so shutting off the machine mid run was not a problem. I do remember though, when the 220 came out, forgetting that it had volatile memory and going through my regular Singer 10 demo and turning off the power, much to the annoyance of my allocated salesman who went pale ... and lots of g uffawing and piss taking as I knew what I had done as soon as I pulled the switch! I remember the customer (the Co-Op) actually said that the cock up actually sold them the system as they realised that we were in fact human, unlike the IBM "slicko's" who had demonstrated their 360 some days before.
Happy days indeed..
Anyway, on a lighter note, how are you doing with your living in, is it Goa lots of the time? Hope you are both well and enjoying the sunshine. Must admit it is a place I'd love to visit and it's on my bucket list!
Dave
-----Original Message-----
From: ProFox [mailto:profox-bounces@leafe.com] On Behalf Of AndyHC
Sent: 19 December 2013 11:21
To: profox@leafe.com
Subject: Re: Finite State Machine
Dave,
did the IBM mainframe and early microprocessor model of instruction pointer; address / data registers map onto a finite-state machine? I can see how it might be done(e.g. by mapping op codes to microcoded OR/NAND/SHIFT/JUMP etc.), but I don't see why it /would/ be done that way.
On 19/12/2013 15:39, Dave Crozier wrote:
> A finite state machine/system is one that:
>
> a. knows the current status of the "machine" at all times b. can
> recognise a state change of the machine c. reacts to a state change
> via a predetermined set of rules d. triggers a change in state for any
> state change in (c) above
>
> Although this would seem to be how any program/system can be defined, the Finite State Machine (FSM) is very rigid in how it models the "system". You need very structured code patterns and usually these are driven via an events table where each event can have a number of states with events being rows and states being columns.
>
> The table is scanned via the events handler and the combination of row/column values at any instant in time dictate either a state change or a requirement for a state change. This state change is then handled, normally in an alternative programming thread and the results of the change fed back into the events table.
>
> What happens is that the system becomes virtually dynamic with regards to "consequential events" as there will be a finite but usually very large number of "states" that have to be processed or recognised.
>
> Lots of the mainframe operating systems that I used to work on at Singer used this methodology as did the early microcode mainframes at ICL.
>
> The biggest difficulty in writing software this way is not the programming, it is actually defining the finite number of events, states and combinations of the two that will generate a state change that may or may not affect the actual state of the thread that is currently processing the change.
>
> Hope this makes sense as although it is a simple concept, the implementation of it is not a trivial task.
>
> Dave
>
>
> -----Original Message-----
> From: ProFox [mailto:profox-bounces@leafe.com] On Behalf Of Nicholas
> Geti
> Sent: 19 December 2013 04:35
> To: profox@leafe.com
> Subject: Finite State Machine
>
> Do any of you know the Finite State Machine technique for programming? Has anyone used it to do programming?
>
> Nick Geti
>
>
> ---
> This email is free from viruses and malware because avast! Antivirus protection is active.
>
>
> --- StripMime Report -- processed MIME parts --- multipart/alternative
> text/plain (text body -- kept)
> text/html
> ---
>
[excessive quoting removed by server]
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/18725B8CD2D5D247873A2BAF401D4AB22A47702B@EX2010-A-FPL.FPL.LOCAL
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Yes. In 30 years of programming I only met two people who knew what it was.
I don't think it is taught in school any more. I would hate to see it
disappear which is why I brought up the subject. It has come to my rescue in
dozens of situations.
Programming and debugging a finite state machine application is almost
trivial. The hard part is determining the states. But that part is done with
paper and pencil before one begins coding.
The books on the subject have relatively simple examples so the student
doesn't really see the value of it.
Here is an easily understood sample from my experience:
My project was for a machining company that used CNC to mill metal parts.
Their programmers would prepare the CNC instructions on CAD computers but
not being totally skilled in milling techniques there would be mistakes. So
they wanted a way to read back and repair the command tapes quickly without
having to go back to the CAD programs and try to figure out what went wrong.
A programmer was working on this project for a year in Basic using lots of
If-Then-Else logic and never got it to work. Using FSM I solved the problem
in three days. Unfortunately the IT manager had no clue what I was talking
about. On top of that the owner of the company signed papers to sell the
company on the day I was to give a demonstration and everything was
canceled.
Think about it. CNC commands are free-form and streaming. That is, there is
a one-byte command followed by one to four digits representing a number such
as size of bit, distance to move, coordinates, etc.
Try to create the If-Then-Else scenario. If the byte is a command, then look
at next byte. Is it a command? Is it is number? And so on for fifteen or
twenty commands. It is a rat's next of logic.
Decoding/parsing commands such as needed in compilers is a natural for FSM.
Real-life examples are much more difficult to find the states but it can be
done. I once applied for a job at a firm that does product placement. They
contracted with clients to determine how to match products with customers.
They would break out patterns of customers: those that liked hot, or salty
or special flavors or speed, etc. and tweak the products to match these
various categories.
The engineer that I interviewed was describing his programming efforts and I
said it looked like a situation for the FSM. He immediately jumped out of
his seat and said that's exactly what he was doing and ran to fetch his
design notes to show me.
Nick Geti
----- Original Message -----
From: "Jean MAURICE" <jsm.maurice@wanadoo.fr>
To: <profox@leafe.com>
Sent: Thursday, December 19, 2013 12:21 AM
Subject: Re: Finite State Machine
>I think I do ! In fact I am not sure with the translation.
>
> When you have a lot of 'states' and a lot of conditions, you built an
> array. With one line per state and one column per condition. In each cell
> of this array, you get the index of the next state you must go and the
> name of the procedure you must execute.
>
> Is that what you are dealing with ?
>
> The Foxil
>
>
[excessive quoting removed by server]
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/B80FE4164F434891A8311CAFB7C30EDF@dual
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.