UnitTestBot / ksmt

Kotlin/Java API for various SMT solvers
https://ksmt.io/
Apache License 2.0
30 stars 14 forks source link

Forking solver implementation #123

Open dee-tree opened 1 year ago

dee-tree commented 1 year ago

A forking solver presents an ability to create children with existed parental assertions memory efficiently as possible. Also, it has lazy assertions initialization.

It is draft implementation requiring following reviews.

Notes

  1. Forking solver manager (KForkingSolverManager) provides shared resources for the solvers group. It allows to create KForkingSolver instance that lifetime upper bounded by the manager's life.
  2. KForkingSolver is a solver, which can be branched in assertions and push-levels.

Usage

KZ3ForkingSolverManager(ctx).use { man ->
    val parent = man.createForkingSolver()
    parent.assert(formula)
    val child = parent.fork()
    println(child.checkSat())
}

Currently implemented:

TODO: