Subject: Re: problems with asserta.

From: "Ed Kovach" <[email-masked]>
Date: Tue, 14 Nov 2000 16:05:47 -0500

Doug,

Thanks!  When I tried using dynamic. I didn't use the :- before it!

Ed
-----Original Message-----
From: Douglas Miles <[email-masked]>
To: Ed Kovach <[email-masked]>; [email-masked]
<[email-masked]>
Date: Tuesday, November 14, 2000 4:09 PM
Subject: RE: problems with asserta.

>Ed,
>
>:-dynamic(fib/2).
>
> fib(1,1).
> fib(2,1).
> fib(N,F) :-
>      N > 2,
>      N1 is N - 1, fib(N1, F1),
>      N2 is N - 2, fib(N2, F2),
>      F is F1 + F2,
>      asserta(fib(N,F)).
>
>-Douglas
>
>> -----Original Message-----
>> From: Ed Kovach [mailto:[email-masked]]
>> Sent: Tuesday, November 14, 2000 12:40 PM
>> To: [email-masked]
>> Subject: problems with asserta.
>>
>>
>> Hi,
>>
>> I am trying to use asserta,but  I keep getting an error.  Here is
>> an example
>> of my problem.
>> (The code to generate the fibonacci series.)
>>
>>
>> fib(1,1).
>> fib(2,1).
>> fib(N,F) :-
>>      N > 2,
>>      N1 is N - 1, fib(N1, F1),
>>      N2 is N - 2, fib(N2, F2),
>>      F is F1 + F2,
>>      asserta(fib(N,F)).
>>
>>
>>
>> The message I get is
>>
>> ERROR: No permission to modify static_procedure 'fib/2'
>> ^ Exception: (14) asserta(fib(3,2)) ?
>>
>> What am I doing wrong?  Thanks for your help!
>>
>> Ed Kovach [email-masked]
>>
>>
>>
>>
>>
>> ----------------
>> * To UNSUBSCRIBE, please use the HTML form at
>>
>>     http://www.swi.psy.uva.nl/projects/SWI-Prolog/index.html#mailinglist
>>
>> or send mail to [email-masked] using the Subject:
>> "unsubscribe"
>> (without the quotes) and *no* message body.
>>
>> ** An ARCHIVE of this list is maintained at
>>
>>     http://www.swi.psy.uva.nl/projects/SWI-Prolog/mailinglist/archive/
>>
>>
>>
>