+ All Categories
Home > Documents > TC Reference

TC Reference

Date post: 19-Feb-2018
Category:
Upload: kamilbisma
View: 217 times
Download: 0 times
Share this document with a friend

of 180

Transcript
  • 7/23/2019 TC Reference

    1/180

  • 7/23/2019 TC Reference

    2/180

    w

    --

    -

    --

    --

    --

    -

    --

    ---

    --

    ---

    -

    ----

  • 7/23/2019 TC Reference

    3/180

    Preface

    -----

    -

    --

    -

    ----

    --

    -

    --

    --

    ---

    ----

    --

    ---

    --

    --

    -

    ----

    -

    --

    -

    -

    --

    -

    ---

    --

    --

    --

    -

    --

    ---

    -

    ---

    ---

    ------

    -

    ----

    ---

    --

    -

    -----

    -

    ---

    -

    -

    --

    -----

    -

    ---

  • 7/23/2019 TC Reference

    4/180

    --

    --

    -

    -

    -

    --

    ----

    -

    ----

    vi

    Preface

    Notations

    Z

    -

    -

    X

    Y

    -

    R

    --

    S

    ---

    -

    l

    --

    U

    --

    -

    -

    --

    --

    -

    -

    F

    G

    ^

    -

    ^

    --

    o

    --

    r

  • 7/23/2019 TC Reference

    5/180

    7'

    ---

    5%

    -

    B

    dd

    dd

    F

    --

    f

    --

    --

    ---

    -

    -

    -

    -

    viii

    Notations

    Contents

    -

    --

    -

    --

    --

    --

    -

    --

    --

    --

    ----

    -

    -

    -

    -

    -

    --

    -

    ---

    ---

    ----

    ---

    ---

  • 7/23/2019 TC Reference

    6/180

    ---

    -

    -

    -

    ---

    -

    --

    --

    --

    ----

    -

    --

    -

    -

    --

    -

    -

    --

    -

    ----

    -----

    -

    x

    Contents

    -

    --

    --

    --

    ----

    -

    -

    -

    --

    -

    -

    --

    -

    -

    -

    --

    --

    --

    -

    -

    --

    --

    --

    -

    ----

    -

    -

    -

    ----

    -

    ---

    ----

    Contents

    xi

  • 7/23/2019 TC Reference

    7/180

    --

    -

    -

    --

    ---

    --

    -

    --

    -

    ---

    -

    --

    --

    --

    ----

    -

    ---

    --

    -

    -

    -

    --

    --

    --

    --

    ----

    --

    -

    --

    --

    -

    xii

    Contents

    --

    --

    --

    ----

    -

    --

    -

    -

    -

    --

    --

    --

    ----

    ---

    --

    -

    -

    --

    --

    -

    --

    --

    --

    ----

    --

    --

    -

    -

    -

    Contents

    x

    iii

  • 7/23/2019 TC Reference

    8/180

    Chap

    ter

    0

    Introduction

    0.1

    BASICS

    0.1.1

    Sets

    ----

    ----

    ------

    -

    ---

    -

    -

    -Z

    ---

    -----

    -

    -

    ---

    --

    ---

    -

    ----

    --R

    ----

    -

    ---

    S

    ----

    -

    -

    ---

    -

    --

    T

    --

    Z

    ----

    (a)

    Un

    ion

    --------

    ----

  • 7/23/2019 TC Reference

    9/180

    -

    --

    X

    ---

    X

    R

    R

    X

    (b)

    Intersec

    tion

    ---

    Y---

    --

    Y

    R

    R

    Y

    Y

    (c)

    SetD

    ifference

    ----

    ---

    -

    R

    Q

    (d)

    Com

    plemen

    t

    --

    ---

    Properties

    ofsetoperations

    ----

    ---

    X

    Y

    X

    X

    Y

    Y

    --

    X

    X

    X

    X

    Y

    Y

    Y

    Y

    2

    TheoryofAutomata,FormalLanguagesandComputation

    -

    X

    Y

    Y

    X

    Y

    Y

    X

    X

    Y

    X

    -

    X

    Y

    Y

    X

    --

    X

    Y

    Y

    X

    Example0.1.1:

    X

    Y

    Solution

    R

    X

    B

    R

    Q

    X

    B

    R

    Q

    Q

    B

    R

    Q

    R

    Q

    B

    R

    R

    B

    R

    Y

    X

    S

    Y

    -

    R

    Y

    B

    R

    R

    B

    R

    Q

    R

    Q

    B

    R

    Q

    Q

    B

    R

    Q

    X

    B

    R

    X

    Y

    S

    X

    X

    Y

    Example0.1.2:-------

    Y

    ~

    Y

    Z

    Z

    S

    Solution

    R

    R

    B

    R

    Q

    B

    R

    R

    B

    R

    Y

    ~

    S

    Y

    ~

    Introduction

    3

  • 7/23/2019 TC Reference

    10/180

    -

    R

    Y

    ~

    R

    Y

    ~B

    R

    R

    B

    R

    Q

    B

    R

    Y

    ~

    Y

    Z

    X

    Y

    B

    XZ

    Y

    Z

    B

    -

    X

    Y

    B

    Y

    B

    Y

    Z

    S

    Y

    Y

    B

    Y

    B

    Z

    Z

    Y

    B

    Y

    Z

    B

    Y

    B

    S

    Example0.1.3:--

    X

    X

    X

    X

    Solution

    --

    X

    X

    T

    X

    X

    R

    X

    X

    B

    R

    R

    X

    B

    R

    R

    R

    B

    R

    R

    R

    4

    TheoryofAutomata,FormalLanguagesandComputation

    B

    R

    X

    R

    B

    R

    X

    X

    X

    X

    T

    X

    X

    -

    -

    X

    X

    T

    X

    X

    --

    --

    X

    X

    R

    X

    X

    B

    R

    X

    R

    B

    R

    R

    R

    B

    R

    R

    R

    B

    R

    X

    X

    X

    X

    T

    X

    X

    X

    X

    X

    X

    Example0.1.4:------

    --

    Y

    Y

    Y

    Y

    Solution

    -

    Y

    Y

    T

    Y

    Y

    -

    R

    Y

    Y

    B

    R

    R

    Y

    B

    R

    R

    R

    B

    R

    R

    R

    B

    R

    Y

    R

    B

    R

    Y

    Y

    Y

    Y

    T

    Y

    Y

    -

    Y

    Y

    T

    Y

    Y

    ---

    R

    Y

    Y

    B

    R

    Y

    R

    Introduction

    5

  • 7/23/2019 TC Reference

    11/180

    B

    R

    R

    R

    B

    R

    R

    R

    B

    R

    R

    Y

    B

    R

    Y

    Y

    Y

    Y

    T

    Y

    Y

    Y

    Y

    Y

    Y

    Example0.1.5:----

    X

    ~

    ~Y

    ~

    Y

    ~

    ~X

    ~

    Solution

    R

    X

    ~E

    Q

    X

    E

    Q

    Q

    E

    R

    ~

    R

    ~

    E

    R

    ~Y

    ~

    R

    Y

    ~E

    Q

    Y

    E

    Q

    Q

    E

    R

    ~

    R

    ~

    E

    R

    ~X

    ~

    Y

    ~

    ~X

    ~

    Example0.1.6:---

    -

    -

    X

    X

    Y

    Solution

    X

    X

    X

    Y

    X

    Y

    Y

    ~

    Y

    ~

    X

    Y

    ~X

    ~

    Q

    X

    Y

    ~X

    X

    Y

    ~

    Y

    ~X

    Y

    ~X

    Y

    ~

    X

    Y

    ~

    6

    TheoryofAutomata,FormalLanguagesandComputation

    Y

    ~X

    Y

    ~

    Y

    ~

    Y

    ~

    Z

    X

    Q

    Additiona

    lTerm

    ino

    logy

    --

    -

    Y

    Z

    --

    --

    --

    --

    -

    -------

    ----

    -

    -

    --

    -

    -

    R

    R

    ----

    -

    l

    l

    R

    R

    Example0.1.7:

    -

    Solution

    --

    ---

    -

    Z

    Example0.1.8:

    -

    Solution

    -

    -

    -

    -

    Z

    43 2

    $# "

    Example0.1.9:

    l

    X

    l

    l

    X

    lX

    l

    R

    l

    R

    l

    R

    R

    R

    R

    R

    R

    R

    R

    R

    X

    l

    X

    Introduction

    7

  • 7/23/2019 TC Reference

    12/180

    Example0.1.10:

    l

    l

    l

    l

    Solution

    l

    l

    I

    I

    0.1.2

    RelationsandFunctions

    ----

    --

    --

    R

    -

    R

    ---

    ----

    -

    --

    --

    8

    TheoryofAutomata,FormalLanguagesandComputation

    Se

    tS

    Se

    tT

    a

    b

    c

    d

    e

    w

    xy z

    --

    y z x yx z

    3 4 3 4 3 4 3 4 3 4 3 4

    (1,,

    3)

    x

    (1,,

    4)

    x

    (1,,

    3)

    y

    (1,,

    4)

    y

    (1,,

    3)

    z

    (1,,

    4)

    z

    (2,,

    3)

    x

    (2,,

    4)

    x

    (2,,

    3)

    y

    (2,,

    4)

    y

    (2,,

    3)

    z

    (2,,

    4)

    z

    1 2

    -

    -----

    Equ

    iva

    lence

    Rela

    tion

    --

    l

    -

    ---

    -

    R

    R

    -

    R

    R

    R

    --

    R

    R

    R

    --

    Part

    ialOrdering

    Re

    lations

    -

    -

    -

    --

    -

    --

    -

    }---

    -

    -

    }-

    Part

    ition

    -

    ---

    -

    R

    --

    g

    Y

    Z

    -

    ---

    ---

    -

    -

    --

    -

    R

    -

    --

    Introduction

    9

    a

    b

    c

    d

    e

    w

    x

    y

    z

  • 7/23/2019 TC Reference

    13/180

    ----

    -

    R

    -

    --

    Example0.1.11:

    -

    R

    R

    B

    R

    -

    ---

    Solution

    -

    -

    --

    R

    R

    B

    R

    -

    -

    R

    -

    -

    R

    R

    B

    R

    -

    -

    ---

    R

    R

    --

    R

    R

    B

    R

    B

    R

    -

    -

    -

    --

    --

    B

    --

    -----

    -

    R

    R

    B

    R

    B

    R

    -

    --

    -

    --

    -

    B

    R

    R

    B

    R

    B

    -

    --

    -

    Example0.1.12:

    -

    ---

    Solution

    --

    --

    -

    R

    f

    --

    R

    10

    TheoryofAutomata,FormalLanguagesandComputation

    R

    -

    f

    R

    -

    -

    f

    B

    B

    B

    f

    --

    f

    f

    B

    B

    -

    B

    B

    f

    -

    --

    --

    ---

    -

    Example0.1.13:--

    --

    --

    Solution

    ----

    Example0.1.14:

    -

    ---

    -

    -

    Solution

    --

    R

    Q

    ---

    R

    Q

    ---

    R

    R

    Q

    Introduction

    11

  • 7/23/2019 TC Reference

    14/180

    ---g

    R

    R

    -

    R

    Func

    tions

    -

    ---

    --

    -

    --

    -----

    --

    -

    --

    Func

    tions

    asre

    lations

    r

    -

    --

    l-

    R

    -

    KindsofF

    unc

    tions

    r

    --

    ---

    -

    ~-

    ~

    12

    TheoryofAutomata,FormalLanguagesandComputation

    a b c

    wx

    yz

    a

    b

    c

    d

    e

    w

    x

    y

    z

    r

    --

    --

    r

    -

    -

    -

    -

    -

    -

    -

    --

    r

    --

    -

    -

    r

    --

    Example0.1.15:

    -

    -

    ---

    Solution

    -

    -

    g

    Example0.1.16:

    -

    r

    -

    Introduction

    13

    a

    b

    cd

    w

    x

    y

    z

    a

    b

    c

    d

    e

    w

    x

    y

    z

  • 7/23/2019 TC Reference

    15/180

    Solution

    -

    ---

    -

    Example0.1.17:

    ---

    Solution

    I

    I

    I

    g

    I

    --

    -

    Example0.1.18:

    r

    R

    g

    -

    Solution

    -

    -

    R

    B

    B

    -

    14

    TheoryofAutomata,FormalLanguagesandComputation

    a b c d

    1 2 3

    A

    B

    R

    --

    R

    -

    : 89* ()

    : 89

    * ()

    R

    -

    -

    -

    0.1.3

    Graphsan

    dTrees

    Grap

    hs

    ---

    ----

    --

    -----

    --

    -

    --

    --

    -

    -

    ---

    -----

    -

    -

    ---

    Introduction

    15

    1

    2

    3

    4

  • 7/23/2019 TC Reference

    16/180

    --

    -

    ---

    --

    ---

    --

    ----

    ---

    -

    --

    ---

    ---

    --

    -

    ---

    ----

    16

    TheoryofAutomata,FormalLanguagesandComputation

    -

    ---

    -

    -

    -----

    -

    -----

    -

    -----

    ----

    --

    --

    --

    ----

    -

    Introduction

    17

    F

    E

    DB

    C

    A

  • 7/23/2019 TC Reference

    17/180

  • 7/23/2019 TC Reference

    18/180

    Solution

    R

    ~-

    -

    -

    -

    -

    -

    ---

    ----

    --

    -

    --

    Example0.1.20:--

    --

    Solution

    -

    -

    --

    ------

    i

    --

    20

    TheoryofAutomata,FormalLanguagesandComputation

    Example0.1.21:-----

    R

    R

    --

    R

    Solution

    ---

    I

    I

    Example0.1.22:

    m

    --

    Solution

    -

    r-

    r-

    r------

    Introduction

    21

  • 7/23/2019 TC Reference

    19/180

    Example0.1.23:

    m

    Solution

    m

    m

    m

    --

    -

    -

    m

    Example0.1.24:

    --

    Solution

    -

    -

    --

    X

    X

    KK

    -

    --

    X

    KK

    r---

    r---

    s

    s

    ---

    r---

    Example0.1.25:

    m

    -

    22

    TheoryofAutomata,FormalLanguagesandComputation

    Solution

    X

    X

    KK

    X

    X

    KK

    m

    KKK

    KKK

    X

    X

    X

    X

    KKK

    K

    -

    Example0.1.26:

    Solution

    --

    Example0.1.27:

    -

    --

    -

    -

    Introduction

    23

  • 7/23/2019 TC Reference

    20/180

    B

    B

    Example0.1.28:

    Solution

    --

    -

    --

    -

    -

    -

    ----

    Example0.1.29:

    -

    Solution

    --

    ---

    -

    Example0.1.30:

    -

    Solution:

    ---

    24

    TheoryofAutomata,FormalLanguagesandComputation

    ---

    Example0.1.31:

    Solution

    -

    Example0.1.32:

    -

    m

    Solution

    -

    Example0.1.33:

    m

    }

    X

    m

    m

    Y

    Solution

    X

    m

    X

    }

    g

    m

    Introduction

    25

  • 7/23/2019 TC Reference

    21/180

    Y

    m

    Y

    m

    g

    Example0.1.34:

    --

    -

    X

    Y

    Solution

    X

    ------

    Y

    ---

    Example0.1.35:

    m

    m

    m

    m

    m

    m

    m

    m

    ----

    -

    -

    -

    X

    -

    Y

    -

    X

    -

    Y

    -

    [

    -

    -

    X

    -

    X

    -

    X

    X

    -

    Y

    Y

    -

    Y

    -

    X

    Y

    -

    Y

    Solution

    --

    X

    Y

    26

    TheoryofAutomata,FormalLanguagesandComputation

    -

    -

    -

    -

    -

    0.1.5

    BooleanL

    ogic

    ----

    ---

    -

    ---H

    HH

    --G

    -

    --F

    ----

    G

    F

    -

    --

    --[

    [

    -

    -u-

    ---I

    ntroduction

    27

  • 7/23/2019 TC Reference

    22/180

    ----r

    --

    -

    -----

    r-

    0.1.6

    Fun

    damentalProofTechniques

    (a)

    Princ

    ipleo

    fMa

    thema

    tica

    lInduc

    tion

    -----

    ----

    --

    --m---

    ---

    -

    --

    -

    --

    -

    -

    -

    m--

    ----

    -

    -

    -

    (b)

    Pigeon-ho

    lePrinc

    iple

    ---

    ---

    -

    --

    Example0.1.36:----

    ---

    Solution

    ---

    --

    -

    ----

    -

    7'-----

    --

    Example0.1.37:

    m

    --

    --

    28

    TheoryofAutomata,FormalLanguagesandComputation

    I

    : 89

    * ()I

    m

    : 89

    * ()I

    m

    : 89

    * ()I

    m

    m

    m

    Example0.1.38:

    m

    -

    -

    -

    --

    -

    -

    I

    -

    -

    -

    Example0.1.39:

    m

    -

    -

    --

    --

    Introduction

    29

  • 7/23/2019 TC Reference

    23/180

    --

    i

    -

    m

    Example0.1.40:--m

    L

    --

    Solution

    : 89

    * ()

    --

    --

    L

    L

    7 56

    ' %&

    L

    --

    : 89

    * ()

    7 56

    ' %&

    L

    -

    30

    TheoryofAutomata,FormalLanguagesandComputation

    7 56

    ' %&

    L

    ---

    B

    Example0.1.41:--

    ?

    /m

    m

    : 89

    * ()

    : 89

    * ()

    7 56 6

    ' %& &

    --

    : 89

    * ()

    : 89

    * ()

    7 56 6

    ' %& &

    7 56

    ' %&

    --

    : 89

    * ()

    : 89

    * ()

    7 56 6

    ' %& &

    : 89

    * ()

    : 89

    * ()

    7 56 6

    ' %& &

    : 89

    * ()

    : 89

    * ()

    7 56 6

    ' %& &

    Introduction

    31

  • 7/23/2019 TC Reference

    24/180

    Example0.1.42:-

    m-

    -

    ---

    --

    --

    ---

    -

    B--

    Example0.1.43:

    m

    ;

    L

    --

    -

    --

    L

    -

    L

    -

    L

    L

    Q

    -

    32

    TheoryofAutomata,FormalLanguagesandComputation

    B-

    -

    -

    --

    m

    ;

    Example0.1.44:

    R

    -

    -

    -

    -

    -----

    -

    -

    -

    B

    --

    B

    -----

    -Q

    --

    B

    -

    --

    -

    B

    R

    Example0.1.45:--

    --

    -

    --

    Solution

    Introduction

    33

  • 7/23/2019 TC Reference

    25/180

    --

    KK

    ---

    LLL

    LLL

    --

    - -

    ;

    ;

    ;

    -

    -

    Example0.1.46:

    L

    -

    -

    ---

    ------

    m

    L

    7 56

    ' %&

    L

    34

    TheoryofAutomata,FormalLanguagesandComputation

    --

    R

    Example0.1.47:

    ;

    --

    ;

    B

    ;-

    --

    ;

    -

    -

    ;

    ;

    B

    --

    Example0.1.48:

    R

    B

    Introduction

    35

  • 7/23/2019 TC Reference

    26/180

    ---

    m

    B

    B

    B

    B

    B

    --

    m

    Example0.1.49:

    --

    ;

    : 89* ()

    7 56

    ' %&

    -

    --

    ;

    : 89* ()

    7 56

    ' %&

    : 89 9

    * () )

    :

    89* ()

    7 56

    ' %&

    : 89* ()

    7 56

    ' %&

    : 89* ()

    7 56 6

    ' %& &

    -

    B

    Example0.1.50:

    --

    ---

    -

    --

    36

    TheoryofAutomata,FormalLanguagesandComputation

    Solution

    -

    --

    KK

    ---

    KK

    -

    ------

    --

    -

    -

    --

    Example0.1.51:--

    -

    -

    ---

    -

    Solution

    --

    ---

    -

    -

    7'

    -

    --

    0.1.7

    IntroductiontoGrammar

    ----

    --

    --

    --

    R

    -

    --

    -

    r

    --

    r

    -

    Introduction

    37

  • 7/23/2019 TC Reference

    27/180

    ------

    R

    B

    R

    -

    B

    B

    B

    B

    B

    KK

    -

    -

    -

    KK

    --

    -

    -

    Example0.1.52:

    -

    r r

    --

    Solution

    B B B

    B

    r

    --

    -

    --

    r

    B

    --

    -r

    B

    B

    38

    TheoryofAutomata,FormalLanguagesandComputation

    m

    Example0.1.53:-

    m

    Solution

    m

    -

    r

    r

    m

    -

    --

    r

    -

    -

    rr r

    Example0.1.54:

    -

    r r r r

    Solution

    -

    -

    --

    ----

    R

    -

    R

    ---

    R

    -

    R

    Introduction

    39

  • 7/23/2019 TC Reference

    28/180

    ------

    r

    -

    -

    --

    -

    --

    Example0.1.55:

    -

    rr

    -

    m

    --

    -

    -

    r r

    Solution

    -

    r r rr

    r--

    B B B

    B B B B

    -

    m

    -

    r

    r

    r

    --

    -

    --

    40

    TheoryofAutomata,FormalLanguagesandComputation

    r

    B

    --

    -

    r

    B

    B

    m

    -

    --

    m

    Example0.1.56:

    -

    rr r r r

    R

    -

    Solution

    B B B B B B B B

    R

    Example0.1.57:-

    --

    --

    ---

    ---

    Introduction

    41

  • 7/23/2019 TC Reference

    29/180

    Solution

    ---

    --

    rr r

    R

    ----

    rr r

    R

    ---

    }

    m

    -

    rr r r r

    R

    Example0.1.58:--

    -

    rrr

    rrr

    Soution

    -

    rrr

    m

    -

    r

    42

    TheoryofAutomata,FormalLanguagesandComputation

    r r

    -

    --

    GLOSSARY

    -

    -

    --

    --

    ---

    -

    ----

    --

    --

    -

    -

    ---

    -

    --

    --

    -

    --

    --

    -

    -

    -

    ---

    -

    -

    -

    --

    -

    --

    ---

    --

    ---

    -----

    ---

    -

    -

    -

    -In

    troduction

    43

  • 7/23/2019 TC Reference

    30/180

  • 7/23/2019 TC Reference

    31/180

  • 7/23/2019 TC Reference

    32/180

  • 7/23/2019 TC Reference

    33/180

  • 7/23/2019 TC Reference

    34/180

  • 7/23/2019 TC Reference

    35/180

  • 7/23/2019 TC Reference

    36/180

    -

    ---R

    --

    --

    ---

    -

    -----

    -----

    --

    -

    R

    -

    ---

    -

    -----

    -

    I

    R

    I

    -

    R

    R

    -

    -

    -

    -

    -

    ----

    R

    K

    -

    m-

    K

    R

    -

    ------

    --H

    HH

    --G

    -

    --F

    -

    G

    F

    -

    56

    TheoryofAutomata,FormalLanguagesandComputation

    [

    -

    --

    ----

    ---

    --

    m-

    -

    -

    ---

    -

    --

    -

    --

    -

    -

    --

    --

    ---

    ----

    R

    --

    --

    Introduction

    57

  • 7/23/2019 TC Reference

    37/180

    Chap

    ter

    1

    DFAandNFA

    1.1

    DETERMINISTICFINITEAUTOMATA(DFA)

    1.1.1AutomataWhatisit?

    ---

    -

    --

    --

    ---

    --

    -

    -

    --

    ----

    -

    1.1.2

    Typ

    esofAutomaton

    -

    -

    ---

    -

    -

    ----

    --

    ---

    ----

    Con

    tro

    lUn

    it

    Ou

    tpu

    t

    Inpu

    File

    Storage

    ------

    1.1.3

    Definition

    ofDeterministicFiniteAutomaton

    --

    ---

    ---

    l

    r

    -

    R

    -

    S

    --

    --

    --

    -

    -

    -

    ---

    --

    Example1.1.1:-

    -

    R

    --

    -

    -

    -

    --

    ---

    -

    -

    -

    -

    DFAandNFA

    59

  • 7/23/2019 TC Reference

    38/180

    Solution

    ------

    -

    --

    -

    --

    -

    ---

    -

    -

    -

    ---

    --

    -

    -

    -

    ---

    -

    -

    ---

    ---

    -----

    -

    -

    -------

    Example1.1.2:-

    ---

    -

    -

    -

    -

    -

    -

    60

    TheoryofAutomata,FormalLanguagesandComputation

    q0

    q1

    q2

    q3

    a

    b

    b

    b

    b

    a

    --

    Solution

    ---

    -

    -

    -

    ----

    ------

    -

    -

    -

    --

    --

    Example1.1.3:

    -

    -

    Solution

    -----

    --

    -

    -

    -

    -

    -

    DFAandNFA

    61

    q1

    q2

    q3

    0

    1

    1

    00

    ,1

    --

    q1

    q2

    0

    1

    1

    0

  • 7/23/2019 TC Reference

    39/180

    -----

    -

    Example1.1.4:-

    m

    Solution

    m

    --

    K

    -----

    ----

    Example1.1.5:----

    -

    --

    -

    ---

    Solution

    ---

    --

    -

    -

    62

    TheoryofAutomata,FormalLanguagesandComputation

    q0

    q2

    q1

    b

    a,b

    a,b

    Example1.1.6:--

    R

    -

    -----

    Solution

    ------

    --

    --

    -

    -

    ---

    ---

    Example1.1.7:

    --

    DFAandNFA

    63

    q0

    q1

    q2

    q3

    q4

    a

    b

    a

    c

    Inpu

    q0

    q1

    q2

    q3

    b bbb

    a

    a

    a

    a

    q0

    q1

    q2

    q3

    a

    q4

    b,c

    c

    a

    b

    a

    c

    b,c

    b

    a,b,c

    a

  • 7/23/2019 TC Reference

    40/180

    Solution

    --

    ---

    -

    -

    -

    -

    -

    --

    --

    Example1.1.8:

    -

    Solution

    --

    -

    -

    -

    -

    -

    -

    ---

    -

    -

    64

    TheoryofAutomata,FormalLanguagesandComputation

    q0

    q1

    q2

    q3

    q4 a

    b

    b

    a,b

    a

    a

    a

    b

    q0

    q1

    q2

    q3

    a

    b

    a,b

    a

    a

    b

    b

    Example1.1.9:-----

    -

    Solution

    --

    -

    ----

    ----

    -

    -

    -

    -

    --

    Example1.1.10:--

    ----

    -

    Solution

    -

    DFAandNFA

    65

    q0

    q1

    q2

    q3

    b

    a,b

    a

    b

    aa,b

  • 7/23/2019 TC Reference

    41/180

    -

    -

    -

    --

    ---

    ----

    --

    -

    ------

    -

    -

    --

    Example1.1.11:---

    -

    Solution

    -

    ---

    66

    TheoryofAutomata,FormalLanguagesandComputation

    q2

    q1

    q0

    b

    a

    a b

    b

    a

    q1

    q0

    q20 1

    0

    1

    Example1.1.12:---

    -

    --

    Solution

    Example1.1.13:

    R

    --

    Solution

    -

    DFAandNFA

    67

    q1

    q0

    q20

    0

    0

    1

    1

    1

    1

    q0

    q1

    q3

    q2

    1 11 1

    0

    0

    0

    0

    q0

    q3

    q1

    0

    0

    0,1

    q2

    1

    0 1

  • 7/23/2019 TC Reference

    42/180

    Example1.1.14:-

    -

    -

    Solution

    R--

    R-

    Example1.1.15:

    m

    R

    m

    R

    Solution

    m

    --

    -

    -

    -

    68

    TheoryofAutomata,FormalLanguagesandComputation

    q2

    q0

    q1

    b

    a

    b

    a

    b

    q1

    b

    q0

    a

    b

    (b)

    q1

    a

    b (a

    )

    m

    R

    -

    g-

    -

    --

    -

    --

    Example1.1.16:

    --

    --

    ----

    -

    --

    Solution

    --

    -----

    --

    DFAandNFA

    69

    q3

    q0

    q1 a

    b

    a

    b

    q2

    b

    ab

    q3

    q0

    a

    b

    a

    b

    q1

    q2

    b

    a

    b a

    q2

    q0

    a

    b

    a

    b

    q1

    ab

  • 7/23/2019 TC Reference

    43/180

    ----

    -

    K

    --

    1.2

    NON

    -DETERMINISTICFINITEAUTOMATA(NFA)

    Definition

    --

    --

    ---

    ---

    l

    X

    r

    R

    ---

    S

    ----

    -

    -

    -

    -

    ------

    -

    --

    Example1.2.1:----

    -

    Solution

    --

    70

    TheoryofAutomata,FormalLanguagesandComputation

    q0

    q1

    0-9

    1-9

    q0

    q1

    0-9

    q2

    +,

    1-9

    q0

    q1

    q2

    q3

    a

    a

    a

    b

    b

    b

    b

    a

    --

    ----

    Example1.2.2:

    R

    -

    X

    Solution

    Example1.2.3:--

    ---

    Solution

    ---

    -

    -

    --

    Example1.2.4:-

    R

    m

    -

    -

    DFAandNFA

    71

    q0

    q1

    abac

    a,b,c

    a,b,c

    q0

    q1

    q2

    a b

    q0

    q1

    q2

    1 1

    0

    1

    q1

    q2

    q3

    q4

    1

    0,1

    0,1

  • 7/23/2019 TC Reference

    44/180

    Solution

    -

    ---

    --

    ----

    --

    Example1.2.5:-

    --

    Z

    Z

    Solution

    --

    ---

    72

    TheoryofAutomata,FormalLanguagesandComputation

    q0

    q1

    q2

    q3

    a,b

    a

    a,b

    a,b

    q1

    q2

    q0

    q3

    10

    0,1

    0,1

    Example1.2.6:

    -

    -

    X

    Solution

    -

    X

    -

    X

    X

    -

    --------

    -

    Example1.2.7:--

    m

    X

    m

    Solution

    m

    X

    m

    ----

    -

    m

    -----

    DFAandNFA

    73

    q0

    q1

    q2

    q3

    q4

    q5

    a

    a a

  • 7/23/2019 TC Reference

    45/180

  • 7/23/2019 TC Reference

    46/180

    Example1.3.1:-

    -

    -

    Z

    Solution

    ~

    ~

    ~

    ~

    ~

    -

    ~

    Z

    ~

    ~

    -

    ----

    ~

    ~

    Z

    Z

    Z

    Z

    -

    ~

    -

    ~

    X

    XZ

    ~

    -

    X

    X

    76

    TheoryofAutomata,FormalLanguagesandComputation

    ----

    ----

    Example1.3.2:--

    --

    Z

    Z

    Z

    Z

    Solution

    -------

    Z

    Z

    Z

    Z

    Z

    DFAandNFA

    77

    q0

    q1

    a

    q2

    b

    a

    b

    [

    ]q0

    [

    ]q1

    [

    ]

    q0,q

    1

    a

    b

    b

    Za

    b

    a

    ab

  • 7/23/2019 TC Reference

    47/180

    ---

    -

    --

    --

    Example1.3.3:--

    Solution

    -------

    ---

    Z

    Z

    Z

    Z

    Z

    Z

    -----

    78

    TheoryofAutomata,FormalLanguagesandComputation

    Z

    ~--

    r

    --

    --

    Example1.3.4:-

    Solution

    ----

    Z

    Z

    Z

    Z

    --

    --

    --

    DFAandNFA

    79

    [

    ]

    q0,q

    3

    [

    ]

    q0,q1

    [

    ]

    q0,q1

    2,q

    [

    ]

    q0,q

    3

    4,q

    0

    01

    1

    01

    0

    1

    [

    ]q0

    q0

    q1

    q2

    q3

    a

    a

    b

    b

  • 7/23/2019 TC Reference

    48/180

  • 7/23/2019 TC Reference

    49/180

    -

    --

    -

    ---

    -

    -

    ---

    -

    -

    ---

    --

    1.4.4

    Lan

    guagesdefinedbyRegularExpressions

    -----

    -

    -

    --

    --

    R

    Z

    X

    1.4.5

    Reg

    ularExpressionstoNFA

    ---

    ------

    ---

    --

    --

    -

    82

    TheoryofAutomata,FormalLanguagesandComputation

    x

    NFAforx

    NFAfor

    --

    Z-

    Z--

    --

    --

    -

    --

    ---

    ----

    -

    ---

    ----

    1.4.6

    NFAstoR

    egularExpression

    -------

    --

    ---

    ---

    DFAandNFA

    83

    NFAforZ

    NFAforrr12

    Mr(

    )1

    Mr(

    )2

    NFAfor

    +r

    r

    1

    2

    Mr(

    )1

    Mr(

    )2

    Mr(

    )1

  • 7/23/2019 TC Reference

    50/180

  • 7/23/2019 TC Reference

    51/180

    ----

    ------

    Solution

    --

    ---

    -

    --

    --

    --

    -

    --

    --

    -

    -

    ----

    ---

    ---

    -

    -

    -

    --

    --

    --

    --

    86

    TheoryofAutomata,FormalLanguagesandComputation

    ---

    -

    -

    -

    --

    -

    -

    Example1.4.6:---

    --

    Solution

    -

    ---

    -

    ---

    ----

    ----

    -

    ---

    -----

    -

    Example1.4.7:--

    --

    Solution

    Example1.4.8:----

    DFAandNFA

    87

  • 7/23/2019 TC Reference

    52/180

  • 7/23/2019 TC Reference

    53/180

    -

    -

    --

    --

    -

    -

    -

    -

    --

    --

    -------

    -

    l

    1.6.3

    MooreMachine

    ----

    -

    --

    -

    ---

    Example1.6.1:---

    --

    -

    --

    --

    Solution

    ----

    ----

    90

    TheoryofAutomata,FormalLanguagesandComputation

    q0

    q1

    q2

    q3

    1,1

    0,1

    0,0 0

    ,0

    1,0

    0,1

    1,0

    Example1.6.2:--

    -

    Solution

    -

    --

    --

    r

    r

    1.7

    PROPERTIESOFREGULARSETS(LANGUAGES)

    -

    --

    1.7.1

    Closure

    ---

    -

    ------

    -----

    -

    -

    --

    -

    -

    DFAandNFA

    91

  • 7/23/2019 TC Reference

    54/180

  • 7/23/2019 TC Reference

    55/180

  • 7/23/2019 TC Reference

    56/180

  • 7/23/2019 TC Reference

    57/180

  • 7/23/2019 TC Reference

    58/180

    ---

    -

    -

    --

    --

    -

    ---

    ---

    ---

    -

    EXERCISES

    -----

    --

    ---

    ---

    ----

    g

    ---

    -

    --

    m

    ----

    -

    -

    Z

    100

    TheoryofAutomata,FormalLanguagesandComputation

    --

    --

    Z

    Z

    Z

    -

    -

    ---

    DFAandNFA

    101

    a

    a

    a

    b

    b

    a

    a

    a

    b

    b

    b

    a

    b

    b

    b

    a

    q3

    q1

    q2

    q4

    q0

    0 1

    0,1

    1

    01

    0

    0

  • 7/23/2019 TC Reference

    59/180

    -

    --

    -

    -

    -

    -

    -

    -

    -

    -

    -

    -

    -

    -

    -

    -

    -

    --

    -

    -

    --

    --

    ----

    ------

    --

    ---

    ----

    -

    -

    102

    TheoryofAutomata,FormalLanguagesandComputation

    s2

    s1 s3

    s4

    s0

    Start

    1,1

    1,0

    0,00

    ,0

    0,0

    1,0

    1,0

    s1

    s0

    s2

    s3

    Start

    1,1

    1,0

    0,00

    ,01

    ,1

    1,1

    0,0

    0,0

    --

    --

    -

    ----

    -

    --

    ----

    ------

    -

    --

    -

    -

    -

    -

    -

    -

    KK

    -

    -

    --

    -

    KK

    -

    -

    KK

    -

    ---

    -

    --

    -

    -

    -

    -

    - --

    - -

    --

    -

    DFAandNFA

    103

    s0

    s1

    s2

    Start

    1

    0

    0

    1

    1

    010

    s0

    s1 s2

    Start

    1,1

    0,1

    1,0

    0,0

    0,0

    1,0

  • 7/23/2019 TC Reference

    60/180

  • 7/23/2019 TC Reference

    61/180

    --

    --

    -

    KK

    --

    ---

    -

    -

    -------

    ----

    -----

    -

    ---

    ---

    ----

    --

    - --

    --

    -

    -

    -

    --

    X

    --

    X

    ---

    m

    m

    ---

    ------

    --

    106

    TheoryofAutomata,FormalLanguagesandComputation

    3

    1

    2b

    a

    a,b

    a

    s0

    s1 s2

    Start

    1

    0

    0

    0

    1

    1

    --

    ---

    ---

    ----

    ---

    --

    R

    -

    R

    --

    --

    -

    --

    ------

    ---

    ---

    ---

    --

    DFAandNFA

    107

    s0

    s1

    s2

    s3

    a,b

    a

    a

    b

    s0

    s1

    s2

    s3

    a,b

    a

    a

    b

    a,b

    q0

    q1

    q2

    0

    0

    1

    0

    1

    q0

    q1

    a b

    a

    b

  • 7/23/2019 TC Reference

    62/180

    R

    R

    R

    R

    R

    ----

    --

    --

    -

    SHORTQUESTIONSANDANSWERS

    -

    ---

    ---

    -

    -

    -

    -

    108

    TheoryofAutomata,FormalLanguagesandComputation

    q0

    q1

    q2

    10

    1

    0

    1

    q0

    q1

    q2

    00

    0

    1

    1

    q0

    q1

    q2

    0

    0

    1 1

    1

    q0

    q1

    q2

    00

    1

    0

    1

    -

    -

    ---

    -

    --

    ---

    -

    -

    ---

    -

    --

    -

    --

    -

    --

    ---

    ---

    l

    r

    -

    R

    -

    S

    --

    -

    --

    --

    -

    -

    --

    --

    ---

    ---

    l

    X

    r

    R

    --

    S-

    ---

    ---

    --

    -

    -

    --

    -------

    -

    --

    DFAandNFA

    109

  • 7/23/2019 TC Reference

    63/180

  • 7/23/2019 TC Reference

    64/180

  • 7/23/2019 TC Reference

    65/180

    --

    f

    -

    -

    ------

    ---

    ---

    ---

    -

    -

    -

    114

    TheoryofAutomata,FormalLanguagesandComputation

    Chap

    ter

    2

    Con

    text-FreeGrammars

    2.1

    INTRODUCTION

    2.1.1

    Definition

    ofCFG

    -

    ---

    ---

    -

    ---

    -

    --

    R--

    ----

    r

    -

    --

    B

    2.1.2

    Exampleo

    fCFG

    -

    --

    r r r

    R

    ------

    -----

    ---

    ------

    2.1.3

    Right-Line

    arGrammar

    -

    X

    r

    X

    --

    r

  • 7/23/2019 TC Reference

    66/180

    r

    ----

    -----

    -

    2.1.4

    Right-LinearGrammarsandNFAs

    -

    ----

    -

    -

    --

    --

    ------

    2.1.5

    Left-LinearGrammar

    --

    r

    r

    -----

    -

    ----

    -

    116

    TheoryofAutomata,FormalLanguagesandComputation

    A

    B

    x

    A

    x

    y

    B

    z

    A

    B

    A

    x

    A

    xB

    rA

    xyzB

    rA

    B

    rA

    x

    r

    1 11 1

    0

    0

    0

    0

    S

    A

    B

    C

    S

    r

    S

    B

    r0

    S

    A

    r0

    A

    C

    r0

    A

    S

    r1

    B

    S

    r0

    B

    C

    r1

    2.1.6

    Conversio

    nofLeft-linearGrammarinto

    Right-Line

    arGrammar

    -

    -

    r

    r

    r

    r

    -

    -

    -

    -

    -

    -

    -

    -

    --

    --

    --

    -

    -

    -

    ---

    --

    Example2.1.1:--

    Solution

    -

    r

    r

    r

    -

    B

    B

    B

    B

    -

    R

    -

    -

    -

    rr r r

    -C

    ontext-freeGrammars

    117

  • 7/23/2019 TC Reference

    67/180

    -

    m

    Example2.1.2:--

    m

    m

    Solution

    r rr r

    r rr r

    2.2

    DERIVATIONTREES

    --

    --

    -

    --

    ---

    2.2.1

    DefinitionofaDerivationTree

    -

    --

    -

    -

    X

    --

    -

    R

    -

    KK

    -

    r

    K

    K

    ---

    -

    118

    TheoryofAutomata,FormalLanguagesandComputation

    2.2.2

    SententialForm

    -

    r

    r

    r

    r

    ---

    B

    B

    B

    B

    --

    ---

    2.2.3

    PartialDerivationTree

    -

    X

    X--

    2.2.4

    RightMos

    t/LeftMost/MixedDerivation

    -

    rr

    4 3 2

    $ # "

    B B B B B B B

    -

    -

    --

    Context-freeGrammars

    119

    a

    b

    S

    A

    B

    B

    a

    a

  • 7/23/2019 TC Reference

    68/180

    B B B B B B B

    ---

    B B B B B B B

    -

    -

    ---

    Example2.2.1:

    -

    -

    -

    rr r r

    ---

    B

    r

    B

    B

    B

    120

    TheoryofAutomata,FormalLanguagesandComputation

    Solution

    Example2.2.2:--

    r rr

    Solution

    -

    -

    -

    B

    B

    B

    BB B B

    --

    Context-freeGrammars

    121

    a

    S A

    S

    b

    S

    a

    S

    a

    a

    A

    b

    S a

    a

    S A

    B

    (a)S

    a

    AB

    r

    (b)A

    Bba

    r

    a

    S A

    B

    B

    b

    a

    (c)Br

    a

    S A

    B

    B

    b

    a

    c

    (d)B

    bB

    r

    a

    S A

    B

    B

    b

    a

    c

    b

    B

    (e)B

    c

    r

    a

    S A

    B

    B

    b

    a

    b

    cc

  • 7/23/2019 TC Reference

    69/180

    Example2.2.3:

    rr

    4 3 2

    $ # "

    Solution

    B B B B B B B

    R

    -

    R R

    ---

    m

    Example2.2.4:

    rr r

    4 31 21

    $ #1 "1

    Solution

    B

    R

    B

    B

    R

    122

    TheoryofAutomata,FormalLanguagesandComputation

    a

    SS

    a

    S

    bb

    a

    b

    S C a

    S S c

    a

    B

    B

    R

    B B B

    R

    -

    -

    R

    -

    KK

    KK

    Example2.2.5:

    r

    r rr

    Solution

    Context-freeGrammars

    123

    a

    S S S

    a

    b

    b

    c

    E

    E

    *

    E

    E

    E+

    id

    id

    id

    B

    id*id+id

    E

    E

    E

    E

    (

    )*

    id

    id

    id

    E

    E

    +

    B

    id+id)*id

  • 7/23/2019 TC Reference

    70/180

    Example2.2.6:

    rr

    4 3 2

    $ # "

    Solution

    B

    B

    B

    B

    B

    -

    -

    m

    Example2.2.7:

    -

    r r r

    R

    r r

    R

    r r r

    R

    rr r

    R

    r r r

    -

    r r r r

    Solution

    -

    -

    -

    BR

    B

    B

    B

    B

    B

    -

    -

    m

    124

    TheoryofAutomata,FormalLanguagesandComputation

    S

    S S

    a

    a

    S

    SS

    aS

    aa

    BB B

    S a

    S

    a

    B

    BRB B

    R

    r r

    rR

    -

    r r

    r

    r r

    r r

    Example2.2.8:

    rrrr

    4 31 21

    $ #1 "1

    Solution

    B

    B

    B

    B

    B

    B

    B

    B

    B

    B

    -

    --

    -

    m

    m

    Context-freeGrammars

    125

  • 7/23/2019 TC Reference

    71/180

    Example2.2.9:

    rr r

    4 31 21

    $ #1 "1

    Solution

    B

    B

    B

    B

    B

    B

    K

    K

    ---

    m

    Example2.2.10:-

    -

    R

    R

    R

    Solution

    r rR

    r

    r r r r

    R

    126

    TheoryofAutomata,FormalLanguagesandComputation

    a

    S

    bA

    a

    S

    A

    b

    S

    a

    A

    b

    r r r r rR

    Example2.2.11:

    -

    r rr r r r r r

    --

    -

    Solution

    -

    B

    B

    B

    B

    B

    B

    B

    B

    B

    B

    -

    B

    B

    B

    B

    B

    B

    B

    B

    B

    2.3

    PARSINGA

    NDAMBIGUITY

    2.3.1

    Parsing

    --

    -

    --

    -

    --

    ---

    - ----

    -

    ---

    Context-freeGrammars

    127

  • 7/23/2019 TC Reference

    72/180

    2.3.2

    Exh

    austiveSearchParsing

    -----

    -

    ---

    --

    -

    --

    -

    ----

    -

    -------

    --

    -------

    --

    ---

    -

    R

    ---

    -----

    -----

    ---

    -

    ----

    2.3.3

    Top

    down/BottomupParsing

    --

    -

    -

    --

    ---

    -

    -

    rr

    ----

    r---

    --

    --

    128

    TheoryofAutomata,FormalLanguagesandComputation

    a

    S S

    S

    a

    S

    S

    b

    a

    S

    Sb

    b

    b

    -

    -

    ----

    -

    r---

    --

    --

    2.3.4

    Ambiguity

    r

    -----

    -

    --

    ---

    -

    ----

    B

    B

    B

    B

    B

    B

    B

    B

    -----

    B

    B

    B

    B

    B

    B

    B

    B

    -

    -

    --

    -

    ---

    C

    ontext-freeGrammars

    129

    S

    S

    S b

    Sa

    a

    a

    b

    b

    b

    S

    S

    S

    -

    a

    S

    b

    b

    S

    a

    S

    S

    S

    S

    a

    b

    S

    a

    b

    S

  • 7/23/2019 TC Reference

    73/180

    2.3.5

    AmbiguousGrammars/AmbiguousLanguages

    ----

    -

    -

    -

    -

    R

    ---

    --

    ---

    --

    -----

    --

    ----

    --

    -

    --

    ---

    Example2.3.1:

    rr r

    --

    Solution

    --

    -----

    rrrrr r

    -

    -

    B B

    B

    $ #1 "1

    Example2.3.2:

    r

    r

    -

    -

    Solution

    -

    --

    R

    -

    -

    130

    TheoryofAutomata,FormalLanguagesandComputation

    --

    ---

    --

    Example2.3.3:

    rr

    --

    Solution

    B

    r

    B

    r

    Q Q

    B

    r

    B

    r

    B

    QQ

    --

    --

    2.4

    SIMPLIFICA

    TIONOFCFG

    2.4.1

    Simplifica

    tionofCFG-Introduction

    ---

    --

    X

    ---

    -----

    -

    -

    -

    -

    r

    Context-freeGrammars

    131

    S

    S

    S

    S

    S

    b

    b

    S

    S

    S

    S

    S

    b

    a

    S

    S

    b

    a

    a

    a

    S

    S

    b

    a

    a

    a

    a

    b

    (a

    )

    (b)

  • 7/23/2019 TC Reference

    74/180

  • 7/23/2019 TC Reference

    75/180

    --

    $

    -

    Proce

    dure

    tofin

    dCFGw

    ithou

    t-Pro

    duc

    tions

    -

    r

    ---

    -

    r

    KK

    KK

    $---

    r

    m

    KK

    R

    X

    -

    $--

    ----

    -

    r-$

    -----

    (b)Un

    itPr

    oduc

    tions

    Remova

    l

    r

    R

    -

    -----

    ----

    -

    --

    $

    $$

    $

    ---

    --

    Procedure

    toremovetheunitproductions:

    -

    -

    B

    --

    -

    134

    TheoryofAutomata,FormalLanguagesandComputation

    -

    r

    B

    -

    -

    $-$

    -

    --

    B

    $

    r

    KK

    r

    KK

    ---$

    (c)Le

    ftRecurs

    io

    nRemova

    l

    ---

    r

    R

    X

    -----

    --

    -

    Example2.4.1:

    -

    r r

    $-$-

    Solution

    -

    r

    r

    -

    $-

    r r

    $-

    --

    --

    B

    B

    B

    Context-freeGrammars

    135

  • 7/23/2019 TC Reference

    76/180

    B

    B

    $

    -

    $

    Example2.4.2:-

    rr r r r

    $

    ---

    --

    Solution

    ---

    B

    B

    B

    $

    ~

    ~--

    rr r

    ---

    -

    r

    -

    r

    --

    Example2.4.3:

    rr r r

    ------

    136

    TheoryofAutomata,FormalLanguagesandComputation

    Solution

    ---

    -

    r

    r

    -

    ---

    ---

    -

    B

    B

    -

    ---

    --

    -

    r

    -

    -----

    rr r

    --

    -

    --

    -

    --

    --

    ----

    $

    $

    $

    $

    $

    $

    rr

    Example2.4.4:

    rr

    ---

    Solution

    rr

    -

    Context-freeGrammars

    137

    S

    B

    A

  • 7/23/2019 TC Reference

    77/180

    m

    r

    -

    ---

    -

    rr

    --

    --

    m

    Example2.4.5:

    -

    r

    r

    r

    r

    r

    Solution

    -

    -

    -

    rr r rr

    ---~

    -

    Example2.4.6:-

    -

    rr r rrr

    138

    TheoryofAutomata,FormalLanguagesandComputation

    Solution

    r

    r

    r

    $

    -

    -

    B

    r

    -

    r

    $

    B

    B

    r

    r

    $

    --

    $

    $

    $

    $

    rr r r rr

    Example2.4.7:

    rr r rr

    -

    Solution

    r r

    --

    r r

    r

    r

    Context-freeGrammars

    139

  • 7/23/2019 TC Reference

    78/180

    $

    rr r

    Example2.4.8:

    rr r

    Solution

    ---

    --

    B B B B

    ---

    rr r

    -

    rr r

    rr r

    -$

    140

    TheoryofAutomata,FormalLanguagesandComputation

    S

    B

    A

    Example2.4.9:

    rr

    -----

    Solution

    rr

    -----

    -

    -

    r

    -

    rr

    r

    -$

    Example2.4.10:

    rr r

    -$

    Solution

    --

    -

    --

    --

    r

    -

    --

    r

    -

    r

    r

    -

    r

    r

    -

    r

    Context-freeGrammars

    141

  • 7/23/2019 TC Reference

    79/180

    --$

    -

    r rr

    2.5

    NOR

    MALFORMS

    -

    -

    -

    -

    2.5.1

    Cho

    mskyNormalForm(CNF)

    -

    --

    r

    r

    R

    R

    Proce

    dure

    tofin

    dEqu

    iva

    len

    tGram

    mar

    inCNF

    -

    -

    --

    --

    -

    -

    ---

    ---

    ----

    --

    -----

    -

    r

    m

    KK

    --

    r

    -

    ~---

    142

    TheoryofAutomata,FormalLanguagesandComputation

    r

    ~ --

    ~-

    -

    ~

    ~

    -

    ~---

    -

    -

    r

    KK

    --

    m

    r

    -

    r

    KK

    --

    r r r

    LL

    LL

    LL

    LL

    ~

    -

    ---

    Example2.5.1:-

    -

    rr r

    Solution

    --

    --

    r r

    r

    rrr

    r

    r

    r

    r

    Context-freeGrammars

    143

  • 7/23/2019 TC Reference

    80/180

    ~

    ~--

    r r r r r rr

    ~

    r

    ---

    -

    r r r

    --

    -

    r r r r r r r r

    r

    Example2.5.2:-

    -

    rr r

    144

    TheoryofAutomata,FormalLanguagesandComputation

    Solution

    ---

    -

    --

    r

    r

    r

    r

    r

    r

    r

    r

    r

    ---

    ~

    r r r r r r

    ~

    rr

    ---

    -

    r r r r

    -

    --

    -

    r r r r

    Context-freeGrammars

    145

  • 7/23/2019 TC Reference

    81/180

    r r r

    r

    Example2.5.3:

    r

    r

    -

    Solution

    --

    -

    r

    r

    r

    r

    r

    r

    r

    r

    r

    r

    r

    ~

    -

    ~

    r r r r r r

    r

    ~

    r r

    146

    TheoryofAutomata,FormalLanguagesandComputation

    r

    ---

    --

    r

    r

    r

    r

    r

    r r

    r

    r r r

    --

    r r r r r r r r

    r r r

    r

    Example2.5.4:

    -

    r

    Solution

    --

    -

    r

    r

    Context-freeGrammars

    147

  • 7/23/2019 TC Reference

    82/180

    r

    r

    r

    ~

    -~

    r r r r

    ~

    r

    -

    r r

    --

    -

    r r r r

    r

    2.5.2

    Gre

    ibachNormalForm

    ----

    --

    --

    ----

    --------

    --

    --

    -

    r

    R

    R

    148

    TheoryofAutomata,FormalLanguagesandComputation

    --

    -

    -

    --

    -

    GLOSSARY

    -

    r

    r

    -

    r

    r

    -

    -

    -

    --

    ---

    -

    -----

    ----

    ---

    ---

    r

    R

    -

    -

    --

    -

    r

    r

    R

    R

    REVIEW

    QUESTIONS

    ---

    -

    -

    -

    --

    -

    Context-freeGrammars

    149

  • 7/23/2019 TC Reference

    83/180

  • 7/23/2019 TC Reference

    84/180

    -

    r

    r

    r

    --

    -

    -

    -----

    -

    -

    r

    -

    -

    r

    --

    -

    r r r r

    r r r

    ----

    rr r rr

    -

    rr

    152

    TheoryofAutomata,FormalLanguagesandComputation

    q0

    q4

    q3

    q5

    a

    aba

    rr r

    -

    rr r

    -

    rr

    rr

    r

    -

    -

    rr r

    -

    R--

    R

    -

    r r

    R

    ---

    -

    m

    m

    m

    m

    S

    HORT-QUESTIONSANDANSWERS

    -

    ---

    ---

    -

    ---

    -

    --

    R

    --

    Context-freeGrammars

    153

  • 7/23/2019 TC Reference

    85/180

  • 7/23/2019 TC Reference

    86/180

  • 7/23/2019 TC Reference

    87/180

    --

    --

    ---

    ----

    -

    ---

    r

    R

    R

    158

    TheoryofAutomata,FormalLanguagesandComputation

    Chap

    ter

    3

    PushdownAutomata

    3.1

    DEFINITION

    S

    ---

    m

    -

    ---

    ---

    -

    ----

    --

    ---

    -

    -

    m

    -

    --

    -

    m

    ---

    -

    ----

    --

    ---

    ---

    -

    ---

    ---

    m--

    ---

    3.1.1

    Nondeterm

    inisticPDA(Definition)

    -

    ---

    ---

  • 7/23/2019 TC Reference

    88/180

  • 7/23/2019 TC Reference

    89/180

  • 7/23/2019 TC Reference

    90/180

    3.1.7

    Acc

    eptingStringswithNPDA(FormalVersion)

    ---

    -

    ---

    ----

    -

    -

    R

    R

    R

    Example3.1.1:--

    m-

    Solution

    m

    -

    -

    -----

    --

    --

    -

    ----

    -

    ---

    -

    R

    Example3.1.2:-

    m

    -

    164

    TheoryofAutomata,FormalLanguagesandComputation

    Solution

    m

    -

    -

    Example3.1.3:

    m

    -

    Solution

    m--

    -

    ----

    Example3.1.4:-

    m

    -

    Solution

    THEOREM:

    -

    -

    ~

    ~

    ~

    ~

    ~

    -

    -

    ~

    ~

    ~

    ~

    -

    ~

    ~

    ~

    PushdownAutomata

    165

  • 7/23/2019 TC Reference

    91/180

  • 7/23/2019 TC Reference

    92/180

  • 7/23/2019 TC Reference

    93/180

  • 7/23/2019 TC Reference

    94/180

  • 7/23/2019 TC Reference

    95/180

    --

    --

    -

    -

    Example3.3.1:

    }

    }

    -

    Solution

    -

    -

    }

    }

    --

    -------

    -

    -

    -

    Q

    -

    -

    Example3.3.2:-

    S

    --

    --

    -

    --

    R

    -

    -

    --

    -

    gZ

    -

    -

    -

    -

    --

    --

    -

    -

    ~

    ~-

    ---

    R

    ~

    R

    Q

    ~

    -

    Example3.3.3:

    m

    g

    -

    174

    TheoryofAutomata,FormalLanguagesandComputation

    ---

    -

    -

    -

    --

    m

    Y

    --

    Y

    -

    -

    --

    --

    m

    g

    -

    Example3.3.4:

    R

    -

    ---

    Y

    m

    --

    -

    -

    R

    -

    Example3.3.5:

    m

    -

    Solution

    ---

    -

    -

    }

    }

    -

    -

    }

    PushdownAutomata

    175

  • 7/23/2019 TC Reference

    96/180

  • 7/23/2019 TC Reference

    97/180

    Solution

    ---

    ---

    --

    R

    --

    R

    m

    -

    R

    --

    --

    -

    Example3.4.3:---

    ---

    Solution

    -

    -----

    ---

    -

    -

    Table:TransitionTableforDPDA.

    -

    -

    -

    -

    -

    -

    -------

    ------

    ---

    --

    178

    TheoryofAutomata,FormalLanguagesandComputation

    -

    --

    ---

    -

    R

    --

    -

    -

    --

    --

    -

    Q

    GLOSSARY

    --

    -

    -

    l

    X

    l

    ----

    l

    PushdownAutomata

    179

  • 7/23/2019 TC Reference

    98/180

  • 7/23/2019 TC Reference

    99/180

  • 7/23/2019 TC Reference

    100/180

  • 7/23/2019 TC Reference

    101/180

  • 7/23/2019 TC Reference

    102/180

  • 7/23/2019 TC Reference

    103/180

    ---

    -

    Example4.1.1:---

    -

    Solution

    -----

    -

    --------

    ---

    -

    -

    --

    -

    ---

    ----

    --

    -

    ---

    -------

    -

    r

    Example4.1.2:

    --

    --

    Solution

    --

    --

    -

    -

    ---

    -

    ---

    -

    --

    -

    190

    TheoryofAutomata,FormalLanguagesandComputation

    ---

    oo

    ---

    -

    --

    -

    Example4.1.3:--

    m

    Solution

    ----

    ------

    -

    -

    ----

    -

    ---

    q0:

    Move

    al

    l

    the

    way

    to

    the

    le

    ft

    q1:

    Erase

    a

    n

    a

    .

    TuringMachines

    191

  • 7/23/2019 TC Reference

    104/180

  • 7/23/2019 TC Reference

    105/180

  • 7/23/2019 TC Reference

    106/180

  • 7/23/2019 TC Reference

    107/180

  • 7/23/2019 TC Reference

    108/180

  • 7/23/2019 TC Reference

    109/180

  • 7/23/2019 TC Reference

    110/180

  • 7/23/2019 TC Reference

    111/180

  • 7/23/2019 TC Reference

    112/180

  • 7/23/2019 TC Reference

    113/180

    Chap

    ter

    5

    ChomskyHierarchy

    5.1

    CON

    TEXTSENSITIVEGRAMMARSANDLANGUAGES

    ---

    --

    ----

    -

    r

    R

    R

    X

    -----

    r

    ----

    -

    r

    R

    X

    }

    -----

    --

    -

    ---

    -

    ---

    ---

    -

    -----

    --

    -

    X

    Example5.1.1:

    m

    -

    --

    Solution

    -

    ----

    -

    r r r r r

    --

    --

    B

    B

    B

    B

    B

    B

    B

    B

    B

    B

    B

    ---

    -

    -

    -

    ---

    5.2

    LINEARBO

    UNDEDAUTOMATA

    --

    -----

    -

    -----

    THEOREM(I):--

    --

    -

    --

    THEOREM(II):

    -

    --

    5.3

    RELATIONSHIPOFOTHERGRAMMARS

    THEOREM(I):

    ---

    -

    r

    -

    --

    r

    -

    THEOREM(II):-----

    ChomskyHierarchy

    211

  • 7/23/2019 TC Reference

    114/180

  • 7/23/2019 TC Reference

    115/180

  • 7/23/2019 TC Reference

    116/180

  • 7/23/2019 TC Reference

    117/180

  • 7/23/2019 TC Reference

    118/180

    --

    -

    ----

    ---

    ---

    ----

    --

    -----

    --

    --

    Example6.3.1:-

    --

    Solution

    --

    KK

    Example6.3.2:-

    -

    -

    Solution

    -

    -

    Example6.3.3:-

    -

    ----

    -

    220

    TheoryofAutomata,FormalLanguagesandComputation

    Solution

    -

    KK

    Example6.3.4:-

    -

    -

    -

    --

    Solution

    -

    -

    Example6.3.5:-

    -

    ---

    -

    Solution

    ---

    -

    m

    --

    Computability

    221

  • 7/23/2019 TC Reference

    119/180

  • 7/23/2019 TC Reference

    120/180

    Example:

    -

    Solution

    --

    Example6.4.2:

    -

    -

    Solution

    -----

    -

    --

    --

    KK

    KK

    KK

    KK

    KK

    --

    -

    --

    -

    -

    ~

    -

    -

    -

    -

    -

    ---

    -

    224

    TheoryofAutomata,FormalLanguagesandComputation

    ~

    --

    -

    -

    ---

    -

    ---

    --

    -

    --

    Example6.4.3:

    -

    -

    Solution

    --

    -

    I~

    -

    --

    --

    Example6.4.4:-

    -

    4 3 2

    --

    Solution

    -

    -

    4 3 2

    -

    -

    -

    -

    ---

    Example6.4.5:

    --

    Computability

    225

  • 7/23/2019 TC Reference

    121/180

    Solution

    i

    i ---

    -

    $ # "

    --

    Example6.4.6:

    -

    -

    Solution

    ---

    ---

    -

    -

    -

    i

    -----

    i

    ---

    -

    ----

    -

    -

    -

    i

    ---

    ---

    Example6.4.7:-

    g

    4 3 2

    -

    -

    Solution

    -

    226

    TheoryofAutomata,FormalLanguagesandComputation

    g

    4 3 2

    -

    --

    -

    g

    4 3 2

    --

    -

    --

    Example6.4.8:--

    g

    4 3 2

    --

    Solution

    --

    g

    4 3 2

    ----

    --

    -

    --

    ---

    -

    Example6.4.9:

    --

    Computability

    227

  • 7/23/2019 TC Reference

    122/180

    Solution

    I

    ---

    --

    Example6.4.10:

    -

    m

    4 3 2

    -

    -

    Solution

    --

    -

    m

    4 3 2

    -

    i

    i

    ----

    --

    -

    -

    Example6.4.11:-

    --

    -

    -

    Solution

    --

    g

    4 3 2

    -

    -

    228

    TheoryofAutomata,FormalLanguagesandComputation

    -

    --

    -

    g

    4 3 2

    --

    K

    LL

    -

    --

    ------

    -

    --

    --

    6.5

    ACKERMANNSFUNCTION

    ----

    ----

    ---

    ---

    -

    ----

    Example6.5.1:

    -

    -

    -

    Solution

    -

    Computability

    229

  • 7/23/2019 TC Reference

    123/180

    -

    -

    -

    -

    -

    -

    -

    -

    -

    -

    GLOSSARY

    ----

    -----

    -----

    --

    ----

    --

    -------

    ---

    ----

    230

    TheoryofAutomata,FormalLanguagesandComputation

    ---

    -

    ----

    -

    ----

    -

    ---

    --------

    -

    -

    REVIEW

    QUESTIONS

    ---

    ------

    ---

    --

    ---

    --

    --

    --

    -

    -

    -

    EXERCISES

    -

    -

    -

    -

    Computability

    231

  • 7/23/2019 TC Reference

    124/180

  • 7/23/2019 TC Reference

    125/180

  • 7/23/2019 TC Reference

    126/180

  • 7/23/2019 TC Reference

    127/180

  • 7/23/2019 TC Reference

    128/180

  • 7/23/2019 TC Reference

    129/180

  • 7/23/2019 TC Reference

    130/180

  • 7/23/2019 TC Reference

    131/180

  • 7/23/2019 TC Reference

    132/180

    ----

    F

    --

    --

    F

    ---

    --

    F

    -

    -

    Illus

    tra

    tion

    -

    F

    -

    ---F

    --

    -

    F

    F

    G

    B-

    --

    B

    248

    TheoryofAutomata,FormalLanguagesandComputation

    B-

    B

    -

    -

    ----

    -

    Illus

    tra

    tion

    B

    -

    ---

    -

    ----

    -

    --

    B

    --

    --

    --

    ----

    -

    --

    B

    --

    E

    -

    -

    --

    E

    -

    E

    -

    -----

    -

    E

    --

    B

    G

    B

    --

    E-

    -

    E

    -

    ---

    -

    Illus

    tra

    tion

    -

    -

    -

    ---

    E

    -

    PropositionsandPredicates

    249

  • 7/23/2019 TC Reference

    133/180

    ---

    E

    -

    --

    -

    ----

    -----

    -----

    -

    Example8.1.1:-----

    -

    -

    --

    -

    Solution

    GH

    G

    H

    GH

    H

    G

    Example8.1.2:-----

    -----

    -

    --

    -

    Solution

    ---

    G

    250

    TheoryofAutomata,FormalLanguagesandComputation

    --

    ---

    --

    ---

    G

    B

    -

    -

    B

    ---

    -

    -

    F

    ----

    Example8.1.3:

    ----

    -

    -

    -

    --

    E

    H

    E

    H

    E

    G

    B

    Solution

    E

    -----

    H

    E

    H

    -----

    E

    --

    GH

    -----

    B-----

    PropositionsandPredicates

    251

  • 7/23/2019 TC Reference

    134/180

    Example8.1.4:

    -

    -

    ---

    -

    ---

    --

    --

    -

    Solution

    E

    E

    E

    GH

    BH

    Example8.1.5:

    -

    --

    --

    G

    H

    GH

    H

    G

    F

    H

    HH

    FH

    Solution

    G

    ---

    H

    GH

    ---

    H

    G

    ----

    FH

    ---

    HH

    FH

    ---

    -

    Example8.1.6:

    --

    --

    -

    -

    252

    TheoryofAutomata,FormalLanguagesandComputation

    Solution

    Example8.1.7:--

    -

    --

    -

    F

    G

    F

    G

    GH

    GHG

    H

    B

    -

    B

    E

    B

    Solution

    F

    F

    G

    G

    -

    F

    G

    F

    F

    G

    -

    GH

    H

    GH

    GH

    GH

    H

    GH

    H

    GH

    GH

    -

    B

    B

    -

    PropositionsandPredicates

    253

  • 7/23/2019 TC Reference

    135/180

    -

    B

    E

    B

    -

    -B

    -

    E

    E

    -

    B

    B

    B

    Example8.1.8:-

    H

    F

    GH

    F

    Solution

    H

    H

    H

    F

    H

    F

    H

    F

    GH

    F

    Example8.1.9:HH

    GH

    H

    H

    H

    GH

    HH

    GH

    Example8.1.9:---

    E

    -

    B

    B

    --

    B

    B

    E

    -

    Solution

    E

    B

    B

    -

    254

    TheoryofAutomata,FormalLanguagesandComputation

    -

    --

    E

    -

    B

    B

    -

    -

    --

    B

    B

    -

    E

    -

    8.1.2

    Tautology

    ,ContradictionandContingency

    ----

    ------

    F

    H

    ---

    ---

    G

    H

    --

    -

    Example8.1.10:

    B

    ---HF

    -

    -

    B

    E

    H

    F

    -

    Solution

    H

    B

    H

    F

    B

    E

    H

    F

    -

    B

    ---H

    F

    ---

    B

    E

    H

    F

    --

    -

    Example8.1.11:----

    -

    --

    FH

    GH

    BH

    H

    HG

    E

    H

    FH

    PropositionsandPredicates

    255

  • 7/23/2019 TC Reference

    136/180

    Solution

    FH

    H

    FH

    -

    -

    GH

    H

    GH

    --

    -

    BH

    H

    H

    HH

    BHH

    -

    -

    H

    G

    E

    H

    FH

    G

    H

    G

    HH

    H

    FH

    H

    G

    EH

    FH

    -

    -

    Example8.1.12:----

    ---

    256

    TheoryofAutomata,FormalLanguagesandComputation

    HF

    E

    H

    GH

    B

    E

    H

    BH

    B

    E

    H

    BH

    G

    F

    B

    G

    F

    G

    Solution

    HF

    E

    H

    GH

    B

    E

    H

    BH

    B

    G

    B

    B

    B

    B

    G

    B

    ---

    -

    G

    F

    B

    G

    F

    G

    -

    Example8.1.13:

    ---

    -

    -

    -

    ----

    --

    --

    --

    ---

    --

    E

    GH

    G

    B

    G

    B

    H

    G

    PropositionsandPredicates

    257

  • 7/23/2019 TC Reference

    137/180

    Solution

    H

    G

    B

    B

    H

    GH

    E

    GH

    -

    -

    G

    B

    G

    B

    H

    F

    -

    Example8.1.14:-

    -

    GH

    E

    H

    G

    B

    Solution

    -

    ---

    -

    Example8.1.15:

    KK

    --

    Z

    KK

    ---

    }

    }

    --

    Z

    Solution

    KK

    ----

    -

    8.1.3

    Log

    icalIdentities

    ----

    --

    --

    --

    --

    -

    -----

    -

    -

    -

    --

    -

    258

    TheoryofAutomata,FormalLanguagesandComputation

    Table.LogicalIdentities

    E

    F

    F

    E

    G

    G

    F

    E

    F

    F

    G

    E

    G

    G

    F

    F

    E

    F

    F

    --F

    G

    G

    E

    G

    G

    --G

    H

    F

    E

    H

    GH

    H

    G

    E

    H

    FH

    $ # "

    --

    G

    G

    E

    G

    F

    G

    -GF

    F

    G

    E

    F

    G

    F

    -FG

    F

    E

    G

    E

    F

    E

    G

    E

    FH

    E

    GH

    E

    EHH

    B

    E

    H

    F

    E

    E

    B

    G

    B

    G

    B

    E

    B

    B

    B

    G

    BH

    EH

    -

    B

    E

    H

    BH

    -

    ---

    ----

    Table.LogicalImplications

    B

    F

    G

    B

    G

    B

    B

    --

    B

    GH

    BH

    --

    H

    G

    F

    B

    --

    B

    G

    B

    B

    B

    -

    B

    B

    B

    B

    B

    B

    G

    B

    B

    G

    B

    G

    E

    G

    E

    B

    E

    PropositionsandPredicates

    259

  • 7/23/2019 TC Reference

    138/180

    Example8.1.15:--

    --

    -

    -

    -

    -

    Solution

    --

    -

    -

    --

    --

    --

    -

    -

    --

    --

    Example8.1.16:----

    -

    ----GH-

    --

    --

    F

    FH

    F

    H

    G

    B

    B

    B

    Solution

    F

    FH

    E

    HH

    GH

    FH

    E

    H

    H

    GH

    G

    E

    HH

    GH

    G

    F

    H

    G

    B

    E

    H

    H

    GH

    H

    G

    B

    E

    H

    H

    GHHH

    G

    F

    E

    H

    H

    G

    H

    G

    GH

    B

    B

    E

    B

    H

    F

    E

    H

    FH

    F

    E

    H

    F

    FH

    E

    FH

    E

    Example8.1.17:----

    -

    ----FH-

    --

    --

    260

    TheoryofAutomata,FormalLanguagesandComputation

    G

    GH

    B

    FH

    GH

    G

    Solution

    G

    GH

    E

    HH

    G

    F

    E

    HH

    FH

    F

    B

    FH

    GH

    G

    E

    H

    F

    FH

    GH

    G

    E

    H

    F

    FH

    GH

    G

    E

    H

    GH

    G

    F

    GH

    G

    FH

    GH

    G

    E

    H

    G

    F

    GH

    F

    H

    G

    GH

    F

    GH

    GH

    E

    H

    FH

    Example8.1.18:----

    -

    -

    G

    B

    E

    HH

    F

    BH

    E

    B

    H

    GH

    B

    E

    Solution

    G

    B

    E

    H

    G

    F

    E

    H

    FH

    F

    E

    FH

    FH

    E

    FH

    E

    HH

    F

    BH

    E

    H

    F

    FH

    E

    H

    FH

    F

    E

    H

    F

    E

    H

    E

    B

    H

    GH

    BE

    H

    FH

    G

    F

    E

    H

    G

    E

    Example8.1.19:-B

    --B----

    PropositionsandPredicates

    261

  • 7/23/2019 TC Reference

    139/180

    Solution

    B

    -

    --

    B

    --

    B

    -

    -

    --

    Example8.1.20:--

    -

    -H

    G

    EH

    E

    F

    E

    G

    Solution

    G

    H

    G

    E

    H

    G

    262

    TheoryofAutomata,FormalLanguagesandComputation

    E

    H

    E

    H

    G

    E

    H

    G

    E

    H

    E

    F

    E

    H

    E

    H

    E

    H

    H

    E

    HH

    GH

    E

    F

    E

    G

    HG

    E

    H

    G

    H

    G

    E

    H

    H

    G

    GH

    G

    E

    H

    F

    G

    F

    E

    H

    F

    E

    G

    Example8.1.21:---

    H

    B

    B

    H

    B

    B

    HG

    B

    BH

    Solution

    H

    B

    B

    H

    B

    H

    B

    B

    -

    PropositionsandPredicates

    263

  • 7/23/2019 TC Reference

    140/180

    H

    B

    B

    B

    H

    B

    H

    B

    B

    -

    H

    G

    B

    BH

    H

    B

    H

    H

    G

    B

    H

    G

    B

    BH

    -

    Example8.1.22:

    F

    GHH

    GH

    FH

    FH

    GH

    FH

    GH

    -

    Solution

    F

    GH

    GH

    FH

    FH

    GH

    FH

    GH

    E

    F

    GH

    H

    GH

    G

    FH

    F

    FH

    F

    E

    F

    G

    F

    G

    FH

    F

    FH

    F

    E

    F

    G

    F

    FH

    F

    G

    F

    E

    F

    G

    F

    FH

    F

    G

    E

    F

    G

    FH

    F

    G

    E

    -

    Example8.1.23:

    r

    G

    r

    F

    r

    264

    TheoryofAutomata,FormalLanguagesandComputation

    Solution

    r

    G

    r

    E

    H

    F

    GH

    F

    E

    H

    GH

    F

    E

    H

    F

    F

    E

    F

    r

    Example8.1.24:

    H

    G

    r

    H

    FH

    F

    B

    H

    F

    H

    F

    r

    H

    FH

    F

    B

    G

    FH

    FH

    F

    B

    G

    FH

    F

    B

    G

    FH

    F

    B

    G

    FH

    F

    B

    FH

    G

    FH

    F

    B

    G

    FH

    F

    B

    FH

    F

    B

    FH

    BH

    F

    Example8.1.25:

    F

    -

    F

    Gr

    G

    r

    Solution

    --

    F

    G

    r

    G

    r

    -

    F

    r

    r

    -

    F

    -

    -

    -

    -

    -

    r

    -

    -

    --

    -

    -

    r

    -

    -

    -

    -

    -

    F

    -

    F

    G

    r

    G

    r

    -

    F

    8.2

    LOGICALINFERENCE

    -

    -

    PropositionsandPredicates

    265

  • 7/23/2019 TC Reference

    141/180

    ---

    r

    ---

    Ru

    lesofIn

    ference

    -

    G

    B

    G

    B

    $ # "

    B

    F

    B

    F

    $ # "

    H

    B

    r

    B

    r

    H

    r

    B

    H

    r

    H

    B

    G

    H

    F

    B

    ---

    r

    B

    --

    H

    r

    BH

    --

    r

    r

    B

    r

    -

    F

    r

    r

    B

    -

    HH

    E

    G

    E

    G

    F

    E

    F

    $ # "

    -

    G

    G

    E

    G

    G

    F

    F

    E

    F

    F

    $ # "

    ---

    F

    G

    E

    F

    G

    F

    G

    G

    E

    G

    F

    G

    $ # "

    -

    H

    G

    E

    H

    FH

    H

    F

    E

    H

    GH

    $ # "

    --

    F

    E

    G

    E

    F

    GH

    E

    G

    FH

    E

    F

    FH

    E

    266

    TheoryofAutomata,FormalLanguagesandComputation

    G

    GH

    E

    r

    EH

    F

    H

    r

    E

    GH

    r

    EH

    rH

    r

    r

    E

    G

    r

    H

    E

    E

    EH

    E

    E

    r

    G

    r

    E

    E

    G

    FH

    GH

    Example8.2.1:

    F

    --

    -

    F

    F

    r

    H

    H

    r

    GH

    GH

    r

    F

    Solution

    F

    rH

    H

    r

    GH

    F

    r

    GH

    -

    GH

    r

    F

    F

    r

    F

    -

    F

    F

    --

    Example8.2.2:

    F

    -

    F

    G

    r

    G

    r

    Solution

    F

    H

    r

    Q

    r

    E

    H

    F

    r

    H

    r

    H

    r

    -

    r

    EH

    rH

    r

    H

    r

    F

    Example8.2.3:

    G

    F

    --

    --

    F

    r

    r

    H

    PropositionsandPredicates

    267

  • 7/23/2019 TC Reference

    142/180

    Solution

    r

    H

    H

    --

    F

    r

    --

    G

    F

    Q

    B

    G

    Example8.2.4:-

    -

    --

    r

    H

    F

    H

    r

    H

    Solution:

    F

    H

    -

    r

    H

    H

    ---

    H

    r

    --

    Example8.2.5:H

    r

    BH

    Solution

    r

    H

    rH

    -

    r

    E

    H

    r

    H

    H

    H

    --

    r

    B

    Example8.2.5:

    F

    --

    --

    F

    F

    rH

    H

    r

    GH

    GH

    r

    F

    268

    TheoryofAutomata,FormalLanguagesandComputation

    Solution

    F

    F

    rH

    H

    --

    H

    r

    GH

    GH

    --

    GH

    r

    F

    F

    --

    Example8.2.6:-

    --

    -

    -

    -

    -

    -

    -

    Solution

    -

    -

    -

    -

    rH

    r

    H

    r

    r

    r

    -

    H

    rH

    -

    r

    -

    r

    r

    -

    r

    Example8.2.7:-

    -----

    --

    ----

    PropositionsandPredicates

    269

  • 7/23/2019 TC Reference

    143/180

    Solution

    -

    ----

    --

    H

    ru

    H

    r

    $ #1 "1

    --

    H

    r

    G

    u

    B

    H

    r

    u

    H

    r

    G

    u

    Hr

    G

    u

    B

    -

    -

    Example8.2.8:-----

    ----

    -

    ----

    -------

    270

    TheoryofAutomata,FormalLanguagesandComputation

    Solution

    F H

    FH

    --

    F

    B

    -

    rH H

    rH

    H

    H

    r

    BH

    -

    -

    -

    r

    ---

    --

    --

    --

    r

    F

    --

    r

    F

    --

    Example8.2.9:---

    -

    ----

    -

    PropositionsandPredicates

    271

  • 7/23/2019 TC Reference

    144/180

    -

    -

    --

    -

    --

    ---

    Solution

    -

    --

    -

    -

    -

    H

    rrGH

    $ #1 "1

    -

    r

    r

    r

    GH

    H

    G

    H

    H

    --

    H

    --

    H

    GH

    --

    -

    -

    --

    rr

    r

    -

    ---

    Example8.2.10:-

    -

    -----

    -

    --

    -

    -

    --

    -

    272

    TheoryofAutomata,FormalLanguagesandComputation

    -------

    -

    ---

    -----

    ----

    Solution

    -

    H

    Fr

    H

    H

    F

    r

    H

    GH

    -

    H

    H

    --

    ----

    --

    -

    H

    FH

    G

    F

    G

    F

    G

    H

    FH

    G

    F

    G

    F

    -

    H

    FH

    GH

    F

    -

    F

    H

    F

    FH

    F

    G

    FH

    F

    GH

    F

    PropositionsandPredicates

    273

  • 7/23/2019 TC Reference

    145/180

    Example8.2.11:

    -

    --

    G B

    G

    F B

    F

    B B

    B

    B

    F

    BH

    BH

    GH

    Solution

    G B

    G

    G

    r

    --

    -

    F B

    F

    F

    B

    H

    r

    H

    r

    F

    -

    B B

    B

    274

    TheoryofAutomata,FormalLanguagesandComputation

    r

    r

    r

    G

    r

    r

    r

    G

    rB

    r

    B

    B-

    r

    F

    rH

    rH

    GH

    r

    F

    F

    --

    r

    H

    H

    --

    r

    H

    HH

    rH

    rH

    H

    --

    GH

    B-

    PropositionsandPredicates

    275

  • 7/23/2019 TC Reference

    146/180

  • 7/23/2019 TC Reference

    147/180

    --

    ---

    --

    I

    Solution:

    ---

    F

    F

    _

    F

    F

    _

    }

    F

    H

    H_

    F

    F

    F

    _

    F

    Example8.3.2:

    __

    __

    -----

    __

    __

    __

    _

    F_

    F_

    K

    K

    F

    F

    F

    F

    F

    F

    KK

    KK

    F

    F

    F

    F

    F

    F

    F

    KK

    KK

    KK

    F

    F

    F

    F

    F

    F

    FKKKK

    F

    _

    F_

    F_

    F

    __

    KK

    KK

    Example8.3.3:-

    -

    ----I-

    F_

    I

    F_

    I

    278

    TheoryofAutomata,FormalLanguagesandComputation

    _F

    I

    _F

    I

    Solution

    F

    _

    I

    -

    F

    _

    I

    -

    _F

    I

    I

    I

    Q

    -

    _F

    I

    I

    I

    -

    Example8.3.4:--

    ---

    --

    F_

    B_

    F

    _

    F

    BF

    _

    Solution

    F_

    B_

    F

    _

    _

    -

    PropositionsandPredicates

    279

  • 7/23/2019 TC Reference

    148/180

    _

    F

    BF

    _

    K

    -

    Example8.3.5:---

    -----

    ------

    F

    F

    F_

    _

    F

    Solution

    ----

    -----

    ---

    ---

    Example8.3.6:-------

    -----

    -

    -

    F

    F

    F

    F_

    _

    F

    __

    Solution

    F

    G

    F

    F

    G

    G

    G

    F_

    F

    G

    F

    _

    F

    G

    F

    G

    __

    F

    F

    F

    280

    TheoryofAutomata,FormalLanguagesandComputation

    Example8.3.7:---

    ----

    -F

    _

    ---

    -F

    _

    -

    --

    --

    -F

    _

    _

    Solution

    g

    -

    g

    ----

    F_

    _

    Example8.3.8:---

    ----

    ---

    ---

    --

    ----

    --

    Solution

    FF

    _

    FF

    _

    _F

    8.4

    QUANTIFIE

    RSANDLOGICALOPERATORS

    -

    ----

    -

    -

    ------

    PropositionsandPredicates

    281

  • 7/23/2019 TC Reference

    149/180

    -

    F

    F

    -

    F

    G

    B

    -

    HF

    B

    _

    GH

    -

    -

    F

    H

    B

    --

    --

    --

    --

    ---

    -

    -

    F

    BF

    F

    F

    B

    -----

    ---

    -

    ----

    -----

    F

    F

    _

    --

    ---

    ----

    ---

    - H

    F

    F_

    -

    __

    F

    H

    __

    F

    g

    -

    --

    -

    -

    282

    TheoryofAutomata,FormalLanguagesandComputation

    Log

    ica

    lRe

    lations

    F

    B

    --

    B

    _

    --

    FH

    EH

    _

    F

    EH

    _H

    EHF

    F

    G

    EF

    G

    F

    F

    EF

    F

    F

    GF

    EF

    G

    F

    FF

    EF

    F

    _

    G

    E_

    G

    _

    F

    E_

    F

    _

    G

    E

    _

    G_

    _

    F_

    E

    _

    F

    Example8.4.1:

    -----

    g

    g

    g

    --

    --

    m

    ---

    }

    }-

    -

    --

    --

    Solution

    F

    BF

    g

    g

    g

    F

    F

    H

    BH

    GH

    F

    F

    B

    G

    PropositionsandPredicates

    283

  • 7/23/2019 TC Reference

    150/180

    F

    E

    --

    --

    m

    F

    H

    E

    H

    F

    ---

    F

    F

    F

    H

    GH

    BH

    }

    }-

    -

    F

    F

    H

    GH

    B

    F

    F

    F

    G

    BF

    F

    G

    B

    HF

    F

    G

    --

    F

    F

    G_

    BF

    F

    G

    B

    -

    Example8.4.2:----

    ------

    --

    --

    ----

    ---

    F

    -------

    F

    B

    F

    FH

    _

    GH

    F

    F

    F

    G

    B

    F

    F

    BF

    F

    B

    Solution

    F

    B

    -

    -

    284

    TheoryofAutomata,FormalLanguagesandComputation

    FH

    ----

    _

    GH

    ---

    FF

    F

    G

    B

    F

    --F---

    --

    F

    BF

    F

    B

    ---

    --

    F

    -

    Example8.4.3:--

    ------

    -

    -

    ----

    ------

    -

    -

    Solution

    -

    -

    _

    G

    -

    -

    H_

    G

    -

    -

    --

    F

    B_

    G

    F

    _

    GH

    G__

    G

    -

    B_

    Example8.4.4:---

    F

    --

    _H

    --

    _

    -FH

    --

    _

    -F

    H

    PropositionsandPredicates

    285

  • 7/23/2019 TC Reference

    151/180

    Solution

    F

    E

    HHF

    E

    H_H

    E

    H_H

    _

    E

    HH

    _

    E

    HFH

    E

    HF

    H

    Example8.4.5:---

    _

    ---F_

    -

    Solution

    _

    E_

    GF

    B

    Example8.4.6:--

    F

    B

    B

    F

    BF

    -

    Solution:

    F

    B

    F

    BF

    ---

    Example8.4.7:--

    _

    G

    _

    G_

    --

    K

    -

    -

    --

    286

    TheoryofAutomata,FormalLanguagesandComputation

    _

    G

    B

    _

    G_

    Solution

    _

    G

    E

    G

    F

    G

    E

    G

    F

    G

    G

    F

    E

    F

    G

    F

    G

    F

    G

    F

    E

    F

    G

    F

    E

    _

    G_

    --

    Example8.4.8:----

    -

    ----

    -

    ---

    ---

    -

    ----

    --

    ---

    Solution

    --

    -

    F

    r

    _

    r

    -

    --

    r

    --

    -

    -

    --

    r

    r

    r

    r

    PropositionsandPredicates

    287

  • 7/23/2019 TC Reference

    152/180

    --

    --

    G

    -

    --

    Example8.4.9:-

    -

    --

    --

    -

    --

    -

    -

    Solution

    -

    -

    -

    -

    H_

    r

    H

    FH

    r

    _

    r

    _

    r

    H

    F

    r

    H

    _H

    r

    FH

    r

    H

    r

    _

    r

    r

    H

    r

    _H

    r

    B---

    Example8.4.10:

    F

    F

    r

    H

    F

    -

    Solution

    F

    F

    F

    _

    _

    F

    288

    TheoryofAut


Recommended