• 検索結果がありません。

A Basic Agreement Protocol

3.3 A history of a peer

3.3.1 History

Each peer pi takes a value while exchanging values with the other peers at each round as discussed in the basic coordination protocol. A historyHitof a peerpiis a collection of local historiesHit1, . . ., Hint at roundt. A local historyHiit is a sequencevi0, vi1, . . . , vti−1of values which a peerpihas taken until roundtfrom the initial round 0. A local historyHijt is a sequence of valuesvj0, vj1, . . . , vjt−1 which a peer pi has received from another peer pj until round t (j = 1, . . . n, i=j). Here,Hijt =Hjjt since we assume the network and every peer to be reliable and every peer surely receives every value sent in the sending order by another peer. Initially,Hij0 = φ (j = 1, . . . n). A notationHijt|u shows a valuevju which a peer pi receives from a peer pj at round u (u t). Hiit|u shows a value viu which the peerpi takes at the roundu. Suppose a peer pi receives values a, b, c, d, and e at rounds 0, 1, 2, 3, and 4, respectively from another peerpj. Here,Hij5 = a, b, c, d, e. Hij5|2=c.

LetH be a sequencex1, . . . , xm(m 1) of values. Here, a valuexl is re-ferred to as precede another value xh (xl xh) ifl < hin the sequence H. A notation “H +x” shows a sequencex1, . . . , xm, xof values obtained by adding a value x to the sequence H. A subsequence x1, . . . , xl (l m) is a prefix of the sequence H. A subsequence xk, . . . , xm (1 < k) is a postfix of the se-quence H. For example, let H be a sequence a, b, c, d, e of values. A pair of subsequences a, b, c, d and c, d, e are a prefix and postfix of the sequence H, respectively. H + y1, . . . , yl = ((. . . ((H + y1) + y2) . . . ) + yl−1) + yl = x1, . . . , xm, y1, . . . , yl. “H -xl” gives a prefixx1, . . . , xl−1of a sequenceH = x1, . . . , xl. H -xl, . . . , xm= (. . . ((H -xm) -xm−1) . . .) - xl for a sequence H = x1, . . . , xmandl m. For example, H +f, a=a, b, c, d, e, f, αand H -d, e=a, b, c

A value x may occur multiple times in a sequence H of values. Let Hijt[x] show a subsequence x, . . . , x of instances of a value x in a local historyHijt.

|Hijt[x]|is the number of instances of a valuexin a local historyHijt. For example,

letHij7 be a sequencea, b, x, c, d, x, e, fof values.Hij7[x]=x, x,Hij7[c]=c,

|Hij7[x]|= 2, and|Hij7[c]|= 1.

A peerpi takes a current valuevit after obtaining a tuplev1t−1, . . . , vnt−1 of values from the other peersp1, ...,pn, respectively, at roundt. Letctiiindicate the current valuevti. Then, the peerpi sends the valuevitand receives a valuevjtfrom another peerpj. Letctij be a valuevjt which the peerpi receives from the peer pj at roundt. At roundt+ 1, the local historyHijt+1 of a peerpi is obtained asHijt + ctij (=vjt) =vj0, vj1, . . . , vjt−1, vtj(j=1, . . . , n).

For a pair of valuesv1 and v2 in a local history Hijt, v1 precedes v2 (v1 j

v2) if a peerpi receives the value v2 after the value v1 from a peerpj (j = 1, . . ., n). Suppose there are a pair of valuesv1 andv2 in a local historyHijt. If a pair of valuesv1 andv2are in the local historyHijt and the valuev1E-precedes the value v2 in a peer pj (v1 Ej v2), the valuev1 precedes the valuev2 (v1 j v2) in the local historyHijt. However, even ifv1 Pj v2, v2 j v1 might hold in the local historyHijt. A peerpj may take a less preferable value at some round.

3.3.2 Methods on a history

A peerpi takes a value and receives values based on the historyHitat each round t. LetDi show a set of possible sequences of values obtained from the domain Di. Here,Hiit ∈Difor every local historyHiit.

