View
222
Download
0
Category
Tags:
Preview:
Citation preview
Kahn’s Principle and the Semantics of Discrete Event Systems
Xiaojun LiuEE290N Class ProjectDecember 10, 2004
Xiaojun Liu 2 of 22
Kahn Process Networks
An elegant model of computation for deterministic concurrent processes.
Processes communicate streams of data asynchronously through unbounded FIFO channels.
A denotational semantics based on complete partial orders (CPOs) and Scott continuous functions.
Xiaojun Liu 3 of 22
Kahn’s Principle
The input-output function of any network is denoted by the least fixed point solution of the network’s recursion equations.
Robert Yates and Guang Gao, “A Kahn Principle for Networks of Nonmonotonic Real-Time Processes”http://www.sable.mcgill.ca/~hendren/ftp/acaps/memo60.ps.gz
p qx
z
y
(y, z) = f(x)
F(f)(x) = (p(x, 2(f(x))), q(1(f(x))))
f = fix(F)
Can we extend this to timed systems?
Xiaojun Liu 4 of 22
Previous Work: Yates & Gao Timed stream: a sequence of time-stamped
tokens. The time stamps are strictly increasing and
separated by a minimum time interval 0. Processes are -causal.
Xiaojun Liu 5 of 22
Previous Work, Continued
The principle novelty of the new functional (F) … is that it cuts off all outputs as soon as the earliest new output token appears.
The new functional lets the network “run” at each step only until the earliest new output token appears.
Xiaojun Liu 6 of 22
Highlights of Approach
A direct extension of KPN to DE systems.
More general than the previous work outlined earlier.
Useful guidance to develop operational semantics and simulator.
Xiaojun Liu 7 of 22
Prefix Order − Definition
Let T, a poset, be the set of all tags. Let L(T) be the set of lower sets of T.
A signal is a function from a lower set LL(T) to some value set V,
signal: L V A signal s1: L1 V is a prefix of s2: L2 V,
denoted s1 s2, if and only if
L1 L2, and s1(t) = s2(t), tL1
Let S(T, V) be the set of all signals from lower sets of T to V.
Xiaojun Liu 8 of 22
Prefix Order − Examples
Given any set A, treated as a poset with the discrete order, S(A, B) is the set of all partial functions from A to B.
Let T = [0, ), and V = V {}, where represents the absence of value, S(T, V) is the set of DE signals.
Xiaojun Liu 9 of 22
Prefix Order − Properties
For any poset T of tags and set V of values, S(T, V) with the prefix order is a poset a CPO a complete lower semilattice (i.e. any
subset of signals have a GLB) For any network of processes that are
Scott continuous functions from input to output, Kahn’s principle applies.
Xiaojun Liu 10 of 22
Discrete Event Signals
The set of DE signals, S([0, ), V {}) is a CPO.
Examples:
clock:
0 1 2 3 …
zeno:
0 1 2 3 …
…
½
r-zeno:
0 1 2 3 …
…
½
Xiaojun Liu 11 of 22
Discrete Event Processes
adds1: L1 V
s2: L2 V
s: L V
L = L1 L2
s(t) = s1(t) + s2(t), tL
delayby 1
s1: L1 V s2: L2 V
L2 = L1{1} [0, 1)s2(t) = s1(t 1), when t 1 and
, when t [0, 1)
Xiaojun Liu 12 of 22
Biased Merge or “Default”
biasedmerge
s1: L1 V
s2: L2 V
s: L V
Let p = sup L2.If pL2, L = L1 L2 {q | q p and t[p, q], s1(t)V }and if pL2, L = L1 L2 {q | q p and t(p, q], s1(t)V }s(t) = s1(t), when s1(t)V
s2(t), otherwise, tL
Xiaojun Liu 13 of 22
A Discrete Event System
biasedmerge
delayby 1
zeno
0 1 2 3 …½
…
0 1½
0 1½
…
0 1 2½
…
0 1 2½
… …
0 1 2 3 …½
… …
0 1 2 3 …½
… … …
Xiaojun Liu 14 of 22
YADES
biasedmerge
lookaheadby 1
r-zeno
0 1 2 3 …
…
½
Xiaojun Liu 15 of 22
Continuity and Causality
A process may be continuous but not causal, e.g. “lookahead by 1”.
A process may be causal but not continuous, e.g. one that produces an output event after counting an infinite number of input events.
Xiaojun Liu 16 of 22
Discrete Signals
A DE signal s: L V is discrete if s-1(V) is order-isomorphic with a lower set
of Nand s-1(V) is a finite set, or L = [0, sup s-1(V)).
Let D([0, ), V {}) be the set of discrete signals. With the prefix order, it is a poset, CPO, and a complete lower semilattice.
Xiaojun Liu 17 of 22
?
A Caveat
biasedmerge
clock:0 1
0 1½
…
zeno:
0 1½
…
Xiaojun Liu 18 of 22
Operational Semantics
Represent signals as timed streams Processes map input timed streams to
output timed streams An alternative development of Chandy
and Misra’s distributed DE simulation
Xiaojun Liu 19 of 22
Representing Discrete Signals as Timed Streams Only “present” events?
(0.0, 1)many-to-one
(0.0, 1), (1.0, 1)
prefix
not a prefix
Xiaojun Liu 20 of 22
Null Events
(0.0, 1), (1.0, )
one-to-many
(0.0, 1), (1.0, 1), (2.0, )
(0.0, 1), (2.0, )
(0.0, 1), (1.0, ), (2.0, )
Xiaojun Liu 21 of 22
Simultaneous Events
Extend the tag set to [0, ) N, with the lexicographical order.
All developments so far can be generalized.
Any continuous/causal DE process at a time t can be treated as a Scott continuous function from input sequences to output sequences.
A “snapshot” of a DE system at a time t is a KPN.
Xiaojun Liu 22 of 22
Current Status
Substantial progress on theoretical development
Developing a plan for implementation Introduce “end-of-stream” marker in KPN Change event queue to contain
sequences of events with the same time stamp and receiver
Key criterion for improvement: more efficient simulation due to less traffic into/out of the event queue
Recommended