f



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://tkoutline.sourceforge.net/wiki/38). 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.

0
emukang
1/6/2005 1:11:22 AM
comp.lang.prolog 3728 articles. 0 followers. Post Follow

5 Replies
709 Views

Similar Articles

[PageSpeed] 38

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"

0
emukang
1/6/2005 1:16:58 AM
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

0
emukang
1/6/2005 7:01:59 PM
emukang wrote:
> 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).

I don't know whether it will work under Windows, but you might be
interested in "wafe" (Wafe = Tcl + Xt + WidgetSets + Extensions):
http://nestroy.wi-inf.uni-essen.de:8080/wafe/

It uses a 2-way pipe to communicate between a front end (e.g., using
tcl) and a backend (e.g., using Prolog, Perl, Python, whatever):

+----------+    text Tcl commands    +----------+
|          |   -------pipe-------->  |          |
|   App    |                         |   Wafe   |
|          |    text responses       |          |
|          |   <------pipe--------   |          |
+----------+                         +----------+

This is a very nice way of doing UIs, which unfortunately has been
almost entirely ignored - Java's SwingUtilities.invokeLater() has some
of this feel but doesn't seem as clean a design to me.

0
peter
1/8/2005 7:17:13 AM
thank you very much for your reply. I have checked it, but it does not
support windows:(
I tried the script under win2000, still the same problem as under
winXp.
I also found another tool which named
Tclpro(http://cswww.essex.ac.uk/SNAP/Chris_Fox/), it also use pipe to
communicate with prolog, but it also can not work under windows(works
nice under linux). So I am wonder if there is some problems with pipe
of windows system?
Is there any one have other suggest?

0
emukang
1/8/2005 1:10:43 PM
now i 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.

0
emukang
1/8/2005 7:22:37 PM
Reply:

Similar Artilces:

Why Not Prolog in Prolog ?
Prolog can do anything that C or C++ can do. But for the 2 outstanding prolog systems , SWI- and GNU prolog , the source codes are not written in prolog . Why not ? If only it was in prolog ! Really if only !! On 28 Apr 2006 18:27:44 -0700, newser.bbs@bbs.ee.ncu.edu.tw wrote: >Prolog can do anything that C or C++ can do. >But for the 2 outstanding prolog systems , SWI- and GNU prolog , >the source codes are not written in prolog . >Why not ? Do this yourself. A.L. On 28 Apr 2006 18:27:44 -0700 newser.bbs@bbs.ee.ncu.edu.tw wrote: > Prolog can do anything that C or C++ ca...

how to access prolog from tcl?
hi, dear friends, 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://tkoutline.sourceforge.net/wiki/38). I tried the code, but unfortunately, the terminal always crashed and did not gi...

Prolog compiler in Prolog?
Is there a Prolog compiler written in Prolog? If so, where can I get it? If not, why not? On Oct 9, 12:32=A0am, gerald.brit...@gmail.com wrote: > Is there a Prolog compiler written in Prolog? =A0If so, where can I get i= t? =A0If not, why not? The kernel of ECLiPSe (http://eclipseclp.org) is an efficient implementation of standard (Edinburgh-like) Prolog - incremental compiler to virtual machine code. Since version 6 compiler itself is written in Prolog. On Sat, 08 Oct 2011 14:32:53 -0700, gerald.britton wrote: > Is there a Prolog compiler written in Prolog? If so, where can I get...

Tcl interface with SWI-Prolog?
Hello all Does anyonw know if there a interface to invoque SWI-Prolog from tcl. Thanks in advance ...

why not use LISP-imp of Prolog as opposed to Prolog itself?
is there an actual reason to use swi-prolog or the like as opposed to just use an implementation of Prolog in Lisp? it seems Prolog is a special-purpose language and the turingcompleteness is fairly pointless and just there for the cause of being turingcomplete. and thus better to have a real general-purpose language with prolog implemented in that language so you can easily write your application and then dont have to run code between 2 different languages. or how big of a fool am i? this is just my quick/first impression of prolog. http://www.amazon.com/gp/product/1558601910/002-6413815-3...

[TCL/TK interface] Passing variable to TCL/TK
Hi, I am trying to sent to a variable to tcl/tk and unify there it with a string. I wrote the prolog code: :- use_module(library(tcltk)). :- use_package(classic). go(A):- tk_new([name('Simple')], Tcl), tcl_eval(Tcl, 'source simple2.tcl', _), tcl_eval(Tcl, ['ask', br(write(A))], _), tk_main_loop(Tcl), tcl_delete(Tcl). and the tcl file simple2.tcl proc ask {var} { unify_term $var my_value } unfortunatelly when I query for go(S). the interpeter goes into a loop (!?). Where I am wrong. Are there any example code somewhere i...

Simulating PROLOG inside PROLOG!
Imagine if you could cut down on all the PROLOG RULES f(a,b,c) :- g(a,b) , h(b,c). and just use SINGLE FACTS! if( g(a,b)&h(b,c) , f(a,b,c)). This would greatly simplify tracing the program run and give you more control over the facts and implications you manipulate! -----LOG13.PRO---- less(0,X). iif( less(X,Y) , less(Y,Z) , less(X,Z)). %TRANSITIVE RULE t(less(X,Y)) :- less(X,Y). t(R) :- if(L,R), t(L). t(N) :- iif(E,W,N) , t(E), t(W). less(1,2). less(2,3). less(3,4). --------------------- You might recognize MODUS PONENS t(R) <- if(L,R) &...

It seems that I found prolog in prolog
Please look at : http://www2.info.ucl.ac.be/people/PVR/Peter.thesis/aquarius_compiler.html But I don't see the low level codes in it . Anyone finds those codes ? newser.bbs@bbs.ee.ncu.edu.tw escreveu: > Please look at : > http://www2.info.ucl.ac.be/people/PVR/Peter.thesis/aquarius_compiler.html > > But I don't see the low level codes in it . > Anyone finds those codes ? > Did you read what's written in these pages: http://www2.info.ucl.ac.be/people/PVR/aquarius.html http://www.info.ucl.ac.be/people/PVR/user_manual.ps http://www2.info.ucl.ac.be/people/PVR/Pet...

turbo prolog or visual prolog
SGVsbG8KCr3QsN2zb/nYprO1TKRIqM+lznR1cmJvIHByb2xvZyAyLjAgb3IgdmlzdWFsIHByb2xv ZyA1LjEuCgpUaGFua3MK zu61 wrote: > Hello > > �аݳo�ئ��L�H�ϥ�turbo prolog 2.0 or visual prolog 5.1. > > Thanks What is your question? 55SoIHR1cmJvIHByb2xvZ+WvqwoK5L6L5aaCCkNsYXVzZXMKY3VwKDEpLiBjdXAoMikuIGN1cCgz KS4Kc29ydF9jdXAoWik6LSBjdXAoQSksIGN1cChCKSwgQTw+QiwKd3JpdGVmKOKAnFRoZSBtZXRo b2QgaGF2ZSAlMiwlMiwlMuKAnSxOLCBBLCBCKSwgbmwsIForMT1ZLCBzb3J0X2N1cChZKS4KCuir i+WVj+aAjuaoo+WcqFdyaXRmKOKApi5O4oCmLiksIOmAmeWAi07lnLDmlrnliqDkuIrkuIDlgIvm rKHluo/omZ/norw/CuaIkeW4jOacm+W+l+WIsOetlOahiOaYrwoxICAxLCAx...

communicate with Prolog engine in Prolog
Hello, Interfaces from other programming languages L to Prolog usually enable the L programmer to say something like "give me the next n solutions and then wait for more instructions" to Prolog. Usually you can use in L a Prolog query object which has a method "nextSolution()" or the like. Can I do this in Prolog itself, too? In other words, can I write a Prolog program that uses ";" just as a human would use ";" in a Prolog shell? Simon Simon Strobl wrote: > Hello, > > Interfaces from other programming languages L to Prolog usually enable &...

Using Tcl::Tk Module with Tcl/Tk 8.5
Not sure if this is the right place for this question, as it is with relation to the Tcl::Tk module, rather than Perl/Tk specifically. I'd like to use Tcl::Tk with Tcl/Tk 8.5 rather than 8.4. To that end, on a clean Debian Testing system I have installed only Tcl/Tk 8.5 and also finally managed to install the Tcl::Tk module. I was having problems installing the Tcl-0.95 module, which Tcl::Tk depends on, but fixed it with a specific include path call: >sudo perl Makefile.PL --tclsh /usr/bin/tclsh8.5 --tclconfig /usr/lib/tcl8.5/tclConfig.sh --include /usr/include/tcl8.5 Fo...

Canna Prolog
Hi all, I'm writing a prolog system/compiler for the .net platform. Currently it's still in a early stage, but I'd like to receive feedbacks and suggestion. I put it on Gotdotnet: http://codegallery.gotdotnet.com/cannaprolog Cheers Gabriele Cannata ...

Prolog vs Visual-Prolog
I know it does not make much sense, but anyhow here it is: Is there any reasonably recent study, which Prolog is most widely used in the market? I guess that Visual Prolog may be the most widely used dialect. I don't know how Sicstus fares in comparison. Among the free versions it seems that gnu-prolog is more widely used than swi-prolog, at least Google yields more hits. Andreas ------- Although the moon is smaller than the earth, it is farther away. On 2007-01-15, Andreas Kochenburger <akk@nospam.com> wrote: > I know it does not make much sense, but anyhow here it is: > ...

Web resources about - how to access prolog from tcl?(not using tcl/tk interface from prolog) - comp.lang.prolog

Interface - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

Dictionary.com Dictionary & Thesaurus goes 7.0 with interface improvements
... especially for longtime users of the app like me. Fortunately, here comes version 7.0 of the app to the rescue with a handful of welcome interface ...

Disney CEO & Apple board member Bob Iger calls Apple TV best television interface ever
... Executive Bob Iger said in an interview on Monday, praising Apple for creating what he believes is the most intuitive television user interface ...

Playing around with BMW’s 7 Series gesture control user interface
... we showed you Dragon Drive , the voice-activation system that's now included in BMW's 7 Series. That's not the only advanced user interface ...

Firefox 43 adds new block list, updates Android user interface
Mozilla has rolled out Firefox 43 FINAL for Windows, Mac and Linux, with Firefox 43 for Android due to follow imminently. The desktop build ...

Samsung Shows Off New Smart Remote and Interface for Their Smart TVs
... hubs in 2016. On top of extensive smart home control by way of SmartThings , the company’s line of smart TVs will also be getting a user interface ...

IDG Contributor Network: Post-acquisition, LastPass rolls out new version with more user interface bling ...
... exists, revenue streams are sure to eventuate. The new version of LastPass, imaginatively called LastPass 4.0, has an entirely new user interface ...

Android’s design guru says iPhone interface is ‘heavy and burdensome’
The arrival of the original iPhone may have fundamentally changed Google’s plans for its Android smartphone platform, but according to Google’s ...

Sling TV Plans New Interface And Guide That Predicts What Users Want
... Sling CEO Roger Lynch says that the service won’t hike the price this year. He also said that later this quarter it will roll out a new interface, ...

Day of the Tentacle Remastered's slick interface works flawlessly
When we learned at the PlayStation Experience keynote that Day of the Tentacle Remastered was releasing March 2016, I wrote that it had been ...

Resources last updated: 1/24/2016 4:06:12 PM