Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > bd5c3d824c3db63ffd9226c15941e6ad > files > 173

mozart-1.4.0-1mdv2010.0.i586.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>6.2 Tuples</TITLE><LINK href="ozdoc.css" rel="stylesheet" type="text/css"></HEAD><BODY><TABLE align="center" border="0" cellpadding="6" cellspacing="6" class="nav"><TR bgcolor="#DDDDDD"><TD><A href="record.html#section.records.records">&lt;&lt; Prev</A></TD><TD><A href="node8.html">- Up -</A></TD><TD><A href="list.html#section.records.lists">Next &gt;&gt;</A></TD></TR></TABLE><DIV id="section.records.tuples"><H2><A name="section.records.tuples">6.2 Tuples</A></H2><P> The module <A name="label263"></A><SPAN class="index"><CODE>Tuple</CODE></SPAN> contains procedures operating on tuples. </P><DL><DT><A name="label264"></A><SPAN class="index"><CODE>IsTuple</CODE></SPAN> <A name="label266"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P><CODE>{Tuple<SPAN class="keyword">.</SPAN>is&nbsp;</CODE><CODE>+<I>X</I></CODE><CODE>&nbsp;</CODE><CODE>?<I>B</I></CODE><CODE>}</CODE> </P></BLOCKQUOTE></DD><DD><P>tests whether <CODE><I>X</I></CODE> is a tuple. </P></DD><DT><A name="label267"></A><SPAN class="index"><CODE>MakeTuple</CODE></SPAN> <A name="label269"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P><CODE>{Tuple<SPAN class="keyword">.</SPAN>make&nbsp;</CODE><CODE>+<I>L</I></CODE><CODE>&nbsp;</CODE><CODE>+<I>I</I></CODE><CODE>&nbsp;</CODE><CODE>?<I>T</I></CODE><CODE>}</CODE> </P></BLOCKQUOTE></DD><DD><P>binds <CODE><I>T</I></CODE> to new tuple with label&nbsp;<CODE><I>L</I></CODE> and fresh variables at features <CODE>1</CODE> through&nbsp;<CODE><I>I</I></CODE>. <CODE><I>I</I></CODE>&nbsp;must be non-negative, else an error exception is raised. </P><P> For example, <CODE>{MakeTuple&nbsp;L&nbsp;N&nbsp;T}</CODE> waits until <CODE>L</CODE> is bound to a literal, say&nbsp;<CODE>b</CODE>, and <CODE>N</CODE> is bound to a number, say&nbsp;<CODE>3</CODE>, whereupon <CODE>T</CODE> is bound to <CODE>b(_&nbsp;_&nbsp;_)</CODE>. </P></DD><DT><CODE>toArray</CODE> <A name="label271"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P><CODE>{Tuple<SPAN class="keyword">.</SPAN>toArray&nbsp;</CODE><CODE>+<I>T</I></CODE><CODE>&nbsp;</CODE><CODE>?<I>A</I></CODE><CODE>}</CODE> </P></BLOCKQUOTE></DD><DD><P>returns an array with bounds between <CODE>1</CODE> and <CODE>{Width&nbsp;</CODE><CODE><I>T</I></CODE><CODE>}</CODE>, where the elements of the array are the subtrees of&nbsp;<CODE><I>T</I></CODE>. </P></DD><DT><CODE>append</CODE> <A name="label273"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P><CODE>{Tuple<SPAN class="keyword">.</SPAN>append&nbsp;</CODE><CODE>+<I>T1</I></CODE><CODE>&nbsp;</CODE><CODE>+<I>T2</I></CODE><CODE>&nbsp;</CODE><CODE>?<I>T3</I></CODE><CODE>}</CODE> </P></BLOCKQUOTE></DD><DD><P>returns a tuple with same label as&nbsp;<CODE><I>T2</I></CODE>. Given that <CODE><I>T1</I></CODE> has width&nbsp;<I>i</I> and <CODE><I>T2</I></CODE> has width&nbsp;<I>j</I>, <CODE><I>T3</I></CODE>&nbsp;will have width <I>i</I><CODE>&nbsp;<SPAN class="keyword">+</SPAN>&nbsp;</CODE><I>j</I>, and the first <I>i</I> fields of&nbsp;<CODE><I>T3</I></CODE> will be the same as the fields of <CODE><I>T1</I></CODE> in their original order, and the fields <I>i</I><CODE>&nbsp;<SPAN class="keyword">+</SPAN>&nbsp;1</CODE> through <I>i</I><CODE>&nbsp;<SPAN class="keyword">+</SPAN>&nbsp;</CODE><I>j</I> will be the same as the fields of&nbsp;<CODE><I>T2</I></CODE> in their original order. </P></DD></DL><P> </P></DIV><TABLE align="center" border="0" cellpadding="6" cellspacing="6" class="nav"><TR bgcolor="#DDDDDD"><TD><A href="record.html#section.records.records">&lt;&lt; Prev</A></TD><TD><A href="node8.html">- Up -</A></TD><TD><A href="list.html#section.records.lists">Next &gt;&gt;</A></TD></TR></TABLE><HR><ADDRESS><A href="http://www.ps.uni-sb.de/~duchier/">Denys&nbsp;Duchier</A>, <A href="http://www.ps.uni-sb.de/~kornstae/">Leif&nbsp;Kornstaedt</A> and&nbsp;<A href="http://www.ps.uni-sb.de/~schulte/">Christian&nbsp;Schulte</A><BR><SPAN class="version">Version 1.4.0 (20090610)</SPAN></ADDRESS></BODY></HTML>