About.
State / pl: 'stan' / can be defined in many ways.
Finite State Machine.
A finite-state machine (FSM) / pl: automat skończenie stanowy / is a mathematical model of computation. It is an abstract machine that can be in exactly one of a finite number of states at any given time. The FSM can change from one state to another in response to some inputs; the change from one state to another is called a transition
/ pl: 'przejście', 'funkcja przejścia' /. An FSM is defined by a list of its states, its initial state / pl: 'stan początkowy' /, optionally acceptance (final) state(s) / pl: 'stan(y) akceptujący(-e)', 'stan(y) końcowy(-e)' /, transitions, and the inputs that trigger each transition.
... for more, feel free to look: [ Finite-state machine on Wikipedia ].
Finite State Object.
One can look at object, at it's variables. Variables can be - and are - represented as list of 0's and 1's. Variable values can be concatenated into one list. All of possible permutations of 0's and 1's in this list represent all of possible of this object's states.
Similarly, object's methods can be seen as 'families' of transition functions / pl: 'rodziny funkcji przejścia' / between object's
possible states. Object, method's name & possible parameter(s) - if any - passed to the method, together determine unambiguously / pl: 'jednoznacznie' / which transition to trigger.
In this way, object can be seen as finite state automaton, also called FSM - Finite State Machine.
... i call FSM implemented as object an FSO - Finite State Object.
In FSO, each of possible states can be represented graphically as a dot labelled with its list of 0's and 1's ... and method(s) - if any - is/are arrow(s) leading from one state to one or more other state(s). Obviously not every state must be connected with every other possible state. Not every method must change object's state as well ... then there's either no arrow associated with this method, or there is/are arrow(s) that point(s) to the same FSO that it originated from - useful when we want certain 'side effect(s)' to happen as a part of transition (see below).
FSO can have the 'side effects' that can trigger / pl: 'wyzwalać' / on transition, can send message(s) to other FSO(s), can call method(s) on other FSO(s). That way, Directed Graphs of FSOs can be seen as complete models of programs, that can be executed as well.
Context.
We can select a group of objects and contain it in another object, then states of contained objects are parts of grouping object's state. Anything outside connected to grouping object can be named 'context' / pl: kontekst /. That is ... context is 'external state'.
Mind States.
I think and feel that buddhism's concept of Mind can be explained as similar to Finite State Machine(s).
For more details, feel free to look: [ Self-Improvement and Mind States ].
Links.
- Automata, Languages & Computations / Work in Progress Still /.
No comments:
Post a Comment