From d652155ae013f36a1ee17653a8e458baad2d9c2c Mon Sep 17 00:00:00 2001 From: Checkmate50 Date: Mon, 6 Jun 2016 23:14:18 -0600 Subject: Merging complete. Everything looks good *crosses fingers* --- Test/test1/UpdateExprTyping.bpl | 90 ++++++++++++++++++++--------------------- 1 file changed, 45 insertions(+), 45 deletions(-) (limited to 'Test/test1/UpdateExprTyping.bpl') diff --git a/Test/test1/UpdateExprTyping.bpl b/Test/test1/UpdateExprTyping.bpl index bf8fd47c..41b88a3c 100644 --- a/Test/test1/UpdateExprTyping.bpl +++ b/Test/test1/UpdateExprTyping.bpl @@ -1,45 +1,45 @@ -// RUN: %boogie -noVerify "%s" > "%t" -// RUN: %diff "%s.expect" "%t" -procedure P(a: [int]bool, b: [int]ref, c: [bool]bool) -{ - assert a == b; // type error - assert a == c; // type error - - assert a == a[5 := true]; - assert a == a[true := true]; // type error - assert a == a[5 := 5]; // type error in RHS - assert a == b[5 := null]; // type error -} - -procedure Q(aa: [int,ref]bool) -{ - assert aa[5,null := true] != aa[2,null := false]; - assert aa == aa[null,null := true]; // type error, index 0 - assert aa == aa[5,true := true]; // type error, index 1 - assert aa == aa[5,null := null]; // type error, RHS -} - -type Field a; -const unique IntField: Field int; -const unique RefField: Field ref; -const unique SomeField: Field any; - -procedure R(H: [ref,Field x]x, this: ref) -{ - var i: int, r: ref, y: any; - var K: [ref,Field wz]wz; - - i := H[this, IntField]; - r := H[this, RefField]; - y := H[this, IntField]; // type error, wrong LHS - y := H[this, SomeField]; - - K := H[this, IntField := i][this, RefField := r][this, SomeField := y]; - K := H[this, SomeField := r]; // type error, wrong RHS - - K := K[this, IntField := r]; // RHS has wrong type (ref, expecting int) - K := K[this, RefField := i]; // RHS has wrong type (int, expecting ref) -} - -type ref, any; -const null : ref; +// RUN: %boogie -noVerify "%s" > "%t" +// RUN: %diff "%s.expect" "%t" +procedure P(a: [int]bool, b: [int]ref, c: [bool]bool) +{ + assert a == b; // type error + assert a == c; // type error + + assert a == a[5 := true]; + assert a == a[true := true]; // type error + assert a == a[5 := 5]; // type error in RHS + assert a == b[5 := null]; // type error +} + +procedure Q(aa: [int,ref]bool) +{ + assert aa[5,null := true] != aa[2,null := false]; + assert aa == aa[null,null := true]; // type error, index 0 + assert aa == aa[5,true := true]; // type error, index 1 + assert aa == aa[5,null := null]; // type error, RHS +} + +type Field a; +const unique IntField: Field int; +const unique RefField: Field ref; +const unique SomeField: Field any; + +procedure R(H: [ref,Field x]x, this: ref) +{ + var i: int, r: ref, y: any; + var K: [ref,Field wz]wz; + + i := H[this, IntField]; + r := H[this, RefField]; + y := H[this, IntField]; // type error, wrong LHS + y := H[this, SomeField]; + + K := H[this, IntField := i][this, RefField := r][this, SomeField := y]; + K := H[this, SomeField := r]; // type error, wrong RHS + + K := K[this, IntField := r]; // RHS has wrong type (ref, expecting int) + K := K[this, RefField := i]; // RHS has wrong type (int, expecting ref) +} + +type ref, any; +const null : ref; -- cgit v1.2.3