TOC Toolkit API - v0.1.0
    Preparing search index...

    toc-toolkit/machines

    The machine kernel. It represents finite control with an ordered tuple of input, stack, counter, queue and tape stores, and one checked model, compiler and breadth-first search serve the machine kinds, including the one-counter automaton. The procedure and syntax packages build on it.

    • Machine validation. Checks a draft in phases and mints a checked, frozen model when no issue is an error. (MachineDraft.check, MachineDraft.issues, MachineDraft.issuesSummary)
    • Breadth-first configuration search. Explores exact tuples of control and store contents, returns the shortest accepting transition path, and reports exhaustion apart from rejection. compiledMachine compiles a machine once for each budget tree, so many runs of one model share it. (compileMachine, compiledMachine, search, prepareSearch)
    • Untraced and prefix search. searchWithoutTrace runs the same search and records no frames, for a caller that needs only the outcome and the path. A PrefixSearch serves a machine whose memory behind the input is a stack or a queue. It keeps the configurations that remain after each prefix of the words that it has read, so a word that continues a read prefix charges only the configurations that the prefix did not reach. (searchWithoutTrace, PrefixSearch)
    • Reuse across edits. noteEdit records in an artifact cache that one machine is another with some transitions changed. compiledMachine then compiles the edit over the pools of the earlier machine and reuses the compiled edge of every unchanged transition, and prefixSearchOf starts from the prefix nodes of the earlier machine that no changed control reaches. (noteEdit, prefixSearchOf)
    • Path replay. Checks that a list of transition ids is an accepting run on a word. (replayPath)
    • Nondeterminism conflicts. Lists every pair of transitions of one control whose guards overlap, using a product trie over the store guards for large controls. (conflicts)
    • Configuration graph. Builds an NFA over pairs of control and remaining memory contents, which is exact when the reachable graph is finite. (configurationGraph)
    • Finite-memory reduction. Turns a PDA, DPDA, two-stack or queue machine, or a machine with a tape port, into a finite automaton when the construction applies. (finiteMemoryToFinite) Its decline codes distinguish a general LBA, a reachable left move, an uncertified tape window and an unavailable tape algorithm. A decline proves no claim about regularity. (FiniteReductionIssueCode)
    • Reachability and emptiness certificates. Finds the controls reachable without testing store guards and certifies some empty languages. (reachableControls, certifiedEmpty)
    • Pushdown predicates. isRealTime checks that every transition consumes an input symbol. isHeightDeterministic recognizes the sufficient case where every transition consumes a symbol and all transitions for each symbol have the same change in stack height. Runs on the same input prefix then start at the same height and add the same changes, so their heights agree. The test can decline other height-deterministic machines.
    • Finite-turn recognition. isFiniteTurn recognizes the sufficient case where every reachable strongly connected control component has height-changing edges of at most one sign. A control path visits each component at most once, so its height changes direction at most twice the number of controls. Ignoring stack guards can make the test decline another finite-turn machine.
    • Action graph. Interns the labelled edges of two compatible machines in one graph for the procedures that compare them. (compatibleActionGraph)
    • Machine editing. Adds, renames and deletes states, transitions and symbols and keeps ids stable. (MachineDraft.addState, MachineDraft.renameState, MachineDraft.deleteState, MachineDraft.deleteStates, MachineDraft.setStart, MachineDraft.setAccepting, MachineDraft.setRejecting, MachineDraft.addTransition, MachineDraft.deleteTransition, MachineDraft.deleteTransitions, MachineDraft.setEdgeTransitions, MachineDraft.addSymbols, MachineDraft.removeSymbol, MachineDraft.transitionsUsing)
    • Symbol usage. Lists the symbols that initial memory or transitions use, the used symbols that no declaration names, the declarations that nothing uses, and the symbols that an edit cannot remove. The declaring function adds every undeclared used symbol. (MachineDraft.usedSymbols, MachineDraft.undeclaredSymbols, MachineDraft.unusedSymbols, MachineDraft.fixedSymbols, MachineDraft.declareUsedSymbols)
    • Compilation funding. Reserves declaration and payload work on a budget before an owner compiles a machine without one. (fundMachineCompilation)
    • Widening. Appends an idle stack or queue to a checked machine. (widen)
    • Machine drafts and models. A draft holds states, start, accepting and rejecting sets and transitions with typed operations, and its functions form the namespace MachineDraft. A checked machine carries a brand. (MachineDraft, Machine, MachineKind)
    • Kind presets. The store shape, determinism rule, acceptance mode and blank draft of each kind. (PRESETS, StoreKind, KindPreset)
    • Compiled machine. Dense control indices and one prepared step per store and edge. (CompiledMachine, CompiledEdge)
    • Store behaviours. Input, stack, counter, queue and tape stores over shared pools. A counter starts at zero and tests zero or positive before changing its value. (STORES, hasStore, StorePools, StoreStep, PreparedStore)
    • Run and trace. A tagged result of accepted, rejected or exhausted, with breadth-first frames. (Run, SearchConfiguration, SearchFrame)
    • Balanced automaton. The type of a nested-word automaton with visible roles for the symbols. (BalancedAutomaton, VisibleAlphabet, visibleRoles)
    • Action graph. The labelled edges of two compatible machines over shared control states. (ActionGraph, CompatibleActionGraph, ActionGraphState)
    • Dumps. Print a draft, a compiled machine, an action graph or a balanced automaton as stable text. (MachineDraft.dump, dumpCompiled, dumpActionGraph, dumpBalancedAutomaton)
    • Reserved terminals. The refusal of an input terminal that the machine alphabet reserves. (reservedTerminalIssue, reservedTerminalIssueDecoder)
    • Decoders. Check machines, issues and traces that arrive from outside. (machineDecoder, machineOfDecoder, anyMachineDecoder, machineDraftDecoder, machineDraftOfDecoder, anyMachineDraftDecoder, machineStateDecoder, transitionDecoder, storeSpecDecoder, storeOperationDecoder, storeViewDecoder, machineIssueDecoder, storeIssueDecoder, conflictDecoder, searchConfigurationDecoder, searchFrameDecoder, controlAcceptanceDecoder, headMoveDecoder, inputOperationDecoder, inputSpecDecoder, inputViewDecoder, leftBoundedTapeSpecDecoder, machineIssueCodeDecoder, machineKindDecoder, machineTargetDecoder, markedTapeSpecDecoder, operationTargetDecoder, queueOperationDecoder, queueSpecDecoder, queueViewDecoder, runStatusDecoder, stackOperationDecoder, stackSpecDecoder, stackViewDecoder, stateIdDecoder, stateIndexDecoder, storeFinalDecoder, storeKindDecoder, storeTargetDecoder, tapeBoundsDecoder, tapeOperationDecoder, tapeSpecDecoder, tapeSymbolDecoder, tapeViewDecoder, transitionIdDecoder)
    • Enumerations. Name the closed sets of strings that the types and the wire data of the package use. (ActionGraphIssueCode, ControlAcceptance, DeterminismPolicy, FiniteMethod, FiniteReductionIssueCode, HeadMove, LabelLayout, MachineIssueCode, ReservedTerminalCode, RunStatus, StoreFinal, SymbolSlotKind, TapeBounds, VisibleRole)
    • Index and operation guards. Mint the index of a compiled state, and tell whether an operation belongs to the input store. (stateIndex, isInputOperation)