YAPEngine

YAP Engine: creates an execution environment where we can run goals.

Public Function:

1. YAPEngine::YAPEngine(YAPEngineArgs *cargs):

1. YAPEngine::YAPEngine(int argc, char argv[], YAPCallback callback=(YAPCallback *) NULL): : construct a new engine, including aaccess to callbacks

construct a new engine using argc/argv list of arguments kill engine

1. YAPEngine::~YAPEngine():

1. void YAPEngine::delYAPCallback(): : remove current callback

1. void YAPEngine::setYAPCallback(YAPCallback *cb): : set a new callback

1. void YAPEngine::run(char *s): : execute the callback.

/void [run()][1a2737b81a74a93c59657cf982c5b72554] { if (_callback) _callback.run(); } execute the callback with a text argument. stop yap

1. void YAPEngine::close(): : execute the callback with a text argument.

1. bool YAPEngine::hasError(): : build a query on the engine

1. YAPQuery * YAPEngine::query(const char *s):

1. YAPQuery * YAPEngine::query(YAPTerm t): : build a query from a term

1. YAPQuery * YAPEngine::qt(Term t): : build a query from a Prolog term (internal)

1. YAPTerm YAPEngine::getTerm(yhandle_t h): : given a handle, fetch a term from the engine

current directory for the engine

1. bool YAPEngine::call(YAPPredicate ap, YAPTerm ts[]): : current directory for the engine

1. bool YAPEngine::goal(YAPTerm Yt, YAPModule module, bool release=false):

1. bool YAPEngine::mgoal(Term t, Term tmod, bool release=false): : ru1n a goal in a module.

By default, memory will only be fully recovered on backtracking. The release option ensures backtracking is called at the very end. current directory for the engine

1. bool YAPEngine::goal(YAPTerm t, bool release=false):

1. bool YAPEngine::goal(Term t, bool release=false): : reset Prolog state

1. void YAPEngine::reSet(): : assune that there are no stack pointers, just release memory for last execution

1. void YAPEngine::release(): : call load_files to load a file in a module

called when a query must be terminated and its state fully recovered,

1. bool YAPEngine::load_file(std::string FileName, std::string module="user"): : call load_files to load a library(file) in a module

1. bool YAPEngine::load_library(std::string FileName):

1. Term YAPEngine::top_level(std::string s):

parse string s and make term with var names available.

1. Term YAPEngine::next_answer(YAPQuery *&):

parse string s and make term with var names available.

1. Term YAPEngine::fun(Term t):

1. YAPTerm YAPEngine::funCall(YAPTerm t):

1. bool YAPEngine::load_text(std::string text, std::string *module=nullptr): : load a string as if it was a file.

1. const char * YAPEngine::currentDir():

1. const char * YAPEngine::version(): : report YAP version as a string

1. bool YAPEngine::setStringFlag(std::string arg, std::string path):

Private-func:

1. void YAPEngine::doInit(YAP_file_type_t BootMode, YAPEngineArgs *cargs):

1. PredEntry * YAPEngine::rewriteUndefEngineQuery(PredEntry *ap, Term &t, Term tmod):

Public-attrib:

1. std::string YAPEngine::port: : < construct a new engine; may use a variable number of arguments

Private-attrib:

1. YAPEngineArgs* YAPEngine::engine_args:

1. YAPCallback* YAPEngine::_callback:

1. YAPError YAPEngine::yerror:

1. YAPError YAPEngine::e: