Relations on Numbers

Next: Lists Up: Numbers Previous: Functions on Numbers

## Relations on Numbers

integer - The sentence (integer ) means that the object denoted by is an integer.

real-number - The sentence (real-number ) means that the object denoted by is a real number.

complex-number - The sentence (complex-number ) means that the object denoted by is a complex number.

`(defrelation number (?x) :=`` (or (real-number ?x) (complex-number ?x)))`

`(defrelation natural (?x) := (and (integer ?x) (>= ?x 0)))`

`(defrelation rational-number (?x) :=`` (exists (?y) (and (integer ?y) (integer (* ?x ?y)))))`

< - The sentence (< ) is true if and only if the number denoted by is less than the number denoted by .

`(defrelation > (?x ?y) := (< ?y ?x))`

`(defrelation =< (?x ?y) := (or (= ?x ?y) (< ?x ?y)))`

`(defrelation >= (?x ?y) := (or (> ?x ?y) (= ?x ?y)))`

`(defrelation positive (?x) := (> ?x 0))`

`(defrelation negative (?x) := (< ?x 0))`

`(defrelation zero (?x) := (= ?x 0))`

`(defrelation odd-integer (?x) := (integer (/ (+ ?x 1) 2))`

`(defrelation even-integer (?x) := (integer (/ ?x 2))`

logbit - The sentence (logbit ) is true if bit of is 1.

logtest - The sentence (logtest ) is true if the logical and of the two's-complement representation of the integers and is not zero.

Vishal I. Sikka
Wed Dec 7 13:23:42 PST 1994