Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download
Views: 45894
Kernel: Python 3

automaton.complement

Produce an automaton that accepts the complement of the language of the input automaton.

Precondition:

  • the labelset is free

  • the weightset is B\mathbb{B}

  • the automaton is complete

  • the automaton is deterministic

Postcondition:

  • Result.is_complete()

  • Result.is_deterministic()

See also:

Examples

import vcsn b = vcsn.context('lal_char(abc), b')
a = b.expression('a+b').standard().determinize().complete() a
Image in a Jupyter notebook

The prefix operator ~ invokes complement().

~a
Image in a Jupyter notebook
c = a.complement() c
Image in a Jupyter notebook
a.shortest(2)

ab\mathit{a} \oplus \mathit{b}

c.shortest(10)

εcaaabacbabbbccacb\varepsilon \oplus \mathit{c} \oplus \mathit{aa} \oplus \mathit{ab} \oplus \mathit{ac} \oplus \mathit{ba} \oplus \mathit{bb} \oplus \mathit{bc} \oplus \mathit{ca} \oplus \mathit{cb}