srfs.py 文件源码

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

项目:lomap 作者: wasserfeder 项目源码 文件源码
def has_empty_language(model, trivial=False):
    '''
    Checks if the language associated with the model is empty. It verifies if
    there are any self-reachable final states of the model which are also
    reachable from some initial state.

    Parameters
    ----------
    model : Model
       A finite system model.
    trivial: boolean
       Specify if self-loops are allowed in the definition of self-reachability.
    By default, self-loops are not allowed.

    Returns
    -------
    empty : boolean
       True if the language is empty.

    See Also
    --------
    networkx.networkx.algorithms.components.strongly_connected.strongly_connected_components
    self_reachable_final_states
    product

    Note
    ----
    This function is intended to be used on product automata.
    '''
    return len(self_reachable_final_states(model, trivial)) == 0
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号