Skip to content

Conversation

mtzguido
Copy link
Member

@mtzguido mtzguido commented Sep 2, 2025

Currently, if we reach an internal let-rec during SMT encoding, we raise an exception that is meant to be caught in order to display a warning. As #3991 shows, we sometimes fail to catch it, and crash. This PR changes this logic to simply encode them imprecisely (via a fresh new variable), and remove the use of the exception. This fixes the issue, and seems simpler. I removed the warning about the imprecise encoding but it can be easily added back too.

I also wonder (and don't remember) what is special about inner let recs: can't we encode them the same as top-level recursive lets, just maybe after a closure conversion?

check-world here: https://github.com/mtzguido/FStar/actions/runs/17366789190, failures seem to be expected ones

@gebner
Copy link
Contributor

gebner commented Sep 4, 2025

👍 on removing the warning. The SMT encoding isn't complete anyhow (nor can it be).

@mtzguido
Copy link
Member Author

mtzguido commented Sep 4, 2025

Why can't it be?

@gebner
Copy link
Contributor

gebner commented Sep 4, 2025

Right now we're really limited by the lifting of the refinement types and lambdas; there's no way for the SMT solver to create new ones.

But I was mostly thinking practically. We're intentionally restricting the SMT encoding with fuel and ifuel to be incomplete.

@gebner gebner changed the title Twaeking imprecise encoding of inner let recs Tweaking imprecise encoding of inner let recs Sep 5, 2025
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.

2 participants