info-gnuprologjava
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Info-gnuprologjava] Adding facts to environment dynamicly


From: Dominik Schmeiser
Subject: [Info-gnuprologjava] Adding facts to environment dynamicly
Date: Sun, 5 Jun 2011 14:32:21 +0200
User-agent: RoundCube Webmail/0.1

Hi all,

Me and my collegue are working with GPJ on an project for the university.
we have a Prolog-Environment which already loaded some facts. (using
environment.ensureLoaded(...))

e.g.
foo(bar1).
foo(bar2).

Now we try to invoke a rule (using interpreter.execute(...)).
This rule should create some new facts in the environment,

e.g.
invoke :- assert( foo(bar3) ).

Our problem:
When we use the predicate "assert" t is not recognized:
- gnu.prolog.vm.PrologException: error(existence_error(procedure,assert /
1),error)
When we try "asserta" or "assertz" we have another error that implies we
would like to override the facts which are already in the environment:
- gnu.prolog.vm.PrologException:
error(permission_error(modify,static_procedure,foo / 1),error)

Our question:
Is there any possibility to add facts to the environment dynamicly?

Please note that I'm not on the mailing list so please reply directly.

TIA

Dominik






reply via email to

[Prev in Thread] Current Thread [Next in Thread]