A C++ reference implementation accompanies the theoretical framework, demonstrating computational viability. It is provided as supporting evidence; the mathematical claims of the paper are stated and justified in the chapters and do not depend on this implementation.
This directory provides:
-
Core data structure. A class
IntervalNumber(src/IntervalNumber.hpp) usingdoublefor endpoint storage, with normalization to ensure$x_0 \le x_1$ and propagation ofNaNsemantics. -
Arithmetic operations. All operations defined in Section 4 with explicit handling of extended-real limits, including the indeterminate forms
$0 \cdot \infty$ ,$\infty - \infty$ , and related cases. -
Unit tests. A test suite (
src/main.cpp) employing the Google Test framework, validating mathematical properties, edge cases, and the behavior of native IEEE-754 floating-point limits used as a baseline.
The project uses CMake (version 3.14 or higher).
cd test
cmake -S . -B build
cmake --build build --config ReleaseGoogle Test is fetched automatically via CMake's FetchContent module; no manual installation is required.
The location of the test executable depends on the CMake generator:
# Single-config generators (Ninja, Unix Makefiles)
./build/interval_test # add .exe on Windows
# Multi-config generators (Visual Studio, Xcode)
./build/Release/interval_test.exe
./build/Debug/interval_test.exeAlternatively, run the suite via CTest from the build directory:
ctest --test-dir build --output-on-failure -C ReleaseThe 93 unit tests in src/main.cpp verify that the reference implementation conforms to the formal definitions of Chapter 4 and to the stated examples and edge cases. Selected correspondences:
| Claim | Reference | Test name(s) |
|---|---|---|
| Rule I: |
§3.4 | RuleI_ZeroTimesInfinity |
| Rule II: |
§3.4 | RuleII_ZeroTimesNegativeInfinity |
| Central thesis identity |
§6.1 |
Thesis01, Thesis02
|
| Non-associativity of multiplication | Proposition 5.2 | MultiplicationNotAssociative |
| Combined-operation examples | §6.2 |
ReadmeExample01, ReadmeExample02
|
| §4.5 | DivisionByZeroIndeterminateForm |
|
| §4.5 | DivisionInfinityByInfinity |
|
| §4.7 |
Power_IndeterminateForm_0_pow_0, Power_IndeterminateForm_1_pow_Infinity, Power_IndeterminateForm_Infinity_pow_0
|
All 93 tests pass under the build instructions above. Test names not appearing in this table cover normalization invariants, arithmetic identities on point intervals, IEEE-754 baseline comparisons, and regression tests for reciprocal/division/abs/pow on edge cases.
The reference implementation is intended as a proof of computational viability rather than a production library. Possible extensions include:
- Arbitrary precision arithmetic (e.g., via
mpfrorboost::multiprecision) to eliminate floating-point artifacts. - Symbolic representation to preserve exact algebraic identities through interval operations.
- Language bindings (Python, Julia) for use in scientific computing workflows.
- Formal verification of operation correctness using a proof assistant such as Coq or Lean.