Skip to content

Commit

Permalink
Merge branch 'main' into update/sbt-scoverage-2.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
konnov authored Oct 1, 2024
2 parents 422c185 + 97263b5 commit 010912e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
1 change: 1 addition & 0 deletions .unreleased/bug-fixes/distinct-on-singleton.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Do not produce `(distinct ...)` for singletons, see #3005
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.12.0")
// https://github.com/sbt/sbt-native-packager
addSbtPlugin("com.github.sbt" % "sbt-native-packager" % "1.10.4")
// https://scalacenter.github.io/scalafix/docs/users/installation.html
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.12.1")
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.13.0")
// https://scalapb.github.io/zio-grpc/docs/installation
addSbtPlugin("com.thesamet" % "sbt-protoc" % "1.0.6")
// https://github.com/sbt/sbt-unidoc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -765,12 +765,17 @@ class Z3SolverContext(val config: SolverConfig) extends SolverContext with LazyL
(z3context.mkNot(eq.asInstanceOf[BoolExpr]).asInstanceOf[ExprSort], 1 + n)

case OperEx(ApalacheInternalOper.distinct, args @ _*) =>
val (es, ns) = (args.map(toExpr)).unzip
val distinct = z3context.mkDistinct(es: _*)
(distinct.asInstanceOf[ExprSort],
ns.foldLeft(1L) {
_ + _
})
if (args.length < 2) {
// Produce true for a singleton set or an empty set. Otherwise, we cannot replay the SMT log in CVC5.
(z3context.mkTrue().asInstanceOf[ExprSort], 1)
} else {
val (es, ns) = (args.map(toExpr)).unzip
val distinct = z3context.mkDistinct(es: _*)
(distinct.asInstanceOf[ExprSort],
ns.foldLeft(1L) {
_ + _
})
}

case OperEx(TlaBoolOper.and, args @ _*) =>
val (es, ns) = (args.map(toExpr)).unzip
Expand Down

0 comments on commit 010912e

Please sign in to comment.