dfa.py 文件源码

python
阅读 31 收藏 0 点赞 0 评论 0

项目:revex 作者: lucaswiman 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号