Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. HJoshy

    Factorial in Prolog and C++

    # include files term_t tf; term_t tx; term_t goal_term; functor_t goal_functor; int main( int argc, char** argv ) { argv[0] = "libpl.dll"; PL_initialise( argc, argv ); PlCall( "consult( swi( 'plwin.rc' ) )" ); PlCall( "consult(...
  2. HJoshy

    XPCE Prolog command causing error in VS2008 C++

    * @ is apparently unknown! It is loaded by the 'rc' file in the SWI home dir and realizes the XPCE binding. I should load this by hand, using: consult( swi( 'plwin.rc' ) ) All my pl and xpce source files were compiled successfully. I am interfacing C++ and Prolog to connect a cognitive...
  3. HJoshy

    XPCE Prolog command causing error in VS2008 C++

    Upon loading into a C++ program a Prolog program that contains the command 'send' (xpce graphics), I get error messages of type: Syntax Error: Operator Expected. Here is an example command that causes the errors: send( Dialog, append, button(continue, message(@prolog...
  4. HJoshy

    Factorial in Prolog and C++

    Here is a simpler version of my problem, if someone could please help me: I would like to work out a number's factorial. My factorial rule is in a Prolog file and I am connecting it to a C++ file. Can someone please tell me what is wrong with my interfacing C++ to Prolog? my factorial.pl...
  5. HJoshy

    Factorial in Prolog and C++

    I would like to work out a number's factorial. My factorial rule is in a Prolog file and I am connecting it to a C++ code. Can someone tell me what is wrong with my C++ interface please? % factorial.pl factorial( 1, 1 ):- !. factorial( X, Fac ):- X > 1...
  6. HJoshy

    Avoiding plld in VS2008

    Here is my code in its entirety; in response to my own posting (Avoiding plld in VS2008). Trying "listing." at the Prolog prompt that pops up when I run the program confirms that my Prolog source code has been loaded (consulted). #include <iostream> #include <fstream>...
  7. HJoshy

    Avoiding plld in VS2008

    Thanks for the reply Joel. What I mean is that how can I consult (compile) my Prolog program from within VS2008 C++ code without having to use plld.exe? Normally, when I write a C++ program to call Prolog and vice versa, and I press F5 to build and compile it, my Prolog code doesn't get...
  8. HJoshy

    Avoiding plld in VS2008

    Hello, I have a large Prolog program with lots of predicates. I need to connect to this Prolog code from C++ (VS2008) to obtain certain query results. So I am NOT trying to embed Prolog in C++ as a logical engine, but for my C++ program to connect to my Prolog code and obtain query...
  9. HJoshy

    Prolog foreign-interfacing with C++

    I have a simple Prolog source code (Hanoi.pl) containing the code for solving the Hanoi Towers puzzle: hanoi( N ):- move( N, left, middle, right ). move( 0, _, _, _ ):- !. move( N, A, B, C ):- M is N-1, move( M, A, C, B ), inform( A, B ), move( M, C, B, A ). inform( X...

Part and Inventory Search

Back
Top