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

Assume the rule remainder condition when checking ensures #4071

Merged
merged 1 commit into from
Nov 1, 2024

Conversation

geo2a
Copy link
Collaborator

@geo2a geo2a commented Oct 31, 2024

When Booster detects an indeterminate requires, it adds it to the constraints on the rewritten Pattern. However, when we check the ensures clause, we only pass the the constraints on the old pattern as known truth. This PR corrects that by adding the uncertain conditions as additional known truth, as the ensures check should be performed on the rewritten pattern, not the old one.

@geo2a geo2a requested a review from jberthold October 31, 2024 11:52
@geo2a geo2a force-pushed the booster-check-ensures-with-rule-remainder branch from 5d5ec32 to 1e2d4cb Compare October 31, 2024 11:54
--
-- we need to add unclearRequiresAfterSmt (if any) as additional known truth,
-- as it may allow us to prune a vacuous state
ensuredConditions <- checkEnsures ruleSubstitution unclearRequiresAfterSmt

-- if a new constraint is going to be added, the equation cache is invalid
unless (null ensuredConditions) $ do
Copy link
Member

Choose a reason for hiding this comment

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

Just stumbled over this line here. What if ensuredConditions is nil but we have unclearRequiresAfterSmt?
We should probably also clear the equation cache in that case. We are most likely going to return a Branching result immediately, but maybe we find one of the branches simplifies to bottom and proceed.

@jberthold jberthold merged commit 856a96f into master Nov 1, 2024
6 checks passed
@jberthold jberthold deleted the booster-check-ensures-with-rule-remainder branch November 1, 2024 00:18
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