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

Some changes for Lib, December '24 edition #845

Merged
merged 6 commits into from
Dec 20, 2024

Conversation

michaelmcinerney
Copy link
Contributor

@michaelmcinerney michaelmcinerney commented Dec 19, 2024

These are some changes that cropped up during my work for sorted_ipc_queues for MCS.

I would recommend reviewing commit-by-commit, so that unrelated changes appearing in the same file can be considered individually.

"\<lbrace>\<lambda>s. \<forall>vs. map (\<lambda>t. f t s) ts = map Some vs \<longrightarrow> P vs s\<rbrace>
mapM (gets_the \<circ> f) ts
\<lbrace>P\<rbrace>"
unfolding comp_def
Copy link
Member

Choose a reason for hiding this comment

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

@lsf37 edge case for indentation, where does this one go? it's a new one for me

Copy link
Member

Choose a reason for hiding this comment

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

I was going to say this is correct as is, but it is true that we usually put unfolding on the same indent as apply. That would probably look weird here. What does the Isabelle auto indenter do?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The auto indenter indents this by 2 spaces. Sigh. I'll cancel the tests that are running and push an update

Copy link
Member

Choose a reason for hiding this comment

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

Feel free to ignore if you don't want to keep on fiddling with this, but I imagine that the unfold isn't needed in the Nil case, and if that's right you could just add comp_def to the simp in the Cons case and possibly avoid fighting with the indentation at all.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It does seem necessary in both cases, and even adding it to the simp in wpsimp in both cases doesn't work. So I just went with the unfolding. If this is suspicious, I can look into it further

Copy link
Member

Choose a reason for hiding this comment

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

Huh, that seems unexpected to me but not enough to be worth further investigation.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah. If you want to sweep it under the rug, you can put a unfold ..., before the induct in proof, otherwise yeah just do what auto-indenter does it this case, it's a really rare event it seems.

Copy link
Member

@Xaphiosis Xaphiosis left a comment

Choose a reason for hiding this comment

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

Cheers!
(although do fix the AARCH64 CRefine, not sure why only it broke, probably because it uses latest tech)

Copy link
Member

@lsf37 lsf37 left a comment

Choose a reason for hiding this comment

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

Cool. For the indent comment above, I would say in this case, go with whatever Isabelle's indenter wants to do. No point in fighting it there.

Done in order to avoid unwanted interactions with comp_apply

Signed-off-by: Michael McInerney <[email protected]>
Done in order to avoid unwanted simplification of heaps which
are defined via multiple uses of opt_map_Some

Signed-off-by: Michael McInerney <[email protected]>
This rule is no longer needed, now that opt_map_Some is not
defined in terms of comp

Signed-off-by: Michael McInerney <[email protected]>
@michaelmcinerney michaelmcinerney force-pushed the michaelm-rules_for_Lib_Dec24 branch from 96a3752 to 62292f3 Compare December 20, 2024 02:11
@michaelmcinerney michaelmcinerney merged commit 911b214 into master Dec 20, 2024
14 checks passed
@michaelmcinerney michaelmcinerney deleted the michaelm-rules_for_Lib_Dec24 branch December 20, 2024 05:14
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.

4 participants