Пример #1
0
 def is_stable(af: ArgumentationFramework, arg_set: frozenset) -> bool:
     """
     Verify whether arg_set is a stable extension by
     taking the set of arguments which are not attacked by arg_set
     and then testing if this set is equal to arg_set
     Besnard & Doutre (2004) Checking the acceptability of a set of arguments.
     """
     # "the set of arguments which are not attacked by S and then testing if this set is equal to S"
     not_attacked_by_arg_set = af.arguments - af.attacked_by(arg_set)
     return arg_set == frozenset(not_attacked_by_arg_set)
Пример #2
0
    def is_complete(af: ArgumentationFramework, arg_set: frozenset) -> bool:
        """
        Verify whether the arg_set is a complete extension by
        Compute the set of arguments defended by arg_set,
        the set of arguments not attacked by S and then
        to test if their intersection is equal to arg_set.
        Besnard & Doutre (2004) Checking the acceptability of a set of arguments.
        """
        attacked_by_arg_set = af.attacked_by(arg_set)
        defended_by_arg_set = set()
        for arg in af.arguments:
            attackers = set(af.graph.predecessors(arg))
            if attackers.issubset(attacked_by_arg_set):
                defended_by_arg_set.add(arg)

        not_attacked_by_arg_set = af.arguments - attacked_by_arg_set
        intersection = defended_by_arg_set.intersection(
            not_attacked_by_arg_set)
        return arg_set == frozenset(intersection)