Skip to content

Write down integral's two forms, and 1.4.0's unrecorded break - #848

Merged
Rafael-SOWNet merged 1 commit into
masterfrom
docs/integral-arity
Aug 9, 2026
Merged

Write down integral's two forms, and 1.4.0's unrecorded break#848
Rafael-SOWNet merged 1 commit into
masterfrom
docs/integral-arity

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Collaborator

The documentation half of #847 — which is all that survives of it, after I corrected the rest of that issue.

What was actually missing

Syntax.md:111 listed integral(expr, var) and stopped. The definite form integral(expr, var, from, to) is supported and covered by tests in three files (FromStringTest.cs:160, ToSymPyTEst.cs:40, IntegrationTest.cs:210), but a caller reading the syntax reference was told only the two-argument form existed, with no way to discover the other — which is precisely the form that replaced the three-argument one.

It now lists both, and says why the two calculus functions read differently:

derivative takes an order and integral does not: derivative(f, x, 2) is the second derivative, while integral's third and fourth arguments are the bounds of a definite integral, not a count.

That asymmetry is real and looks like an inconsistency until you know it is a range rather than a count. Saying so is cheaper than the alternatives I originally proposed in #847, both of which I have since withdrawn.

The 1.4.0 note

BREAKING-CHANGES.md begins at "2.0.0 — since 1.4.0", so a break introduced by 1.4.0 has never had a home in it. This one is worth recording because 1.4.0 is what dotnet add package installs today and the change is silent until a string is parsed:

1.3.0 1.4.0 onwards
integral(f, x, 1) accepted, read as integral(f, x) FunctionArgumentCountException
integral(f, x, a, b) the definite integral

It gets a short section at the end of the file, with the fix (integral(f, x, 1)integral(f, x), identical in meaning).

How this was found, and what I got wrong

Both samples in this repository called integral(f, x, 1) and had been failing against 1.4.0 since January without anyone seeing it, because they were pinned to AngouriMath 1.3.0. #846 unpinned them, which is what surfaced it.

I then filed #847 claiming the change was accidental and untested, and proposed restoring the three-argument form. Both claims were false — git log -S finds it as a deliberate design change in #657, and FromStringTest.cs:282 has asserted the new arity all along. That correction is on the issue; only the documentation gap survives, and this is it.

Documentation-only. No code changes, no behaviour changes.

🤖 Generated with Claude Code

Syntax.md listed integral(expr, var) and stopped. The definite form
integral(expr, var, from, to) is supported and covered by tests in three
files, but a caller reading the syntax document was told only the
two-argument form existed and given no way to discover the other -- which is
the form that replaced the three-argument one.

It now lists both, and says why derivative takes an order while integral does
not: derivative(f, x, 2) is a second derivative, integral's third and fourth
arguments are bounds. Three arguments name neither form, which is a parse
error rather than an oversight.

BREAKING-CHANGES.md begins at 2.0.0, so the change that introduced this --
PR #657 in 1.4.0, replacing the iteration count with a range -- has never had
a home in it. 1.4.0 is what dotnet add package installs today and the change
is silent until a string is parsed, so it now has a section of its own at the
end.

Both samples in this repository called integral(f, x, 1) and had been failing
against 1.4.0 since January without anyone seeing it, because they were
pinned to 1.3.0.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@Rafael-SOWNet
Rafael-SOWNet merged commit 775dedd into master Aug 9, 2026
25 checks passed
@Rafael-SOWNet
Rafael-SOWNet deleted the docs/integral-arity branch August 9, 2026 16:39
Rafael-SOWNet added a commit that referenced this pull request Aug 9, 2026
preview.1 is published, and it has the conversion. Every other entry in the file
describes a change from 1.3.0 or 1.4.0, so the file's implicit frame is
release-to-release and a reader already on preview.1 would not learn from it that
this one lands on them. Checked: #848 is the only other commit to touch the file
since the preview.1 tag, and what it added is a 1.4.0 section, not a preview delta.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Rafael-SOWNet added a commit that referenced this pull request Aug 10, 2026
…rloads uncallable (#853)

* Drop the implicit List<Entity> conversion that made three params overloads uncallable

Entity had implicit conversions to itself from both Entity[] and List<Entity>, each
building a FiniteSet. The List one meant a list also converted to a single Entity,
so for any member with both an IEnumerable<Entity> overload and a params Entity[]
overload the params form became applicable in its expanded form, neither candidate
was better, and the call did not compile:

    var equations = new List<Entity> { "x - 1", "y - 2" };
    new EquationSystem(equations);   // error CS0121
    new FiniteSet(equations);        // error CS0121
    MathS.Equations(equations);      // error CS0121

Not three defects -- one conversion breaking every params Entity[] overload in the
library, including any added later. A sweep of all 2602 members in PublicApi.txt for
the IEnumerable<T>/T[] overload pattern found exactly these three, and each was
confirmed by compiling the call in isolation. The array, IEnumerable<Entity> and
variadic forms always compiled; only a concrete List<Entity> broke, which is how it
reached a 2.0 preview unnoticed.

The Entity[] conversion is kept. An array binds to the params overload in its normal
form by an identity conversion, which wins outright, so it never had the ambiguity.

The new test compiling is the regression guard: restore the conversion and the test
project stops building. Sources/.editorconfig gets a per-file header section for it,
since Tests/UnitTests/Common still carries the 2022 template.

Verified: 6055 C# tests and 130 F# tests pass, the library, F# wrapper and Utils
build clean, and all ten call shapes in the ambiguity matrix now compile.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* Say that this break falls between preview.1 and preview.2

preview.1 is published, and it has the conversion. Every other entry in the file
describes a change from 1.3.0 or 1.4.0, so the file's implicit frame is
release-to-release and a reader already on preview.1 would not learn from it that
this one lands on them. Checked: #848 is the only other commit to touch the file
since the preview.1 tag, and what it added is a 1.4.0 section, not a preview delta.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* Correct which previews carry the conversion

preview.2 was tagged while this branch sat unmerged, so it ships the conversion too
and the previous commit's "gone from preview.2" is wrong. Naming the version that
removes something from a branch that has not merged bets on merge order; the entry
now says "the release that follows them" and stops guessing.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

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