Advanced Logic Programming-Languages and Systems (ALPS) UTD Slide- 1 University of Texas at Dallas Neda Saeedloei, Gopal Gupta Verifying Complex.

Slides:



Advertisements
Similar presentations
CS 208: Computing Theory Assoc. Prof. Dr. Brahim Hnich Faculty of Computer Sciences Izmir University of Economics.
Advertisements

C O N T E X T - F R E E LANGUAGES ( use a grammar to describe a language) 1.
Pushdown Systems Koushik Sen EECS, UC Berkeley Slide Source: Sanjit A. Seshia.
1 Mechanical Verification of Timed Automata Myla Archer and Constance Heitmeyer Presented by Rasa Bonyadlou 24 October 2002.
Chapter Two: Finite Automata
1 Languages. 2 A language is a set of strings String: A sequence of letters Examples: “cat”, “dog”, “house”, … Defined over an alphabet: Languages.
Finite Automata Section 1.1 CSC 4170 Theory of Computation.
CS21 Decidability and Tractability
Introduction to Computability Theory
CFG => PDA Sipser 2 (pages ).
1 Introduction to Computability Theory Lecture7: PushDown Automata (Part 1) Prof. Amos Israeli.
CFG => PDA Sipser 2 (pages ). CS 311 Fall Formally… A pushdown automaton is a sextuple M = (Q, Σ, Γ, δ, q 0, F), where – Q is a finite set.
Courtesy Costas Busch - RPI1 Non Deterministic Automata.
1 CSCI-2400 Models of Computation. 2 Computation CPU memory.
Reachability Analysis for Some Models of Infinite-State Transition Systems Oscar H. Ibarra, Tevfik Bultan, and Jianwen Su Department of Computer Science.
1 Finite Automata. 2 Finite Automaton Input “Accept” or “Reject” String Finite Automaton Output.
Foundations of (Theoretical) Computer Science Chapter 2 Lecture Notes (Section 2.2: Pushdown Automata) Prof. Karen Daniels, Fall 2009 with acknowledgement.
January 14, 2015CS21 Lecture 51 CS21 Decidability and Tractability Lecture 5 January 14, 2015.
Finite Automata Costas Busch - RPI.
Fall 2004COMP 3351 Another NFA Example. Fall 2004COMP 3352 Language accepted (redundant state)
Grammars, Languages and Finite-state automata Languages are described by grammars We need an algorithm that takes as input grammar sentence And gives a.
1 Pushdown Automata PDAs. 2 Pushdown Automaton -- PDA Input String Stack States.
1 Non-Deterministic Finite Automata. 2 Alphabet = Nondeterministic Finite Automaton (NFA)
Abstract Verification is traditionally done by determining the truth of a temporal formula (the specification) with respect to a timed transition system.
Finite State Machines Data Structures and Algorithms for Information Processing 1.
CS 3240: Languages and Computation Pushdown Automata & CF Grammars NOTE: THESE ARE ONLY PARTIAL SLIDES RELATED TO WEEKS 9 AND 10. PLEASE REFER TO THE TEXTBOOK.
Timed UML State Machines Ognyana Hristova Tutor: Priv.-Doz. Dr. Thomas Noll June, 2007.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 8 Mälardalen University 2010.
Advanced Logic Programming-Languages and Systems (ALPS) UTD Slide- 1 University of Texas at Dallas L. Simon, A. Bansal, A. Mallya, G. Gupta. Co-Logic.
 Computability Theory Turing Machines Professor MSc. Ivan A. Escobar
