-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Rework model detach * Upgrade version to 0.5.18
- Loading branch information
Showing
19 changed files
with
159 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ plugins { | |
} | ||
|
||
group = "io.ksmt" | ||
version = "0.5.17" | ||
version = "0.5.18" | ||
|
||
repositories { | ||
mavenCentral() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
ksmt-core/src/main/kotlin/io/ksmt/solver/model/KNativeSolverModel.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package io.ksmt.solver.model | ||
|
||
import io.ksmt.decl.KDecl | ||
import io.ksmt.expr.KExpr | ||
import io.ksmt.expr.KUninterpretedSortValue | ||
import io.ksmt.solver.KModel | ||
import io.ksmt.sort.KSort | ||
import io.ksmt.sort.KUninterpretedSort | ||
|
||
class KNativeSolverModel(nativeModel: KModel): KModel { | ||
private var model: KModel = nativeModel | ||
|
||
override val declarations: Set<KDecl<*>> get() = model.declarations | ||
|
||
override val uninterpretedSorts: Set<KUninterpretedSort> get() = model.uninterpretedSorts | ||
|
||
override fun <T : KSort> eval(expr: KExpr<T>, isComplete: Boolean): KExpr<T> = | ||
model.eval(expr, isComplete) | ||
|
||
override fun <T : KSort> interpretation(decl: KDecl<T>): KFuncInterp<T>? = | ||
model.interpretation(decl) | ||
|
||
override fun uninterpretedSortUniverse(sort: KUninterpretedSort): Set<KUninterpretedSortValue>? = | ||
model.uninterpretedSortUniverse(sort) | ||
|
||
override fun detach(): KModel { | ||
model = model.detach() | ||
return model | ||
} | ||
|
||
override fun close() { | ||
model.close() | ||
} | ||
|
||
override fun toString(): String = detach().toString() | ||
override fun hashCode(): Int = detach().hashCode() | ||
override fun equals(other: Any?): Boolean { | ||
if (this === other) return true | ||
if (other !is KModel) return false | ||
return detach() == other | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.