diff options
author | mikebarnett <unknown> | 2009-07-15 21:03:41 +0000 |
---|---|---|
committer | mikebarnett <unknown> | 2009-07-15 21:03:41 +0000 |
commit | ce1c2de044c91624370411e23acab13b0381949b (patch) | |
tree | 592539996fe08050ead5ee210c973801611dde40 /Test/inline/test1.bpl |
Initial set of files.
Diffstat (limited to 'Test/inline/test1.bpl')
-rw-r--r-- | Test/inline/test1.bpl | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/Test/inline/test1.bpl b/Test/inline/test1.bpl new file mode 100644 index 00000000..db847b25 --- /dev/null +++ b/Test/inline/test1.bpl @@ -0,0 +1,45 @@ +
+procedure Main()
+{
+
+ var x:int;
+ var y:int;
+
+ x := 1;
+ y := 0;
+
+ call x := inc(x, 5);
+ call y := incdec(x, 2);
+
+ assert(x - 1 == y);
+
+}
+
+procedure {:inline 1} incdec(x:int, y:int) returns (z:int)
+ ensures z == x + 1 - y;
+{
+ z := x;
+ z := x + 1;
+ call z := dec(z, y);
+
+ return;
+
+}
+
+procedure {:inline 1} inc(x:int, i:int) returns (y:int)
+ ensures y == x + i;
+{
+ y := x;
+ y := x + i;
+ return;
+
+}
+
+procedure {:inline 1} dec(x:int, i:int) returns (y:int)
+ ensures y == x - i;
+{
+ y := x;
+ y := x - i;
+ return;
+
+}
\ No newline at end of file |