Skip to content

Commit 8527848

Browse files
committed
Fixing issue #707 for Z3 API as well
1 parent e28254a commit 8527848

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

src/main/scala/decider/TermToZ3APIConverter.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,10 @@ class TermToZ3APIConverter
483483
// could be any Z3 internal functions that exist for those custom sorts. For the Real (i.e., Perm) sort, however,
484484
// such functions exist. So we re-declare *only* this sort.
485485
val decls = declPreamble + args.zipWithIndex.map { case (a, i) => s"(declare-const workaround${i} ${smtlibConverter.convert(a.sort)})" }.mkString(" ")
486-
val funcAppString = s"(${functionName} ${(0 until args.length).map(i => "workaround" + i).mkString(" ")})"
486+
val funcAppString = if (args.nonEmpty)
487+
s"(${functionName} ${(0 until args.length).map(i => "workaround" + i).mkString(" ")})"
488+
else
489+
functionName
487490
val assertion = decls + s" (assert (= ${funcAppString} ${funcAppString}))"
488491
val workaround = ctx.parseSMTLIB2String(assertion, null, null, null, null)
489492
val app = workaround(0).getArgs()(0)

src/main/scala/decider/Z3ProverAPI.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ class Z3ProverAPI(uniqueId: String,
263263
case t => triggerGenerator.isForbiddenInTrigger(t)
264264
}.nonEmpty))
265265
q.copy(triggers = goodTriggers)
266-
}({t => true})
266+
}(_ => true)
267267
cleanTerm
268268
}
269269

0 commit comments

Comments
 (0)