Search:

Type: Posts; User: HJoshy

Page 1 of 2 1 2

Search: Search took 0.00 seconds.

  1. Replies
    1
    Views
    2,934

    PREDICATE( name, arity )

    Suppose I have the program below:


    #include files

    PREDICATE( add, 3 )
    {
    return A3 = (long)A1 + (long)A2;
    }
  2. argv Memory Allocation (updated code)

    Could someone please tell me what I am doing wrong that I get this Unhandled Exception error message:


    0xC0000005: Access violation reading location 0x0000000c.

    with a green pointer...
  3. argv Memory Allocation

    Have attended to my replies and revised my code.

    Now, I was wondering if someone could tell me what I am doing wrong that I get this Unhandled Exception error message:


    0xC0000005: Access...
  4. Replies
    1
    Views
    4,075

    Backtracking plus Hanoi and Factorial

    I have included the complete programs for Hanoi, Factorial, and Backtracking below. I hope beginners will benefit from them. If anybody is not sure about VS2008 settings for interfacing C++ and...
  5. . I have tried that, believe it or not! I...

    .


    I have tried that, believe it or not!

    I have tried all the examples in the SWI manual, including the foreign_t and PL_open_frame to no avail in this Robotics program in VS2008.

    I am in...
  6. . OK, thanks. That was useful. I left: ...

    .


    OK, thanks. That was useful. I left:


    PL_initialise( 1, argv );

    and got rid of the other 'if' check statement.
  7. Good point tabstop, but what do you mean by "ust...

    Good point tabstop, but what do you mean by "ust save the return code from the first time into a variable" ?
  8. Thanks tabstop. I made my argv a fixed-size...

    Thanks tabstop.

    I made my argv a fixed-size array of characters, but the error message is persistent...


    Original:

    I am interfacing C++ and Prolog and I am trying to avoid the plld utility...
  9. How do I do that, given that I am using the above...

    How do I do that, given that I am using the above as a Prolog engine initializer?

    I'm actually trying to avoid plld and foreign_t complications by loading my Prolog sources and initializing them...
  10. Prolog code causing Access Violation error in VS2008

    Does anyone know why including a term such as:


    t = PL_new_term_ref();

    would cause an Unhandled Exception error message:


    0xC0000005: Access violation reading location 0x0000000c.
  11. Replies
    1
    Views
    4,075

    Backtracking Problem

    Could someone please guide me through backtracking in Prolog-C using the simple example below?

    Here is my Prolog file:


    likes( john, mary ).

    likes( john, emma ).

    likes( john,...
  12. # include files term_t tf; term_t tx;...

    # 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";
  13. * @ is apparently unknown! It is loaded by...

    *

    @ 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...
  14. 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...
  15. Interfacing C++ and Prolog to work out factorial

    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...
  16. Replies
    2
    Views
    2,600

    Factorial in C++ and Prolog

    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?



    ...
  17. Replies
    0
    Views
    2,256

    plld Prolog VS2008

    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 logicasl...
  18. SWI-Prolog as an embedded application in VS2008 C++

    I have a C++ application (prog.sln) which is my main program and I want to use Prolog as an embedded logic server (hanoi.pl)

    int main(int argc, char** argv)
    {
    putenv( "SWI_HOME_DIR=C:\\Program...
  19. Replies
    4
    Views
    6,629

    Thanks for letting me know. Actually, mine...

    Thanks for letting me know.

    Actually, mine works fine too, but because I get an error message that indicates my Prolog code is not consulted, I thought perhaps I needed to add pl\bin to my PATH.
    ...
  20. Replies
    4
    Views
    6,629

    VS2008 adding to %PATH%

    Guys,

    How do I add:

    pl\bin

    to my VS2008 PATH?

    I read in a forum post: . . . ensure pl\bin is in %PATH%
  21. By 'consult' I mean compiling my Prolog program....

    By 'consult' I mean compiling my Prolog program.

    The program return something when you type in, say, hanoi(5).



    hanoi( N ):-
    move( N, left, middle, right ).

    move( 0, _, _, _ ):-
  22. Consulting a Prolog file from within a C++ solution file

    I have a Prolog file (Hanoi.pl) containing the code for solving the Hanoi Towers puzzle:

    hanoi( N ):-
    move( N, left, middle, right ).

    move( 0, _, _, _ ):-
    !.

    move(...
  23. Replies
    1
    Views
    2,056

    Adding DLLs to VS2008 IDE

    How do I add Prolog DLLs to VS2008 in order to embed Prolog within C++?

    Are these three dlls sufficient:

    libpl.lib
    plterm.lib
    pthreadVC.lib

    Thanks,
  24. Replies
    1
    Views
    5,479

    (argc, argv) C++ & Prolog

    My question is concerning argv[0].

    I know (in theory) that on Unix, this argument passes the part of the command-line that is used to locate the executable. Prolog uses this to find the file...
  25. Replies
    4
    Views
    2,409

    I added these lines: #pragma comment(lib,...

    I added these lines:

    #pragma comment(lib, "libpl.lib")
    #pragma comment(lib, "plterm.lib")
    #pragma comment(lib, "pthreadVC.lib")
    #pragma comment(dll, "libpl.dll")
    #pragma...
Results 1 to 25 of 26
Page 1 of 2 1 2