Skip to content

Commit bce71a3

Browse files
committed
Add test for modelT over IntSMT values
1 parent cee27d8 commit bce71a3

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

src/test/scala/edu/colorado/plv/cuanto/abstracting/tc/domains/SymbolicIntervalSpec.scala

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ package domains.interval
55
import smtlib.theories.Core._
66
import smtlib.theories.Ints._
77

8-
import symbolic._
8+
import abstracting.tc.symbolic._
99

1010
import instances._
1111

@@ -41,4 +41,27 @@ class SymbolicIntervalSpec extends CuantoSpec {
4141

4242
model("asdf",btwSpec(2,1)) should equal (None)
4343
}
44+
45+
46+
val addSpec: Int => Transformer[IntSMT] =
47+
n => {
48+
case (IntSMT(a1),IntSMT(a2)) => Equals(
49+
Add(sTerm(a1),NumeralLit(BigInt(n))),
50+
sTerm(a2)
51+
)
52+
}
53+
54+
val transformerTests = Table[
55+
(Transformer[IntSMT],Constraint[IntSMT],Constraint[IntSMT]),
56+
((Int,Int)) => Boolean
57+
](
58+
"SMT Transformer and constraints" -> "Int pair predicate",
59+
(addSpec(1),gteSpec(1),gteSpec(5)) -> { case ((i1,i2)) => (i1 + 1) == i2 }
60+
)
61+
62+
"The Int symbolic representation" should "produce transformer models" in {
63+
forAll (transformerTests) {
64+
case ((t,pre,post),p) => modelT(t)(pre,post).map(p) should equal (Some(true))
65+
}
66+
}
4467
}

0 commit comments

Comments
 (0)