#### 4.3.1 Comparison of Terms

Two terms are compared according to the standard ordering, which is defined below. Items listed at the beginning come before the items listed at the end. For example, numbers are less than atoms in the standard ordering.

- Variables, in age ordering (older variables come before younger variables).
- Numbers, in numerical ordering.
- Atoms, in character code (ASCII) ordering.
- String, in standard string odering.
- Compound terms are compared in the following order:
- Arity, in numerical ordering.
- Functor, in standard ordering.
- Arguments, in standard ordering, from left to right.

- Sets, in dictionary order on elements.
- Lists, in dictionary order on elements.

The above ordering is used when constructing sets.

The following relations use the above ordering to test terms.

`Term1 @> Term2`

Succeeds if `Term1`

is greater than`Term1`

in the above ordering.

`Term1 @>= Term2`

Succeeds if `Term1`

is greater than or equal to `Term2`

in the above ordering.

`Term1 @< Term2`

Succeeds if `Term1`

is less than`Term1`

in the above ordering.

`Term1 @=< Term2`

Succeeds if `Term1`

is less than or equal to `Term2`

in the above ordering.