Pushdown Automata (PDAs)
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 11 Midterm Exam 2 -Context-Free Languages Mälardalen University 2005.
1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 6 Mälardalen University 2010.
Recognizing safety and liveness Presented by Qian Huang.
Finite Automata – Definition and Examples Lecture 6 Section 1.1 Mon, Sep 3, 2007.
Applied Logic, Programming-Languages and Systems (ALPS) UTD Slide- 1 University of Texas at Dallas Modal Logic Gopal Gupta Department of Computer.
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
Foundations of (Theoretical) Computer Science Chapter 2 Lecture Notes (Section 2.2: Pushdown Automata) Prof. Karen Daniels, Fall 2010 with acknowledgement.
11 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 7 School of Innovation, Design and Engineering Mälardalen University 2012.
CSCI 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Pushdown.
Formal Languages, Automata and Models of Computation
Formal Languages Finite Automata Dr.Hamed Alrjoub 1FA1.
Pushdown Automata Hopcroft, Motawi, Ullman, Chap 6.
Grammar Set of variables Set of terminal symbols Start variable Set of Production rules.
1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 8 Mälardalen University 2011.
Advanced Logic Programming-Languages and Systems (ALPS) UTD Slide- 1 University of Texas at Dallas L. Simon, A. Mallya, A. Bansal, G. Gupta. Extending.
Theory of Computation Automata Theory Dr. Ayman Srour.
Recap: Nondeterministic Finite Automaton (NFA) A deterministic finite automaton (NFA) is a 5-tuple (Q, , ,s,F) where: Q is a finite set of elements called.
Fall 2004COMP 3351 Finite Automata. Fall 2004COMP 3352 Finite Automaton Input String Output String Finite Automaton.
6. Pushdown Automata CIS Automata and Formal Languages – Pei Wang.
Finite Automata.
Formal Languages, Automata and Models of Computation
Languages.
G. Pullaiah College of Engineering and Technology
CIS Automata and Formal Languages – Pei Wang
Non Deterministic Automata
Pushdown Automata PDAs
Pushdown Automata PDAs
Pushdown Automata PDAs
Pushdown Automata PDAs
CSE322 Finite Automata Lecture #2.
Chapter Two: Finite Automata
CSE322 Definition and description of finite Automata
Non Deterministic Automata
Finite Automata.
Pushdown automata a_introduction.htm.
Principles of Computing – UFCFA3-30-1
Pushdown automata The Chinese University of Hong Kong Fall 2011
Lecture One: Automata Theory Amjad Ali
Presentation transcript:

Advanced Logic Programming-Languages and Systems (ALPS) UTD Slide- 1 University of Texas at Dallas Neda Saeedloei, Gopal Gupta Verifying Complex Continuous Real- Time Systems with Coinductive CLP(R) Neda Saeedloei, Gopal Gupta Department of Computer Science The University of Texas at Dallas Richardson, Texas, USA CICLOPS 2009 July 14 th 2009

Advanced Logic Programming-Languages and Systems (ALPS) UTD Slide- 2 University of Texas at Dallas Neda Saeedloei, Gopal Gupta Real-Time Systems Timed automata for specifying real-time systems –Recognize only timed regular languages Pushdown timed automata –Recognize timed context-free languages

Advanced Logic Programming-Languages and Systems (ALPS) UTD Slide- 3 University of Texas at Dallas Neda Saeedloei, Gopal Gupta Motivation constraint logic programming over reals or CLP(R) & Co-induction for modeling timed automata Modeling PTAs with Co-induction and CLP(R) verify safety and liveness properties The Generalized Railroad Crossing problem –Safety –Utility

Advanced Logic Programming-Languages and Systems (ALPS) UTD Slide- 4 University of Texas at Dallas Neda Saeedloei, Gopal Gupta ω-Automata ω-automata over the alphabet Σ is a tuple M= –Q is the (finite) set of states –Q 0 ⊆ Q is the set of initial states –F ⊆ Q is the set of final states –Δ ⊆ Q x Σ x Q is the transition relation Given an infinite string s = s 0 s 1 s 2 …, where s i Є Σ, a derivation is defined as a sequence of transitions q 0 Є Q 0, and (q i-1, s i-1, q i ) Є Δ Notions of acceptance of an infinite string s = s 0 s 1 s 2 … –Bϋchi: ∃q Є F and an infinite set of indices I such that (∀i Є I)(q = q i ). –Mϋller: F Є 2 Q, ∃A Є F, and an infinite set of indices I a for each a Є A such that (∀q Є A) (∀i Є I a )(q = q i ).

