Repository navigation
IEnumerable<Entity> -> Set in InvertNode #318
Description
Activity
- addedAcceptedFor proposals, which were approved and will be implementedFor proposals, which were approved and will be implemented
on Mar 24, 2021 - added a commit that references this issue
on Aug 8, 2026 Measured this while sorting out what has to happen before 2.0, and it changes what is left here.
The parametric sets already work
abs(x) = a -> { a * e ^ (i * r_1) provided r_1 in RR } sin(x) = a -> { arcsin(a) + 2 * pi * n_1, pi - arcsin(a) + 2 * pi * n_1 } x ^ 2 = a -> { sqrt(a), -sqrt(a) }on
master(21f0d16). The first is the example in this issue, and it comes back in the shape asked for. Inversions that are not finite sets are already expressed as parametric ones, viaConditionalSetandProvidedf.It is also not an API change
InvertisinternalandInvertNodeisprivate protected:internal IEnumerable<Entity> Invert(Entity value, Entity x) private protected abstract IEnumerable<Entity> InvertNode(Entity value, Entity x)
so what they return is nobody's contract, and changing the type breaks no consumer. I had this filed as a decision that only a major version could take; it is not, and it does not need to wait for 2.0. (The doc comment on
Invertalready says it "returns aSet", so the intent was recorded even though the signature was not changed.)What is actually left, and it is worse than a signature
The sentence in this issue names two halves:
|x| = ashould return{ a e ^ (i * r) : r in RR **and a >= 0** }The
r in RRhalf is implemented. Thea >= 0half is not, and without it the result is wrong rather than merely loose:abs(x) = -1 -> { -e ^ (i * r_1) provided r_1 in RR }At
r_1 = 0that isx = -1, andabs(-1) = 1, not-1. No member satisfies the equation; the answer should be the empty set. Filed as #812.So the useful remainder of this issue is the guard, not the return type — and it is a wrong-answer fix, which outranks the refactor. Changing
IEnumerable<Entity>toSetis still reasonable tidying whenever someone is in here, just not urgent and not breaking.- added a commit that references this issue
on Aug 8, 2026
Because not every node when being inverted returns a finite set. For example,
|x| = ashould return{ a e ^ (i * r) : r in RR and a >= 0 }