Tree-automata-based run-time type constraints for miniKanren