Article View: net.lang.prolog
Article #1Interesting Cprolog 1.5 bug
From: Wayne Citrin
Date: Sat, 08 Nov 1986 19:23
Date: Sat, 08 Nov 1986 19:23
25 lines
1610 bytes
1610 bytes
Here's an interesting bug in Cprolog 1.5 that I stumbled upon. Take the following program: main :- foo(_), replace_foo, fail. foo(1). replace_foo :- retract(foo(_)), assert(foo(2)), !. (The cut is needed to remove the choice point set up by the retract, but that's another bug.) Run this program by issuing the query ?- main. The program terminates and fails. The call to foo/1 in main does not set up a choice point because there is only one clause in foo at the time the call is made. This is the behavior one would expect. Now, put the interpreter in debug mode and issue the same query. The program loops and never terminates. The call to foo in main now has a choice point, and there is always a new choice due to the asserted clause. This actually happened to me yesterday. What use is a debugger that introduces new bugs? Wayne Citrin (ucbvax!citrin)
Technical Details
Message-ID:
<16352@ucbvax.BERKELEY.EDU>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp!utzoo!mnetor!seismo!lll-crg!nike!ucbcad!ucbvax!citrinShow Full Headers
Complete Article Headers
Message-ID: <16352@ucbvax.BERKELEY.EDU> Subject: Interesting Cprolog 1.5 bug Date: Sat, 08 Nov 1986 19:23:18 +0000 From: citrin@ucbvax.BERKELEY.EDU (Wayne Citrin) Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp!utzoo!mnetor!seismo!lll-crg!nike!ucbcad!ucbvax!citrin Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Newsgroups: net.lang.prolog Article-I.D.: ucbvax.16352 Posted: Sat Nov 8 19:23:18 1986 Date-Received: Sun, 9-Nov-86 03:46:01 EST Reply-To: citrin@ucbvax.Berkeley.EDU.UUCP (Wayne Citrin) Organization: University of California at Berkeley Lines: 24