Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Z3: Fix model detach #143

Merged
merged 4 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Get the most out of SMT solving with KSMT features:
* Streamlined [solver delivery](#ksmt-distribution) with no need for building a solver or implementing JVM bindings

[![KSMT: build](https://github.com/UnitTestBot/ksmt/actions/workflows/build-and-run-tests.yml/badge.svg)](https://github.com/UnitTestBot/ksmt/actions/workflows/build-and-run-tests.yml)
[![Maven Central](https://img.shields.io/maven-central/v/io.ksmt/ksmt-core)](https://central.sonatype.com/artifact/io.ksmt/ksmt-core/0.5.12)
[![Maven Central](https://img.shields.io/maven-central/v/io.ksmt/ksmt-core)](https://central.sonatype.com/artifact/io.ksmt/ksmt-core/0.5.13)
[![javadoc](https://javadoc.io/badge2/io.ksmt/ksmt-core/javadoc.svg)](https://javadoc.io/doc/io.ksmt/ksmt-core)

## Get started
Expand All @@ -20,9 +20,9 @@ To start using KSMT, install it via [Gradle](https://gradle.org/):

```kotlin
// core
implementation("io.ksmt:ksmt-core:0.5.12")
implementation("io.ksmt:ksmt-core:0.5.13")
// z3 solver
implementation("io.ksmt:ksmt-z3:0.5.12")
implementation("io.ksmt:ksmt-z3:0.5.13")
```

Find basic instructions in the [Getting started](docs/getting-started.md) guide and try it out with the
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/io.ksmt.ksmt-base.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ plugins {
}

group = "io.ksmt"
version = "0.5.12"
version = "0.5.13"

repositories {
mavenCentral()
Expand Down
6 changes: 3 additions & 3 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ repositories {
```kotlin
dependencies {
// core
implementation("io.ksmt:ksmt-core:0.5.12")
implementation("io.ksmt:ksmt-core:0.5.13")
}
```

Expand All @@ -43,9 +43,9 @@ dependencies {
```kotlin
dependencies {
// z3
implementation("io.ksmt:ksmt-z3:0.5.12")
implementation("io.ksmt:ksmt-z3:0.5.13")
// bitwuzla
implementation("io.ksmt:ksmt-bitwuzla:0.5.12")
implementation("io.ksmt:ksmt-bitwuzla:0.5.13")
}
```

Expand Down
6 changes: 3 additions & 3 deletions examples/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ repositories {

dependencies {
// core
implementation("io.ksmt:ksmt-core:0.5.12")
implementation("io.ksmt:ksmt-core:0.5.13")
// z3 solver
implementation("io.ksmt:ksmt-z3:0.5.12")
implementation("io.ksmt:ksmt-z3:0.5.13")
// Runner and portfolio solver
implementation("io.ksmt:ksmt-runner:0.5.12")
implementation("io.ksmt:ksmt-runner:0.5.13")
}

java {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ inline fun KContext.simplifyRealToIntLight(
): KExpr<KIntSort> {
if (arg is KRealNumExpr) {
val realValue = arg.toRealValue()
return mkIntNum(realValue.numerator / realValue.denominator)
return mkIntNum(evalIntDiv(realValue.numerator, realValue.denominator))
}

// (real2int (int2real x)) ==> x
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,7 @@ open class KExprSimplifier(override val ctx: KContext) :
* Don't check if all expressions are constants as they are trivially comparable.
* */
allDistinct = allDistinct
&& !allExpressionsAreConstants
&& visitedExprs.all { areDefinitelyDistinct(it, expr) }
&& (allExpressionsAreConstants || visitedExprs.all { areDefinitelyDistinct(it, expr) })
}

if (allDistinct) return true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ class FpToBvTransformer(ctx: KContext, private val packedBvOptimization: Boolean
override fun <S : KFpSort> visit(sort: S): Boolean = true

override fun visit(sort: KFpRoundingModeSort): Boolean =
TODO("Fp rounding mode transformer")
throw KSolverUnsupportedFeatureException("Rounding mode expressions are not supported")

override fun <D : KSort, R : KSort> visit(sort: KArraySort<D, R>): Boolean =
sort.range.accept(this) || sort.domain.accept(this)
Expand Down
Loading
Loading