Repository navigation
specs/ternary: trits + radix_economy -- the logic of the course "The ternary machine" (t27.ai) #8978
Copy link
Copy link
Closed
Labels
Description
Owner, 2026-10-11: build the next t27.ai course and make it engaging with visualisations. The course "The ternary machine" (gHashTag/trinity, ternary-computing) gets an interactive widget in every lesson. Each widget's numbers must come from a t27 spec compiled to wasm, as with line_bounce, eye_isi and secded (#8931).
Two specs:
specs/ternary/trits.t27- balanced-ternary digits, read with the offset 111...1 (base 3), so no signed division is needed;
- negation by flipping trits, rounding by cutting trits;
- Kleene logic: NOT, MIN, MAX, CONSENSUS, ANY, plus the half adder;
- full adder, ripple add;
- product by one trit without a multiplier, long multiplication, MAC step;
- a trit in two bits, five trits in a byte, bit use, bits for k trits;
- three-way compare at the first differing trit, two-answer and three-answer question counts;
- a ternary activation.
specs/ternary/radix_economy.t27- digits per base, cost = b * digits, b / ln b (ln as a series), the cheapest base.
Done when both specs typecheck and every test passes with no vacuous pass, negative controls are caught, and the seals are saved.
User Scenarios
- Given the
specs/ternarydirectory exists, when the specspecs/ternary/trits.t27is compiled witht27c, then it typechecks and all its tests pass with no vacuous pass. - Given the
specs/ternarydirectory exists, when the specspecs/ternary/radix_economy.t27is compiled witht27c, then it typechecks and all its tests pass with no vacuous pass.
Requirements
- FR-001:
specs/ternary/trits.t27MUST define balanced-ternary digits read with offset 111...1 (base 3) avoiding signed division. - FR-002:
specs/ternary/trits.t27MUST implement negation by flipping trits and rounding by cutting trits. - FR-003:
specs/ternary/trits.t27MUST implement Kleene logic: NOT, MIN, MAX, CONSENSUS, ANY, and half adder. - FR-004:
specs/ternary/trits.t27MUST implement full adder, ripple add. - FR-005:
specs/ternary/trits.t27MUST implement product by one trit without a multiplier, long multiplication, MAC step. - FR-006:
specs/ternary/trits.t27MUST implement trit encoding: a trit in two bits, five trits in a byte, bit use, bits for k trits. - FR-007:
specs/ternary/trits.t27MUST implement three-way compare at first differing trit, two-answer and three-answer question counts. - FR-008:
specs/ternary/trits.t27MUST implement a ternary activation function. - FR-009:
specs/ternary/radix_economy.t27MUST compute digits per base, cost = b * digits, b / ln b (ln as a series), and identify the cheapest base. - FR-010: Both specs MUST compile to WASM without errors for use in interactive widgets.
Success Criteria
t27c specs/ternary/trits.t27exits withexit 0and produces a WASM module.t27c specs/ternary/radix_economy.t27exits withexit 0and produces a WASM module.- All tests in
specs/ternary/trits.t27pass (negative controls caught, no vacuous pass). - All tests in
specs/ternary/radix_economy.t27pass (negative controls caught, no vacuous pass). - Seals are saved for both specs.
Boundary
- specs/ternary/trits.t27
- specs/ternary/radix_economy.t27
Reactions are currently unavailable
Activity
specs/ternary/trits: pack a trit in two bits the way the hardware spe…
specs/ternary: trits + radix_economy -- the logic of the course "The …