Automata. Summary Deterministic Automata  Languages Stochastic Automata Other Automata Formalisms  Automata with input and output Protocol Representation.

Slides:



Advertisements
Similar presentations
Language and Automata Theory
Advertisements

YES-NO machines Finite State Automata as language recognizers.
Modeling & Simulation. System Models and Simulation Framework for Modeling and Simulation The framework defines the entities and their Relationships that.
Markov Chains.
ECE 4450:427/527 - Computer Networks Spring 2015
 1  Outline  performance measures for a single-server station  discrete-event simulation  hand simulation  process-oriented simulation approach.
ECE 877-J Discrete Event Systems 224 McKinley Hall.
Classification of Simulation Models
61 Nondeterminism and Nodeterministic Automata. 62 The computational machine models that we learned in the class are deterministic in the sense that the.
Equivalence, DFA, NDFA Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 2 Updated and modified by.
1 Performance Evaluation of Computer Networks Objectives  Introduction to Queuing Theory  Little’s Theorem  Standard Notation of Queuing Systems  Poisson.
CSC 361Finite Automata1. CSC 361Finite Automata2 Formal Specification of Languages Generators Grammars Context-free Regular Regular Expressions Recognizers.
Lab 01 Fundamentals SE 405 Discrete Event Simulation
Finite State Machines Data Structures and Algorithms for Information Processing 1.
Languages and Machines Unit two: Regular languages and Finite State Automata.
Simulation Output Analysis
(C) 2009 J. M. Garrido1 Object Oriented Simulation with Java.
Finite-State Machines with No Output
1 Performance Evaluation of Computer Networks: Part II Objectives r Simulation Modeling r Classification of Simulation Modeling r Discrete-Event Simulation.
Network Analysis A brief introduction on queues, delays, and tokens Lin Gu, Computer Networking: A Top Down Approach 6 th edition. Jim Kurose.
Generalized Semi-Markov Processes (GSMP)
Probability Review Thinh Nguyen. Probability Theory Review Sample space Bayes’ Rule Independence Expectation Distributions.
CMPS 3223 Theory of Computation
Basics of automata theory
CSC312 Automata Theory Lecture # 2 Languages.
ETM 607 – Discrete Event Simulation Fundamentals Define Discrete Event Simulation. Define concepts (entities, attributes, event list, etc…) Define “world-view”,
Entities and Objects The major components in a model are entities, entity types are implemented as Java classes The active entities have a life of their.
Dr. Eng. Farag Elnagahy Office Phone: King ABDUL AZIZ University Faculty Of Computing and Information Technology CPCS 222.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 3 Mälardalen University 2010.
Generalized Semi- Markov Processes (GSMP). Summary Some Definitions The Poisson Process Properties of the Poisson Process  Interarrival times  Memoryless.
Interconnect simulation. Different levels for Evaluating an architecture Numerical models – Mathematic formulations to obtain performance characteristics.
Interconnect simulation. Different levels for Evaluating an architecture Numerical models – Mathematic formulations to obtain performance characteristics.
ECE 466/658: Performance Evaluation and Simulation Introduction Instructor: Christos Panayiotou.
CS433 Modeling and Simulation Lecture 06 – Part 02 Discrete Markov Chains Dr. Anis Koubâa 11 Nov 2008 Al-Imam Mohammad.
Copyright © Curt Hill Finite State Automata Again This Time No Output.
Mathematical Preliminaries
CS433 Modeling and Simulation Lecture 07 – Part 01 Continuous Markov Chains Dr. Anis Koubâa 14 Dec 2008 Al-Imam.
CONCURRENT SIMULATION: A TUTORIAL Christos G. Cassandras Dept. of Manufacturing Engineering Boston University Boston, MA Scope of.
Lecture #2 How to describe a hybrid system? Formal models for hybrid system João P. Hespanha University of California at Santa Barbara Hybrid Control and.
OPERATING SYSTEMS CS 3530 Summer 2014 Systems and Models Chapter 03.
Chapter 3 Regular Expressions, Nondeterminism, and Kleene’s Theorem Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction.
Recognising Languages We will tackle the problem of defining languages by considering how we could recognise them. Problem: Is there a method of recognising.
Finite State Machines 1.Finite state machines with output 2.Finite state machines with no output 3.DFA 4.NDFA.
Introduction to discrete event systems
(C) J. M. Garrido1 Objects in a Simulation Model There are several objects in a simulation model The activate objects are instances of the classes that.
CDA6530: Performance Models of Computers and Networks Chapter 8: Statistical Simulation ---- Discrete Event Simulation (DES) TexPoint fonts used in EMF.
Modeling Computation: Finite State Machines without Output
UNIT - I Formal Language and Regular Expressions: Languages Definition regular expressions Regular sets identity rules. Finite Automata: DFA NFA NFA with.
R. Johnsonbaugh Discrete Mathematics 5 th edition, 2001 Chapter 10 Automata, Grammars and Languages.
CS433 Modeling and Simulation Lecture 11 Continuous Markov Chains Dr. Anis Koubâa 01 May 2009 Al-Imam Mohammad Ibn Saud University.
1 Section 13.1 Turing Machines A Turing machine (TM) is a simple computer that has an infinite amount of storage in the form of cells on an infinite tape.
Finding Regular Simple Paths Sept. 2013Yangjun Chen ACS Finding Regular Simple Paths in Graph Databases Basic definitions Regular paths Regular simple.
1 Turing Machines and Equivalent Models Section 13.1 Turing Machines.
CS151 Introduction to Digital Design Chapter 5: Sequential Circuits 5-1 : Sequential Circuit Definition 5-2: Latches 1Created by: Ms.Amany AlSaleh.
Petri-Nets and Other Models
Overview of Previous Lesson(s) Over View  A token is a pair consisting of a token name and an optional attribute value.  A pattern is a description.
December 3, 2009Theory of Computation Lecture 21: Turing Machines III 1 Simulation of T in L Now the MIDDLE section of Q can be generated by replacing.
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen.
Random Variables r Random variables define a real valued function over a sample space. r The value of a random variable is determined by the outcome of.
Simulation Examples And General Principles Part 2
Discrete-Event System Simulation in Java. Discrete Event Systems New dynamic systems New dynamic systems Computer and communication networks Computer.
1 Chapter Pushdown Automata. 2 Section 12.2 Pushdown Automata A pushdown automaton (PDA) is a finite automaton with a stack that has stack operations.
Deterministic Finite-State Machine (or Deterministic Finite Automaton) A DFA is a 5-tuple, (S, Σ, T, s, A), consisting of: S: a finite set of states Σ:
9. Principles of Reliable Data Transport – Part 1
Language and Automata Theory
ECE 4450:427/527 - Computer Networks Spring 2017
Getting Connected (Chapter 2 Part 3)
Queueing Theory Chapter 1
Performance evaluation of manufacturing systems
What is it? The term "Automata" is derived from the Greek word "αὐτόματα" which means "self-acting". An automaton (Automata in plural) is an abstract self-propelled.
Presentation transcript:

