Intermediate Compilers & Programming Language Theory
Q41 / 100

What is the Hindley-Milner type inference algorithm?

Correct! Well done.

Incorrect.

The correct answer is B) A unification-based algorithm inferring the most general (principal) type for every expression in a polymorphic type system without annotations

B

Correct Answer

A unification-based algorithm inferring the most general (principal) type for every expression in a polymorphic type system without annotations

Explanation

HM (Algorithm W): unification variables, constraint generation, unification to solve constraints. Infers ∀a. [a] → Int for length :: [a] → Int. Decidable for Hindley-Milner; undecidable for System F (full second-order).

Progress
41/100