diff options
Diffstat (limited to 'tests/source')
-rw-r--r-- | tests/source/abro.scade | 31 | ||||
-rw-r--r-- | tests/source/cosinus.scade | 2 |
2 files changed, 32 insertions, 1 deletions
diff --git a/tests/source/abro.scade b/tests/source/abro.scade new file mode 100644 index 0000000..43589d0 --- /dev/null +++ b/tests/source/abro.scade @@ -0,0 +1,31 @@ +node abro(a, b, r: bool) returns(o: bool) +var + ha, hb: bool; +let + automaton initial state G let + automaton + initial state N ha = false; until if a resume M; + state M ha = true; + returns ha; + + automaton + initial state N hb = false; until if b resume M; + state M hb = true; + returns hb; + + tel until if r restart G; + returns ha, hb; + o = ha and hb and (false -> not pre(ha and hb)); +tel + +node test(i: int) returns(a, b, c: int; exit: bool) +var xa, xb, xr: bool; +let + xa = (i mod 3 = 2); + xb = (i mod 5 = 3); + xr = (i mod 9 = 4); + a = if xa then 1 else 0; + b = if xb then 1 else 0; + c = (if abro(xa, xb, xr) then 1 else 0) + (if xr then 2 else 0); + exit = (i >= 128); +tel diff --git a/tests/source/cosinus.scade b/tests/source/cosinus.scade index a1596c2..febf5d0 100644 --- a/tests/source/cosinus.scade +++ b/tests/source/cosinus.scade @@ -14,6 +14,6 @@ let a = int(cos * 1000.); b = int(cosprime * 1000.); c = int(-cos * 1000.); - exit = (i > 8000); + exit = (i > 1000); tel |