diff options
Diffstat (limited to 'primrose/spec_code/b_asc_con.rs')
-rw-r--r-- | primrose/spec_code/b_asc_con.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/primrose/spec_code/b_asc_con.rs b/primrose/spec_code/b_asc_con.rs new file mode 100644 index 0000000..5189ddd --- /dev/null +++ b/primrose/spec_code/b_asc_con.rs @@ -0,0 +1,15 @@ +/*SPEC* +property ascending<T> { + \c -> ((for-all-consecutive-pairs c) leq?) +} +type AscendingCon<T> = {c impl (Container) | (ascending c)} +*ENDSPEC*/ + +fn main () { + let mut c = AscendingCon::<u32>::new(); + for x in 0..10 { + c.insert(x); + c.insert(x); + } + assert_eq!(c.len(), 20); +}
\ No newline at end of file |