Automata

Summary Deterministic Automata  Languages Stochastic Automata Other Automata Formalisms  Automata with input and output Protocol Representation with Finite State Automata (FSM) Timed Automata

Deterministic Automaton X is the state space E is the event set associated with G f: X  E  X is the transition function  f(x,e)=y means that when G is at state x and event e occurs then G transitions to y Γ is the feasible event set.  For every state x, Γ(x) is the set of all events that are active x 0 is the initial state X m is the set of marked states and is a subset of X

Example: Computer Basic Functions Design an automaton that describes the basic functions of a computer: down, waiting, processing State space  D : down, I : Idle, B : Busy Event set  f : failure, r : repair, a : job arrival, c : job completion Feasible event sets  Γ(D)={r,a}, Γ(I)={a, f}, Γ(B)={f, a, c}  Alternatively Γ(I)={a} (computer cannot fail when idle) Transition functions  p(D, r)= I, p(D, a)=D  p(I, a)= B, p(I, f)= D  p(B, f)= D, p(B, a)= B, p(B, c)= I. Initial state x 0 = I

Example: Automaton Graphical Representation a c a a f r f IB D

Languages Generated by Automata a c a a f r 12 3 A language is a set of a finite length event strings to marked states L={a, aa, aaa, …, ac, aac, aca, acaa, ar, aar, ara,…}

