Languages can be either formal or generative.
- Formal: sets of strings composed of symbols from a finite set
- Generative: you can run the machine as a generator to get strings from the language
Properties of languages
-
- if a word belongs to two languages, then it belongs to both languages
-
- if a word belongs to either one of the languages, then it belongs to either L1 or L2
Example
Given and
- :
Automa L1 (riconosce "nlp"):
(q0) --> (q1) --nlp--> [Accept]
Automa L2 (riconosce "is_cool" o "is_fun"):
(q0) --> --is_cool--> q1 [Accept]
\ /
---is_fun---
Automa L3 (riconosce L1 seguito da zero o più elementi di L2):
(q0) --> (q0) --nlp--> (q1)
(q1) --is_cool--> [accept]
--is_fun --> [accept]
[Accept] in q1