Repository navigation
A negation of a signed term is printed in brackets - #2265
Merged
Merged
Conversation
A negation prints as a bare - in front of what it negates. A negative integer was bracketed by its priority, which is a sum's, but a negative rational has a quotient's, and a negation and +oo print with their own sign: -(-2/3) printed as --2/3, which reads back as -(-2) / 3, and sinh(+oo) as (e ^ +oo - e ^ (-+oo)) / 2. A negated term whose print starts with a sign is now bracketed. NegationOfASignedTermPrintsTest prints six negations and reads them back to their values; three of them, and sinh(-5/4)'s double sign, fail on master. Found by work/roundtrip: over 5000 random expressions no print failed to parse and none read back to another value. Fixes #2264. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2265 +/- ##
==========================================
+ Coverage 86.69% 86.71% +0.02%
==========================================
Files 310 310
Lines 67830 67831 +1
Branches 19683 19687 +4
==========================================
+ Hits 58802 58822 +20
+ Misses 4910 4892 -18
+ Partials 4118 4117 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
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.
A negation prints as a bare
-in front of what it negates. A negative integer was bracketed by its priority, but a negative rational, a negation and+ooprint with a sign of their own and were not. A negated term whose print starts with a sign is now bracketed."sinh(-5/4)".ToEntity().ToString()(e ^ (-5/4) - e ^ (--5/4)) / 2(e ^ (-5/4) - e ^ (-(-5/4))) / 2-(-x)--x-(-x)-(+oo)-+oo-(+oo)--5/4reads back as-(-5) / 4: the same value, a different expression, and easy to misread.NegationOfASignedTermPrintsTest: four cases fail on master, and three pass on both. Suite 18218 passed. 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 a new workspace harness,work/roundtrip.Fixes #2264.
🤖 Generated with Claude Code