Example: Automaton Graphical Representation a c a a f f IB D Now it is possible to create a deadlock. D is an absorbing state Suppose that the technician has resigned and it is no longer possible to fix the computer.

Example: Queueing What is an automaton model for simple FIFO queueing system? State space  X={0, 1, 2, 3, …} Event set  E={a, d}  a : customer arrival,  d : customer departure Feasible event sets  Γ(0)={a},  Γ(x)={a, d}, x > 0 Transition functions  f(x, a)= x+1  f(x, d)= x-1, if x > 0 Initial state x 0 = 0 ad State transition diagram a d a d a d a d … 0123

Non-Deterministic Automaton A non-deterministic automaton is similar to the deterministic except  f nd : may probabilistically transition to a set of states.  x 0 the initial state may also be a set of states. Example a b ba 12 3

Equivalent Deterministic Automaton For each non-deterministic automaton there is an equivalent automaton that generates the same language. a b ba 12 3 L={a, b, ab, ba. aba, bab, abab, baba, ababa, …} a b ab 12 3

Automata with Inputs/Outputs Each state “emits” an output symbol that is noted on the state Alternatively, each transition is marked with the event that triggers the transition and below it lists the actions that are taken as a result of the transition a c bd s1s1 s2s2 s3s a/s 2 b/s 2 c/s 3 d/s 1

Example of FSM Model for Protocol Verification (Stop and Wait Protocol) The transmitter sends a frame and stops waiting for an acknowledgement from the receiver (ACK) Once the receiver correctly receives the expected packet, it sends an acknowledgement to let the transmitter send the next frame. When the transmitter does not receive an ACK within a specified period of time (timer) then it retransmits the packet. Timer TransmitterReceiver Frame 0 Frame 1 ACK 0 ACK 1 Frame 0 ACK 0

FSM for Stop and Wait Protocol Transmitter Ack 1 Received Pkt 0 transmitted Ack 0 Received Pkt 1 transmitted Timeout or Ack 0 Received Timeout or Ack 1 Received Send Pkt 0 Send Pkt 1 Wait Ack 1 Wait Ack 0

FSM for Stop and Wait Protocol Receiver Pkt 0 received Send Ack 0 Pkt 1 received Send Ack 1 Pkt 0 Received Pkt 1 Received Wait Pkt 1 Wait Pkt 0 Send Ack 1 Send Ack 0

Timed Automata Models So far, the models we studied did not consider the time when an event occurred. For dynamic systems, the sample path of the system is specified by the sequence of pairs {(e i,t i )} where e i is the i -th event and t i is the time that the event has occurred. Timed automata are similar to the deterministic automata with the addition of a clock structure V is the clock structure X m (the set of marked states) is omitted for simplicity

Simple Example Assume a system with a single event, i.e., E={a} and Γ(x)={a} for all x  X. We are interested for the sequence {(e i, t i )} where e i is the i -th event and t i is the time when e i occurs. t1t1 e 1 = a t k-1 e k-1 = a tktk e k = a t2t2 e 2 = a … t time vkvk zkzk ykyk v k = t k -t k-1 is the event lifetime z k = t - t k-1 is the age of event y k = t k - t is the residual lifetime

