Applying a transformation to all elements of a set #322
Description
Activity
Measured on
mastertoday. This does not need quantifiers, and most of it is already done.Finite sets already map any function
"({ 1, 2, 3 }) ^ 2".ToEntity().Simplify() // { 1, 4, 9 } "sin({ 1, 2, 3 })".ToEntity().Simplify() // { sin(1), sin(2), sin(3) } "ln({ 1, 2, 3 })".ToEntity().Simplify() // { 0, ln(2), ln(3) } "({ 1, 2, 3 }) + 1".ToEntity().Simplify() // { 2, 3, 4 }
Intervals are half done, and the half that exists needs no quantifier either
"(0; 1) + 1".ToEntity().Simplify() // (1; 2) ✔ "(0; 1) - 5".ToEntity().Simplify() // (-5; -4) ✔ "(0; 1) * 2".ToEntity().Simplify() // (0; 1) * 2 ✘ untouched "ln((0; 1))".ToEntity().Simplify() // ln((0; 1)) ✘ untouched
SumfandMinusfhave interval cases inEvaluation.Continuous.Arithmetics.Classes.cs;MulfandDivfhave none. So the gap is interval arithmetic, not quantification — sliding an interval is already there, scaling it is not.Reading the two that exist turned up a wrong answer
Subtracting an interval reflects it, so its ends have to swap — and the code slid both without swapping:
"5 - (0; 1)".ToEntity().Simplify() // was (5; 4) — left end above right, so empty "4.5 in (5 - (0; 1))".ToEntity().Simplify() // was False
Fixed in #1117, with the openness swapping too (
5 - (0; 1]is[4; 5), not(4; 5]).What is left for this issue
MulfandDivfover an interval, which is a sign analysis rather than a new concept:multiplier (a; b) * kk > 0(k*a; k*b), ends and openness in placek < 0(k*b; k*a), ends and openness swapped — exactly as subtraction doesk = 0{ 0 }, the interval collapsing to a pointsign unknown left alone, because answering would be choosing one Division by a constant is the same with
1/k; division by an interval straddling zero is not an interval at all and should be left alone.Non-monotonic functions are a different question and I would leave them out:
ln((0; 1))is(-oo; 0)becauselnis increasing, butsin((0; 7))is[-1; 1]and getting there needs to know where the turning points are. Monotonic-function-over-interval is a reasonable follow-up; generalfover an interval is the thing that would want more machinery.The label says
Not now, so I have not implemented the multiplication — happy to if you want it, and the sign table above is the whole of it.This is easy to do, just do it
- added a commit that references this issue
on Sep 18, 2026
It will be possible once we implement quantifiers
Example for intervals