Is_integer predicate?

Yes

Of course.

I note a few ways to do this in Wiki: Bug hunting toolbox

The one you probably want is

is_of_type(+Type, @Term)

and for the Type value see the list in must_be/2

?- is_of_type(positive_integer,-1).
false.

?- is_of_type(positive_integer,0).
false.

?- is_of_type(positive_integer,1).
true.

?- is_of_type(positive_integer,0.1).
false.

?- is_of_type(integer,-1).
true.

?- is_of_type(integer,0).
true.

?- is_of_type(integer,1).
true.

?- is_of_type(nonneg,-1).
false.

?- is_of_type(nonneg,0).
true.

?- is_of_type(nonneg,1).
true.
1 Like