Simple Example with Two Events that are Always Feasible Assume a system with two events, i.e., E={a, b} and Γ(x)={a, b} for all x  X. In addition we are given the sequences v a ={v a,1, v a,2,… }, v b ={v b,1, v b,2,… }, t1t1 e 1 = a time a b va1va1 vb1vb1 a b va2va2 yb1yb1 t2t2 e 2 = b a b ya2ya2 vb2vb2 t3t3 e 3 = b a b ya3ya3 vb3vb3 t4t4 e 4 = a x0x0 x1x1 x2x2 x3x3 x4x4 …

Example with Two Events that are NOT Always Feasible Assume that in the previous example that Γ(x)={a,b} for x  {x 0, x 2, x 4 } Γ(x)={b} for x  {x 1, x 3, } t1t1 e 1 = a time a b va1va1 vb1vb1 b yb1yb1 t2t2 e 2 = b a b va2va2 vb2vb2 t3t3 e 3 = b a b ya2ya2 vb3vb3 t4t4 e 4 = b x0x0 x1x1 x2x2 x3x3 x4x4 …

The Score of an Event The score N ik of an event i  E after the k th state transition on a given sample path is the number of times that i has been activated (not occurred). t1t1 e 1 = a time a b va1va1 vb1vb1 a b va2va2 yb1yb1 t2t2 e 2 = b a b ya2ya2 vb2vb2 t3t3 e 3 = b a b ya3ya3 vb3vb3 t4t4 e 4 = b x0x0 x1x1 x2x2 x3x3 x4x4 … N a0 = N b0 =1 N a1 = 2 N b1 =1 N a2 = N b2 =2

The Event Timing Dynamics Notation  x is the current state  e is the event that caused the system to go into state x  t is the time that the corresponding event occurred  e ’ is the next event (triggering event) (clearly e ’  Γ(x) )  t ’ is the next event time (corresponding to e ’ )  x ’ is the next state given by x ’ = f(x, e ’ ).  N ’ i is the next score of event i  y ’ i is the next clock value of event i (after e ’ occurs)

The Event Timing Dynamics Step 1: Given x evaluate the feasible event set Γ(x) Step 2: From the clock value y i of all events i  Γ(x) determine the minimum clock value y*= min i  Γ(x) {y i } Step 3: Determine the triggering event e ’ = arg min i  Γ(x) {y i } Step 4: Determine the next state x ’ = f(x, e ’ )  where f() is the state transition function.

The Event Timing Dynamics Step 5: Determine t ’ = t + y * Step 6: Determine the new clock values Step 7: Determine the new event scores

State Space Model The automaton timing dynamics can also be represented as a dynamical system … INPUT OUTPUT The initial conditions are given by x 0, N i,0 =1 for all i  Γ(x 0 ) and N i,0 =0 for all i  Γ(x 0 ) and y i = v i,1 for all i  Γ(x 0 ). What represents the state variables of the system?

Example: Queueing Model State space  X={0, 1, 2, 3, …} Event set  E={a, d}  a : customer arrival,  d : customer departure Feasible event sets  Γ(0)={a},  Γ(x)={a, d}, x > 0 Transition functions Initial state x 0 = 0 ad Clock structure  V a ={0.5, 0.5, 1.0, 0.5, 2.0, 0.5, …}  V d ={1.0, 1.5, 0.5, 0.5, 1.0, …}  In general, the numbers of the clock structure are generated by a Random Number Generator

Example: Queueing Model time a b 0.5 Clock structure  V a ={0.5, 0.5, 1.0, 0.5, 2.0, 0.5, …}  V d ={1.0, 1.5, 0.5, 0.5, 1.0, …} t=0t=0.5t=1t=1.5t=2t=2.5t=3t=3.5t=4t=4.5t=5

The Event Scheduling Scheme INITIALIZE EVENT CALENDAR e1e1 t1t1 e2e2 t2t2 … CLOCK STRUCTURE TIME STATE Update State x ’ =f(x,e 1 ) Update Time t ’ =t 1 Delete Infeasible Events Add New Feasible Events

Recall the Queueing System from Introduction System Input System Dynamics t u1(t)u1(t) t u2(t)u2(t) t x(t)x(t)

Time Driven vs. Event Driven Simulation Models Time Driven Dynamics Event Driven Dynamics State is updated only at the occurrence of a discrete event In this case, time is divided in intervals of length Δt, and the state is updated at every step

Example: Two Queues in Series Determine the automaton that describes the following network where the B 1 and B 2 have finite capacities of 3 and 2 packets respectively (including the customer in the server) When a customer departs from B 1 when B 2 is full, then the customer is lost! B1B1 B2B2 State x = [x 1, x 2 ] where x i denotes the number of customers in B i

State space  X={[x 1, x 2 ] : x 1 = 0,…,3, x 2 = 0, 1, 2} Event set  E={a, d 1, d 2 } Feasible event sets  Γ([0,0])= {a}, Γ([0, x])={a, d 2 } if x > 0, Γ([x, 0])= {a, d 1 } if x > 0,  Γ([x 1, x 2 ])= {a, d 1, d 2 } if x 1 > 0 and x 2 > 0. Transition functions Initial state x 0 = [0,0]. Example: Two Queues in Series ad2d2 B1B1 B2B2 d1d1

Communication Link How would you model a transmission link that can transmit packets at a rate G packets per second and has a propagation delay equal to 100ms? B1B1 B2B2 B1B1 … ?

Exercise Write a simulation program that imitates the behavior of the network shown below.  The inputs to your program are the capacities of each buffer as well as the clock structure (three vectors with the lifetimes of each event)  The output from your program is the sample path of the network i.e., the state trajectory and/or a “trace” consisting of a sequence of events and its corresponding time. B1B1 B2B2 ad1d1 d2d2

Example: Two Class FIFO Buffer Assume the queueing model shown below. The arrival process consists of two classes of customers (in general n classes) and each class has different priority as well as different service requirements. B1B1 a1a1 a2a2 d Define the following string operations  Concatenation: [a 1,a 2,…,a m ] + [a m+1 ]= [a 1,a 2,…,a m, a m+1 ]  Reduction: [a 1,a 2,…,a m ]\[a j ] = [a 1,…, a j-1, a j+1,…a m ]  Head Reduction : [a 1,a 2,…,a m ]\1= [a 2,…,a m ]

Example: Two Class FIFO Buffer Event Set  E={ a 1,a 2, d } State Space:  X ={ x : {ε}  { all possible permutations of a 1 and a 2 with length 0,…,K} }  K is the buffer size Feasible Event set  Γ(ε)={a 1,a 2 } and Γ(x)={a 1,a 2,d} for all other states x Transition Functions  f(x, a 1 )= x + {a 1 }  f(x, a 2 )= x + {a 2 }  f(x, d)= x\1 for all x  {ε}. Initial State : x 0 = ε.

Exercise Consider the two class FIFO buffer from the previous example and determine how you would simulate the following policies Threshold policy (with threshold B < K )  When a high priority customer arrives (e.g. a 1 ), it is accommodated as long as there is enough buffer space, i.e., as long as |x| < K where |x| is the “cardinality” of the set x, (the number of elements in x or 0 if x=ε ).  When a low priority customer arrives (e.g. a 2 ), it is accommodated only if the number of customers currently in the queue does not exceed B, i.e., as long as |x| < B. Push-out Policy  When a low priority customer arrives, it is accommodated if |x| < K.  When a high priority customer arrives, it is accommodated at the end of the queue if |x| < K. However, if |x| = K then, the last low priority customer from the queue (if one is present) is removed and the new customer is accommodated the at the tail of the queue.

Single Queue Simulation Pseudo-code InitializeSimulator(); While !end_of_simulation  event= GetNextEvent();  time= event(time);  Switch(event(type)) case ‘a’: onArr(); case ‘d’: onDep();  EndSwitch; EndWhile; ad onArr()  first=UpdateState();  ActivateNextArr();  If(first) ActivateNextDep(); End onDep()  empty=UpdateState();  If(!empty) ActivateNextDep(); End