0

I have recently started studying Formal Language Theory and having some problems with finite and infinite languages.

I have been told that all finite languages are regular.

However, reading through the notes given to me, a grammar with productions:

S --> ab

S --> aabb

S --> aaabbb

Is not a regular language although the productions generate a finite number of strings.

However, a grammar with the productions:

S --> Sb

S --> Tb

T --> Ta

T --> a

Which generate strings of the form a^m b^n, which is an infinite list of strings yet this language is defined as regular?

Could anyone help me to understand in simple terms? Would be really appreciated as I am struggling.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
user3650602
  • 175
  • 2
  • 10

1 Answers1

0

Questions on theory might get quicker answers in https://cs.stackexchange.com/, however there are still people who can answer here.

You are forgetting that the relationship is not symmetric. All finite languages are regular, but not all regular languages are finite. In the same way all regular languages are context free but not all context free languages are regular. The relationship is nicely illustrated in Cleaveland, J.C. & Uzgalis, R.C. (1977) Grammars For Programming Languages, Elsevier North Holland, pp.20:

Classification of languages

Community
  • 1
  • 1
Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129