Variable name dictionaries

Author(s): Francisco Bueno, Edison Mera, Alejandro Serrano.

Documentation on exports

Usage:null_dict(D)

D is an empty dictionary.

    PREDICATEcreate_dict/2

    Usage:create_dict(Term,Dict)

    Dict has names for all variables in Term.

    • The following properties should hold at call time:
      (basic_props:term/1)Term is any term.
    • The following properties should hold upon exit:
      (vndict:varnamedict/1)Dict is a dictionary of variable names.

    Usage:create_pretty_dict(Term,Dict)

    Dict has names for all variables in Term. The difference with create_dict/2 is that prettier names are generated

    • The following properties should hold at call time:
      (basic_props:term/1)Term is any term.
    • The following properties should hold upon exit:
      (vndict:varnamedict/1)Dict is a dictionary of variable names.

    Usage:complete_dict(Dict,Term,NewDict)

    NewDict is Dict augmented with the variables of Term not yet in Dict.

    Usage:complete_vars_dict(Dict,Vars,NewDict)

    NewDict is Dict augmented with the variables of the list Vars not yet in Dict.

    Usage:complete_dict_alpha(Dict,Term,NewDict)

    NewDict is Dict augmented with the variables of Term not yet in Dict with alphabetical names.

    Usage:complete_vars_dict_alpha(Dict,Vars,NewDict)

    NewDict is Dict augmented with the variables of the list Vars not yet in Dict with alphabetical names.

    PREDICATEprune_dict/3

    Usage:prune_dict(Term,Dict,NewDict)

    NewDict is Dict reduced to just the variables of Term.

    PREDICATEsort_dict/2

    Usage:sort_dict(D,Dict)

    D is sorted into Dict.

    • The following properties should hold at call time:
      (vndict:varnamedict/1)D is a dictionary of variable names.
    • The following properties should hold upon exit:
      (vndict:varnamedict/1)Dict is a dictionary of variable names.

    Usage:dict2varnamesl(Dict,VNs)

    Translates Dict to VNs.

    • The following properties should hold at call time:
      (vndict:varnamedict/1)Dict is a dictionary of variable names.
    • The following properties should hold upon exit:
      (dict_types:varnamesl/1)VNs is a list of Name=Var pairs, where Var is a variable and Name its name.

    Usage:varnamesl2dict(VNs,Dict)

    Translates VNs to Dict.

    • The following properties should hold at call time:
      (dict_types:varnamesl/1)VNs is a list of Name=Var pairs, where Var is a variable and Name its name.
    • The following properties should hold upon exit:
      (vndict:varnamedict/1)Dict is a dictionary of variable names.

    PREDICATEfind_name/4

    Usage:find_name(Vars,Names,V,Name)

    Given that vars_names_dict(Dict,Vars,Names) holds, it acts as rename(V,Dict), but the name of V is given as Name instead of unified with it.

      PREDICATEprettyvars/2

      Usage:prettyvars(Term,Dict)

      Give names to the variables in the term Term using the dictionary Dict. Intended to replace prettyvars/1 in those places where is possible to get the dictionary of variables.

      • Call and exit should be compatible with:
        (basic_props:term/1)Term is any term.
        (dict_types:varnamesl/1)Dict is a list of Name=Var pairs, where Var is a variable and Name its name.
      • The following properties should hold at call time:
        (term_typing:nonvar/1)Dict is currently a term which is not a free variable.

      PREDICATErename/2

      Usage:rename(Term,Dict)

      Unifies each variable in Term with its name in Dict. If no name is found, a new name is created.

      • The following properties should hold at call time:
        (vndict:varnamedict/1)Dict is a dictionary of variable names.

      Usage:varnamedict(D)

      D is a dictionary of variable names.

        Usage:vars_names_dict(Dict,Vars,Names)

        Vars is a sorted list of variables, and Names is a list of their names, which correspond in the same order.

        Documentation on imports

        This module has the following direct dependencies: