7/7/20161 Formal Methods in software development a.a.2015/2016 Prof.Anna Labella
7/7/ The metaphore of abstract machine An automaton is given by a (finite) set of states S; an initial state s 0 and (one or more) terminal one Transitions labeled via a finite alphabet A transition law : S x S
7/7/ The metaphore of abstract machine Automata are characterized through the “accepted” language i.e. through the possible sequences of elements from the alphabet going from the initial state to the terminal state
7/7/ Finite State Automata
7/7/ Finite State Automata Coffee machine A 1 : Coffee machine A 2 : Are the two machines ”the same”? 1€ tea coffee 1€ tea coffee 1€
7/7/ The metaphore of abstract machine In the previous slide the two structures are equivalent automata because the language accepted by the first one can be proved equal to the language accepted by the second one
7/7/ The algebra of languages * is the free monoid generated by the alphabet P( *) is a boolean algebra, but also a domain It is a monoid w.r.t. concatenation (Frobenius product)
7/7/ The free monoid generated by A
7/7/ Boolean algebra
7/7/ Frobenius product Frobenius product distributes over sum (union)
7/7/ The algebra of languages We are able to define iteration on P( *)
7/7/ The algebra of languages We are able to define iteration on P(A*)
7/7/ Theorems Languages accepted by finite states automata correspond to regular expressions Regular expressions are generated by right linear grammars, which are continuous operators on P( *) The language associated with a right linear grammar is the minimal solution of a recursive equations system We can extend the result to context free grammars (push down automata)
7/7/ Examples Let us take the automaton a It accepts the language a* defined by the grammar X = a X | or via the recursive equation x = ax+1 as its minimal solution (Tarski’s theorem)
7/7/ More generally The recursive equation x = ax+b defines a continuous function P( *) P( *) and has a*b as its minimal solution (Tarski’s theorem)
7/7/ grammar equations system Minimal solution X ∞ = a*ba* Y ∞ = 0
7/7/ From automata to reactive systems They are supposed to go on forever as Communication protocols Operative systems Command and control devices
7/7/ Their features Synchronous vs asynchronous Communication Observability Non determinism vs determinism
7/7/ Transition systems TS=( ,S, , S 0 ), where – a non empty finite alphabet –S a non empty finite set of states – S S is a transition relation, –S 0 S is the set of initial states Similar to a nondeterministic finite state automaton, with possibly more than one initial state, but without terminal states Similar to a labeled Kripke model as we have seen in temporal logic
7/7/ A transition system generates (finite or infinite) words w 0 w 1 w 2... iff there are states s 0 s 1 s 2 s 3... s.t. s 0 S 0 and (s i,w i,s i+1 ) A state is identified through the possibilities it offers to go on termination and deadlock
7/7/ Example: a recorder 1. ={up, dn} 2. S={off, tape, memory, play} 3. ={(off,dn,tape), (tape,up,off), (tape,dn,memory), (memory,up,off), (memory,dn,play), (play,dn,tape), (play,up,off)} 4. S 0 ={off} off memorytapeplay dn up
7/7/ Parallel transition systems Parallel transition system T=(T 1,…,T n ) –each T i is a transition system –S i S j = interleaving semantics –on its private alphabet, each T i can make an independent move –synchronization is via common events example: power switch and camcorder mode
7/7/ Example T=(switch, camera) {pwr_fail, pwr_res} are private to camera synchronization alphabet {up,dn} how big is the state space? but_hi but_lo dn up off on dn, pwr_res up, pwr_fail memorytape play dn on switch camera dn
7/7/ The global transition system T associated with a parallel transition system (T 1,…,T n ) is defined as T=( , S, , S 0 ), where – = i –S= S 1 … S n –S 0 = S 1,0 … S n,0, and –((s 1,…,s n ),a,(s 1 ‘,…,s n ‘)) iff for all T i if a i, then ((s i ),a,(s i ‘)) i, and if a i, then s i =s i ‘. ((s 1,…,s n ),a,(s 1 ‘,…,s n ‘)) iff for all T i –If a is the result of a synchronisation of ((s i ),a i,(s i ‘)) i and ((s ji ),a j,(s j ‘)) j, then then s k =s k ‘ for all k≠i,j