YAP 7.1.0
Copying Terms

Detailed Description


Class Documentation

◆ copy_term/2

class copy_term/2

copy_term(? TI,- TF)

defined in the ISO standard

Term TF is a variant of the original term TI, such that for each variable V in the term TI there is a new variable V' in term TF Notice that:

  • suspended goals and attributes for attributed variables in TI are also duplicated;
  • ground terms are shared between the new and the old term

If you do not want any sharing to occur please use duplicate_term/2

◆ duplicate_term/2

class duplicate_term/2

duplicate_term(? TI,- TF)

Term  _TF_ is a variant of the original term  _TI_, such that
for each variable  _V_ in the term  _TI_ there is a new variable
_V'_ in term  _TF_, and the two terms do not share any
structure. All suspended goals and attributes for attributed
variables in  _TI_ are also duplicated.

Also refer to @ref copy_term/2 .

◆ rational_tree_to_forest/4

class rational_tree_to_forest/4

rational_tree_to_forest(? TI,- TF, -Extras, ?More)

Copy the term, but loops within the term are broken up and added to a list of loopy assignments

The term TF is a forest representation (without cycles and repeated terms) for the Prolog term TI The term TF is the main term The difference list SubTerms-_MoreSubterms_ stores terms of the form V=T, where V is a new variable occuring in TF, and T is a copy of a sub-term from TI

◆ copy_term_nat/2

class copy_term_nat/2

copy_term_nat(? TI,- TF)

As copy_term/2 Attributes however, are not copied but replaced by fresh variables

Macro Definition Documentation

◆ DEB_DOOB

#define DEB_DOOB (   S)
Value:
(fprintf(stderr, "%s %ld %p=%p %p--%d\n ", S, to_visit - to_visit0, pt0, \
ptf, *AbsAppl(pt0), arity))

Definition at line 41 of file copy.c.

◆ DEB_DOOBIN

#define DEB_DOOBIN (   d0)    (fprintf(stderr, "+++ %s ", __FUNCTION__), Yap_DebugPlWriteln(d0))

Definition at line 38 of file copy.c.

◆ DEB_DOOBOUT

#define DEB_DOOBOUT (   d0)    (fprintf(stderr, "--- "), Yap_DebugPlWriteln(d0))

Definition at line 40 of file copy.c.

Function Documentation

◆ CopyTermToArena()

Term CopyTermToArena ( Term  t,
bool  share,
bool  copy_att_vars,
yap_error_number *  errp,
Term *  arenap,
Term *bindp  USES_REGS 
)

Definition at line 529 of file copy.c.

◆ Yap_AllocateDefaultArena()

void Yap_AllocateDefaultArena ( size_t  gsizeW,
int  wid,
void *  cs 
)

Definition at line 157 of file copy.c.

◆ Yap_ArenaExpand()

bool Yap_ArenaExpand ( size_t  sz,
CELL *  arenap 
)

Definition at line 102 of file copy.c.

◆ Yap_ArenaLimit()

CELL * Yap_ArenaLimit ( Term  arena)

Definition at line 68 of file copy.c.

◆ Yap_ArenaPt()

CELL * Yap_ArenaPt ( Term  arena)

Definition at line 70 of file copy.c.

◆ Yap_ArenaSz()

UInt Yap_ArenaSz ( Term  arena)

Definition at line 72 of file copy.c.

◆ Yap_CopyTerm()

Term Yap_CopyTerm ( Term  inp)

Definition at line 679 of file copy.c.

◆ Yap_CopyTermNoShare()

Term Yap_CopyTermNoShare ( Term  inp)

Definition at line 684 of file copy.c.

◆ Yap_InitCopyTerm()

void Yap_InitCopyTerm ( void  )

Definition at line 836 of file copy.c.

◆ Yap_MkArena()

Term Yap_MkArena ( CELL *  ptr,
CELL *  max 
)

Definition at line 87 of file copy.c.

◆ Yap_TermAsForest()

Term Yap_TermAsForest ( Term  t1)

Definition at line 792 of file copy.c.

Macros

#define DEB_DOOBIN(d0)   (fprintf(stderr, "+++ %s ", __FUNCTION__), Yap_DebugPlWriteln(d0))
 
#define DEB_DOOBOUT(d0)   (fprintf(stderr, "--- "), Yap_DebugPlWriteln(d0))
 
#define DEB_DOOB(S)
 

Functions

CELL * Yap_ArenaLimit (Term arena)
 
CELL * Yap_ArenaPt (Term arena)
 
UInt Yap_ArenaSz (Term arena)
 
Term Yap_MkArena (CELL *ptr, CELL *max)
 
bool Yap_ArenaExpand (size_t sz, CELL *arenap)
 
void Yap_AllocateDefaultArena (size_t gsizeW, int wid, void *cs)
 
Term CopyTermToArena (Term t, bool share, bool copy_att_vars, yap_error_number *errp, Term *arenap, Term *bindp USES_REGS)
 
Term Yap_CopyTerm (Term inp)
 
Term Yap_CopyTermNoShare (Term inp)
 
Term Yap_TermAsForest (Term t1)
 
void Yap_InitCopyTerm (void)