We introduce the following coordination methods on the historyHit [Figure 3.7]:

1. forward:Di→Di. For a sequenceH1inDi,H1is a prefix of forward(H1).

2. compensate: Di Di. For a sequence H1 in Di, compensate(H1) is a prefix ofH1.

3. null:Di→Di. For a sequenceH1 inDi, null(H1) =H1.

LetH1 be a sequence v1, . . . , vm of values. forward(H1) = v1, . . . , vm, vm+1, . . . , vl. In the forward method, a sequencevm+1, . . . , vlis added to the sequenceH1, i.e. H1+vm+1, . . . , vl. compensate(H1) gives a prefixv1, . . . , vk (k m) of the sequenceH1. This means, a peerpi backs to the previous state

null: compensate:

forward: 1 m 1

1

m+1 l

k

m

m

k 1

m

1

1 m

Figure 3.7: History methods.

with a historyH2by withdrawing the valuesvk+1, . . . , vm. In the null method, no new value is taken at roundt, null (H1) =H1.

Each peerpi takes one of the coordination methods at each round as shown in Figure 3.8. If a peerpi takes the forward method, the peerpi selects a new value vit at round t as presented in the basic coordination procedure. In the forward method, a value v is taken and added to the history H1, i.e. v1, . . . , vm, v. If a peerpitakes the null method, the peerpidoes not select a new value at roundt. If a peerpitakes the compensate method, the peerpibacks to a previous roundk+1 where values taken from the roundk+ 1to the present round are withdrawn.

: agreement condition.

forward null compensate

true

history methods

agreement

Figure 3.8: Coordination procedure of a peer.

3.3.3 Compensation

A peerpican back to the previous rounduby compensating a historyHitat current round t (u < t). In some meeting of multiple persons, there may be some rule that each person can withdraw his remark but cannot withdraw a special remark

“no”. Thus, there is some valuevwhich a person cannot withdraw after the person shows the valuevto others. A valuexis referred to as primarily uncompensatable in a peer pi iff the peerpi cannot withdraw the valuexafter showing the valuex to the other peers, i.e. the valuexcannot be withdrawn in the history. Otherwise, a value is primarily compensatable in a peer pi. Let us consider a local history Hii4 = a, b, c, d, eof a peerpi. Suppose a valuecis primarily uncompensatable and the other values are primarily compensatable in the peer pi. Here, the values dandecan be compensated but the valueccannot be compensated. Although the values a and b are primarily compensatable, neither the value a nor the value b can be withdrawn because the valuecpreceded by the values aandbin the local historyHii4 is primarily uncompensatable.

[Definition] In a local historyHiit =vi0,. . .,viu−1,. . .,vti−1of a peerpi, a value viu−1is referred to as uncompensatable iff the valuevui−1is primarily uncompen-satable or some valuevi(viu−1 ⇒vi) preceded by the valuevui−1is uncompensat-able. A valueuui−1 is compensatable iffviu−1 is not uncompensatable in the local historyHiit.

A sequencev0i, v1i, . . . , vit−1 is referred to as uncompensatable iff the value vit−1 is primarily uncompensatable or the subsequence v0i, . . . , vit−2 is uncom-pensatable. A peerpi cannot back to the previous round uat roundt (u < t) if a valuevsi (u < s < t) is uncompensatable in the local historyHiit.

In the example, the local historyHii4 = a, b, c, d, e is uncompensatable, be-cause the valuecis primarily uncompensatable. The subsequenced, eis com-pensatable. In a local historyHiit =vi0, vi1, . . . , vit−1, an uncompensatable value viuis a most recently uncompensatable value iff a subsequenceviu+1, . . . , vit−1is compensatable as shown in Figure 3.9. A compensatable postfixviu+1, . . . , vit−1 is referred to as maximally compensatable subsequence of a local history Hiit = vi0, vi1, . . . , vit−1iff a prefixvi0, v1i, . . . , viuis uncompensatable. In the local his-toryHii4 =a, b, c, d, e, the valuecis the most recently uncompensatable value. A postfixd, eis the maximally compensatable subsequence of Hii4. A postfixe is compensatable but not maximally compensatable.

