ANML Documentation

State Transition Element

The state transition element (STE) is the resource that stores the state of the automaton. It is also the symbol recognition element and sole device capable of receiving an input symbol.

An STE is comprised of two required attributes and three optional attributes. It may also generate two types of output.

Required attributes:

  • ID
  • symbol set

Optional attributes:

  • start
  • case
  • latch

Optional outputs:

  • activate-on-match (activation signals to other nodes)
  • report-on-match (report generation)

An STE can be either active or inactive. An active STE will respond to the current input symbol. If the input symbol matches the STE's programmed symbol set, the STE will generate outputs: activate-on-match (activate any STEs to which it is connected, possibly including itself) or report-on-match (generate a report). Activated STEs will be active for the next input symbol cycle. This process of matching and activating downstream STEs repeats for each additional input symbol.

It is possible for an automaton to die out if it reaches the end of a chain of STEs and there are no further activation connections. It may also die out if an STE does not match the input symbol on a symbol cycle.

Figure 1 shows the syntax of an STE.

Figure 2 shows an STE as constructed in the AP Workbench.

Figure 1. State Transition Element
Railroad ste

Figure 2. State Transition Element (AP Workbench)
Ste workbench

ID Attribute

The ID attribute is a user-defined unique identifier (name) for the STE. The ID attribute must start with a character, but can then contain other characters, digits, or underscore symbols.

Symbol Set Attribute

The symbol set attribute defines the symbol(s) the STE is programmed to match. The symbol set attribute can be defined using one of three methods: as a single character, a regex character class, or as a numerical class (digit).

Figure 3. Symbol Set Attribute
Railroad symbol set

Single Character

The single character method programs an STE to recognize a single 8-bit character. The character is entered without any additional markup. The character can be specified in decimal or hexadecimal notation. For hexadecimal notation, include a leading \x followed by two hexadecimal digits. For example:



The single character method is based on a subset of admissible characters in Perl Compatible Regular Expression (PCRE). Most characters stand for themselves in a pattern and will match the corresponding input character. For example, a will match the ASCII byte value for the lower case letter a.

The single character method supports pattern meta-characters (see STE Symbol Sets); these pattern meta-characters are not interpreted as literal characters.

The single character method supports the use of an asterisk (*) as a meta-character representing any character including a new line. An STE can be made case-insensitive (see STE: Case Attribute).

Regex Character Class

The regex character class is based on a subset of the PCRE character classes. A set of square brackets encloses a regex character class specification; for example:


Ranges are specified with a dash and operate in ASCII collating sequence. Ranges can be used for characters specified numerically, for example [\000-\037]. Additional formatting includes:

  • [A-Z] represents any uppercase letter in the range A through Z
  • [ˆA] represents anything other than the letter A
  • [ABCDE] is any of the letters A,B,C,D,E (no other characters)
  • [0-9A-Fa-f] represents any single hexadecimal digit

Regex character classes, unlike PCRE, cannot be set for case-insensitivity. If case-insensitivity is desired, both the lower and upper case ranges must be specified.

If a closing square bracket is required as a member of the class, it should be the first data character in the class (after an initial circumflex, if present) or escaped with a backslash.

If a minus character is required in a class, it must be escaped with a backslash or appear in a position where it cannot be interpreted as indicating a range, typically as the first or last character in the class.

It is not possible to have the literal character "]" as the end character of a range. A pattern such as [W-]46] is interpreted as a class of two characters ("W" and "-") followed by a literal string "46]", so it would match "W46]" or "-46]". However, if the "]" is escaped with a backslash it is interpreted as the end of range; therefore, [W-\]46] is interpreted as a single class containing a range followed by two separate characters. The octal or hexadecimal representation of "]" can also be used to end a range.

The character types \d, \D, \s, \S, \w, and \W may also appear in a character class and add the characters that they match to the class. For example, [\dABCDEF] matches any hexadecimal digit. A circumflex can conveniently be used with the upper-case character types to specify a more restricted set of characters than the matching lowercase type. For example, the class [ˆ\W_] matches any letter or digit, but not underscore.

All non-alphanumeric characters other than \, -, ˆ (at the start) and the terminating ] are non-special in character classes, but it does no harm if they are escaped. The pattern terminator is always special and must be escaped when used within an expression.

Numerical Class

The numerical class specifies a bit-level pattern. This method is unique to ANML and not found in PCRE. This method may be easier to use than the single character or regex character class method for applications that are not character-oriented.

Numerical class digits can be specified in decimal form only. A set of curly brackets {} encloses a numerical class specification; for example:


The numerical class can specify multiple digits and ranges of digits. Multiple digits are comma-separated and ranges are specified with a colon.

For example, the following pattern specifies 0 to 9 and 250 to 255 as well as positions 20 and 40. An input byte, after passing through the 8-to-256 decoder that has any of these bits sets, will match the pattern and cause the STE to execute match actions:


