A Wolfram Language paclet for exploring and analyzing Turing machines, powered by a Rust backend for high-performance enumeration and search.
📦 Paclet Repository: https://resources.wolframcloud.com/PacletRepository/resources/WolframInstitute/TuringMachine/
The published
README.mdis generated fromREADME-raw.mdwith MarkdownToNotebook; its output images are live evaluations. EditREADME-raw.mdand regenerate — don't editREADME.mdby hand.
PacletInstall["WolframInstitute/TuringMachine"]
Needs["WolframInstitute`TuringMachine`"]Full documentation — a guide page, a reference page for every symbol, and a tutorial — ships with the paclet and is browsable on its documentation site and the Paclet Repository page. The markdown sources live under TuringMachine/docs/ and are built into the paclet's documentation notebooks by scripts/build_docs.wls.
A machine is identified by its Wolfram enumeration number together with its state and color counts, written {number, s, k}. A bare integer is shorthand for a 2-state, 2-color machine.
Run the s=3, k=2 rule 600720 on input 1 for at most 32 steps:
OneSidedTuringMachineFunction[{600720, 3, 2}, 1, 32]Return the steps, value, and width together as {steps, value, width}:
OneSidedTuringMachineFunction[{600720, 3, 2}, 1, 32, All]A bare integer rule is treated as a 2-state, 2-color machine:
OneSidedTuringMachineFunction[2506, 1, 100]Give the transition table explicitly, as {state, symbol} -> {nextState, writeSymbol, direction} (direction 1 = right, -1 = left):
OneSidedTuringMachineFunction[{{1, 0} -> {1, 1, 1}, {1, 1} -> {1, 0, -1}}, 1, 100]Count the distinct rules with 2 states and 2 colors:
TuringMachineRuleCount[2, 2]Tabulate step counts for all 4096 two-state, two-color machines over inputs 1 through 100 (backed by Rust):
Dimensions[TuringMachineSteps[2, 2, 200, 100]]See also TuringMachineOutput, TuringMachineWidths, and the combined TuringMachineOutputWithStepsWidths (and their numeric ...Float variants).
A multiway machine is a list of integer rule numbers; where their transitions disagree, the machine branches. Search for a sequence of transitions turning input 0 into output 5 within 50 steps:
MultiwayTuringMachineSearch[{2506, 1953}, 0, 5, 50]Count how many branches remain unexplored after 20 steps:
MultiwayNonHaltedStatesLeft[{2506, 1953}, 0, 20]Rule 257 enters a cycle within 1000 steps on input 1:
NonTerminatingTuringMachineQ[257, 1, 1000]Rule 2506 does not:
NonTerminatingTuringMachineQ[2506, 1, 1000]Plot the space-time evolution — tape cells colored by symbol, the head a black marker:
OneSidedTuringMachinePlot[{600720, 3, 2}, 1, 16]Plot the output value as a function of the input:
OneSidedTuringMachineFunctionPlot[{600720, 3, 2}, {1, 50}, 200]Plot the running time as a function of the input:
OneSidedTuringMachineRuntimePlot[{600720, 3, 2}, {1, 50}, 200]The Rust backend (TuringMachine/Libs/ndtm_search) is built with
cargo wl, which compiles the library and writes it,
with its generated Wolfram Language loader, into
TuringMachine/Binaries/ndtm_search-<SystemID>/. The build scripts live in
scripts/.
Build the library for the host and every cross target (macOS x86-64/ARM64, Linux
x86-64/ARM64, Windows x86-64). Cross-compiling needs the toolchains that
scripts/setup_rust.sh and scripts/setup_cross_compile.sh install; on a Mac it is easiest
to build inside the Wolfram Engine container with scripts/docker_build.sh:
./scripts/build_all_targets.shLoad the paclet from this checkout:
PacletDirectoryLoad["TuringMachine"]
Needs["WolframInstitute`TuringMachine`"]Rebuild the documentation notebooks and the Paclet Repository definition notebook
(TuringMachine/ResourceDefinition.nb) from their markdown sources, with
PacletPage (pinned in
scripts/pacletpage.wl):
wolframscript -f scripts/build_docs.wlsReleases go through PacletPage. Bump "Version" in
TuringMachine/PacletInfo.wl, rebuild the docs, then submit to the
Paclet Repository as the account that owns the WolframInstitute publisher (nikm@wolfram.com),
and publish the paclet's resource and documentation site in the Wolfram Institute's cloud
account. The accounts are connected by the wolfram-cloud-account skill's run-as.wls; every
archive is checked to hold the Rust libraries of all five platforms.
wolframscript -f scripts/build_docs.wls
RUNAS=~/.claude/skills/wolfram-cloud-account/run-as.wls
wolframscript -f $RUNAS nikm scripts/submit.wls --dry-run # everything but the submission
wolframscript -f $RUNAS nikm scripts/submit.wls # submit to the Paclet Repository
wolframscript -f $RUNAS wolframinstitute scripts/release.wls # resource and documentation siteCI (.github/workflows/build_paclet.yml) builds all
targets and the paclet archive on every push to main; scripts/act_run.sh runs the same
workflow locally with act.












