Operator-Generalization.html 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
  2. <html>
  3. <!-- Created on December 10, 2012 by texi2html 1.82
  4. texi2html was written by:
  5. Lionel Cons <[email protected]> (original author)
  6. Karl Berry <[email protected]>
  7. Olaf Bachmann <[email protected]>
  8. and many others.
  9. Maintained by: Many creative people.
  10. Send bugs and suggestions to <[email protected]>
  11. -->
  12. <head>
  13. <title>avram - a virtual machine code interpreter: 2.7.15.2 Operator Generalization</title>
  14. <meta name="description" content="avram - a virtual machine code interpreter: 2.7.15.2 Operator Generalization">
  15. <meta name="keywords" content="avram - a virtual machine code interpreter: 2.7.15.2 Operator Generalization">
  16. <meta name="resource-type" content="document">
  17. <meta name="distribution" content="global">
  18. <meta name="Generator" content="texi2html 1.82">
  19. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  20. <style type="text/css">
  21. <!--
  22. a.summary-letter {text-decoration: none}
  23. blockquote.smallquotation {font-size: smaller}
  24. pre.display {font-family: serif}
  25. pre.format {font-family: serif}
  26. pre.menu-comment {font-family: serif}
  27. pre.menu-preformatted {font-family: serif}
  28. pre.smalldisplay {font-family: serif; font-size: smaller}
  29. pre.smallexample {font-size: smaller}
  30. pre.smallformat {font-family: serif; font-size: smaller}
  31. pre.smalllisp {font-size: smaller}
  32. span.roman {font-family:serif; font-weight:normal;}
  33. span.sansserif {font-family:sans-serif; font-weight:normal;}
  34. ul.toc {list-style: none}
  35. -->
  36. </style>
  37. </head>
  38. <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
  39. <a name="Operator-Generalization"></a>
  40. <table cellpadding="1" cellspacing="1" border="0">
  41. <tr><td valign="middle" align="left">[<a href="A-Hierarchy-of-Sets.html#A-Hierarchy-of-Sets" title="Previous section in reading order"> &lt; </a>]</td>
  42. <td valign="middle" align="left">[<a href="Error-Messages.html#Error-Messages" title="Next section in reading order"> &gt; </a>]</td>
  43. <td valign="middle" align="left"> &nbsp; </td>
  44. <td valign="middle" align="left">[<a href="Virtual-Machine-Specification.html#Virtual-Machine-Specification" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
  45. <td valign="middle" align="left">[<a href="Exception-Handling.html#Exception-Handling" title="Up section"> Up </a>]</td>
  46. <td valign="middle" align="left">[<a href="Library-Reference.html#Library-Reference" title="Next chapter"> &gt;&gt; </a>]</td>
  47. <td valign="middle" align="left"> &nbsp; </td>
  48. <td valign="middle" align="left"> &nbsp; </td>
  49. <td valign="middle" align="left"> &nbsp; </td>
  50. <td valign="middle" align="left"> &nbsp; </td>
  51. <td valign="middle" align="left">[<a href="avram.html#Top" title="Cover (top) of document">Top</a>]</td>
  52. <td valign="middle" align="left">[<a href="avram_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
  53. <td valign="middle" align="left">[<a href="Function-Index.html#Function-Index" title="Index">Index</a>]</td>
  54. <td valign="middle" align="left">[<a href="avram_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
  55. </tr></table>
  56. <hr size="1">
  57. <a name="Operator-Generalization-1"></a>
  58. <h4 class="subsubsection">2.7.15.2 Operator Generalization</h4>
  59. <p>Each set in the hierarchy induces a structure preserving <code>cons</code>
  60. <a name="index-cons-2"></a>
  61. operator, denoted <code>cons_<var>n</var></code> for the <code><var>n</var></code>th level
  62. set, and satisfying this equation.
  63. </p>
  64. <dl compact="compact">
  65. <dt> <em>E10</em></dt>
  66. <dd><p><code>cons_<var>n</var>(<var>x</var>_<var>n</var>,<var>y</var>_<var>n</var>)</code> =
  67. <code>(cons(<var>x</var>,<var>y</var>))_<var>n</var></code>
  68. </p></dd>
  69. </dl>
  70. <p>It will be convenient to generalize all of these <code>cons</code> operators to be
  71. defined on members of other sets than their own.
  72. </p>
  73. <dl compact="compact">
  74. <dt> <em>E11</em></dt>
  75. <dd><p>For <code><var>m</var></code> greater than <code><var>n</var></code>,
  76. <code>cons_<var>n</var>(<var>x</var>_<var>m</var>,<var>y</var>_<var>p</var>)</code> =
  77. <code><var>x</var>_<var>m</var></code>
  78. </p></dd>
  79. </dl>
  80. <p>In this equation, <code><var>p</var></code> is unrestricted. The intuition is that
  81. if the left operand of a <code>cons</code> is the result of a computation that
  82. went wrong due to an exceptional condition (more exceptional than
  83. <code><var>n</var></code>, the level already in effect), then the exceptional
  84. result becomes the whole result.
  85. </p>
  86. <p>It is tempting to hazard a slightly stronger statement, which is that
  87. this equation holds even if <code><var>y</var>_<var>p</var></code> is equal to some
  88. expression <code><var>f</var> <var>x</var></code> that is undefined according to the
  89. operator semantics. This stipulation would correspond to an
  90. implementation in which the right operand isn&rsquo;t evaluated after an error
  91. is detected in the left, but there are two problems with it.
  92. </p>
  93. <ul>
  94. <li> This semantics might unreasonably complicate a concurrent
  95. implementation of the virtual machine. If evaluation leads to
  96. non-termination in some cases where the result is undefined (as it certainly
  97. would in any possible implementation consistent with cases where it&rsquo;s
  98. defined), then the mechanism that evaluates the right side of a pair
  99. must be interruptible in case an exception is detected in the left.
  100. </li><li> It is beyond the expressive power of the present mathematical
  101. framework to make such a statement, because it entails universal
  102. quantification over non-members of the constructed sets, which includes
  103. <a name="index-universal-quantification-2"></a>
  104. almost everything.
  105. </li></ul>
  106. <p>Nevertheless, the implementation in <code>avram</code> is sequential and does
  107. indeed behave as proposed, with no practical difficulty. As for any
  108. deficiency in the theory, it could be banished by recasting the
  109. semantics in terms of a calculus of expressions with formal rules of
  110. manipulation. An operand to the <code>cons</code> operator would be identified
  111. not with a member of a semantic domain, but with the expression used to
  112. write it down, and then even &ldquo;undefinedness&rdquo; could be
  113. <a name="index-undefined-expressions-1"></a>
  114. defined. However, the present author&rsquo;s preference in computing as in
  115. <a name="index-author-2"></a>
  116. life is to let some things remain a mystery rather than to abandon the
  117. quest for meaning entirely.
  118. </p>
  119. <p>A comparable condition applies in cases where the right side of a pair
  120. represents an exceptional result.
  121. </p>
  122. <dl compact="compact">
  123. <dt> <em>E12</em></dt>
  124. <dd><p>For <code><var>m</var></code> greater than <code><var>n</var></code>,
  125. <code>cons_<var>n</var>(<var>x</var>_<var>n</var>,<var>y</var>_<var>m</var>)</code> =
  126. <code><var>y</var>_<var>m</var></code>
  127. </p></dd>
  128. </dl>
  129. <p>Whereas an infinitude of <code>cons</code> operators has been needed, it will
  130. <a name="index-cons-3"></a>
  131. be possible to get by with only one invisible operator, as before, by
  132. generalizing it in the following way to operands on any level of the
  133. hierarchy.
  134. </p>
  135. <dl compact="compact">
  136. <dt> <em>P43</em></dt>
  137. <dd><p><code><var>f</var>_<var>n</var> <var>x</var>_<var>n</var></code> = <code>(<var>f</var> <var>x</var>)_<var>n</var></code>
  138. </p></dd>
  139. <dt> <em>P44</em></dt>
  140. <dd><p>For distinct <code><var>n</var></code> and <code><var>m</var></code>, <code><var>f</var>_<var>n</var> <var>x</var>_<var>m</var></code> = <code><var>x</var>_<var>m</var></code>
  141. </p></dd>
  142. </dl>
  143. <p>That is, the result of evaluating two operands on the same level is the
  144. image relative to that level of the result of their respective images on
  145. the bottom level, but the result of evaluating two operands on different
  146. levels is the same as the right operand.
  147. </p>
  148. <hr size="1">
  149. <table cellpadding="1" cellspacing="1" border="0">
  150. <tr><td valign="middle" align="left">[<a href="A-Hierarchy-of-Sets.html#A-Hierarchy-of-Sets" title="Previous section in reading order"> &lt; </a>]</td>
  151. <td valign="middle" align="left">[<a href="Error-Messages.html#Error-Messages" title="Next section in reading order"> &gt; </a>]</td>
  152. <td valign="middle" align="left"> &nbsp; </td>
  153. <td valign="middle" align="left">[<a href="Virtual-Machine-Specification.html#Virtual-Machine-Specification" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
  154. <td valign="middle" align="left">[<a href="Exception-Handling.html#Exception-Handling" title="Up section"> Up </a>]</td>
  155. <td valign="middle" align="left">[<a href="Library-Reference.html#Library-Reference" title="Next chapter"> &gt;&gt; </a>]</td>
  156. <td valign="middle" align="left"> &nbsp; </td>
  157. <td valign="middle" align="left"> &nbsp; </td>
  158. <td valign="middle" align="left"> &nbsp; </td>
  159. <td valign="middle" align="left"> &nbsp; </td>
  160. <td valign="middle" align="left">[<a href="avram.html#Top" title="Cover (top) of document">Top</a>]</td>
  161. <td valign="middle" align="left">[<a href="avram_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
  162. <td valign="middle" align="left">[<a href="Function-Index.html#Function-Index" title="Index">Index</a>]</td>
  163. <td valign="middle" align="left">[<a href="avram_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
  164. </tr></table>
  165. <p>
  166. <font size="-1">
  167. This document was generated on <i>December 10, 2012</i> using <a href="http://www.nongnu.org/texi2html/"><i>texi2html 1.82</i></a>.
  168. </font>
  169. <br>
  170. </p>
  171. </body>
  172. </html>