automaton.info(key=None, details=2)

A dictionary of facts about an automaton.

Arguments:

  • keys: if specified, return just the corresponding result.
  • details: level of details, from 1 to 3
    • 1: number of states and transitions
    • 2: number of useful states, cheap facts to compute (e.g., whether valid, proper, etc.)
    • 3: also facts costly to compute (e.g., whether ambiguous, etc.)

See also:

Examples

In [1]:
import vcsn
a = vcsn.Q.expression('(<1/2>a*+<1/3>b*)*').automaton()
a
Out[1]:
%3 I0 0 0 I0->0 F0 F1 F2 0->F0 ⟨6⟩ 1 1 0->1 ⟨3⟩a 2 2 0->2 ⟨2⟩b 1->F1 ⟨6⟩ 1->1 ⟨4⟩a 1->2 ⟨2⟩b 2->F2 ⟨6⟩ 2->1 ⟨3⟩a 2->2 ⟨3⟩b
In [2]:
a.info(details=1)
Out[2]:
{'number of final states': 3,
 'number of initial states': 1,
 'number of states': 3,
 'number of transitions': 6,
 'number of useful states': 3}
In [3]:
a.info(details=2)
Out[3]:
{'is codeterministic': False,
 'is complete': True,
 'is deterministic': True,
 'is empty': False,
 'is eps-acyclic': True,
 'is normalized': False,
 'is proper': True,
 'is standard': True,
 'is trim': True,
 'is useless': False,
 'is valid': True,
 'number of accessible states': 3,
 'number of coaccessible states': 3,
 'number of codeterministic states': 1,
 'number of deterministic states': 3,
 'number of final states': 3,
 'number of initial states': 1,
 'number of lazy states': 0,
 'number of spontaneous transitions': 0,
 'number of states': 3,
 'number of transitions': 6,
 'number of useful states': 3,
 'type': 'mutable_automaton<letterset<char_letters(ab)>, q>'}
In [4]:
a.info('type')
Out[4]:
'mutable_automaton<letterset<char_letters(ab)>, q>'
In [5]:
a.info(details=3)
Out[5]:
{'is ambiguous': False,
 'is codeterministic': False,
 'is complete': True,
 'is cycle ambiguous': False,
 'is deterministic': True,
 'is empty': False,
 'is eps-acyclic': True,
 'is normalized': False,
 'is proper': True,
 'is standard': True,
 'is synchronizing': True,
 'is trim': True,
 'is useless': False,
 'is valid': True,
 'number of accessible states': 3,
 'number of coaccessible states': 3,
 'number of codeterministic states': 1,
 'number of deterministic states': 3,
 'number of final states': 3,
 'number of initial states': 1,
 'number of lazy states': 0,
 'number of spontaneous transitions': 0,
 'number of states': 3,
 'number of strongly connected components': 2,
 'number of transitions': 6,
 'number of useful states': 3,
 'type': 'mutable_automaton<letterset<char_letters(ab)>, q>'}
In [6]:
a.info('number of states')
Out[6]:
3