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

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

import vcsn a = vcsn.Q.expression('(<1/2>a*+<1/3>b*)*').automaton() a
Image in a Jupyter notebook
a.info(details=1)
{'number of final states': 3, 'number of initial states': 1, 'number of states': 3, 'number of transitions': 6, 'number of useful states': 3}
a.info(details=2)
{'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>'}
a.info('type')
'mutable_automaton<letterset<char_letters(ab)>, q>'
a.info(details=3)
{'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>'}
a.info('number of states')
3