Skip to content

Conversation

@brianhuffman
Copy link
Contributor

The SAWCore simulator backend cannot evaluate the recursor Nat#rec on an argument derived from a symbolic bitvector expression with bvToNat. This situation leads to a panic message.

Previously goal_normalize would happily unfold functions like equalNat or addNat to their low-level definitions using Nat#rec. Such functions are implemented as primitives in the various SAW backends, and as primitives they can be reasoned about successfully with symbolic bvToNat arguments.

As of this PR, goal_normalize now avoids unfolding any function that is implemented as a primitive in the SAWCore simulator backends. This ensures that the resulting goal will still be evaluated in the backend in the same way as the original goal.

Fixes #2749.

Some SAWCore constants (e.g. `equalNat`) are implemented as primitives
in the SAW backends, and also have definitions using e.g. Nat#rec that
are used for Coq export.

We now avoid unfolding such constants with `goal_normalize` because
it typically results in goals that are unprovable by external solvers.
@brianhuffman brianhuffman merged commit 4868cb5 into master Oct 30, 2025
37 checks passed
@brianhuffman brianhuffman deleted the bh/issue2749 branch October 30, 2025 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SAWCore panic after proof goal normalization

4 participants