Contract Syntax Sample Clauses
Contract Syntax syntactically defined as follows: , , . k , ▇ ▇ k
Contract Syntax. Definition 5 The set of contract formulae de- noted by C (with variable ϕ P C to range over the units. ^ _ Contract disjunction is written as ϕ1 ϕ2, and contract conjunction as ϕ1 ϕ2. The for- mula ϕ1; ϕ2 indicates the sequential composition of two contracts — in order to satisfy the whole contract, the first contract ϕ1 must be satisfied and then the second one ϕ2. For instance, we can model the obligation of agent k of doing action p q O p qr s wait 2 ; k a 3 . O p qr s P p qr s The reparation operator, written ϕ1§ϕ2, is the contract which starts off as ϕ1, but when violated triggers contract ϕ2, e.g., 1 a 2 § 2 b 5 is the contract which obliges agent 1 to perform action p qr sp q a in 2 time units, but if she does not, permits agent 2 to perform action b in 5 time units. The formula condk a d ϕ1, ϕ2 is a condi- tional contract where (i) if party k performs ac- tion a within d time units it proceeds to behave like ϕ1; otherwise (ii) if d time units elapse with- out a being performed by k, it then proceeds to behave like ϕ2. Note that we can generalize to more general conditions on the system, but we limit it to the ability of a party to perform an action for the scope of this paper. O p qr s O p qr s ^ p q Finally, rec x.ϕ and x handles recursive con- tracts, e.g., rec x. p a d ; x is the contract which obliges agent p to repeatedly perform action a within d time units of each other. In contrast, rec x. r pr 10 wait 30 ; x, is the contract in which agent r is repeatedly obliged to pay rent (action pr) during the first 10 days of the month. Using these basic contract combinators, we can define more complex ones, for example, a pro- hibition which persists until a particular action is performed — a prohibition on agent k from per- forming action a until party l performs action b, written Fpra, ks U rb, lsq, and defined as follows: = ” df Fpra, ks U rb, lsq rec x.`cond paqr8spK, Jq^ In order to compute the relation, we trans- form it into a rewriting calculus: we can see ˘ the rules above as rewriting rules going from condlpbqr8spJ, xq
Example 1 The contract of the plane boarding system from Section 2, can be formalised using our contract calculus as follows: ϕ0 ::= Pppcheckinqrt0 − 120s ϕ1 ::= OppPBPqr5s left to right. For instance, the equivalence rule 13 (Okpaqr0s ” K) allows us to rewrite Okpaqr0s; Plpbqr5s to K; Plpbqr5s, which in turn can be rewritten to K using rule 10 (K; ϕ ” K). Definition 7 We write ϕ ãÑ ϕ1 (where ϕ, ϕ1 P C), if ϕ1 is the result of...
Contract Syntax. Definition 5. The set of contract formulae denoted by C (with variable ϕ P C to range over the contracts) is contract where (i) if party k performs action a within d time units it proceeds to behave like ϕ1; otherwise (ii) if d time units elapse without a being performed by k, it then proceeds to behave like ϕ2. Note that we can generalize to more general conditions on the system, but we limit it to the ability of a party to perform an action for the scope of this paper. p q p qr s p qr s ^ Finally, rec x.ϕ and x handles recursive contracts, e.g., rec x.Op a d ; x is the contract which obliges agent p to repeatedly perform action a within d time units of each other. In contrast, rec x.Or pr 10 wait 30 ; x, is the contract in which agent r is repeat- edly obliged to pay rent (action pr) during the first 10 days of the month. Using these basic contract combinators, we can define more complex ones, for example, a prohibi- tion which persists until a particular action is per- formed — a prohibition on agent k from perform- ing action a until party l performs action b, written F pra, ks U rb, lsq, and defined as follows: ` ˘ ϕ ::= J | K | P paqrds | O paqrds | F paqrds F pra, ks U rb, lsq = rec x. condkpaqr8spK, Jq^ condl pbqr8spJ, xq
