Definitively.Domain.TransitionTable (definitively v0.2.0)

Copy Markdown

Pure transition lookup built from a program's states.*.on maps.

Summary

Functions

Builds a transition lookup table from a loaded program.

Looks up the target state for a (from_state, label) edge.

Types

edge()

@type edge() :: {atom(), atom()}

t()

@type t() :: %Definitively.Domain.TransitionTable{
  edges: %{required(edge()) => atom()}
}

Functions

build(program)

@spec build(Definitively.Domain.Program.t()) :: t()

Builds a transition lookup table from a loaded program.

next(transition_table, from_state, label)

@spec next(t(), atom(), atom()) :: {:ok, atom()} | {:error, :no_transition}

Looks up the target state for a (from_state, label) edge.