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

word_lib+crefine: move lemmas to Word_Lib #736

Merged
merged 1 commit into from
Mar 25, 2024
Merged

Conversation

lsf37
Copy link
Member

@lsf37 lsf37 commented Mar 16, 2024

  • move AARCH64 word lemmas to the holding area in Word_Lib
  • generalise word_ctz_upcast_id and provide word_ctz_upcast_id_32_64

@lsf37 lsf37 self-assigned this Mar 16, 2024
@lsf37 lsf37 added cleanup Aarch64 AArch64-specific proofs, specs, etc labels Mar 16, 2024
@lsf37 lsf37 requested a review from Xaphiosis March 16, 2024 10:34
@lsf37 lsf37 force-pushed the aarch64-word-move branch 2 times, most recently from b39ea74 to fc470c2 Compare March 17, 2024 09:51
by (simp add: word_rsplit_def bin_rsplit_def word_bits_def word_size_def Cons_replicate_eq)

lemma word_ctz_upcast_id_32_64:
"x \<noteq> 0 \<Longrightarrow> word_ctz (UCAST(32 \<rightarrow> 64) x) = word_ctz x"
Copy link
Member

Choose a reason for hiding this comment

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

there's an argument to be made that this is true of any upcast

Copy link
Member Author

Choose a reason for hiding this comment

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

That's why I made word_ctz_upcast_id and use it here to prove this one :-). Just wanted to preserve the behaviour the existing proof expects and remove the additional is_up condition the generic one introduces.

@@ -1480,19 +1480,6 @@ lemma multiple_add_less_nat:
apply simp
done

(* FIXME AARCH64 move to wherever we keep the from_bool/to_bool lemmas *)
lemma word_le_1_and_idem:
Copy link
Member

Choose a reason for hiding this comment

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

can you confirm that Word_Lemmas_Internal are where we keep our from_bool/to_bool lemmas?

Copy link
Member Author

Choose a reason for hiding this comment

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

Word_Lemmas_Internal is the area to commit Word_Lib lemmas to that should be moved into the rest of Word_Lib at the next sync with the AFP. The from_bool/to_bool lemmas are deeper within Word_Lib, but should only move there at the sync point (otherwise we risk accidentally removing things when we sync).

Copy link
Member

Choose a reason for hiding this comment

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

Oki, but then do you want to remove or keep the comment to move it near from/to_bool?

Copy link
Member Author

@lsf37 lsf37 Mar 25, 2024

Choose a reason for hiding this comment

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

word_le_1_and_idem should not actually go there, from_to_bool_le_1_idem should. word_le_1_and_idem should go where AND lemmas are. (I.e. they should all be sorted properly by content by default, so I removed that part).

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.

I would prefer the commit message short-line reflect that this is AARCH64-cleanup related:
"word_lib+crefine: move AARCH64 lemmas to Word_Lib" or something

- move AARCH64 word lemmas to the holding area in Word_Lib
- generalise word_ctz_upcast_id and provide word_ctz_upcast_id_32_64

Signed-off-by: Gerwin Klein <[email protected]>
Base automatically changed from aarch64-cleanup to master March 25, 2024 19:44
@lsf37 lsf37 merged commit a5baa09 into master Mar 25, 2024
14 checks passed
@lsf37 lsf37 deleted the aarch64-word-move branch March 25, 2024 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Aarch64 AArch64-specific proofs, specs, etc cleanup
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants