Alternation (formal language theory)

Source: Wikipedia, the free encyclopedia.

In formal language theory and pattern matching, alternation is the union of two sets of strings, or equivalently the logical disjunction of two patterns describing sets of strings.

finite automata for unions of two regular languages that are themselves defined by finite automata is central to the equivalence between regular languages defined by automata and by regular expressions.[4]

Other classes of languages that are closed under alternation include context-free languages and recursive languages. The vertical bar notation for alternation is used in the SNOBOL language and some other languages. In formal language theory, alternation is

associative
. This is not in general true of the form of alternation used in pattern-matching languages, because of the side-effects of performing a match in those languages.

References

  1. ^ .
  2. .
  3. ^ "Alternation with The Vertical Bar". regular-expressions.info. Retrieved 2021-11-11.
  4. .

Bibliography