fix procedure?
add tests for tagged type predicates