Question: Suppose that during type inference, a compiler generates the following constraints to be solved: = bool int r ; = int bool Solve those constraints
Suppose that during type inference, a compiler generates the following constraints to be solved:
= bool int r ; = int bool
Solve those constraints by the unification algorithm below. You need to write down the steps during constraint solving.
rules



Unify( ) 11, the empty substitution . Unity((r,-72); E) Unity(E) if T-72 Unify((a-r); E) [ | o (Unify(Ela TD) if (r is not a free variable in T Unify( ) 11, the empty substitution . Unity((r,-72); E) Unity(E) if T-72 Unify((a-r); E) [ | o (Unify(Ela TD) if (r is not a free variable in T
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
