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/test21/InterestingExamples4.bpl | 96 ++++++++++++++++++------------------ 1 file changed, 48 insertions(+), 48 deletions(-) (limited to 'Test/test21/InterestingExamples4.bpl') diff --git a/Test/test21/InterestingExamples4.bpl b/Test/test21/InterestingExamples4.bpl index 941c9020..aa8993db 100644 --- a/Test/test21/InterestingExamples4.bpl +++ b/Test/test21/InterestingExamples4.bpl @@ -1,48 +1,48 @@ -// RUN: %boogie -typeEncoding:n -logPrefix:0n "%s" > "%t" -// RUN: %diff "%s.n.expect" "%t" -// RUN: %boogie -typeEncoding:p -logPrefix:0p "%s" > "%t" -// RUN: %diff "%s.p.expect" "%t" -// RUN: %boogie -typeEncoding:a -logPrefix:0a "%s" > "%t" -// RUN: %diff "%s.a.expect" "%t" -// a property that should hold according to the Boogie semantics -// (but no automatic theorem prover will be able to prove it) - - -type C a; - -function sameType(x:a, y:b) returns (bool); - -axiom (forall x:a, y:b :: sameType(x,y) == (exists z:a :: y==z)); - -// Will be defined to hold whenever the type of y (i.e., b) -// can be reached from the type of x (a) by applying the type -// constructor C a finite number of times. In order words, -// b = C^n(a) -function rel(x:a, y:b) returns (bool); - -function relHelp(x:a, y:b, z:int) returns (bool); - -axiom (forall x:a, y:b :: relHelp(x, y, 0) == sameType(x, y)); -axiom (forall n:int, x:a, y:b :: - (n >= 0 ==> - relHelp(x, y, n+1) == - (exists z:c, y' : C c :: relHelp(x, z, n) && y==y'))); - -axiom (forall x:a, y:b :: - rel(x, y) == (exists n:int :: n >= 0 && relHelp(x, y, n))); - -// Assert that from every type we can reach a type that is -// minimal, i.e., that cannot be reached by applying C to some -// other type. This will only hold in well-founded type -// hierarchies - -procedure P() returns () { - var v : C int; - - assert relHelp(7, 13, 0); - assert rel(7, 13); - - assert (forall y:b :: (exists x:a :: // too hard for a theorem prover - rel(x, y) && - (forall z:c :: (rel(z, x) ==> sameType(z, x))))); -} +// RUN: %boogie -typeEncoding:n -logPrefix:0n "%s" > "%t" +// RUN: %diff "%s.n.expect" "%t" +// RUN: %boogie -typeEncoding:p -logPrefix:0p "%s" > "%t" +// RUN: %diff "%s.p.expect" "%t" +// RUN: %boogie -typeEncoding:a -logPrefix:0a "%s" > "%t" +// RUN: %diff "%s.a.expect" "%t" +// a property that should hold according to the Boogie semantics +// (but no automatic theorem prover will be able to prove it) + + +type C a; + +function sameType(x:a, y:b) returns (bool); + +axiom (forall x:a, y:b :: sameType(x,y) == (exists z:a :: y==z)); + +// Will be defined to hold whenever the type of y (i.e., b) +// can be reached from the type of x (a) by applying the type +// constructor C a finite number of times. In order words, +// b = C^n(a) +function rel(x:a, y:b) returns (bool); + +function relHelp(x:a, y:b, z:int) returns (bool); + +axiom (forall x:a, y:b :: relHelp(x, y, 0) == sameType(x, y)); +axiom (forall n:int, x:a, y:b :: + (n >= 0 ==> + relHelp(x, y, n+1) == + (exists z:c, y' : C c :: relHelp(x, z, n) && y==y'))); + +axiom (forall x:a, y:b :: + rel(x, y) == (exists n:int :: n >= 0 && relHelp(x, y, n))); + +// Assert that from every type we can reach a type that is +// minimal, i.e., that cannot be reached by applying C to some +// other type. This will only hold in well-founded type +// hierarchies + +procedure P() returns () { + var v : C int; + + assert relHelp(7, 13, 0); + assert rel(7, 13); + + assert (forall y:b :: (exists x:a :: // too hard for a theorem prover + rel(x, y) && + (forall z:c :: (rel(z, x) ==> sameType(z, x))))); +} -- cgit v1.2.3