next up previous contents index
Next: Comparing two numbers: `gtp' Up: Relational Abstractions Previous: Relational Abstractions   Contents   Index


Comparing two numbers: `equaln'

This abstraction can only be used to compare Church Numerals. To compare other objects like symbols, strings or closures `equalx' has to be used, one of the primitive functions introduced by the extension of A++.


\begin{lstlisting}[language=Scm]{}
(define equaln (lambda (m n)
(land (zerop (sub m n))
(zerop (sub n m)))))
\end{lstlisting}

\begin{lstlisting}[language=Scm]{}
(bdisp! (equaln two three))
--> false
(bdisp! (equaln two two))
--> true
\end{lstlisting}



domain access counter Georg P. Loczewski 2004-03-05