Asserta and Dynamic 
Author Message
 Asserta and Dynamic

Hello, I write a Prolog program which translates natural language sentences
about chess into play, and the reverse.
I use GPROLOG.

For this, I need to assert some predicates that describe the situation of
the game.   There is one predicate "case" which is :
case(When,Where,What,Player), for instance
case(0,[5,1],king,white) at the beginning.

I need to asserta case(_,_,_,_), but gprolog complains that it is not
dynamic.   I put dynamic(case(_,_,_,_)) in the code, before any call to
case, but it still tells me an error.

What is wrong ??

(thanks in advance)



Thu, 23 Jun 2005 11:28:44 GMT  
 Asserta and Dynamic

Quote:

> Hello, I write a Prolog program which translates natural language sentences
> about chess into play, and the reverse.
> I use GPROLOG.

> For this, I need to assert some predicates that describe the situation of
> the game.   There is one predicate "case" which is :
> case(When,Where,What,Player), for instance
> case(0,[5,1],king,white) at the beginning.

> I need to asserta case(_,_,_,_), but gprolog complains that it is not
> dynamic.   I put dynamic(case(_,_,_,_)) in the code, before any call to
> case, but it still tells me an error.

> What is wrong ??

> (thanks in advance)

   Try

            :- dynamic(case/4).



Thu, 23 Jun 2005 16:34:41 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Question on asserta/1

2. Lisp version of asserta(x).

3. Dynamic Loading and dynamic linking

4. dynamic class hierarchies, dynamic changes to multimethods ?

5. Dynamic Timestamp in Dynamic SQL?

6. Dynamic web pages! not Dynamic HTML

7. Dynamic declaration of dynamic clauses?

8. Static vs Dynamic Typing: Effects on Productivity?

9. Bloch on dynamic typing

10. Creating collections - dynamic list operator {...}

11. Creating collections - dynamic list operator - braces

12. Dynamic Functions

 

 
Powered by phpBB® Forum Software