[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: dynamic clauses in gprolog
From: |
James_Dean |
Subject: |
Re: dynamic clauses in gprolog |
Date: |
Tue, 8 May 2001 19:16:26 -0400 |
Tia,
I think you need to make 'pred' dynamic.
The assertion of pred(A,B) is failing because pred(a,b) already exists, and
thus a static predicate
is being redefined. If you make it dynamic, it should work ok.
:- dynamic(pred/2).
I believe there was another conversation on this recently.
- Jim
Tia Watts <address@hidden>@gnu.org on 05/08/2001 10:47:20 AM
Sent by: address@hidden
To: address@hidden
cc: (bcc: James Dean/CAM/Lotus)
Subject: dynamic clauses in gprolog
I have been trying (unsuccessfully) to declare a predicate as dynamic in
gprolog - Would someone be able to supply me with some examples?
Here is what I have been trying:
Given a .pl file that contains:
pred(a,b).
makepred(A,B) :- assertz(pred(A,B)).
If I load this file and enter:
| ?- makepred(c,d).
I receive the error message:
uncaught exception:
error(permission_error(modify,static_procedure,pred/2),assertz/1)
Thank you for any insights you can provide!
Tia Watts
address@hidden