Re: ASSERT in SWI Prolog
- From: "Advait" <advait_raut@xxxxxxxxxxxxxx>
- Date: 15 Aug 2006 06:06:25 -0700
Hi
Mika wrote:
Hello to all,
I must resolve the following problem:
given one list of facts
fact1.
fact2.
fact3.
fact4.
fact5.
I want to replace a fact with a new fact to insert in the same
position of that replacing, as an example if I want to replace fact2
with a new fact fact6, then the DB becomes therefore:
fact1.
fact6.
fact3.
fact4.
fact5.
in order to eliminate a fact from the DB I use ' retract', but as I
make to insert a new fact in one precise position? It can be to
resolved only using ' asserta' and ' assertz'? Thanks.
You cannot have control on the order of facts.
Test this ...
%%%%% START of KB %%%%%%%%%
a.
s.
d.
f.
%%%%% END of KB %%%%%%%%%%
Open this file in SWI interpreter and
?- listing.
Now see the result.
yours
Advait
.
- Follow-Ups:
- Re: ASSERT in SWI Prolog
- From: russell kym horsell
- Re: ASSERT in SWI Prolog
- References:
- ASSERT in SWI Prolog
- From: Mika
- ASSERT in SWI Prolog
- Prev by Date: Re: ASSERT in SWI Prolog
- Next by Date: Re: ASSERT in SWI Prolog
- Previous by thread: Re: ASSERT in SWI Prolog
- Next by thread: Re: ASSERT in SWI Prolog
- Index(es):
Relevant Pages
|
|