Expand description
The core modules for the rstm
framework, providing a suite of fundamental abstractions
and primitives for creating and managing state machines and related constructs.
Modules§
- error
- The
error
module defines the coreError
type used throughout the library and provides a convenient alias forResult
types. - head
- prelude
- rule
- state
- The
state
module provides abstractions and implementations for managing state within therstm
framework. - tail
- The
Tail
of a rule defines the reaction of the actor under specific conditions. Specifically, it defines the next state, the symbol to write, and the direction to move - traits
- types
- The core types used throughout the library such as the
Direction
enum - utils
- useful utilities for managing and creating Turing machines and related constructs
Structs§
- Head
- The
Head
of a Turing machine is defined to be a two-tuple consisting of a state and a symbol. Our implementation is generic over both the state and symbol types, allowing for flexibility in their representation(s). - Learned
Rule - A
LearnedRule
is an extension of the basicRule
structure, incorporating a confidence metric to quantify the reliability or certainty of the rule within the scope of a learning context. This is particularly useful in scenarios where rules are derived from data or experience, allowing for a more nuanced application of rules based on their confidence levels. - Rule
- The
Rule
implementation is a concrete representation of a single instruction, or rule, within a given Turing machine program. It encapsulates the necessary components to define the behavior of the Turing machine when it encounters a specific state and symbol. - State
- State is a generalized state implementation, representing the state of a system or object.
- Tail
- The
Tail
of a rule in a Turing machine
Enums§
- Direction
- Direction enumerates the various directions a head can move, namely: left, right, and stay.
- Error
- The
Error
implementation describes the various errors that can occur within the library
Traits§
- Alphabet
- Alphabet describes a finite set of symbols used to construct a formal language.
- AsDirection
- The AsDirection trait provides a convience method for converting a type into a Direction.
- AsHead
- Converts to a
Head
by reference. - AsTail
- Converts a type into a
Tail
by reference. - Decrement
- Decrement is a trait that provides a common interface for decrementing values; i.e., subtracting one from a value.
- Decrement
Assign - DecrementAssign is a trait that provides a common interface for decrementing values in place.
- Directive
- The
Directive
trait is used to define the expected behaviors of all tail-like objects within the system - Increment
- Increment is a trait that provides a common interface for incrementing values; i.e., adding one to a value.
- Increment
Assign - IncrementAssign is a trait that provides a common interface for incrementing values in place.
- Incremental
- Incremental is a trait that provides a common interface for incrementing and decrementing values.
- Instruction
- The
Instruction
trait defines the expected behaviors of a particular rule within a Turing machine program. - Into
Direction - The IntoDirection trait provides a convience method for converting a type into a Direction.
- Into
Head - Consumes the caller to convert it into a
Head
. - Into
Tail - A consuming trait for converting a type into a
Tail
. - RawState
RawState
is a trait describing objects capable of being used as states in our library. The trait contains a single associated trait, the context, or inner value of the state.- RawSymbol
- The
RawSymbol
trait establishes the minimum requirements for a type to be used as a symbol within a Turing machine. - Scope
- The
Scope
trait establishes a common interface for all head-like objects; - Symbol
- The
Symbol
trait extends theRawSymbol
to define the expected behaviors of a symbol used within a Turing machine. - Symbolic
Symbolic
is a marker trait used to signal a type that can be displayed.
Functions§
- get_
range_ around - returns a range, as a 2-tuple, around a given position within the bounds of some length and with some radius
- pretty_
printer - printer
Type Aliases§
- HeadMut
- a type alias for a
Head
containing mutable references to its state and symbol - HeadRef
- a type alias for a
Head
containing immutable references to its state and symbol - Result
- A type alias for a
Result
with an error type ofError
- TailMut
- A type alias for a
Tail
containing mutable references to the next state and symbol. - TailRef
- A type alias for a
Tail
containing immutable references to the next state and symbol.