An inference algorithm for strictness