Attributed Variables Runtime

Author(s): Rémy Haemmerlé, Christian Holzbaur, Daniel Cabeza, Manuel Carro.

This module provides a means to handle attributed variables. Note that attributes are private to the module from which the predicates implemented by attr_rt module are called. See package attr for more details about attributed variables.

Usage and interface

Documentation on exports

PREDICATE

Usage:attvar(Var)

Succeeds if Term is an attributed variable

    PREDICATE

    Usage:put_attr_local(Var,Value)

    If Var is a variable or attributed variable, set its attribute to Value. If an attribute is already associated with Var, the old value is replaced. Backtracking will restore the old value (i.e., an attribute is a mutable term. See also library mutables). This predicate raises a representation error if Var is not a variable and a type error if Module is not an atom.

      PREDICATE
      No further documentation available for this predicate.

      PREDICATE

      Usage:get_attr_local(Var,Value)

      Request the current value for the attribute associted to Var. If Var is not an attributed variable or the named attribute is not associated to Var this predicate fails silently.

        PREDICATE
        No further documentation available for this predicate.

        PREDICATE

        Usage:del_attr_local(Var)

        If Var has an attribute, deletes it, otherwise succeeds without side-effect.

          PREDICATE
          No further documentation available for this predicate.

          PREDICATE

          Usage:attvarset(X,Vars)

          AttVars is a list of all attributed variables in Term and its attributes. I.e., attvarset/2 works recursively through attributes. This predicate is Cycle-safe. The goal term_attvars(Term,[]) is optimized to be an efficient test that Term has no attributes. I.e., scanning the term is aborted after the first attributed variable is found.

            PREDICATE

            Usage:copy_term(Term,Copy,Gs)

            Creates a regular term Copy as a copy of Term (without any attributes), and a list Gs of goals that when executed reinstate all attributes onto Copy. The nonterminal attribute_goal/1, as defined in the modules the attributes stem from, is used to convert attributes to lists of goals.