Repository navigation
Read an equality as a difference equal to zero in an equation and in a system - #2061
Merged
Rafael-SOWNet merged 1 commit intoOct 22, 2026
Merged
Conversation
…a system
MathS.SolveEquation, Entity.SolveEquation and MathS.Equations read each
equation as an expression equal to zero, and passed an equality a = b on
as it stood. One equation came back as the set builder
{ x : a = b and b = 0 }, which is empty unless b is zero, so
"a * x = b".SolveEquation("x") held only where b = 0; a system came back
null, no solution. An equality is now read as a - b = 0, as a statement's
own solve reads it: "x + 1 = 3".Solve("x") was already { 2 }. The one-
variable entry points meet in EquationSolver.Solve, and the system reads
its equations once, in its constructor, so its printed form agrees with
what it solves.
The MCP server rewrote a = b to a - b before asking for a system, and its
self-test documented the defect, which now no longer reproduces: both go,
and its README lists three workarounds where it listed four.
Fixes #1673.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
This was referenced Oct 22, 2026
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.
Fixes #1673.
MathS.SolveEquation,Entity.SolveEquationandMathS.Equationsread each equation as an expression equal to zero, and passed an equalitya = bon as it stood.{ x : a = b and b = 0 }. That is empty unlessbis zero, so"a * x = b".SolveEquation("x")held only whereb = 0.null, no solution.a - b = 0, as a statement's own solve reads it:"x + 1 = 3".Solve("x")was already{ 2 }. The one-variable entry points meet inEquationSolver.Solve. The system reads its equations once, in its constructor, so its printed form agrees with what it solves.a = btoa - bbefore asking for a system, and its self-test documented the defect. The defect no longer reproduces, so both go, and its README lists three workarounds where it listed four.MathS.SolveEquation("x + 1 = 3", "x"){ x : x + 1 = 3 and 3 = 0 }{ 2 }"x^2 = 4".SolveEquation("x"){ x : x ^ 2 = 4 and 4 = 0 }{ 2, -2 }"a * x = b".ToEntity().SolveEquation("x"){ x : a * x = b and b = 0 }{ b / a }MathS.Equations("x + y = 3", "x - y = 1").Solve("x", "y")null[[2, 1]]AnEqualityReadAsADifferenceTest: all eight cases fail on master. The full unit suite passes (16,711), and so do the MCP tests (325). The library builds for netstandard2.0. The BREAKING-CHANGES entry opens the section for changes since 2.6.0, with the 2.6.0 values measured on the release.🤖 Generated with Claude Code
https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura