def satisfier(self, term):  # type: (Term) -> Assignment
        """
        Returns the first Assignment in this solution such that the sublist of
        assignments up to and including that entry collectively satisfies term.
        """
        assigned_term = None  # type: Term

        for assignment in self._assignments:
            if assignment.dependency.name != term.dependency.name:
                continue

            if (
                not assignment.dependency.is_root
                and not assignment.dependency.name == term.dependency.name
            ):
                if not assignment.is_positive():
                    continue

                assert not term.is_positive()

                return assignment

            if assigned_term is None:
                assigned_term = assignment
            else:
                assigned_term = assigned_term.intersect(assignment)

            # As soon as we have enough assignments to satisfy term, return them.
            if assigned_term.satisfies(term):
                return assignment

        raise RuntimeError("[BUG] {} is not satisfied.".format(term))
def satisfier ( self , term ) : assigned_term = None for assignment in self . _assignments : if assignment . dependency . name != term . dependency . name : continue if ( not assignment . dependency . is_root and not assignment . dependency . name == term . dependency . name ) : if not assignment . is_positive ( ) : continue assert not term . is_positive ( ) return assignment if assigned_term is None : assigned_term = assignment else : assigned_term = assigned_term . intersect ( assignment ) if assigned_term . satisfies ( term ) : return assignment raise RuntimeError ( "[BUG] {} is not satisfied." . format ( term ) )
Returns the first Assignment in this solution such that the sublist of
        assignments up to and including that entry collectively satisfies term.