<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _theorem6p1():
 """See Theorem 6.1 in paper."""


    pruning_set = set()

    def _prune(x):
        if len(x) <= 2:
            return False
        # this is faster than tuple(x[-3:])
        key = (tuple(x[:-2]), x[-2], x[-1])
        return key in pruning_set

    def _explored(x):
        if len(x) >= 3:
            prunable = (tuple(x[:-2]), x[-1], x[-2])
            pruning_set.add(prunable)

    return _prune, _explored