aboutsummaryrefslogtreecommitdiff
path: root/primrose/spec_code/b_asc_con_ra.rs
blob: af399472e78de19d4fce54803d3545d3ac835d6a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/*SPEC*
property ascending<T> {
    \c -> ((for-all-consecutive-pairs c) leq?)
}
type AscendingCon<T> = {c impl (Container, Indexable) | (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);
}