bottom up constraint-based type inference