TIE: A CHR-based Type Inference Engine