![]() |
YAP 7.1.0
|
Engine and Query Management. More...
Engine and Query Management.
These classes wrap engine and query An engine is an environment where we can rum Prolog, that is, where we can run queries
Also, supports callbacks and engine configuration
class YAPQuery |
Queries and engines.
Queries
interface to a YAP Query; uses an SWI-like status info internally
Public Member Functions | |
YAPQuery (YAPPredicate p, YAPTerm t[]) | |
main constructor, uses a predicate and an array of terms More... | |
YAPQuery (YAPFunctor f, YAPTerm mod, YAPTerm t[]) | |
full constructor, More... | |
YAPQuery (YAPFunctor f, YAPTerm mod, Term t[]) | |
often, this is more efficient More... | |
YAPQuery (const char *s) | |
functor/term constructor, More... | |
YAPQuery (YAPTerm t) | |
string constructor with just an atom More... | |
void | setFlag (int flag) |
set flags for query execution, currently only for exception handling More... | |
void | resetFlag (int flag) |
reset flags for query execution, currently only for exception handling More... | |
bool | first () |
first query More... | |
bool | next () |
ask for the next solution of the current query same call for every solution More... | |
bool | deterministic () |
does this query have open choice-points? or is it deterministic? More... | |
const char * | text () |
represent the top-goal More... | |
void | close () |
remove alternatives in the current search space, and finish the current query finish the current query: undo all bindings More... | |
void | cut () |
query variables More... | |
Term | namedVars () |
YAPPairTerm * | namedVarTerms () |
std::vector< Term > | namedVarsVector () |
query variables, but copied out More... | |
YAPTerm | getTerm (yhandle_t t) |
convert a ref to a binding More... | |
bool | command () |
simple YAP Query; just calls YAP and reports success or failure, Useful when we just want things done, eg YAPCommand("load_files(library(lists), )") More... | |
![]() | |
YAPPredicate (const char *s0, Term &tout, YAPPairTerm *&names, CELL *&nts) | |
String constructor for predicates. More... | |
YAPPredicate (YAPFunctor f) | |
Functor constructor for predicates. More... | |
YAPPredicate (YAPFunctor f, YAPTerm mod) | |
Functor constructor for predicates, is given a specific module. More... | |
YAPPredicate (YAPAtom at, YAPTerm mod) | |
Name/arity constructor for predicates. More... | |
YAPPredicate (YAPAtom at) | |
Name/0 constructor for predicates. More... | |
YAPPredicate (YAPAtom at, uintptr_t arity, YAPModule mod) | |
Mod:Name/Arity constructor for predicates. More... | |
YAPPredicate (YAPAtom at, uintptr_t arity) | |
Atom/Arity constructor for predicates. More... | |
YAPPredicate (const std::string at, uintptr_t arity, std::string mod="") | |
std::string/Arity constructor for predicates More... | |
YAPPredicate (const char *at, uintptr_t arity) | |
char */arity constructor for predicates More... | |
YAPPredicate (const char *at, uintptr_t arity, YAPTerm mod) | |
char */module constructor for predicates More... | |
YAPPredicate (const char *at, YAPTerm mod) | |
char */module constructor for predicates More... | |
YAPModule | module () |
module of a predicate More... | |
YAPAtom | name () |
name of predicate More... | |
YAPFunctor | functor () |
functor of predicate More... | |
uintptr_t | getArity () |
arity of predicate More... | |
arity_t | arity () |
PredEntry * | predEntry () |
![]() | |
YAPModuleProp (YAPModule tmod) | |
virtual YAPModule | module () |
![]() | |
virtual | ~YAPProp () |
get name of property virtual YAPAtom name(); More... | |
Additional Inherited Members | |
![]() | |
PredEntry * | getPred (Term &t, Term &tm, CELL *&outp) |
auxiliary routine to find a predicate in the current module More... | |
PredEntry * | asPred () |
YAPPredicate () | |
Empty constructor for predicates. More... | |
YAPPredicate (Term &to, Term &tmod, CELL *&ts, const char *pname) | |
YAPPredicate (Term t, CELL *&v) | |
Term constructor for predicates. More... | |
YAPPredicate (Term t) | |
YAPPredicate (YAPTerm t, CELL *&v) | |
Term constructor for predicates. More... | |
YAPPredicate (YAPTerm t) | |
YAPPredicate (PredEntry *pe) | |
Cast constructor for predicates, if we have the implementation data. More... | |
YAPPredicate (Functor f, Term mod) | |
Functor constructor for predicates, is given a specific module. More... | |
![]() | |
PredEntry * | ap |
YAPQuery | ( | YAPPredicate | p, |
YAPTerm | t[] | ||
) |
main constructor, uses a predicate and an array of terms
It is given a YAPPredicate p , and an array of terms that must have at least the same arity as the functor
YAPQuery | ( | YAPFunctor | f, |
YAPTerm | mod, | ||
YAPTerm | t[] | ||
) |
YAPQuery | ( | YAPFunctor | f, |
YAPTerm | mod, | ||
Term | t[] | ||
) |
|
inline |
functor/term constructor,
It is given a functor, and an array of terms that must have at least the same arity as the functor Works within the current module
string constructor without varnames
It is given a string, calls the parser and obtains a Prolog term that should be a callable goal
void close | ( | ) |
|
inline |
bool deterministic | ( | ) |
|
inline |
|
inline |
|
inline |
bool next | ( | ) |
|
inline |
|
inline |
class YAPCallback |
This class implements a callback Prolog-side.
It will be inherited by the Java or Python class that actually implements the callback
Public Member Functions | |
virtual void | run () |
virtual void | run (char *s) |
|
inlinevirtual |
struct YAPEngineArgs |
Public Member Functions | |
void | setEmbedded (bool fl) |
bool | getEmbedded () |
void | setStackSize (bool fl) |
bool | getStackSize () |
void | setTrailSize (bool fl) |
bool | getTrailSize () |
bool | getMStackSize () |
void | setMaxTrailSize (bool fl) |
bool | getMaxTrailSize () |
void | createSavedState (bool fl) |
bool | creatingSavedState () |
void | setPLDIR (const char *fl) |
const char * | getPLDIR () |
void | setINPUT_STARTUP (const char *fl) |
const char * | getINPUT_STARTUP () |
void | setOUTPUT_STARTUP (const char *fl) |
void | setOUTPUT_RESTORE (const char *fl) |
const char * | getOUTPUT_STARTUP () |
void | setSOURCEBOOT (const char *fl) |
const char * | getSOURCEBOOT () |
void | setPrologBOOTSTRAP (const char *fl) |
const char * | getBOOTSTRAP () |
void | setPrologGoal (const char *fl) |
const char * | getPrologGoal () |
void | setPrologTopLevelGoal (const char *fl) |
const char * | getPrologTopLevelGoal () |
void | setHaltAfterBoot (bool fl) |
bool | getHaltAfterBoot () |
void | setFastBoot (bool fl) |
bool | getFastBoot () |
void | setArgc (int fl) |
int | getArgc () |
void | setArgv (char **fl) |
char ** | getArgv () |
void | setBOOTDIR (const char *fl) |
const char * | getBOOTDIR () |
const char * | getBOOTFILE () |
void | setBOOTFILE (const char *fl) |
void | setROOTDIR (const char *fl) |
Additional Inherited Members | |
![]() | |
void * | start |
YAP_file_type_t | boot_file_type |
const char * | ROOTDIR |
const char * | BINDIR |
const char * | LIBDIR |
const char * | SHAREDIR |
const char * | INCLUDEDIR |
const char * | DLLDIR |
const char * | PLDIR |
const char * | COMMONSDIR |
const char * | BOOTDIR |
const char * | SOURCEBOOT |
const char * | BOOTSTRAP |
const char * | INPUT_STARTUP |
bool | install |
bool | jupyter |
const char * | OUTPUT_STARTUP |
size_t | HeapSize |
size_t | MaxHeapSize |
size_t | StackSize |
size_t | MaxStackSize |
size_t | MaxGlobalSize |
size_t | TrailSize |
size_t | MaxTrailSize |
size_t | AttsSize |
size_t | MaxAttsSize |
const char * | YapPrologInitGoal |
const char * | PrologRCFile |
const char * | PrologGoal |
const char * | PrologTopLevelGoal |
const char * | PrologAddPath |
bool | HaltAfterBoot |
bool | FastBoot |
size_t | MaxTableSpaceSize |
unsigned long int | NumberWorkers |
unsigned long int | SchedulerLoop |
unsigned long int | DelayedReleaseLoad |
bool | PrologCannotHandleInterrupts |
int | ExecutionMode |
int | Argc |
char ** | Argv |
bool | Embedded |
int | QuietMode |
int | inp |
int | out |
int | err |
char * | def_var [YAP_MAX_YPP_DEFS] |
char * | def_value [YAP_MAX_YPP_DEFS] |
int | def_c |
int | ErrorNo |
char * | ErrorCause |
|
inline |
class YAPEngine |
YAP Engine: takes care of the execution environment where we can go executing goals.
Public Member Functions | |
YAPEngine (YAPEngineArgs *cargs) | |
construct a new engine; may use a variable number of arguments More... | |
YAPEngine (int argc, char *argv[], YAPCallback *callback=(YAPCallback *) NULL) | |
construct a new engine, including aaccess to callbacks More... | |
~YAPEngine () | |
kill engine More... | |
void | delYAPCallback () |
remove current callback More... | |
void | setYAPCallback (YAPCallback *cb) |
set a new callback More... | |
void | run (char *s) |
execute the callback More... | |
void | close () |
stop yap More... | |
bool | hasError () |
execute the callback with a text argument More... | |
YAPQuery * | query (const char *s) |
build a query on the engine More... | |
YAPQuery * | query (YAPTerm t) |
build a query from a term More... | |
YAPQuery * | qt (Term t) |
build a query from a Prolog term (internal) More... | |
Term | Yap_CurrentModule () |
current module for the engine More... | |
YAPTerm | getTerm (yhandle_t h) |
given a handle, fetch a term from the engine More... | |
bool | call (YAPPredicate ap, YAPTerm ts[]) |
current directory for the engine More... | |
bool | goal (YAPTerm Yt, YAPModule module, bool release=false) |
current directory for the engine More... | |
bool | mgoal (Term t, Term tmod, bool release=false) |
ru1n a goal in a module More... | |
bool | goal (YAPTerm t, bool release=false) |
current directory for the engine More... | |
bool | goal (Term t, bool release=false) |
void | reSet () |
reset Prolog state More... | |
void | release () |
assune that there are no stack pointers, just release memory More... | |
const char * | currentDir () |
const char * | version () |
report YAP version as a string More... | |
YAPTerm | funCall (YAPTerm t) |
Term | fun (Term t) |
bool | setStringFlag (std::string arg, std::string path) |
Term | top_level (std::string s) |
Term | next_answer (YAPQuery *&Q) |
|
inline |
YAPEngine | ( | int | argc, |
char * | argv[], | ||
YAPCallback * | callback = (YAPCallback *)NULL |
||
) |
bool call | ( | YAPPredicate | ap, |
YAPTerm | ts[] | ||
) |
|
inline |
|
inline |
|
inline |
bool mgoal | ( | Term | t, |
Term | tmod, | ||
bool | release = false |
||
) |
Term next_answer | ( | YAPQuery *& | Q | ) |
|
inline |
|
inline |
void release | ( | ) |
|
inline |
|
inline |
|
inline |
Term top_level | ( | std::string | s | ) |
|
inline |
class X_API YAPPredicate |
Variables | |
class X_API | YAPPredicate |