-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
669b038
commit be5b65c
Showing
10 changed files
with
29 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#[flux_rs::extern_spec(core::ptr)] | ||
#[refined_by(n: int)] | ||
struct NonNull<T>; | ||
struct NonNull<T>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,31 @@ | ||
// The spec we need to prove log_base_two | ||
#[flux_rs::extern_spec] | ||
impl u32 { | ||
#[sig(fn(num: u32) -> u32{r: (num == 0 => r == 32) && | ||
(num > 0 => r <= 31) && | ||
(num > 1 => r <= 30) | ||
#[sig(fn(num: u32) -> u32{r: (num == 0 => r == 32) && | ||
(num > 0 => r <= 31) && | ||
(num > 1 => r <= 30) | ||
})] | ||
fn leading_zeros(self) -> u32; | ||
|
||
#[sig(fn(num: u32) -> u32{r: (num == 0 => r == 32) && (num != 0 =>r <= 31) })] | ||
fn trailing_zeros(self) -> u32; | ||
} | ||
|
||
#[flux_rs::extern_spec] | ||
impl u64 { | ||
#[sig(fn(num: u64) -> u32{r: (num == 0 => r == 64) && | ||
(num > 0 => r <= 63) && | ||
(num > 1 => r <= 62) | ||
#[sig(fn(num: u64) -> u32{r: (num == 0 => r == 64) && | ||
(num > 0 => r <= 63) && | ||
(num > 1 => r <= 62) | ||
})] | ||
fn leading_zeros(self) -> u32; | ||
} | ||
|
||
// Only works when usize is 32-bits | ||
#[flux_rs::extern_spec] | ||
impl usize { | ||
#[sig(fn(num: usize{num < 4294967295}) -> u32{r: (num == 0 => r == 32) && | ||
(num > 0 => r <= 31) && | ||
(num > 1 => r <= 30) | ||
#[sig(fn(num: usize{num < 4294967295}) -> u32{r: (num == 0 => r == 32) && | ||
(num > 0 => r <= 31) && | ||
(num > 1 => r <= 30) | ||
})] | ||
fn leading_zeros(self) -> u32; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters