Re: Finite State Machine

2013-12-19 Thread Man-wai Chang
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 ng...@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.
 http://www.avast.com


 --- 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+putqk1gkg50u...@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.


RE: Finite State Machine

2013-12-19 Thread Dave Crozier
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-boun...@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.
http://www.avast.com


--- 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/18725b8cd2d5d247873a2baf401d4ab22a476...@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.


RE: Finite State Machine

2013-12-19 Thread Dave Crozier
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-boun...@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.
http://www.avast.com


--- 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/18725b8cd2d5d247873a2baf401d4ab22a476...@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.


Re: Finite State Machine

2013-12-19 Thread Alan Bourke
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.1d62d...@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.


Re: Finite State Machine

2013-12-19 Thread AndyHC

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-boun...@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.
http://www.avast.com


--- 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.2050...@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.


RE: Finite State Machine

2013-12-19 Thread Dave Crozier
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-boun...@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-boun...@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.
 http://www.avast.com


 --- 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

RE: Finite State Machine

2013-12-19 Thread Dave Crozier
Sorry, I think this should probably go [NF] now.

Dave



-Original Message-
From: ProFox [mailto:profox-boun...@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-boun...@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-boun...@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.
 http://www.avast.com


 --- StripMime Report -- processed MIME parts

Re: Finite State Machine

2013-12-19 Thread Nicholas Geti
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.maur...@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.


Re: Finite State Machine

2013-12-19 Thread Stephen Russell
On Wed, Dec 18, 2013 at 11:21 PM, Jean MAURICE jsm.maur...@wanadoo.frwrote:

 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 ?

 -


To me that is a workflow.


-- 
Stephen Russell
Sr. Analyst
Ring Container Technology
Oakland TN

901.246-0159 cell


--- 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/CAJidMYKX=pvtp_xdjbltqfpqrdydv63zjutlsd35wloisns...@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.


Re: Finite State Machine

2013-12-19 Thread Stephen Russell
On Thu, Dec 19, 2013 at 4:09 AM, Dave Crozier da...@flexipol.co.uk wrote:


 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.

 -


I see Taxation at Sales following this methodology.  Rigid rules for
physical locations all over and you have to charge different rates
depending on your customer because you do drop ships for them.




-- 
Stephen Russell
Sr. Analyst
Ring Container Technology
Oakland TN

901.246-0159 cell


--- 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/cajidmy+lsiyzcwvbryyayr54cd88zoi71bn3m9jes0jg1y4...@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.


RE: Finite State Machine

2013-12-19 Thread Dave Crozier
Stephen,
Yes, I believe this model is used in large tax systems as it is to process 
large queueing systems. We used it because it is flexible and we used to call 
it Dynamic Jump-pad  programming used when memory is at a premium and the 
coding you start off with in a process isn't necessarily the coding you end up 
with because the code in te State responses actually can modify an existing set 
of response code.

At the time this really opened my eyes on two fronts.
a. The strength and versatility of assembler coding
b. The ability of a program to effectively learn by modifying itself. This 
was necessary because we only had 8K of core in those days and so to operate 
efficiently we didn't want to overlay code from disk back into memory so we 
dynamically altered code whilst it was in memory. 

The project was to write an operating system that supported Point of Sale Tills 
as external nodes, each of which was firing transactions back to a mainframe at 
any time so the mainframe had to be able to queue the events/transactions 
effectively. Using conventional if...else topdown technology would never have 
worked and would have become too large anyway.

We ended up streaming 4 FSM program models together in parallel in order to 
process the transactions which effectively did away with the conventional 
polling technique that most people would have used to create a solution. 
Funnily enough, OOP was only a glimmer in the sky at that stage but to all 
intents and purposes we were using all the OOP techniques in creating a 
solution to the problem.

It must have worked as it was only decommissioned 5 years ago after 25 years of 
operation on the same hardware!!!

Dave


-Original Message-
From: ProFox [mailto:profox-boun...@leafe.com] On Behalf Of Stephen Russell
Sent: 19 December 2013 16:17
To: ProFox Email List
Subject: Re: Finite State Machine

On Thu, Dec 19, 2013 at 4:09 AM, Dave Crozier da...@flexipol.co.uk wrote:


 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.

 -


I see Taxation at Sales following this methodology.  Rigid rules for physical 
locations all over and you have to charge different rates depending on your 
customer because you do drop ships for them.




--
Stephen Russell
Sr. Analyst
Ring Container Technology
Oakland TN

901.246-0159 cell


--- 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/18725b8cd2d5d247873a2baf401d4ab22a477...@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.


Re: Finite State Machine

2013-12-19 Thread Stephen Russell
On Thu, Dec 19, 2013 at 10:32 AM, Dave Crozier da...@flexipol.co.uk wrote:

 Stephen,
 Yes, I believe this model is used in large tax systems as it is to process
 large queueing systems. We used it because it is flexible and we used to
 call it Dynamic Jump-pad  programming used when memory is at a premium
 and the coding you start off with in a process isn't necessarily the coding
 you end up with because the code in te State responses actually can modify
 an existing set of response code.

 At the time this really opened my eyes on two fronts.
 a. The strength and versatility of assembler coding
 b. The ability of a program to effectively learn by modifying itself.
 This was necessary because we only had 8K of core in those days and so to
 operate efficiently we didn't want to overlay code from disk back into
 memory so we dynamically altered code whilst it was in memory.

 The project was to write an operating system that supported Point of Sale
 Tills as external nodes, each of which was firing transactions back to a
 mainframe at any time so the mainframe had to be able to queue the
 events/transactions effectively. Using conventional if...else topdown
 technology would never have worked and would have become too large anyway.

 We ended up streaming 4 FSM program models together in parallel in order
 to process the transactions which effectively did away with the
 conventional polling technique that most people would have used to create
 a solution. Funnily enough, OOP was only a glimmer in the sky at that stage
 but to all intents and purposes we were using all the OOP techniques in
 creating a solution to the problem.

 It must have worked as it was only decommissioned 5 years ago after 25
 years of operation on the same hardware!!!
 -



Awesome.

I bounce back and forth between easy code and workflow code.  We have an
asset approval process that s butt ugly in rules that use to be all hard
coded.  Now have modules that determine state and only get the rules that
pertain in this situation.  It take a bunch of sign-off here to buy
something.  # of people required  is determined by asset type and cost.


-- 
Stephen Russell
Sr. Analyst
Ring Container Technology
Oakland TN

901.246-0159 cell


--- 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/cajidmyk7ho-vm2wayzk7b6eknb6-tt30dpoxd-jtfaca2jm...@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.


Re: Finite State Machine

2013-12-19 Thread AndyHC

On 19/12/2013 22:02, Dave Crozier wrote:

... At the time this really opened my eyes on two fronts.
a. The strength and versatility of assembler coding
b. The ability of a program to effectively learn by modifying itself.

snip
At the time this got me really slapped on the wrist.

a. The strength and versatility of assembler coding
b. The ability of a program to effectively learn by modifying itself.

Self modifying code was a real memory saver and a real No-No for the 
newly invented programming standards wonks.
A couple of years later I was put in charge of ... programming standards 
- and I made it a rule 'no self modifying code' - so a lass (yes there 
were female programmers in the neolithic!) whose program was at the 
memory limit *moved some code into the data area, modified it, and 
executed it there* - then defied me to rule it out of order bg

  bl**dy 'L  - that took me back!

___
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/52b323c3.5070...@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.


Re: Finite State Machine

2013-12-19 Thread M Jarvis
On Thu, Dec 19, 2013 at 2:21 AM, Alan Bourke alanpbou...@fastmail.fm wrote:
 Many years ago I programmed factory-floor PLCs (programmable logic
 controllers) using 'ladder logic'. This sounds sort of like that.


I was going to make a joke and give an example such as:

do while .t.
enddo

and call it good  g

I *think* I've heard of FSM in the past but perhaps not. I know I
never studied the concept in college as I was a Math major not Comp
Science

Interesting stuff, especially as I see some of the practical examples
ya'll are putting out there...


-- 
Matt Jarvis
Eugene, Oregon USA

___
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/capt54rzv32+ekboaqxuc6e59qruj0osxuqrv6pbt5glw+jk...@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.


RE: Finite State Machine

2013-12-19 Thread Dave Crozier
Just to bring this thread back onto VFP, the O/S had a built in ISAM (Index 
Sequential Access Method) built into it which closely resembled VFP Files and 
indexes. On top of this we built a high level language to manipulate the ISAM 
files which virtually has a one to one with the early Foxbase  DBASE products 
on a database level i.e seek, find, browse, insert, delete etc.

it was at that time that I decided that any language that I was to do 
development of desktop apps on would have to have these facilities built into 
it and some years after I discovered Dbase II and Foxplus which was like a gift 
from god!

Dave

-Original Message-
From: ProFox [mailto:profox-boun...@leafe.com] On Behalf Of AndyHC
Sent: 19 December 2013 16:50
To: profox@leafe.com
Subject: Re: Finite State Machine

On 19/12/2013 22:02, Dave Crozier wrote:
 ... At the time this really opened my eyes on two fronts.
 a. The strength and versatility of assembler coding b. The ability of 
 a program to effectively learn by modifying itself.
snip
At the time this got me really slapped on the wrist.

a. The strength and versatility of assembler coding b. The ability of a 
program to effectively learn by modifying itself.

Self modifying code was a real memory saver and a real No-No for the newly 
invented programming standards wonks.
A couple of years later I was put in charge of ... programming standards
- and I made it a rule 'no self modifying code' - so a lass (yes there were 
female programmers in the neolithic!) whose program was at the memory limit 
*moved some code into the data area, modified it, and executed it there* - then 
defied me to rule it out of order bg
   bl**dy 'L  - that took me back!

[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/18725b8cd2d5d247873a2baf401d4ab22a477...@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.


Re: Finite State Machine

2013-12-19 Thread Nicholas Geti
The thinking about states in the FSM is similar to that in VFP. It is 
object-oriented style. The advantage of the FSM is the small size of the 
engine to drive it. One doesn't need a full blown OOP like VFP to write an 
app. Most of the logic is in arrays holding the state information. Note that 
moving from one state to the next also includes the ability to execute an 
output function just like in OOP so you need to code the output functions.


Another problem with thinking in VFP is that commercial frameworks are based 
on forms so now everything looks like a form. Not all apps require forms 
such as the examples I mentioned in my last note.


Nick Geti

- Original Message - 
From: Stephen Russell srussell...@gmail.com

To: ProFox Email List profox@leafe.com
Sent: Thursday, December 19, 2013 11:46 AM
Subject: Re: Finite State Machine


On Thu, Dec 19, 2013 at 10:32 AM, Dave Crozier da...@flexipol.co.uk 
wrote:



Stephen,
Yes, I believe this model is used in large tax systems as it is to 
process
large queueing systems. We used it because it is flexible and we used 
to

call it Dynamic Jump-pad  programming used when memory is at a premium
and the coding you start off with in a process isn't necessarily the 
coding
you end up with because the code in te State responses actually can 
modify

an existing set of response code.

At the time this really opened my eyes on two fronts.
a. The strength and versatility of assembler coding
b. The ability of a program to effectively learn by modifying itself.
This was necessary because we only had 8K of core in those days and so to
operate efficiently we didn't want to overlay code from disk back into
memory so we dynamically altered code whilst it was in memory.

The project was to write an operating system that supported Point of Sale
Tills as external nodes, each of which was firing transactions back to a
mainframe at any time so the mainframe had to be able to queue the
events/transactions effectively. Using conventional if...else topdown
technology would never have worked and would have become too large 
anyway.


We ended up streaming 4 FSM program models together in parallel in order
to process the transactions which effectively did away with the
conventional polling technique that most people would have used to 
create
a solution. Funnily enough, OOP was only a glimmer in the sky at that 
stage

but to all intents and purposes we were using all the OOP techniques in
creating a solution to the problem.

It must have worked as it was only decommissioned 5 years ago after 25
years of operation on the same hardware!!!
-




Awesome.

I bounce back and forth between easy code and workflow code.  We have an
asset approval process that s butt ugly in rules that use to be all hard
coded.  Now have modules that determine state and only get the rules that
pertain in this situation.  It take a bunch of sign-off here to buy
something.  # of people required  is determined by asset type and cost.


--
Stephen Russell
. 



---
This email is free from viruses and malware because avast! Antivirus protection 
is active.
http://www.avast.com


___
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/14C4AA84D6F94EC69A1D47BB43E4F77A@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.


Re: Finite State Machine

2013-12-19 Thread Nicholas Geti

Your joke is not far off. Just add a call

do while currentstate .NE. done
currentstate= FSM(event, currentstate, output)  ; where FSM returns the next 
state and execute the output function

endwhile

I Googled Finite State Machine
Looks like a hotbed of information about it.

Nick Geti


- Original Message - 
From: M Jarvis brewda...@gmail.com

To: profox@leafe.com
Sent: Thursday, December 19, 2013 12:05 PM
Subject: Re: Finite State Machine


On Thu, Dec 19, 2013 at 2:21 AM, Alan Bourke alanpbou...@fastmail.fm 
wrote:

Many years ago I programmed factory-floor PLCs (programmable logic
controllers) using 'ladder logic'. This sounds sort of like that.



I was going to make a joke and give an example such as:

do while .t.
enddo

and call it good  g

I *think* I've heard of FSM in the past but perhaps not. I know I
never studied the concept in college as I was a Math major not Comp
Science

Interesting stuff, especially as I see some of the practical examples
ya'll are putting out there...


--
Matt Jarvis
Eugene, Oregon USA





---
This email is free from viruses and malware because avast! Antivirus protection 
is active.
http://www.avast.com


___
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/241DA8C6F9C04FC08CDB95C841D6648E@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.


Re: Finite State Machine

2013-12-19 Thread Stephen Russell
On Thu, Dec 19, 2013 at 11:17 AM, Nicholas Geti ng...@optonline.net wrote:

 Your joke is not far off. Just add a call

 do while currentstate .NE. done
 currentstate= FSM(event, currentstate, output)  ; where FSM returns the
 next state and execute the output function
 endwhile

 


In my case that output is actually a request via email to to give a
thumbs up or down on the transaction.  Depending on the asset we will track
comments and cross references through our app and people high atop the
totem pole can see what has transpired for this request.





-- 
Stephen Russell
Sr. Analyst
Ring Container Technology
Oakland TN

901.246-0159 cell


--- 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/CAJidMYJ7_QX-8aDtaTari3t9=-yxnhbqc6t6gcjmztom71y...@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.


Re: Finite State Machine

2013-12-19 Thread Gene Wirchenko

At 20:34 2013-12-18, Nicholas Geti ng...@optonline.net wrote:
Do any of you know the Finite State Machine technique for 
programming? Has anyone used it to do programming?


 Yes.

 Yes.  I find it very useful for some forms of parsing.

Sincerely,

Gene Wirchenko


___
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/
** 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.


Re: Finite State Machine

2013-12-19 Thread Gene Wirchenko

At 07:38 2013-12-19, Nicholas Geti ng...@optonline.net wrote:
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.


 It might partly be a matter of vocabulary.  state transition 
diagram is another term.


 It was taught in my computing diploma in the last semester.  I 
had previously used an extended version to implement a calculator.


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.


 GASP!  You mean planning in advance?

The books on the subject have relatively simple examples so the 
student doesn't really see the value of it.


 And complicated examples are a bear to follow.


Here is an easily understood sample from my experience:


[snipped example]

 Here are mine.

  1) My VFP app needed a string for how credit card transactions are 
handled.  The date had to be substituted in there somewhere once.  I 
used % as an escape character with %d meaning the date and %% 
meaning a percent character.  My FSM validated that the date escape 
occurred exactly once and that all escape codes were correct and that 
the string did not end mid-escape.


  2) On my computing diploma, I implemented an FSM with additional 
actions to implement a four-banger calculator.  It took three 
states.  It was easy.  My classmates who did not know the technique 
were cursing the assignment.


Sincerely,

Gene Wirchenko


___
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/
** 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.


Finite State Machine

2013-12-18 Thread Nicholas Geti
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.
http://www.avast.com


--- 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.


Re: Finite State Machine

2013-12-18 Thread Jean MAURICE

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.6070...@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.