Subject: Re: problems with asserta.

From: Pablo Lopez <[email-masked]>
Date: Wed, 15 Nov 2000 13:39:40 +0100

> 
>         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