summaryrefslogtreecommitdiff
path: root/impl/test
diff options
context:
space:
mode:
authorCarlo Zancanaro <carlo@pc-4w14-0.cs.usyd.edu.au>2012-07-10 12:57:37 +1000
committerCarlo Zancanaro <carlo@pc-4w14-0.cs.usyd.edu.au>2012-07-10 12:57:37 +1000
commitd11acd6d52351b35c102e9c18e32d38a11975c5b (patch)
tree87bed31ad5c1c1de24552eabad012fc2ce4ecc48 /impl/test
parent9f3fff18f29d250745a758d13e4c4d39f59bee9c (diff)
Simple test stuff - examples from the paper
Diffstat (limited to 'impl/test')
-rw-r--r--impl/test/1.eqns3
-rw-r--r--impl/test/1.soln3
-rw-r--r--impl/test/2.eqns2
-rw-r--r--impl/test/2.soln2
-rw-r--r--impl/test/3.eqns1
-rw-r--r--impl/test/3.soln1
-rw-r--r--impl/test/4.eqns3
-rw-r--r--impl/test/4.soln3
-rw-r--r--impl/test/5.eqns2
-rw-r--r--impl/test/5.soln2
-rw-r--r--impl/test/6.eqns2
-rw-r--r--impl/test/6.soln2
-rw-r--r--impl/test/run16
13 files changed, 42 insertions, 0 deletions
diff --git a/impl/test/1.eqns b/impl/test/1.eqns
new file mode 100644
index 0000000..0cdfd24
--- /dev/null
+++ b/impl/test/1.eqns
@@ -0,0 +1,3 @@
+x = max(0, min(-1 + x, y))
+y = max(0, 5 + x, x)
+z = max(0, 1 + z, 0 + x)
diff --git a/impl/test/1.soln b/impl/test/1.soln
new file mode 100644
index 0000000..533dfeb
--- /dev/null
+++ b/impl/test/1.soln
@@ -0,0 +1,3 @@
+x = 0
+y = 5
+z = inf
diff --git a/impl/test/2.eqns b/impl/test/2.eqns
new file mode 100644
index 0000000..a5beaaf
--- /dev/null
+++ b/impl/test/2.eqns
@@ -0,0 +1,2 @@
+x = min(max(y, x + 1), 100)
+y = 0
diff --git a/impl/test/2.soln b/impl/test/2.soln
new file mode 100644
index 0000000..8f0f836
--- /dev/null
+++ b/impl/test/2.soln
@@ -0,0 +1,2 @@
+x = 100
+y = 0
diff --git a/impl/test/3.eqns b/impl/test/3.eqns
new file mode 100644
index 0000000..f11eb6c
--- /dev/null
+++ b/impl/test/3.eqns
@@ -0,0 +1 @@
+x = max(1, x + 1)
diff --git a/impl/test/3.soln b/impl/test/3.soln
new file mode 100644
index 0000000..90631c1
--- /dev/null
+++ b/impl/test/3.soln
@@ -0,0 +1 @@
+x = inf
diff --git a/impl/test/4.eqns b/impl/test/4.eqns
new file mode 100644
index 0000000..cd6045c
--- /dev/null
+++ b/impl/test/4.eqns
@@ -0,0 +1,3 @@
+x = 1
+y = max(y + x, -10)
+z = x * y
diff --git a/impl/test/4.soln b/impl/test/4.soln
new file mode 100644
index 0000000..c867646
--- /dev/null
+++ b/impl/test/4.soln
@@ -0,0 +1,3 @@
+x = 1
+y = inf
+z = inf
diff --git a/impl/test/5.eqns b/impl/test/5.eqns
new file mode 100644
index 0000000..af544cc
--- /dev/null
+++ b/impl/test/5.eqns
@@ -0,0 +1,2 @@
+x = max(0, x + y - 4)
+y = max(-10, min(max(x + 1, 2 * y), 5))
diff --git a/impl/test/5.soln b/impl/test/5.soln
new file mode 100644
index 0000000..bed531c
--- /dev/null
+++ b/impl/test/5.soln
@@ -0,0 +1,2 @@
+x = inf
+y = 5
diff --git a/impl/test/6.eqns b/impl/test/6.eqns
new file mode 100644
index 0000000..d8a508b
--- /dev/null
+++ b/impl/test/6.eqns
@@ -0,0 +1,2 @@
+x = max(0, x + y)
+y = x;1
diff --git a/impl/test/6.soln b/impl/test/6.soln
new file mode 100644
index 0000000..39162e5
--- /dev/null
+++ b/impl/test/6.soln
@@ -0,0 +1,2 @@
+x = inf
+y = 1
diff --git a/impl/test/run b/impl/test/run
new file mode 100644
index 0000000..d238962
--- /dev/null
+++ b/impl/test/run
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+NUM=1
+
+while [ -f "$NUM.eqns" ]
+do
+ OUTPUT=$($1 "$NUM.eqns" smart smart)
+ DIFF=$(echo "$OUTPUT" | diff - "$NUM.soln")
+ if [ ! -z "$DIFF" ]; then
+ echo "=================="
+ echo "Test #$NUM failed:"
+ echo "$OUTPUT" | sdiff - "$NUM.soln"
+ echo
+ fi
+ NUM=$(($NUM + 1))
+done