Skip to content

feat(symbolic): prove bounded mul-div monotonicity#15696

Merged
figtracer merged 1 commit into
masterfrom
fig/symbolic-muldiv-monotonic
Jul 12, 2026
Merged

feat(symbolic): prove bounded mul-div monotonicity#15696
figtracer merged 1 commit into
masterfrom
fig/symbolic-muldiv-monotonic

Conversation

@figtracer

@figtracer figtracer commented Jul 11, 2026

Copy link
Copy Markdown
Member

Summary

Teach native symbolic testing to prove bounded unsigned multiplication/division monotonicity without bit-blasting the nonlinear terms.

The Spark PSM3 verification harness from A Spark Is Born already runs unchanged under forge test --symbolic, but current master returns:

[FAIL: incomplete symbolic execution (Timeout): hard arithmetic heuristic witness used; no replayed counterexample found]

for prove_getSUsdsValue_roundDown_rate_monotonic, whose core shape is:

amount * rate1 / 1e9 / 1e18 <= amount * rate2 / 1e9 / 1e18

with amount <= uint128.max, rate1 <= rate2, and rate2 <= uint128.max.

With this branch, the unchanged proof reports:

[PASS] prove_getSUsdsValue_roundDown_rate_monotonic(...) (... hard-arith: 0 ...)

This is a focused first slice, not the full hevm arithmetic-abstraction catalogue. Spark's ceilDiv round-up properties and exact cancellation/telescoping identities remain incomplete.

This is also separate from #15591: that PR improves stateful invariant exploration and replay storage; its current head still returns the same incomplete result for this stateless nonlinear proof.

  • propagate unsigned path bounds through order constraints, including a <= b <= uint128.max
  • recognize weak product order when both products are proven not to overflow
  • preserve that order through one or more UDIV operations with matching divisors
  • prune contradictory failure paths and remove soundly implied success constraints before heuristic hard-arithmetic search
  • keep wrapping/unbounded products on the existing exact/fallback path

@figtracer figtracer marked this pull request as ready for review July 11, 2026 15:12

@mattsse mattsse left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@figtracer figtracer merged commit 85dfa64 into master Jul 12, 2026
20 checks passed
@figtracer figtracer deleted the fig/symbolic-muldiv-monotonic branch July 12, 2026 01:25
@github-project-automation github-project-automation Bot moved this to Done in Foundry Jul 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants