System Modeling Introduction Rugby Meta-Model Finite State Machines Petri Nets Untimed Model of Computation Synchronous Model of Computation Timed Model of Computation Integration of Computational Models Tightly Coupled Process Networks Nondeterminism and Probability Applications
System Modeling Untimed MoC 1 Coexistence of Different MoC Domains
System Modeling Untimed MoC 2 An Amplifier as a Network of Three Processes A 3 input A 1 A 2 output A 1 merges input data with a control signal; A 2 amplifies the input signal by applying the control signal; A 3 analyses the amplified signal and produces a new control value;
System Modeling Untimed MoC 3 Events and Signals Untimed events Ė = V ; Synchronous events Ē = V { }; Timed events Ê = Ē; Any kind of event E = Ė Ē Ê; Untimed signals Ṡ : ṡ = ė 0, ė 1, ė 2,..., ė i Ė; Synchronous signals S : s = ē 0, ē 1, ē 2,..., ē i Ē; Timed signals Ŝ : ŝ = ê 0, ê 1, ê 2,..., ê i Ê; Any kind of signal S : s = e 0, e 1, e 2,..., e i E; Empty signal ;
System Modeling Untimed MoC 4 Processes Connected by Untimed, Synchronous and Timed Signals ṡ 1 = ė 1, ė 2, ė 3,... p 1 = 6, 3, 1,... s 2 = ē 1, ē 2, ē 3, ē 4,... p 3 = 6,, 3, 1,... ŝ 3 = ê 1, ê 2, ê 3,... p 5 = 6,,, 1,... p 2 p 4 p 6
System Modeling Untimed MoC 5 Operations on Signals Concatenation of signals s 1 (s 2 s 3 ) = (s 1 s 2 ) s 3, s = s = s. Length of a signal: #s, e.g. # e, e = 2, # = 0; Indexing of signals: [ ] : S N E, e.g. s = e 1, e 2, e 3, s[2] = e 2 ; { e0,..., e take(n, s) = n 1 if #s n s otherwise { en,..., e drop(n, s) = #s 1 if #s n otherwise { e0 if s head(s) = undefined otherwise tail(s) = drop(1, s)
System Modeling Untimed MoC 6 Signal Partitioning Definition: Let ν : N 0 N 0 be a function on natural numbers and s S be a signal. The partition π(ν, s) is defined as follows. π(ν, s) = parts(ν, 0, s) s S We write π(ν, s) = r i with i = 0, 1, 2,... The remainder rem(π, ν, s) is s = ( r i ) rem(π, ν, s), s S, i N 0. r i =π(ν,s) parts(ν, i, s) = for all s S, i N 0. { take(ν(i), s) parts(ν, i + 1, drop(ν(i), s)) if #s ν(i) otherwise
System Modeling Untimed MoC 7 Signal Partitioning Example s = e 0, e 1, e 2, e 3, e 4, e 5,... π(ν, s) = r i for ν(i) = 3 for all i r 0, r 1,... = e 0, e 1, e 2, e 3, e 4, e 5,... p s = e 0, e 1, e 2, e 3, e 4, e 5,... π(ν, s ) = r i for ν (i) = 2 for all i r 0, r 1,... = e 0, e 1, e 2, e 3,...
System Modeling Untimed MoC 8 Signal Partitioning in the Amplifier s = e 0, e 1, e 2, e 3, e 4, e 5,... π(ν, s) = r i for ν(i) = 1 i r 0, r 1,... = e 0, e 1,... s = e 0, e 1, e 2, e 3, e 4, e 5,... π(ν, s ) = r i for ν (i) = 5 i r 0, r 1,... = e 0, e 1, e 2, e 3, e 4,... A 2 s = e 0, e 1, e 2, e 3, e 4, e 5,... π(ν, s ) = r r 0, r 1,... = e 0, e 1,..., e 5 A 3 s = e 0, e 1, e 2, e 3, e 4, e 5,... i for ν (i) = 5 i π(ν, s ) = r i for ν (i) = 1 i,...,... r 0, r 1,... = e 0, e 1,...
System Modeling Untimed MoC 9 Process Constructors Process constructors are templates to instantiate processes. Level Name Constructor Description 1 map mapu Processes without internal state. 2 scan scanu Processes with an internal state and a next-state function. The state is directly visible at the output. 3 moore mooreu Processes with a state; the output is a function of the state, but not directly of the input. 3 mealy mealyu Processes with a state; the output is a function of the state and the current input.
System Modeling Untimed MoC 10 A Map-based Process A 3 input A 1 A 2 output A 2 = mapu(c, f) where c = 1 f(( x, y 1, y 2, y 3, y 4, y 5 )) = xy 1, xy 2, xy 3, xy 4, xy 5 A 2 ( ( 10, 1, 2, 3, 4, 5 ), ( 10, 6, 7, 8, 9, 10 ) ) = 10, 20, 30, 40, 50, 60, 70, 80, 90, 100
System Modeling Untimed MoC 11 The mapu Process Constructor mapu(c, f) = p where p(ṡ) = ṡ f(ȧ i ) = ȧ i π(ν, ṡ) = ȧ i, ν(i) = c π(ν, ṡ ) = ȧ i, ν (i) = #f(ȧ i )
System Modeling Untimed MoC 12 The scanu Process Constructor scanu(γ, g, w 0 ) = p where p(ṡ) = ṡ g(ȧ i, w i ) = w i+1 w i+1 = ȧ i π(ν, ṡ) = ȧ i, ν(i) = γ(w i ) π(ν, ṡ ) = ȧ i, ν (i) = #g(ȧ i ) = 1 i N 0
System Modeling Untimed MoC 13 A Scan-based Process A 3 input A 1 A 2 output A 3 = scanu(γ, g, w 0 ) where w 0 = 10 γ(w i ) = 5 i N 0 g(w i, x 1, x 2, x 3, x 4, x 5 ) = w i 1 if x 1 + x 2 + x3 + x4 + x5 > 500 w i + 1 if x 1 + x 2 + x3 + x4 + x5 < 400 otherwise w i A 3 ( 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 ) = 11, 11.
System Modeling Untimed MoC 14 The mealyu Process Constructor mealyu(γ, g, f, w 0 ) = p where p(ṡ) = ṡ f(w i, ȧ i ) = ȧ i g(w i, ȧ i ) = w i+1 π(ν, ṡ) = ȧ i, ν(i) = γ(w i ) π(ν, ṡ ) = ȧ i, ν (i) = #f(w i, ȧ i )
System Modeling Untimed MoC 15 The mooreu Process Constructor mooreu(γ, g, f, w 0 ) = p where p(ṡ) = ṡ f(w i ) = ȧ i g(w i, ȧ i ) = w i+1 π(ν, ṡ) = ȧ i, ν(i) = γ(w i ) π(ν, ṡ ) = ȧ i, ν (i) = #f(w i )
System Modeling Untimed MoC 16 The zipu Process Constructor zipu(γ a, γ b ) = p where p(ṡ a, ṡ b, ṡ c ) = ṡ ȧ i, ḃi = ė i π(ν a, ṡ a ) = ȧ i, ν a (i) = γ a (ċ i ) π(ν b, ṡ b ) = ḃi, ν b (i) = γ b (ċ i ) π(ν c, ṡ c ) = ċ i, ν c (i) = 1 π(ν, ṡ ) = ė i, ν (i) = 1
System Modeling Untimed MoC 17 The unzipu Process Constructor unzipu() = p where p(ṡ) = ṡ, ṡ ė i = ȧ i, ȧ i π(ν, ṡ) = ė i, ν(i) = 1 π(ν, ṡ ) = ȧ i, ν (i) = #ȧ i π(ν, ṡ ) = ȧ i, ν (i) = #ȧ i
System Modeling Untimed MoC 18 The zipus Process Constructor zipus(c 1, c 2 ) = p where p(ṡ a, ṡ b ) = ṡ (ȧ i, ḃi) = ė i π(ν a, ṡ a ) = ȧ i, ν a (i) = c 1 π(ν b, ṡ b ) = ḃi, ν b (i) = c 2 π(ν, ṡ ) = ė i, ν (i) = 1
System Modeling Untimed MoC 19 The zipwithu Process Constructor zipwithu(c 1, c 2, f) = p where p(ṡ a, ṡ b ) = ṡ f((ȧ i, ḃi)) = ċ i π(ν a, ṡ a ) = ȧ i, ν a (i) = c 1 π(ν b, ṡ b ) = ḃi, ν b (i) = c 2 π(ν, ṡ ) = ċ i, ν (i) = #ċ i
System Modeling Untimed MoC 20 A Zip-based Process A 3 input A 1 A 2 output A 1 = zipus(1, 5) A 1 ( 10, 11, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ) = ( 10, 1, 2, 3, 4, 5 ), ( 11, 6, 7, 8, 9, 10 )
System Modeling Untimed MoC 21 The Amplifier Process Network s in A s 2 A 1 A 3 s 1 A 2 s out A(s in ) = s out where s out = A 2 (s 1 ) s 1 = A 1 (s 2, s in ) s 2 = A 3 (s out )
System Modeling Untimed MoC 22 Process Constructors to Initialize Signals scandu(γ, g, w 0 ) = p where p(ṡ) = w 0 scanu(γ, g, w 0 )(ṡ) initu(ṙ) = p where p(ṡ) = ṙ ṡ ν = ν = 1 ṙ, ṡ Ṡ
System Modeling Untimed MoC 23 Sink and Source Processes sourceu(g, w 0 ) = p where p() = ṡ w i = e i g(w i ) = w i+1 π(ν, ṡ ) = e i, ν (i) = #g(ȧ i ) = 1 sinku(γ, g, w 0 ) = p where p(ṡ) = g(w i ) = w i+1 π(ν, ṡ) = ȧ i, ν(i) = γ(w i )
System Modeling Untimed MoC 24 The Amplifier with Signal Initialization A 4 = initu( 10 ) A (s in ) = s out where s out = A 2 (s 1 ) s 1 = A 1 (s 3, s in ) s 3 = A 4 (s 2 ) s 2 = A 3 (s out ) s 3 s in A s 2 A 4 A 3 s A 1 1 A 2 s out s in = 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 16, 17, 18, 18, 20 s out = 10, 20, 30, 40, 50, 66, 77, 88, 99, 110, 121, 132, 143, 154, 165, 160, 170, 180, 190, 200 s 3 = 10, 11, 11, 10, 9.
System Modeling Untimed MoC 25 Process Composition Parallel Composition Sequential Composition Feedback Composition
System Modeling Untimed MoC 26 Parallel Process Composition p 1 and p 2 are two processes with one input and one output each. s 1, s 2 S are two signals. Parallel process composition, denoted as p 1 p 2, is defined by s 1 s 2 (p 1 p 2 )( s 1, s 2 ) = p 1 (s 1 ), p 2 (s 2 ). Example: p(s 1, s 2 ) = (s 1, s 2 ) can be defined as p 1 p 2 (p 1 p 2 ) p(s 1, s2) = (p (s1), p (s2)) where p = mapu(1, f) f(x) = x
System Modeling Untimed MoC 27 Sequential Process Composition s p 1 and p 2 are two processes with one input and one output each. s S is a signal. Sequential process composition, denoted as p 1 p 2, is defined by (p 2 p 1 )(s) = p 2 (p 1 (s)). (p 2 p 1 ) p 1 p 2
System Modeling Untimed MoC 28 Feedback Process Composition p : (S S) (S S) is a process with two input signals and two output signals. The operator FB P is called the feedback operator. The process FB P (p) : S S is defined by FB P (p)(s 1 ) = s 2 where p(s 1, s 3 ) = (s 2, s 3 ). s 1 s 3 p FB P (p) s 2
System Modeling Untimed MoC 29 Models of Computation Definition: A Model of Computation (MoC) is a 2-tuple MoC= (C, O), where C is a set of process constructors, each of which, when given constructor specific parameters, instantiates a process. O is a set of process composition operators, each of which, when given processes as arguments, instantiates a new process.
System Modeling Untimed MoC 30 Domains of different Models of Computation I MoC A MoC C MoC B
System Modeling Untimed MoC 31 The Untimed Model of Computation Definition: The Untimed Model of Computation (Untimed MoC) is defined as Untimed MoC=(C, O), where C = { mapu, scanu, scandu, mealyu, mooreu, zipu, zipus, zipwithu, unzipu, sourceu, sinku, initu} O = {,, FB P } In other words, a process or a process network belongs to the Untimed MoC Domain iff all its processes and process compositions are constructed either by one of the named process constructors or by one of the composition operators. We call such processes U-MoC processes.
System Modeling Untimed MoC 32 Process Signature Definition: The type of a process is a four-tuple T I, T O, NI, NO, where T I = {T I,1,..., T I,n } T O = {T O,1,..., T O,m } NI = {νi 1,..., νi n } NO = {νo 1,..., νo m } The pair NI, NO is the process signature. is the set of types of the n input signals is the set of types of the m output signals is the set of partitioning functions for the n input signals is the set of partitioning functions for the m output signals
System Modeling Untimed MoC 33 Process Matches Process p has one output with type T O,p and partitioning ν p. Process q has one input with type T I,q = T T O,q and partitioning ν q. The match of the two processes is defined by match(p, q) = ν p(i) ν q (i). match(p, q) = constant 1... perfect match match(p, q) = constant rational number... rational match match(p, q) = not constant... varying match
System Modeling Untimed MoC 34 Matches of the Amplifier Processes s in s 3 A s 2 A 4 A 3 s A 1 1 A 2 s out TYPE(A 1 ) = T I, T O, NI, NO with T I = {Z, Z}, T O = {Z}, NI = {1, 5}, NO = {1}. TYPE(A 2 ) = T I, T O, NI, NO with T I = {Z}, T O = {Z}, NI = {1}, NO = {5}. TYPE(A 3 ) = T I, T O, NI, NO with T I = {Z}, T O = {Z}, NI = {5}, NO = {1}. TYPE(A 4 ) = T I, T O, NI, NO with T I = {Z}, T O = {Z}, NI = {1}, NO = {1}.
System Modeling Untimed MoC 35 Process Up-rating Definition: Let ϱ be a natural number ϱ > 0 and let p be a U-MoC process with one input and one output and the input signal s is partitioned π(ν p, s) = a i. Process p is up-rated by a factor ϱ resulting in another process q if q is continuous and the input signal partitioning of q is π(ν q, s) = b j with b j = ϱ 1 i=0 a jϱ+i j N 0 and p behaves identical to q for all increasing prefixes of an input signal defined by b j : j 1 p( i=0 j 1 b i ) = q( i=0 b i ) j N 0.
System Modeling Untimed MoC 36 Up-rating of Map Processes s in s 3 A s 2 A 4 A 3 s A 1 1 A 2 s out A 2 = uprate(a 2, 2) A 2 = mapu(1, f) where f(( x, y 1, y 2, y 3, y 4, y 5 )) = xy 1, xy 2, xy 3, xy 4, xy 5 A 2 = mapu(2, f ) where f ( x 1, x 2 ) = f(x 1 ) f(x 2 )
System Modeling Untimed MoC 37 Up-rating of Scan Processes s in s 3 A s 2 A 4 A 3 s A 1 1 A 2 A 3 = scanu(γ, g, w 0 ) where ṡ = A 3 (ṡ) w 0 = 10 γ(w i ) = 5 i N 0 π(5, ṡ) = ȧ i and π(1, ṡ ) = ȧ i w i 1 if x 1 + x 2 + x3 + x4 + x5 > 500 g( x 1, x 2, x 3, x 4, x 5, w i ) = w i + 1 if x 1 + x 2 + x3 + x4 + x5 < 400 otherwise w i s out
System Modeling Untimed MoC 38 Up-rating of Scan Processes - cont d A 3 = uprate(a 3, 2) A 3 = mealyu(2 5, g, f, v 0 ) where v 0 = w 0 = 10 π(10, ṡ) = u i, u i = ȧ 2i ȧ 2i+1 π(2, ṡ ) = f (u i, v i ) = u i, u i = ȧ 2i ȧ 2i+1 u i = g(ȧ 2i, v i ) g(ȧ 2i+1, g(ȧ 2i, v i )) g (u i, v i ) = v i+1 = g(ȧ 2i+1, g(ȧ 2i, v i )) A 3( 10,20, 30, 40, 50, 60, 70, 80, 90, 100 ) = f (u 0, v 0 ) = f ( 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 10) = g( 10, 20, 30, 40, 50, 10) g( 60, 70, 80, 90, 100, g( 10, 20, 30, 40, 50, 10)) = 11 g( 60, 70, 80, 90, 100, 11) = 11, 11.
System Modeling Untimed MoC 39 Up-rating of Mealy Processes B = mealyu(γ, g, f, w 0 ) where w 0 = 0, 0, 0, 0, 0 γ(w i ) = 2 i N 0 g( v 1, v 2, v 3, v 4, v 5, x 1, x 2 ) = v 3, v 4, v 5, x 1, x 2 f( v 1, v 2, v 3, v 4, v 5, x 1, x 2 ) = v 1 + v 2 + v 3 + v 4 + v 5 B = uprate(b, 2) B = mealyu(2 2, g, f, v 0 ) v 0 = w 0 = 0, 0, 0, 0, 0 u i = ȧ 2i ȧ 2i+1 u i = ȧ 2i ȧ 2i+1 f (u i, v i ) = f(ȧ 2i, w 2i ) f(ȧ 2i+1, w 2i+1 ) g (u i, v i ) = g(ȧ 2i+1, w 2i+1 ) with w 2i = v i and w 2i+1 = g(ȧ 2i, w 2i ) for i N 0
System Modeling Untimed MoC 40 Up-rating of Mealy Processes - cont d For ṡ = 2, 4, 6, 8 we get B(ṡ) = f( 2, 4, 0, 0, 0, 0, 0 ), f( 6, 8, g( 2, 4, 0, 0, 0, 0, 0 )) = 0, 6 B (ṡ) = f (u 0, v 0 ) = f ( 2, 4, 6, 8, 0, 0, 0, 0, 0 ) = f( 2, 4, 0, 0, 0, 0, 0 ) f( 6, 8, g( 2, 4, 0, 0, 0, 0, 0 )) = 0, 6
System Modeling Untimed MoC 41 Up-rating of Processes with Multiple Inputs Definition: p is a U-MoC process with n inputs and m outputs. The input signals s l, 1 l n are partitioned π(ν p,l, s l ) = a i,l. Process p is up-rated by a factor ϱ N resulting in q if the input signal partitioning of q is π(ν q,l, s l ) = b j,l with b j,l = ϱ 1 i=0 a jϱ+i,l j N 0, 1 l n and p behaves identical to q for all increasing prefixes of input signals defined by b j,l : j 1 p(( i=0 j 1 b i,1 ),, ( i=0 j 1 b i,n )) = q(( i=0 j 1 b i,1 ),, ( i=0 b i,n )) j N 0.
System Modeling Untimed MoC 42 Up-rating of Zip and Unzip Processes zipu processes cannot be up-rated in a simple way. p = zipus(c 1, c 2 ), q = uprate(p, ϱ) is defined by q = q 2 q 1 q 1 = zipus(ϱc 1, ϱc 2 ) q 2 = mapu(1, f) if #(ȧ 1 ) < c 1 #(ȧ 2 ) < c 2 f((ȧ 1, ȧ 2 )) = (take(c 1, ȧ 1 ), take(c 2, ȧ 2 )) f(drop(c 1, ȧ 1 ), drop(c 2, ȧ 2 )) otherwise p = unzipu(), q = uprate(p, ϱ) is defined by q = q 2 q 1 q 1 = mapu(ϱ, f) f( (ȧ 1, ḃ1),, (ȧ ϱ, ḃϱ) ) = (ȧ 1 ȧ 2 ȧ ϱ, ḃ1 ḃ2 ḃϱ) q 2 = unzipu()
System Modeling Untimed MoC 43 Up-rating and Process Composition Sequential composition: uprate((p q), ϱ) = (uprate(p, ϱ)) (uprate(q, ϱ)) Parallel composition: uprate((p q), ϱ) = (uprate(p, ϱ)) (uprate(q, ϱ)) Feedback composition: uprate((fb P (p)), ϱ) FB P (uprate(p, ϱ))
System Modeling Untimed MoC 44 Merge of Map Processes ṡ = ȧ i ṡ = ȧ f f i ṡ = ȧ i ṡ = ȧ i f p = mapu(c, f) p = mapu(c, f ) p = mapu(c, f ) where f (ȧ i ) = ȧ i = f (f(ȧ i )) c = c ν p = ν p
System Modeling Untimed MoC 45 s = ȧ i Merge of Scan Processes g w i g s = ȧ i w i s = ȧ i g f s = ȧ i (w i, w i ) p = scanu(γ, g, w 0 ) p = scanu(γ, g, w 0) p = mealyu(γ, g, f, v 0) where γ (v i ) = γ(w i) v 0 = (v 0, v 0) = (w 0, w 0) g ((v i, v i )), ȧ i) = (v i+1, v i+1 ) = (g(v i, ȧ i ), g (v i, v i)) f ((v i, v i ), ȧ i) = v i
System Modeling Untimed MoC 46 ṡ = ȧ i Merge of Mealy Processes g w i ṡ = ȧ i f g f ṡ = ȧ i w i ṡ = ȧ i ṡ = ḃi g f (w i, w i ) p = mealyu(γ, g, f, w 0 ) p = mealyu(γ, g, f, w 0) p = mealyu(γ, g, f, v 0) where v 0 = (v 0, v 0) = (w 0, w 0) g ((v i, v i ), ȧ i) = (v i+1, v i+1 ) = (g(v i, ȧ i ), g (v i, f(v i, ȧ i )) f ((v i, v i ), ȧ i) = ȧ i = f (v i, f(v i, ȧ i )) γ (v i ) = γ(w i)
System Modeling Untimed MoC 47 Process Merge Example s 3 A 4 s 2 A 3 sin s A 1 1 A 2 s out s in s 3 s 2 A 4 A 3 s 1 A 1 A 2 A 2 s out s in s 3 s 2 A 4 A 23 A 1 s 1 A 2 s out
System Modeling Untimed MoC 48 Process Merge Example - cont d A 2 = mealyu(γ 2, g 2, f 2, 0) where γ 2 = 1 f 2 (( x, y 1, y 2, y 3, y 4, y 5 ), 0) = xy 1, xy 2, xy 3, xy 4, xy 5 g 2 (x, 0) = 0 A 3 = mealyu(γ 3, g 3, f 3, w 0 ) where w 0 = 10 γ 3 = 5 f 3 (x, w i ) = w i g 3 ( x 1, x 2, x 3, x 4, x 5, w i ) = w i 1 if x 1 + x 2 + x 3 + x 4 + x 5 > 500 w i + 1 if x 1 + x 2 + x 3 + x 4 + x 5 < 400 otherwise w i
System Modeling Untimed MoC 49 Process Merge Example - cont d A 23 = mealyu(γ, f, g, (0, w 0 )) where γ((0, w i )) = 1 i N 0 g(ȧ i, (0, w i )) = (0, g 3 (f 2 (ȧ i, 0), w i )) f(ȧ i, (0, w i )) = f 3 (f 2 (ȧ i, 0), w i ) A 23 = mealyu(γ, f, g, w 0 ) where γ(w i ) = 1 i N 0 g (( x, y 1, y 2, y 3, y 4, y 5 ), 0) = w i 1 if y 1 + y 2 + y 3 + y 4 + y 5 > 500/x = w i + 1 if y 1 + y 2 + y 3 + y 4 + y 5 < 400/x w i otherwise f (x, w i ) = w i
System Modeling Untimed MoC 50 s Merge of Processes with a Rational Match p 1 p 2 ν p1 ν p 1 ν p2 ν s p 2 ν p3 ν s p 3s s Processes p 1 and p 2 for a rational match match(p 1, p 2 ) = ν p 1 (i) ν p2 (i) = ϱ 2 ϱ 1 with ϱ 2, ϱ 1 N with no common integer divisor. Processes uprate(p 1, ϱ 1 ) and uprate(p 2, ϱ 2 ) form a perfect match. They can be merged: p 3 = (uprate(p 2, ϱ 2 )) (uprate(p 1, ϱ 1 )) with p 3 ν p3 (i) = ϱ 1 1 j=0 ν p1 (iϱ 1 + j) ν p 3 (i) = ϱ 2 1 j=0 ν p 2 (iϱ 2 + j).
System Modeling Untimed MoC 51 Untimed Process Networks and Petri Nets k 0 k 1 k 3 k 4 k 5 k 7 A 0 A 1 A 2 A 4 k 2 k 6 k 8 k 9 A 3 t 0 p 0 t 1 t p t 4 1 2 p 2 k 1 k 3 k 4 k 5 k 7 k 0 k 2 p 4 k 6 p 3 k 9 k 8 t 3
System Modeling Untimed MoC 52 Processes with Rational Matches as Petri Nets ν A 1 1 ν 2 A 2 t 1 t 2 k 1 k 2 (a) (b) A process network in (a) can be represented by the Petri net in (b) if ν 1 (i) ν 2 (i) = k 1 k 2 for all i N 0.
System Modeling Untimed MoC 53 Processes with Data Dependent Partitioning as Petri Nets t 1 t p 3 2 k 1 l 1 p 1 p 3 t 4 p k 2 l 7 k 2 1 t 2 t 5 t 6 p 4 p k 5 2 p 6
System Modeling Untimed MoC 54 Synchronous Data Flow Definition: Synchronous Data Flow (SDF) is an untimed model of computation where all processes define only constant partitionings for all their input and output signals, i.e. all partitioning functions are constant; all process signatures are constant.
System Modeling Untimed MoC 55 An SDF Network as Petri Net k 0 k A 0 A 3 k 5 1 A 2 A 4 k 1 k 4 k 7 k 2 k 6 k 8 k 9 A 3 t 0 p 0 t 1 p 1 t 2 p 2 t 4 p 4 p 3 t 3 k i = 1 i
System Modeling Untimed MoC 56 The Incidence Matrix of an SDF Network t 0 p 0 t 1 p 1 t 2 p 2 t 4 p 4 p 3 t 3 A = k 0 0 0 0 0 k 1 k 3 0 0 k 2 0 k 4 k 5 k 6 0 0 0 0 k 8 k 9 0 0 k 7 0 0 = 1 0 0 0 0 1 1 0 0 1 0 1 1 1 0 0 0 0 1 1 0 0 1 0 0 Rows correspond to transitions; columns to places.
System Modeling Untimed MoC 57 Evolution of an SDF Network t 0 p 0 t 1 p 1 t 2 p 2 t 4 p 4 p 3 t 3 x = x 0 + ( u 0 + u 1 + u 2 + u 3 + u 4 ) A 1 0 0 0 0 1 1 0 0 1 = [0, 0, 0, 0, 1] + [1, 1, 1, 1, 1] 0 1 1 1 0 0 0 0 1 1 0 0 1 0 0 = [0, 0, 0, 0, 1] + [0, 0, 0, 0, 0] = [0, 0, 0, 0, 1]
System Modeling Untimed MoC 58 SDF Networks and Scheduling SDF represents an important class of applications; Important implementation problems are scheduling and buffer dimensioning; There exist necessary and sufficient conditions for the existence of periodic, static schedules; There exists an algorithm to construct a periodic, sequential schedule; There exists an algorithm to construct a periodic, parallel schedule.
System Modeling Untimed MoC 59 Single Processor Schedule Definition: s is a signal connecting the output of process A to the input of process B. The initial buffer condition of s is the number of events in s before A and B are executed the first time. The number of events buffered in s is the number of events initially in s or produced by executions of A but not yet consumed by B. An admissible, sequential schedule φ is a non-empty sequence of processes such that if the processes are executed in the sequence given by φ the number of events buffered in any signal will remain non-negative and bounded. A periodic, admissible, sequential schedule (PASS) is a periodic and infinite admissible sequential schedule. It is specified by a list φ that is the list of processes executed in one period.
System Modeling Untimed MoC 60 A Schedule as Transition Sequence A schedule φ is represented by φ = t i, t k,...,. The firing of transition t i is represented by vector u i. The firing vector q φ represents the schedule φ, i.e. q φ = t i φ u i. φ can only be a PASS if q φ A = 0
System Modeling Untimed MoC 61 SDF Schedule Example 1 t 1 p 1 t 2 [ q φ A a = [q 1, q 2 ] 2 3 A a = 2 3 ] [ 2 3 ] = 0 2q 1 3q 2 = 0 A periodic schedule requires an infinite number of solutions, which are represented by the smallest, strictly positive integer solutions for q 1 and q 2 : q 1 = 3 and q 2 = 2 Possible schedules are: φ = [t 1, t 1, t 1, t 2, t 2 ] or φ = [t 1, t 1, t 2, t 1, t 2 ].
System Modeling Untimed MoC 62 SDF Schedule Example 2 p 1 t 1 t 2 2 3 p 2 4 6 A b = [ 2 4 3 6 ] [ q φ A b = [q 1, q 2 ] 2 4 3 6 ] = 0 2q 1 3q 2 = 0 4q 1 + 6q 2 = 0 These two equations are not independent and the smallest, strictly positive solution is q 1 = 3 and q 2 = 2
System Modeling Untimed MoC 63 SDF Schedule Example 3 p 1 t 1 t 2 2 3 p 2 4 3 A c = [ 2 4 3 3 ]. [ q φ A c = [q 1, q 2 ] 2 4 3 3 ] = 0 2q 1 3q 2 = 0 4q 1 + 3q 2 = 0 The only solution is q 1 = 0 and q 2 = 0
System Modeling Untimed MoC 64 The Rank Test Theorem: For a connected SDF process network with N t processes and its corresponding incidence matrix A, rank(a) = N t 1 is a necessary condition for a PASS to exist. The rank of a matrix gives the number of independent equations. If the rank would not be N t 1 any periodic schedule would accumulate tokens in one or more places. A positive rank test result guarantees the existence of a schedule with bounded token numbers in all places. A positive rank test does not guarantee that there are always sufficient tokens available for the next transition to fire.
System Modeling Untimed MoC 65 Initial Buffer Conditions p 1 t 1 t 2 2 3 p 2 4 6 The rank test is positive. x 0 = [0, 0]: deadlock x 0 = [3, 0]: deadlock after t 2, t 1 x 0 = [6, 0]: valid PASS: φ = [t 2, t 2, t 1, t 1, t 1, t 1 ]
System Modeling Untimed MoC 66 Computing the Initial Buffer Conditions 1. Find an arbitrary, positive, non-zero integer vector q such that q A = 0. (a) There exists a vector v = [v 1,..., v Nt ] with v A = 0, v 1 = 1, all v i 0, 1 i N t, and all v i are rational numbers with their numerators and denominators are mutually prime. (b) Find η N 0, the least common multiple of all denominators of v i. (c) q = η v. 2. Select an arbitrary schedule φ with each transition firing as often as given by q. 3. We execute one cycle of φ starting from an empty marking and allowing negative markings. We memorize the most negative marking of each place. 4. After the full cycle of φ the most negative marking, multiplied by 1, defines the initial buffer condition for each place.
System Modeling Untimed MoC 67 Initial Buffer Conditions - Example p 1 t 1 t 2 2 3 p 2 4 6 A b = [ 2 4 3 6 ] 1. Find q such that q A = 0. (a) 2v 1 3v 2 = 0 4v 1 + 6v 2 = 0 We set v 1 = 1 and derive v 2 = 2/3. (b) η = 3 (c) η v = 3[1, 2/3] = [3, 2] = q 2. φ = t 1, t 1, t 1, t 2, t 2 3. x 0 = [0, 0] x 3 = x 2 + u 1 A = [6, 12] x 1 = x 0 + u 1 A = [2, 4] x 4 = x 3 + u 2 A = [3, 6] x 2 = x 1 + u 1 A = [4, 8] x 5 = x 4 + u 2 A = [0, 0] 4. Initial buffer conditions: 0 for p 1, 12 for p 2.
System Modeling Untimed MoC 68 Multi Processor Schedule - Assumptions Homogeneous resources; Constant number of resources; Communication is ignored;
System Modeling Untimed MoC 69 Periodic, Admissible, Parallel Schedule Definition: Given is an SDF process network and n resources. A periodic, admissible, parallel schedule (PAPS) is a periodic and infinite admissible sequential schedule for each of the resources available such that the data dependencies between the processes are respected. It is specified by a list {ψ 1,..., ψ n }, where ψ i is a sequential schedule for processor i. 1. Compute a PASS schedule. 2. Determine a PASS unroll factor J, i.e. how many PASS cycles form a single PAPS cycle. 3. Construct a precedence graph. 4. Compute the PAPS based on the Hu-level algorithm.
System Modeling Untimed MoC 70 2. Determine the Unroll Factor J p 1 t 1 p 2 t 3 p 5 p 4 p 3 A possible PASS is φ = t 1, t 1, t 2, t 3. t 2 Processor 1 t 3 t 3 t 1 t 3 Processor 2 t 1 t 1 t 2 t 1 t 1 t 2 t 1 t 2 0 1 2 3 4 time units 0 1 2 3 4 time units (a) J = 1 (b) J = 2
System Modeling Untimed MoC 71 3. Construct Precedence Graph p 1 t 1 p 2 t 3 p 5 p 4 p 3 t 1 1 t 2 1 t 1 3 (a) J = 1 t 1 2 t 2 t 1 1 t 2 1 t 3 1 t 1 t 2 2 3 (b) J = 2 t 1 2 t 4 1 t 2 3
System Modeling Untimed MoC 72 Precedence Graph Annotated with Hu-levels 3 t 1 1 2 3 t 2 1 3 t 1 3 t 1 2 6 t 1 1 5 3 t 1 2 6 t 2 1 3 t 6 3 1 2 t 1 t 3 3 2 2 t 4 1 t 2 3 (a) J = 1 (b) J = 2 Processors with runtime(t 1 ) = 1, runtime(t 2 ) = 2, runtime(t 1 ) = 3;
System Modeling Untimed MoC 73 A Three Processor Schedule with J = 2 Processor 3 t 1 3 t 1 3 Processor 2 t 2 1 t 2 1 Processor 1 t 1 1 t 1 1 t 1 2 0 1 2 3 4 (a) Step 1 5 6 time units 0 1 2 3 4 (b) Step 2 5 6 time units Processor 3 t 1 3 t 2 3 t 1 3 t 2 3 Processor 2 t 2 1 t 4 1 t 2 1 t 4 1 Processor 1 t 1 1 t 1 2 t 3 1 t 1 1 t 1 2 t 3 1 t 2 2 0 1 2 3 4 5 6 0 1 2 3 4 5 6 time units time units (c) Step 3 (d) Step 4
System Modeling Untimed MoC 74 Summary Untimed Model of Computation Process instantiation Process composition Type and signature of processes Merging of processes Untimed process network as Petri net (SDF) Schedling and buffer analysis of SDF networks