<HTML> <HEAD> <!-- Created by texi2html 1.56k + clip patches and <A href="http://www.clip.dia.fi.upm.es/Software">lpdoc</A> from ciao.texi on 28 January 2007 --> <LINK rel="stylesheet" href="ciao.css" type="text/css"> <TITLE>The Ciao Prolog System - Variable name dictionaries</TITLE> </HEAD> <BODY> Go to the <A HREF="ciao_1.html">first</A>, <A HREF="ciao_175.html">previous</A>, <A HREF="ciao_177.html">next</A>, <A HREF="ciao_241.html">last</A> section, <A HREF="ciao_toc.html">table of contents</A>. <P><HR><P> <H1><A NAME="SEC720" HREF="ciao_toc.html#TOC720">Variable name dictionaries</A></H1> <P> <A NAME="IDX8073"></A> <P> <STRONG>Author(s):</STRONG> Francisco Bueno. <P> <STRONG>Version:</STRONG> 1.10#7 (2006/4/26, 19:22:13 CEST) <P> <STRONG>Version of last change:</STRONG> 1.9#99 (2003/8/27, 17:56:12 CEST) <UL> <LI><A HREF="ciao_176.html#SEC721">Usage and interface (vndict)</A> <LI><A HREF="ciao_176.html#SEC722">Documentation on exports (vndict)</A> </UL> <H2><A NAME="SEC721" HREF="ciao_toc.html#TOC721">Usage and interface (<CODE>vndict</CODE>)</A></H2> <div class="cartouche"> <UL> <LI><STRONG>Library usage:</STRONG> <CODE>:- use_module(library(vndict)).</CODE> <LI><STRONG>Exports:</STRONG> <UL> <LI><EM>Predicates:</EM> <A NAME="IDX8074"></A> <CODE>create_dict/2</CODE>, <A NAME="IDX8075"></A> <CODE>complete_dict/3</CODE>, <A NAME="IDX8076"></A> <CODE>complete_vars_dict/3</CODE>, <A NAME="IDX8077"></A> <CODE>prune_dict/3</CODE>, <A NAME="IDX8078"></A> <CODE>sort_dict/2</CODE>, <A NAME="IDX8079"></A> <CODE>dict2varnamesl/2</CODE>, <A NAME="IDX8080"></A> <CODE>varnamesl2dict/2</CODE>, <A NAME="IDX8081"></A> <CODE>find_name/4</CODE>, <A NAME="IDX8082"></A> <CODE>rename/2</CODE>, <A NAME="IDX8083"></A> <CODE>vars_names_dict/3</CODE>. <LI><EM>Regular Types:</EM> <A NAME="IDX8084"></A> <CODE>null_dict/1</CODE>, <A NAME="IDX8085"></A> <CODE>varname/1</CODE>, <A NAME="IDX8086"></A> <CODE>varnamesl/1</CODE>, <A NAME="IDX8087"></A> <CODE>varnamedict/1</CODE>. </UL> <LI><STRONG>Other modules used:</STRONG> <UL> <LI><EM>System library modules:</EM> <A NAME="IDX8088"></A> <CODE>idlists</CODE>, <A NAME="IDX8089"></A> <CODE>terms_vars</CODE>, <A NAME="IDX8090"></A> <CODE>sets</CODE>, <A NAME="IDX8091"></A> <CODE>sort</CODE>. </UL> </UL> </div class="cartouche"> <H2><A NAME="SEC722" HREF="ciao_toc.html#TOC722">Documentation on exports (<CODE>vndict</CODE>)</A></H2> <P> <A NAME="IDX8092"></A> <A NAME="IDX8093"></A> <DL> <DT><span class="define">REGTYPE:</span> <B>null_dict/1:</B> <DD><A NAME="IDX8094"></A> <P> <STRONG>Usage:</STRONG> <CODE>null_dict(D)</CODE> <UL> <LI><EM>Description:</EM> <CODE>D</CODE> is an empty dictionary. </UL> </DL> <P> <A NAME="IDX8095"></A> <A NAME="IDX8096"></A> <DL> <DT><span class="define">PREDICATE:</span> <B>create_dict/2:</B> <DD><A NAME="IDX8097"></A> <P> <STRONG>Usage:</STRONG> <CODE>create_dict(Term, Dict)</CODE> <UL> <LI><EM>Description:</EM> <CODE>Dict</CODE> has names for all variables in <CODE>Term</CODE>. <LI><EM>The following properties should hold at call time:</EM> <CODE>Term</CODE> is any term. (<CODE>basic_props:term/1</CODE>) <LI><EM>The following properties should hold upon exit:</EM> <CODE>Dict</CODE> is a dictionary of variable names. (<CODE>vndict:varnamedict/1</CODE>) </UL> </DL> <P> <A NAME="IDX8098"></A> <A NAME="IDX8099"></A> <DL> <DT><span class="define">PREDICATE:</span> <B>complete_dict/3:</B> <DD><A NAME="IDX8100"></A> <P> <STRONG>Usage:</STRONG> <CODE>complete_dict(+Dict, +Term, -NewDict)</CODE> <UL> <LI><EM>Description:</EM> <CODE>NewDict</CODE> is <CODE>Dict</CODE> augmented with the variables of <CODE>Term</CODE> not yet in <CODE>Dict</CODE>. </UL> </DL> <P> <A NAME="IDX8101"></A> <A NAME="IDX8102"></A> <DL> <DT><span class="define">PREDICATE:</span> <B>complete_vars_dict/3:</B> <DD><A NAME="IDX8103"></A> <P> <STRONG>Usage:</STRONG> <CODE>complete_vars_dict(+Dict, +Vars, -NewDict)</CODE> <UL> <LI><EM>Description:</EM> <CODE>NewDict</CODE> is <CODE>Dict</CODE> augmented with the variables of the list <CODE>Vars</CODE> not yet in <CODE>Dict</CODE>. </UL> </DL> <P> <A NAME="IDX8104"></A> <A NAME="IDX8105"></A> <DL> <DT><span class="define">PREDICATE:</span> <B>prune_dict/3:</B> <DD><A NAME="IDX8106"></A> <P> <STRONG>Usage:</STRONG> <CODE>prune_dict(+Term, +Dict, -NewDict)</CODE> <UL> <LI><EM>Description:</EM> <CODE>NewDict</CODE> is <CODE>Dict</CODE> reduced to just the variables of <CODE>Term</CODE>. </UL> </DL> <P> <A NAME="IDX8107"></A> <A NAME="IDX8108"></A> <DL> <DT><span class="define">PREDICATE:</span> <B>sort_dict/2:</B> <DD><A NAME="IDX8109"></A> <P> <STRONG>Usage:</STRONG> <CODE>sort_dict(D, Dict)</CODE> <UL> <LI><EM>Description:</EM> <CODE>D</CODE> is sorted into <CODE>Dict</CODE>. <LI><EM>The following properties should hold at call time:</EM> <CODE>D</CODE> is a dictionary of variable names. (<CODE>vndict:varnamedict/1</CODE>) <LI><EM>The following properties should hold upon exit:</EM> <CODE>Dict</CODE> is a dictionary of variable names. (<CODE>vndict:varnamedict/1</CODE>) </UL> </DL> <P> <A NAME="IDX8110"></A> <A NAME="IDX8111"></A> <DL> <DT><span class="define">PREDICATE:</span> <B>dict2varnamesl/2:</B> <DD><A NAME="IDX8112"></A> <P> <STRONG>Usage:</STRONG> <CODE>dict2varnamesl(Dict, VNs)</CODE> <UL> <LI><EM>Description:</EM> Translates <CODE>Dict</CODE> to <CODE>VNs</CODE>. <LI><EM>The following properties should hold at call time:</EM> <CODE>Dict</CODE> is a dictionary of variable names. (<CODE>vndict:varnamedict/1</CODE>) <LI><EM>The following properties should hold upon exit:</EM> <CODE>VNs</CODE> is a list of <CODE>Name=Var</CODE>, for a variable <CODE>Var</CODE> and its name <CODE>Name</CODE>. (<CODE>vndict:varnamesl/1</CODE>) </UL> </DL> <P> <A NAME="IDX8113"></A> <A NAME="IDX8114"></A> <DL> <DT><span class="define">PREDICATE:</span> <B>varnamesl2dict/2:</B> <DD><A NAME="IDX8115"></A> <P> <STRONG>Usage:</STRONG> <CODE>varnamesl2dict(VNs, Dict)</CODE> <UL> <LI><EM>Description:</EM> Translates <CODE>VNs</CODE> to <CODE>Dict</CODE>. <LI><EM>The following properties should hold at call time:</EM> <CODE>VNs</CODE> is a list of <CODE>Name=Var</CODE>, for a variable <CODE>Var</CODE> and its name <CODE>Name</CODE>. (<CODE>vndict:varnamesl/1</CODE>) <LI><EM>The following properties should hold upon exit:</EM> <CODE>Dict</CODE> is a dictionary of variable names. (<CODE>vndict:varnamedict/1</CODE>) </UL> </DL> <P> <A NAME="IDX8116"></A> <A NAME="IDX8117"></A> <DL> <DT><span class="define">PREDICATE:</span> <B>find_name/4:</B> <DD><A NAME="IDX8118"></A> <P> <CODE>find_name(Vars, Names, V, Name)</CODE> <P> Given that <CODE>vars_names_dict(Dict,Vars,Names)</CODE> holds, it acts as <CODE>rename(X,Dict)</CODE>, but the name of <CODE>X</CODE> is given as <CODE>Name</CODE> instead of unified with it. </DL> <P> <A NAME="IDX8119"></A> <A NAME="IDX8120"></A> <DL> <DT><span class="define">PREDICATE:</span> <B>rename/2:</B> <DD><A NAME="IDX8121"></A> <P> <STRONG>Usage:</STRONG> <CODE>rename(Term, Dict)</CODE> <UL> <LI><EM>Description:</EM> Unifies each variable in <CODE>Term</CODE> with its name in <CODE>Dict</CODE>. If no name is found, a new name is created. <LI><EM>The following properties should hold at call time:</EM> <CODE>Dict</CODE> is a dictionary of variable names. (<CODE>vndict:varnamedict/1</CODE>) </UL> </DL> <P> <A NAME="IDX8122"></A> <A NAME="IDX8123"></A> <DL> <DT><span class="define">REGTYPE:</span> <B>varname/1:</B> <DD><A NAME="IDX8124"></A> <P> <STRONG>Usage:</STRONG> <CODE>varname(N)</CODE> <UL> <LI><EM>Description:</EM> <CODE>N</CODE> is a term representing a variable name. </UL> </DL> <P> <A NAME="IDX8125"></A> <A NAME="IDX8126"></A> <DL> <DT><span class="define">REGTYPE:</span> <B>varnamesl/1:</B> <DD><A NAME="IDX8127"></A> <P> <STRONG>Usage:</STRONG> <CODE>varnamesl(D)</CODE> <UL> <LI><EM>Description:</EM> <CODE>D</CODE> is a list of <CODE>Name=Var</CODE>, for a variable <CODE>Var</CODE> and its name <CODE>Name</CODE>. </UL> </DL> <P> <A NAME="IDX8128"></A> <A NAME="IDX8129"></A> <DL> <DT><span class="define">REGTYPE:</span> <B>varnamedict/1:</B> <DD><A NAME="IDX8130"></A> <P> <STRONG>Usage:</STRONG> <CODE>varnamedict(D)</CODE> <UL> <LI><EM>Description:</EM> <CODE>D</CODE> is a dictionary of variable names. </UL> </DL> <P> <A NAME="IDX8131"></A> <A NAME="IDX8132"></A> <DL> <DT><span class="define">PREDICATE:</span> <B>vars_names_dict/3:</B> <DD><A NAME="IDX8133"></A> <P> <STRONG>Usage:</STRONG> <CODE>vars_names_dict(Dict, Vars, Names)</CODE> <UL> <LI><EM>Description:</EM> <CODE>Varss</CODE> is a sorted list of variables, and <CODE>Names</CODE> is a list of their names, which correspond in the same order. <LI><EM>Call and exit should be <EM>compatible</EM> with:</EM> <CODE>Dict</CODE> is a dictionary of variable names. (<CODE>vndict:varnamedict/1</CODE>) <CODE>Vars</CODE> is a list. (<CODE>basic_props:list/1</CODE>) <CODE>Names</CODE> is a list. (<CODE>basic_props:list/1</CODE>) </UL> </DL> <P><HR><P> Go to the <A HREF="ciao_1.html">first</A>, <A HREF="ciao_175.html">previous</A>, <A HREF="ciao_177.html">next</A>, <A HREF="ciao_241.html">last</A> section, <A HREF="ciao_toc.html">table of contents</A>. </BODY> </HTML>