morphisms of state machines sequential machine theory prof. k. j. hintz department of electrical and...

49
Morphisms of State Machines Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 8 Updated and adapted by Marek Perkowski

Upload: giles-matthews

Post on 13-Dec-2015

219 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Morphisms of State Machines Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 8 Updated and adapted

Morphisms of State MachinesMorphisms of State Machines

Sequential Machine Theory

Prof. K. J. HintzDepartment of Electrical and Computer

Engineering

Lecture 8

Updated and adapted by Marek Perkowski

Page 2: Morphisms of State Machines Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 8 Updated and adapted

NotationNotation

A relation

A function

A binary operation called multiplication

A binary operation called addition +

Therefore

For all

There exists

Proper subset

Subset

Page 3: Morphisms of State Machines Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 8 Updated and adapted

Free SemiGroupFree SemiGroup

The free semigroup generated by the set

is the set of all strings (words) from

where

= symbols

This is equivalent to

+

I*

Page 4: Morphisms of State Machines Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 8 Updated and adapted

String or WordString or Word

.,,,

.,

from elements of sequence finitea is stringa

setnonempty a =

Given

714221 etc

e.g

then

Page 5: Morphisms of State Machines Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 8 Updated and adapted

ConcatenationConcatenation

strings twoof ionconcatenat theis

,

setnonempty a ,

Given

''11

''11

''11

mn

mn

mn

then

and

Page 6: Morphisms of State Machines Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 8 Updated and adapted

Partition of a SetPartition of a Set

• Properties

• pi are called “pi-blocks” of a partition, (A)

i

i

P

p

Ap

p

Ap|pA

c)

, b)

disjoint, are a)

and,

Page 7: Morphisms of State Machines Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 8 Updated and adapted

Types of RelationsTypes of Relations

• Partial, Binary, Single-Valued System

• Groupoid

• SemiGroup

• Monoid

• Group

Page 8: Morphisms of State Machines Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 8 Updated and adapted

Partial Binary Single-ValuedPartial Binary Single-Valued

S

SS

SSS:

R

R

R

R

D & partial subsetproper .,.

,

valued-single unique is.,.

function partiala is

,,.,.

21

3

321

ei

ss

and

sei

such that

sssei

If

Page 9: Morphisms of State Machines Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 8 Updated and adapted

GroupoidGroupoid

• Closed Binary Operation

• Partial, Binary, Single-Valued System with

• It is defined on all elements of S x S

• Not necessarily surjective

S

S

RD .,.

, 21

ei

ss

Page 10: Morphisms of State Machines Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 8 Updated and adapted

SemiGroupSemiGroup

• An Associative Groupoid– Binary operation, e.g., multiplication– Closure– Associative

• Can be defined for various operations, so sometimes written as

,S

S cbacbacba ,,

Page 11: Morphisms of State Machines Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 8 Updated and adapted

Closed Binary OperationClosed Binary Operation

• Division Is Not a Closed Binary Operation on the Set of Counting Numbers6/3 = 2 = counting number

2/6 = ? = not a counting number

• Division Is Closed Over the Set of Real Numbers.

Page 12: Morphisms of State Machines Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 8 Updated and adapted

MonoidMonoid

Semigroup With an Identity Element, e.

eee

aea

aae

a

A

Page 13: Morphisms of State Machines Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 8 Updated and adapted

GroupGroup

Monoid With an Inverse

aea

ei

ee

eaa

bae

.,.

monoid in defined as same thebemust

elementunit or element identity

,,1

A

Page 14: Morphisms of State Machines Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 8 Updated and adapted

‘Morphisms’‘Morphisms’

Homomorphism (J&J)“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...

Page 15: Morphisms of State Machines Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 8 Updated and adapted

HomomorphismHomomorphism

“If operations such as multiplication, addition, or multiplication by scalars are defined for D and R, it is required that these correspond...”

and...

