From dmiles@teknowledge.com  Tue Nov 14 21:55:58 2000
Received: from teknowledge.com (pop.teknowledge.com [128.136.192.13])
	by swi.psy.uva.nl (8.9.3/8.9.3) with ESMTP id VAA29235
	for <prolog@swi.psy.uva.nl>; Tue, 14 Nov 2000 21:55:56 +0100 (MET)
Received: from Jordan [192.168.200.145] by teknowledge.com [192.168.100.10]
	with SMTP (MDaemon.v2.8.7.5.R)
	for <prolog@swi.psy.uva.nl>; Tue, 14 Nov 2000 12:52:44 -0800
From: "Douglas Miles" <dmiles@teknowledge.com>
To: "Ed Kovach" <ekovach@franuniv.edu>, <prolog@swi.psy.uva.nl>
Subject: RE: problems with asserta.
Date: Tue, 14 Nov 2000 13:00:04 -0800
Message-ID: <DKEMIAGOABLKKCIMBHCIGEOGCAAA.dmiles@teknowledge.com>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
Importance: Normal
In-Reply-To: <000a01c04e7b$1c9a6bc0$3520a8c0@cis78vyz68.franuniv.edu>
X-MDaemon-Deliver-To: prolog@swi.psy.uva.nl
X-Return-Path: dmiles@teknowledge.com

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:ekovach@franuniv.edu]
> Sent: Tuesday, November 14, 2000 12:40 PM
> To: prolog@swi.psy.uva.nl
> 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 ekovach@franuniv.edu
> 
> 
> 
> 
> 
> ----------------
> * To UNSUBSCRIBE, please use the HTML form at
> 
>     http://www.swi.psy.uva.nl/projects/SWI-Prolog/index.html#mailinglist
> 
> or send mail to prolog-request@swi.psy.uva.nl 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/
> 
> 
> 

