summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Auvolat <alex.auvolat@ansys.com>2014-07-04 17:54:40 +0200
committerAlex Auvolat <alex.auvolat@ansys.com>2014-07-04 17:54:40 +0200
commit9628140878d0f57bbb37186b00164b80365f9b34 (patch)
treeea272dca7599b2d8a597d941b5e14a427144695b
parent0ce4cf6e7e280269db5da7c7b4fcb977b7f6f2cd (diff)
downloadscade-analyzer-9628140878d0f57bbb37186b00164b80365f9b34.tar.gz
scade-analyzer-9628140878d0f57bbb37186b00164b80365f9b34.zip
Add example counters.scade.
-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