diff options
author | Xander <xander@biltopia.org> | 2023-08-19 19:47:30 +0200 |
---|---|---|
committer | Xander <xander@biltopia.org> | 2023-08-19 21:26:28 +0200 |
commit | 5e0dafa7cfbb90c941fc771f0d157cf13dc1aa91 (patch) | |
tree | ca2810bcc0d2261f98580723de43018e2d82c646 /kernel/prelude/SATS/safe_casts.sats | |
parent | a76c89dc3932f0b5e60ff871b08f4bc745727ae4 (diff) | |
download | ats-os-5e0dafa7cfbb90c941fc771f0d157cf13dc1aa91.tar.xz ats-os-5e0dafa7cfbb90c941fc771f0d157cf13dc1aa91.zip |
implement table
Diffstat (limited to 'kernel/prelude/SATS/safe_casts.sats')
-rw-r--r-- | kernel/prelude/SATS/safe_casts.sats | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/kernel/prelude/SATS/safe_casts.sats b/kernel/prelude/SATS/safe_casts.sats index f8e34db..8850ef6 100644 --- a/kernel/prelude/SATS/safe_casts.sats +++ b/kernel/prelude/SATS/safe_casts.sats @@ -1,4 +1,12 @@ castfn u2u64{v : nat | v <= 0xFFFFFFFFFFFFFFFF}(v : uint v) :<> uint64 v -castfn u64_to_Ptr0(v : uint64):<> Ptr0 castfn Ptr0_to_u64(v : Ptr0):<> uint64 + +castfn u64_to_Ptr1{n:nat | n > 0}(v : uint64 n):<> Ptr1 +castfn ulint_to_Ptr1{n: nat | n > 0}(v : ulint n):<> Ptr1 +castfn sz_to_Ptr1{n : nat | n > 0}(v : size_t n):<> Ptr1 + +castfn u64_to_Ptr0(v : uint64):<> Ptr0 +castfn ulint_to_Ptr0(v : ulint):<> Ptr0 castfn sz_to_Ptr0(v : size_t):<> Ptr0 + +castfn Ptr1_to_sz(v : Ptr1):<> sizeGte(1) |