Skip to content

Commit c37411d

Browse files
authored
Merge pull request #141 from jad-hamza/smt-parsing
Add model extraction for #unspecified and seq.unit
2 parents b787367 + 5cf176a commit c37411d

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ libraryDependencies ++= Seq(
4545

4646
def ghProject(repo: String, version: String) = RootProject(uri(s"${repo}#${version}"))
4747
// lazy val smtlib = RootProject(file("../scala-smtlib"))
48-
lazy val smtlib = ghProject("https://github.com/epfl-lara/scala-smtlib.git", "5b9503e13d69c7116039a243025b2ce657c32c77")
48+
lazy val smtlib = ghProject("https://github.com/epfl-lara/scala-smtlib.git", "95b5d1ed2ee9c0c1ec5cabb3c0303d27a48131cd")
4949

5050
lazy val scriptName = settingKey[String]("Name of the generated 'inox' script")
5151

src/it/scala/inox/tip/TipTestSuite.scala

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,8 @@ class TipTestSuite extends TestSuite with ResourceUtils {
2525
private def ignoreSAT(ctx: Context, file: java.io.File): FilterStatus =
2626
ctx.options.findOptionOrDefault(optSelectedSolvers).headOption match {
2727
case Some(solver) => (solver, file.getName) match {
28-
// test containing list of booleans, so CVC4 will crash on this
29-
// See http://church.cims.nyu.edu/bugzilla3/show_bug.cgi?id=500
30-
case ("smt-cvc4", "List-fold.tip") => Skip
3128
// Z3 and CVC4 binaries are exceedingly slow on these benchmarks
32-
case ("smt-z3" | "smt-cvc4", "BinarySearchTreeQuant.scala-2.tip") => Ignore
33-
case ("smt-z3" | "smt-cvc4", "ForallAssoc.scala-0.tip") => Ignore
29+
case ("no-inc:smt-z3" | "smt-z3" | "smt-cvc4", "ForallAssoc.scala-0.tip") => Ignore
3430
// this test only holds when assumeChecked=false
3531
case (_, "LambdaEquality2.scala-1.tip") if ctx.options.findOptionOrDefault(optAssumeChecked) => Skip
3632
case _ => Test

src/main/scala/inox/solvers/smtlib/SMTLIBParser.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ trait SMTLIBParser {
224224
val MapType(from, to) = fromSMT(sort)
225225
FiniteMap(Seq.empty, d, from, to)
226226

227-
case _ => throw new MissformedSMTException(term, "Unknown SMT term")
227+
case _ => throw new MissformedSMTException(term, "Unknown SMT term of class: " + term.getClass)
228228
}
229229

230230
protected def fromSMT(sort: Sort)(implicit context: Context): Type = sort match {

src/main/scala/inox/solvers/smtlib/Z3Target.scala

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,15 @@ trait Z3Target extends SMTLIBTarget with SMTLIBDebugger {
144144
unsupported(t, "woot? tester for non-adt type")
145145
}
146146

147+
case (QualifiedIdentifier(SimpleIdentifier(SSymbol("#unspecified")), None), None) =>
148+
throw new MissformedSMTException(t, "Cannot extract #unspecified symbol when type is unknown")
149+
150+
case (QualifiedIdentifier(SimpleIdentifier(SSymbol("#unspecified")), None), Some(tpe)) =>
151+
Choose(ValDef.fresh("unspecified", tpe), BooleanLiteral(true))
152+
153+
case (FunctionApplication(QualifiedIdentifier(SimpleIdentifier(SSymbol("seq.unit")), None), Seq(SHexadecimal(hex))), _) =>
154+
StringLiteral(utils.StringUtils.decode(hex.repr))
155+
147156
case (QualifiedIdentifier(ExtendedIdentifier(SSymbol("as-array"), k: SSymbol), _), Some(tpe @ MapType(keyType, valueType))) =>
148157
val Some(Lambda(Seq(arg), body)) = context.getFunction(k, FunctionType(Seq(keyType), valueType))
149158

0 commit comments

Comments
 (0)