Current behavior
In Pony, integer division by zero returns 0:
let x = I64(1) / I64(0) // x = 0
This is pragmatic but loses provenance: 1/0 and 2/0 both return 0.
Proposal: indexed infinity (RICIS-III ontology)
RICIS-III (DOI: 10.5281/zenodo.17872755) defines F/0 = ∞_F — an indexed infinity that preserves the numerator as provenance.
| Expression |
Current Pony |
Proposed |
1/0 |
0 |
∞_1 |
2/0 |
0 |
∞_2 |
0/0 |
0 |
resolved via A4 |
∞_1/∞_2 |
NaN |
1/2 |
This could be a fourth division mode (/? preserves the indexed structure) or a compile-time option.
Why
- Preserves information that Pony currently discards
- Allows structural cancellation:
0_F/0_G = F/G
- Prevents NaN cascade from
inf/inf
- Already implemented in C# (Expression Trees): [link to your repo]
Questions for maintainers
- Would a fourth division mode (
/?i for indexed) be acceptable?
- Could this be a compiler flag?
- Interested in a proof-of-concept PR?
References
Current behavior
In Pony, integer division by zero returns
0:let x = I64(1) / I64(0) // x = 0
This is pragmatic but loses provenance:
1/0and2/0both return0.Proposal: indexed infinity (RICIS-III ontology)
RICIS-III (DOI: 10.5281/zenodo.17872755) defines
F/0 = ∞_F— an indexed infinity that preserves the numerator as provenance.1/00∞_12/00∞_20/00∞_1/∞_2NaN1/2This could be a fourth division mode (
/?preserves the indexed structure) or a compile-time option.Why
0_F/0_G = F/Ginf/infQuestions for maintainers
/?ifor indexed) be acceptable?References