On-Equality.html 4.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <html lang="en">
  2. <head>
  3. <title>On Equality - avram - a virtual machine code interpreter</title>
  4. <meta http-equiv="Content-Type" content="text/html">
  5. <meta name="description" content="avram - a virtual machine code interpreter">
  6. <meta name="generator" content="makeinfo 4.13">
  7. <link title="Top" rel="start" href="index.html#Top">
  8. <link rel="up" href="Virtual-Code-Semantics.html#Virtual-Code-Semantics" title="Virtual Code Semantics">
  9. <link rel="prev" href="A-New-Operator.html#A-New-Operator" title="A New Operator">
  10. <link rel="next" href="A-Minimal-Set-of-Properties.html#A-Minimal-Set-of-Properties" title="A Minimal Set of Properties">
  11. <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
  12. <meta http-equiv="Content-Style-Type" content="text/css">
  13. <style type="text/css"><!--
  14. pre.display { font-family:inherit }
  15. pre.format { font-family:inherit }
  16. pre.smalldisplay { font-family:inherit; font-size:smaller }
  17. pre.smallformat { font-family:inherit; font-size:smaller }
  18. pre.smallexample { font-size:smaller }
  19. pre.smalllisp { font-size:smaller }
  20. span.sc { font-variant:small-caps }
  21. span.roman { font-family:serif; font-weight:normal; }
  22. span.sansserif { font-family:sans-serif; font-weight:normal; }
  23. --></style>
  24. </head>
  25. <body>
  26. <div class="node">
  27. <a name="On-Equality"></a>
  28. <p>
  29. Next:&nbsp;<a rel="next" accesskey="n" href="A-Minimal-Set-of-Properties.html#A-Minimal-Set-of-Properties">A Minimal Set of Properties</a>,
  30. Previous:&nbsp;<a rel="previous" accesskey="p" href="A-New-Operator.html#A-New-Operator">A New Operator</a>,
  31. Up:&nbsp;<a rel="up" accesskey="u" href="Virtual-Code-Semantics.html#Virtual-Code-Semantics">Virtual Code Semantics</a>
  32. <hr>
  33. </div>
  34. <h4 class="subsection">2.7.2 On Equality</h4>
  35. <p><a name="index-equality-241"></a>One example of a property this operator should have, for reasons that
  36. will not be immediately clear, is that for any trees <var>x</var> and
  37. <var>k</var>, the equality <code>cons(cons(nil,</code><var>k</var><code>),nil) </code><var>x</var><code> =
  38. </code><var>k</var> always holds.
  39. Even though the present exposition opts for readability over formality,
  40. statements like these demand clarification of the notion of
  41. equality. Some of the more pedantic points in <a href="Raw-Material.html#Raw-Material">Raw Material</a> may be needed
  42. for the following ideas to hold water.
  43. <ul>
  44. <li>As originally stipulated, it is always possible to distinguish
  45. <code>nil</code> from any member of the set. We can therefore decide on this
  46. basis whether <var>a</var><code> = </code><var>b</var> whenever at least one of them is <code>nil</code>.
  47. <li>Where neither <var>a</var> nor <var>b</var> is <code>nil</code> in an expression
  48. <var>a</var><code> = </code><var>b</var>, but rather something of the form
  49. <code>cons(</code><var>x</var><code>,</code><var>y</var><code>)</code>, the equality holds if and only
  50. if both pairs of corresponding subexpressions are equal. If at least one
  51. member of each pair of corresponding subexpressions is <code>nil</code>, the
  52. question is settled, but otherwise there is recourse to their respective
  53. subexpressions, and so on. This condition follows from the uniqueness property
  54. of the <code>cons</code> operator.
  55. <li>If one side of an equality is of the form
  56. <var>x</var> <var>y</var>, or is defined in terms of such an expression,
  57. but <code>(</code><var>x</var><code>,</code><var>y</var><code>)</code> is one of those pairs with which the operator
  58. associates no result, then the equality holds if and only if the other
  59. side is similarly ill defined.
  60. <li>Statements involving universal quantification (i.e.,
  61. <a name="index-universal-quantification-242"></a><a name="index-undefined-expressions-243"></a>beginning with words similar to &ldquo;for any tree <var>x</var> <small class="dots">...</small>&rdquo;)
  62. obviously do not apply to instances of a variable (<var>x</var>) outside
  63. the indicated set (trees). Hence, they are not refuted by any
  64. consequence of identifying a variable with an undefined expression.
  65. </ul>
  66. <p>Readers who are aware of such issues as pointer equality or intensional
  67. <a name="index-pointer-equality-244"></a><a name="index-pointers-245"></a>versus extensional equality of functions are urged to forget all about
  68. them in the context of this document, and abide only by what is
  69. stated. Other readers should ignore this paragraph.
  70. </body></html>