Floor/Ceil composition contract: exact substitution and usable jump analysis
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 30/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- csharp, fsharp
- Área
- backend-api-design
Línea de trabajo
Start with the Floor/Ceil evaluation paths in Evaluation.Continuous.Arithmetics.Classes.cs and the recognition logic in BreakpointIntegration.cs; compare these with the existing differentiation behavior in Differentiation.cs. The issue describes exact substitution, both compiler paths, and a public bounded-domain jump analysis, so first clarify scope with maintainers. Done means exact cases are handled without guessed integers and any jump analysis reports unresolved boundaries rather than implying completeness.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
What you ran: An application uses Floor/Ceil as both symbolic operations and plotted functions. The smallest correctness reproducer on AngouriMath 2.5.0 is:
open AngouriMath
let x : Entity.Variable = "x"
let two = MathS.FromString("2")
let four = MathS.FromString("4")
let child = MathS.Sin(MathS.pi * x / two)
let rounded = MathS.Floor(child)
printfn "%O" (rounded.Substitute(x, four).InnerSimplified)
// -1
let childAtFour = child.Substitute(x, four).InnerSimplified
printfn "%O" childAtFour
printfn "%O" (MathS.Floor(childAtFour).InnerSimplified)
// 0
// 0
The first result should also be 0: the substituted argument is exactly sin(2*pi) = 0. The construction order changes the result.
The application also constructs these ordinary compositions:
floor(x^2)
floor(x^2/2)
floor(sin(pi*x*(4-x)/2))
ceil(sin(pi*x*(4-x)/2))
It needs to evaluate them exactly at authored rational checkpoints, compile them for plotting, and, where provable on a bounded real interval, obtain their constant pieces and exact jump/endpoint ownership for later integration or differentiation.
What it did:
There are three separate parts to the integration contract.
-
Exact substitution can give the wrong integer. The reproducer above returns
-1because the already-wrapped expression reaches Floor from the negative side of a numerically evaluated trigonometric zero. Simplifying the child first produces exact zero and the correct Floor. Current master at2d3dc6astill routes an exact Rational throughEDecimal.Floor/Ceiling(Floor source, Ceil source). The broader finite-precision number-design problem is already tracked in #1376; this issue is not presenting the known 100+ digit near-integer case as a new discovery. -
Compilation was an application blocker in 2.5.0.
rounded.Compile([| x |])throwsUncompilableNodeException, so the same expression that is displayed symbolically cannot use AngouriMath's fast evaluator for a plot. #1603 covered Floor/Ceil as part of a solver-fallback failure. Current master has since added both fast-expression instructions (Floor/Ceil compiler) and LINQ forms (LINQ compiler). That appears to resolve the compiler part for the next release; it is recorded here so this integration requirement is not mistaken for a duplicate request. -
A caller cannot yet obtain a complete, checkable partition for nonlinear compositions. Current master has careful breakpoint integration, but its Floor/Ceil recognition is deliberately limited to the direct argument
x(break recognition, unit-step recognition).floor(x^2)and the sine composition therefore remain unevaluated under anchored integration. Differentiation returns the mathematically useful almost-everywhere condition0 provided not argument in ZZ(source); that is not a claim that the full composition is or is not differentiable at every preimage of an integer, and it does not expose the one-sided information a renderer needs.
I searched open and closed issues for Floor/Ceil compilation and sine evaluation. #1603 is the related compilation report, and #1376 is the related v3 exact-versus-approximate number-design discussion. I did not find an existing issue for the substitution-order error or for a public, completeness-reporting jump analysis of composed Floor/Ceil.
What it should have done:
For exact symbolic evaluation:
- substituting
x = 4intofloor(sin(pi*x/2))and then simplifying should return exact0, independent of whether the child was simplified before it was wrapped; - exact Rational Floor/Ceil should be decided from numerator and denominator, without first rounding through
EDecimal; - exact and approximate evaluation should have an explicit contract. If the side of an integer cannot be proved in exact mode, retaining the Floor/Ceil node is safer than returning a guessed integer. The wider redesign can remain with #1376.
For numerical plotting, the compiled Floor/Ceil support now on master should remain covered for both compiler paths and for nonlinear children such as x^2 and sin(pi*x/2).
For downstream symbolic consumers, a useful result would be either:
- a public piecewise/jump analysis over a caller-supplied bounded real domain, returning proven constant pieces with exact boundary expressions and open/closed ownership; or
- an explicit incomplete/unresolved result when those boundaries cannot be proved.
This need not promise a general closed-form integral or distributional derivative. Leaving Integralf unevaluated is valid, and the current conditional derivative is useful as an almost-everywhere statement. The required distinction is that an unresolved integral, an almost-everywhere derivative, or an incomplete jump search must remain visibly unresolved rather than being usable as proof that a composed rounded curve is numerically valid everywhere. Such an API would let applications render and validate the cases AngouriMath can prove while declining the rest honestly, instead of each application building its own partial piecewise solver.
- Lenguaje dominante
- C#
- Estrellas
- 831
- Forks
- 79
- Merge medio
- 2 h 22 min
- PR fusionados (30 d)
- 507
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de ASC-Community/AngouriMath
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
ASC-Community/AngouriMath#1692 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 30/100
ASC-Community/AngouriMath#1690 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
ASC-Community/AngouriMath#1689 · 5 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
ASC-Community/AngouriMath#1684 ·
Los mantenedores suelen responder en 1 día
-
Eigenvalues of a matrixAbierto
Dificultad 4/5 3-5 días Aptitud para principiantes 57/100
ASC-Community/AngouriMath#1676 ·
Los mantenedores suelen responder en 1 día
Todos los issues de ASC-Community/AngouriMath
Issues similares
-
Python: Bug: split_plaintext_paragraph / split_markdown_paragraph can return a chunk larger than max_tokensPosiblemente ocupada @xThreeh la tomó hoy. Abiertopython triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
microsoft/semantic-kernel#14566 ·
Los mantenedores suelen responder en 4 días
-
triage
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
rjmurillo/moq.analyzers#1384 ·
-
Variables passed to Compensated are not set on the routing slipQuizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
MassTransit/MassTransit#6249 ·
-
security
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Sendspin/sendspin-dotnet#339 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
owasp-dep-scan/dosai#79 ·
Los mantenedores suelen responder en 1 día