Synthesis of Distributed Mobile Programs Using Monadic Types in Coq
We present a methodology for the automatic synthesis of certified, distributed, mobile programs with side effects in Erlang, using the Coq proof assistant.
First, we define monadic types in the Calculus of Inductive Constructions, using a lax monad covering the distributed computational aspects. These types can be used for the specifications of programs in Coq. From the (constructive) proofs of these specifications we can extract Haskell code, which is decorated with symbols representing distributed nodes and specific operations for distributed computations. These syntactic annotations are exploited by a back-end compiler to produce actual mobile code for a suitable runtime environment (Erlang, in our case).
Then, we introduce an object type theory for distributed computations, which can be used as a front-end programming language. These types and terms are translate to CIC extended with monadic types; this allows us to prove the soundess of the object type theory, and to obtain an implementation of the language via Coq’s extraction features.
This methodology can be ported to other computational aspects, by suitably adapting the monadic type theory and the back-end compiler.
Unable to display preview. Download preview PDF.
- 1.Armstrong, J.: Erlang - a survey of the language and its industrial applications. In: Proc. INAP 1996 (1996)Google Scholar
- 4.Leroy, X.: Formal certification of a compiler back-end or: programming a compiler with a proof assistant. In: Proc. POPL, pp. 42–54. ACM (2006)Google Scholar
- 7.Licata, D.R., Harper, R.: A monadic formalization of ML5. In: Crary, K., Miculan, M. (eds.) Proc. LFMTP. EPTCS, vol. 34, pp. 69–83 (2010)Google Scholar
- 8.Murphy VII, T., Crary, K., Harper, R.: Type-Safe Distributed Programming with ML5. In: Barthe, G., Fournet, C. (eds.) TGC 2007. LNCS, vol. 4912, pp. 108–123. Springer, Heidelberg (2008)Google Scholar
- 11.Virding, R., Wikström, C., Williams, M.: Concurrent programming in ERLANG, 2nd edn. Prentice Hall International (UK) Ltd. (1996)Google Scholar