Skip to content

Tri-Cortex Engine

The Tri-Cortex is MindFry’s decision-making brain, implementing Balanced Ternary Logic inspired by the Soviet Setun computer.

Unlike binary (0, 1), balanced ternary uses three values:

TritValueMeaning
True+1Excitation / Yes
Unknown0Neutral / Maybe
False-1Inhibition / No

MindFry’s personality is an 8-dimensional vector of Trits:

pub struct Octet([Trit; 8]);
pub mod dimension {
pub const OPENNESS: usize = 0;
pub const CURIOSITY: usize = 1;
pub const PRESERVATION: usize = 2;
pub const AGGRESSION: usize = 3;
pub const SOCIABILITY: usize = 4;
pub const CAUTION: usize = 5;
pub const CREATIVITY: usize = 6;
pub const EMPATHY: usize = 7;
}

The Cortex maintains a mood value from 0 to 1:

τ(μ) = 0.5 × (1 - μ)
where μ = mood ∈ [0, 1]
MoodThresholdAccessibility
1.0 (Euphoric)0.0All accessible
0.5 (Neutral)0.25Medium-energy+
0.0 (Depressive)0.5High-energy only

Data can have its own Octet. Resonance measures compatibility:

resonance(P, D) = (1/8) × Σᵢ (Pᵢ × Dᵢ + 1) / 2

High resonance = data feels “natural” to this personality.

The Quantizer converts continuous signals to discrete Trits:

impl Quantizer {
pub fn quantize(value: f32) -> Trit {
if value > 0.33 { Trit::True }
else if value < -0.33 { Trit::False }
else { Trit::Unknown }
}
}

See Architecture Overview for how Cortex fits into the system.