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

Formally specify correctness property of the chain sync mini-protocol with fixed chain #97

Open
javierdiaz72 opened this issue Jan 12, 2024 · 2 comments · May be fixed by #98
Open

Formally specify correctness property of the chain sync mini-protocol with fixed chain #97

javierdiaz72 opened this issue Jan 12, 2024 · 2 comments · May be fixed by #98

Comments

@javierdiaz72
Copy link
Contributor

javierdiaz72 commented Jan 12, 2024

We shall formally specify the equivalence between sending a whole chain and running the chain synchronization mini-protocol when the client starts from the genesis block and the server is given the aforementioned chain, which then is never updated during the protocol run.

Additionally, since the definition of the semantics of mini-protocol programs (see #96) will likely not be ready when this GitHub issue is addressed, we shall assume the existence of the following semantics function:

_:: ('p'm or_done program)process family
@jeltsch
Copy link
Contributor

jeltsch commented Jan 12, 2024

I think that it we should use either program families and process families or programs and processes. I guess that the latter is enough. To go to process families we could start with program families and apply ⟦_⟧ pointwise.

@javierdiaz72
Copy link
Contributor Author

I think that it we should use either program families and process families or programs and processes. I guess that the latter is enough.

My current code attempt (which follows your former approach) is the following:

consts protocol_semantics :: "('p ⇒ 'm or_done program) ⇒ process family" (‹⟦_⟧›)

consts sync_repeated_send :: "'a sync_channel ⇒ 'a ⇒ process family" (infix ‹◃⇧∞⇘s⇙› 52)

definition list_sender :: "'a::embeddable sync_channel ⇒ 'a list ⇒ process family" where
  [simp]: "list_sender c xs = foldr (λx p. c ◃⇘s⇙ x; p) xs 𝟬"

context chain_sync
begin

definition spec :: "'i list ⇒ process family" where
  [simp]: "spec C = list_sender client_chains [C'. C' ← prefixes C, C' ≠ []]"
  
 definition impl :: "'i list ⇒ process family" where
  [simp]: "impl C = ⟦program⟧ ∥ server_chains ◃⇧∞⇘s⇙ C"

theorem fixed_chain_sync_from_genesis_conformance:
  assumes "initial_client_chain = [hd C]"
  shows "spec C ≈⇩s impl C"
  sorry
  
end

To go to process families we could start with program families and apply ⟦_⟧ pointwise.

Do you suggest to do something like ⟦program Client⟧ ∥ ⟦program Server⟧? If so, how could I turn this compound process into a process family?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment