boolean isTerminated() {
    return patterns.isEmpty() || patterns.stream().allMatch(PlanMatchPattern::isTerminated);
  }
A PlanMatchingState is a list of patterns representing a potential match for the sources of a
PlanMatchNode. There is a 1:1 correspondence between the elements of the patterns and the
sources.

<p>Example: During the matching process, a PlanMatchingState with patterns [pattern1, pattern2]
is generated while visiting a PlanNode with sources [sourceA, sourceB]. The matching process will
attempt the following matches: [pattern1 : sourceA, pattern2 : sourceB]
iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/plan/relational/planner/assertions/PlanMatchingState.java