Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/algebraic/categorical.zig
Original file line number Diff line number Diff line change
Expand Up @@ -172,5 +172,6 @@ test "topos witness gate" {
.has_exponentials = true,
};
try std.testing.expect(w.isElementaryTopos());
try std.testing.expect(!ToposWitness{}.isElementaryTopos());
const empty = ToposWitness{};
try std.testing.expect(!empty.isElementaryTopos());
}
1 change: 0 additions & 1 deletion src/deductive/natded.zig
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,6 @@ test "natded modus ponens" {
const a1 = try pr.assume(imp);
const a2 = try pr.assume(p);
const q_line = try pr.impliesElim(a1, a2);
_ = q_line;
// Discharge p: derive (P→Q) → ((P→Q) wait — discharge innermost first
// Innermost is P, last formula Q → get P→Q (identity-ish under outer)
// Actually last is Q, discharge P → (P → Q) under outer (P→Q) assumption.
Expand Down
2 changes: 1 addition & 1 deletion src/deductive/sequent.zig
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ test "sequent implies-right shape" {
const node = ProofNode{
.sequent = conc,
.rule = .implies_r,
.premises = &[_]*const ProofNode{&prem},
.premises = &[_]*ProofNode{&prem},
};
try std.testing.expect(check(&node));
}
2 changes: 0 additions & 2 deletions src/deductive/sequent_search.zig
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ pub const SearchResult = enum { proved, failed, depth_exceeded };
/// signed atoms (positive = right-side atom or left-side negation, etc.).
/// For the spine we reduce formulas to NNF-ish signed literals via a simple
/// recursive inversion.

pub const Signed = struct {
atom: []const u8,
/// true = positive occurrence on the side it sits
Expand Down Expand Up @@ -56,7 +55,6 @@ pub fn search(
}

fn searchDepth(allocator: std.mem.Allocator, goal: sequent.Sequent, depth: u32) !SearchResult {
_ = allocator;
if (goal.isInitial()) return .proved;
if (depth == 0) return .depth_exceeded;

Expand Down
2 changes: 1 addition & 1 deletion src/fuzzy/fuzzy.zig
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ pub fn kleeneOr(a: Kleene, b: Kleene) Kleene {
}

test "lukasiewicz t-norm bounds" {
try std.testing.expect(tnorm(.lukasiewicz, 0.7, 0.6) == @as(Degree, 0.3));
try std.testing.expectApproxEqAbs(@as(Degree, 0.3), tnorm(.lukasiewicz, 0.7, 0.6), 1e-6);
try std.testing.expect(tnorm(.lukasiewicz, 0.2, 0.3) == @as(Degree, 0));
try std.testing.expect(implies(.lukasiewicz, 0.3, 0.8) == @as(Degree, 1));
}
Expand Down
1 change: 0 additions & 1 deletion src/modal/cert.zig
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ fn fingerprint(phi: *const normal.Formula) u64 {
}

fn forces(n: u32, rel: u32, val: u32, w: u32, phi: *const normal.Formula, n_atoms: u32) bool {
_ = n_atoms;
return switch (phi.*) {
.atom => |a| (val & (@as(u32, 1) << @intCast(a * n + w))) != 0,
.not => |x| !forces(n, rel, val, w, x, n_atoms),
Expand Down
4 changes: 2 additions & 2 deletions src/probabilistic/prob.zig
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ test "independence product" {

test "frechet and bounds" {
const iv = frechetAnd(0.7, 0.6);
try std.testing.expect(iv.lo == 0.3);
try std.testing.expect(iv.hi == 0.6);
try std.testing.expectApproxEqAbs(0.3, iv.lo, 1e-12);
try std.testing.expectApproxEqAbs(0.6, iv.hi, 1e-12);
}

test "negation complement" {
Expand Down
4 changes: 2 additions & 2 deletions src/probabilistic/wpll.zig
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ const markov = @import("markov.zig");

/// Softplus-stable log(σ(z)) helpers.
fn logSigmoid(z: f64) f64 {
if (z >= 0) return -@log1p(@exp(-z));
return z - @log1p(@exp(z));
if (z >= 0) return -std.math.log1p(@exp(-z));
return z - std.math.log1p(@exp(z));
}

/// Weight difference for atom j: score(x[j]=1) - score(x[j]=0) with others fixed.
Expand Down
Loading