Repository navigation
fix(language): the case check tells two pairs of columns of one relation apart - #951
Merged
Merged
Conversation
…ion apart Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015MPR9MKVJ9XwN68qHLrX5g
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015MPR9MKVJ9XwN68qHLrX5g
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
The following content was generated by AI.
What this changes
The case check now refuses
ends[bus0] == ends[bus1]besideends[bus0] != ends[bus2], because a line wherebus0equalsbus1but notbus2is in both cases. Before, it proved them apart. This PR is stacked on #949.Method, gate output, alternatives
Why
_subject_ofkeyed aRelationPairComparisonby its two relation names and dropped the columns. So every comparison of two columns ofendsread one shared fact, equal or different. The checker then read the two cases above as complements and proved them apart.The change: the pair subject now carries both columns in
Subject.group. The two sides are sorted, soends[bus1] != ends[bus0]andends[bus0] == ends[bus1]stay one subject. The witness now names the columns, for exampleends[bus0] vs ends[bus1] is equal, notends vs ends.Comparisons that share a column, such as
bus0 == bus1,bus1 == bus2andbus0 != bus2, stay independent subjects. That over-approximates: it can produce a witness that no data has, but it never hides a real one.Tests
In
tests/test_exclusivity.py:TestTwoPairsOfColumns::test_two_pairs_that_share_a_relation_both_claim_a_line: I watched it fail on the base branch (ValueError: not enough values to unpack, which means no refusal).test_one_pair_written_either_way_round_is_one_fact: two cases. They passed before the fix and guard the sort.test_a_row_both_cases_read_is_still_foundnow expects the new witness wording.Guard table
I deleted each guard in turn and ran the full suite. I restored each one with
git checkout --and dropped__pycache__on both sides. The tree came back clean.('?', '?'))test_two_pairs_that_share_a_relation_both_claim_a_linetest_one_pair_written_either_way_round_is_one_factThe fuzz fails under both mutations, but with a
KeyError: it builds the subjects by hand, so they no longer match. It does not find a witness. The tests written for each guard are what catch them.Gates
pixi run ci:lint,test(3077 passed, 1 skipped) anddocs-buildpassed.compile-texfailed on all 54 documents because tectonic could not download its bundle in this container. This diff does not touch the typesetter.Not done
xfail. The fix lands in the same commit, so the marker would come off at once.Generated by Claude Code