ECE-548 Sequential Machine Theory

advertisement
Morphisms of State Machines
Sequential Machine Theory
Prof. K. J. Hintz
Department of Electrical and Computer
Engineering
Lecture 7
Updated and adapted by Marek
Perkowski
Notation
A relation

A function

A binary operation called multiplication
A binary operation called addition
Therefore

For all

There exists

Proper subset

Subset


+
Free SemiGroup
The free semigroup generated by the set 
+
is the set of all strings (words) from 
where
 =
 symbols 
This is equivalent to I *
String or Word
Given
 = a nonempty set
then
a string is a finite sequence of elements from 
e.g .,
 1 2 ,  2 4 ,  1 7 , etc.
Concatenation
Given
, a nonempty set
and
 1  n ,  1'  m'  
then
 1  n   1'  m'  
 1   n 1'  m'  
is the concatenat ion of two strings
Partition of a Set
• Properties
  A   p | p  P  A  
and,
a) p are disjoint,
b)
 p  A,
i
c) pi  
• pi are called “pi-blocks” of a partition, (A)
Types of Relations
•
•
•
•
•
1. Partial, Binary, Single-Valued System
2. Groupoid
3. SemiGroup
4. Monoid
5. Group
Partial Binary Single-Valued
If
R :S S  S
i.e.,   s1 , s2 , s3 R
such that
R is a partial function
i.e., s3 is unique  single - valued
and
 s1 , s2  S  S
i.e., proper subset  partial & D  R   S
Groupoid
• Closed Binary Operation
• Partial, Binary, Single-Valued System with
 s1, s2   S
i.e., D  R   S
• It is defined on all elements of S x S
• Not necessarily surjective
arguments
a
a a
b c
c c
Also:
b
b
a
a
c
a
b
c
a(ba) = ac = a
(ab) a = ba = c
value
Surjective: each y
in the R has at least
one x in the D
a  bc    ab  c  a, b, cS
SemiGroup
• An Associative Groupoid
– Binary operation, e.g., multiplication
– Closure
a  bc    ab  c  a, b, cS
– Associative
• Can be defined for various operations, so
sometimes written as
 S,  
a
a a
b b
c c
b
b
c
a
c
c
a
b
Closed Binary Operation
• Division Is Not a Closed Binary Operation
on the Set of Counting Numbers
6/3 = 2 = counting number
2/6 = ? = not a counting number
• Division Is Closed Over the Set of Real
Numbers.
Monoid
Semigroup With an Identity Element, e.
a
a a
b b
c c
b
b
c
a
c
c
a
b
 aA
ea  a
ae  a
ee  e
Group
Monoid With an Inverse
e, a, b  A
a  a 1  e  identity element or unit element
e must be the same e as defined in monoid
i.e.,
a e  a
0 1 2
a
a a
b b
c c
b
b
c
a
c
c
a
b
a
a a
b b
c c
b
b
c
a
c
c
a
b
Operation is
modulo
addition. Check
that this is a
group
‘Morphisms’
Homomorphism
“A correspondence of a set D (the domain) with a set
R (the range) such that each element of D
determines a unique element of R [single-valued]
and each element of R is the correspondent of at
least one element of D.“
and...
Homomorphism continued
“If operations such as multiplication, addition,
or multiplication by scalars are defined for
D and R, it is required that these
correspond...”
and...
Example: Homomorphism of groups
“If D and R are groups (or semigroups) with
the operation denoted by * and
x corresponds to x’ and
y corresponds to y’
then
x * y must correspond to x’ * y’ “
Product of Correspondence = Correspondence of product
Homomorphism
Note that homomorphism can
map many elements to one.
But homomorphic properties
must be preserved in the range
Homomorphism preserves correspondence
• Correspondence must be
– Single-valued: therefore at least a partial
function
– Surjective: each y in the R has at least one
x in the D
– Non-Injective: not one-to-one else
isomorphism
Endomorphism
• Question: What is endomorphism?
• Answer: An endomorphism is a ‘morphism’
which maps back onto itself
• The range, R, is the same set as the domain, D,
e.g., the real numbers.
‘morphism’
R=D
SemiGroup Homomorphism
Given semigroups
 D,   and  R, + 
and a function
f :D  R
then
f is a semigroup homomorphi sm
iff
f  x   f  y  f  x  y 
Operation in
range
Operation in
domain
Graphical Explanation of
Homomorphism of Semi-Groups
Operation in range
Operation in
domain
Homomorphism of Semi-Groups. Example*
let D = e, g, g 2 ,, g 7 with multiplica tion, 
and R = 0,1, 2, 3  with addition, +
f (e) = 0
f (g) = 1
f ( g2 ) = 2
f ( g3 ) = 3
f g
4
 0
f  g 5  1
f  g 6  2
f  g 7  3
*Larsen, Intro to Modern Algebraic Concepts, p. 53
Ask a student to draw operations in
domain and range and then show this
homomorphism graphically
Homomorphism of Semi-Groups. Example*
Is the relation
• single-valued?
– Each symbol of D maps to only one symbol of R
• surjective?
– Each symbol of R has a corresponding element in D
• not-injective?
– e and g4 correspond to the same symbol, 0
Homomorphism of Semi-Groups. Example*
Do the results of operations correspond?
e. g., let
x  g2
then
x  y = g6
 
f g6  2
and
y  g4
 
same
f g4   0
f g2  + f g4  = 2 + 0 = 2
f g2  2
\Homomorphism of Monoids
Given semigroups with identity elements
 D,   and  R, + 
