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

automaton.is_deterministic

Whether the automaton is deterministic:

  • at most one initial state

  • each state is deterministic:

    • at most one transition per label

Precondition:

  • labelset is free

See also:

Examples

import vcsn b = vcsn.context("lal_char(ab), b")

The empty automaton is deterministic.

%%automaton -s a context = "lal_char(ab), b"
Image in a Jupyter notebook
a.is_deterministic()
True

Having more than one initial state makes the automaton not deterministic.

%%automaton -s a $ -> 0 0 -> 1 a 1 -> $ $ -> 2 2 -> 1 b
Image in a Jupyter notebook
a.is_deterministic()
False

Having a state, even unreachable, with two transitions with the same label makes the automaton not deterministic.

%%automaton -s a 0 -> 1 a 0 -> 2 a
Image in a Jupyter notebook
a.is_deterministic()
False