org.clafer 0.6.0 API
The Java API of the Java tools of Clafer: clafersg,
the Clafer solution generator (formerly chocosolver), claferc and the language server clafer-ls,
version 0.6.0, released with Clafer 0.6.0 on Nov 29, 2026.
clafersg
- The command is
clafersg(clafersg.jar), for instance generation and multi-objective optimization with Choco 6.0.2, and the traces of temporal models with Alloy 6.2.0.clafersg --versionprintsclafersg v0.6.0.<build date>. chocosolver, its old name, is deprecated: Clafer Tools 0.6.0 no longer installs it, norchocosolver.jar, and there is no alias.clafersgreads.cfrmodels directly with its Java frontend and writes no.jsfile. It runsclafer -m chocoitself for a model with a[choco| |]escape and with--haskell-frontend, using theclafernext to its jar, or the one on thePATH..jsfiles still work.- On a temporal model,
clafersgsolves with Alloy 6.2.0 in the same JVM, and--replis claferIG's REPL; the launcher passes the optimized MiniSat prover. - New:
claferc, the Clafer compiler's-m clafer,--core,--meta-dataand-m alloyin Java, andclafer-ls, the Clafer language server (LSP).
Maven
The parent project is org.clafer:org.clafer, with four modules:
| Artifact | Module | Contents |
|---|---|---|
org.clafer:clafersg (was org.clafer:chocosolver) | solver/ |
the solver: the AST, the IR, the Choco compiler and the CLI |
org.clafer:clafer-frontend | frontend/ |
the Java frontend: the parser of .cfr models, the explicit IR, and claferc |
org.clafer:clafer-alloy | alloy/ |
the Alloy 6 backend for temporal models |
org.clafer:clafer-language-server | lsp/ |
clafer-ls, on Eclipse LSP4J |
<dependency>
<groupId>org.clafer</groupId>
<artifactId>clafersg</artifactId>
<version>0.6.0</version>
</dependency>
Clafer Tools 0.6.0
The binaries are on Clafer Tools - Binary
Distributions. The release has three assets, each with its checksum <file>.sha256:
clafer-tools-java-0.6.0-linux-x86_64.tar.gz:clafersg,claferc,clafer-lsand the optimized MiniSat prover;clafer-tools-haskell-0.6.0-linux-x86_64.tar.gz:claferandclaferIG;clafer-syntax-0.6.0.vsix: the VS Code extension clafer-vscode.
The two bundles unpack into the same folder, clafer-tools-0.6.0/, and together they are the whole toolset.
See the README and the change log.
Packages
Package
Description
This package provides the Alloy 6 code of a temporal model, as
clafer -m alloy writes it: a port of the Clafer compiler's
AlloyLtl generator, with the mapping of the positions in the Alloy
code back to the model's constraints.This package provides the Alloy backend of the solution loop, for temporal
models: a port of claferIG that runs Alloy 6.2.0 in the same JVM, finds
the traces of a model, reads them from Alloy's XML, and computes unsat
cores and their near-misses.
This package provides the assertions of a model: a boolean expression of the
AST that every instance should satisfy, with where it is in the source model.
This package provides the language for building Clafer AST.
This package provides various analysis and optimizations to perform on the
AST.
This package provides a compiler to translate Clafer AST to IR.
This package provides extensions to the Choco solver used by the Clafer
solvers, such as stop criteria (a time limit) that survive a reset of the
search.
This package provides Clafer specific Choco constraints required for
efficient solving.
This package provides Clafer specific Choco propagators required for
efficient solving.
This package provides Choco search strategies for set variables that choose
the variable and the value at random.
This package provides the command-line interface of clafersg, the Clafer
solution generator (formerly chocosolver): the main class of
clafersg.jar.This package provides various data structures common throughout the project.
This package provides various utility functions common throughout the
project.
This package provides a compiler from AST to Choco including algorithms for
solving optimal instances and max unsat.
This package provides immutable domains over integers, stored as disjoint
ranges, and boolean domains, which the AST and IR analyses use to bound
variables before they are compiled to Choco.
This package provides the Java frontend of Clafer: a port of the Clafer
compiler that reads
.cfr models without the Haskell compiler.This package provides data structure and algorithms for directed graphs.
This package provides the solution loop shared by the backends, a port of
claferIG's command line: the REPL, the solutions (the instances of a static
model from Choco, or the traces of a temporal model from Alloy) and their
views.
This package provides structure for working with instances.
This package provides the IR used as in intermediate language during
compilation.
This package provides various analysis and optimizations to perform on the
IR.
This package provides the deductions of the IR optimizer: feasibility-based
bounds tightening (
FBBT), with one
deducer per kind of IR constraint, which narrows the domains of the
variables before the IR is compiled to Choco, removes constraints that hold,
and coalesces variables that must be equal.This package provides a compiler to translate IR to Choco.
This package provides classes for building Clafer models and invoking the
solver via Javascript.
This package provides
clafer-ls, the Clafer language server (LSP),
on Eclipse LSP4J: JSON-RPC over stdin and stdout.This package provides exact linear algebra over rational numbers: linear
functions, equations and systems, and sparse matrices.
This package provides classes for building the objective.
This package provides a small knowledge base of is-a and has-a relationships
between concepts, with an oracle that answers queries about them.
This package provides classes for building and retrieving the scope.