In the regex character class, this pattern would be specified as:


The numerical class specifies any combination of bit positions from 0 to max_bit, inclusive, which are set and match-enabled. In an 8-bit byte implementation, max_bit is 255.

Comparing the Symbol Sets

Figure 4 illustrates programming a single value (A) in the AP Workbench using the three symbol set methods. Figure 5 illustrates programming a range of values with each method. Figure 6 illustrates programming a mix of ranges and values.

Figure 4. Symbol Set—Single Value (A)
Ste symbol set single

Figure 5. Symbol Set—Range of Values (A–C)
Ste symbol set range

Figure 6. Symbol Set—Ranges and Values (A, B–C)
Ste symbol set mixed

Start Attribute

The start attribute defines the STE that will be active on either the first symbol cycle or all symbol cycles. The start attribute has three possible settings:

  • None: The STE is active only when activated by another element in the automata network.
  • Start-of-data: The STE is active on the first symbol cycle and only active thereafter if it is activated by another element (possibly itself) in the automata network. In the AP Workbench, start-of-data appears with the 1 indicator in the upper left corner of the STE.
  • All-input: The STE is active on all symbol cycles. In the AP Workbench, all-input appears with the infinity symbol (∞) indicator in the upper left corner of the STE.

If not specified, the default setting (none) is used .

Figure 7. Start Attribute
Railroad ste start attribute

Case Attribute

The case attribute is a shorthand method for specifying an STE’s matching as case-insensitive. This setting only affects the characters a–z and A–Z. Other match symbols are unaffected.

For example, an STE with symbol set=[AB*?] and case-insensitive=true will match any of these symbols: *, a, A, b, B, ?

The default behavior is false (STE is case-sensitive).

Figure 8. Case Attribute
Railroad ste case attribute

Latch Attribute

If an STE has the latch attribute enabled, the STE will continue to drive its outputs after it has matched against a symbol in the input data stream, including if the STE has report-on-match enabled (the STE will continue to generate reports on all subsequent symbol cycles). A latched STE will also continue to drive activation signals to any other automata network elements to which it is connected.

The default behavior is false.

Figure 9. Latch Attribute
Railroad ste latch attribute


The report-on-match output causes the STE to generate a report event if the current input symbol matches the STE’s symbol set.

If the STE also has the latch attribute turned on, the STE will continue to generate report events on all subsequent symbol cycles.

Because the report-on-match output is a characteristic of the STE, there will only be a single indicator to represent this; therefore, an STE will have either a report-on-match or it will not. This is in contrast to activate-on-match, where an STE can have any number of activate-on-match outputs.

The report-on-match output must precede any activate-on-match outputs.

Figure 10. Report-on-Match
Railroad ste report on match

Any STE can generate an output report and any number of STEs can be enabled for reporting. A hardware device implementing ANML may have restrictions either in the total number or distribution of report-enabled STEs; however, these potential restrictions are not an intrinsic part of ANML.

ANML does not support output values either on the transition or associated with the STE. Match report output from the STE is generated on elements designated as report-on-match. However, elements that are not report-output-enabled do not generate report output. In a very limited sense it is possible to view the operation of an ANML machine as a finite transducer with a capability of outputting either no report output signal on a given clock cycle or a report output signal if the STEs are configured as report-on-match.

ANML chip implementations may limit the number of report-output-enabled elements because of routing constraints, and there may be other practical limitations that would prevent one from making much use of the finite transducer, even as a finite transducer with the limitation of having essentially just a binary output value.


The activate-on-match output indicates which other automata network entities are activated if the current input symbol matches the STE's symbol set, creating activation connections (transitions) from this STE to other elements in the automata network.

Activation means the STE will accept the next input symbol and take whatever action is specified when the symbol matches the symbol set. An activation by another STE is only enabled for the next symbol cycle; if no subsequent activation of the STE occurs, it will be deactivated after processing the current input symbol.

The containing STE is the source or causative element, and the element that is activated on the next input cycle is identified by the value of the element attribute in the activate-on-match element.

Figure 11. Activate-on-Match
Railroad ste activate on match

ANML transitions are specified only in the source element; an element declares what elements it activates on a match but it does not know what elements can activate it.

In classic finite state automata, the match value is associated with the transition; however, in ANML transitions are unmarked as they are more properly activations which occur on the match event in the source element.

An STE can drive activation connections to any number of other elements in the network. However, when it comes to hardware, there is a finite limit to the routing capacity and the number of elements available within a chip. For these reasons, it recommended that a designer be somewhat conservative in how many activation connections come from any single STE in the automata network. There may be cases where a designer will want to use redundant resources within a network to accommodate high fanout activation connections, or there may be instances where resources are used to combine multiple activation signals into a single activation signal.