1. Automata - CIS @ Temple University

Download Report

Transcript 1. Automata - CIS @ Temple University

1. Automata
CIS 5513 - Automata and Formal Languages – Pei Wang
Abstract machines
Automata: machines, devices, or systems
described abstractly for the purpose of
computability
Focus: common features of different devices, as
well as their limitations
Abstraction: internal activity as transitions
through discrete states; external interaction as
streams of symbols
Examples
 An
on/off switch
 A pocket calculator that computes the value of
arithmetic expressions
 A lexical analyzer that recognizes certain
keywords
In principle, any software or hardware can be
analyzed as an automaton, though such an
analysis only answers certain questions
Automata and formal languages
The external features of automata can be
described as formal languages
A formal language is defined as a set of
symbolic sentences
The patterns of the sentences of a formal
language can be summarized into a grammar
or expression
There is a correspondence between automata
and formal languages
String and word
An alphabet is a finite, nonempty set of symbols,
usually written as ∑ (sigma), such as {0, 1} or
{a, b, …, z}
A string (word) is a finite sequence of symbols
chosen from some alphabet, such as 01001,
cis, or ϵ (epsilon, empty string)
The length of a string is the number of symbols
in it, so |01001| = 5, |ϵ| = 0
Strings
 ∑k
is the set of all strings of length k formed by
symbols in ∑
 ∑* is the set of all strings of any finite length
formed by symbols in ∑ (Kleene star)
 ∑* = ∑0  ∑1  ∑2  …
 ∑ + = ∑ 1  ∑2  …
Let x and y be strings, then xy is their
concatenation, and |xy| = |x| + |y|
Formal languages
A language over ∑ is a subset of ∑*. E.g.:
Problems and languages
In mathematics and computer science, a
“problem” is often defined as a function from
input to output
In principle, a function problem can be
converted into a decision problem that only
has “yes/no” answers
So to solve a problem means to decide whether
a given string belongs to a particular language
Languages and automata
Example: Lp over {0, 1} consisting of all binary
strings whose value as a binary number is a
prime, so 101 belongs to the language, but not
1001 and 0101
An automaton accepts a language by
transitioning into some special states for the
instances of the language
So each automaton solves a problem
Mathematical proofs
Mathematical conclusions (theorems) are
obtained by proofs
 Deductive proof: to build a sequence of
sentences, each is either an axiom or can be
derived from axioms and proven theorems
 Proof by contradiction: to negate a statement
and derive a contradiction from it
 Mathematical induction: starting from a base,
to extend the conclusion step by step to infinite