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 <prolog@swi.psy.uva.nl>; 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 <F4K8594C>; Tue, 26 Feb 2002 11:00:53 +0100
Message-ID: <91A311FF6A85D3118DDF0060080C3D82025ED502@lat3721.rd.francetelecom.fr>
From: zze-PEX SOR balc031 FTRD/DTL/CAE
	 <pexsor.balc031@rd.francetelecom.com>
To: "'prolog@swi.psy.uva.nl'" <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"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2653.12">
<TITLE>Problem with dynamic facts</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=2 FACE="Arial">Hello,</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">I've got a problem with a dynamic declaration of facts!</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">In a prolog file, I defined a prolog predicate reduce/3 which calls facts</FONT>
<BR><FONT SIZE=2 FACE="Arial">deduce/5.</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">From my C++ program, I can execute a query calling the predicate 'reduce/3'.</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">If my base of facts is declare in the prolog file, expected result is correct.</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">If facts are declare in my C++ program (with the 'assert/1' prolog predicate') instead, </FONT>
<BR><FONT SIZE=2 FACE="Arial">an exception is raised during execution:</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">ERROR: Undefined procedure: deduce/5</FONT>
<BR><FONT SIZE=2 FACE="Arial">ERROR:&nbsp;&nbsp;&nbsp;&nbsp; However, there are definitions for:</FONT>
<BR><FONT SIZE=2 FACE="Arial">ERROR:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; reduce/3</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">I think this appears because the 'reduce/3' prolog predicate can't find facts 'deduce/5'.</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">I supposed this predicate should be declared as dynamic.</FONT>
<BR><FONT SIZE=2 FACE="Arial">So, I added the following line in my prolog file:</FONT>
<BR><FONT SIZE=2 FACE="Arial">:- dynamic</FONT>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="Arial">deduce/5.</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">... but the expected result is not correct!</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">Please, could anybody help me?</FONT>
<BR><FONT SIZE=2 FACE="Arial">Thank you</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">Sylvain C.</FONT>
</P>

</BODY>
</HTML>
------_=_NextPart_001_01C1BEAC.7FB56050--

------=_NextPartTM-000-73e50f9f-29f3-11d6-ac1f-00508b692753--

