how to access prolog from tcl?(not using tcl/tk interface from prolog) 
Author Message
 how to access prolog from tcl?(not using tcl/tk interface from prolog)

hi, I am now doing my thesis project relate to mobile agent technology
which need to access prolog from tcl.

There are a lot of prologs which have the function to access tcl
from prolog, but I need to access prolog from tcl.(I can not use the
method that first load prolog, then access tcl via the interface, and
reload prolog).

So is there any one can help me or give me some tips to solve this
problem?

Now I can only found one article to solve this
problem( http://www.*-*-*.com/ ). I tried the code,
but unfortunately, the terminal always crashed and did not give any
response when I run the second command of its example---"%
prolog::init". I could run the command of "plcon -s interp.pl -t main
-q" in DOS terminal without problem. Originally I thought it is the
version problem of tcl, so I changed it from 8.4.9 to 8.0.3, but the
problem was still there. My SWI-prolog version is 3.1.2. My operating
system is winXP.

I am now very nervous about that, Please give me some help to solve
this problem, or tell me some other way to access prolog from tcl.
Thank you very much



Mon, 25 Jun 2007 09:15:49 GMT  
 how to access prolog from tcl?(not using tcl/tk interface from prolog)
I did not give up the solution of
(http://tkoutline.sourceforge.net/wiki/38).
Now I changed SWI-prolog version to 5.4.4. When I run the second
command(prolog::init) of the example from wish.exe, it pop up a
window, said that

Prolog interpreter closed unexpectedly
Prolog interpreter closed unexpectedly
while executing
"error "Prolog interpreter closed unexpectedly""
(procedure "prolog::unexpectedPrologOutput" line 4)
invoked from within
"prolog::unexpectedPrologOutput fileb50590"

Then I changeed to run the command from tclsh.exe, the second
command can pass, but when I run the third command(prolog::prolog
assert(child(a,b)).), it also report error

% source c:/prolog.tcl
% prolog::init
% prolog::prolog assert(child(a,b)).
wrong # args: should be "close"
while executing
"close $interp"
(procedure "prolog::getPrologResults" line 6)
invoked from within
"prolog::getPrologResults file931988"



Mon, 25 Jun 2007 09:17:41 GMT  
 how to access prolog from tcl?(not using tcl/tk interface from prolog)
I tried the program under redhat linux, then it works without any
problem. I am strange why it can not run under winXP? is there any one
can solve this problem, because I have to do my project under windows


Tue, 26 Jun 2007 03:19:21 GMT  
 how to access prolog from tcl?(not using tcl/tk interface from prolog)
I have solved the problem.

the problem is in this line:
set prologInterp  [open "|c:/prolog/bin/plcon -s interp.pl -t main -q"
r+]

Originally I just copy interp.pl to the folder of c:/prolog/bin/ as I
think plcon could find interp.pl under the same folder, but it seems
that it can not find it and report error whne i run "prolog::init".
Today I add the path in front of interp.pl, then the problem has solved.



Thu, 28 Jun 2007 03:23:48 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Manipulating prolog terms in a tcl/tk interface

2. Prolog interface to Tcl/Tk

3. Prolog interface to Tcl/Tk

4. Using Tcl/Tk in Prolog

5. Using Tcl/Tk with SICStus Prolog on Win 95

6. X interface in Quintus prolog or C(C++) interface in Quintus prolog

7. TCL "tickle" interfaces to Quintus Prolog

8. Tcl interface with SWI-Prolog?

9. how to access prolog from tcl?

10. Tk/Tcl interface to access to SQL

11. SWI prolog + Tcl/Tk

12. question regarding prolog and tcl/tk

 

 
Powered by phpBB® Forum Software