{"title":"多方消息传递协议的改进:与规范无关的理论与实现","authors":"Vassor Martin, Yoshida Nobuko","doi":"arxiv-2407.09106","DOIUrl":null,"url":null,"abstract":"Multiparty message-passing protocols are notoriously difficult to design, due\nto interaction mismatches that lead to errors such as deadlocks. Existing\nprotocol specification formats have been developed to prevent such errors (e.g.\nmultiparty session types (MPST)). In order to further constrain protocols,\nspecifications can be extended with refinements, i.e. logical predicates to\ncontrol the behaviour of the protocol based on previous values exchanged.\nUnfortunately, existing refinement theories and implementations are tightly\ncoupled with specification formats. This paper proposes a framework for\nmultiparty message-passing protocols with refinements and its implementation in\nRust. Our work decouples correctness of refinements from the underlying model\nof computation, which results in a specification-agnostic framework. Our\ncontributions are threefold. First, we introduce a trace system which\ncharacterises valid refined traces, i.e. a sequence of sending and receiving\nactions correct with respect to refinements. Second, we give a correct model of\ncomputation named refined communicating system (RCS), which is an extension of\ncommunicating automata systems with refinements. We prove that RCS only produce\nvalid refined traces. We show how to generate RCS from mainstream protocol\nspecification formats, such as refined multiparty session types (RMPST) or\nrefined choreography automata. Third, we illustrate the flexibility of the\nframework by developing both a static analysis technique and an improved model\nof computation for dynamic refinement evaluation. Finally, we provide a Rust\ntoolchain for decentralised RMPST, evaluate our implementation with a set of\nbenchmarks from the literature, and observe that refinement overhead is\nnegligible.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":null,"pages":null},"PeriodicalIF":0.0000,"publicationDate":"2024-07-12","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":"{\"title\":\"Refinements for Multiparty Message-Passing Protocols: Specification-agnostic theory and implementation\",\"authors\":\"Vassor Martin, Yoshida Nobuko\",\"doi\":\"arxiv-2407.09106\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"Multiparty message-passing protocols are notoriously difficult to design, due\\nto interaction mismatches that lead to errors such as deadlocks. Existing\\nprotocol specification formats have been developed to prevent such errors (e.g.\\nmultiparty session types (MPST)). In order to further constrain protocols,\\nspecifications can be extended with refinements, i.e. logical predicates to\\ncontrol the behaviour of the protocol based on previous values exchanged.\\nUnfortunately, existing refinement theories and implementations are tightly\\ncoupled with specification formats. This paper proposes a framework for\\nmultiparty message-passing protocols with refinements and its implementation in\\nRust. Our work decouples correctness of refinements from the underlying model\\nof computation, which results in a specification-agnostic framework. Our\\ncontributions are threefold. First, we introduce a trace system which\\ncharacterises valid refined traces, i.e. a sequence of sending and receiving\\nactions correct with respect to refinements. Second, we give a correct model of\\ncomputation named refined communicating system (RCS), which is an extension of\\ncommunicating automata systems with refinements. We prove that RCS only produce\\nvalid refined traces. We show how to generate RCS from mainstream protocol\\nspecification formats, such as refined multiparty session types (RMPST) or\\nrefined choreography automata. Third, we illustrate the flexibility of the\\nframework by developing both a static analysis technique and an improved model\\nof computation for dynamic refinement evaluation. Finally, we provide a Rust\\ntoolchain for decentralised RMPST, evaluate our implementation with a set of\\nbenchmarks from the literature, and observe that refinement overhead is\\nnegligible.\",\"PeriodicalId\":501197,\"journal\":{\"name\":\"arXiv - CS - Programming Languages\",\"volume\":null,\"pages\":null},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2024-07-12\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"0\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"arXiv - CS - Programming Languages\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/arxiv-2407.09106\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"arXiv - CS - Programming Languages","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/arxiv-2407.09106","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
Refinements for Multiparty Message-Passing Protocols: Specification-agnostic theory and implementation
Multiparty message-passing protocols are notoriously difficult to design, due
to interaction mismatches that lead to errors such as deadlocks. Existing
protocol specification formats have been developed to prevent such errors (e.g.
multiparty session types (MPST)). In order to further constrain protocols,
specifications can be extended with refinements, i.e. logical predicates to
control the behaviour of the protocol based on previous values exchanged.
Unfortunately, existing refinement theories and implementations are tightly
coupled with specification formats. This paper proposes a framework for
multiparty message-passing protocols with refinements and its implementation in
Rust. Our work decouples correctness of refinements from the underlying model
of computation, which results in a specification-agnostic framework. Our
contributions are threefold. First, we introduce a trace system which
characterises valid refined traces, i.e. a sequence of sending and receiving
actions correct with respect to refinements. Second, we give a correct model of
computation named refined communicating system (RCS), which is an extension of
communicating automata systems with refinements. We prove that RCS only produce
valid refined traces. We show how to generate RCS from mainstream protocol
specification formats, such as refined multiparty session types (RMPST) or
refined choreography automata. Third, we illustrate the flexibility of the
framework by developing both a static analysis technique and an improved model
of computation for dynamic refinement evaluation. Finally, we provide a Rust
toolchain for decentralised RMPST, evaluate our implementation with a set of
benchmarks from the literature, and observe that refinement overhead is
negligible.