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

Unroll first and last iteration in encoding #545

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

Conversation

JonasAlaif
Copy link
Contributor

For a

while(cond)
 invariant invs
{
  body
}

loops we can instead generate the CFG of essentially

if(cond) {
  do
   invariant invs
  {
    inhale cond
    body
  } while(cond)
}

This essentially unrolls the first and last loop iteration when executed in Silicon.
This change should be identical to viperproject/carbon#399 ⁠— i.e. we should add a flag for enabling this behavior.

The one thing I'm not sure about is the hardcoded Inhale(cond), sometimes we might want this to be an Assume? Is there any significant difference?

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