YAP 7.1.0
Term Handling in the YAP interface.

These classes offer term construction and access. More...

Detailed Description

These classes offer term construction and access.

Terms are seens as objects that inherit from a virtual class, Currently, all terms must reside in the stack and may be moved around during garbage collection Term objects use an handle, in the SWI-Prolog style

Notice that terms are forcefully destroyed during backtracking


Class Documentation

◆ YAPTerm

class YAPTerm

Generic Prolog Term.

Definition at line 42 of file yapt.hh.

Inheritance diagram for YAPTerm:
T YAPApplTerm YAPAtomTerm YAPConjunctiveTerm YAPErrorTerm YAPListTerm YAPNumberTerm YAPPairTerm YAPStringTerm YAPVarTerm

Public Member Functions

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...
 

Protected Attributes

yhandle_t hdl
 

Friends

class YAPPredicate
 
class YAPPrologPredicate
 
class YAPQuery
 
class YAPModule
 
class YAPModuleProp
 
class YAPApplTerm
 
class YAPListTerm
 
class YAPConjunctiveTerm
 

Constructor & Destructor Documentation

◆ YAPTerm() [1/4]

YAPTerm ( Term  tn)
inline

create an empty YAPTerm

Definition at line 86 of file yapt.hh.

◆ YAPTerm() [2/4]

YAPTerm ( )
inline

private method to convert from Term (internal YAP representation) to YAPTerm

Definition at line 96 of file yapt.hh.

◆ YAPTerm() [3/4]

YAPTerm ( void *  ptr)

pointer to term

Definition at line 497 of file yapi.cpp.

◆ YAPTerm() [4/4]

YAPTerm ( char *  s)
inline

parse string s and construct a term

Definition at line 101 of file yapt.hh.

◆ ~YAPTerm()

virtual ~YAPTerm ( )
inlinevirtual

Term destructor, tries to recover slot.

Definition at line 108 of file yapt.hh.

Member Function Documentation

◆ arg()

YAPTerm arg ( int  i)
inline

from YAPTerm to Term (internal YAP representation)

Definition at line 140 of file yapt.hh.

◆ arity()

virtual arity_t arity ( )
inlinevirtual

extract the arity of the term variables have arity 0

Definition at line 228 of file yapt.hh.

◆ bind() [1/2]

void bind ( Term  b)
inline

Definition at line 151 of file yapt.hh.

◆ bind() [2/2]

void bind ( YAPTerm b)
inline

Definition at line 152 of file yapt.hh.

◆ deepCopy()

Term deepCopy ( )

copy the term ( term copy )

Definition at line 433 of file yapi.cpp.

◆ exactlyEqual()

virtual bool exactlyEqual ( YAPTerm  t1)
inlinevirtual

this term is == to t1

Definition at line 158 of file yapt.hh.

◆ getArg()

Term getArg ( arity_t  i)
virtual

term is a list

extract the argument i of the term, where i in 1...arityvoid *Yap_RepStreamFromId(int sno)

Reimplemented in YAPApplTerm.

Definition at line 109 of file yapi.cpp.

◆ gt()

Term gt ( )
inline

handle to term, equivalent to term_t

get the Prolog term corresponding to the YAPTerm

Definition at line 57 of file yapt.hh.

◆ handle()

yhandle_t handle ( )
inline

return a handle to the term

Definition at line 257 of file yapt.hh.

◆ hashTerm()

virtual intptr_t hashTerm ( size_t  sz,
size_t  depth,
bool  variant 
)
inlinevirtual

Definition at line 194 of file yapt.hh.

◆ initialized()

bool initialized ( )
inline

whether the term actually refers to a live object

Definition at line 260 of file yapt.hh.

◆ isAppl()

virtual bool isAppl ( )
inlinevirtual

is a primitive term

Reimplemented in YAPApplTerm, YAPAtomTerm, and YAPVarTerm.

Definition at line 217 of file yapt.hh.

◆ isAtom()

virtual bool isAtom ( )
inlinevirtual

type check for unound

Reimplemented in YAPApplTerm, YAPAtomTerm, and YAPVarTerm.

Definition at line 204 of file yapt.hh.

◆ isCompound()

virtual bool isCompound ( )
inlinevirtual

type check for a string " ... "

Reimplemented in YAPApplTerm, YAPAtomTerm, and YAPVarTerm.

Definition at line 214 of file yapt.hh.

