I am searching for the least term in '@<' comparison

But I found:

$ gprolog
GNU Prolog 1.4.5 (64 bits)
Compiled Feb 23 2020, 20:14:50 with gcc
By Daniel Diaz
Copyright (C) 1999-2020 Daniel Diaz
| ?- '' @< [].

yes
| ?- 

vs.

$ swipl
Welcome to SWI-Prolog (threaded, 64 bits, version 9.3.32-16-g508550cf3)
...

?- '' @< [].
false.

Can someone explain this difference and is there a globally existing minimum and maximum term available?

?- '' @< '[]'.
true.

In SWI-Prolog, [] is not the same as '[]'. The first is a symbol rather than an atom.

1 Like

Looking at SWI-Prolog -- System limits I think there isn’t a minimum or maximum, in normal compilations - out-of-memory would be the limit.

Indeed :slight_smile: The minimum would be the oldest variable still alive. That exists, but there is no obvious way to get hold of it. The maximum is the compound term with the highest arity. The arity of compounds is unbound though, so that term is limited by the amount of memory available.

I will just create a compound : (1,1) for the lowest, (2,DATA) for all in between and (3,3) for the highest value, if needed. I thought maybe there are artificial definitions like inf and sup.