From lopez@lcc.uma.es  Wed Nov 15 13:40:05 2000
Received: from correo.uma.es (correo.uma.es [150.214.40.73])
	by swi.psy.uva.nl (8.9.3/8.9.3) with ESMTP id NAA28036
	for <prolog@swi.psy.uva.nl>; Wed, 15 Nov 2000 13:40:04 +0100 (MET)
Received: from sol10.lcc.uma.es (sol10.lcc.uma.es [150.214.108.1])
	by correo.uma.es (8.9.3/8.9.3) with SMTP id NAA07596
	for <prolog@swi.psy.uva.nl>; Wed, 15 Nov 2000 13:39:59 +0100 (MET)
Received: from lcc.uma.es by sol10.lcc.uma.es (SMI-8.6/SMI-SVR4)
	id NAA15045; Wed, 15 Nov 2000 13:39:58 +0100
Message-ID: <3A12840C.3391EB14@lcc.uma.es>
Date: Wed, 15 Nov 2000 13:39:40 +0100
From: Pablo Lopez <lopez@lcc.uma.es>
X-Mailer: Mozilla 4.6 [en] (WinNT; I)
X-Accept-Language: en
MIME-Version: 1.0
CC: prolog@swi.psy.uva.nl
Subject: Re: problems with asserta.
References: <200011142210.LAA10547@atlas.otago.ac.nz>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

 
> 
>         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)).
> 
> 
>         ERROR: No permission to modify static_procedure 'fib/2'
>         ^ Exception: (14) asserta(fib(3,2)) ?

?- help(dynamic).
dynamic +Functor/+Arity, ...
    Informs  the interpreter  that  the definition  of the  predicate(s)
    may  change  during  execution (using  assert/1  and/or  retract/1).
    Currently  dynamic/1  only stops  the interpreter  from  complaining
    about  undefined  predicates  (see  unknown/2).     Future  releases
    might  prohibit  assert/1  and retract/1  for  not-dynamic  declared
    procedures.

Hi Jan,

Thus according to the documentation that should not be an error.
Am I missing the point?

Best, 

   - Pablo

