Skip to content

test(3vl): AND cod-override differentiator#78

Merged
Felipe705x merged 1 commit into
mainfrom
test/3vl-and-cod-override-witness
Jul 6, 2026
Merged

test(3vl): AND cod-override differentiator#78
Felipe705x merged 1 commit into
mainfrom
test/3vl-and-cod-override-witness

Conversation

@Felipe705x

@Felipe705x Felipe705x commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

What

Follow-up to the merged 3VL work (#73, #76). Test only — no semantics changed.

The typechecker's cod override special-cases both OR and AND, but the suite only had a vacuity-soundness witness for OR (x.status OR true). Deleting the BinOp::And arm from the override therefore broke no test — a real coverage gap, since the AND override is load-bearing.

The AND witness

MATCH (x:N) WHERE NOT (x.status AND false) RETURN x.name on a closed schema where status is unknown (x.status : ⊥):

  • Runtime: false is AND's absorbing element → null AND false → falseNOT false → true → keeps all rows.
  • Strict (un-amended) static: x.status AND false : ⊥, then NOT ⊥ : ⊥ → pattern pruned as guaranteed_empty.
  • Same static/dynamic unsoundness the OR override fixes; the amendment types the AND as Bool so NOT Bool : Bool and the pattern is not pruned.

The symmetry is the point: each short-circuit connective has an absorbing element yielding a defined value beside a /null operand — true for OR (keeps rows directly), false for AND (keeps rows once negated).

Verified as a real differentiator

Temporarily removing the BinOp::And arm from the checker's cod override flips this query's guaranteed_empty to true and the new test fails; the existing OR test is unaffected. So the two are independent witnesses. Reverted; full suite 26/26, clippy clean.

🤖 Generated with Claude Code

The cod override for the short-circuit connectives (checker.rs) special-
cases OR *and* AND, but the vacuity-soundness suite only had a witness for
OR (`x.status OR true`). Removing the `BinOp::And` arm from the override
therefore broke no test, even though the AND override is load-bearing.

Add the symmetric AND witness: `WHERE NOT (x.status AND false)`. `false` is
AND's absorbing element, so at runtime `NOT (null AND false) = NOT false =
true` keeps every row; under the strict (un-amended) cod, `x.status AND
false : ⊥` then `NOT ⊥ : ⊥`, so the pattern is pruned as guaranteed_empty —
the same static/dynamic unsoundness the OR override fixes. Verified as a real
differentiator: deleting the AND arm from the override flips this query's
guaranteed_empty to true and the test fails (the OR test is unaffected, so
the two are independent witnesses).

No semantics changed; test only.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Felipe705x Felipe705x force-pushed the test/3vl-and-cod-override-witness branch from 9257575 to 5da3cd5 Compare July 6, 2026 03:50
@Felipe705x Felipe705x changed the title test(3vl): AND cod-override differentiator + finding handoff doc test(3vl): AND cod-override differentiator Jul 6, 2026
@Felipe705x Felipe705x merged commit d22001a into main Jul 6, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant