![]() |
YAP 7.1.0
|
These classes define the main data-structures stored to represent compiled programs: More...
These classes define the main data-structures stored to represent compiled programs:
class YAPModule |
YAPModule A YAPModule describes a bare module, which in YAP is just a name.
Info about the module is in YAPModuleProp
Public Member Functions | |
YAPModule (YAP_Term t) | |
YAPModule (YAPAtom t) | |
YAPModule (YAPStringTerm t) | |
Term | term () |
Friends | |
class | YAPPredicate |
class | YAPModuleProp |
Additional Inherited Members | |
![]() | |
YAPAtomTerm (Atom a) | |
YAPAtomTerm (YAPAtom a) | |
YAPAtomTerm (char s[]) | |
YAPAtomTerm (char *s, size_t len) | |
YAPAtomTerm (wchar_t *s) | |
YAPAtomTerm (wchar_t *s, size_t len) | |
bool | isVar () |
term hash, More... | |
bool | isAtom () |
type check for unbound More... | |
bool | isInteger () |
type check for atom More... | |
bool | isFloat () |
type check for integer More... | |
bool | isString () |
type check for floating-point More... | |
bool | isCompound () |
type check for a string " ... " More... | |
bool | isAppl () |
is a primitive term More... | |
bool | isPair () |
is a structured term More... | |
virtual bool | isGround () |
is a pair term More... | |
virtual bool | isList () |
term is ground More... | |
YAPAtom | getAtom () |
[] is a list More... | |
const char * | text () |
return a string with a textual representation of the term More... | |
![]() | |
Term | gt () |
handle to term, equivalent to term_t More... | |
Term | pop_t () |
get the Prolog term corresponding to the YAPTerm, and try to recover More... | |
void | mk (Term t0) |
create a new YAPTerm from a term More... | |
void | put (Term t0) |
copy a term to an YAPTerm More... | |
YAPTerm (Term tn) | |
create an empty YAPTerm More... | |
YAPTerm () | |
private method to convert from Term (internal YAP representation) to YAPTerm More... | |
YAPTerm (void *ptr) | |
pointer to term More... | |
YAPTerm (char *s) | |
parse string s and construct a term More... | |
virtual | ~YAPTerm () |
Term destructor, tries to recover slot. More... | |
YAP_tag_t | tag () |
construct a term out of an integer (if you know object type use YAPIntegerTerm) YAPTerm(long int num) { mk(MkIntegerTerm(num)); } construct a term out of an integer (if you know object type use YAPIntegerTerm) YAPTerm(double num) { mk(MkFloatTerm(num)); } parse string s and construct a term More... | |
Term | deepCopy () |
copy the term ( term copy ) More... | |
int | numberVars (int start, bool singletons=false) |
numbervars ( int start, bool process=false ) More... | |
Term | term () |
YAPTerm | arg (int i) |
from YAPTerm to Term (internal YAP representation) More... | |
void | bind (Term b) |
void | bind (YAPTerm *b) |
Term & | operator[] (arity_t n) |
from YAPTerm to Term (internal YAP representation) fetch a sub-term More... | |
virtual bool | exactlyEqual (YAPTerm t1) |
this term is == to t1 More... | |
virtual bool | unify (YAPTerm t1) |
t = t1 More... | |
virtual bool | unifiable (YAPTerm t1) |
we can unify t and t1 More... | |
virtual YAP_Term | variant (YAPTerm t1) |
t == t1, the two terms are equal up to variable renamingvirtual bool variant( More... | |
virtual intptr_t | hashTerm (size_t sz, size_t depth, bool variant) |
virtual bool | isVar () |
term hash, More... | |
virtual bool | isAtom () |
type check for unound More... | |
virtual bool | isInteger () |
type check for atom More... | |
virtual bool | isFloat () |
type check for integer More... | |
virtual bool | isString () |
type check for floating-point More... | |
virtual bool | isCompound () |
type check for a string " ... " More... | |
virtual bool | isAppl () |
is a primitive term More... | |
virtual bool | isPair () |
is a structured term More... | |
virtual bool | isGround () |
is a pair term More... | |
virtual bool | isList () |
term is ground More... | |
virtual Term | getArg (arity_t i) |
term is a list More... | |
virtual arity_t | arity () |
extract the arity of the term variables have arity 0 More... | |
virtual const char * | text () |
return a string with a textual representation of the term More... | |
yhandle_t | handle () |
return a handle to the term More... | |
bool | initialized () |
whether the term actually refers to a live object More... | |
![]() | |
yhandle_t | hdl |
|
inline |
|
friend |
|
friend |
class YAPModuleProp |
YAPModuleProp A YAPModuleProp controls access to a module property.
Public Member Functions | |
YAPModuleProp (YAPModule tmod) | |
virtual YAPModule | module () |
![]() | |
virtual | ~YAPProp () |
get name of property virtual YAPAtom name(); More... | |
Friends | |
class | YAPPredicate |
|
inline |
|
inline |
|
inlinevirtual |
Reimplemented in YAPPredicate.
|
friend |
class YAPPredicate |
Public Member Functions | |
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... | |
Protected Member Functions | |
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... | |
Protected Attributes | |
PredEntry * | ap |
Friends | |
class | YAPQuery |
class | YAPEngine |
|
inlineprotected |
|
protected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inline |
|
inline |
|
inline |
|
inline |
YAPPredicate | ( | YAPAtom | at | ) |
|
inline |
YAPPredicate | ( | YAPAtom | at, |
uintptr_t | arity | ||
) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
protected |
|
inlinevirtual |
module of a predicate
notice that modules are currently treated as atoms, this should change
Reimplemented from YAPModuleProp.
|
inline |
class YAPPrologPredicate |
PrologPredicate.
This class interfaces with Predicates Implemented in Prolog
Public Member Functions | |
YAPPrologPredicate (YAPTerm t) | |
YAPPrologPredicate (const char *s, arity_t arity) | |
YAPPrologPredicate (YAPAtom s, arity_t arity) | |
bool | assertClause (YAPTerm clause, bool last=true, YAPTerm source=YAPTerm()) |
add a new clause More... | |
bool | assertFact (YAPTerm *tuple, bool last=true) |
add a new tuple More... | |
void * | retractClause (YAPTerm skeleton, bool all=false) |
retract at least the first clause matching the predicate More... | |
YAPTerm * | nextClause () |
return the Nth clause (if source is available) 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 |
|
inline |
|
inline |
|
inline |
bool assertFact | ( | YAPTerm * | tuple, |
bool | last = true |
||
) |
|
inline |
class YAPFLIP |
PrologPredicate.
This class interfaces with Predicates Implemented in Prolog
Public Member Functions | |
YAPFLIP (YAP_UserCPred call, std::string name, YAP_Arity arity, const std::string module=std::string(RepAtom(AtomOfTerm(CurrentModule)) ->StrOfAE), YAP_UserCPred retry=0, YAP_UserCPred cut=0, YAP_Arity extra=0, bool test=false) | |
YAPFLIP (const char *name, uintptr_t arity, YAPModule module=YAPModule(), bool backtrackable=false) | |
bool | addCall (CPredicate call) |
bool | addRetry (CPredicate call) |
bool | addCut (CPredicate call) |
Term | x (int i) |
YAPTerm | X (int i) |
bool | output (Term t, int i) |
bool | output (YAPTerm t, int i) |
bool | ensureStorage (size_t cells) |
bool | ensureStorage (size_t cells, std::vector< Term > ts) |
![]() | |
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 |
|
inline |
|
inline |