Subject: [SWIPL] Problem with dynamic facts

From: zze-PEX SOR balc031 FTRD/DTL/CAE <[email-masked]>
Date: Tue, 26 Feb 2002 11:01:02 +0100

Hello,

I've got a problem with a dynamic declaration of facts!

In a prolog file, I defined a prolog predicate reduce/3 which calls facts
deduce/5.

>From my C++ program, I can execute a query calling the predicate 'reduce/3'.

If my base of facts is declare in the prolog file, expected result is
correct.

If facts are declare in my C++ program (with the 'assert/1' prolog
predicate') instead, 
an exception is raised during execution:

ERROR: Undefined procedure: deduce/5
ERROR:     However, there are definitions for:
ERROR:         reduce/3

I think this appears because the 'reduce/3' prolog predicate can't find
facts 'deduce/5'.

I supposed this predicate should be declared as dynamic.
So, I added the following line in my prolog file:
:- dynamic
	deduce/5.

... but the expected result is not correct!

Please, could anybody help me?
Thank you

Sylvain C.