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

Reduce boilerplate to merge local predicates #37

Open
TWal opened this issue Jun 24, 2024 · 0 comments · May be fixed by #40
Open

Reduce boilerplate to merge local predicates #37

TWal opened this issue Jun 24, 2024 · 0 comments · May be fixed by #40
Labels
cleanup Ideas to make the code cleaner

Comments

@TWal
Copy link
Collaborator

TWal commented Jun 24, 2024

Currently, some amount of boilerplate is needed to merge local predicates, and prove that the global predicate contains all local predicates:

val all_sessions_has_all_sessions: unit -> Lemma (norm [delta_only [`%all_sessions; `%for_allP]; iota; zeta] (for_allP (has_local_bytes_state_predicate protocol_invariants_nsl) all_sessions))
let all_sessions_has_all_sessions () =
assert_norm(List.Tot.no_repeats_p (List.Tot.map fst (all_sessions)));
mk_global_local_bytes_state_predicate_correct protocol_invariants_nsl all_sessions;
norm_spec [delta_only [`%all_sessions; `%for_allP]; iota; zeta] (for_allP (has_local_bytes_state_predicate protocol_invariants_nsl) all_sessions)
val protocol_invariants_nsl_has_pki_invariant: squash (has_pki_invariant protocol_invariants_nsl)
let protocol_invariants_nsl_has_pki_invariant = all_sessions_has_all_sessions ()
val protocol_invariants_nsl_has_private_keys_invariant: squash (has_private_keys_invariant protocol_invariants_nsl)
let protocol_invariants_nsl_has_private_keys_invariant = all_sessions_has_all_sessions ()
val protocol_invariants_nsl_has_nsl_session_invariant: squash (has_local_state_predicate protocol_invariants_nsl state_predicate_nsl)
let protocol_invariants_nsl_has_nsl_session_invariant = all_sessions_has_all_sessions ()

The boilerplate is linear in the number of local predicates, there is no reason that this shouldn't be doable in constant size? For example using a meta-program?

@TWal TWal mentioned this issue Jun 24, 2024
@TWal TWal linked a pull request Jul 17, 2024 that will close this issue
@TWal TWal added the cleanup Ideas to make the code cleaner label Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Ideas to make the code cleaner
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant