From tim@menzies.com  Fri Apr 14 16:32:16 2000
Received: from c004.sfo.cp.net (c004-h006.c004.sfo.cp.net [209.228.14.77])
	by swi.psy.uva.nl (8.9.3/8.9.3) with SMTP id QAA06411
	for <prolog@swi.psy.uva.nl>; Fri, 14 Apr 2000 16:32:15 +0200 (MET DST)
Received: (cpmta 6689 invoked from network); 14 Apr 2000 07:32:08 -0700
Received: from 1Cust121.tnt4.morgantown.wv.da.uu.net (HELO oemcomputer) (63.15.80.121)
  by smtp.peoplepc.com with SMTP; 14 Apr 2000 07:32:08 -0700
X-Sent: 14 Apr 2000 14:32:08 GMT
Message-ID: <000701bfa61e$3c507a00$79500f3f@oemcomputer>
From: "Timothy Menzies" <tim@menzies.com>
To: <prolog@swi.psy.uva.nl>
References: <E12g3H5-00048d-00@rzstud1.rz.uni-karlsruhe.de>
Subject: Re: indeterministic ASSERT and RETRACT
Date: Fri, 14 Apr 2000 08:57:54 -0400
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.00.2919.6600
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600

why use the cut?

bassert(X) :- assert(X); retract(X), fail.

bretract(X) :- X,(retract(X);assert(X), fail).

----- Original Message -----
From: "Jan Wedekind" <unoh@rz.uni-karlsruhe.de>
To: <prolog@swi.psy.uva.nl>
Sent: Friday, April 14, 2000 6:24 AM
Subject: indeterministic ASSERT and RETRACT


>    I would like to write an application in prolog, that will extract
> knowledge from english sentences. I think, this program should add
> the learned predicates to the prolog-database by using "assert/1".
>    But the problem is, that "assert/1" has no indeterministic (I think you
> all know this). So I do not now, how to write an indeterministic rule,
which
> will clean up all created predicates on backtracking. Can anyone propose
> a solution for this?
>    The reason, why I am posting to the SWI-Prolog specific mailing-list
is,
> that perhaps there is a possibility to solve this problem by creating a
> new predicate "xassert" with the C-interface. However I do not now, how to
> create such a predicate: The problem is, that after a cut-and-fail
> (..., assertx( ... ), !, fail ) SWI-Prolog does not inform the C-routine
> "PL_assertx" about the failure.
>    If anyone has an answer to this problem, tell me! If there is a simple
> PROLOG-solution for this problem, forgive me!
>
> Jan Wedekind, student at University of Karlsruhe, Germany.
>
>
> ----------------
> * To UNSUBSCRIBE, please use the HTML form at
>
>     http://www.swi.psy.uva.nl/projects/SWI-Prolog/index.html#mailinglist
>
> or send mail to prolog-request@swi.psy.uva.nl using the Subject:
"unsubscribe"
> (without the quotes) and *no* message body.
>
> ** An ARCHIVE of this list is maintained at
>
>     http://www.swi.psy.uva.nl/projects/SWI-Prolog/mailinglist/archive/
>



