extracted rete pseudoequivalency functionality to separate file