Term manipulation utilities

Author(s): The Ciao Development Team.

This module implements some utils to do term manipulation.

Usage and interface

Documentation on exports

PREDICATEterm_size/2

Usage:term_size(Term,N)

Determines the size of a term.

PREDICATEcopy_args/3

Usage:copy_args(N,Term,Copy)

Term and Copy have the same first N arguments.

Other properties: copy_args(N,Term,Copy)

  • If the following properties hold at call time:
    (term_typing:ground/1)N is currently ground (it contains no variables).
    (term_typing:nonvar/1)Term is currently a term which is not a free variable.
    then the following properties hold globally:
    (basic_props:eval/1)copy_args(N,Term,Copy) is evaluable at compile-time.
copy_args(N,Term,Copy)

  • The following properties hold globally:
    (basic_props:sideff/2)copy_args(N,Term,Copy) is side-effect free.

PREDICATEarg/2

Usage:arg(Term,Arg)

Arg is an argument of Term. Gives each of the arguments on backtracking.

    PREDICATEatom_concat/2
    atom_concat(Atms,Atm)

    Atm is the atom resulting from concatenating all atoms in the list Atms in the order in which they appear. If Atm is an atom at call then Atms can contain free variables.

    Usage 1:atom_concat(Atms,Atm)

    • The following properties should hold at call time:
      (basic_props:list/2)Atms is a list of atms.
    • The following properties should hold upon exit:
      (basic_props:atm/1)Atm is an atom.

    Usage 2:atom_concat(Atms,Atm)

    Documentation on imports

    This module has the following direct dependencies: