code: def _theorem6p2():
      
      pruning_set2 = set()
  
      def _prune2(x, a, nbrs_a):
          frozen_nbrs_a = frozenset(nbrs_a)
          for i in range(len(x)):
              key = (tuple(x[0:i]), a, frozen_nbrs_a)
              if key in pruning_set2:
                  return True
          return False
  
      def _explored2(x, a, nbrs_a):
          prunable = (tuple(x), a, frozenset(nbrs_a))  # (s,a,N(a))
          pruning_set2.add(prunable)
          return prunable
  
      def _finished2(prunable):
          pruning_set2.remove(prunable)
  
      return _prune2, _explored2, _finished2
docs: See Theorem 6.2 in paper.
      Prunes (x,...,a) when (x,a) is explored and a has the same neighbour set in both graphs.