A researcher may want to investigate the behavior of a state transition network that operates under the control of QSMM.
The network can be defined by an assembler program that contains a number of macro definitions.
Every expanded macro might correspond to a state, from which there can be transitions to other states.
The text of macro
g1 that can represent a state linked to the other state in a chain of state transitions was already given in Defining Macros.
Along with instruction
regst that macro might contain other user instructions, which perform custom operations upon entering a state.
Below there is given the text of macro
g2 that defines a state with two possible transitions to states specified by arguments of the macro.
To every transition a probability corresponds, according to which user spur increment is made.
The probabilities are specified by arguments of the macro.
incspr increments user spur by the logarithm of a probability specified as an instruction argument.
g2 macro id, l1,p1, l2,p2 lu def u##__UNIQUE__ s##id: stt #id regst jprob 0.5, lu incspr p2 jmp l2
lu: incspr p1 jmp l1 end macro
Below there is represented an example state transition network. The initial state is encircled by the thick line.
The state transition network can be described by the following assembler program fragment located after definitions of macros
g2 0, s1, 0.5, s5, 0.5 g2 1, s2, 0.5, s3, 0.5 g1 2, s4 g1 3, s4 g2 4, s1, 0.5, s9, 0.5 g2 5, s6, 0.9, s7, 0.1 g1 6, s8 g1 7, s8 g2 8, s5, 0.5, s9, 0.5 g1 9, s0
Note that when a state is connected to just one other state, the state transition is performed deterministically. When the environment state identification engine is represented by a small actor, the use of a state transition network with states connected to several different numbers (greater than 1) of other states will imply relying on a rather weak concept of the mean number of actor’s output signals (described in Other Parameters of an Actor) that biuniquely correspond to states. Therefore, it is recommended either to use a state transition network with states, where each state is connected to just one other state and/or to certain fixed number of other states, or to use a large actor for the environment state identification engine that does not have such deficiency. In the latter case, the number of output signals of a small actor associated with the large actor is fixed and is equal to the arity of Huffman tree. The same is pertinent to invocation of instructions in action choice states: if in different action choice states there can be invoked instructions from the sets of user and mixed type instructions of different sizes greater than 1, it is recommended to use the instruction emitting engine represented by a large actor.
Another peculiarity a researcher should keep in mind is that the auto-increment of the automatic spur is not well-defined when the state transition network has transitions performed deterministically. Such transitions can appear not only between principal states of the network, but also between user and mixed type instructions within definitions of those states. Moreover, it is often useful to increment the automatic spur only during transitions between a subset of states defined by an assembler program. Therefore, it is generally recommended switching off the auto-increment of the automatic spur for assembler programs, especially when they define deterministically performed state transitions. In this case, automatic spur (or spur of other kind used instead of it) can be incremented manually by a well-defined algorithm supplied by the researcher during invocation of user instructions from an instruction set provided by the researcher.