Page 16: Morphisms of State Machines Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 8 Updated and adapted

HomomorphismHomomorphism

“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

Page 17: Morphisms of State Machines Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 8 Updated and adapted

HomomorphismHomomorphism

Page 18: Morphisms of State Machines Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 8 Updated and adapted

HomomorphismHomomorphism

• 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

Page 19: Morphisms of State Machines Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 8 Updated and adapted

EndomorphismEndomorphism

• A ‘morphism’ which maps back onto itself

• The range, R, is the same set as the domain, D, e.g., the real numbers.

R=D

‘morphism’

Page 20: Morphisms of State Machines Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 8 Updated and adapted

SemiGroup HomomorphismSemiGroup Homomorphism

yxfyfxf

iff

f

f

smhomomorphi semigroupa is

then

:

functiona and

+, and ,

semigroups Given

RD

RD

Page 21: Morphisms of State Machines Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 8 Updated and adapted

SemiGroup HomomorphismSemiGroup Homomorphism

Page 22: Morphisms of State Machines Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 8 Updated and adapted

SmGp. HmMphsm. Example*SmGp. HmMphsm. Example*

3 3 = )(

2 2 = )(

1 1 = )(

0 0 = )(

+ addition, with 32,1,0,=

tion,multiplica with,,gg,e,=

73

62

5

4

72

gfgf

gfgf

gfgf

gfef

and

glet

R

D

*Larsen, Intro to Modern Algebraic Concepts, p. 53

Page 23: Morphisms of State Machines Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 8 Updated and adapted

SmGp. HmMphsm. Example*SmGp. HmMphsm. 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

Page 24: Morphisms of State Machines Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 8 Updated and adapted

SmGp. HmMphsm. Example*SmGp. HmMphsm. Example*

Do the results of operations correspond?

e g

x g y g

x y g f g

f g f g

f g f g

. ., let

and

then

=

+ = 2 + 0 = 2

2 4

6 2

6 4

2 4

2

2 0same

Page 25: Morphisms of State Machines Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 8 Updated and adapted

Monoid HomomorphismMonoid Homomorphism

' and

smhomomorphi monoida is

:

+, ,

elementsidentity withsemigroups Given

eefyxfyfxf

iff

f

then

f

tionand a func

and

RD

RD

Page 26: Morphisms of State Machines Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 8 Updated and adapted

IsomorphismIsomorphism

• 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

Page 27: Morphisms of State Machines Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 8 Updated and adapted

SemiGroup IsomorphismSemiGroup Isomorphism

Injective Homomorphism

Page 28: Morphisms of State Machines Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 8 Updated and adapted

Isomorphism Example*Isomorphism Example*

• 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

Page 29: Morphisms of State Machines Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 8 Updated and adapted

Isomorphism ExampleIsomorphism Example

yxxy

yxxy

since

then

logloglog

misomorphis an is log

Page 30: Morphisms of State Machines Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 8 Updated and adapted

SemiGroup IsomorphismSemiGroup Isomorphism

Page 31: Morphisms of State Machines Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 8 Updated and adapted

Machine IsomorphismsMachine Isomorphisms

• Input-output isomorphism, but usually abbreviated to just isomorphism

• An I/O isomorphism exists between two machines, M1 and M2 if there exists a triple

and . . .

where

isom.)for (required bijective are ,,

,,

Page 32: Morphisms of State Machines Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 8 Updated and adapted

Machine IsomorphismsMachine Isomorphisms

1112111

112111

211

12

21

21

,,

,,

and s

thatsuch

subscripts theoforder reverse thenote :

:

:

oisis

isis

ii

S

OO

II

SS

Page 33: Morphisms of State Machines Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 8 Updated and adapted

Machine IsomorphismsMachine Isomorphisms

Interpret

, , ,, =

, , ,, =

semigroupa is and with

semigroupa is and with

,

,

222222

11111

1

1

2222111

1111111

OI S

OI S

O IS

SIS

M

M1

where

therefore

zyxis

zyxis

Page 34: Morphisms of State Machines Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 8 Updated and adapted

Machine State IsomorphismMachine State Isomorphism

Page 35: Morphisms of State Machines Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 8 Updated and adapted

Machine Output IsomorphismMachine Output Isomorphism

Page 36: Morphisms of State Machines Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 8 Updated and adapted

Homo- vice Iso- MorphismHomo- 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

Page 37: Morphisms of State Machines Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 8 Updated and adapted

Homo- vice Iso- MorphismHomo- 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

Page 38: Morphisms of State Machines Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 8 Updated and adapted

Block Diagram IsomorphismBlock Diagram Isomorphism

I1 I2 O2 O1M2

M1

2 2

1 1

I1O1

Page 39: Morphisms of State Machines Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 8 Updated and adapted

Block Diagram IsomorphismBlock Diagram Isomorphism

Page 40: Morphisms of State Machines Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 8 Updated and adapted

Block Diagram IsomorphismBlock Diagram Isomorphism

which is the same as the preceding state diagram and block diagram definitions therefore M1 and M2 are Isomorphic to each other

112

222121

2121

,=

,

is

isOss

OOss

Page 41: Morphisms of State Machines Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 8 Updated and adapted

Machine InformationMachine Information

• 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

Page 42: Morphisms of State Machines Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 8 Updated and adapted

Output EquivalenceOutput Equivalence

, =

is which

, ,

- - of strings

output the toequivalent are of stringsoutput the

x and

s then

misomorphis I/O an .,. Let

*2

*2

*

1*

1*1

2

1

*1

1

21

xs

xsxs

M

ei

M

MM

I

S

:

Page 43: Morphisms of State Machines Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 8 Updated and adapted

Identity Machine IsomorphismIdentity Machine Isomorphism

functionsidentity are misomorphis theof elements all .,.

Let

21id

ei

OO

II

SS

:

:

:

:

MM

Page 44: Morphisms of State Machines Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 8 Updated and adapted

Inverse Machine IsomorphismInverse Machine Isomorphism

surjective and injective .,. bijective, bemust ,,

a exists toFor there

,,

then

,,

Let

1

21111

21

ei

1MM

MM

:

:

Page 45: Morphisms of State Machines Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 8 Updated and adapted

Machine EquivalenceMachine Equivalence

Let be isomorphic machines

then,

reflexive

symmetric

and transitive

which we recognize as the properties of an equivalence

relationship, . ., machine isomorphism is an

equivalence relationship defined on

M M M

M M

M M M M

M M M M M M

M

1 2 3

1 2 2 1

1 2 2 3 1 3

, ,

i e

Page 46: Morphisms of State Machines Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 8 Updated and adapted

Machine HomomorphismMachine Homomorphism

,,s functions are

subscripts oforder reverse note

one many to .,.

into of m HomorphisI/O an is

,,

Let

211

12

21

21

21

21

and

oi

OO

II

eiSS

iff

then

OIS

:

:

:

:

MM

MM

Page 47: Morphisms of State Machines Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 8 Updated and adapted

Machine HomomorphismMachine Homomorphism

• If alpha is injective, then have isomorphism– “State Behavior” assignment,

– “Realization” of M1

• If alpha not injective– “Reduction Homomorphism”

isis

isis

,,

,,

12

12

M M1 2

M <M1 2

Page 48: Morphisms of State Machines Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 8 Updated and adapted

Behavioral EquivalenceBehavioral Equivalence

equivalent

ly behavioral are and machines, Two

21

21

21

21

for which

and

iff

SS

OO

II

R

MM

Page 49: Morphisms of State Machines Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 8 Updated and adapted

Behavioral EquivalenceBehavioral Equivalence

xsxs

xthen

ss

and if

,,

*

2*21

*1

1

21

2

1

I

SR

SD

R

R

R