◆ isFloat()

virtual bool isFloat ( )
inlinevirtual

type check for integer

Reimplemented in YAPApplTerm, YAPAtomTerm, and YAPVarTerm.

Definition at line 208 of file yapt.hh.

◆ isGround()

virtual bool isGround ( )
inlinevirtual

is a pair term

Reimplemented in YAPApplTerm, YAPAtomTerm, and YAPVarTerm.

Definition at line 219 of file yapt.hh.

◆ isInteger()

virtual bool isInteger ( )
inlinevirtual

type check for atom

Reimplemented in YAPApplTerm, YAPAtomTerm, and YAPVarTerm.

Definition at line 205 of file yapt.hh.

◆ isList()

virtual bool isList ( )
inlinevirtual

term is ground

Reimplemented in YAPApplTerm, YAPAtomTerm, and YAPVarTerm.

Definition at line 220 of file yapt.hh.

◆ isPair()

virtual bool isPair ( )
inlinevirtual

is a structured term

Reimplemented in YAPApplTerm, YAPAtomTerm, and YAPVarTerm.

Definition at line 218 of file yapt.hh.

◆ isString()

virtual bool isString ( )
inlinevirtual

type check for floating-point

Reimplemented in YAPApplTerm, YAPAtomTerm, and YAPVarTerm.

Definition at line 211 of file yapt.hh.

◆ isVar()

virtual bool isVar ( )
inlinevirtual

term hash,

Reimplemented in YAPApplTerm, YAPAtomTerm, and YAPVarTerm.

Definition at line 203 of file yapt.hh.

◆ mk()

void mk ( Term  t0)
inline

create a new YAPTerm from a term

Definition at line 74 of file yapt.hh.

◆ numberVars()

int numberVars ( int  start,
bool  singletons = false 
)
inline

numbervars ( int start, bool process=false )

Definition at line 134 of file yapt.hh.

◆ operator[]()

Term & operator[] ( arity_t  n)

from YAPTerm to Term (internal YAP representation) fetch a sub-term

Definition at line 307 of file yapi.cpp.

◆ pop_t()

Term pop_t ( )
inline

get the Prolog term corresponding to the YAPTerm, and try to recover

space

Definition at line 66 of file yapt.hh.

◆ put()

void put ( Term  t0)
inline

copy a term to an YAPTerm

Definition at line 80 of file yapt.hh.

◆ tag()

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

YAPTerm(YAPFunctor f, YAPTerm ts[]); extract the tag of a term, after dereferencing

Definition at line 389 of file yapi.cpp.

◆ term()

Term term ( )
inline

Definition at line 137 of file yapt.hh.

◆ text()

virtual const char * text ( void  )
inlinevirtual

return a string with a textual representation of the term

Reimplemented in YAPAtomTerm.

Definition at line 243 of file yapt.hh.

◆ unifiable()

virtual bool unifiable ( YAPTerm  t1)
inlinevirtual

we can unify t and t1

Definition at line 176 of file yapt.hh.

◆ unify()

virtual bool unify ( YAPTerm  t1)
inlinevirtual

t = t1

Definition at line 167 of file yapt.hh.

◆ variant()

virtual YAP_Term variant ( YAPTerm  t1)
inlinevirtual

