This repository contains eleven small, fast Rust ARC programs.
ARC stands for Answer • Reason • Check. An ARC program does more than emit a result. It gives:
A useful way to read this repository is as teaching material for an LLM acting as a student programmer. The target is not a mysterious giant system that emits polished text. The target is a small program that can be written, inspected, rerun, criticized, and improved. In that teaching setup, the student should learn to produce code that answers a precise question, explains its reasoning in a compact witness, and then verifies the result with explicit checks instead of asking for trust.
That teaching angle matters because it pushes toward the right habits: keep the data explicit, keep the logic local, keep the question precise, and make correctness visible in the running artifact. The goal is not just to compute, but to compute in a way that stays easy to inspect, explain, and challenge. That is the practical value of the ARC approach: each run leaves an auditable trail instead of a black box. This follows the core ARC idea that trustworthy computation should be self-contained, repeatable, and verifiable at runtime.
These examples are organized around a few simple ARC principles:
In this repository, the programs are handwritten and specialized for speed, but they still follow the same ARC discipline: answer the question, explain the answer, and verify the answer. That also makes them good exemplars for teaching or evaluating an LLM as a student programmer: the deliverable is not merely source code, but a runnable artifact whose reasoning and checks are visible at the interface.
That structure has practical benefits:
A good ARC check is not a decorative success message. It should be a concrete test that can actually fail.
In this repository, good checks try to have one or more of these properties:
That means the Check section is meant to resist self-certification. The best cases do not merely restate the main computation path; they challenge it.
collatz-1000A computational check of the Collatz conjecture in src/collatz_1000.rs.
For CLI compatibility, the case name remains collatz-1000, while this version exhaustively verifies all starts from 1 through 10000.
It models:
n -> n / 2 for even nn -> 3n + 1 for odd n1 through 1000027control-systemA small rule-based control example in src/control_system.rs.
It models:
measurement10/2control1/2 rules for actuator1 and actuator2true :+ control1(_, _) as query satisfieddeep-taxonomy-100000A specialized forward-chaining taxonomy benchmark in src/deep_taxonomy_100000.rs.
It models:
Ind has class N(0)N(i) -> N(i+1), I(i+1), J(i+1)N(100000) -> A2A2 -> goal reachedThis version is specialized for speed and does not use a slower generic triple engine.
delfourA Rust translation of the browser-side Delfour Insight Economy phone/scanner demo in src/delfour.rs.
It models:
euler-identityAn exact arithmetic version of Euler’s identity in src/euler_identity.rs.
This version uses direct integer arithmetic over a small ExactComplex type.
It mirrors the mathematical structure:
exp(i*pi) exactly as (-1, 0)(1, 0) to obtain (0, 0)1fibonacciA direct Fibonacci computation in src/fibonacci.rs.
This version computes the requested values with iterative Rust and BigUint.
It prints:
F(0)F(1)F(10)F(100)F(1000)goldbach-1000A computational check of Goldbach’s conjecture in src/goldbach_1000.rs.
It models:
1000 with a sieve4 through 1000n = p + q1000gpsA route-planning example in src/gps.rs.
It models:
The translation uses Rust concepts like City, Action, Stage, Description, and Route.
kaprekar-6174A computational proof of Kaprekar’s constant in src/kaprekar_6174.rs.
It models:
1111 and 00006174<= 7 iteration bound2111 -> 0999 -> ... -> 6174polynomialA quartic polynomial consistency check in src/polynomial.rs.
It models the two quartic outputs shown in the original example material and verifies:
path-discoveryA path-finding example in src/path_discovery.rs.
It models:
(from, to) edgessrc/main.rs — CLI dispatchersrc/report.rs — structured ARC report model used for JSON outputsrc/collatz_1000.rs — Collatz conjecture benchmark translationsrc/control_system.rs — control system benchmark translationsrc/deep_taxonomy_100000.rs — specialized taxonomy benchmarksrc/delfour.rs — Delfour phone/scanner insight examplesrc/euler_identity.rs — Euler identity benchmark translationsrc/fibonacci.rs — Fibonacci benchmark translationsrc/goldbach_1000.rs — Goldbach conjecture benchmark translationsrc/gps.rs — GPS benchmark translationsrc/kaprekar_6174.rs — Kaprekar 6174 proof examplesrc/path_discovery.rs — path discovery benchmark translation plus generated airport and flight datasrc/polynomial.rs — polynomial benchmark translationpilot.sh — build, refresh, and check snapshot filesThe package name is arclight, so a release build produces target/release/arclight.
Default case:
cargo run --release
Explicit cases:
cargo run --release -- collatz-1000
cargo run --release -- control-system
cargo run --release -- deep-taxonomy-100000
cargo run --release -- delfour
cargo run --release -- euler-identity
cargo run --release -- fibonacci
cargo run --release -- goldbach-1000
cargo run --release -- gps
cargo run --release -- kaprekar-6174
cargo run --release -- path-discovery
cargo run --release -- polynomial
Structured JSON output for one case:
cargo run --release -- collatz-1000 --format json
Structured JSON output for the whole suite:
cargo run --release -- --all --format json
Arclight supports two stable output forms:
--format jsonThe recommended workflow is:
The root pilot.sh script is the main driver for this:
Because snapshots are regular files in the repository, intentional output changes show up as normal diffs in version control. If you add or grow a case, run ./pilot.sh refresh, review the snapshot diff, and commit it together with the code change.
./pilot.sh refresh
./pilot.sh check
What it does:
snapshots/text/snapshots/json/all.txt, all.json, and list.txtcheckThat gives a practical separation between:
This is especially useful for ARC programs because the output is part of the artifact: the answer, the reason why, and the executable checks are all meant to stay auditable and reproducible.
snapshots/
text/
<case>.txt
all.txt
list.txt
json/
<case>.json
all.json
List available cases:
cargo run --release -- --list
Run all cases in sequence:
cargo run --release -- --all
Each case prints a short three-part story:
Where possible, the check section uses more than one line of evidence, so the program does not rely on a single computation path to certify its own output.