Skip to content

Commit

Permalink
CP -- queue.broken.c still broken :-(
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Pierce committed Jun 8, 2024
1 parent 4a51fec commit c3d7704
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/examples/queue.broken.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ predicate (datatype seq) IntQueue(pointer q) {
}
predicate (datatype seq) IntQueue1(pointer dummy, struct int_queue H) {
if (is_null(H.head)) {
assert (is_null(H.tail));
if (is_null(H.head) || is_null(H.tail)) {
assert (is_null(H.head) && is_null(H.tail));
return (Seq_Nil{});
} else {
assert (!is_null(H.tail));
assert (!is_null(H.head) && !is_null(H.tail));
take T = Owned<struct int_queueCell>(H.tail);
assert (is_null(T.next));
take Q = IntQueueAux (H.head, H.tail, T.first);
Expand Down Expand Up @@ -133,14 +133,14 @@ void IntQueue_push (int x, struct int_queue *q)
if (q->tail == 0) {
/*@ split_case (*q).head == NULL; @*/
/*@ apply snoc_nil(x); @*/
// And then this??
// And then this?? Trying random stuff...
/*@ split_case (*q).tail == NULL; @*/
q->head = c;
q->tail = c;
} else {
// This is needed next:
/*@ split_case (*q).head == NULL; @*/
// And then this??
// And then this?? Again, random stuff
/*@ split_case (*q).tail == NULL; @*/
q->tail->next = c;
q->tail = c;
Expand Down

0 comments on commit c3d7704

Please sign in to comment.