From pexsor.balc031@rd.francetelecom.com Tue Feb 26 11:02:03 2002 Received: from p-mail1.rd.francetelecom.com (p-mail1.rd.francetelecom.com [193.49.124.31]) by swi.psy.uva.nl (8.11.6/8.11.2) with SMTP id g1QA22u08666 for ; Tue, 26 Feb 2002 11:02:03 +0100 (MET) Received: by p-biset.rd.francetelecom.fr with Internet Mail Service (5.5.2653.19) id ; Tue, 26 Feb 2002 11:00:53 +0100 Message-ID: <91A311FF6A85D3118DDF0060080C3D82025ED502@lat3721.rd.francetelecom.fr> From: zze-PEX SOR balc031 FTRD/DTL/CAE To: "'prolog@swi.psy.uva.nl'" Date: Tue, 26 Feb 2002 11:01:02 +0100 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: multipart/mixed; boundary="----=_NextPartTM-000-73e50f9f-29f3-11d6-ac1f-00508b692753" Subject: [SWIPL] Problem with dynamic facts This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------=_NextPartTM-000-73e50f9f-29f3-11d6-ac1f-00508b692753 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C1BEAC.7FB56050" ------_=_NextPart_001_01C1BEAC.7FB56050 Content-Type: text/plain; charset="ISO-8859-1" 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. ------_=_NextPart_001_01C1BEAC.7FB56050 Content-Type: text/html; charset="ISO-8859-1" Problem with dynamic facts

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.

------_=_NextPart_001_01C1BEAC.7FB56050-- ------=_NextPartTM-000-73e50f9f-29f3-11d6-ac1f-00508b692753--