klause

klause

Used in: combo.

Klause is a constraint solver written in Kotlin Multiplatform. It solves satisfaction and optimization problems over Booleans, integers and reals, including constraint programming, SAT, MaxSAT, mixed integer linear programming and SMT arithmetic. Use the Kotlin library or run the CLI on the JVM or as a native executable.

The Kotlin DSL covers arithmetic, logic, comparisons and global constraints such as allDifferent, cumulative, circuit, binPacking, table, regular, mdd and network flow. MiniZinc models can target klause through klause-mzn-lib. The CLI also reads FlatZinc, XCSP3, SMT-LIB, MPS, DIMACS, OPB/WBO and WCNF.

Complete search, local search, LP relaxations and exact arithmetic services work on the same source model. Complete search can establish infeasibility or optimality when it finishes; local search finds checked feasible points without a global proof. Available operations depend on the model and solver.

Finite-model library operations include repeated solves under assumptions, enumeration, sampling and counting. SMT-LIB command sessions support repeated checks with assertion stacks and queries on retained models; each check solves its active snapshot.

SMT-LIB

The first-order quantifier-free language includes exact integer and real arithmetic, bitvectors, free sorts and functions, extensional arrays and algebraic datatypes. These sorts can be combined in one formula. The SMT-LIB guide covers the supported language, command sessions and runnable examples against the current main branch.

Floating point, strings and regular expressions, term quantifiers and higher-order maps are excluded. Nonlinear integer and transcendental solving are incomplete, so a valid input can return unknown. Optional proof, core and unsat-assumption production is unsupported.

Install

dependencies {
  implementation("com.eignex:klause:LATEST")
}

Where to go next