Certified symbolic management of financial multi-party contracts

Domain-specific languages (DSLs) for complex financial contracts are in practical use in many banks and financial institutions today. Given the level of automation and pervasiveness of software in the sector, the financial domain is immensely sensitive to software bugs. At the same time, there is an increasing need to analyse (and report on) the interaction between multiple parties. In this paper, we present a multi-party contract language that rigorously relegates any artefacts of simulation and computation from its core, which leads to favourable algebraic properties, and therefore allows for formalising domain-specific analyses and transformations using a proof assistant. At the centre of our formalisation is a simple denotational semantics independent of any stochastic aspects. Based on this semantics, we devise certified contract analyses and transformations. In particular, we give a type system, with an accompanying type inference procedure, that statically ensures that contracts follow the principle of causality. Moreover, we devise a reduction semantics that allows us to evolve contracts over time, in accordance with the denotational semantics. From the verified Coq definitions, we automatically extract a Haskell implementation of an embedded contract DSL along with the formally verified contract management functionality. This approach opens a road map towards more reliable contract management software, including the possibility of analysing contracts based on symbolic instead of numeric methods.

[1]  Pierre Letouzey Extraction in Coq: An Overview , 2008, CiE.

[2]  Tom Hvitved,et al.  A Survey of Formal Languages for Contracts , 2011 .

[3]  Robert Atkey,et al.  Unembedding domain-specific languages , 2009, Haskell.

[4]  Gernot Heiser,et al.  Comprehensive formal verification of an OS microkernel , 2014, TOCS.

[5]  Ronald M. Lee,et al.  A logic model for electronic contracting , 1988, Decis. Support Syst..

[6]  Nick Benton,et al.  Ultrametric Semantics of Reactive Programs , 2011, 2011 IEEE 26th Annual Symposium on Logic in Computer Science.

[7]  Felix Klaedtke,et al.  A trace-based model for multiparty contracts , 2012, J. Log. Algebraic Methods Program..

[8]  A. van Deursen,et al.  Algebraic specification of a language for describing financial products , 1995 .

[9]  Christian Johansen,et al.  Run-Time Monitoring of Electronic Contracts , 2008, ATVA.

[10]  Alan Jeffrey,et al.  LTL types FRP: linear-time temporal logic propositions as types, proofs as functional reactive programs , 2012, PLPV '12.

[11]  Florian Haftmann,et al.  From higher-order logic to Haskell: there and back again , 2010, PEPM '10.

[12]  Rowan Davies,et al.  A temporal-logic approach to binding-time analysis , 1995, Proceedings 11th Annual IEEE Symposium on Logic in Computer Science.

[13]  Diomidis Spinellis,et al.  Commercial uses: Going functional on exotic trades , 2009, Journal of Functional Programming.

[14]  Adam Chlipala,et al.  Certified Programming with Dependent Types - A Pragmatic Introduction to the Coq Proof Assistant , 2013 .

[15]  Simon L. Peyton Jones,et al.  Composing contracts: an adventure in financial engineering (functional pearl) , 2000, ICFP '00.

[16]  J. Eber,et al.  How to write a financial contract , 2003 .

[17]  Brian Vinter,et al.  Functional High Performance Financial IT , 2011, Trends in Functional Programming.

[18]  Xavier Leroy,et al.  Formal certification of a compiler back-end or: programming a compiler with a proof assistant , 2006, POPL '06.

[19]  Ken Friis Larsen,et al.  POETS: Process-oriented event-driven transaction systems , 2009, J. Log. Algebraic Methods Program..

[20]  Robert Atkey,et al.  Productive coprogramming with guarded recursion , 2013, ICFP.

[21]  Martin Elsman,et al.  A Financial Benchmark for GPGPU Compilation , 2015 .

[22]  Jakob Grue Simonsen,et al.  Compositional specification of commercial contracts , 2006, International Journal on Software Tools for Technology Transfer.

[23]  Hiroshi Nakano,et al.  A modality for recursion , 2000, Proceedings Fifteenth Annual IEEE Symposium on Logic in Computer Science (Cat. No.99CB36332).

[24]  John C. Hull,et al.  CVA and Wrong-Way Risk , 2012 .