Ternary proof verification system. Assertions return {-1=invalid, 0=inconclusive, +1=valid} with confidence-weighted evidence chains, challenge-response verification, and majority-vote aggregation across proof strategies.
Binary logic (true/false) is the standard for formal verification. But real-world proof systems — legal arguments, scientific claims, multi-agent consensus — often live in a richer space:
- +1 (Valid): the claim is confirmed with high confidence
- 0 (Inconclusive): evidence is insufficient — we neither accept nor reject
- -1 (Invalid): the claim is contradicted by evidence
This ternary verdict system enables:
- Graceful uncertainty: "I don't know" is a first-class answer, not a failure
- Composable verification: chain assertions with AND/OR/min/max semantics
- Confidence thresholds: claims below 50% confidence are inconclusive, not false
- Majority voting: aggregate multiple independent verifications
- Challenge-response: interactive proof with edit-distance tolerance for fuzzy matching
Each assertion carries a confidence score
Two ternary results combine via lattice operations:
AND (min): The weakest link determines validity.
| ∧ | -1 | 0 | +1 |
|---|---|---|---|
| -1 | -1 | -1 | -1 |
| 0 | -1 | 0 | 0 |
| +1 | -1 | 0 | +1 |
OR (max): The strongest supporter carries the verdict.
| ∨ | -1 | 0 | +1 |
|---|---|---|---|
| -1 | -1 | 0 | +1 |
| 0 | 0 | 0 | +1 |
| +1 | +1 | +1 | +1 |
Complexity: O(1) per logical operation — simple integer comparison.
A sequence of assertions
-
All-valid (AND chain):
$\bigwedge_i \text{verify}(a_i)$ — every link must hold -
Any-valid (OR chain):
$\bigvee_i \text{verify}(a_i)$ — at least one must hold -
Majority vote: Valid if
$|{i : v_i = +1}| > n/2$ and more than invalid count
Verify a response against an expected answer using Levenshtein edit distance:
- Exact match: Valid (+1)
- Similarity ≥ tolerance: Inconclusive (0)
- Below tolerance: Invalid (-1)
Levenshtein DP: Standard
use ternary_proof::*;
// Individual assertions
let strong = Assertion::new("1", "the sky is blue", 0.95);
assert_eq!(strong.verify(), VerifyResult::Valid);
let weak = Assertion::new("2", "maybe it'll rain", 0.6);
assert_eq!(weak.verify(), VerifyResult::Inconclusive);
let contradicted = Assertion::new("3", "2+2=5", 0.2);
assert_eq!(contradicted.verify(), VerifyResult::Invalid);
// Proof chains
let chain = ProofChain::new(vec![
Assertion::new("1", "premise A", 0.95),
Assertion::new("2", "premise B", 0.95),
]);
assert_eq!(chain.verify_all(), VerifyResult::Valid);
// One weak link breaks the chain
let chain2 = ProofChain::new(vec![
Assertion::new("1", "strong", 0.95),
Assertion::new("2", "weak", 0.3),
]);
assert_eq!(chain2.verify_all(), VerifyResult::Invalid);
assert_eq!(chain2.verify_any(), VerifyResult::Valid);
// Majority vote
let chain3 = ProofChain::new(vec![
Assertion::new("1", "yes", 0.95),
Assertion::new("2", "yes", 0.95),
Assertion::new("3", "no", 0.3),
]);
assert_eq!(chain3.verify_majority(), VerifyResult::Valid);
// Challenge-response
let cr = ChallengeResponse::new("2+2", "4");
assert_eq!(cr.verify("4"), VerifyResult::Valid); // exact
assert_eq!(cr.verify("5"), VerifyResult::Invalid); // wrong
// Lattice operations
use VerifyResult::*;
assert_eq!(Valid.and(Invalid), Invalid); // weakest link
assert_eq!(Valid.or(Invalid), Valid); // strongest supporter| Type / Method | Description |
|---|---|
VerifyResult::Invalid / Inconclusive / Valid |
Ternary verdict enum |
.to_i8() / from_i8() |
Convert to/from {-1, 0, +1} |
.and(other) / .or(other) |
Lattice meet/join |
Assertion::new(id, claim, confidence) |
Create an assertion |
.with_evidence(&[evidence]) |
Attach supporting evidence |
.verify() → VerifyResult |
Evaluate assertion |
ProofChain::new(assertions) |
Chain of dependent assertions |
.verify_all() / verify_any() / verify_majority() |
Aggregation strategies |
ChallengeResponse::new(challenge, expected) |
Interactive proof |
.verify(response) → VerifyResult |
Check with edit-distance tolerance |
The ternary proof system is a direct instance of the γ + η = C conservation identity in the epistemic domain. A Valid verdict (+1) represents constructive evidence mass γ — proof that builds confidence. An Invalid verdict (-1) represents inhibitory evidence mass η — proof that undermines confidence. An Inconclusive verdict (0) is the neutral epistemic state — insufficient evidence to commit either way.
The conserved total
The confidence thresholds (0.9 for Valid, 0.5 for Inconclusive) partition the [0,1] interval into three regions, creating a ternary signal from a continuous input — the same quantization operation that BitNet applies to neural network weights.
- Kleene, S. C. (1952). Introduction to Metamathematics. North-Holland. (Kleene 3-valued logic)
- Goldwasser, S. et al. (1989). The Knowledge Complexity of Interactive Proof Systems. STOC.
- Cook, S. A. (1971). The Complexity of Theorem-Proving Procedures. STOC. (NP-completeness)
- Levenshtein, V. I. (1966). Binary Codes Capable of Correcting Deletions, Insertions and Reversals. Soviet Physics Doklady.
MIT