Relations and P osets 1 Goals of the lecture Relations - - PowerPoint PPT Presentation

relations and p osets 1 goals of the lecture relations p
SMART_READER_LITE
LIVE PREVIEW

Relations and P osets 1 Goals of the lecture Relations - - PowerPoint PPT Presentation

Relations and P osets 1 Goals of the lecture Relations P osets A run o r a distributed computation Happ ened-b efo re relation c Vija y K. Ga rg Distributed Systems F all 94 Relations and P


slide-1
SLIDE 1 Relations and P
  • sets
1 Goals
  • f
the lecture
  • Relations
  • P
  • sets
  • A
run
  • r
a distributed computation
  • Happ
ened-b efo re relation c Vija y K. Ga rg Distributed Systems F all 94
slide-2
SLIDE 2 Relations and P
  • sets
2 Mo del
  • f
Distributed systems
  • events
  • b
eginnin g
  • f
p ro cedure fo
  • termination
  • f
ba r
  • send
  • f
a message
  • receive
  • f
a message
  • termination
  • f
a p ro cess
  • happ
ened-b efo re relation 6 ?
  • I
@ @ R Comm uni cation Net w
  • rk
Time 12:01 Time 12:04 Austin San Jose New Y
  • rk
Time 11:58 Withdra w $ 10 Dep
  • sit
$ 20 T ransfer $ 10 c Vija y K. Ga rg Distributed Systems F all 94
slide-3
SLIDE 3 Relations and P
  • sets
3 Relation
  • X
= any set a bina ry relation R is a subset
  • f
X
  • X
.
  • Example:
X = fa; b; cg, and R = f(a; c); (a; a); (b; c); (c; a)g. h h h c a b c Vija y K. Ga rg Distributed Systems F all 94
slide-4
SLIDE 4 Relations and P
  • sets
4 Relation [Contd.] Reexiv e: If fo r each x 2 X ; (x; x) 2 R :
  • Example:
X is the set
  • f
natural numb ers, and R = f(x; y ) j x divides y g: Irreexiv e: F
  • r
each x 2 X ; (x; x) 62 R :
  • Example:
X is the set
  • f
natural numb ers, and R = f(x; y ) j x less than y g: Reexive
  • r
irreexive ? h h h h ?
  • 6
  • h
h h h ?
  • 6
  • c
Vija y K. Ga rg Distributed Systems F all 94
slide-5
SLIDE 5 Relations and P
  • sets
5 Relation [Contd.] Symmetric: (x; y ) 2 R implies (y ; x) 2 R .
  • Examples:
is sibling
  • f,
x mo d k = y mo d k : An ti-symmetric: (x; y ) 2 R ; (y ; x) 2 R inplies x = y .
  • Examples:
, divides. Asymmetric: (x; y ) 2 R implies (y ; x) 62 R .
  • Examples:
is child
  • f,
<. c Vija y K. Ga rg Distributed Systems F all 94
slide-6
SLIDE 6 Relations and P
  • sets
6 Relation [Contd.] T ransitiv e: (x; y ); (y ; z ) 2 R implies (x; z ) 2 R .
  • Examples:
is reachable from, <, divides. Puzzle: Example
  • f
a symmetric and transitive but not reexive relation. c Vija y K. Ga rg Distributed Systems F all 94
slide-7
SLIDE 7 Relations and P
  • sets
7 P a rtially Ordered Sets [P
  • sets]
P a rtial Order @ @ @ @ @ R
  • Reexive
Irreexive T ransitive T ransitive Anti-symmetric Anti-symmetric Example:
  • Example:
< Examples:
  • X
: Ground Set, (2 X ; ) is a irreexive pa rtial
  • rder
  • (N
; divides ) is a reexive pa rtial
  • rder
  • (R;
) is a reexive pa rtial
  • rder
(also a total
  • rder)
  • causalit
y in a distributed system (later ..) c Vija y K. Ga rg Distributed Systems F all 94
slide-8
SLIDE 8 Relations and P
  • sets
8 P
  • sets
[Contd.] Let Y
  • X
, where (X ; ) is a p
  • set.
Inm um: m = inf (Y ) i
  • 8y
2 Y : m
  • y
  • 8x
2 X : (8y 2 Y : x
  • y
) ) x
  • m
m is also called g l b
  • f
the set Y . Suprem um: s = sup(Y ) i (s is also called l ub)
  • 8y
2 Y : y
  • s
  • 8x
2 X : (8y 2 Y : y
  • s)
) s
  • x
W e denote the glb
  • f
fa; bg b y a u b, and lub b y a t b. X = fa; b; c; d; e; f g R = 8 > > > > < > > > > : (a; b); (a; c); (b; d); (c; f ); (c; e); (d; e) 9 > > > > = > > > > ; f f f f f f
  • 7
Q Q Q Q k 6
  • @