t == t1, the two terms are equal up to variable renamingvirtual bool variant(

Definition at line 186 of file yapt.hh.

Friends And Related Function Documentation

◆ YAPApplTerm

friend class YAPApplTerm
friend

Definition at line 48 of file yapt.hh.

◆ YAPConjunctiveTerm

friend class YAPConjunctiveTerm
friend

Definition at line 50 of file yapt.hh.

◆ YAPListTerm

friend class YAPListTerm
friend

Definition at line 49 of file yapt.hh.

◆ YAPModule

friend class YAPModule
friend

Definition at line 46 of file yapt.hh.

◆ YAPModuleProp

friend class YAPModuleProp
friend

Definition at line 47 of file yapt.hh.

◆ YAPPredicate

friend class YAPPredicate
friend

Definition at line 43 of file yapt.hh.

◆ YAPPrologPredicate

friend class YAPPrologPredicate
friend

Definition at line 44 of file yapt.hh.

◆ YAPQuery

friend class YAPQuery
friend

Definition at line 45 of file yapt.hh.

Member Data Documentation

◆ hdl

yhandle_t hdl
protected

Definition at line 53 of file yapt.hh.

◆ T

class T

If you like being short, use T instead of YapTerm.

Definition at line 266 of file yapt.hh.

Inheritance diagram for T:
YAPTerm

Friends

class YAPTerm
 

Additional Inherited Members

- Public Member Functions inherited from YAPTerm
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...
 
- Protected Attributes inherited from YAPTerm
yhandle_t hdl
 

Friends And Related Function Documentation

◆ YAPTerm

friend class YAPTerm
friend

Definition at line 268 of file yapt.hh.

◆ YAPApplTerm

class YAPApplTerm

Compound Term.

A compound term, with functor and fixed number of arguments, also known as a function application

Notice that lists and big numbers do not belong to this class

Definition at line 279 of file yapt.hh.

Inheritance diagram for YAPApplTerm:
YAPTerm

Public Member Functions

 YAPApplTerm (Term t0)
 There are very many ways to build one of these terms: More...
 
 YAPApplTerm (Functor f, Term ts[])
 
 YAPApplTerm (YAPFunctor f, YAPTerm ts[])
 
 YAPApplTerm (const std::string s, std::vector< Term > ts)
 not really needed, but we may not want to look inside the vector More...
 
 YAPApplTerm (const std::string s, std::vector< YAPTerm > ts)
 
 YAPApplTerm (const std::string s, Term a1)
 
 YAPApplTerm (const std::string s, Term a1, Term a2)
 
 YAPApplTerm (const std::string s, Term a1, Term a2, Term a3)
 
 YAPApplTerm (const std::string s, unsigned int arity)
 
 YAPApplTerm (YAPFunctor f)
 
Functor functor ()
 
YAPFunctor getFunctor ()
 
Term getArg (arity_t i)
 term is a list More...
 
void putArg (int i, Term targ)
 
void putArg (int i, YAPTerm t)
 
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...
 
- Public Member Functions inherited from YAPTerm
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...
 

Friends

class YAPTerm
 

Additional Inherited Members

- Protected Attributes inherited from YAPTerm
yhandle_t hdl
 

Constructor & Destructor Documentation

◆ YAPApplTerm() [1/10]

YAPApplTerm ( Term  t0)
inline

There are very many ways to build one of these terms:

  1. engine representation to YAPApplTerm

Definition at line 286 of file yapt.hh.

◆ YAPApplTerm() [2/10]

YAPApplTerm ( Functor  f,
Term  ts[] 
)
inline
  1. this is the way the engine builds App, but in C you need to give the arity Notice we build from the engine world

Definition at line 289 of file yapt.hh.

◆ YAPApplTerm() [3/10]

YAPApplTerm ( YAPFunctor  f,
YAPTerm  ts[] 
)
  1. similar to beefore, but wwe use objects This is useful if we already got the objects

Definition at line 256 of file yapi.cpp.

◆ YAPApplTerm() [4/10]

YAPApplTerm ( const std::string  s,
std::vector< Term >  ts 
)

not really needed, but we may not want to look inside the vector

Definition at line 267 of file yapi.cpp.

◆ YAPApplTerm() [5/10]

YAPApplTerm ( const std::string  s,
std::vector< YAPTerm ts 
)

Definition at line 284 of file yapi.cpp.

◆ YAPApplTerm() [6/10]

YAPApplTerm ( const std::string  s,
Term  a1 
)
inline

Definition at line 362 of file yapt.hh.

◆ YAPApplTerm() [7/10]

YAPApplTerm ( const std::string  s,
Term  a1,
Term  a2 
)
inline

Definition at line 373 of file yapt.hh.

◆ YAPApplTerm() [8/10]

YAPApplTerm ( const std::string  s,
Term  a1,
Term  a2,
Term  a3 
)
inline

Definition at line 386 of file yapt.hh.

◆ YAPApplTerm() [9/10]

YAPApplTerm ( const std::string  s,
unsigned int  arity 
)
inline
  1. build empty compound term, that is, all arguments are free variables

Definition at line 403 of file yapt.hh.

◆ YAPApplTerm() [10/10]

  1. or use the functor object

Definition at line 300 of file yapi.cpp.

Member Function Documentation

◆ functor()

Functor functor ( )
inline

Definition at line 410 of file yapt.hh.

◆ getArg()

Term getArg ( arity_t  i)
inlinevirtual

term is a list

extract the argument i of the term, where i in 1...arityvoid *Yap_RepStreamFromId(int sno)

Reimplemented from YAPTerm.

Definition at line 413 of file yapt.hh.

◆ getFunctor()

YAPFunctor getFunctor ( )
inline

Definition at line 411 of file yapt.hh.

◆ isAppl()

virtual bool isAppl ( )
inlinevirtual

is a primitive term

Reimplemented from YAPTerm.

Definition at line 439 of file yapt.hh.

◆ isAtom()

virtual bool isAtom ( )
inlinevirtual

type check for unound

Reimplemented from YAPTerm.

Definition at line 434 of file yapt.hh.

◆ isCompound()

virtual bool isCompound ( )
inlinevirtual

type check for a string " ... "

Reimplemented from YAPTerm.

Definition at line 438 of file yapt.hh.

◆ isFloat()

virtual bool isFloat ( )
inlinevirtual

type check for integer

Reimplemented from YAPTerm.

Definition at line 436 of file yapt.hh.

◆ isGround()

virtual bool isGround ( )
inlinevirtual

is a pair term

Reimplemented from YAPTerm.

Definition at line 441 of file yapt.hh.

◆ isInteger()

virtual bool isInteger ( )
inlinevirtual

type check for atom

Reimplemented from YAPTerm.

Definition at line 435 of file yapt.hh.

◆ isList()

virtual bool isList ( )
inlinevirtual

term is ground

Reimplemented from YAPTerm.

Definition at line 442 of file yapt.hh.

◆ isPair()

virtual bool isPair ( )
inlinevirtual

is a structured term

Reimplemented from YAPTerm.

Definition at line 440 of file yapt.hh.

◆ isString()

virtual bool isString ( )
inlinevirtual

type check for floating-point

Reimplemented from YAPTerm.

Definition at line 437 of file yapt.hh.

◆ isVar()

virtual bool isVar ( )
inlinevirtual

term hash,

Reimplemented from YAPTerm.

Definition at line 433 of file yapt.hh.

◆ putArg() [1/2]

void putArg ( int  i,
Term  targ 
)
inline

Definition at line 421 of file yapt.hh.

◆ putArg() [2/2]

void putArg ( int  i,
YAPTerm  t 
)
inline

Definition at line 427 of file yapt.hh.

Friends And Related Function Documentation

◆ YAPTerm

friend class YAPTerm
friend

Definition at line 280 of file yapt.hh.

◆ YAPPairTerm

class YAPPairTerm

List Constructor Term.

Definition at line 448 of file yapt.hh.

Inheritance diagram for YAPPairTerm:
YAPTerm

Public Member Functions

 YAPPairTerm (Term t0)
 
 YAPPairTerm (YAPTerm hd, YAPTerm tl)
 
Term getHead ()
 
Term getTail ()
 
YAPTerm car ()
 
bool nil ()
 
YAPPairTerm cdr ()
 
std::vector< Term > listToArray ()
 
std::vector< YAPTermlistToVector ()
 
- Public Member Functions inherited from YAPTerm
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...
 

Friends

class YAPTerm
 

Additional Inherited Members

- Protected Attributes inherited from YAPTerm
yhandle_t hdl
 

Constructor & Destructor Documentation

◆ YAPPairTerm() [1/3]

YAPPairTerm ( Term  t0)
inline

Definition at line 452 of file yapt.hh.

◆ YAPPairTerm() [2/3]

YAPPairTerm ( YAPTerm  hd,
YAPTerm  tl 
)

Definition at line 342 of file yapi.cpp.

◆ YAPPairTerm() [3/3]

Definition at line 349 of file yapi.cpp.

Member Function Documentation

◆ car()

YAPTerm car ( )
inline

Definition at line 463 of file yapt.hh.

◆ cdr()

YAPPairTerm cdr ( )
inline

Definition at line 465 of file yapt.hh.

◆ getHead()

Term getHead ( )
inline

Definition at line 461 of file yapt.hh.

◆ getTail()

Term getTail ( )
inline

Definition at line 462 of file yapt.hh.

◆ listToArray()

std::vector< Term > listToArray ( )

Definition at line 355 of file yapi.cpp.

◆ listToVector()

std::vector< YAPTerm > listToVector ( )

Definition at line 372 of file yapi.cpp.

◆ nil()

bool nil ( )
inline

Definition at line 464 of file yapt.hh.

Friends And Related Function Documentation

◆ YAPTerm

friend class YAPTerm
friend

Definition at line 449 of file yapt.hh.

◆ YAPNumberTerm

class YAPNumberTerm

Number Term.

Definition at line 474 of file yapt.hh.

Inheritance diagram for YAPNumberTerm:
YAPTerm YAPFloatTerm YAPIntegerTerm

Public Member Functions

bool isTagged ()
 
- Public Member Functions inherited from YAPTerm
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...
 

Additional Inherited Members

- Protected Attributes inherited from YAPTerm
yhandle_t hdl
 

Constructor & Destructor Documentation

◆ YAPNumberTerm()

YAPNumberTerm ( )
inline

Definition at line 476 of file yapt.hh.

Member Function Documentation

◆ isTagged()

bool isTagged ( )
inline

Definition at line 477 of file yapt.hh.

◆ YAPIntegerTerm

class YAPIntegerTerm

Integer Term.

Definition at line 484 of file yapt.hh.

Inheritance diagram for YAPIntegerTerm:
YAPNumberTerm YAPTerm

Public Member Functions

 YAPIntegerTerm (intptr_t i)
 
intptr_t getInteger ()
 
- Public Member Functions inherited from YAPNumberTerm
bool isTagged ()
 
- Public Member Functions inherited from YAPTerm
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...
 

Additional Inherited Members

- Protected Attributes inherited from YAPTerm
yhandle_t hdl
 

Constructor & Destructor Documentation

◆ YAPIntegerTerm()

YAPIntegerTerm ( intptr_t  i)

Definition at line 481 of file yapi.cpp.

Member Function Documentation

◆ getInteger()

intptr_t getInteger ( )
inline

Definition at line 487 of file yapt.hh.

◆ YAPFloatTerm

class YAPFloatTerm

Floating Point Term.

Definition at line 494 of file yapt.hh.

Inheritance diagram for YAPFloatTerm:
YAPNumberTerm YAPTerm

Public Member Functions

 YAPFloatTerm (double dbl)
 
double getFl ()
 
- Public Member Functions inherited from YAPNumberTerm
bool isTagged ()
 
- Public Member Functions inherited from YAPTerm
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...
 

Additional Inherited Members

- Protected Attributes inherited from YAPTerm
yhandle_t hdl
 

Constructor & Destructor Documentation

◆ YAPFloatTerm()

YAPFloatTerm ( double  dbl)
inline

Definition at line 496 of file yapt.hh.

Member Function Documentation

◆ getFl()

double getFl ( )
inline

Definition at line 498 of file yapt.hh.

◆ YAPListTerm

class YAPListTerm

Definition at line 501 of file yapt.hh.

Inheritance diagram for YAPListTerm:
YAPTerm

Public Member Functions

 YAPListTerm ()
 
 YAPListTerm (Term t0)
 Create an empty list term. More...
 
 YAPListTerm (Term ts[], size_t n)
 Create a list term out of an array of terms. More...
 
 YAPListTerm (std::vector< Term >)
 
size_t length ()
 Return the number of elements in a list term. More...
 
Term & operator[] (size_t n)
 Extract the nth element. More...
 
Term car ()
 Extract the first element of a list. More...
 
Term cdr ()
 Extract the tail elements of a list. More...
 
Term dup ()
 copy a list More...
 
bool nil ()
 Check if the list is empty. More...
 
- Public Member Functions inherited from YAPTerm
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...
 

Additional Inherited Members

- Protected Attributes inherited from YAPTerm
yhandle_t hdl
 

Constructor & Destructor Documentation

◆ YAPListTerm() [1/4]

YAPListTerm ( )
inline
Parameters
[in]theterm

Definition at line 506 of file yapt.hh.

◆ YAPListTerm() [2/4]

YAPListTerm ( Term  t0)
inline

Create an empty list term.

Parameters
[in]theterm

Definition at line 510 of file yapt.hh.

◆ YAPListTerm() [3/4]

YAPListTerm ( Term  ts[],
size_t  n 
)

Create a list term out of an array of terms.

Parameters
[in]thearray of terms
[in]anumber smaller or equal to the length of the array

Definition at line 512 of file yapi.cpp.

◆ YAPListTerm() [4/4]

YAPListTerm ( std::vector< Term >  ts)
Parameters
[in]thearray of terms

Definition at line 533 of file yapi.cpp.

Member Function Documentation

◆ car()

Term car ( )

Extract the first element of a list.

Parameters
[in]thelist

Definition at line 502 of file yapi.cpp.

◆ cdr()

Term cdr ( )

Extract the tail elements of a list.

Parameters
[in]thelist

Definition at line 443 of file yapi.cpp.

◆ dup()

Term dup ( )

copy a list

Parameters
[in]thelist

Definition at line 469 of file yapi.cpp.

◆ length()

size_t length ( )
inline

Return the number of elements in a list term.

Definition at line 521 of file yapt.hh.

◆ nil()

bool nil ( )
inline

Check if the list is empty.

Parameters
[in]thelist

Definition at line 544 of file yapt.hh.

◆ operator[]()

Term & operator[] ( size_t  n)

Extract the nth element.

Definition at line 329 of file yapi.cpp.

◆ YAPConjunctiveTerm

class YAPConjunctiveTerm

Definition at line 551 of file yapt.hh.

Inheritance diagram for YAPConjunctiveTerm:
YAPTerm

Public Member Functions

 YAPConjunctiveTerm ()
 
 YAPConjunctiveTerm (Term t0)
 Create an empty list term. More...
 
 YAPConjunctiveTerm (const Term ts[], size_t n)
 Create a list term out of an array of terms. More...
 
 YAPConjunctiveTerm (std::vector< Term >)
 
size_t length ()
 Return the number of elements in a list term. More...
 
Term & operator[] (size_t n)
 Extract the nth element. More...
 
Term car ()
 Extract the first element of a listconjunction. More...
 
Term cdr ()
 Extract the tail elements of a conjunction. More...
 
- Public Member Functions inherited from YAPTerm
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...
 

Additional Inherited Members

- Protected Attributes inherited from YAPTerm
yhandle_t hdl
 

Constructor & Destructor Documentation

◆ YAPConjunctiveTerm() [1/4]

YAPConjunctiveTerm ( )
inline
Parameters
[in]theterm

Definition at line 556 of file yapt.hh.

◆ YAPConjunctiveTerm() [2/4]

YAPConjunctiveTerm ( Term  t0)
inline

Create an empty list term.

Parameters
[in]theterm

Definition at line 560 of file yapt.hh.

◆ YAPConjunctiveTerm() [3/4]

YAPConjunctiveTerm ( const Term  ts[],
size_t  n 
)

Create a list term out of an array of terms.

Parameters
[in]thearray of terms
[in]anumber smaller or equal to the length of the array

Definition at line 614 of file yapi.cpp.

◆ YAPConjunctiveTerm() [4/4]

YAPConjunctiveTerm ( std::vector< Term >  ts)
Parameters
[in]thearray of terms

Definition at line 580 of file yapi.cpp.

Member Function Documentation

◆ car()

Term car ( )

Extract the first element of a listconjunction.

Parameters
[in]theconjunction

Definition at line 560 of file yapi.cpp.

◆ cdr()

Term cdr ( )

Extract the tail elements of a conjunction.

Parameters
[in]thelist

Definition at line 570 of file yapi.cpp.

◆ length()

size_t length ( )
inline

Return the number of elements in a list term.

Definition at line 571 of file yapt.hh.

◆ operator[]()

Term & operator[] ( size_t  n)

Extract the nth element.

Definition at line 453 of file yapi.cpp.

◆ YAPStringTerm

class YAPStringTerm

String Term.

Definition at line 596 of file yapt.hh.

Inheritance diagram for YAPStringTerm:
YAPTerm

Public Member Functions

 YAPStringTerm (char *s)
 your standard constructor More...
 
 YAPStringTerm (char *s, size_t len)
 use this one to construct length limited strings More...
 
 YAPStringTerm (wchar_t *s)
 construct using wide chars More...
 
 YAPStringTerm (wchar_t *s, size_t len)
 construct using length-limited wide chars More...
 
const char * getString ()
 
- Public Member Functions inherited from YAPTerm
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...
 

Additional Inherited Members

- Protected Attributes inherited from YAPTerm
yhandle_t hdl
 

Constructor & Destructor Documentation

◆ YAPStringTerm() [1/4]

YAPStringTerm ( char *  s)

your standard constructor

Definition at line 196 of file yapi.cpp.

◆ YAPStringTerm() [2/4]

YAPStringTerm ( char *  s,
size_t  len 
)

use this one to construct length limited strings

Definition at line 205 of file yapi.cpp.

◆ YAPStringTerm() [3/4]

YAPStringTerm ( wchar_t *  s)

construct using wide chars

Definition at line 222 of file yapi.cpp.

◆ YAPStringTerm() [4/4]

YAPStringTerm ( wchar_t *  s,
size_t  len 
)

construct using length-limited wide chars

Definition at line 238 of file yapi.cpp.

Member Function Documentation

◆ getString()

const char * getString ( )
inline

Definition at line 606 of file yapt.hh.

◆ YAPAtomTerm

class YAPAtomTerm

Atom Term Term Representation of an Atom.

Definition at line 613 of file yapt.hh.

Inheritance diagram for YAPAtomTerm:
YAPTerm YAPModule

Public Member Functions

 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...
 
- Public Member Functions inherited from YAPTerm
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...
 

Friends

class YAPModule
 

Additional Inherited Members

- Protected Attributes inherited from YAPTerm
yhandle_t hdl
 

Constructor & Destructor Documentation

◆ YAPAtomTerm() [1/6]

YAPAtomTerm ( Atom  a)
inline

Definition at line 619 of file yapt.hh.

◆ YAPAtomTerm() [2/6]

YAPAtomTerm ( YAPAtom  a)
inline

Definition at line 621 of file yapt.hh.

◆ YAPAtomTerm() [3/6]

YAPAtomTerm ( char  s[])

Definition at line 132 of file yapi.cpp.

◆ YAPAtomTerm() [4/6]

YAPAtomTerm ( char *  s,
size_t  len 
)

Definition at line 148 of file yapi.cpp.

◆ YAPAtomTerm() [5/6]

YAPAtomTerm ( wchar_t *  s)

Definition at line 165 of file yapi.cpp.

◆ YAPAtomTerm() [6/6]

YAPAtomTerm ( wchar_t *  s,
size_t  len 
)

Definition at line 180 of file yapi.cpp.

Member Function Documentation

◆ getAtom()

YAPAtom getAtom ( )
inline

[] is a list

Definition at line 644 of file yapt.hh.

◆ isAppl()

bool isAppl ( )
inlinevirtual

is a primitive term

Reimplemented from YAPTerm.

Definition at line 639 of file yapt.hh.

◆ isAtom()

bool isAtom ( )
inlinevirtual

type check for unbound

Reimplemented from YAPTerm.

Definition at line 634 of file yapt.hh.

◆ isCompound()

bool isCompound ( )
inlinevirtual

type check for a string " ... "

Reimplemented from YAPTerm.

Definition at line 638 of file yapt.hh.

◆ isFloat()

bool isFloat ( )
inlinevirtual

type check for integer

Reimplemented from YAPTerm.

Definition at line 636 of file yapt.hh.

◆ isGround()

virtual bool isGround ( )
inlinevirtual

is a pair term

Reimplemented from YAPTerm.

Definition at line 641 of file yapt.hh.

◆ isInteger()

bool isInteger ( )
inlinevirtual

type check for atom

Reimplemented from YAPTerm.

Definition at line 635 of file yapt.hh.

◆ isList()

virtual bool isList ( )
inlinevirtual

term is ground

Reimplemented from YAPTerm.

Definition at line 642 of file yapt.hh.

◆ isPair()

bool isPair ( )
inlinevirtual

is a structured term

Reimplemented from YAPTerm.

Definition at line 640 of file yapt.hh.

◆ isString()

bool isString ( )
inlinevirtual

type check for floating-point

Reimplemented from YAPTerm.

Definition at line 637 of file yapt.hh.

◆ isVar()

bool isVar ( )
inlinevirtual

term hash,

Reimplemented from YAPTerm.

Definition at line 633 of file yapt.hh.

◆ text()

const char * text ( void  )
inlinevirtual

return a string with a textual representation of the term

Reimplemented from YAPTerm.

Definition at line 646 of file yapt.hh.

Friends And Related Function Documentation

◆ YAPModule

friend class YAPModule
friend

Definition at line 614 of file yapt.hh.

◆ YAPVarTerm

class YAPVarTerm

Variable Term.

Definition at line 652 of file yapt.hh.

Inheritance diagram for YAPVarTerm:
YAPTerm

Public Member Functions

 YAPVarTerm ()
 constructor More...
 
CELL * getVar ()
 get the internal representation More...
 
 YAPVarTerm (Term t)
 is the variable bound to another one More...
 
bool unbound ()
 type check for unbound More...
 
bool isVar ()
 term hash, More...
 
bool isAtom ()
 type check for unound 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...
 
bool isGround ()
 is a pair term More...
 
bool isList ()
 term is ground More...
 
- Public Member Functions inherited from YAPTerm
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...
 

Friends

class YAPTerm
 

Additional Inherited Members

- Protected Attributes inherited from YAPTerm
yhandle_t hdl
 

Constructor & Destructor Documentation

◆ YAPVarTerm() [1/2]

YAPVarTerm ( )
inline

constructor

Definition at line 657 of file yapt.hh.

◆ YAPVarTerm() [2/2]

YAPVarTerm ( Term  t)
inline

is the variable bound to another one

Definition at line 661 of file yapt.hh.

Member Function Documentation

◆ getVar()

CELL * getVar ( )
inline

get the internal representation

Definition at line 659 of file yapt.hh.

◆ isAppl()

bool isAppl ( )
inlinevirtual

is a primitive term

Reimplemented from YAPTerm.

Definition at line 674 of file yapt.hh.

◆ isAtom()

bool isAtom ( )
inlinevirtual

type check for unound

Reimplemented from YAPTerm.

Definition at line 669 of file yapt.hh.

◆ isCompound()

bool isCompound ( )
inlinevirtual

type check for a string " ... "

Reimplemented from YAPTerm.

Definition at line 673 of file yapt.hh.

◆ isFloat()

bool isFloat ( )
inlinevirtual

type check for integer

Reimplemented from YAPTerm.

Definition at line 671 of file yapt.hh.

◆ isGround()

bool isGround ( )
inlinevirtual

is a pair term

Reimplemented from YAPTerm.

Definition at line 676 of file yapt.hh.

◆ isInteger()

bool isInteger ( )
inlinevirtual

type check for atom

Reimplemented from YAPTerm.

Definition at line 670 of file yapt.hh.

◆ isList()

bool isList ( )
inlinevirtual

term is ground

Reimplemented from YAPTerm.

Definition at line 677 of file yapt.hh.

◆ isPair()

bool isPair ( )
inlinevirtual

is a structured term

Reimplemented from YAPTerm.

Definition at line 675 of file yapt.hh.

◆ isString()

bool isString ( )
inlinevirtual

type check for floating-point

Reimplemented from YAPTerm.

Definition at line 672 of file yapt.hh.

◆ isVar()

bool isVar ( )
inlinevirtual

term hash,

Reimplemented from YAPTerm.

Definition at line 668 of file yapt.hh.

◆ unbound()

bool unbound ( )
inline

type check for unbound

Definition at line 667 of file yapt.hh.

Friends And Related Function Documentation

◆ YAPTerm

friend class YAPTerm
friend

Definition at line 653 of file yapt.hh.

◆ YAPErrorTerm

class YAPErrorTerm

Prolog container for error descriptors.

Definition at line 687 of file yapt.hh.

Inheritance diagram for YAPErrorTerm:
YAPTerm

Public Member Functions

 YAPErrorTerm (yap_error_descriptor_t *err)
 
- Public Member Functions inherited from YAPTerm
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...
 

Friends

class YAPTerm
 

Additional Inherited Members

- Protected Attributes inherited from YAPTerm
yhandle_t hdl
 

Constructor & Destructor Documentation

◆ YAPErrorTerm() [1/2]

YAPErrorTerm ( )
inline

Definition at line 690 of file yapt.hh.

◆ YAPErrorTerm() [2/2]

Definition at line 691 of file yapt.hh.

Friends And Related Function Documentation

◆ YAPTerm

friend class YAPTerm
friend

Definition at line 688 of file yapt.hh.

Macro Definition Documentation

◆ YAPT_HH

#define YAPT_HH   1

Definition at line 30 of file yapt.hh.

Function Documentation

◆ MkErrorTerm()

X_API Term MkErrorTerm ( yap_error_descriptor_t t)

Definition at line 1265 of file errors.c.

◆ YAP_MkCharPTerm()

X_API Term YAP_MkCharPTerm ( char *  n)

Definition at line 313 of file c_interface.c.

Macros

#define YAPT_HH   1
 

Functions

X_API Term YAP_MkCharPTerm (char *n)
 
X_API Term MkErrorTerm (yap_error_descriptor_t *)