Re: Prologs with Occurs Check constantly on?



On 2011-10-12, Jan Burse <janburse@xxxxxxxxxxx> wrote:
Jan Wielemaker schrieb:
As Ulrich pointed out, the world of unification with occurs-check
combines poorly with the world of cyclic terms. This was the main
conclusion from a debate whether A=f(A), unify_with_occurs_check(A,_)
should succeed or fail.

Yes, remember something.

That requires much than simply emitting different
unification instructions.

Agreed!

In a first round, the burden would be on the
end-user to guarantee that his mix and match
does work.

That smells a lot as trying to mix type-checked and non-type-checked
code as Tom did in his demo type-checker. Complicated stuff and I'd
rather do something with typing :-)

The problem is that when you have the occurs
check off and no cyclic terms, your Prolog
system is anyway not safe in the first place.

I probably don't need to give you examples,
but here is one:

?- X=f(X), Y=f(Y), X=Y.

I guess it will hang in 75% of the Prolog
systems, or is it 95%?

I may hope not. On this example, hanging or crashing systems are ISO
compliant, but I sincerely hope we left this era behind us.

Cheers --- Jan
.



Relevant Pages

  • Re: Destructive assignments (Was: Win from call/n)
    ... It might help you to note that all you show is rather in favor of cyclic terms as first-class citizens, and the troubles are all yours. ... is not possible in pure FOL. ... the original Prolog. ... recursion of predicates, but it is also possible that there ...
    (comp.lang.prolog)
  • Re: Destructive assignments (Was: Win from call/n)
    ... have and does not need cyclic terms. ... Prolog has object and meta level mixed. ... is not possible in pure FOL. ... recursion of predicates, but it is also possible that there ...
    (comp.lang.prolog)
  • Re: Prologs with Occurs Check constantly on?
    ... combines poorly with the world of cyclic terms. ... In a first round, the burden would be on the ... Prolog system might infinitely hang, ... throwing a stack overflow error or some heap ...
    (comp.lang.prolog)
  • Update: Consistency check.
    ... >From time to time I've revisited my exercise, ... I recognize that I'm still a novice at Prolog, ... passes expressions until they can be proven impossible, ... cyclic terms. ...
    (comp.lang.prolog)
  • Re: Destructive assignments (Was: Win from call/n)
    ... the term rewriting community, type checking community, ... With cyclic terms unwanted typing like the Y ... Note that Prolog is a *lowest* level programming language. ...
    (comp.lang.prolog)