summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtests/source/counters.scade27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/source/counters.scade b/tests/source/counters.scade
new file mode 100755
index 0000000..3266ec9
--- /dev/null
+++ b/tests/source/counters.scade
@@ -0,0 +1,27 @@
+
+
+const bound: int = 1000;
+
+node counters(z: bool) returns (eq_nind : bool ; probe x, probe y : int)
+var
+ b1, b2 : bool;
+ a, b : bool;
+let
+
+ a = false -> (if pre a then pre x < bound else pre x <= 0);
+ --a = false -> pre(if a then x < bound else x <= 0);
+ x = bound -> (if a then pre x + 1 else pre x - 1);
+
+ b = true -> (if pre b then pre y < bound else pre y <= 0);
+ --b = true -> pre(if b then y < bound else y <= 0);
+ y = 0 -> (if b then pre y + 1 else pre y - 1);
+
+ b1 = x=bound;
+ b2 = y=0;
+
+
+ guarantee xy : x+y = bound;
+ guarantee bb : b1 = b2;
+ guarantee rp : -bound <= (x-y) and (x-y) <= bound;
+
+tel