Theories and tools based on multiparty session types offer correctness guarantees for concurrent programs that communicate using message-passing. These guarantees usually come at the cost of an intrinsically top-down approach, which requires the communication behaviour of the entire program to be specified as a global type. This paper introduces kmclib: an OCaml library that supports the development of correct message-passing programs without having to write any types. The library utilises the meta-programming facilities of OCaml to automatically infer the session types of concurrent programs and verify their compatibility (k-MC). Well-typed programs, written with kmclib, do not lead to communication errors and cannot get stuck.
翻译:以多党会话类型为基础的理论和工具为同时使用信息传递的同步程序提供了正确性保障。 这些保障通常以内在的自上而下的方法为代价,要求将整个程序的通信行为指定为全球类型。 本文引入了 kmclib: 支持开发正确信息传递程序的OCaml 图书馆, 无需写任何类型的文件。 图书馆使用 Ocaml 的元程序设置自动推算同步程序的会话类型并核实其兼容性( k- MC ) 。 以 kmclib 写好的程序不会导致通信错误, 也不会被卡住 。