Language: Python · Sphere: programming · Category: Data Structures
Pointer-based segment tree over a fixed-length numeric array supporting range-sum and range-min queries with point updates.
Use for O(log n) range aggregate queries on mutable data; each node caches the sum and min of its span, refreshed along the root-to-leaf path on update.
Guarantees (self-test): planted sums/mins exact, a point update propagates to both aggregates, a 600-op fuzz agrees with a plain-list oracle, and inverted or out-of-bounds ranges and empty construction are refused.
When it runs, segment tree guarantees st.range_sum(0, 9) == 55; st.range_sum(10, 19) == 155; st.range_sum(0, 99) == 5050 (proven by run).
Checkable constraints:
st.range_sum(0, 9) == 55st.range_sum(10, 19) == 155st.range_sum(0, 99) == 5050st.range_min(0, 9) == 1st.range_min(10, 19) == 11st.range_min(50, 99) == 51st.range_sum(0, 4) == 15st.range_sum(0, 4) == 112
- Green-run: ✓ passes (re-run under the extractor's gate)
- Constraint strength: recovery (truth-pinned)
- Independent oracle: — none yet (green-run candidate; not an axiom under the frozen ruler)
- Peer review: unreviewed
△ AURA Pattern Library — © Reality Optimizer