@ @ @ I 6 a b c d e f c Vija y K. Ga rg Distributed Systems F all 94
slide-9
SLIDE 9 Relations and P
  • sets
9 Lattices Lattices
  • *
H H H H H H H H j P
  • set
sups and infs fo r nite sets
  • Let
S b e any set, and 2 S b e its p
  • w
er set. The p
  • set
(2 S ; ) is a lattice.
  • Set
  • f
rationals with usual .
  • Set
  • f
global states
  • A
lattice is an algeb raic system (L; t; u) where t and u satisfy commutative, asso ciative and abso rption la ws. f f f f f f f f f f f f f
  • 6
@ @ I
  • 7
C C C C C C C C O 6 @ @ @ @ @ @ I
  • 6
6
  • @
@ @ I
  • 7
S S S
  • a
b c d e b a a b c d e f c Vija y K. Ga rg Distributed Systems F all 94
slide-10
SLIDE 10 Relations and P
  • sets
10 Monotone functions A function f : X ! Y is monotone i 8 x; y 2 X : x
  • y
) f (x)
  • f
(y ):
  • Examples
  • union,
intersection
  • addition,
multiplic ati
  • n
with p
  • sitive
numb er
  • clo
cks in distribute d systems r r r r
  • J
J J J J J J J J
  • J
J J J J J J J J
  • J
J J J J J J J J
  • J
J J J J J J J J g (x) g (y ) y x g g r r r r
  • J
J J J J J J J J
  • J
J J J J J J J J
  • J
J J J J J J J J
  • J
J J J J J J J J y x f (x) f (y ) f f c Vija y K. Ga rg Distributed Systems F all 94
slide-11
SLIDE 11 Relations and P
  • sets
11 Do wn-Sets and Up-Sets Let (X ; <) b e any p
  • set.
  • W
e call a subset Y
  • X
a do wn-set (alternatively ,
  • rder
ideal) if f 2 Y ^ e < f ) e 2 Y :
  • Simila
rly , w e call Y
  • X
an up-set (alternatively ,
  • rder
lter) if e 2 Y ^ e < f ) f 2 Y :
  • W
e use O (X ) to denote the set
  • f
all do wn-sets
  • f
X . W e no w sho w a simple but imp
  • rtant
lemma. Lemma 1 L et (X ; <) b e any p
  • set.
Then, (O (X ); ) is a lattic e. c Vija y K. Ga rg Distributed Systems F all 94
slide-12
SLIDE 12 Relations and P
  • sets
12 Run g g g g g g g g
  • 0;
1 1; 3 2; 3 3; 2 0; 1 1; 4 2; 3 3; 6 r [1] r [2] (pc; x) (pc; y ) x = x
  • 1
send (x) x = x
  • 1
y = y + 3 receiv e (y ) y = 2
  • y
  • Each
p ro cess P i in a run generates an execution trace s i; e i; s i; 1 : : : e i; l
  • 1
s i; l , which is a nite sequence
  • f
lo cal states and events in the p ro cess P i .
  • state
= values
  • f
all va riables, p rogram counter
  • event
= internal, send, receive
  • A
run r is a vecto r
  • f
traces with r [i] as the trace
  • f
the p ro cess P i . c Vija y K. Ga rg Distributed Systems F all 94
slide-13
SLIDE 13 Relations and P
  • sets
13 Relations g g g g g g g g
  • 0;
1 1; 3 2; 3 3; 2 0; 1 1; 4 2; 3 3; 6 r [1] r [2] (pc; x) (pc; y ) x = x
  • 1
send (x) x = x
  • 1
y = y + 3 receiv e (y ) y = 2
  • y
  • s
  • 1
t if and
  • nly
if s imme diately p recedes t in the trace r [i].
  • s:next
= t
  • r
t:pr ev = s whenever s
  • 1
t.
  • =
irreexive transitive closure
  • f
  • 1
.
  • =
reexive transitive closure
  • f
  • 1
.
  • event
e in the trace r [i] ; event f in the trace r [j ] if e is the send
  • f
a message and f is the receive event
  • f
the same message. c Vija y K. Ga rg Distributed Systems F all 94
slide-14
SLIDE 14 Relations and P
  • sets
14 Relations [Contd.] g g g g g g g g
  • 0;
1 1; 3 2; 3 3; 2 0; 1 1; 4 2; 3 3; 6 r [1] r [2] (pc; x) (pc; y ) x = x
  • 1
send (x) x = x
  • 1
y = y + 3 receiv e (y ) y = 2
  • y
c ausal ly pr e c e des relation
  • the
transitive closure
  • f
union
  • f
  • 1
and ;. That is, s ! t i 1. (s
  • 1
t) _ (s ; t),
  • r
2. 9u : (s ! u) ^ (u ! t) s and t a re concurrent (denoted b y sjjt) if :(s ! t) ^ :(t ! s). c Vija y K. Ga rg Distributed Systems F all 94