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 ReplicaSet invariants, Convert Model from usize to unbounded Nats #575

Merged

Conversation

codyjrivera
Copy link
Collaborator

Prove several additional invariants for VReplicaSet; convert reconcile step data structure to unbounded integers.

@codyjrivera codyjrivera mentioned this pull request Jan 16, 2025
@codyjrivera codyjrivera marked this pull request as ready for review January 18, 2025 00:35
@codyjrivera codyjrivera changed the title Draft PR: Prove ReplicaSet invariants, Convert Model from usize to unbounded Nats Prove ReplicaSet invariants, Convert Model from usize to unbounded Nats Jan 18, 2025
@@ -97,7 +97,7 @@ pub open spec fn reconcile_core(v_replica_set: VReplicaSetView, resp_o: Option<R
obj: pod.marshal(),
});
let state_prime = VReplicaSetReconcileState {
reconcile_step: VReplicaSetReconcileStep::AfterCreatePod((diff - 1) as usize),
reconcile_step: VReplicaSetRecStepView::AfterCreatePod(abs(diff - 1)),
Copy link
Collaborator

@marshtompsxd marshtompsxd Jan 18, 2025

Choose a reason for hiding this comment

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

Why do we need abs (which should be a no-op here)? Is it to make sure the result is still a nat since there is subtraction here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The compiler complains if the expression is left as-is without a cast/operation. If you'd prefer as nat, I can do that change.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes let's use as nat, which looks more natural

Signed-off-by: Cody Rivera <[email protected]>
@codyjrivera codyjrivera force-pushed the cody/convert-to-unb-integers branch from 822dbc4 to 3dc70cd Compare January 20, 2025 18:15
@@ -1,14 +1,14 @@
use crate::kubernetes_api_objects::spec::prelude::*;
use crate::reconciler::spec::{io::*, reconciler::*};
use crate::vreplicaset_controller::trusted::{spec_types::*, step::*};
use vstd::prelude::*;
use vstd::{prelude::*, math::abs};
Copy link
Collaborator

Choose a reason for hiding this comment

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

@codyjrivera Can you also remove this import of abs? After that you can merge it.

@codyjrivera codyjrivera enabled auto-merge January 20, 2025 19:43
@codyjrivera codyjrivera added this pull request to the merge queue Jan 20, 2025
Merged via the queue into anvil-verifier:main with commit 0fd286e Jan 20, 2025
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