add memoize(TriFunction), memoize(TriPredicate)