Jump to content

Regular Grammar

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1
Apprentice123

Apprentice123

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 430 posts
Describe a regular grammar that generates the regular language of all strings in {0,1} that do not contain two consecutive 0's

S->A
A->0B | 1A | E
B->1A | E

E is empty

Are correct ?

#2
ferovac

ferovac

    Learning Programmer

  • Members
  • PipPipPip
  • 84 posts
i dont thnk you need 3 states 2 would be just fine

A->1A|0B|E
B->1A|E

think this would do, correct me if i'm wrong it's been a while since i've done regular expressions

but besides that the grammar is OK