You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 3b30a1e
Browse filesBrowse the repository at this point in the historyBrowse files
Print a node's Codomain, so the printed form stops losing it (#1022)
`Stringize` printed no node's `Codomain`, so `domain(x, ZZ)` printed as `x` and
parsing that gave a `Variable` with `Codomain = Any` back. The annotation is not
decoration: `sqrt(-1)` is `i` and the same expression over the reals is `NaN`,
and the two printed the same string.
The parser already had the syntax -- `domain(expr, SET)` maps onto
`WithCodomain` and works for every node -- so only the printing half was
missing. A node whose codomain is not the one its type carries by default now
prints inside `domain(...)`, and LaTeX renders it as a subscripted set.
The default is not uniform, which is why the rule is a comparison and not a
check against `Complex`: a variable and a matrix default to `Any`, `abs` and an
interval to `Real`, every boolean node to `Boolean`, each numeric literal to its
own type's domain. Each node declares that default beside its `Codomain`, both
abstract so that a node declaring one and forgetting the other does not compile.
The wrapper is one decision, so it lives once on `Entity` and the per-node
rendering moved behind `StringizeNode`/`LatexizeNode`. That removes 130
overrides from the recorded public surface; every one of them is still callable,
inherited.
`Simplify` collected `x` and the same `x` narrowed to the integers as one
monomial, because it keys a monomial by its base's printed form: `x - domain(x,
ZZ)` was `0`, which is the answer only where `x` is an integer. It is left
alone now.
Two annotations still do not survive, both the grammar's limit rather than the
printer's, and both pinned by tests that fail if they start working: `Any` has
no special set to name it, and no input yields a `Rational` whose codomain is
`Complex`, since the pass that reads `1/2` as a rational treats `Complex` as
"nobody annotated this" (#873).
Measured on a build of each side; 8070 -> 8516 passed, 0 failed. The two
expected outputs that moved are the test written to fail when this is fixed and
the recorded public surface.
#1022#746
Copy file name to clipboardExpand all lines: BREAKING-CHANGES.md
+77Lines changed: 77 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,6 +34,11 @@ read first.
34
34
|| any expression mixing a number with a `Complex` argument, `Compile`d in a NativeAOT app — `"x + 1".Compile<Complex, Complex>("x")`|`UncompilableNodeException: ... The binary operator Add is not defined for the types 'System.Numerics.Complex' and 'System.Numerics.Complex'`| the compiled function, answering as it does under the JIT |
35
35
||`Compile` to a nullable integral return type in a NativeAOT app |`AngouriBugException: IsNaN method expected for type System.Double`, which took the process down | the compiled function |
36
36
|**Silent**| an app publishing with `PublishTrimmed` or NativeAOT |`AngouriMath.dll` was copied in whole, being unmarked | it is trimmed with the rest, since the assembly now declares `IsTrimmable`|
37
+
|**Silent**|`"domain(x, ZZ)".ToEntity().Stringize()`, and `ToString`, and `EntityJsonConverter`|`x`, which reads back with `Codomain = Any`|`domain(x, ZZ)`, which reads back narrowed |
38
+
|**Silent**|`"domain(sqrt(-1), RR)".ToEntity().Stringize()`|`sqrt(-1)`, which evaluates to `i` when read back |`domain(sqrt(-1), RR)`, which evaluates to `NaN`|
|**Silent**|`"x - domain(x, ZZ)".ToEntity().Simplify()`, and any sum mixing a node with a narrowed codomain and the same node without |`0` — the two were collected as one monomial |`x - domain(x, ZZ)`, left alone |
41
+
|| every node type's own `Stringize()` and `Latexize()` overrides — `Entity.Sumf.Stringize()` and 129 more | declared on each node | declared once on `Entity`; still callable on every node, and a consumer compiled against 2.3.0 has to be rebuilt |
37
42
38
43
### A polynomial inequality of degree three or more is answered
39
44
@@ -156,6 +161,78 @@ bracketing for. The change only ever adds `\left(`/`\right)` groups, which CShar
156
161
parses, so nothing downstream needs a matching change
0 commit comments