integer — Logtalk 3.100.1

object

# `integer`

Integer data type predicates.

Availability:
`logtalk_load(types(loader))`
Author: Paulo Moura
Version: 1:56:0
Date: 2025-05-26
Compilation flags:
`static, context_switching_calls`
Extends:
`public` number
Remarks:

> - Portability notes: This object will use the backend Prolog system `between/3`, `plus/3`, and `succ/2` built-in predicates when available.

Inherited public predicates:
(<)/2 (=:=)/2 (=<)/2 (=\=)/2 =~= / 2 (>)/2 (>=)/2 approximately_equal/2 approximately_equal/3 check/1 depth/2 essentially_equal/3 ground/1 new/1 numbervars/1 numbervars/3 occurs/2 singletons/2 subsumes/2 subterm/2 tolerance_equal/4 valid/1 variables/2 variant/2 varnumbers/2 varnumbers/3

## Public predicates

### `between/3`

Returns integers in the interval defined by the two first arguments.

Compilation flags:
`static`
Template:
`between(Lower,Upper,Integer)`
Mode and number of proofs:
`between(+integer,+integer,+integer)` - `zero_or_one`
`between(+integer,+integer,-integer)` - `zero_or_more`

### `plus/3`

Reversible integer sum. At least two of the arguments must be instantiated to integers.

Compilation flags:
`static`
Template:
`plus(I,J,Sum)`
Mode and number of proofs:
`plus(+integer,+integer,?integer)` - `zero_or_one`
`plus(+integer,?integer,+integer)` - `zero_or_one`
`plus(?integer,+integer,+integer)` - `zero_or_one`

### `succ/2`

Successor of a natural number. At least one of the arguments must be instantiated to a natural number.

Compilation flags:
`static`
Template:
`succ(I,J)`
Mode and number of proofs:
`succ(+integer,?integer)` - `zero_or_one`
`succ(?integer,+integer)` - `zero_or_one`

### `sequence/3`

Generates a list with the sequence of all integers in the interval `[Lower,Upper]`. Assumes `Lower =< Upper` and fails otherwise.

Compilation flags:
`static`
Template:
`sequence(Lower,Upper,List)`
Mode and number of proofs:
`sequence(+integer,+integer,-list(integer))` - `zero_or_one`

### `sequence/4`

Generates a list with the sequence of integers in the interval `[Lower,Upper]` by `Step`. Assumes `Lower =< Upper, Step >= 1` and fails otherwise.

Compilation flags:
`static`
Template:
`sequence(Lower,Upper,Step,List)`
Mode and number of proofs:
`sequence(+integer,+integer,+integer,-list(integer))` - `zero_or_one`

### `power_sequence/4`

Generates a list of exponentiation results given `[Lower,Upper]` sequence of exponents and `Base`. Assumes `Lower =< Upper` and `Base > 1` and fails otherwise.

Compilation flags:
`static`
Template:
`power_sequence(Lower,Upper,Base,List)`
Mode and number of proofs:
`power_sequence(+integer,+integer,+integer,-list(integer))` - `zero_or_one`

## Protected predicates

(no local declarations; see entity ancestors if any)

## Private predicates

(no local declarations; see entity ancestors if any)

## Operators

(none)