and a function
f :D  R
then
f is a monoid homomorphi sm
iff
f  x   f  y   f  x  y  and f  e   e'
Isomorphism
• An Isomorphism Is a Homomorphism
Which Is Injective
• Injective: One-to-One Correspondence
– A relation between two sets such that pairs can
be removed, one member from each set until
both sets have been simultaneously exhausted
Graphical illustration of
Isomorphism of Semi-Groups
Injective Homomorphism
Example of function Log being
Isomorphism of two semi-groups
• Define two groupoids
– non-associative semigroups
– groups without an inverse or identity element
• SG1:
A1 = { positive real numbers }
*1 = multiplication = *
• SG2:
A2 = { positive real numbers }
*2 = addition = +
*Ginzberg, pg 10
Example of function Log being
Isomorphism
of
two
semi-groups
Isomorphism Example
(continued)
then
  log is an isomorphis m
since
  xy     x     y 
log  xy   log  x   log  y 
Graphical illustration of this
SemiGroup Isomorphism
Machine Isomorphisms
• Formally, it should be called Machine Inputoutput isomorphism, but usually abbreviated
to just isomorphism
• An I/O isomorphism exists between two
machines, M1 and M2 if there exists a triple
   , , 
where
 , ,
alpha
and . . .
are bijective (required for isom.)
Machine Isomorphisms (cont)
alpha
iota
 : S1  S2
 : I1  I 2
 : O2  O1 note the reverse order of the subscripts
such that
 sS1
  i1   i2
   1  s1 , i1     2    s1 ,  i1  
1  s1 , i1      2    s1 ,  i1     o1
and
Machine Isomorphisms (cont)
delta
Interpret  1  s1 , i1 
1  s1 , i1 

x1  1 y1  z1

x2  2 y 2  z 2
Machine state
isomorphism
therefore
 1 with
1 with
 S  I  and  S  is a semigroup
 S  I  and  O is a semigroup
where
M1 =  S1 , I1 , O1 ,  1 , 1

M2 =  S 2 , I 2 , O2 ,  2 ,  2

Two machine isomorphisms should be introduced, for states and for outputs
Machine
output
isomorphism
Machine State Isomorphism
Machine Output Isomorphism
Homo- vice Iso- Morphism
Reduction Homomorphism
• Shows behavioral equivalence between machines of
different sizes
• Allows us to only concern ourselves with minimized
machines (not yet decomposed, but fewest states in
single machine)
• If we can find one, we can make a minimum state
machine
Homo- vice Iso- Morphism
Isomorphism
• Shows equivalence of machines of
identical, but not necessarily minimal, size
• Shows equivalence between machines with
different labels for the inputs, states, and/or
outputs
Block Diagram Isomorphism
2
I1
I2

I1
2
M2
M1
 1 1
O2

O1
O1
Block Diagram Isomorphism
Block Diagram Isomorphism
  s1   s2
  s1   s2
O1    O2

O1     2  s2 , i2  
=    2    s1 ,  i1   
which is the same as the preceding state
diagram and block diagram definitions
therefore M1 and M2 are Isomorphic to each
other
Information in Isomorphic
Machines
• Since the Inputs and Outputs Can Be
Mapped Through Isomorphisms Which Are
Independent of the State Transitions, All of
the State Change Information Is Maintained
in the Isomorphic Machine
• Isomorphic Machines Produce Identical
Outputs
Output Equivalence
Let  : M 1  M 2
i.e., an I/O isomorphis m
then  s  S1
and  x  I1*
the output strings of M 1 are equivalent to the output
strings of  - M 2 - 
1*  s1 , x   *    s1 , x
which is

=  *   2*  s2 ,  *  x

Output strings of one machine are equivalent to output strings of
other machine
Identity Machine Isomorphism
 id : M 1  M 2
Let
 : SS
Al three are identity
functions
 : II
 : O O
i.e., all elements of the isomorphis m are identity functions
Inverse Machine Isomorphism
Let
    , ,   : M 1  M 2
then
 1    1 , 1 ,  1  : M 2  M 1
For there to exists a  1
 , ,  must be bijective, i.e., injective and surjective
Machine Equivalence
Let M 1 , M 2 , M 3 be isomorphic machines
then,
M M
reflexive
M1  M 2  M 2  M1
symmetric
M 1  M 2 and M 2  M 3  M 1  M 3 transitive
which we recognize as the properties of an equivalence
relationship, i. e., machine isomorphism is an
equivalence relationship defined on M
Remember: machine isomorphism is an equivalence relation
defined on M
Machine Homomorphism
Let
    , ,   : M1  M2
then  is an I/O Homorphis m of M1 into M2
iff
 : S1  S2
i.e., many to one
 : I1  I 2
 : O2  O1
note reverse order of subscripts
are functions  sS1 , i I1 , oO2
and 
Machine Homomorphism
 2    s ,  i       1 s, i  
   2    s ,  i     1  s, i 
• If alpha is injective, then have isomorphism
– “State Behavior” assignment, M 1  M 2
– “Realization” of M1
• If alpha not injective
– “Reduction Homomorphism” M 1 < M 2
Behavioral Equivalence of
two State Machines
Two machines, M1 and M2 are behavioral ly
equivalent
iff
I1  I 2
O1  O2
and
R  S1  S 2
for which 
Behavioral Equivalence
D  R   S1
R  R   S2
and if
s1 R s2
then  x I1 *
1*  s1 , x    2*  s2 , x 
Homework Problem
• Take an arbitrary machine M and minimize it to
machine M2 which has less states.
• Next specify the homomorphism between
Machine M and Machine M2 that corresponds to
the relation of combining compatible states.
• To specify this homomorphism use the
formalisms and notations from this lecture.
Download