brik64-core
BRIK-64 Core Monomers for Rust — Digital Circuitality natively in Rust.
64 formally verified atomic operations + EVA algebra composition operators. All functions are total, deterministic, and free of undefined behavior.
Installation
[]
= "2.0"
# With SHA-256 support:
= { = "2.0", = ["sha2"] }
Usage
use ;
// Direct monomer use
let sum = add8; // saturating: 255
let = div8; // (3, 2) — division by zero safe
let s = concat; // "hello world"
// EVA sequential composition ⊗
let pipeline = seq;
let result = pipeline; // add8(7,8)=15 → mod8(15,10)=5
assert_eq!;
// EVA parallel composition ∥
let dual = par;
let = dual;
assert_eq!;
assert_eq!;
// EVA conditional composition ⊕
let transform = cond;
assert_eq!;
assert_eq!;
Monomer Families
| Family | Range | Functions |
|---|---|---|
| Arithmetic | MC_00–07 | add8, sub8, mul8, div8, mod8, abs64, neg64, clamp |
| Logic | MC_08–15 | and8, or8, xor8, not8, shl8, shr8, bool_and, bool_or |
| Memory | MC_16–23 | load, store, push, pop, peek, alloc, free, len_mem |
| Control | MC_24–31 | mc_if, mc_loop, nop, halt, cmp_eq, cmp_lt, cmp_gt, mc_call |
| I/O | MC_32–39 | read_file, write_file, append_file, read_str, write_stdout, write_stderr, file_exists, file_size |
| String | MC_40–47 | concat, substr, trim, len, contains, starts_with, ends_with, char_at |
| Crypto | MC_48–55 | hash_sha256*, hash_hex*, xor_bytes, rotate_left, rotate_right, constant_eq, zero_bytes, bytes_to_hex |
| System | MC_56–63 | time_unix, time_ms, env_get, env_set, pid, args, exit_code, sleep_ms |
* Requires features = ["sha2"]
EVA Algebra
| Operator | Function | Description |
|---|---|---|
⊗ |
eva::seq |
Sequential: B(A(x)) |
∥ |
eva::par |
Parallel: (A(x), B(y)) |
⊕ |
eva::cond |
Conditional: if pred { A(x) } else { B(x) } |
Any function composed exclusively from Core monomers via EVA operators
retains its Φ_c = 1 guarantee — the circuit is closed.
Digital Circuitality
License
Apache-2.0 — © 2026 BRIK-64 Inc.