1 / 9

# Algorithmic Software Verification - PowerPoint PPT Presentation

Algorithmic Software Verification. II. Modeling using FSA. Finite state machines. FSM = ( , X, {D x } {x  X} , Q, Q_in,  , δ )  finite set of actions X finite set of variables D x domain of x, for each x in X

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.

## PowerPoint Slideshow about 'Algorithmic Software Verification' - inigo

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

### Algorithmic Software Verification

II. Modeling using FSA

FSM = (, X, {Dx} {x  X} , Q, Q_in, , δ )

 finite set of actions

X finite set of variables

Dxdomain of x, for each x in X

Q finite set of states

Q_in  Q set of initial states

 For each q  Q,

(q) is a function that maps

each x in X to an element in Dx

δ  Q x  x Q transition relation

EFSM = (, X, {Dx} {x  X} , L, L_in, G_in, δ )

 finite set of actions

X finite set of variables

Dxdomain of x, for each x in X

L finite set of control locations

L_in  Q set of initial locations;

G_in predicate over X

transition relation:

l -- a, g(X), A(X)  l’ where a is in .

g(X) – guard

A(X) – assgn

FSM where Dx = { T, F }.

Each state is hence of the form

(l, v), where v: X  {T, F}

Given FSM M, a target set T, call DFS(q_in)

DFS ( q )

for each q’ such that q –a q’

do if q’ is in T,

print “Target found” ; halt.

else if q’ is not in Set_of_Visited_States

DFS(q’)

Given FSM M and specification FSM S,

Is every behaviour of M a behaviour of S?

L(M) L(S)

Solvable in Pspace /

Linear in M and exponential in S.

M1 = (1, X1, {Dx} {x  X1} , Q1, Q_in1, δ1)

M2 = (2, X2, {Dx} {x  X2} , Q2, Q_in2, δ2)

where X1 and X2 are disjoint

M = M1 x M2

(1  2, X1  X2, {Dx} {x  X1} {Dx} {x  X2} ,

Q1 x Q2, Q_in1 x Q_in2, δ)

(q1, q2 ) --a (q1’, q2’) iff

q1 –a q1’ and q2 –a q2’ a  1 2

q1 –a q1’ and q2=q2’ a  1

q2 –a q2’ and q2=q2’ a  2

3 cannibals and 3 missionaries are on the left side of a river.

There is 1 boat that can carry two people.

(The boat of course needs to be ferried by at least one person).

If at any point, there are more cannibals than missionaries on

one bank, the cannibals eat the missionaries.

1. Model all the possibilities of movement between

the banks using an EFSM. The EFSM should

have at least two locations, one for the configurations

where the boat is on the left bank, and one for

configurations where it is on the right.

Also, model it such that checking whether all of them can

get safely across to the right side reduces to reachability

in the model.

• Model the same situation now using component machines… one for each cannibal, one for each missionary, and one for the boat.

Aim for a clean model that is simple and scalable

(i.e. easily changeable if one wants more missionaries/cannibals).

(Forget solving the puzzle using reachability).