Advanced Logic Programming-Languages and Systems (ALPS) UTD Slide- 5 University of Texas at Dallas Neda Saeedloei, Gopal Gupta Timed-Automata A generalization of ω-automata, capable of recognizing infinite words Given a string s = s 0 s 1 s 2 …, Purpose of timed automata is accepting timed words (s i, t i ) Timed automata obtained from ω-automata by adding –a finite set C of clocks –a set P of propositions over C –a labeling function τ c : Δ → 2 C (reset function) –a labeling function τ P : Δ → Prop(P), where prop(A) is the set of propositional formulae over the set of atomic propositions A

Advanced Logic Programming-Languages and Systems (ALPS) UTD Slide- 6 University of Texas at Dallas Neda Saeedloei, Gopal Gupta Pushdown Timed Automata A Pushdown Timed Automaton extends a timed automaton with a stack A PTA is obtained from a timed automaton by adding –ε (empty string) to the input alphabet Σ –a stack alphabet Γ ε = Γ U ε –a stack represented by Γ ε * Acceptance conditions for an infinite string for a PTA –the stack must be empty.

Advanced Logic Programming-Languages and Systems (ALPS) UTD Slide- 7 University of Texas at Dallas Neda Saeedloei, Gopal Gupta Pushdown Timed Automata Example S R S R a {c := 0} T b {c < 20} T a T b T a b {c < 5}

Advanced Logic Programming-Languages and Systems (ALPS) UTD Slide- 8 University of Texas at Dallas Neda Saeedloei, Gopal Gupta Recognizers for ω-PDAs and ω- Grammars. PTAs and timed grammars accept infinite strings. Definite clause grammars (DCGs) extended with co-induction can act as recognizers for ω-PDAs and ω-grammars. –Using DCG facility of prolog to create parser for context-free grammars or even context-sensitive grammars. –extending logic programming with co-induction, to develop language processors that recognize infinite strings.

Advanced Logic Programming-Languages and Systems (ALPS) UTD Slide- 9 University of Texas at Dallas Neda Saeedloei, Gopal Gupta Modeling PTAs with coinductive CLP(R) trans(s0, a, s1, T, Tr, To, _, [1]) :- {To=T}. trans(s1, a, s1, T, Tr, To, C, [1|C]):- {To=Tr}. trans(s1, b, s2, T, Tr, To, [1|C], C):- {T - Tr < 5, To =Tr}. trans(s2, b, s2, T, Tr, To, [1|C], C):- {To=Tr}. trans(s2, b, s0, T, Tr, To, [1|C], C):- {T - Tr < 20,To =Tr}. :-coinductive(driver/6). driver([X| R], Si, C1, Tr, T, [(X, T)| S]) :- trans(Si, X, Sj, T, Tr, To, C1, C2), {Ta > T}, driver(R, Sj, C2, To, Ta, S).

Advanced Logic Programming-Languages and Systems (ALPS) UTD Slide- 10 University of Texas at Dallas Neda Saeedloei, Gopal Gupta The Generalized Railroad Crossing Railroad crossing I lies in a region of interest R, i.e., I ⊆ R. A set of trains travel through R on multiple tracks in both directions. A sensor system determines when each train enters and exits region R. gate function g(t) Є [0, 90], –g(t) = 0 means the gate is down –g(t) = 90 means the gate is up. occupancy intervals: {λ i } The ith occupancy interval: λ i = [τ i, ν i ] Safety Property: t Є U i λ i →g(t) = 0 Utility Property: t ∉ U i [τ i – ξ 1, ν i + ξ 2 ] → g(t) = 90

Advanced Logic Programming-Languages and Systems (ALPS) UTD Slide- 11 University of Texas at Dallas Neda Saeedloei, Gopal Gupta The GRC Problem ε 1, a lower bound on the time from when a train enters R until it reaches I. ε 2, an upper bound on the time from when a train enters R until it reaches I. γ down, an upper bound on the time to lower the gate completely. γ up, an upper bound on the time to raise the gate completely. ξ 1, an upper bound on the time from the start of lowering the gate until some train is in I. ξ 2, an upper bound on the time from when the last train leaves I until the gate is up.

