Skip to content

A piecewise's condition under a reading asks only the case it takes - #2262

Merged
Rafael-SOWNet merged 1 commit into
masterfrom
a-piecewise-is-defined-in-a-reading-where-its-case-is
Oct 30, 2026
Merged

Rafael-SOWNet merged 1 commit into
masterfrom
a-piecewise-is-defined-in-a-reading-where-its-case-is

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

DomainCondition reads a piecewise as defined where the case it takes is defined (#1817). DomainConditionIn conjoined every case's condition instead. So piecewise(sqrt(x) provided x > 0, 1) is 1 at -4 while its condition over the reals failed there, and tan(piecewise(pi / x provided x > 0, x / 2)) is 0 at 0 while its condition failed there too. Over the complex numbers, DomainConditionIn and DomainCondition disagreed as well. WhereTheCaseItTakesIsDefined now takes the condition to ask of a predicate and a case, and DomainConditionIn passes its reading through it.

"piecewise(sqrt(x) provided x > 0, 1)".ToEntity().DomainConditionIn(Domain.Real)
2.6.0 and master x >= 0 and x in RR
this branch x > 0 and x >= 0 or not x > 0 or not x in RR

PiecewiseConditionInAReadingTest: four cases fail on master, and six pass on both. Suite: 18210 passed and 1 failed, SaturationAblationTest.EachOfTheFourRulesIsLoadBearingForTheRunaway. Its budget includes Time = 1 s and the suite ran for 15 minutes under load; it passes four times out of four alone, and the change does not touch saturation. The F# wrapper suite, the Mcp, Terminal and InteractiveWrapper suites and the AOT smoke test pass. BoundCheck, RootCheck, CasBench, PropCheck, SimpSweep, RuleCheck, CanonCheck and Confluence are unchanged. Found by work/domaincheck.

Part of #2256.

🤖 Generated with Claude Code

DomainCondition reads a piecewise as defined where the case it takes
is defined (#1817), but DomainConditionIn conjoined every case's
condition. piecewise(sqrt(x) provided x > 0, 1) is 1 at -4, and its
condition over the reals, x >= 0 and x in RR, failed there; so did
tan(piecewise(pi / x provided x > 0, x / 2)) at 0, where it is 0. Over
the complex numbers the two disagreed too. WhereTheCaseItTakesIsDefined
now takes the condition it asks of a predicate and a case, and
DomainConditionIn passes its own reading through it.

PiecewiseConditionInAReadingTest takes four piecewise expressions at
seven points over the reals, and three over the complex numbers, where
the reading must agree with DomainCondition; four fail on master.

Found by work/domaincheck.

Part of #2256.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@Rafael-SOWNet Rafael-SOWNet added this to the 2.7.0 milestone Oct 30, 2026
@Rafael-SOWNet Rafael-SOWNet moved this from Todo to In review in AngouriMath Oct 30, 2026
@codecov

codecov Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.71%. Comparing base (3d21a61) to head (fbf02e1).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2262   +/-   ##
=======================================
  Coverage   86.71%   86.71%           
=======================================
  Files         310      310           
  Lines       67815    67833   +18     
  Branches    19676    19684    +8     
=======================================
+ Hits        58806    58824   +18     
+ Misses       4895     4894    -1     
- Partials     4114     4115    +1     
Flag Coverage Δ
cpp 37.77% <ø> (ø)
csharp 87.26% <100.00%> (+<0.01%) ⬆️
fsharp 32.97% <ø> (ø)
interactive 40.72% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...Math/Functions/Evaluation/Evaluation.Definition.cs 90.90% <100.00%> (+0.11%) ⬆️

... and 9 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Rafael-SOWNet
Rafael-SOWNet merged commit 6d2a960 into master Oct 30, 2026
35 checks passed
@github-project-automation github-project-automation Bot moved this from In review to Done in AngouriMath Oct 30, 2026
@Rafael-SOWNet
Rafael-SOWNet deleted the a-piecewise-is-defined-in-a-reading-where-its-case-is branch October 30, 2026 21:30
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.

1 participant