|
Not Ranked
:
+0 / -0
0 score
Re: Algorithms beyond programming
I remember writing a FSM (ATN net) for a parser for machine instructions for a handful of Intel and Motorola 8 and 16-bit chips for a bunch of engineers.
It was completely deterministic and simply read "tokens" from the input - an ASCII file of assembler tokens and directives - it always looked for a valid declarative. ATN grammars are context-free, and assembler instructions are (mostly) context-free as well, or the few exceptions, like the extensions in addressing modes introduced by Intel with the 16-bit chips were easy enough to handle.
Any algorithm can be recoded as a finite-state grammar, or transformed from a procedural 'algorithm' to a completely deterministic one. The deterministic state-transition paths should only be taken though, after you check the input is a valid set of tokens - there should be a lot of 'outs' in the graph, or default lambda-states that either 'fall-through' to the next state, or halt with a runtime error.
You could determine the inner workings of some algorithm, and decide to make it completely deterministic by setting a set of flags in registers, according to a scheme that corresponds to running an algorithm - the machine will produce the same output, although it will be fixed rather than variable so it will only handle one specific input state.
This might (or more likely it won't) correspond to what you want the algorithm to do, but in principle any 'program' can be recoded as a set of flags being tested and set, according to a predetermined pattern.
|