Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

how to join java and prolog.
hi,

i have to write a program which need to call prolog from java and then
return query result from prolog to java.
i am a beginner of prolog and know only basic of prolog.
for my case, now , i am trying to use JPL , SWI prolog and for java
site, i use JBuilder6.

i cannot find the latest version of JPL ( get only JPL 1.0.0.1)and i
cannot find any examples and can't join java and prolog via JPL.


is there some example showing step by step for both java and prolog
sites.
is there any tools ( interface) simpler than JPL.

SWI prolog can run as background?

pls, help me out!

sincerely,

kks


Report this thread to moderator Post Follow-up to this message
Old Post
kks
04-08-05 08:58 AM


Re: how to join java and prolog.
I don't know prolog but I recall in java there was a way to call
functions form external languages. Perhaps it would have been good to
cross post to the Java goup. I also saw a papper on javalog.

Where is what a google search brings up.
http://www.google.ca/search?hl=en&q=javalog&meta=


Report this thread to moderator Post Follow-up to this message
Old Post
JohnCreighton_@hotmail.com
04-08-05 08:58 AM


Re: how to join java and prolog.
You could possibly use the Runtime library and call the prologue file
externally, then capture the output through a stream.

I don't know if it will work, but it is an option: eg

Process proc = Runtime.getRuntime().exec("pl args file.pl");
DataInputStream result = new DataInputStream(prog.getInputStream())

So look at prolog "saved state" which allows you to run prologue file
as app rather than through the interpreter.

You can then capture the output and use it as you like.

hope it helps, i'm no expert, but it is a way you could look into that
shouldn't be too hard.


Report this thread to moderator Post Follow-up to this message
Old Post
gorans@students.cs.mu.oz.au
04-08-05 01:58 PM


Re: how to join java and prolog.
kks a écrit :
> hi,
>
> i have to write a program which need to call prolog from java and then
> return query result from prolog to java.
> i am a beginner of prolog and know only basic of prolog.
> for my case, now , i am trying to use JPL , SWI prolog and for java
> site, i use JBuilder6.
>
> i cannot find the latest version of JPL ( get only JPL 1.0.0.1)and i
> cannot find any examples and can't join java and prolog via JPL.
>
>
> is there some example showing step by step for both java and prolog
> sites.
> is there any tools ( interface) simpler than JPL.
>
> SWI prolog can run as background?
>
> pls, help me out!
>
> sincerely,
>
> kks
>

you have to get the source of swi, inside the source of jpl lib, there's
a lot of examples for both side (java in prolog, and prolog in java)
have a look to this link
it may be usefull
http://groups.google.fr/groups?hl=f...btnG=Rechercher

Report this thread to moderator Post Follow-up to this message
Old Post
Djamé Seddah
04-08-05 01:58 PM


Re: how to join java and prolog.
JPL is quite simple. You can find many examples in the directory
examples/java_interface in the B-Prolog package (for Windows). I guess these
examples also run with SWI and K-Prolog (you need to change the package
name).

Neng-Fa Zhou


"kks" <khinsu@karate.com> wrote in message
news:1112934664.828092.89190@f14g2000cwb.googlegroups.com...
> hi,
>
> i have to write a program which need to call prolog from java and then
> return query result from prolog to java.
> i am a beginner of prolog and know only basic of prolog.
> for my case, now , i am trying to use JPL , SWI prolog and for java
> site, i use JBuilder6.
>
> i cannot find the latest version of JPL ( get only JPL 1.0.0.1)and i
> cannot find any examples and can't join java and prolog via JPL.
>
>
> is there some example showing step by step for both java and prolog
> sites.
> is there any tools ( interface) simpler than JPL.
>
> SWI prolog can run as background?
>
> pls, help me out!
>
> sincerely,
>
> kks
>


Report this thread to moderator Post Follow-up to this message
Old Post
Neng-Fa Zhou
04-08-05 09:00 PM


Re: how to join java and prolog.
You might want to try out Jinni 2005 - a pure Java-based Prolog
compiler that allows to easily intermix Java Prolog code using Java's
reflection, see

http://www.binnetcorp.com

By avoiding interfaces that involve C/C++ native code as the Prolog
engine, you can easily run  your programs as applets or Web services
and you benefit from the simplicity, portability and low maintenance
costs of a single platform solution.

Paul Tarau


Report this thread to moderator Post Follow-up to this message
Old Post
ptarau@yahoo.com
04-09-05 01:58 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Prolog archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 06:58 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.