Advanced Logic Programming-Languages and Systems (ALPS) UTD Slide- 12 University of Texas at Dallas Neda Saeedloei, Gopal Gupta GRC Problem 1-Track Generalized Railroad Crossing Problem –One track, unspecified number of trains GRC Problem –Arbitrary number of tracks, unspecified number of trains

Advanced Logic Programming-Languages and Systems (ALPS) UTD Slide- 13 University of Texas at Dallas Neda Saeedloei, Gopal Gupta Track Automaton

Advanced Logic Programming-Languages and Systems (ALPS) UTD Slide- 14 University of Texas at Dallas Neda Saeedloei, Gopal Gupta Gate Automaton

Advanced Logic Programming-Languages and Systems (ALPS) UTD Slide- 15 University of Texas at Dallas Neda Saeedloei, Gopal Gupta Controller Automaton

Advanced Logic Programming-Languages and Systems (ALPS) UTD Slide- 16 University of Texas at Dallas Neda Saeedloei, Gopal Gupta Track Automata ε 1 = 2, ε 2 = 3, γ down = 1, γ up = 2, ξ 1 = 2, ξ 2 = 3 track(s0, approach, s1, GT, TI, TO, L) :- {TO = GT}. track(s1, in, s2, GT, TI, TO, L) :- {GT - TI > 2, GT - TI < 3, TO = TI}. track(s2, approach, s3, GT, TI, TO, L) :- {TO = GT}. track(s4, in, s2, GT, TI, TO, L) :- {GT - TI > 2, GT - TI < 3, TO = TI}. track(s3, exit, s4, GT, TI, TO, L) :- first(L, First), {GT - First < 5, TO = TI}. track(s2, exit, s0, GT, TI, TO, L) :- first(L, First), {GT - First < 5, TO = TI}. track(X, lower, X, GT, TI, TI, L). track(X, down, X, GT, TI, TI, L). track(X,up, X, GT, TI, TI, L). track(X, raise, X, GT, TI, TI, L).

Advanced Logic Programming-Languages and Systems (ALPS) UTD Slide- 17 University of Texas at Dallas Neda Saeedloei, Gopal Gupta Gate Automaton gate(s0, lower, s1, GT, TI, TO) :- {TO = GT}. gate(s1, down, s2, GT, TI, TO) :- {TO = TI, GT - TI < 1}. gate(s2, raise, s3, GT, TI, TO) :- {TO = GT}. gate(s3, up, s0, GT, TI, TO) :- {TO = TI, GT - TI < 2}. gate(X, approach, X, GT, TI, TI). gate(X, in, X, GT, TI, TI). gate(X, exit, X, GT, TI, TI).

Advanced Logic Programming-Languages and Systems (ALPS) UTD Slide- 18 University of Texas at Dallas Neda Saeedloei, Gopal Gupta Controller Automaton contr(s0, approach, C1, C2, s1, GT, TI, TO) :- C2 is C1 + 1, {TO = GT}. contr(s1, lower, C1, C1, s2, GT, TI, TO) :- {GT - TI = 1, TO = TI}. contr(s2, approach, C1, C2, s2, GT, TI, TO) :- C2 is C1 + 1, {TO = TI}. contr(s3, approach, C1, C2, s2, GT, TI, TO) :- C2 is C1 + 1, {TO = TI}. contr(s3, raise, C1, C1, s0, GT, TI, TO) :- {GT - TI < 1, TO = TI}. contr(s2, exit, C1, C2, s3, GT, TI, TO):- C1 = 1, C2 is C1 - 1, {TO = GT}. contr(s2, exit, C1, C2, s2, GT, TI, TO):- C1 > 1, C2 is C1 - 1, {TO = TI}. contr(s2, in,C1,C1,s2,GT,TI,TI). contr(s0,up,C1,C1,s0,GT,TI,TI). contr(s2,down,C1,C1,s2,GT,TI,TI).

