original.name="Process_Valid_9" boogie.ignore=true Whiley2Boogie.issue=56 ====== >>> main.whiley type Queue is {int[] items, int length} where length >= 0 && length <= |items| method get(&Queue _this) -> int requires _this->length > 0: _this->length = _this->length - 1 return _this->items[_this->length] method put(&Queue _this, int item) requires _this->length < |_this->items|: _this->items[_this->length] = item _this->length = _this->length + 1 method isEmpty(&Queue _this) -> bool: return _this->length == 0 method Queue(int capacity) -> (&Queue q) requires capacity >= 0 ensures |q->items| == capacity ensures q->length == 0: int[] slots = [0; capacity] // return new {items: slots, length: 0} public export method test() : int[] items = [1, 2, 3, 4, 5] &Queue q = Queue(5) // Put items into the queue put(q, 1) assume q->items == [1,0,0,0,0] put(q, 2) assume q->items == [1,2,0,0,0] put(q, 3) assume q->items == [1,2,3,0,0] put(q, 4) assume q->items == [1,2,3,4,0] put(q, 5) assume q->items == [1,2,3,4,5] // Get items outof the queue int result = get(q) bool empty = isEmpty(q) assume result == 5 assume !empty // result = get(q) empty = isEmpty(q) assume result == 4 assume !empty // result = get(q) empty = isEmpty(q) assume result == 3 assume !empty // result = get(q) empty = isEmpty(q) assume result == 2 assume !empty // result = get(q) empty = isEmpty(q) assume result == 1 assume empty ---