summaryrefslogtreecommitdiff
path: root/Test/textbook/McCarthy-91.bpl
diff options
context:
space:
mode:
authorGravatar rustanleino <unknown>2010-10-22 01:34:13 +0000
committerGravatar rustanleino <unknown>2010-10-22 01:34:13 +0000
commit75affe5a214df74d2927785d666fbe3d7871e867 (patch)
tree2c849dc5fea8ea7e0406ab03d9c622d47909bf9a /Test/textbook/McCarthy-91.bpl
parent7b2e81b5f228e09feaedd215c7d2fc7eed0ffe1c (diff)
Miscellaneous changes:
* Also copy CodeContractExtender in PrepareBoogieZip.bat * Added some comments and a new program in Test/textbook * Included refinement keywords in Chalice emacs mode * Used assignment instead of spec statement in DuplicatesVideo.chalice
Diffstat (limited to 'Test/textbook/McCarthy-91.bpl')
-rw-r--r--Test/textbook/McCarthy-91.bpl12
1 files changed, 12 insertions, 0 deletions
diff --git a/Test/textbook/McCarthy-91.bpl b/Test/textbook/McCarthy-91.bpl
new file mode 100644
index 00000000..899a7ff1
--- /dev/null
+++ b/Test/textbook/McCarthy-91.bpl
@@ -0,0 +1,12 @@
+// McCarthy 91 function
+procedure F(n: int) returns (r: int)
+ ensures 100 < n ==> r == n - 10;
+ ensures n <= 100 ==> r == 91;
+{
+ if (100 < n) {
+ r := n - 10;
+ } else {
+ call r := F(n + 11);
+ call r := F(r);
+ }
+}