6CELL *pt0=&t-1, *pt0_end=&t;
13 yhandle_t y0 = Yap_StartHandles();
18 while (pt0 == pt0_end) {
19 if (!pop_sub_term(stt, &pt0, &pt0_end)) {
29 mderef_head(d0, dd0, var_in_term_unk);
32 CELL *ptd1 = RepPair(d0);
33#if defined(LIST_HOOK_CODE)
36 if (IS_VISIT_MARKER(ptd1[0]))
38 CELL d1 = VISIT_UNMARK(ptd1[0]);
39 push_sub_term(stt, d1, ptd1, pt0, pt0_end);
45 }
else if (IsApplTerm(d0)) {
49 CELL *ptd1 = RepAppl(d0), d1;
50 f = (
Functor)(d1 = VISIT_UNMARK(*ptd1));
51#if defined(COMPOUND_HOOK_CODE)
54 if (IsExtensionFunctor(f)) {
55 if (f == FunctorAttVar)
60 a = ArityOfFunctor(f);
63 if (IS_VISIT_MARKER(*ptd1)) {
67 push_sub_term(stt, d1, ptd1, pt0, pt0_end);
74#if defined(ATOMIC_HOOK_CODE)
80 mderef_body(d0,dd0, ptd0, var_in_term_unk, var_in_term_nvar);
82#if defined(VAR_HOOK_CODE)
87 }
while (stt->err != YAP_NO_ERROR);
90#undef RESET_TERM_VISITOR
#define VAR_HOOK_CODE
routine to locate all variables in a term, and its application s