Skip to content

Read an equality as a difference equal to zero in an equation and in a system - #2061

Merged
Rafael-SOWNet merged 1 commit into
masterfrom
read-an-equality-in-a-system-as-a-difference
Oct 22, 2026
Merged

Rafael-SOWNet merged 1 commit into
masterfrom
read-an-equality-in-a-system-as-a-difference

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

Fixes #1673.

  • The defect. 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 }. That is empty unless b is zero, so "a * x = b".SolveEquation("x") held only where b = 0.
    • A system came back null, no solution.
  • The change. 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. The system reads its equations once, in its constructor, so its printed form agrees with what it solves.
  • The MCP server. It rewrote a = b to a - b before 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.
Input 2.6.0 this branch
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

…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

MathS.Equations finds no solution for a system written as equalities

1 participant