Talk:Occurs check

Latest comment: 8 years ago by Wlodr in topic complexity without occur check

I replaced the dangling link "logical variable" by a link into "First-order logic#Terms" in introduction section.

I have suggestions regarding the following points of the article:

  • In section "Algorithm", the shown algorithm does not provide much new insight as it just defines "occurscheck(x,t)" by "x occurs in t". I'd suggest to omit the algorithm box. Alternatively, a recursive Prolog (or Ml) definition of the predicate (or boolean function) that test whether x occurs in t could be given.
  • The goal of syntactic unification in general should be restated in this article. Thereafter, it'd be easier to explain that e.g. has no solution among finite terms, but has one among infinite terms. I'll try to draw a picture showing the introduction of a cycle in this case, if occurs check is omitted.
Meanwhile, I added an example picture; resulting in a poor overall page layout, however. If the picture shall be kept, somebody should improve the page layout. Jochen Burghardt (talk) 23:02, 15 May 2013 (UTC)Reply
  • In section "Application in theorem proving", the conclusion that "is only valid if is the identity", seems at least misleading in the Prolog context, where a solution of is sought rather than trying to prove . While the latter property is in fact valid only if is the identity, the former is valid if has any fixpoint. For example has two solutions, viz. and .
  • In section "Prolog implementation", I suggest to write more precisely "some Prolog implementations omit the occurs check ... ", "most ...", or "all current ..."; I don't have the appropriate information, however.
  • As far as I know, Colmerauer released Prolog II in the 1980ies, which could handle infinite trees; a related article reference could be [1] I have this reference, but not the article itself.
  1. ^ Alain Colmerauer, Equations and Inequations on Finite and Infinite Trees, ICOT, Proc. Int. Conf. on Fifth Generation Computer Systems, p.85-99, 1984

Jochen Burghardt (talk) 07:54, 15 May 2013 (UTC)Reply

complexity without occur check edit

There is a funny error in the statement on complexity of unification without occur check. The error has been there in many Prolog manuals for more than 30 years. The following statement (now at the page) is plainly incorrect.

By not performing the occurs check, the worst case complexity of unifying a term   with term   is reduced from   to  ;

It implies that arbitrarily big terms can be compared in constant time, by unifying eq(t1,t2) with eq(X,X).

I am going to change it by adding "in many cases", and abandoning the reference to a Prolog manual: F. Pereira, D. Warren, D. Bowen, L. Byrd, L. Pereira (1983). C-Prolog's User's Manual Version 1.2 (Technical report). SRI International. Retrieved 21 June 2013.{{cite tech report}}: CS1 maint: multiple names: authors list (link)

--Wlodr (talk) 20:17, 24 October 2015 (UTC)Reply