def match(self, subject: Expression) -> Iterator[Tuple[Pattern, Substitution]]:
        """Match the given subject against all patterns in the sequence matcher.

        Args:
            subject:
                The subject that is matched. Must be constant.

        Yields:
            A tuple :code:`(pattern, substitution)` for every matching pattern.
        """
        if not isinstance(subject, self.operation):
            return

        subjects = list(op_iter(subject))
        flatterms = [FlatTerm(o) for o in subjects]

        for i in range(len(flatterms)):
            flatterm = FlatTerm.merged(*flatterms[i:])

            for index in self._net._match(flatterm, collect=True):
                match_index = self._net._patterns[index][1]
                pattern, first_name, last_name = self._patterns[match_index]
                operand_count = op_len(pattern.expression) - 2
                expr_operands = subjects[i:i + operand_count]
                patt_operands = list(op_iter(pattern.expression))[1:-1]

                substitution = Substitution()
                if not all(itertools.starmap(substitution.extract_substitution, zip(expr_operands, patt_operands))):
                    continue

                try:
                    if first_name is not None:
                        substitution.try_add_variable(first_name, tuple(subjects[:i]))
                    if last_name is not None:
                        substitution.try_add_variable(last_name, tuple(subjects[i + operand_count:]))
                except ValueError:
                    continue

                for constraint in pattern.constraints:
                    if not constraint(substitution):
                        break
                else:
                    yield pattern, substitution
Match the given subject against all patterns in the sequence matcher.

        Args:
            subject:
                The subject that is matched. Must be constant.

        Yields:
            A tuple :code:`(pattern, substitution)` for every matching pattern.