diff options
Diffstat (limited to 'src/tests/b_unique_asc_con_ra')
-rw-r--r-- | src/tests/b_unique_asc_con_ra/Cargo.toml | 8 | ||||
-rw-r--r-- | src/tests/b_unique_asc_con_ra/src/main.rs | 11 | ||||
-rw-r--r-- | src/tests/b_unique_asc_con_ra/src/types.pr.rs | 10 |
3 files changed, 29 insertions, 0 deletions
diff --git a/src/tests/b_unique_asc_con_ra/Cargo.toml b/src/tests/b_unique_asc_con_ra/Cargo.toml new file mode 100644 index 0000000..bb3fb42 --- /dev/null +++ b/src/tests/b_unique_asc_con_ra/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "b_unique_asc_con_ra" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/src/tests/b_unique_asc_con_ra/src/main.rs b/src/tests/b_unique_asc_con_ra/src/main.rs new file mode 100644 index 0000000..2eac169 --- /dev/null +++ b/src/tests/b_unique_asc_con_ra/src/main.rs @@ -0,0 +1,11 @@ +mod types; +use types::*; + +fn main() { + let mut c = StrictlyAscendingCon::<u32>::new(); + for x in 0..10 { + c.insert(x); + c.insert(x); + } + assert_eq!(c.len(), 10); +} diff --git a/src/tests/b_unique_asc_con_ra/src/types.pr.rs b/src/tests/b_unique_asc_con_ra/src/types.pr.rs new file mode 100644 index 0000000..ed64180 --- /dev/null +++ b/src/tests/b_unique_asc_con_ra/src/types.pr.rs @@ -0,0 +1,10 @@ +/*SPEC* +property unique<T> { + \c <: (Container) -> ((for-all-elems c) \a -> ((unique-count? a) c)) +} +property ascending<T> { + \c -> ((for-all-consecutive-pairs c) leq?) +} + +type StrictlyAscendingCon<S> = {c impl (Container, Indexable) | ((unique c) and (ascending c))} +*ENDSPEC*/ |