I’m using: SWI-Prolog version 8.0.2 on Ubuntu Linux 18.04.
I have now converted my code from being mostly residenton the PEngines server (loaded at server startup), to being passed to the PEngines instance I create via the src_text
parameter given to the create()
call. I do not get any errors during the create()
call. Also, I set the destroy
option set to false in the create()
call . However, when I try to call one of the predicates found in the code in the src_text
parameter, I get an existence error back from the PEngines instance.
Here is the module declaration at the top of the code passed via the src_text
option during the create()
call:
:- module(
% Module name.
src_text,
% Exported predicates list.
[
pengine_execute_single_user_action/2,
]
).
Here is the goal I pass to the PEngines ask()
method:
Attempting Prolog query: pengine_execute_single_user_action(get_player_location(PlayerLocation),QueryReport)
Here is the error I receive back from the PEngines instance, as seen from my client Node.JS code:
Error: procedure `pengine_execute_single_user_action(A,B)' does not exist
Object received:{
"arg1": "procedure",
"arg2": "pengine_execute_single_user_action('$VAR'(0),'$VAR'(1))",
"code": "existence_error",
"data": "procedure `pengine_execute_single_user_action(A,B)' does not exist",
"event": "error",
"id": "6b057dcc-8ad8-4159-872a-a0c236bb0dca",
"pengine": {
"options": {
"server": "http://localhost:3030/pengine",
"application": "tsll",
"destroy": false,
"src_text": <DELETED TO KEEP THIS POST SHORT>,
"format": "json"
},
"id": "6b057dcc-8ad8-4159-872a-a0c236bb0dca",
"request": {}
}
}
I tried pre-pending the module name to the goal I pass to the PEngines ask()
method, but that didn’t work either:
Attempting Prolog query: src_text:pengine_execute_single_user_action(get_player_location(PlayerLocation),QueryReport)
And now the error changes to this:
Error: procedure `src_text:pengine_execute_single_user_action(A,B)' does not exist
What am I doing wrong?