diff options
author | Aria <me@aria.rip> | 2023-10-05 15:04:40 +0100 |
---|---|---|
committer | Aria <me@aria.rip> | 2023-10-05 15:04:40 +0100 |
commit | 1a8fba28d02a8415118e22f6d3816264b3840c95 (patch) | |
tree | 886265fa0f87b4897f356db7c016407dc951c141 /primrose/spec_code/b_des_con_ra.rs | |
parent | 171f808f49675c7960939c441aa36063d868af80 (diff) |
add original primrose source
Diffstat (limited to 'primrose/spec_code/b_des_con_ra.rs')
-rw-r--r-- | primrose/spec_code/b_des_con_ra.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/primrose/spec_code/b_des_con_ra.rs b/primrose/spec_code/b_des_con_ra.rs new file mode 100644 index 0000000..5ed84c9 --- /dev/null +++ b/primrose/spec_code/b_des_con_ra.rs @@ -0,0 +1,15 @@ +/*SPEC* +property descending<T> { + \c -> ((for-all-consecutive-pairs c) geq?) +} +type DescendingCon<T> = {c impl (Container, Indexable) | (descending c)} +*ENDSPEC*/ + +fn main () { + let mut c = DescendingCon::<u32>::new(); + for x in 0..10 { + c.insert(x); + c.insert(x); + } + assert_eq!(c.len(), 20); +}
\ No newline at end of file |