<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 - dictionary_tree (library)</TITLE> </HEAD> <BODY> Go to the <A HREF="ciao_1.html">first</A>, <A HREF="ciao_210.html">previous</A>, <A HREF="ciao_212.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="SEC832" HREF="ciao_toc.html#TOC832">dictionary_tree (library)</A></H1> <P> <A NAME="IDX9068"></A> <P> <STRONG>Author(s):</STRONG> Göran Smedbäck. <P> <STRONG>Version:</STRONG> 1.10#7 (2006/4/26, 19:22:13 CEST) <P> <STRONG>Version of last change:</STRONG> 1.9#173 (2003/12/4, 17:47:16 CET) <P> This module offers a dynamic tree structured dictionary a bit combined with predicates that gives it the useability to be the dictionary for the parser. <UL> <LI><A HREF="ciao_211.html#SEC833">Usage and interface (dictionary_tree)</A> <LI><A HREF="ciao_211.html#SEC834">Documentation on exports (dictionary_tree)</A> </UL> <H2><A NAME="SEC833" HREF="ciao_toc.html#TOC833">Usage and interface (<CODE>dictionary_tree</CODE>)</A></H2> <div class="cartouche"> <UL> <LI><STRONG>Library usage:</STRONG> <CODE>:- use_module(library(dictionary_tree)).</CODE> <LI><STRONG>Exports:</STRONG> <UL> <LI><EM>Predicates:</EM> <A NAME="IDX9069"></A> <CODE>create_dictionaries/1</CODE>, <A NAME="IDX9070"></A> <CODE>is_dictionaries/1</CODE>, <A NAME="IDX9071"></A> <CODE>get_definition_dictionary/2</CODE>, <A NAME="IDX9072"></A> <CODE>get_prototype_dictionary/2</CODE>, <A NAME="IDX9073"></A> <CODE>dictionary_insert/5</CODE>, <A NAME="IDX9074"></A> <CODE>dictionary_lookup/5</CODE>, <A NAME="IDX9075"></A> <CODE>merge_tree/2</CODE>. </UL> <LI><STRONG>Other modules used:</STRONG> <UL> <LI><EM>System library modules:</EM> <A NAME="IDX9076"></A> <CODE>aggregates</CODE>, <A NAME="IDX9077"></A> <CODE>dynamic</CODE>, <A NAME="IDX9078"></A> <CODE>iso_misc</CODE>, <A NAME="IDX9079"></A> <CODE>iso_byte_char</CODE>, <A NAME="IDX9080"></A> <CODE>iso_incomplete</CODE>, <A NAME="IDX9081"></A> <CODE>operators</CODE>, <A NAME="IDX9082"></A> <CODE>read</CODE>, <A NAME="IDX9083"></A> <CODE>write</CODE>, <A NAME="IDX9084"></A> <CODE>lists</CODE>, <A NAME="IDX9085"></A> <CODE>provrml/internal_types</CODE>. </UL> </UL> </div class="cartouche"> <H2><A NAME="SEC834" HREF="ciao_toc.html#TOC834">Documentation on exports (<CODE>dictionary_tree</CODE>)</A></H2> <P> <A NAME="IDX9086"></A> <A NAME="IDX9087"></A> <DL> <DT><span class="define">PREDICATE:</span> <B>create_dictionaries/1:</B> <DD><A NAME="IDX9088"></A> <P> <STRONG>Usage:</STRONG> <CODE>create_dictionaries(-Dictionary)</CODE> <UL> <LI><EM>Description:</EM> Returns a dictionary. A general name was used if the user would like to change the code to include more dictionaries. <LI><EM>Call and exit should be <EM>compatible</EM> with:</EM> <CODE>-Dictionary</CODE> is a dictionary. (<CODE>internal_types:dictionary/1</CODE>) </UL> </DL> <P> <A NAME="IDX9089"></A> <A NAME="IDX9090"></A> <DL> <DT><span class="define">PREDICATE:</span> <B>is_dictionaries/1:</B> <DD><A NAME="IDX9091"></A> <P> <STRONG>Usage:</STRONG> <CODE>is_dictionaries(?Dictionary)</CODE> <UL> <LI><EM>Description:</EM> Is the argument a dictionary is solved by this predicate. <LI><EM>Call and exit should be <EM>compatible</EM> with:</EM> <CODE>?Dictionary</CODE> is a dictionary. (<CODE>internal_types:dictionary/1</CODE>) </UL> </DL> <P> <A NAME="IDX9092"></A> <A NAME="IDX9093"></A> <DL> <DT><span class="define">PREDICATE:</span> <B>get_definition_dictionary/2:</B> <DD><A NAME="IDX9094"></A> <P> <STRONG>Usage:</STRONG> <CODE>get_definition_dictionary(+Dictionary, -Tree)</CODE> <UL> <LI><EM>Description:</EM> Returns the definition dictionary (for the moment there is only one dictionary), which is a tree representation. <LI><EM>Call and exit should be <EM>compatible</EM> with:</EM> <CODE>+Dictionary</CODE> is a dictionary. (<CODE>internal_types:dictionary/1</CODE>) <CODE>-Tree</CODE> is a tree structure. (<CODE>internal_types:tree/1</CODE>) </UL> </DL> <P> <A NAME="IDX9095"></A> <A NAME="IDX9096"></A> <DL> <DT><span class="define">PREDICATE:</span> <B>get_prototype_dictionary/2:</B> <DD><A NAME="IDX9097"></A> <P> <STRONG>Usage:</STRONG> <CODE>get_prototype_dictionary(+Dictionary, -Tree)</CODE> <UL> <LI><EM>Description:</EM> Returns the prototype dictionary (for the moment there is only one dictionary), which is a tree representation. <LI><EM>Call and exit should be <EM>compatible</EM> with:</EM> <CODE>+Dictionary</CODE> is a dictionary. (<CODE>internal_types:dictionary/1</CODE>) <CODE>-Tree</CODE> is a tree structure. (<CODE>internal_types:tree/1</CODE>) </UL> </DL> <P> <A NAME="IDX9098"></A> <A NAME="IDX9099"></A> <DL> <DT><span class="define">PREDICATE:</span> <B>dictionary_insert/5:</B> <DD><A NAME="IDX9100"></A> <P> <STRONG>Usage:</STRONG> <CODE>dictionary_insert(+Key, +Type, +Field, +Dictionary, ?Info)</CODE> <UL> <LI><EM>Description:</EM> The predicate will search for the place for the Key and return Info, if the element inserted had a post before (same key value) multiple else new. The dictionary is dynamic and do not need output because of using unbinded variables. <LI><EM>Call and exit should be <EM>compatible</EM> with:</EM> <CODE>+Key</CODE> is an atom. (<CODE>basic_props:atm/1</CODE>) <CODE>+Type</CODE> is an atom. (<CODE>basic_props:atm/1</CODE>) <CODE>+Field</CODE> is any term. (<CODE>basic_props:term/1</CODE>) <CODE>+Dictionary</CODE> is a tree structure. (<CODE>internal_types:tree/1</CODE>) <CODE>?Info</CODE> is an atom. (<CODE>basic_props:atm/1</CODE>) </UL> </DL> <P> <A NAME="IDX9101"></A> <A NAME="IDX9102"></A> <DL> <DT><span class="define">PREDICATE:</span> <B>dictionary_lookup/5:</B> <DD><A NAME="IDX9103"></A> <P> <STRONG>Usage:</STRONG> <CODE>dictionary_lookup(+Key, ?Type, ?Field, +Dictionary, -Info)</CODE> <UL> <LI><EM>Description:</EM> The predicate will search for the Key and return Info;defined or undefined accordingly. If defined the fields will be filled as well. The predicate do not insert the element. <LI><EM>Call and exit should be <EM>compatible</EM> with:</EM> <CODE>+Key</CODE> is an atom. (<CODE>basic_props:atm/1</CODE>) <CODE>?Type</CODE> is an atom. (<CODE>basic_props:atm/1</CODE>) <CODE>?Field</CODE> is any term. (<CODE>basic_props:term/1</CODE>) <CODE>+Dictionary</CODE> is a dictionary. (<CODE>internal_types:dictionary/1</CODE>) <CODE>-Info</CODE> is an atom. (<CODE>basic_props:atm/1</CODE>) </UL> </DL> <P> <A NAME="IDX9104"></A> <A NAME="IDX9105"></A> <DL> <DT><span class="define">PREDICATE:</span> <B>merge_tree/2:</B> <DD><A NAME="IDX9106"></A> <P> <STRONG>Usage:</STRONG> <CODE>merge_tree(+Tree, +Tree)</CODE> <UL> <LI><EM>Description:</EM> The predicate can be used for adding a tree dictionary to another one (the second). It will remove equal posts but posts with a slight difference will be inserted. The resulting tree will be the second tree. <LI><EM>Call and exit should be <EM>compatible</EM> with:</EM> <CODE>+Tree</CODE> is a tree structure. (<CODE>internal_types:tree/1</CODE>) <CODE>+Tree</CODE> is a tree structure. (<CODE>internal_types:tree/1</CODE>) </UL> </DL> <P><HR><P> Go to the <A HREF="ciao_1.html">first</A>, <A HREF="ciao_210.html">previous</A>, <A HREF="ciao_212.html">next</A>, <A HREF="ciao_241.html">last</A> section, <A HREF="ciao_toc.html">table of contents</A>. </BODY> </HTML>