Fix predicate tag comparison, make it stricter.
Fix pointer predicate tag comparison.
Add function that builds all the others.

In the process of this I realized that there was much regularity
to be exploited, and I removed some special cases to simplify the
main logic.