implement the constraint inference, still need to solve the constraint though