Suppose that we have a method of always inferring the type of a variable in a dynamic language. And suppose we would like to know if an algorithm, A will halt or not. We can construct a new algorithm, B
function B()
if(halts(A))
a = "lol, I'm a string"
else
a = 1337
end
print(a)
end
We use the method to find out what the type of a will be when it is printed. If a is a string, then A halts. If a is an int, then A will not halt.