YAP 7.1.0
yapt.hh
Go to the documentation of this file.
1
5#ifndef X_API
6#define X_API
7#endif
8
27#include <vector>
28
29#ifndef YAPT_HH
30#define YAPT_HH 1
31
32class YAPError;
33
34extern "C" {
35
36X_API extern Term YAP_MkCharPTerm(char *n);
37}
38
42class X_API YAPTerm {
43 friend class YAPPredicate;
44 friend class YAPPrologPredicate;
45 friend class YAPQuery;
46 friend class YAPModule;
47 friend class YAPModuleProp;
48 friend class YAPApplTerm;
49 friend class YAPListTerm;
50 friend class YAPConjunctiveTerm;
51
52protected:
53 yhandle_t hdl;
54
55public:
57 Term gt() {
58 CACHE_REGS
59 // fprintf(stderr,"?%d,%lx,%p\n",t,LOCAL_HandleBase[t], HR);
60 // Yap_DebugPlWriteln(LOCAL_HandleBase[t]);
61 return Yap_GetFromSlot(hdl);
62 };
63
66 Term pop_t() {
67 CACHE_REGS
68 // fprintf(stderr,"?%d,%lx,%p\n",t,LOCAL_HandleBase[t], HR);
69 // Yap_DebugPlWriteln(LOCAL_HandleBase[t]);
70 return Deref(Yap_PopHandle(hdl));
71 };
72
74 void mk(Term t0) {
75 CACHE_REGS hdl = Yap_InitSlot(t0);
76 // fprintf(stderr,"+%d,%lx,%p,%p",t,t0,HR,ASP); Yap_DebugPlWriteln(t0);
77 };
78
80 void put(Term t0) {
81 Yap_PutInHandle(hdl, t0);
82 // fprintf(stderr,"+%d,%lx,%p,%p",t,t0,HR,ASP); Yap_DebugPlWriteln(t0);
83 };
84
86 YAPTerm(Term tn) { mk(tn); };
87#ifdef SWIGPYTHON
88// YAPTerm(struct _object *inp) {
89// Term tinp = pythonToYAP(inp);
90// t = Yap_InitSlot(tinp);
91//}
92#endif
95 // do nothing constructor
96 YAPTerm() { hdl = 0; };
97 // YAPTerm(yhandle_t i) { t = i; };
99 YAPTerm(void *ptr);
101 YAPTerm(char *s) {
102 Term tp = 0;
103 mk(YAP_ReadBuffer(s, &tp));
104 }
105
106#if 1
108 virtual ~YAPTerm(){
109 // fprintf(stderr,"-%d,%lx,%p ",t,LOCAL_HandleBase[t] ,HR);
110 /* if (!t)
111 return;
112 // Yap_DebugPlWriteln(LOCAL_HandleBase[t]);
113 LOCAL_HandleBase[t] = TermFreeTerm;
114 while (LOCAL_HandleBase[LOCAL_CurSlot - 1] == TermFreeTerm) {
115 LOCAL_CurSlot--;
116 }
117 */
118 };
119#endif
120
130 YAP_tag_t tag();
132 Term deepCopy();
134 inline int numberVars(int start, bool singletons = false) {
135 return Yap_NumberVars(gt(), start, singletons);
136 }
137 inline Term term() {
138 return Deref(gt());
139 }
140 YAPTerm arg(int i) {
141 BACKUP_MACHINE_REGS();
142 Term t0 = gt();
143 YAPTerm tf;
144 if (!IsApplTerm(t0) && !IsPairTerm(t0))
145 return (Term)0;
146 tf = YAPTerm(ArgOfTerm(i, t0));
147 RECOVER_MACHINE_REGS();
148 return tf;
149 };
150
151 inline void bind(Term b) { LOCAL_HandleBase[hdl] = b; }
152 inline void bind(YAPTerm *b) { LOCAL_HandleBase[hdl] = b->term(); }
155 Term &operator[](arity_t n);
156 // const YAPTerm *vars();
158 virtual bool exactlyEqual(YAPTerm t1) {
159 bool out;
160 BACKUP_MACHINE_REGS();
161 out = Yap_eq(gt(), t1.term());
162 RECOVER_MACHINE_REGS();
163 return out;
164 };
165
167 virtual bool unify(YAPTerm t1) {
168 intptr_t out;
169 BACKUP_MACHINE_REGS();
170 out = Yap_unify(gt(), t1.term());
171 RECOVER_MACHINE_REGS();
172 return out;
173 };
174
176 virtual bool unifiable(YAPTerm t1) {
177 bool out;
178 BACKUP_MACHINE_REGS();
179 out = Yap_eq(gt(), t1.term());
180 RECOVER_MACHINE_REGS();
181 return out;
182 };
183
186 inline virtual YAP_Term variant(YAPTerm t1) {
187 intptr_t out;
188 BACKUP_MACHINE_REGS();
189 out = Yap_Variant(gt(), t1.term());
190 RECOVER_MACHINE_REGS();
191 return out;
192 };
193
194 virtual intptr_t hashTerm(size_t sz, size_t depth, bool variant) {
195 intptr_t out;
196
197 BACKUP_MACHINE_REGS();
198 out = Yap_TermHash(gt(), sz, depth, variant);
199 RECOVER_MACHINE_REGS();
200 return out;
201 };
203 virtual bool isVar() { return IsVarTerm(gt()); }
204 virtual bool isAtom() { return IsAtomTerm(gt()); }
205 virtual bool isInteger() {
206 return IsIntegerTerm(gt());
207 }
208 virtual bool isFloat() {
209 return IsFloatTerm(gt());
210 }
211 virtual bool isString() {
212 return IsStringTerm(gt());
213 }
214 virtual bool isCompound() {
215 return !(IsVarTerm(gt()) || IsNumTerm(gt()));
216 }
217 virtual bool isAppl() { return IsApplTerm(gt()); }
218 virtual bool isPair() { return IsPairTerm(gt()); }
219 virtual bool isGround() { return Yap_IsGroundTerm(gt()); }
220 virtual bool isList() { return Yap_IsListTerm(gt()); }
221
224 virtual Term getArg(arity_t i);
225
228 virtual inline arity_t arity() {
229 Term t0 = gt();
230
231 if (IsApplTerm(t0)) {
232 Functor f = FunctorOfTerm(t0);
233 if (IsExtensionFunctor(f))
234 return 0;
235 return ArityOfFunctor(f);
236 } else if (IsPairTerm(t0)) {
237 return 2;
238 }
239 return 0;
240 }
241
243 virtual const char *text() {
244 CACHE_REGS
245 char *os;
246
247 BACKUP_MACHINE_REGS();
248 if (!(os = Yap_TermToBuffer(Yap_GetFromSlot(hdl), Handle_vars_f))) {
249 RECOVER_MACHINE_REGS();
250 return 0;
251 }
252 RECOVER_MACHINE_REGS();
253 return os;
254 };
255
257 inline yhandle_t handle() { return hdl; };
258
260 inline bool initialized() { return hdl != 0; };
261};
262
266class X_API T : public YAPTerm {
267 public:
268 friend class YAPTerm;
269};
270
279class X_API YAPApplTerm : public YAPTerm {
280 friend class YAPTerm;
281
282public:
286 YAPApplTerm(Term t0) { if (IsApplTerm(t0)) mk(t0); }
289 YAPApplTerm(Functor f, Term ts[]) {
290 BACKUP_MACHINE_REGS();
291 Term t0 = Yap_MkApplTerm(f, f->ArityOfFE, ts);
292 mk(t0);
293 RECOVER_MACHINE_REGS();
294 };
300 YAPApplTerm(const std::string s, std::vector<Term> ts);
301 YAPApplTerm(const std::string s, std::vector<YAPTerm> ts);
302#if 0
305 template<typename... T>
306 YAPApplTerm(const Functor f, std::initializer_list<Term> list ) {
307 BACKUP_MACHINE_REGS();
308 *HR++ = (CELL)f;
309 for( auto elem : list )
310 {
311 RESET_VARIABLE(HR);
312 Yap_unify( elem, (CELL)HR );
313 HR++;
314 }
315 RECOVER_MACHINE_REGS();
316 };
319 YAPApplTerm(const std::string s, std::initializer_list<Term> list ) {
320 BACKUP_MACHINE_REGS();
321 Term *o = HR++;
322 for( auto elem : list )
323 {
324 RESET_VARIABLE(HR);
325 Yap_unify( elem, (CELL)HR );
326 HR++;
327 }
328 o[0] = (CELL)Yap_MkFunctor(Yap_LookupAtom(s.c_str()), (HR-(o+1)));
329 mk(AbsAppl(o));
330 RECOVER_MACHINE_REGS();
331 };
333 YAPApplTerm(const char s[], std::initializer_list<Term> list ) {
334 BACKUP_MACHINE_REGS();
335 Term *o = HR++;
336 for( auto elem : list )
337 {
338 RESET_VARIABLE(HR);
339 Yap_unify( elem, (CELL)HR );
340 HR++;
341 }
342 o[0] = (CELL)Yap_MkFunctor(Yap_LookupAtom(s), (HR-(o+1)));
343 mk(AbsAppl(o));
344 RECOVER_MACHINE_REGS();
345 };
346
348 YAPApplTerm(const std::string s, std::initializer_list<YAPTerm> list ) {
349 BACKUP_MACHINE_REGS();
350 Term *o = HR++;
351 for( auto elem : list )
352 {
353 RESET_VARIABLE(HR);
354 Yap_unify( elem.gt(), (CELL)HR );
355 HR++;
356 }
357 o[0] = (CELL)Yap_MkFunctor(Yap_LookupAtom(s.c_str()), (HR-(o+1)));
358 mk(AbsAppl(o));
359 RECOVER_MACHINE_REGS();
360 };
361#else
362 YAPApplTerm(const std::string s, Term a1 ) {
363 BACKUP_MACHINE_REGS();
364 Term *o = HR;
365 RESET_VARIABLE(HR+1);
366Yap_unify( a1, (CELL)(HR+1) );
367HR+=2;
368
369o[0] = (CELL)Yap_MkFunctor(Yap_LookupAtom(s.c_str()), 1);
370mk(AbsAppl(o));
371RECOVER_MACHINE_REGS();
372};
373YAPApplTerm(const std::string s, Term a1, Term a2 ) {
374BACKUP_MACHINE_REGS();
375Term *o = HR;
376RESET_VARIABLE(HR+1);
377Yap_unify( a1, (CELL)(HR+1) );
378RESET_VARIABLE(HR+2);
379Yap_unify( a2, (CELL)(HR+2) );
380HR+=3;
381
382o[0] = (CELL)Yap_MkFunctor(Yap_LookupAtom(s.c_str()), 2);
383mk(AbsAppl(o));
384RECOVER_MACHINE_REGS();
385};
386YAPApplTerm(const std::string s, Term a1, Term a2, Term a3 ) {
387BACKUP_MACHINE_REGS();
388Term *o = HR;
389RESET_VARIABLE(HR+1);
390Yap_unify( a1, (CELL)(HR+1) );
391RESET_VARIABLE(HR+2);
392Yap_unify( a2, (CELL)(HR+2) );
393RESET_VARIABLE(HR+3);
394Yap_unify( a3, (CELL)(HR+3) );
395HR+=4;
396o[0] = (CELL)Yap_MkFunctor(Yap_LookupAtom(s.c_str()),3);
397mk(AbsAppl(o));
398RECOVER_MACHINE_REGS();
399};
400#endif
403 YAPApplTerm(const std::string s, unsigned int arity) {
404 mk(Yap_MkNewApplTerm(Yap_MkFunctor(Yap_LookupAtom(s.c_str()), arity),
405 arity));
406 };
410 inline Functor functor() { return FunctorOfTerm(gt()); }
411 inline YAPFunctor getFunctor() { return YAPFunctor(FunctorOfTerm(gt())); }
412
413 Term getArg(arity_t i) {
414
415 Term t0 = gt();
416 Term tf;
417 tf = ArgOfTerm(i, t0);
418 RECOVER_MACHINE_REGS();
419 return tf;
420 };
421 void putArg(int i, Term targ) {
422 // BACKUP_MACHINE_REGS();
423 Term t0 = gt();
424 RepAppl(t0)[i] = Deref(targ);
425 // RECOVER_MACHINE_REGS();
426 };
427 void putArg(int i, YAPTerm t) {
428 // BACKUP_MACHINE_REGS();
429 Term t0 = gt();
430 RepAppl(t0)[i] = t.term();
431 // RECOVER_MACHINE_REGS();
432 };
433 virtual bool isVar() { return false; } //> type check for unbound
434 virtual bool isAtom() { return false; } //> type check for atom
435 virtual bool isInteger() { return false; } //> type check for integer
436 virtual bool isFloat() { return false; } //> type check for floating-point
437 virtual bool isString() { return false; } //> type check for a string " ... "
438 virtual bool isCompound() { return true; } //> is a primitive term
439 virtual bool isAppl() { return true; } //> is a structured term
440 virtual bool isPair() { return false; } //> is a pair term
441 virtual bool isGround() { return true; } //> term is ground
442 virtual bool isList() { return false; } //> term is a list
443};
444
448class X_API YAPPairTerm : public YAPTerm {
449 friend class YAPTerm;
450
451public:
452 YAPPairTerm(Term t0) {
453 t0 = Deref(t0);
454 if (IsPairTerm(t0) || t0 == TermNil)
455 mk(t0);
456 else
457 Yap_ThrowError(TYPE_ERROR_LIST, t0, "YAPPairTerms");
458 }
460 YAPPairTerm();
461 Term getHead() { return (HeadOfTerm(gt())); }
462 Term getTail() { return (TailOfTerm(gt())); }
463 YAPTerm car() { return YAPTerm(HeadOfTerm(gt())); }
464 bool nil() { return gt() == TermNil; }
465 YAPPairTerm cdr() { return YAPPairTerm(TailOfTerm(gt())); }
466 std::vector<Term> listToArray();
467 std::vector<YAPTerm> listToVector();
468};
469
474class X_API YAPNumberTerm : public YAPTerm {
475public:
476 YAPNumberTerm(){};
477 bool isTagged() { return IsIntTerm(gt()); }
478};
479
484class X_API YAPIntegerTerm : public YAPNumberTerm {
485public:
486 YAPIntegerTerm(intptr_t i);
487 intptr_t getInteger() { return IntegerOfTerm(gt()); };
488};
489
494class X_API YAPFloatTerm : public YAPNumberTerm {
495public:
496 YAPFloatTerm(double dbl) { mk(MkFloatTerm(dbl)); };
497
498 double getFl() { return FloatOfTerm(gt()); };
499};
500
501class X_API YAPListTerm : public YAPTerm {
502public:
503 //> Create a list term out of a standard term. Check if a valid operation.
506 YAPListTerm() { mk(TermNil); /* else type_error */ }
510 YAPListTerm(Term t0) { mk(t0); /* else type_error */ }
515 YAPListTerm(Term ts[], size_t n);
518 YAPListTerm(std::vector<Term>);
519 // YAPListTerm( vector<YAPTerm> v );
521 size_t length() {
522 Term *tailp;
523 Term t1 = gt();
524 return Yap_SkipList(&t1, &tailp);
525 }
527 Term &operator[](size_t n);
531 Term car();
535 Term cdr();
539 Term dup();
540
544 inline bool nil() {
545 return gt() == TermNil;
546 }
547
548 ;
549};
550
551class X_API YAPConjunctiveTerm : public YAPTerm {
552public:
553 //> Create a list term out of a standard term. Check if a valid operation.
556 YAPConjunctiveTerm() { mk(TermNil); /* else type_error */ }
560 YAPConjunctiveTerm(Term t0) { mk(t0); /* else type_error */ }
565 YAPConjunctiveTerm(const Term ts[], size_t n);
568 YAPConjunctiveTerm(std::vector<Term>);
569 // YAPConjunctiveTerm( vector<YAPTerm> v );
571 size_t length() {
572 Term *tailp;
573 Term t1 = gt();
574 size_t cnt = 1;
575 while (IsApplTerm(t1) && FunctorOfTerm(t1)==FunctorComma) {
576 t1 = ArgOfTerm(2,t1);
577 cnt++;
578 }
579 return Yap_SkipList(&t1, &tailp);
580 }
582 Term &operator[](size_t n);
586 Term car();
590 Term cdr();
591};
592
596class X_API YAPStringTerm : public YAPTerm {
597public:
599 YAPStringTerm(char *s);
601 YAPStringTerm(char *s, size_t len);
603 YAPStringTerm(wchar_t *s);
605 YAPStringTerm(wchar_t *s, size_t len);
606 const char *getString() { return StringOfTerm(gt()); }
607};
608
613class X_API YAPAtomTerm : public YAPTerm {
614 friend class YAPModule;
615 // Constructor: receives a C-atom;
616 YAPAtomTerm(Term t) : YAPTerm(t) { IsAtomTerm(t); }
617
618public:
619 YAPAtomTerm(Atom a) { mk(MkAtomTerm(a)); }
620 //> Constructor: receives an atom;
621 YAPAtomTerm(YAPAtom a) : YAPTerm() { mk(MkAtomTerm(a.a)); }
622 //> Constructor: receives a sequence of UTF-8 codes;
623 YAPAtomTerm(char s[]);
624 // Constructor: receives a sequence of up to n UTF-8 codes;
625 YAPAtomTerm(char *s, size_t len);
626 // Constructor: receives a sequence of wchar_ts, whatever they may be;
627 YAPAtomTerm(wchar_t *s);
628 // Constructor: receives a sequence of n wchar_ts, whatever they may be;
629 YAPAtomTerm(wchar_t *s, size_t len);
630 // Constructor: receives a std::string;
631 // YAPAtomTerm(std::string s) { mk(MkAtomTerm(Yap_LookupAtom(s.c_str())));
632 // };
633 bool isVar() { return false; }
634 bool isAtom() { return true; }
635 bool isInteger() { return false; }
636 bool isFloat() { return false; }
637 bool isString() { return false; }
638 bool isCompound() { return false; }
639 bool isAppl() { return false; }
640 bool isPair() { return false; }
641 virtual bool isGround() { return true; }
642 virtual bool isList() { return gt() == TermNil; }
643 // Getter: outputs the atom;
644 YAPAtom getAtom() { return YAPAtom(AtomOfTerm(gt())); }
645 // Getter: outputs the name as a sequence of ISO-LATIN1 codes;
646 const char *text() { return (const char *)AtomOfTerm(gt())->StrOfAE; }
647};
648
652class X_API YAPVarTerm : public YAPTerm {
653 friend class YAPTerm;
654
655public:
657 YAPVarTerm() { mk(MkVarTerm()); };
659 CELL *getVar() { return VarOfTerm(gt()); }
661 YAPVarTerm(Term t) {
662 if (IsVarTerm(t)) {
663 mk(t);
664 }
665 }
667 bool unbound() { return IsUnboundVar(VarOfTerm(gt())); }
668 inline bool isVar() { return true; }
669 inline bool isAtom() { return false; } //> type check for atom
670 inline bool isInteger() { return false; } //> type check for integer
671 inline bool isFloat() { return false; } //> type check for floating-point
672 inline bool isString() { return false; } //> type check for a string " ... "
673 inline bool isCompound() { return false; } //> is a primitive term
674 inline bool isAppl() { return false; } //> is a structured term
675 inline bool isPair() { return false; } //> is a pair term
676 inline bool isGround() { return false; } //> term is ground
677 inline bool isList() { return false; } //> term is a list
678};
679
680 extern "C" {
681 X_API extern Term MkErrorTerm(yap_error_descriptor_t *);
682 }
683
687class X_API YAPErrorTerm : public YAPTerm {
688 friend class YAPTerm;
689public:
690 YAPErrorTerm() : YAPTerm( MkErrorTerm(LOCAL_ActiveError)) {};
691 YAPErrorTerm(yap_error_descriptor_t *err) :YAPTerm( MkErrorTerm(err) ) {};
692};
693
695#endif /* YAPT_HH */
int Yap_NumberVars(Term t, int numbv, bool handle_singles USES_REGS)
numbervariables in term t
Definition: terms.c:770
YAPModule A YAPModule describes a bare module, which in YAP is just a name.
Definition: yapdb.hh:46
YAPModuleProp A YAPModuleProp controls access to a module property.
Definition: yapdb.hh:65
Predicates.
Definition: yapdb.hh:83
PrologPredicate.
Definition: yapdb.hh:287
take information on a Prolog error:
Definition: yapie.hh:31
Atom A YAP data-base is a collection of atoms, where each atom has a name and a set of Properties.
Definition: yapa.hh:71
YAPFunctor represents Prolog functors Name/Arity.
Definition: yapa.hh:125
Queries and engines.
Definition: yapq.hh:38
YAPApplTerm(Functor f, Term ts[])
Definition: yapt.hh:289
YAPTerm(Term tn)
create an empty YAPTerm
Definition: yapt.hh:86
Term deepCopy()
copy the term ( term copy )
Definition: yapi.cpp:433
bool initialized()
whether the term actually refers to a live object
Definition: yapt.hh:260
virtual bool isInteger()
type check for atom
Definition: yapt.hh:205
bool nil()
Check if the list is empty.
Definition: yapt.hh:544
YAPVarTerm()
constructor
Definition: yapt.hh:657
void mk(Term t0)
create a new YAPTerm from a term
Definition: yapt.hh:74
virtual bool isPair()
is a structured term
Definition: yapt.hh:218
bool isCompound()
type check for a string " ... "
Definition: yapt.hh:638
size_t length()
Return the number of elements in a list term.
Definition: yapt.hh:521
bool isString()
type check for floating-point
Definition: yapt.hh:637
Term pop_t()
get the Prolog term corresponding to the YAPTerm, and try to recover
Definition: yapt.hh:66
const char * text()
return a string with a textual representation of the term
Definition: yapt.hh:646
bool unbound()
type check for unbound
Definition: yapt.hh:667
virtual bool isAtom()
type check for unound
Definition: yapt.hh:204
YAPAtom getAtom()
[] is a list
Definition: yapt.hh:644
virtual bool isList()
term is ground
Definition: yapt.hh:220
bool isInteger()
type check for atom
Definition: yapt.hh:635
void put(Term t0)
copy a term to an YAPTerm
Definition: yapt.hh:80
YAPVarTerm(Term t)
is the variable bound to another one
Definition: yapt.hh:661
YAPApplTerm(const std::string s, unsigned int arity)
Definition: yapt.hh:403
bool isList()
term is ground
Definition: yapt.hh:677
virtual bool unifiable(YAPTerm t1)
we can unify t and t1
Definition: yapt.hh:176
bool isFloat()
type check for integer
Definition: yapt.hh:636
int numberVars(int start, bool singletons=false)
numbervars ( int start, bool process=false )
Definition: yapt.hh:134
YAP_tag_t tag()
construct a term out of an integer (if you know object type use YAPIntegerTerm) YAPTerm(long int num)...
Definition: yapi.cpp:389
Term gt()
handle to term, equivalent to term_t
Definition: yapt.hh:57
bool isPair()
is a structured term
Definition: yapt.hh:640
yhandle_t handle()
return a handle to the term
Definition: yapt.hh:257
YAPTerm()
private method to convert from Term (internal YAP representation) to YAPTerm
Definition: yapt.hh:96
YAPTerm(char *s)
parse string s and construct a term
Definition: yapt.hh:101
Term & operator[](size_t n)
Extract the nth element.
Definition: yapi.cpp:453
virtual bool isAppl()
is a primitive term
Definition: yapt.hh:217
virtual bool isVar()
term hash,
Definition: yapt.hh:203
bool isGround()
is a pair term
Definition: yapt.hh:676
YAPListTerm(Term t0)
Create an empty list term.
Definition: yapt.hh:510
virtual Term getArg(arity_t i)
term is a list
Definition: yapi.cpp:109
virtual bool isFloat()
type check for integer
Definition: yapt.hh:208
YAPTerm arg(int i)
from YAPTerm to Term (internal YAP representation)
Definition: yapt.hh:140
virtual bool isGround()
is a pair term
Definition: yapt.hh:219
YAPListTerm()
Definition: yapt.hh:506
virtual arity_t arity()
extract the arity of the term variables have arity 0
Definition: yapt.hh:228
virtual bool isString()
type check for floating-point
Definition: yapt.hh:211
virtual YAP_Term variant(YAPTerm t1)
t == t1, the two terms are equal up to variable renamingvirtual bool variant(
Definition: yapt.hh:186
virtual bool unify(YAPTerm t1)
t = t1
Definition: yapt.hh:167
virtual const char * text()
return a string with a textual representation of the term
Definition: yapt.hh:243
virtual bool exactlyEqual(YAPTerm t1)
this term is == to t1
Definition: yapt.hh:158
YAPApplTerm(Term t0)
There are very many ways to build one of these terms:
Definition: yapt.hh:286
YAPConjunctiveTerm(Term t0)
Create an empty list term.
Definition: yapt.hh:560
virtual ~YAPTerm()
Term destructor, tries to recover slot.
Definition: yapt.hh:108
bool isAtom()
type check for unbound
Definition: yapt.hh:634
bool isAppl()
is a primitive term
Definition: yapt.hh:639
bool isVar()
term hash,
Definition: yapt.hh:633
virtual bool isCompound()
type check for a string " ... "
Definition: yapt.hh:214
If you like being short, use T instead of YapTerm.
Definition: yapt.hh:266
Compound Term.
Definition: yapt.hh:279
Atom Term Term Representation of an Atom.
Definition: yapt.hh:613
Prolog container for error descriptors.
Definition: yapt.hh:687
Floating Point Term.
Definition: yapt.hh:494
Integer Term.
Definition: yapt.hh:484
Number Term.
Definition: yapt.hh:474
List Constructor Term.
Definition: yapt.hh:448
String Term.
Definition: yapt.hh:596
Generic Prolog Term.
Definition: yapt.hh:42
Variable Term.
Definition: yapt.hh:652
all we need to know about an error/throw
Definition: YapError.h:205