Professional Documents
Culture Documents
Lecture 2 Ex
Lecture 2 Ex
= e
where
if
( )
otherwise
i i
X i
X
p
o o
o
c
e
=
`
)
-Given a Language L over X and an alphabet Y disjoint
from X, the expansion of L is defined as the language
Y
L
l
over
X Y
such that -
*
{{ }| { } , }
i i i i i i
Y
L x x L Y o | o |
l
= e . e
Regular Expressions.
Regular Expressions over alphabet
E
{} is a regular expression
c
is a regular expression
|
i i
o o eE are regular expression
If r and s are regular expressions then
r+s, r s, and
*
r
are regular expressions.
The language associated with a regular expression
is called a regular language.
Theorem: The complement of a regular language
is a regular language
Examples of Regular Expressions
Regular expression a +b stands for {a,b}
Regular expression ab stands for {ab}
Regular expression a* stands for {C,a, aa, aaa, aaaa, }
Alphabet E = {a, b, c}. Language includes all the strings, in
which all occurrences of a appear before all occurrences of b:
(a+c)*(b+c)*
Alphabet E = E
x
E
y
= {00, 01, 10, 11}. Language includes
all the strings appearing as input/output combinations of the
given circuit (reset to 0):
( (00)*(10)(11)*(01) )*
DFF
x y 0 1
00
10
11
01
Classes of Languages
-A language is prefix closed if
*
, ,[ ] L L o o o o o eE eE e e
-A language over
I O E =
is I-progressive if
*
, , [ ] i I o O L io L o o o eE e - e e e
-A language over
I O E =
is I-Moore if
, ( ) , ( ' ')
[ [ ' ' ( ' ) ]]
L io i o
io L i o L i o L
o
o o o
e eE eE
e e e
Examples of Languages
Prefix-closed language includes, with its every string, all the
prefixes of this string.
Example 1: Language a*b* is prefix closed
Example 2: Language a*b is not prefix closed
I-progressive language includes the strings, which, for each
input symbol, have some output symbol
Example 1: Language ( (00)*(10)(11)*(01) )* is I-progressive
Example 2: Language ( (00)*(10)(01) )* is not I-progressive
0 1
00
10
11
01
0 1
00
10
01
Classes of Languages
-A language
*
( ) L I O _
over
I O
is prefix closed if
*
( ) , ,[ ] I O i o I O i o L L o o o e e e e
A language
*
( ) L I O _
over
I O
is IO-progressive if
*
( ) , , ,[ ] I O i I o O L i o L o o o e e - e e e
Composition of Languages
-Given disjoint alphabets I,U,O and languages L
1
over
I U
and L
2
over
U O
, their synchronous composition is
1 2
[( ) ( ) ]
O I I O
L L
| | +
.
-Given disjoint alphabets I,U,O and languages L
1
over
I U
and L
2
over
U O
, their parallel composition is
1 2
[( ) ( ) ]
O I I O
L L
l l
.
Synchronous Composition
Spec is defined over IO
Fixed is defined over IVUO
Unknown should be over UV
The solution to the equation
F - X _ S
is
More specifically
S F X - =
I
O
V U
Fixed
Unknown
F
X
Specification
S
) , ( ) , (
] [ ) , ( ) , , , (
V U U V
O I S O U V I F X
+ |
- =
S F X - =
While synchronous product often is thought to be a simple
even uninteresting type of coordination, it can be shown
that, through the use of non-determinism, this conceptually
simple coordination serves to model the most general
asynchronous coordination, i.e. where processes progress
at arbitrary rates relative to one another. In fact the interleaving
model, the most common model for asynchrony in the software
community, can be viewed as a special case of this synchronous
product
Kurshan, 1994.
Uses non-determinism and self loops with null transitions
at each state to model parallel with synchronous.
Finite Automata
A finite automaton (FA) is
( , , , , ) F S r Q o = E
where S is a set of states,
E
is an input alphabet,
( , ) : 2
S
s S o o E
is a transition relation, r is the initial state, and
Q S _
is the set of accepting states.
An input sequence
*
1
( ... )
n
w w w = eE
leads from r to s if there exists a sequence of states,
0 1
( ... ')
n
r s s s s = =
such that
1
( , )
i i i
s s w o
+
e
for all i = 0, ... ,n-1.
w is in the language of F ( ) ( ) w F eL
if and only if w leads from r to ' s Q e
i.e.
( , ) r w Q o = C where ( , ) r w o
denotes the set of states that can be reached from r
under the input sequence w.
Examples of Finite Automata
Example 1: Language a*b* is prefix closed
Example 2: Language a*b is not prefix closed
X Y
a
b
X Y
a
b
b
Theorem: A languages is regular if and only if it is the
language of a finite automaton
Theorem: The set of all languages for deterministic
FA is the same as for non-deterministic FA.
(we will show how this can be done using the so-
called subset construction.)
Operations on FA.
-projection (
X
F
+
): convert F over X V
into F over X by replacing each edge (xv s s) by the
edge (x s s)
-lifting (
V
F
|
): convert F over X into F over X V
by replacing each edge (x s s) by
( ')
V
x s s where V
): convert F over X V
to F over V, by changing every edge (v s s) where
v V e
into ( )
' s s c
-expansion (
V
F
l
): Change F over X into F over
X V
by adding for each state, a self-loop for all v, i.e. add an edge
( )
V
s s where V