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

Prove VReplicaSet WF1 Lemmas for Create Path #571

Merged

Conversation

codyjrivera
Copy link
Collaborator

@codyjrivera codyjrivera commented Oct 31, 2024

Modulo some auxiliary lemmas, this PR provides proofs for WF1 lemmas on the Create path of the ReplicaSet controller.

@codyjrivera codyjrivera changed the title WIP: Prove VReplicaSet WF1 Lemmas for Create Path Prove VReplicaSet WF1 Lemmas for Create Path Oct 31, 2024
requires forall |e: A| #![auto] s.contains(e) ==> !pred(e),
ensures s.filter(pred).len() == 0;
pub proof fn seq_pred_false_on_all_elements_is_equivalent_to_empty_filter<A>(s: Seq<A>, pred: spec_fn(A) -> bool)
ensures (forall |e: A| #![auto] s.contains(e) ==> !pred(e)) <==> s.filter(pred).len() == 0;
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: let's set a trigger instead of using auto, which makes it even harder to predict the behavior of the solver

// TODO: Prove this lemma.
// Annoying sequence reasoning.
#[verifier(external_body)]
pub proof fn lemma_filtered_pods_set_equals_matching_pods(
Copy link
Collaborator

Choose a reason for hiding this comment

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

@codyjrivera could you write more descriptive comments for this lemma?

Copy link
Collaborator Author

@codyjrivera codyjrivera Oct 31, 2024

Choose a reason for hiding this comment

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

Yes -- I can write better comments.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this one already proved or not? Coz I still see the external_body annotation.

Copy link
Collaborator Author

@codyjrivera codyjrivera Nov 1, 2024

Choose a reason for hiding this comment

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

It's not proven yet -- I had proved the first of the conjuncts but not the other two -- I've outlined roughly what we need to do in the body.

I can try to prove it today --- Fridays are generally terrible for me schedule-wise though.

Copy link
Collaborator

@marshtompsxd marshtompsxd Nov 1, 2024

Choose a reason for hiding this comment

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

OK feel free to merge this one when you are ready. I've done my review

@marshtompsxd marshtompsxd marked this pull request as ready for review October 31, 2024 20:55
@marshtompsxd marshtompsxd added this pull request to the merge queue Nov 4, 2024
Merged via the queue into anvil-verifier:main with commit e226ed6 Nov 4, 2024
17 checks passed
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