Regular Language: Difference between revisions
Jump to navigation
Jump to search
imported>Mon Jed Liu No edit summary |
mNo edit summary |
||
(5 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
{{subpages}} | {{subpages}} | ||
In computing theory, a regular [[language]] is one that is accepted by a [[finite automaton]]. | In computing theory, a '''regular [[language]]''' is one that is accepted by a [[finite automaton]]. | ||
== Equivalent Characterizations == | == Equivalent Characterizations == | ||
* <math>A</math> is a regular language. | * <math>A</math> is a regular language. | ||
* <math>A</math> is accepted by a [[deterministic finite automaton]]. | * <math>A</math> is accepted by a [[deterministic finite automaton]](DFA). | ||
* <math>A</math> is accepted by a [[non-deterministic finite automaton]]. | * <math>A</math> is accepted by an [[alternating finite automaton]](AFA). | ||
* <math>A</math> can be described by a [[regular expression]]. | * <math>A</math> is accepted by a [[non-deterministic finite automaton]](NFA). | ||
* <math>A</math> is accepted by a [[generalized non-deterministic finite automaton]](GNFA). | |||
* <math>A</math> can be described by a [[regular expression]](RE). | |||
== Closure Properties == | == Closure Properties == | ||
Line 14: | Line 16: | ||
Suppose <math>A, B \subseteq \Sigma^*</math> are regular languages. Then the following languages are also regular. | Suppose <math>A, B \subseteq \Sigma^*</math> are regular languages. Then the following languages are also regular. | ||
* <math>A \cup B = \{x ~|~ x \in A | * <math>A \cup B = \{x ~|~ x \in A\ \mathrm{or}\ x \in B\}</math> ([[union]]) | ||
* <math>A \cap B = \{x ~|~ x \in A | * <math>A \cap B = \{x ~|~ x \in A\ \mathrm{and}\ x \in B\}</math> ([[intersection]]) | ||
* <math>\bar{A} = \{x \in \Sigma^* ~|~ x \not\in A\}</math> ([[complement]]) | * <math>\bar{A} = \{x \in \Sigma^* ~|~ x \not\in A\}</math> ([[complement (computer language)]]) | ||
* <math>AB = \{xy ~|~ x \in A | * <math>AB = \{xy ~|~ x \in A\ \mathrm{and}\ y \in B\}</math> ([[concatenation]]) | ||
* <math>A^* = \{x_1 x_2 \ldots x_n ~|~ n \geq 0 | * <math>A^* = \{x_1 x_2 \ldots x_n ~|~ n \geq 0\ \mathrm{and}\ x_i \in A,~1 \leq i \leq n\}</math> ([[asterate]]) | ||
* <math>A - B = \{x - y ~|~ x \in A\ \mathrm{and}\ y \in B\}</math> ([[difference]]) | |||
* <math>A^R = \{x^R|~ x \in A\ \}</math> ([[reversal]]) | |||
Regular languages are also closed under homomorphic images and preimages. Suppose <math>C \subseteq \Gamma^*</math> is a regular language and <math>h : \Sigma^* \to \Gamma^*</math> is a [[string homomorphism]]. Then the following languages are regular. | Regular languages are also closed under homomorphic images and preimages. Suppose <math>C \subseteq \Gamma^*</math> is a regular language and <math>h : \Sigma^* \to \Gamma^*</math> is a [[string homomorphism]]. Then the following languages are regular. | ||
* <math>h(A) = \{h(x) ~|~ x \in A\} \subseteq \Gamma^*</math> (homomorphic [[image]]) | * <math>h(A) = \{h(x) ~|~ x \in A\} \subseteq \Gamma^*</math> (homomorphic [[image]]) | ||
* <math>h^{-1}(C) = \{x ~|~ h(x) \in C\} \subseteq \Sigma^*</math> (homomorphic [[preimage]]) | * <math>h^{-1}(C) = \{x ~|~ h(x) \in C\} \subseteq \Sigma^*</math> (homomorphic [[preimage]])[[Category:Suggestion Bot Tag]] |
Latest revision as of 16:01, 10 October 2024
In computing theory, a regular language is one that is accepted by a finite automaton.
Equivalent Characterizations
- is a regular language.
- is accepted by a deterministic finite automaton(DFA).
- is accepted by an alternating finite automaton(AFA).
- is accepted by a non-deterministic finite automaton(NFA).
- is accepted by a generalized non-deterministic finite automaton(GNFA).
- can be described by a regular expression(RE).
Closure Properties
Suppose are regular languages. Then the following languages are also regular.
- (union)
- (intersection)
- (complement (computer language))
- (concatenation)
- (asterate)
- (difference)
- (reversal)
Regular languages are also closed under homomorphic images and preimages. Suppose is a regular language and is a string homomorphism. Then the following languages are regular.