Skip to content

Keep set of defined terms in SideCondition #2354

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

Merged
merged 61 commits into from
Feb 3, 2021

Conversation

ana-pantilie
Copy link
Contributor

@ana-pantilie ana-pantilie commented Jan 19, 2021

Part of #2351

Needs #2315

Implements the first three bullet points from #2351.


Review checklist

The author performs the actions on the checklist. The reviewer evaluates the work and checks the boxes as they are completed.

  • Summary. Write a summary of the changes. Explain what you did to fix the issue, and why you did it. Present the changes in a logical order. Instead of writing a summary in the pull request, you may push a clean Git history.
  • Documentation. Write documentation for new functions. Update documentation for functions that changed, or complete documentation where it is missing.
  • Tests. Write unit tests for every change. Write the unit tests that were missing before the changes. Include any examples from the reported issue as integration tests.
  • Clean up. The changes are already clean. Clean up anything near the changes that you noticed while working. This does not mean only spatially near the changes, but logically near: any code that interacts with the changes!

ana-pantilie and others added 30 commits December 7, 2020 19:00
…ndition' into replacement-map-in-sidecondition
…ork/kore into replacement-map-in-sidecondition
@ana-pantilie ana-pantilie marked this pull request as ready for review January 29, 2021 14:06
@ttuegel ttuegel self-requested a review January 29, 2021 15:13
isBottom assumedTrue
where
SideCondition { assumedTrue } = sideCondition

instance Ord variable => HasFreeVariables (SideCondition variable) variable
where
freeVariables sideCondition@(SideCondition _ _) =
freeVariables sideCondition@(SideCondition _ _ _) =
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this should include the free variables of the other fields.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you think this should include the free variables of the replacements as well? I assume you mean the free variables of the defined terms here, right?

Copy link
Contributor

Choose a reason for hiding this comment

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

Well, the free variables of the term replacements should be the same as from the assumedTrue right? Yes, we should definitely include the defined terms.

generateNormalizedAcs internalMap
& HashSet.map TermLike.mkInternalMap
in foldMap assumeDefinedWorker definedElems
<> asSet term'
Copy link
Contributor

Choose a reason for hiding this comment

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

Why use asSet here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

generateNormalizedAcs will not add the collection itself to the resulting HashSet. I thought it was clearer to separate the two, especially since we should check if the input collection is always defined or not before adding it. Actually, do you think we should do the same for the subcollections as well?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, I mean: Why does the collection itself need to be in the set at all? The set should have all the sub-terms required to decide that the whole collection is defined.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. We don't add the collection itself anymore, and I added a special case for singleton collections in isDefined.

in foldMap assumeDefinedWorker definedElems
<> asSet term'
<> definedMaps
TermLike.InternalSet_ internalSet ->
Copy link
Contributor

Choose a reason for hiding this comment

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

Could the logic for Map and Set be combined with Kore.Builtin.AssocComm.CeilSimplifier?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've thought about this, and I think it would only make sense if we wanted to also generate subcollections there and evaluate their ceils. Do we want to do this? At the moment, it looks like we only check the definedness of the elements and if they are unique.

Copy link
Contributor

Choose a reason for hiding this comment

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

At the moment, it looks like we only check the definedness of the elements and if they are unique.

Well, that's what it means to evaluate the \ceils of sub-collections.

@ttuegel ttuegel merged commit deaf0af into master Feb 3, 2021
@ttuegel ttuegel deleted the defined-terms-in-sidecondition branch February 3, 2021 21:43
ttuegel added a commit that referenced this pull request Feb 4, 2021
@ttuegel ttuegel mentioned this pull request Feb 4, 2021
4 tasks
ttuegel added a commit that referenced this pull request Feb 4, 2021
* Revert "Keep set of defined terms in SideCondition (#2354)"

This reverts commit deaf0af.

* Revert "Keep table of term replacements in SideCondition, use in term simplifier (#2315)"

This reverts commit c427819.
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