Formal Methods in software development

Slides:



Advertisements
Similar presentations
Automata Theory December 2001 NPDAPart 3:. 2 NPDA example Example: a calculator for Reverse Polish expressions Infix expressions like: a + log((b + c)/d)
Advertisements

Language and Automata Theory
Chapter 5: Languages and Grammar 1 Compiler Designs and Constructions ( Page ) Chapter 5: Languages and Grammar Objectives: Definition of Languages.
C O N T E X T - F R E E LANGUAGES ( use a grammar to describe a language) 1.
YES-NO machines Finite State Automata as language recognizers.
Finite Automata Section 1.1 CSC 4170 Theory of Computation.
NFAs Sipser 1.2 (pages 47–54). CS 311 Fall Recall… Last time we showed that the class of regular languages is closed under: –Complement –Union.
Intro to DFAs Readings: Sipser 1.1 (pages 31-44) With basic background from Sipser 0.
Intro to DFAs Readings: Sipser 1.1 (pages 31-44) With basic background from Sipser 0.
Automating Construction of Lexers. Example in javacc TOKEN: { ( | | "_")* > | ( )* > | } SKIP: { " " | "\n" | "\t" } --> get automatically generated code.
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 Non-Deterministic Finite Automata. 2 Alphabet = Nondeterministic Finite Automaton (NFA)
CS/IT 138 THEORY OF COMPUTATION Chapter 1 Introduction to the Theory of Computation.
Theory of Computation, Feodor F. Dragan, Kent State University 1 Regular expressions: definition An algebraic equivalent to finite automata. We can build.
Introduction to CS Theory Lecture 3 – Regular Languages Piotr Faliszewski
Grammars CPSC 5135.
CS 461 – Sept. 19 Last word on finite automata… –Scanning tokens in a compiler –How do we implement a “state” ? Chapter 2 introduces the 2 nd model of.
Regular Grammars Chapter 7. Regular Grammars A regular grammar G is a quadruple (V, , R, S), where: ● V is the rule alphabet, which contains nonterminals.
2G1516 Formal Methods2005 Mads Dam IMIT, KTH 1 CCS: Processes and Equivalences Mads Dam Reading: Peled 8.5.
Grammars A grammar is a 4-tuple G = (V, T, P, S) where 1)V is a set of nonterminal symbols (also called variables or syntactic categories) 2)T is a finite.
CSC312 Automata Theory Lecture # 26 Chapter # 12 by Cohen Context Free Grammars.
1 Language Recognition (11.4) Longin Jan Latecki Temple University Based on slides by Costas Busch from the courseCostas Busch
7/7/20161 Formal Methods in software development a.a.2015/2016 Prof.Anna Labella.
1/29/02CSE460 - MSU1 Nondeterminism-NFA Section 4.1 of Martin Textbook CSE460 – Computability & Formal Language Theory Comp. Science & Engineering Michigan.
1 Regular grammars Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
Chapter 1 INTRODUCTION TO THE THEORY OF COMPUTATION.
Topic 3: Automata Theory 1. OutlineOutline Finite state machine, Regular expressions, DFA, NDFA, and their equivalence, Grammars and Chomsky hierarchy.
Theory of Languages and Automata By: Mojtaba Khezrian.
Deterministic Finite-State Machine (or Deterministic Finite Automaton) A DFA is a 5-tuple, (S, Σ, T, s, A), consisting of: S: a finite set of states Σ:
Chapter 4 Introduction to Set Theory
Language Recognition MSU CSE 260.
Formal Languages, Automata and Models of Computation
Formal Methods in software development
Formal Language & Automata Theory
CIS Automata and Formal Languages – Pei Wang
Non Deterministic Automata
Regular grammars Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
Theory of Languages and Automata
Complexity and Computability Theory I
Natural Language Processing - Formal Language -
Context free grammar.
CSE 105 theory of computation
CS314 – Section 5 Recitation 3
Formal Language Theory
Lecture 9 Theory of AUTOMATA
PARSE TREES.
Language Recognition (12.4)
REGULAR LANGUAGES AND REGULAR GRAMMARS
CSE322 The Chomsky Hierarchy
Regular Grammar.
Regular Expression We shall build expressions from the symbols using simple operations include concatenation, union and kleen closure. Several intuitive.
Non-Deterministic Finite Automata
COSC 3340: Introduction to Theory of Computation
Intro to Data Structures
Non Deterministic Automata
Context-Free Languages
Pushdown automata a_introduction.htm.
CSE322 Regular Expressions and their Identities
Language Recognition (12.4)
Regular grammars Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
Formal Methods in software development
… NPDAs continued.
CSE 105 theory of computation
CSC312 Automata Theory Kleene’s Theorem Lecture # 12
Sub: Theoretical Foundations of Computer Sciences
Regular grammars Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
The Chomsky Hierarchy Costas Busch - LSU.
COMPILER CONSTRUCTION
PZ02B - Regular grammars Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section PZ02B.
CSE 105 theory of computation
Presentation transcript:

Formal Methods in software development a.a.2017/2018 Prof.Anna Labella 2/24/2019

Operational semantics Meaning of program phrases defined in terms of the steps of computation they can take during program execution 2/24/2019

The metaphore of abstract machine An automaton is given by a (finite) set of states S; an initial state s0 and (one or more) terminal one Transitions labeled via a finite alphabet  A transition law : S x   S (maybe a relation) Arbib, Michael A. (1969). Theories of Abstract Automata- Prentice Hall 2/24/2019

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 2/24/2019

Finite State Automata 2/24/2019

Finite State Automata Coffee machine A1: Coffee machine A2: 1€ Coffee machine A1: Coffee machine A2: Are the two machines ”the same”? 1€ tea coffee 1€ 1€ 1€ tea coffee 2/24/2019

The algebra of languages <P(*), , , , Ø, *, , {}> * 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) 2/24/2019

The free monoid generated by A 2/24/2019

Exercises Let us take A = {1}, what is A* ? 2/24/2019

Exercises Let us take A = {1}, what is A* ? Which kind of coding we get? 2/24/2019

Boolean algebra <P(*), , , , Ø, *> 2/24/2019

Frobenius product  Frobenius product distributes over sum (union) 2/24/2019

The algebra of languages We are able to define iteration on P(*) Difficult to axiomatize 2/24/2019

Regular expressions Formulas build from +, . and *, starting from 0, 1 and elements of ∑ Example : a* + a . b* 2/24/2019

Right linear grammars Let us have also non terminal (not belonging to ∑) symbols A right linear grammar is a set of rewriting rules, where single non terminal elements are rewritten into linear polinomial expressions where elements of the alphabet are left coefficients Example: S → aS also written S → aS | ε or S= aS + 1 S → ε 2/24/2019

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) 2/24/2019

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) 2/24/2019

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) In general, every right linear grammar on n non terminal symbols defines a continuous function P(*)n  P(*) n 2/24/2019

Exercises 2/24/2019

We can take more general grammars equations system Minimal solution X∞ = a*ba* Y∞ = 0 2/24/2019

Exercises 2/24/2019