Repository navigation
A compiled statement with no truth value has none - #2208
Merged
Rafael-SOWNet merged 2 commits intoOct 29, 2026
Merged
Rafael-SOWNet merged 2 commits into
Rafael-SOWNet merged 2 commits into
Conversation
A comparison over Complex was refused, as the operators are not defined for it, so piecewise and provided compiled over double but not over Complex. Over double a comparison with NaN was false, so that not (x > 1) was true at NaN, where evaluation says it has no truth value. The LINQ compiler now gives a comparison over Complex, double or float the truth value evaluation does: it holds or fails where both sides are real numbers, and is null where one is NaN or not real. The connectives follow Kleene's tables, as evaluation's do, so (i > 1) or true is true and not (i > 1) is null. A provided or a piecewise whose predicate is null has no value, nor does an Iverson bracket. Compiled to bool? a statement with no truth value is null, and compiled to bool it is false, as one that does not hold. Each is checked against evaluation over a grid of statements and points. Part of #2195 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #2208 +/- ##
==========================================
+ Coverage 86.55% 86.58% +0.03%
==========================================
Files 301 302 +1
Lines 66878 66950 +72
Branches 19428 19464 +36
==========================================
+ Hits 57888 57971 +83
+ Misses 4888 4878 -10
+ Partials 4102 4101 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
As evaluation does: at i, piecewise(1 provided x > 0, 3) is 3. The compiled forms already did; the entry said otherwise, and a test now holds both to it. Part of #2195 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
Rafael-SOWNet
deleted the
a-compiled-comparison-is-undecided-where-it-has-no-truth-value
branch
October 29, 2026 19:54
This was referenced Oct 29, 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.
Part of #2195: item 2, comparisons over
Complex, with the three-valued logic the thread arrived at.A comparison over
Complexwas refused (The binary operator GreaterThan is not defined for the types 'System.Numerics.Complex'). Sopiecewiseandprovidedcompiled overdoublebut not overComplex. Overdouble, a comparison withNaNwas false, which madenot (x > 1)true atNaN. Evaluation says it has no truth value there.Now a compiled statement has the truth value evaluation gives it:
Complex,doubleorfloatholds or fails where both sides are real, and has no truth value where one isNaNor not real.(i > 1) or trueis true,(i > 1) and falseis false, andnot (i > 1)has none.providedwhose predicate has no truth value has no value, and nor has an Iverson bracket. Apiecewisepasses over such a case, as evaluation does:piecewise(1 provided x > 0, 3)is3ati.bool?, a statement with no truth value isnull. Compiled tobool, it isfalse, as one that does not hold.Integer types compare as before. The connectives are explicit methods in
ThreeValuedLogic, not .NET's lifted operators, so the tables are written down. They are named the trimmer-safe way the operator tables already are.not (x > 1),double -> bool, atNaNTrueFalsex > 1,Complex -> bool, atiUncompilableNodeExceptionFalsex > 1 or true,Complex -> bool, atiUncompilableNodeExceptionTruex provided x > 1,Complex -> Complex, at2and atiUncompilableNodeException2,NaNTests:
ThreeValuedCompilationTestcompiles 14 statements overComplexand overdoubletobool?. Each is compared with evaluation at 2, 1, 1/2,i,1 + iandNaN. The AOT smoke test checks the same in the interpreter a native build compiles to. Full suite 17898/0, interactive trio, AOT smoke 66/0, all frameworks build.Still open on #2195: item 1, booleans and branches in FastExpression, and
modoverComplex.🤖 Generated with Claude Code
https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura