Transcript Document

CS 367: Model-Based Reasoning
Lecture 4 (01/24/2002)
Gautam Biswas
Today’s Lecture
Last Lecture:
 Deterministic
Languages and Automata
 Concept of Blocking
Today’s Lecture:
 Concept
of Blocking
 Non deterministic Automata
 Operations on Automata
Automata
Device for representing language as a set of
well-defined rules
Represented as directed graph: nodes are
states and labeled arcs represent transitions
f : X E  X
X  {x, y, z} E  {a, b, g}
f ( x, a )  x
f ( y, a)  x
f ( x, g )  z
f ( y , b)  y
f ( z , b)  z
f ( z, a)  f ( z, g )  y
Initialstate : x Marked states : x, z
Deterministic Automata
G  ( X , E , f , , x0 , X m )
X : set of states
E : finite set of events associated with transitions
f : X  E  X transition function f ( x, e)  y
 : X  2 E feasible(active) event function
x0 : initial state
X m  X : set of m arkedstates
-- Which states to mark: modeling issue
Deterministic versus non deterministic
Note: f is a partially defined function
 is derived from f
Language generated by Automata
L(G)  {s  E : f ( x0 , s) is defined}
*
Lm (G)  {s  L(G) : f ( x0 , s)  X m }
Automata G1 and G2 are equivalent if
L(G1 )  L(G2 )
and
Lm (G1 )  Lm (G2 )
Examples of Equivalent Automata
Blocking Automata
Automata G can reach state x, but (x) =  and
x  xm
This is called deadlock because no further events
can be executed
System blocks when it enters deadlock state
When we have set of unmarked states that form
strongly connected component – Livelock
States are reachable from one another but there is
no transition out of them
Example of Deadlock and
Livelock
Blocking
Lm (G)  Lm (G)  L(G)
Prefix-closed by defn.
prefix closure
Deadlock  (x) =  and x  xm
X m  X then
Lm (G)  L(G)
Livelock  (can execute event, but not
complete task)
Lm (G)  L(G)
Blocking
Automata G is blocking if
Automata G is non blocking if
Lm (G)  L(G)
Lm (G)  L(G)
Example: Machine Status Check
x0  {0} X m  {4}
5  Error state : livelock occurs at state 5
Nondeterministic Automaton
Gnd  ( X , E  { }, f nd , , x0 , X m )
f nd : X  E  { }  2 X transition function f nd ( x, e)  X
x0 : initial state  X
Languages generated are similar to that of deterministic languages
L(Gnd )  {s  E * : x  x0 f nd ( x, s) is defined}
Lm (Gnd )  {s  L(Gnd ) : x  x0 f nd ( x, s)  X m  }
Extend the domain of fnd to traces of events:
f nd ( x, ue)  {z : z  f nd ( y, e) for somestate y  f nd ( x, u)}
Nondeterministic Automata:
Example
Do nondeterministic automata have more expressive power than deterministic
automata?
No: Any nondeterministic automaton can be transformed into an equivalent
deterministic automaton.
Operations on Automata
Every automata models two languages: L(G), Lm (G)
Notion of Accessibility and Co-accessibility

Accessible Part: notion of deleting states that
are not reachable or accessible from x0
Ac(G )  { X ac , E , f ac , x0 , X ac ,m )
X ac  {x  X : s  E * ( f ( x0 , s )  x)}
X ac ,m  X m  X ac
f ac  f ac | X ac  E  X ac
Ac has no effect on L(G), and Lm (G)
Therefore, always assume G = Ac(G)
Operations on Automata
Coaccessible Part
A state is coaccessible if it can reach a marked
state
 Taking the coaccssible part, means building

CoAc(G )  { X coac , E , f coac , x0,coac , X m )
X coac  {x  X : s  E * ( f ( x, s )  X m )}
x0,coac
 x0

undefined
if x0  X coac
otherwise
f coac  f | X coac  E  X coac
CoAc operation shrinks L(G) G  CoAc(G)  G is coaccessible
L(G)  Lm (G)
but not Lm(G)
Operations on Automaton
An automaton that is accessible and
coaccessible is said to be trim
Trim(G)  CoAc[ Ac(G)]  Ac[CoAc(G)]
Coaccessibility linked to concept of blocking
Blocking L(G)  Lm (G)
Nonblocking  coaccessible
Complement of Trim Automaton
1. Complete the transition function f of G and make it a total
function -- done by adding dead or dump state
2. Change the marking status of all states.
Example of Trim Automaton
Composition of Automata
Two kinds
Product:   completely synchronous
 Parallel:   synchronous

Product Composition
Example: Product Composition
b
Parallel Composition
Parallel Composition: Example
b