%0 Journal Article %F aehss2006 %A Andersen, Jesper %A Elsborg, Ebbe %A Henglein, Fritz %A Simonsen, Jakob Grue %A Stefansen, Christian %T Compositional specification of commercial contracts %J International Journal on Software Tools for Technology Transfer (STTT) %V 8 %N 6 %P 485-516 %X We present a declarative language for compositional specification of contracts governing the exchange of resources. It extends Eber and Peyton Jones's declarative language for specifying financial contracts (Jones et al. in The Fun of Programming. 2003) to the exchange of money, goods and services amongst multiple parties and complements McCarthy's Resources, Events and Agents (REA) accounting model (McCarthy in Account Rev. LVII(3), 554-578, 1982) with a view-independent formal contract model that supports definition of user-defined contracts, automatic monitoring under execution and user-definable analysis of their state before, during and after execution. We provide several realistic examples of commercial contracts and their analyses. A variety of (real) contracts can be expressed in such a fashion as to support their integration, management and analysis in an operational environment that registers events. The language design is driven by both domain considerations and semantic language design methods: a contract denotes a set of traces of events, each of which is an alternative way of concluding the contract successfully, which gives rise to a CSP-style (Brooker et al. in J.ACM 31(3), 560-599, 1984; Hoare in Communicating Sequential Processes, 1985) denotational semantics. The denotational semantics drives the development of a sound and complete small-step operational semantics, where a partially executed contract is represented as a (full) contract that represents the remaining contractual commitments. This opera- tional semantics is then systematically refined in two stages to an instrumented operational semantics that reflects the bookkeeping practice of identifying the specific contractual commitment a particular event matches at the time the event occurs, as opposed to delaying this matching until the contract is concluded %U http://www.diku.dk/hjemmesider/ansatte/henglein/papers/andersen2006a.pdf %8 November %D 2006