Skip to content

Commit 7509142

Browse files
authored
Fix java compatibility issues (#32)
* Fix java compatibility issues
1 parent 9c1f811 commit 7509142

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

ksmt-core/build.gradle.kts

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
2+
13
plugins {
24
id("org.ksmt.ksmt-base")
35
`java-test-fixtures`
@@ -7,6 +9,10 @@ dependencies {
79
testFixturesApi("org.junit.jupiter", "junit-jupiter-params", "5.8.2")
810
}
911

12+
tasks.withType<KotlinCompile> {
13+
kotlinOptions.freeCompilerArgs += listOf("-Xjvm-default=all")
14+
}
15+
1016
publishing {
1117
publications {
1218
create<MavenPublication>("maven") {

ksmt-core/src/main/kotlin/org/ksmt/solver/KSolver.kt

+13
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@ import org.ksmt.expr.KExpr
44
import org.ksmt.sort.KBoolSort
55
import kotlin.time.Duration
66

7+
@Suppress("OVERLOADS_INTERFACE", "INAPPLICABLE_JVM_NAME")
78
interface KSolver : AutoCloseable {
89

910
/**
1011
* Assert an expression into solver.
1112
*
1213
* @see check
1314
* */
15+
@JvmName("assertExpr")
1416
fun assert(expr: KExpr<KBoolSort>)
1517

1618
/**
@@ -36,6 +38,8 @@ interface KSolver : AutoCloseable {
3638
* @param n number of pushed scopes to revert.
3739
* @see push
3840
* */
41+
@JvmOverloads
42+
@JvmName("pop")
3943
fun pop(n: UInt = 1u)
4044

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

5359
/**
@@ -57,6 +63,8 @@ interface KSolver : AutoCloseable {
5763
* @see check
5864
* @see unsatCore
5965
* */
66+
@JvmOverloads
67+
@JvmName("checkWithAssumptions")
6068
fun checkWithAssumptions(assumptions: List<KExpr<KBoolSort>>, timeout: Duration = Duration.INFINITE): KSolverStatus
6169

6270
/**
@@ -78,4 +86,9 @@ interface KSolver : AutoCloseable {
7886
* The format of resulting string is solver implementation dependent.
7987
* */
8088
fun reasonOfUnknown(): String
89+
90+
/**
91+
* Close solver and release acquired native resources.
92+
* */
93+
override fun close()
8194
}

0 commit comments

Comments
 (0)