[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Help- error in executing "retract" predicate
From: |
Nico Di Mauro |
Subject: |
Re: Help- error in executing "retract" predicate |
Date: |
Wed, 27 Feb 2002 16:37:18 +0100 |
Hello Vidhya,
Wednesday, February 27, 2002, 1:52:24 PM, you wrote:
VS> Respected sir/madam,
VS> i am using "SWI-Prolog" to find a solution for
VS> timetabling problem. here is a small piece of code
VS> ================ code ============================
VS> sam(1).
VS> soln:-sam(X),retract(sam(X)),write(success).
VS> ==================================================
VS> this code on execution gives the following
VS> error
VS> ================= error ===========================
VS> [succ].
VS> % succ compiled 0.00 sec, 0 bytes
VS> Yes
VS> ?- soln.
VS> ERROR: No permission to modify static_procedure
VS> `sam/1'
VS> ^ Exception: (7) retract(sam(1)) ? retry
VS> [retry]
VS> ^ Call: (7) retract(sam(1)) ? creep
VS> ERROR: No permission to modify static_procedure
VS> `sam/1'
VS> ^ Exception: (7) retract(sam(1)) ? creep
VS> ======================================================
VS> i want to use "assert" and "retract" to add
VS> facts and delete facts from the database.
VS> can anyone help me to find the error in my
VS> program and to execute these 2 commands
VS> thanking you,
VS> yours faithfully,
VS> vidhya
You must declare the predicate sam as dynamic.
VS> __________________________________________________
VS> Do You Yahoo!?
VS> Yahoo! Greetings - Send FREE e-cards for every occasion!
VS> http://greetings.yahoo.com
VS> _______________________________________________
VS> Users-prolog mailing list
VS> address@hidden
VS> http://mail.gnu.org/mailman/listinfo/users-prolog