Next: asmat, Previous: parse-asm, Up: Example Programs [Contents][Index]

`asm-disasm`

This program can be used to study or debug assembling a node, assigning values to controlled probability variables of the node, and disassembling the node.

The program supports a single optional argument that specifies the name of a file with an assembler program text. If the argument is not given, then the program will read an assembler program text from stdin. After assembling the node and optional assigning values to its controlled probability variables, this program prints a disassembled program text to stdout.

To assemble a program, its instruction set must be previously defined.
Specifying the instruction class set has to be done using a number of options `-I STR[/INT]`, where each option defines an instruction, which is an element of the instruction set.
Option argument

For example, to define an instruction set that contains instructions ‘`nop1`’, ‘`user 0`’, and ‘`user 1`’ with one outcome and instruction ‘`test 3`’ with three outcomes, the following list of options `-I` may be used:

-I nop1 -I "user 0" -I "user 1" -I "test 3/3"

If an assembler program contains definitions of probability variables, then assignments to those variables can be made using a number of options `-P STR=FLOAT` where

`var1`

and value 0.15 to the variable `var2`

, the following list of options -P var1=0.05 -P var2=0.15

The list of command-line options understood by the `asm-disasm`

program is given below.

`-D, --determ-mat-action`

Restrict the action emission matrix to defining only deterministic action choices. In this case, probabilities specified in the assembler program correspond only to the state transition matrix, and there is no need to mark unnamed states of the assembler program by

`stt`

instructions.`--dont-reg-vars`

Do not register controlled probability variables of the node.

`--dump-action[=`

`FILE`]Dump the action emission matrix to a file. If

`FILE`not specified, then`mat_action`will be used for it. See Dumping an Action Emission Matrix, for an output format of the matrix.`--dump-goto[=`

`FILE`]Dump the state transition matrix to a file. If

`FILE`not specified, then`mat_goto`will be used for it. See Dumping a State Transition Matrix, for an output format of the matrix.`--dump-var-choice`

When the option

`--dump-var-out[=`is specified, dump output probabilities arrays that correspond to`FILE`]`choice`

instruction blocks.`--dump-var-out[=`

`FILE`]Dump output probability variables and arrays of the node. There are dumped output probabilities arrays that correspond to

`casels`

instructions. If the option`--dump-var-choice`is specified, then there will also be dumped output probabilities arrays that correspond to`choice`

instruction blocks. If`FILE`not specified, then`var_out`will be used for it.`-I, --instruction=`

`STR`[/`INT`]Add instruction class

`STR`with`INT`outcomes to the instruction class set. All characters ‘`%`’ in`STR`are converted to spaces. The default number of outcomes is 1.`-L, --large=`

`PE`|,`PO`|`PE`,`PO`Use a large actor for the environment state identification engine with size

`PE`of the pool of probabilities lists in normal form and/or use a large actor for the instruction emitting engine with size`PO`of the pool of probabilities lists in normal form. The sizes should be sufficient to support storing in the pools all those lists explicitly and/or implicitly defined in the assembler program. The use of large actors is only permitted with map storage (see the option`-S`).`--no-nop`

Do not define the

`nop`

instruction class.`--prob-action-min=`

`FLOAT`When the option

`--template`is provided, the option`--prob-action-min=`specifies the minimum probability of`FLOAT``jprob`

and`case`

instructions, which correspond to the action emission matrix, to retain in the disassembled program. Instructions with lesser probabilities will be removed from the disassembled program, although they are present in the input assembler program. When the option`--template`is not given, the option`--prob-action-min=`specifies the minimum probability of user or mixed type instruction invocation. Instructions with lesser invocation probabilities will not be generated when disassembling the node.`FLOAT``--prob-goto-min=`

`FLOAT`When the option

`--template`is given, the option`--prob-goto-min=`specifies the minimum probability of`FLOAT``jprob`

and`case`

instructions, which correspond to the state transition matrix, to retain in the disassembled program. Instructions with lesser probabilities will be removed from the disassembled program, although they are present in the input assembler program. When the option`--template`is not given, the option`--prob-goto-min=`specifies the minimum probability of state transition. State transitions with lesser probabilities will not be reflected in the disassembled program.`FLOAT``--prob-prec-mat=`

`INT`The number of digits after the decimal point to print for probabilities in the state transition matrix and the action emission matrix. A positive number specifies fixed-point notation. A negative number specifies exponential notation, and its absolute value indicates the number of digits after the decimal point. Zero number is equivalent to default value -15.

`--prob-prec-var=`

`INT`The number of digits after the decimal point to print for values of output probability variables and elements of output probabilities arrays. A positive number specifies fixed-point notation. A negative number specifies exponential notation, and its absolute value indicates the number of digits after the decimal point. Zero number is equivalent to default value -15.

`-P, --variable=`

`STR`=`FLOAT`Assign value

`FLOAT`to controlled probability variable`STR`defined in the assembler program.`-S, --storage=flat|map`

A statistics storage type.

- ‘
`flat`’ Use preallocated storage presumably of big size, but with quick access to data elements.

- ‘
`map`’ Use dynamically allocated storage presumably of lesser size, but with slower access to data elements. The implementation of functionality of the STL

`map`

template is used for backing storage. Is the default mode.

- ‘
`--template`

Disassemble the node using an assembler program template which is the input assembler program. As a side effect, all

`casels`

instructions encountered in the input assembler program will be converted to`choice`

instruction blocks (except for`casels`

instructions, which use probabilities lists that contain only one element; such instructions will be converted to`jprob`

instructions).`--use-stt`

Generate

`stt`

instructions when disassembling the node.`-W`

Show warnings that might have been generated while assembling the node.

Next: asmat, Previous: parse-asm, Up: Example Programs [Contents][Index]