unify function rewritten, tycheckexp function must be modified accordingly