def has_finite_language(self): # type: () -> bool
"""
Returns True iff this DFA recognizes a finite (possibly empty) language.
Based on decision procedure described here:
http://math.uaa.alaska.edu/~afkjm/cs351/handouts/non-regular.pdf
- Remove nodes which cannot reach an accepting state (see
`_acceptable_subgraph` above).
- Language is finite iff the remaining graph is acyclic.
"""
return nx.is_directed_acyclic_graph(self._acceptable_subgraph)
评论列表
文章目录