On Sun, 23 May 2021, Dambaev Alexander wrote:
> ./prelude/basics_pre.sats:sortdef alez = { l:addr | l <= null }
>
> it seems, that addr can be less than null, by the way :)
On AMD64, it is fairly sensible to think of addresses as signed values.
There is a set of addresses that are 'non-canonical' and cannot be
used--they will never map to anything. If you think about addresses as
signed, these non-canonical addresses are in the _middle_ of the space of
representable pointers; so the actual usable address space is segmented,
with one half at the bottom and one half at the top.
But a simpler way to think about it is that an address is a 48-bit
_signed_ integer, which is sign-extended to 64 bits.
See wikipedia
https://en.wikipedia.org/wiki/X86-64#Canonical_form_addresses
(Though note that you're not very likely to ever encounter a negative
address; usually the kernel lives in the 'top half' of the address space
and userspace lives in the 'bottom half'.)
-E