Machine-translated by Google. Questions are authored in English.
Top

Discussion

Why do some implementations omit the occurs check?

  • A.The standard for the language expressly forbids performing the check
  • B.It costs time and the failing case arises rarely in practice
  • C.The check is impossible to implement efficiently at all
  • D.Omitting it makes the procedure complete rather than sound

Answer: B

Testing every binding for occurrence adds cost to the innermost operation of the system, and programs that would trigger it are uncommon, so many implementations trade soundness for speed while providing a sound unification predicate for those who need it. Implementability is not the obstacle, completeness is unaffected, and standards permit both. A known unsoundness accepted deliberately, with an escape hatch provided, is a defensible engineering position provided it is documented.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.