[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

asserta and assertz are different???

From: Thorsten Krebs
Subject: asserta and assertz are different???
Date: Wed, 24 Oct 2001 16:47:43 +0200 (MEST)


I am new to GNU Prolog and want to use the C interface for constraint
solving in Prolog. But I have a lot of problems with the sematics of Prolog...

I tried to get a little ample program running which manages a database eith
ancestors. Entries are of the form "parent(bob, mary).". The queries are
realized by "anc(X,Y):-parent(X,Y)." and "anc(X,Z):-parent(X,Y),anc(Y,Z).".

I can insert knowledge by adding (asserting) parents and I also can send
queries. No problem so far!

But when I try to delete parents using retract I see VERY deffierent
behaviour wether I used asserta or assertz. Using assertz the only parent left 
the one I wanted to delete and using asserta my program crashes at the same
step it "worked" before... (???)

Since I don't know Prolog I would really appreciate any help consideing
assert (differences between asserta and assertz) and retract (does this not

Thanks for any answers,

Thorsten Krebs

GMX - Die Kommunikationsplattform im Internet.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]