Advanced Logic Programming-Languages and Systems (ALPS) UTD Slide- 19 University of Texas at Dallas Neda Saeedloei, Gopal Gupta The driver predicate The driver predicate composes three automata driver(C1,ST,SC,SG,GT,CT,CC,CG,[X|Rest],Resets,[(X,GT)|R]) :- track(ST, X, STO, GT, CT, CTO, Resets), contr(C1, SC, X, C2, SCO, GT, CC, CCO), gate(SG, X, SGO, GT, CG, CGO), {TA > GT}, (X = approach -> add-to-list(GT, Resets, NewResets); (X = exit -> delete-first(Resets, NewResets); NewResets = Resets)), driver(C2,STO,SCO,SGO,TA,CTO,CCO,CGO,Rest,NewResets,R).

Advanced Logic Programming-Languages and Systems (ALPS) UTD Slide- 20 University of Texas at Dallas Neda Saeedloei, Gopal Gupta Safety and Utility Properties firstinbeforedown(X) :- driver(0, s0, s0, s0, 0, 0, 0, 0, X, [], R), append(B, [(in, _) | _], R), append([(approach, 0)], A, B), \+member(down, A). inbeforedown(X) :- driver(0, s0, s0, s0, 0, 0, 0, 0, X, [], R), append(C, [(in, _) | _], R), append(A, B, C), append(_, [(up, _)], A), \+member((down, _), B). utility(X) :- driver(0, s0, s0, s0, 0, 0, 0, 0, X, [], R), append(A, B, R), member([(down, _)], A), \+member((in, _), B).

Advanced Logic Programming-Languages and Systems (ALPS) UTD Slide- 21 University of Texas at Dallas Neda Saeedloei, Gopal Gupta The GRC Problem contr(C1, s1, approach, C2, s1, GT, TI, TO):- C2 is C1 + 1, {TO = TI}.

Advanced Logic Programming-Languages and Systems (ALPS) UTD Slide- 22 University of Texas at Dallas Neda Saeedloei, Gopal Gupta The driver predicate for GRC problem driver(C1, NoTracks, SC, SG, GT, CC, CG, [X|Rest], Tracks, TrkResets, Trains, [(X,Track,GT)|R]):- contr(C1, SC, X, C2, SCO, GT, CC, CCO), gate(SG, X, SGO, GT, CG, CGO), {TA > GT}, ((X = approach, N is NoTracks + 1, random(1, N, Track); (X=in; X=exit), member(Track, Trains))-> nthElement(Track, Tracks, Trk), arg(1, Trk, CT), arg(2, Trk, ST), nthElement(Track, TrkResets, TrkReset), train(Track, ST, X, STO, GT, CT, CTO, TrkReset), update(Track, Tracks, (CTO,STO), NewTracks), (X = approach -> add-to-list(GT, TrkReset, NewTrk), update(Track, TrkResets, NewTrk, NewTrkResets), add-to-list(Track, Trains, NewTrains); (X = exit -> delete-first(TrkReset, NewTrk), update(Track, TrkResets, NewTrk, NewTrkResets), delete-first(Track, Trains, NewTrains); NewTrkResets = TrkResets, NewTrains = Trains)); NewTrkResets = TrkResets, NewTrains = Trains, NewTracks = Tracks), driver(C2, NoTracks, SCO, SGO, TA, CCO, CGO, Rest, NewTracks, NewTrkResets, NewTrains, R).

Advanced Logic Programming-Languages and Systems (ALPS) UTD Slide- 23 University of Texas at Dallas Neda Saeedloei, Gopal Gupta Conclusions Automata based real-time formalisms –Timed automata –Timed transition systems –Discrete pushdown timed automata –Pushdown timed automata with dense clocks Solutions for GRC problem –A solution based on ESTEREL programming languag e Time is discretized The number of trains is chosen at compile time Verifying safety properties is extremely complex –UPPAAL Based on timed automata formalism