Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: lazy ackermannization for bv_decide #25

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

bollu
Copy link

@bollu bollu commented Sep 27, 2024

No description provided.

bollu and others added 9 commits October 8, 2024 23:00
We implement strict ackermannization,
which is an algorithmic technique to convert QF_BV+UF into QF_BV.

The implementation walks over the goals and the hypotheses.
When it encounters a function application `(f x1 x2 ... xn)`
where the type signature of `f` is `BitVec k1 -> BitVec k2 -> ... -> BitVec kn -> BitVec ko`,
it creates a new variable `fAppX : BitVec k0`, and an equation `fAppX = f x1 ... xn`.
Next, when it encounters another application of the same function `(f y1 y2 ... yn)`,
it creates a new variable `fAppY : BitVec k0`, and another equation `fAppY = f y1 ... yn`.

After the walk, we loop over all pairs of applications of the function `f` that we have abstracted.
In this case, we have `fAppX` and `fAppY`. For these, we build a extentionality equation, which says that if

```
hAppXAppYExt: x1 = x2 -> y1 = y2 -> ... xn = yn -> fAppX = fAppY
```

Intuitively, this is the only fact that they theory UF can propagate,
and we thus encode it directly as a SAT formula,
by abstracting out the actual function application into a new free variable.

This implementation creates the ackermann variables (`fAppX, fAppY`) first,
and then in a subsequent phase, adds all the ackermann equations (`hAppXAppYExt`).
This anticipates the next patches which will implement *incremental* ackermannization,
where we will use the counterexample from the model to selectively add ackerman equations.
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.

1 participant