Skip to content

Solve reads a membership, and no longer answers the empty set for a statement it cannot read - #1440

Merged
Rafael-SOWNet merged 2 commits into
masterfrom
membership-solved
Sep 21, 2026
Merged

Rafael-SOWNet merged 2 commits into
masterfrom
membership-solved

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

Wrong answer fixed, found measuring the reference's pre-image rows for item 6 of #1409: "x^2 in (0; 1)".Solve("x") was {}. The statement solver's dispatch had Inf(x, S) for a bare x only, and its last arm answered the empty set for every statement it had no arm for — every f(x) in S, and everything else unread — which claims there is no such x. A quantifier that put the negated body to the solver read that emptiness as a proof: forall x in RR : x^2 in ZZ was True.

Now:

  • f(x) in S is solved: a listed S as the union of the equations f(x) = s; an interval as its bounds, each strict or not as the end is (x^2 in (0; 1)((-oo; 0) \/ (0; +oo)) /\ (-1; 1), x^2 in {1, 4}{1, -1, 2, -2}, sin(x) in {0} keeps its n_1 family); any other S is left.
  • A statement the solver cannot read is { x : statement }, left as written — no claim. The suite pinned nothing on the old emptiness (12180 passed).
  • The subset decision (A subset B is a statement, sets are equal by double containment, and powerset(A) is a set #1432) reads membership of a union, an intersection and a difference as the connectives they are, so that the solver's spelling of a set and the book's compare as sets.

MembershipSolvingTest: Ex 7.3.10's pre-images of x^2 compared at ten points (the book prints (-1, 1) for the pre-image of (0, 1), wrong at 0), the unread statement left as written, the quantifier now False. BREAKING-CHANGES.md rows measured on a v2.5.0 build (all {} there). Benchmark gate PASSED (the Solve benchmarks within 0.1% of the baseline).

Part of #1409.

🤖 Generated with Claude Code

https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

Rafael-SOWNet and others added 2 commits September 21, 2026 06:01
…tatement it cannot read

"x^2 in (0; 1)".Solve("x") was {} -- and so was every f(x) in S with anything but a bare x
on the left, and every statement the solver had no arm for: the arm at the end of the
dispatch answered the empty set, a claim that there is no such x. A membership is solved
now: the members of a listed set each as an equation, an interval as its bounds, each
strict or not as the end is; and a statement that is not read is the set of x with the
property, left as written, which is not a claim. A quantifier that put the negated body
to the solver read that emptiness as a proof: forall x in RR : x^2 in ZZ was True, and is
False, by the witness 1/2.

On the way, the subset decision reads membership of a union, an intersection and a
difference as the connectives they are, so that the solver's answer to x^2 in (0; 1),
((-oo; 0) \/ (0; +oo)) /\ (-1; 1), is compared with (-1; 0) \/ (0; 1) as a set.

The reference's pre-images (Sullivan and Mackey, Ex 7.3.10) are the rows; the book prints
(-1, 1) for the pre-image of (0, 1) under x^2, which is wrong at 0.

#1409

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
@Rafael-SOWNet
Rafael-SOWNet merged commit 84f83fd into master Sep 21, 2026
31 checks passed
@Rafael-SOWNet
Rafael-SOWNet deleted the membership-solved branch September 21, 2026 06:30
Rafael-SOWNet added a commit that referenced this pull request Sep 21, 2026
Item 6 of the reference's docket (#1409), the half that needs no pair. image(f(x), x in A)
is { f(x) : x in A }, which is union({f(x)}, x in A): listed over a listed A, an interval by
interval arithmetic where x occurs once in f -- exact for one occurrence and the operations
that have images (#1423); the reference's 9c/5 + 32 on (0, 100) is (32, 212) -- and
otherwise the family, which answers membership through the quantifiers. preimage(f(x), x in A, Y)
is { x in A : f(x) in Y }, and a set builder of that shape is solved on evaluation where
the statement solver reads the membership (a listed Y, an interval; #1440), the solutions
cut by A: the pre-images of x^2 (Ex 7.3.10), with the one of (0, 1) excluding 0 where the
book prints (-1, 1). That shape only: a set builder is not solved on evaluation in general,
that being a search on every evaluation.

The performance baseline moves to this run. ParseHard reached +3.2% over the baseline
recorded at 86af577, and it is the ten function tokens added to the grammar since --
about 12 KB/op each, whatever the input, measured by removing the two of this change and
nothing else (3,727,130 to 3,703,015 B/op): a cost in the ANTLR runtime's per-parse work,
filed as #1441. Every other row is within 1% of the old baseline.

#1409


Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
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