|
@@ -5,6 +5,7 @@
|
|
## Operations on languages
|
|
## Operations on languages
|
|
An operation defined on a language, applies to (and is definable over) each string in the language.
|
|
An operation defined on a language, applies to (and is definable over) each string in the language.
|
|
$$L^R=\{|x=y^R\wedge y\in L\}$$
|
|
$$L^R=\{|x=y^R\wedge y\in L\}$$
|
|
|
|
+
|
|
#### Prefix-free language
|
|
#### Prefix-free language
|
|
$$\text{prefix}(L)=\{y|x=yz\wedge x\in L\wedge y,z\neq\varepsilon\}$$
|
|
$$\text{prefix}(L)=\{y|x=yz\wedge x\in L\wedge y,z\neq\varepsilon\}$$
|
|
In the language there is not any string that is prefix of another.
|
|
In the language there is not any string that is prefix of another.
|
|
@@ -12,8 +13,10 @@ $$\text{prefix(L)} \cap L=\Phi$$
|
|
|
|
|
|
#### Concatenation
|
|
#### Concatenation
|
|
$$L'L''=\{xy|x\in L' \wedge y \in L''\}$$
|
|
$$L'L''=\{xy|x\in L' \wedge y \in L''\}$$
|
|
|
|
+
|
|
#### m-th power (m≥0)
|
|
#### m-th power (m≥0)
|
|
$$L^m=L^{m-1}L,m>0\;\;L^0=\{\varepsilon\}$$
|
|
$$L^m=L^{m-1}L,m>0\;\;L^0=\{\varepsilon\}$$
|
|
|
|
+
|
|
#### Strings of finite length
|
|
#### Strings of finite length
|
|
The language of the strings that have a length not greater than an integer k
|
|
The language of the strings that have a length not greater than an integer k
|
|
$$L=\{\varepsilon,a,b\}^3 \;k=3$$
|
|
$$L=\{\varepsilon,a,b\}^3 \;k=3$$
|
|
@@ -24,13 +27,16 @@ $$L\{a,b\}\{\varepsilon,a,b\}^2$$
|
|
---
|
|
---
|
|
### Set-theoretic Operations
|
|
### Set-theoretic Operations
|
|
Are traditional operators of set theory, like __union__ $\cup$, __intersection__ $\cap$, __complement__ $\lnot$, also __strict inclusion__, __inclusion__, __equality__, __inequality__...
|
|
Are traditional operators of set theory, like __union__ $\cup$, __intersection__ $\cap$, __complement__ $\lnot$, also __strict inclusion__, __inclusion__, __equality__, __inequality__...
|
|
|
|
+
|
|
#### Universal language
|
|
#### Universal language
|
|
The set of all strings defined over the alphabet $\Sigma$, also called __free monoid__.
|
|
The set of all strings defined over the alphabet $\Sigma$, also called __free monoid__.
|
|
|
|
+
|
|
#### Complement of a language
|
|
#### Complement of a language
|
|
over the alphabet $\Sigma$ is the set-theoretic difference between the universal language and the given language
|
|
over the alphabet $\Sigma$ is the set-theoretic difference between the universal language and the given language
|
|
$$\lnot L =L_{universal} \setminus L$$
|
|
$$\lnot L =L_{universal} \setminus L$$
|
|
>The complement of a finite language is always an infinite language
|
|
>The complement of a finite language is always an infinite language
|
|
The complement of ain infinite language may be infinite or finite.
|
|
The complement of ain infinite language may be infinite or finite.
|
|
|
|
+
|
|
#### Set-theoretic difference
|
|
#### Set-theoretic difference
|
|
$$L_1\setminus L_2$$
|
|
$$L_1\setminus L_2$$
|
|
Is the language containing all the strings of $L_1$ that __are not part__ of $L_2$
|
|
Is the language containing all the strings of $L_1$ that __are not part__ of $L_2$
|
|
@@ -41,6 +47,7 @@ Also called __Kleene star__ or __concatenation closure__.
|
|
Is the union of all powers of a language, for every positive or null exponent.
|
|
Is the union of all powers of a language, for every positive or null exponent.
|
|
$$L^*=\bigcup_{h=0...\infty}L^h=L^0\cup L^1\cup L^2...=\varepsilon\cup L^1\cup L^2...$$
|
|
$$L^*=\bigcup_{h=0...\infty}L^h=L^0\cup L^1\cup L^2...=\varepsilon\cup L^1\cup L^2...$$
|
|
$$L=\{ab,ba\}\;L^*=\{\varepsilon,ab,ba,abab,abba,baab,baba,...\}$$
|
|
$$L=\{ab,ba\}\;L^*=\{\varepsilon,ab,ba,abab,abba,baab,baba,...\}$$
|
|
|
|
+
|
|
#### Properties:
|
|
#### Properties:
|
|
- monotonic
|
|
- monotonic
|
|
- closed w.r.t. Concatenation
|
|
- closed w.r.t. Concatenation
|