At roundt, a peer pi takes a valuevti from the tuple vt1−1, . . . , vtn−1. Here,

compensatable uncompensatable

: most recently uncompensatable value

ii

i

t

0 u

i

1

i u+1

i

t-1

H

i

Figure 3.9: Most recently uncompensatable sequence.

vit−1 Ei vti. Supposevjt−1 Ei vit, i.e. vit= vti−1 Ei vtj−1. Suppose the peer pj withdraws the valuevjt−1. If a peerpj takes another valuev (=vjt−1), the peerpi may take a different value from the valuevitdepending on the valuev. Hence, if the peer pj compensates the value vjt−1, the peer pi has to compensate the value vit since the peer pi takes the value vit which is obtained by applying the local decision functionLDi to the valuevjt−1.

[Definition] For each valuevitat roundt, a minimal domainM D(vit) is defined to be a subset of values in the tuplev1t−1, . . . , vtn−1such thatvit=Ei xMD(vt

i)xand vit=Ei x∈MD(vti)−yxfor every valueyinM D(vit).

If any value in M D(vit) is omitted, a least upper bound (lub) of values in M Di(vit) is not the valuevti. A valuevitis referred to as depend on a valuevjt−1in a peerpi(vjt−1 vti) iffvjt−1∈M D(vti).

It is straightforward for the following theorem to hold from the definitions.

[Theorem 1] A valuevti is required to be compensated in a peerpi if at least one value in the minimal domainM D(vit) is compensated.

[Theorem 2] If a value vit is uncompensatable in a peer pi, every value in the minimal domainM D(vit) is uncompensated.

[Proof] Let v be a value in the minimal domain M D(vti), v i vti. Suppose the valuev is compensated in some peerpj. The peerpj might take another valuev (=v) after compensating the valuev. The valuevti might not be the least upper bound ofM D(vit) since the valuevis not inM D(vti).

3.3.4 Constraints on values

In some meeting, there is a rule on how many times each person can say a remark.

For example, each person can say “no” at most once in some meeting. Thus, each valuevin a domainDiis characterized in terms of the maximum occurrence

M Oi(v). The maximum occurrenceM Oi(v) shows how many times a peerpican take in an agreement procedure. If M Oi(v) = 1, a peer pi can take a value v at most once. If a peerpi had so far taken a valuev or fever times thanM Oi(v), i.e.

|Hiit[v]|< M Oi(v), the peerpi can take a valuev again at roundt. IfM Oi(v) =

, a peerpican take a valuev as many times as the peerpiwould like to take.

At roundt, a peerpi takes a valuevitin the forward method on a historyHit. Here, the valuevithas to satisfy the following conditions:

[Conditions of possible values]

1. For every valuexin the local historyHiit,x→Ei vti. 2. |Hiit[vit]|< M Oi(vti).

LetPit(vit−1) show a set of possible values which a peerpican take at roundt.

The setPit(vit−1) is defined from the conditions as follows:

Pit(vti−1) ={v| |Hiit[v]|< M Oi(v) and for every valuexinHiit,vit−1 Ei v }.

A value v is not included in the possible value set Pit(vit−1) if |Hiit [v]| = M Oi(v). Then, the peer pi takes a value vti in the set Pit(vit−1) if Pit(vit−1) = φ. Then, the peerpi sends the valuevitto the other peers. IfPit(vit−1) =φ, there is no value which the peerpican take at roundtin the forward method after taking a valuevit−1at roundt- 1. Here the peerpihas to take another coordination method, null or compensate. If|Pit(vit−1)| ≥2, the valuevit−1 is referred to as branchable at roundt. Even if a valuevti−1is branchable in the domainDi, i.e.|Corni(vit−1)|

2, the valuevit−1may be taken in previous rounds of the local historyHiit.

関連したドキュメント