Algorithmic Software Verification II. Modeling using FSA.

Slides:



Advertisements
Similar presentations
Model Checking Lecture 3. Specification Automata Syntax, given a set A of atomic observations: Sfinite set of states S 0 Sset of initial states S S transition.
Advertisements

Cooperating Intelligent Systems
Part VI NP-Hardness. Lecture 23 Whats NP? Hard Problems.
Problem Solving Well-formed predicate calculus expressions provide a means of describing objects and relations in a problem domain and inference rule.
Algorithmic Software Verification VII. Computation tree logic and bisimulations.
1 Chapter 4:Constraint Logic Programs Where we learn about the only programming concept rules, and how programs execute.
1 SE-561 Formal Methods in Software Petri Nets - I.
Hybrid Systems Presented by: Arnab De Anand S. An Intuitive Introduction to Hybrid Systems Discrete program with an analog environment. What does it mean?
Merged Processes of Petri nets Victor Khomenko Joint work with Alex Kondratyev, Maciej Koutny and Walter Vogler.
CSC 423 ARTIFICIAL INTELLIGENCE
SEARCH ALGORITHMS David Kauchak CS30 – Spring 2015.
SEARCH APPLICATIONS David Kauchak CS30 – Spring 2015.
A RTIFICIAL I NTELLIGENCE Problem-Solving Solving problems by searching.
Artificial Intelligence
What is an algorithm? Informally: An Algorithm is a step by step method for solving a problem. It’s purpose is to break a larger task down so that each.
Toy Problem: Missionaries and Cannibals
Problem solving by Searching Problem Formulation.
Intelligent agents Intelligent agents are supposed to act in such a way that the environment goes through a sequence of states that maximizes the performance.
Intelligent agents Intelligent agents are supposed to act in such a way that the environment goes through a sequence of states that maximizes the performance.
Dr Eleni Mangina – COURSE: LOGIC PROGRAMMING (during a joint degree with Fudan University in Software Engineering) DEPT. OF COMPUTER SCIENCE UCD Problem.
1 Formal Engineering of Reliable Software LASER 2004 school Tutorial, Lecture1 Natasha Sharygina Carnegie Mellon University.
Problem Solving. What is a Problem? An ambiguous situation not clearly showing how to reach the goal. Given Initial Situation Desired Goal Situation What.
State-Space Searches. 2 State spaces A state space consists of –A (possibly infinite) set of states The start state represents the initial problem Each.
1 Problem Solving We view many situations in life as problems we need to solve Also, much of human behavior can be considered problem solving, even if.
start 3 missionaries and 3 cannibals Cannibal & Cannibal Missionary & Missionary Cannibal & Missionary Which one we should move first You lose True.
State-Space Searches.
02/06/05 “Investigating a Finite–State Machine Notation for Discrete–Event Systems” Nikolay Stoimenov.

Completing the Square.
Finite State Machines Chapter 5. Languages and Machines.
Deterministic Finite State Machines Chapter 5. Languages and Machines 2.
Algorithmic Software Verification III. Finite state games and pushdown automata.
Unsolvability and Infeasibility. Computability (Solvable) A problem is computable if it is possible to write a computer program to solve it. Can all problems.
State-Space Searches. 2 State spaces A state space consists of A (possibly infinite) set of states The start state represents the initial problem Each.
Algorithmic Software Verification V &VI. Binary decision diagrams.
Model construction and verification for dynamic programming languages Radu Iosif
Computational theory techniques in interactive video games.
Problem solving by search Department of Computer Science & Engineering Indian Institute of Technology Kharagpur.
Pg. 301/308/311 Homework Study #8right 2; x = 2#10reflect y; right 5; x = 5 #12right 4/3; up log 2 3; x = 4/3#14reflect x; left 3; down 2; x = -3 #16D:
Linear Equations  Know your rules for solving equations  If fractions, multiply through by LCD  Distribute values to parentheses  What you do on one.
2.1 Solving One Step Equations. Addition Property of Equality For every real number a, b, and c, if a = b, then a + c = b + c. Example 8 = For every.
Objective: To solve multi-step inequalities Essential Question: How do I solve multi-step inequality? Example #1 : solving multi-step inequalities 2x −
1 Solving Problems by Searching. 2 Terminology State State Space Goal Action Cost State Change Function Problem-Solving Agent State-Space Search.
 3.5 More on Linear Equations Objective: solve more complicated equations that have variables on both sides.
Exponential Growth and Decay 6.4. Slide 6- 2 Quick Review.
Solve Linear Systems by Substitution January 28, 2014 Pages
Knowledge Representation Fall 2013 COMP3710 Artificial Intelligence Computing Science Thompson Rivers University.
Solving Equations with Variables on Both Sides. Review O Suppose you want to solve -4m m = -3 What would you do as your first step? Explain.
Counterexample-Guided Abstraction Refinement By Edmund Clarke, Orna Grumberg, Somesh Jha, Yuan Lu, and Helmut Veith Presented by Yunho Kim Provable Software.
Knowledge Representation
Problem solving by Searching
Part VI NP-Hardness.
Timed Automata Formal Systems Pallab Dasgupta Professor,
2 Understanding Variables and Solving Equations.
CS 2710, ISSP 2160 Foundations of Artificial Intelligence
Machine Learning Course.
Lesson 12: more on Equations
2) For each of the finite state machines above, use the sets derived in part 1) to produce the following:   i.                  a set of sequences that.
Solving Equations with Variables on Both Sides
Knowledge Representation
Solving Equations with Variables on Both Sides
Artificial Intelligence
Objective The student will be able to:
State-Space Searches.
State-Space Searches.
Equations …. are mathematical sentences stating that two expressions are equivalent.
Example 2B: Solving Linear Systems by Elimination
1. How do I Solve Linear Equations
State-Space Searches.
missionaries-and-cannibals problem
Presentation transcript:

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 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 D x δ  Q x  x Q transition relation

Extended Finite state machines EFSM = ( , X, {D x } {x  X}, L, L_in, G_in, δ )  finite set of actions X finite set of variables D x domain 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

Kripke structure FSM where D x = { T, F }. Each state is hence of the form (l, v), where v: X  {T, F}

Reachability in FSMs is in O(n) Given FSM M, a target set T, call DFS(q_in) DFS ( q ) Add q to Set_of_Visited_States; 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’)

Model checking FSMs 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.

Product FSMs M 1 = (  1, X 1, {D x } {x  X1}, Q 1, Q_in 1, δ 1 ) M 2 = (  2, X 2, {D x } {x  X2}, Q 2, Q_in 2, δ 2 ) where X 1 and X 2 are disjoint M = M 1 x M 2 (  1   2, X 1  X 2, {D x } {x  X1}  {D x } {x  X2}, Q 1 x Q 2, Q_in 1 x Q_in 2, δ) (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

Homework I 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.

Homework I 2.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).