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

Infer that the right-hand side of claims is defined #2136

Merged
merged 5 commits into from Sep 25, 2020
Merged

Infer that the right-hand side of claims is defined #2136

merged 5 commits into from Sep 25, 2020

Conversation

andreiburdusa
Copy link
Contributor


Fixes #2110

Reviewer checklist
  • Test coverage: stack test --coverage
  • Public API documentation: stack haddock

@andreiburdusa andreiburdusa added this to Pull requests in Iteration via automation Sep 11, 2020
@andreiburdusa andreiburdusa marked this pull request as ready for review September 11, 2020 15:03
lhs' = simplified { Pattern.substitution = mempty }
rhs = ClaimPattern.right claimPattern
simplifiedLhs <- simplify lhs
simplifiedRhs <- OrPattern.filterOr <$> traverse simplify rhs
Copy link
Contributor

Choose a reason for hiding this comment

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

@ana-pantilie Aren't we already simplify the right-hand side of the claim somewhere else?

Copy link
Contributor

Choose a reason for hiding this comment

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

simplifiedRhs <- OrPattern.filterOr <$> traverse simplify rhs
let substitution =
Pattern.substitution simplifiedLhs
<> foldMap Pattern.substitution (MultiOr.getMultiOr simplifiedRhs)
Copy link
Contributor

Choose a reason for hiding this comment

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

We cannot add the substitution from the right-hand side to the global substitution. We can't apply it to the left-hand side, and it isn't right to drop it from the right-hand side (below) either.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Initially I didn't do that, but I tried it out of other ideas

Comment on lines 212 to 214
\ceil{SortGeneratedTopCell{}, SortGeneratedTopCell{}}(
/* Fn Spa */
Lbl'-LT-'generatedTop'-GT-'{}(
Copy link
Contributor

Choose a reason for hiding this comment

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

I know this hasn't been simplified because Lbl'-LT-'generatedTop'-GT-'{} is a functional constructor.

Comment on lines 184 to 189
let simplifiedRhs = OrPattern.filterOr (OrPattern.map Pattern.requireDefined rhs)
let substitution = Pattern.substitution simplifiedLhs
lhs' = simplifiedLhs { Pattern.substitution = mempty }
claimPattern
{ ClaimPattern.left = lhs'
, ClaimPattern.right = simplifiedRhs
Copy link
Contributor

Choose a reason for hiding this comment

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

This code will only be called once, at start-up. Please move it to Kore.Reachability.Claim.simplify', where we infer that the left-hand side of the claim is defined, and where we simplify both sides of the claim. The \ceil patterns must be simplified under the same conditions as the rest of the right-hand side.

@ttuegel ttuegel self-requested a review September 22, 2020 14:12
@andreiburdusa andreiburdusa merged commit b8016de into runtimeverification:master Sep 25, 2020
Iteration automation moved this from Pull requests to Merged Sep 25, 2020
@andreiburdusa andreiburdusa deleted the rhs-defined branch September 25, 2020 07:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Iteration
  
Merged
Development

Successfully merging this pull request may close these issues.

Infer that the right-hand side of claims is defined
3 participants