Skip to content

Commit

Permalink
Fix java compatibility issues (#32)
Browse files Browse the repository at this point in the history
* Fix java compatibility issues
  • Loading branch information
Saloed authored Oct 21, 2022
1 parent 9c1f811 commit 7509142
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ksmt-core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
id("org.ksmt.ksmt-base")
`java-test-fixtures`
Expand All @@ -7,6 +9,10 @@ dependencies {
testFixturesApi("org.junit.jupiter", "junit-jupiter-params", "5.8.2")
}

tasks.withType<KotlinCompile> {
kotlinOptions.freeCompilerArgs += listOf("-Xjvm-default=all")
}

publishing {
publications {
create<MavenPublication>("maven") {
Expand Down
13 changes: 13 additions & 0 deletions ksmt-core/src/main/kotlin/org/ksmt/solver/KSolver.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ import org.ksmt.expr.KExpr
import org.ksmt.sort.KBoolSort
import kotlin.time.Duration

@Suppress("OVERLOADS_INTERFACE", "INAPPLICABLE_JVM_NAME")
interface KSolver : AutoCloseable {

/**
* Assert an expression into solver.
*
* @see check
* */
@JvmName("assertExpr")
fun assert(expr: KExpr<KBoolSort>)

/**
Expand All @@ -36,6 +38,8 @@ interface KSolver : AutoCloseable {
* @param n number of pushed scopes to revert.
* @see push
* */
@JvmOverloads
@JvmName("pop")
fun pop(n: UInt = 1u)

/**
Expand All @@ -48,6 +52,8 @@ interface KSolver : AutoCloseable {
* * [KSolverStatus.UNKNOWN] solver failed to check satisfiability due to timeout or internal reasons.
* Brief reason description may be obtained via [reasonOfUnknown].
* */
@JvmOverloads
@JvmName("check")
fun check(timeout: Duration = Duration.INFINITE): KSolverStatus

/**
Expand All @@ -57,6 +63,8 @@ interface KSolver : AutoCloseable {
* @see check
* @see unsatCore
* */
@JvmOverloads
@JvmName("checkWithAssumptions")
fun checkWithAssumptions(assumptions: List<KExpr<KBoolSort>>, timeout: Duration = Duration.INFINITE): KSolverStatus

/**
Expand All @@ -78,4 +86,9 @@ interface KSolver : AutoCloseable {
* The format of resulting string is solver implementation dependent.
* */
fun reasonOfUnknown(): String

/**
* Close solver and release acquired native resources.
* */
override fun close()
}

0 comments on commit 7509142

Please sign in to comment.