From nick24@cityline.ru Mon Oct  1 02:46:15 2001
Received: from pinochet.cityline.ru (pinochet.cityline.ru [195.46.160.34])
	by swi.psy.uva.nl (8.11.2/8.11.2) with ESMTP id f910kFv03205
	for <prolog@swi.psy.uva.nl>; Mon, 1 Oct 2001 02:46:15 +0200 (MET DST)
Received: from home (20.172.10.dn.dialup.cityline.ru [195.46.172.20])
	by pinochet.cityline.ru (8.11.6/t/08-Oct-1998) with SMTP id f910jxn56735
	for <prolog@swi.psy.uva.nl>; Mon, 1 Oct 2001 04:45:59 +0400 (MSD)
Message-ID: <007901c14a12$717d7a40$14ac2ec3@home>
From: "Nick Fedorov" <nick24@cityline.ru>
To: "Prolog Mailing List" <prolog@swi.psy.uva.nl>
Date: Mon, 1 Oct 2001 04:44:49 +0400
MIME-Version: 1.0
Content-Type: text/plain;
	charset="koi8-r"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.50.4807.1700
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700
Subject: [SWIPL] Search mechanism.

Hi.
I try to do this (search task):
--------------
startup    :-    assert(goal(a)), asserta(statement(b)),
                    asserta(statement(c)).

question(R) :-    startup, r(R).    % R is undefined variable

r(R) :-
    goal(X),
    statement(Y),
    ...                              % do some manipulations with X and Y
    asserta(goal(new_val)),
    success(R).                    % success or not?
--------------
?- question(X).
--------------
There are several statement/1 facts and if success/1 fails, then prolog
 makes Redo on <statement(Y)>. I want prolog make Redo on <goal(X)> too,
 but it doesn't (<asserta(goal(new_val))> doesn't update view of database).
Prolog makes Redo on <goal(X)> if several goal/1 facts were asserted
 at startup.

What means
^ Call: ...
^*Call: ...

I tried make recursive r/1:
    ...
    (success(R) ; r(R)).
than it works as I need (prolog see all asserted goals/1), but I got another
 problem I mailed earlier.

Am I right?
How can I force prolog make Redo on goal/1 too? May I update
 database view manualy?

Thank you.




