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++.

(define equaln (lambda (m n)
(land (zerop (sub m n))
(zerop (sub n m)))))

(bdisp! (equaln two three))
--> false
(bdisp! (equaln two two))
--> true

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