nfa.py 文件源码

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

项目:simone 作者: matheuspb 项目源码 文件源码
def _determinize_state(self, states_set: Set[str]) -> None:
        """
            For a given set of states, verify whether they pertains to the
            actual states of the FA. In negative case, add it and insert
            the transitions properly
        """
        name = "".join(sorted(states_set))
        if name and name not in self._states:
            self.add_state(name)
            if states_set.intersection(self._final_states):
                self._final_states.add(name)
            for symbol in self._alphabet:
                reachable = self._find_reachable(states_set, symbol)
                if reachable:
                    self._transitions[name, symbol] = reachable
                    self._determinize_state(reachable)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号