From 4e2d863e12909a74e4fd36dfed68b6e99aa40138 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20D=C3=ADaz?= Date: Mon, 15 Jan 2024 20:09:05 -0300 Subject: [PATCH] Specify property of the chain sync mini-protocol with fixed chain --- src/Ouroboros-Mini_Protocols-Chain_Sync.thy | 37 +++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/src/Ouroboros-Mini_Protocols-Chain_Sync.thy b/src/Ouroboros-Mini_Protocols-Chain_Sync.thy index 7859af3..6aabfb0 100644 --- a/src/Ouroboros-Mini_Protocols-Chain_Sync.thy +++ b/src/Ouroboros-Mini_Protocols-Chain_Sync.thy @@ -7,6 +7,7 @@ text \ theory "Ouroboros-Mini_Protocols-Chain_Sync" imports "Ouroboros-Mini_Protocols" + "Thorn_Calculus.Thorn_Calculus-Core_Bisimilarities" "HOL-Library.BNF_Corec" "HOL-Library.Sublist" begin @@ -272,6 +273,42 @@ proof by (cases p) simp_all qed +subsection \Proofs of Correctness\ + +no_notation Sublist.parallel (infixl "\" 50) + +(* FIXME: This is a temporary declaration, until the real semantics are implemented. *) +consts protocol_semantics :: "('p \ 'm or_done program) \ process family" (\\_\\) + +text \ + We show a basic correctness property of the chain synchronization mini-protocol, namely the + equivalence between sending a whole chain and running the 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. +\ + +(* FIXME: This is a temporary declaration. *) +consts sync_repeated_send :: "'a sync_channel \ 'a \ process family" (infix \\\<^sup>\\<^bsub>s\<^esub>\ 52) + +definition list_sender :: "'a::embeddable sync_channel \ 'a list \ process family" where + [simp]: "list_sender c xs = foldr (\x p. c \\<^bsub>s\<^esub> 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 \\<^sup>\\<^bsub>s\<^esub> C" + +theorem fixed_chain_sync_from_genesis_correctness: + assumes "initial_client_chain = [hd C]" + shows "spec C \\<^sub>s impl C" + sorry + +end + subsection \The End\ end