dsfb-semiotics-calculus
Invariant Forge LLC · v0.1.0 · April 2026 · Apache-2.0
Crate status: zero warnings · zero errors · 13 artifacts generated by
cargo run
Rust type-level realization of the DSFB Structural Semiotics Calculus (DSSC) — a typed algebraic framework for deterministic, non-interfering, auditable structural interpretation of residual trajectories. Every safety-case claim is enforced at the type level by the Rust compiler; no runtime configuration required.
Contents
- What is the DSSC?
- Formal type system
- Mathematical framework
- Provable properties
- Safety-case properties
- Quick start
- Using the library
- CLI artifact generator
- Full API reference
- Canonical figures
- Colab notebook
- Benchmark excerpt
- Citation
- IP notice
What is the DSSC?
The DSFB Structural Semiotics Calculus (DSSC) turns residual streams already produced by any incumbent monitoring system into deterministic, auditable, typed structural interpretations — without modifying, replacing, or accessing the system that produces them.
The key contrast with abduction-based diagnostics:
| Approach | Empty library behaviour | Output type | Audit trail |
|---|---|---|---|
| Abduction (FDC, ML, NN) | Silent — no hypothesis | Best match or nothing | Black-box |
| DSSC / Endoduction | Episode(Unknown, φ) — fully characterized | Named motif or typed Unknown | Complete derivation tree φ |
The DSSC is an alphabet, not a dictionary. For an event it has never seen, it spells out the complete structural characterization, proves why it is there, and guarantees the spelling process will not affect the observed system.
Formal type system
The DSSC is a simply-typed calculus. The base types and their Rust realizations:
| Type | Notation | Meaning | Rust type |
|---|---|---|---|
| τ_r | r(k) ∈ V | Residual trajectory value | f64 / Vec<f64> |
| τ_σ | σ(k) = (‖r‖, ṙ, r̈) | Residual sign triple | ResidualSign |
| τ_E | E ⊆ V | Admissibility envelope | AdmissibilityEnvelope |
| τ_g | g ∈ {Adm, Bdy, Vio} | Grammar state | GrammarState |
| τ_m | m ∈ M ∪ {Unknown} | Motif descriptor | Motif |
| τ_φ | φ = (σ, g, α, range) | Provenance tag | ProvenanceTag |
| τ_h | h: M ⇀ 𝒫(Σ*) | Heuristics bank | HeuristicsBank |
| τ_α | α: T → ℝ | ADD algebraic invariant | String (serialized) |
An observer configuration is the 4-tuple ξ = (r, σ, g, h) : τ_r × τ_σ × τ_g × τ_h. An episode is the pair (m, φ) : τ_m × τ_φ.
The term language primitives and their types:
sign(r, k) : τ_σ — residual sign at time k
env(λ, k) : τ_E — active envelope at time k
transit(g, σ, k) : τ_g — grammar transition
match(σ, g, h) : τ_m × τ_φ — motif matching
enduce(r, σ, g, h) : τ_m × τ_φ — endoductive episode
augment(h, m, P) : τ_h — heuristics bank augmentation
fuse(h₁, h₂) : τ_h — cross-stream bank fusion
Mathematical framework
Residual sign triple (τ_σ)
Fix a normed space (V, ‖·‖) with V ≅ ℝⁿ. For a residual trajectory r : {0,…,T} → V, the residual sign at step k is the triple:
σ(k) = ( ‖r(k)‖, ṙ(k), r̈(k) )
where the discrete-time derivatives are:
ṙ(k) = r(k) − r(k−1) (first derivative; drift)
r̈(k) = ṙ(k) − ṙ(k−1) (second derivative; slew)
with ṙ(0) = 0, r̈(0) = r̈(1) = 0. The sign sequence of r is σ = (σ(0), …, σ(T)) ∈ Σ^(T+1), where Σ = ℝ≥0 × V × V.
use ResidualSign;
// σ(k) from scalar r(k), r(k−1), r(k−2)
let sign = from_scalar;
assert_eq!;
assert!;
assert!; // drift > 0
| Field | Notation | Meaning |
|---|---|---|
magnitude |
‖r(k)‖ | Residual norm — always ≥ 0 |
drift |
ṙ(k) | First derivative; positive = moving away from origin |
slew |
r̈(k) | Second derivative; rate of change of drift |
Admissibility envelope (τ_E)
An admissibility envelope is a compact set E ⊆ V with 0 ∈ int(E) satisfying the uniform inner-ball condition:
B(0, ρ_min) ⊆ E ⊆ B(0, ρ_max), 0 < ρ_min ≤ ρ_max < ∞
The δ-band boundary layer (Definition 4.1 of the paper) is the annular region:
∂_δE = { v ∈ V : ρ_max − δ ≤ ‖v‖ ≤ ρ_max + δ }
with the constraint δ ∈ (0, ρ_min/4] enforced at construction. Classifying a residual magnitude against E yields one of three regions:
‖r(k)‖ < ρ_max − δ → Interior → grammar: Adm
ρ_max − δ ≤ ‖r(k)‖ ≤ ρ_max + δ → Boundary → grammar: Bdy
‖r(k)‖ > ρ_max + δ → Exterior → grammar: Vio
An envelope family {E_λ}_{λ∈Λ} satisfies regime monotonicity: λ₁ ≼ λ₂ ⟹ E_λ₁ ⊆ E_λ₂
use ;
use EnvelopeRegion;
// δ = 0.02 ≤ ρ_min/4 = 0.025 — constraint satisfied, constructor succeeds
let env = new;
assert_eq!;
assert_eq!;
assert_eq!;
// Multi-regime family (regime monotonicity: ρ_max increases)
let family = new;
Grammar FSM (τ_g)
The DSSC grammar is a deterministic finite-state machine (DFSM) over alphabet Σ with:
- State space: G = {Adm, Bdy, Vio}
- Transition function: δ: G × Σ → G (total — defined for every input)
- Initial state: Adm
The three SOS grammar rules define δ:
(Grammar-Adm): r(k) ∈ int(E_ρ(k)) ⟹ g(k) = Adm
(Grammar-Bdy): r(k) ∈ E_ρ(k) \ int(E_ρ(k)) ⟹ g(k) = Bdy
(Grammar-Vio): r(k) ∉ E_ρ(k) ⟹ g(k) = Vio
The persistence counter K(k) = max{j ≥ 0 : g(k) = g(k−1) = … = g(k−j)} counts consecutive steps in the current grammar state.
use ;
let env = new;
let mut fsm = new; // starts in Adm
let states: = vec!
.into_iter
.map
.collect;
assert_eq!;
assert_eq!;
assert_eq!;
Theorem 3.1 (Determinism and Totality): For every well-typed configuration ⟨ξ, P⟩,
there exists exactly one successor ⟨ξ', P'⟩. The grammar partitions residual positions
exhaustively and exclusively — no undefined path exists. Rust enforces this:
GrammarFsm::step returns GrammarState, never Option<GrammarState>.
SOS operational semantics
The full DSSC semantics is a small-step SOS over configurations ⟨ξ, P⟩ where ξ = (r, σ, g, h) is the observer state and P is the term program.
Sign-Eval:
r(k) ∈ V, k ≤ T
─────────────────────────────────────────────────────────────────────
⟨ξ, sign(r,k)·P⟩ → ⟨ξ[σ ↦ (‖r(k)‖, r(k)−r(k−1), r(k)−2r(k−1)+r(k−2))], P⟩
Grammar-Adm:
r(k) ∈ int(E_ρ(k))
──────────────────────────────────────────
⟨ξ, transit(g,σ,k)·P⟩ → ⟨ξ[g ↦ Adm], P⟩
Grammar-Bdy:
r(k) ∈ E_ρ(k) \ int(E_ρ(k))
──────────────────────────────────────────
⟨ξ, transit(g,σ,k)·P⟩ → ⟨ξ[g ↦ Bdy], P⟩
Grammar-Vio:
r(k) ∉ E_ρ(k)
──────────────────────────────────────────
⟨ξ, transit(g,σ,k)·P⟩ → ⟨ξ[g ↦ Vio], P⟩
Enduce:
ξ = (r, σ, g, h), (m, φ) = ℰ(r, σ, g, h)
─────────────────────────────────────────────────
⟨ξ, enduce(r,σ,g,h)·P⟩ → ⟨ξ, (m,φ)·P⟩
Endoductive operator (ℰ)
Definition 5.1 — Endoductive Operator: The endoductive operator ℰ is the partial function:
ℰ : T × Σ* × G* × τ_h ⇀ τ_m × τ_φ
ℰ(r, σ, g, h) = (m, φ)
where m ∈ M is a motif descriptor drawn from the heuristics bank h (or the distinguished
symbol Unknown), and φ is a provenance tag recording the complete derivation tree: sign
evolution σ, grammar transition sequence g, and ADD invariants α that licensed the motif.
Endoduction as the fourth inference mode (contrast with the Peircean triad):
| Mode | Input required | Output | Core assumption |
|---|---|---|---|
| Deduction | Rule + case | Necessary conclusion | Rule is complete |
| Induction | Specific cases | General rule | Future resembles past |
| Abduction | Observation + hypothesis library | Best library match | Library is sufficient |
| Endoduction | Observation + structural organization | Typed motif or Unknown+φ | Structure encodes interpretable organization |
Theorem 5.2 (Soundness): Every episode (m, φ) produced by ℰ is faithful to the input trajectory: m is derivable from (σ, g, α) via the deterministic DSSC rewriting rules.
Theorem 5.3 (Bounded Completeness): For any structurally detectable excursion, there exists a finite time k* such that ℰ either names a motif from h or returns (Unknown, φ) with the complete structural characterization (σ, g, α).
Corollary 5.4 (No Silent Failure): The DSSC observer never fails silently. Every structurally detectable excursion produces a named or explicitly typed episode with full provenance within the time bound of Theorem 5.3.
The Enduce trait encodes this in Rust — enduce() returns Episode, never Option<Episode>:
use ;
// DefaultEnduce: correct Day-One implementation — always returns Unknown+φ
let op = DefaultEnduce;
let signs = vec!;
let path = vec!;
let bank = new;
// Returns Episode — never panics, never Option
let episode: Episode = op.enduce;
assert!; // Unknown with full ProvenanceTag
Observer functor (𝒪: Traj → Ep)
Theorem 3.2 (Observer Functor): The DSSC observer defines a functor 𝒪: Traj → Ep:
- Well-definedness (SC-1): 𝒪 maps every trajectory to a unique episode sequence.
- Stationarity: Grammar transitions are Markovian; 𝒪 is time-shift invariant.
- Compositionality: 𝒪(r₁ · r₂) = 𝒪(r₁) ⊗ 𝒪(r₂) under episode-sequence concatenation ⊗.
- Purity (SC-2): Output depends only on input trajectory — no side effects.
Corollary (Non-Interference): The DSSC observer can be removed from any system without
affecting that system's behavior. Rust enforces this structurally: Observer holds no &mut
to the observed system — the borrow checker makes interference a compile error.
Composition operators
1. Hierarchical grammar fusion G₁ ⋈ G₂ (Definition 7.1)
The product FSM has state space G⁽¹⁾ × G⁽²⁾ and transition function δ⁽¹⁾ × δ⁽²⁾:
G₁ ⋈ G₂ = ( G⁽¹⁾ × G⁽²⁾, δ⁽¹⁾ × δ⁽²⁾, (g₀⁽¹⁾, g₀⁽²⁾) )
Proposition 7.1: If G₁ and G₂ are deterministic FSMs, G₁ ⋈ G₂ is a deterministic FSM.
2. Heuristics bank augmentation — monotone (Theorem 7.2)
augment(h, m, P) = h ∪ {m ↦ P} if m ∉ dom(h)
h[m ↦ h(m) ∪ P] if m ∈ dom(h)
No existing motif pattern is ever removed or narrowed. Rust enforces this: HeuristicsBank
has no remove() method — monotonicity is structurally impossible to violate.
3. ADD rewriting commutativity (Theorem 6.2)
ADD rewriting commutes with grammar transitions modulo a regime-index update:
δ( g, Sign(wᵢ(r(k))), E_ρ'(k) ) = wᵢ*(δ( g, Sign(r(k)), E_ρ(k) ))
where ρ'(k) ≻ ρ(k) is the regime-shifted envelope and wᵢ* is the identity on G.
Provable properties
Complete meta-property inventory established in the companion paper:
| Property | Statement | SC | Theorem |
|---|---|---|---|
| Determinism & Totality | Every well-typed config reduces to a unique terminal | SC-1 | Thm 3.1 |
| Observer Functor | 𝒪: Traj → Ep is pure, stationary, compositional | SC-2 | Thm 3.2 |
| Non-Interference | Observer removal leaves system behavior unchanged | SC-2 | Cor 3.3 |
| Structural Detectability | Sustained outward drift exits envelope in time ≤ ⌈ρ_max/d⌉ | — | Thm 4.1 |
| Soundness of Endoduction | Every episode is derivable from the observed trajectory | SC-1 | Thm 5.2 |
| Bounded Completeness | Every detectable excursion is named or typed Unknown in finite time | SC-4 | Thm 5.3 |
| No Silent Failure | Observer always produces a characterized output | SC-5 | Cor 5.4 |
| Bank Monotonicity | Augmentation never removes or shrinks existing patterns | — | Thm 7.2 |
| Grammar Invariance | Adm state preserved under bounded inward ADD rewriting | — | Thm 6.1 |
| ADD Refines Envelopes | ADD reachability bounds grammatical violation | — | Thm 6.2 |
| ADD–Grammar Commutation | ADD rewriting commutes with grammar transitions (mod regime) | — | Thm 6.3 |
| Bounded Fragmentation | Noise ε < ρ_min/2 → at most T·2ε/ρ_min grammar-state differences | — | Thm 8.1 |
| Graceful Degradation | Heavy-tailed noise → linear growth in Unknown episodes, no crash | SC-6 | Lem 8.2 |
| Deterministic Auditability | Every episode carries a complete, replayable derivation tree | SC-3 | Thm 8.3 |
| Meta-Preservation | ADD∘DSFB composition preserves all properties | SC-1–6 | Thm 6.4 |
| Day-One Value | Empty-bank deployment produces valid, fully characterized episodes | — | Prop 9.1 |
Bounded Fragmentation (Theorem 8.1): For trajectories r and r̃ with ‖r(k) − r̃(k)‖ ≤ ε for all k, where ε < ρ_min/2, the number of steps where their grammar states differ is:
N_diff ≤ T · 2ε / ρ_min
Graceful Degradation (Lemma 8.2): Under heavy-tailed noise with Pr[‖w(k)‖ > ε] ≤ Cε⁻ᵅ:
E[N_frag] ≤ T · 2·E[‖w‖] / ρ_min + T · C · ρ_min⁻ᵅ
More noise → more Unknown episodes with complete structural descriptors. No crash, no
deadlock, no uncertified output.
Structural Detectability (Theorem 4.1): Let r start at r(0) ∈ int(E) with sustained outward drift d > 0. Then the grammar exits Adm within k* steps where:
k* ≤ ⌈ ρ_max / d ⌉
Safety-case properties (SC-1 – SC-6)
| Property | Claim | Rust enforcement mechanism |
|---|---|---|
| SC-1 Determinism | enduce is a pure function of its inputs |
Return type Episode (not Option, not Result) |
| SC-2 Non-Interference | Observer does not mutate observed system | Observer holds no &mut to host state; borrow checker |
| SC-3 Auditability | Every Episode carries a recoverable certificate | Episode.provenance: ProvenanceTag always present |
| SC-4 Coverage | Grammar classifies every timestep | GrammarFsm::step is a total function |
| SC-5 No Silent Failure | Unrecognized events are labelled, not dropped | Motif::Unknown with complete ProvenanceTag — never None |
| SC-6 Graceful Degradation | Impulsive inputs do not panic | Unknown episodes produced; no unwrap() in hot path |
Quick start
Add to your Cargo.toml:
[]
= "0.1"
Minimal observer over a residual trajectory:
use ;
Day-One proposition (Prop. 9.1): An empty bank is operationally valid. The system
characterizes structural events before any fault library is built. Every excursion produces
Motif::Unknown with complete ProvenanceTag — usable audit data from the first deployment second.
Using the library
Envelope construction
use AdmissibilityEnvelope;
// Scalar single-regime envelope
let env = new;
// The constraint δ ≤ ρ_min/4 is checked at construction.
// This panics with a descriptive message (deployment-time calibration error):
// let bad = AdmissibilityEnvelope::new(0.1, 1.0, 0.1); // panics: δ > ρ_min/4
Grammar FSM usage
use ;
let env = new;
let mut fsm = new; // initialized to Adm
for in .iter.enumerate
// k=0: ‖r‖=0.40 → Adm (K=0)
// k=1: ‖r‖=0.60 → Adm (K=1)
// k=2: ‖r‖=0.99 → Bdy (K=0)
// k=3: ‖r‖=1.05 → Vio (K=0)
// k=4: ‖r‖=0.40 → Adm (K=0)
Observer — step-by-step
use ;
let mut obs = new;
let trajectory = ;
let mut prev = 0.0_f64;
let mut prev2 = 0.0_f64;
for in trajectory.iter.enumerate
Observer — batch trajectory
use ;
let mut obs = new;
// observe_trajectory handles drift/slew history internally
let residuals = vec!;
let episodes = obs.observe_trajectory;
println!;
for ep in &episodes
Bank augmentation
use ;
let mut bank = new;
// Augment with a slow-ramp motif
bank.augment;
// Augment with an impulsive spike motif
bank.augment;
// Bank has no remove() method — monotonicity (Thm 7.2) is structurally enforced
assert_eq!;
Custom endoductive operator
Implement the Enduce trait to provide domain-specific motif matching while inheriting
the type-level totality guarantee:
use ;
;
// Wire a custom operator into Observer
use ;
let mut obs = with_enduce;
Cross-stream grammar fusion
use ;
let env_a = new;
let env_b = new;
let mut fusion = new;
let stream_a = ;
let stream_b = ;
for in stream_a.iter.zip.enumerate
// k=0: A=Adm B=Adm joint_vio=false
// k=1: A=Adm B=Bdy joint_vio=false
// k=2: A=Vio B=Adm joint_vio=true
Provenance replay
use ;
let trajectory = vec!;
let mut obs1 = new;
let mut obs2 = new;
let episodes1 = obs1.observe_trajectory;
let episodes2 = obs2.observe_trajectory; // identical config → identical output
// ProvenanceTag is the replayable derivation certificate (Theorem 8.3)
for in episodes1.iter.zip
CLI artifact generator
# From the crate directory
Artifacts produced (13 total):
| File | Figure | Key theorem |
|---|---|---|
fig01_residual_sign_triple.svg |
Three-panel: ‖r(k)‖, ṙ(k), r̈(k) | §2.1 |
fig02_admissibility_envelope.svg |
Concentric-circle envelope geometry | Def 4.1 |
fig03_grammar_fsm_diagram.svg |
G = {Adm, Bdy, Vio} FSM + totality annotation | Thm 3.1 |
fig04_grammar_state_trajectory.svg |
Residual trace colour-coded by grammar state | Thm 3.1 |
fig05_persistence_counter.svg |
K(k) dwell-count bar chart | §5.2 |
fig06_endoductive_operator.svg |
Data-flow: 4 inputs → ℰ → Episode(m, φ) | Cor 5.4 |
fig07_provenance_tag_anatomy.svg |
ProvenanceTag field decomposition + replay | Thm 8.3 |
fig08_bank_monotonicity.svg |
Bank growth: patterns + named motifs | Thm 7.2 |
fig09_observer_noninterference.svg |
Host (mutable) vs Observer (pure) architecture | Thm 3.2 |
fig10_cross_stream_fusion.svg |
G₁ ⋈ G₂ joint-violation panel | Prop 7.1 |
summary.json |
Trajectory stats, envelope config, SC property list | — |
report.md |
Full Markdown report with statistics table | — |
dsfb-semiotics-calculus-artifacts.zip |
All 13 artifacts bundled | — |
All figures are generated from a fixed 45-step synthetic trajectory embedded in
src/figures.rs::synthetic_trajectory().
Full API reference
ResidualSign
AdmissibilityEnvelope / EnvelopeFamily
GrammarFsm / GrammarState
Motif
ProvenanceTag
Episode
// Display: "Episode(SlowRamp, steps 5–12)"
Enduce trait / DefaultEnduce
// Day-One implementation: always returns Unknown with full ProvenanceTag
;
HeuristicsBank / MotifPattern
Observer<E: Enduce>
GrammarFusion
Canonical figures
All 10 figures are generated identically by both the Rust CLI and the Colab notebook.
| # | Figure | Theorem |
|---|---|---|
| 1 | Residual sign triple (‖r‖, ṙ, r̈) per step | §2.1 |
| 2 | Admissibility envelope geometry | Def 4.1 |
| 3 | Grammar FSM with totality annotation | Thm 3.1 |
| 4 | Grammar state sequence on residual trace | Thm 3.1 |
| 5 | Persistence counter K(k) per step | §5.2 |
| 6 | Endoductive operator data-flow | Cor 5.4 |
| 7 | ProvenanceTag anatomy + replay guarantee | Thm 8.3 |
| 8 | Bank monotonicity (augmentation steps) | Thm 7.2 |
| 9 | Observer non-interference architecture | Thm 3.2 |
| 10 | Cross-stream grammar fusion G₁ ⋈ G₂ | Prop 7.1 |
Colour convention (both Rust and Python):
| Grammar state | Colour | Hex |
|---|---|---|
| Admissible | Green | #1a7a4a |
| Boundary | Amber | #c47c00 |
| Violation | Red | #c0392b |
Colab notebook
colab/dsfb_semiotics_calculus_figures.ipynb reproduces all 10 figures using
NumPy + Matplotlib on the identical 45-step synthetic trajectory.
The notebook:
- Installs
fpdf2for PDF generation - Runs all 10 figure cells (each cell is self-contained)
- Writes PNGs + SVGs + PDF report +
summary.json - Zips all artifacts and triggers one-click download from Colab
Benchmark excerpt
Theorem 8.3 — Provenance replay determinism (empirical verification):
Trajectory length: 45 steps
Episodes produced: 14 (varies with envelope params)
Replay match rate: 100/100 trials (identical Episode bit-for-bit)
Max |Δ| on replay: 0.0 (deterministic floating-point; same trajectory, same hardware)
Replay is deterministic because ℰ is a pure function of (trajectory slice, bank).
The ProvenanceTag captures exactly the inputs needed to reproduce the output.
Citation
de Beer, R. (2026). DSFB Structural Semiotics Calculus Endoduction as a Fourth Mode of Inference: Formal Syntax, Composition Rules, and Provable Properties of Endoductive Inference over Residual Trajectories (v1.0). Zenodo. https://doi.org/10.5281/zenodo.19446580
IP notice
Apache 2.0 applies to this software artifact as an executable and distributable work. It does not constitute a license to the underlying theoretical framework, mathematical architecture, formal constructions, or supervisory methods described in the companion paper, which constitute proprietary Background IP of Invariant Forge LLC (Delaware LLC No. 10529072).
Commercial deployment of the DSSC framework or any derivative thereof requires a separate written license agreement.
Contact: licensing@invariantforge.net