by Michał Antkiewicz, Oct 25, 2026
This release lets a Clafer model import other models, so that a model can be split into several files, for example, a design space and one file for each system that configures it (#100). All tools report errors with the file and the position in it, the editors for Visual Studio Code and Sublime Text 4 compile models and show the errors in place, and the compiler and chocosolver get several fixes. Binaries for Linux x86_64 are available from the Clafer tools binary distributions page.
Models in several files. A model imports other files in its first line, //# OPTIONS --import=design-space.cfr, or on the command line, clafer SystemA.cfr --import=design-space.cfr. The files are compiled together as one model, with one namespace; imports are followed transitively, each file once. A model and its imports can also be URLs, so a model can import a design space published on a server. Errors are given as file.cfr:line:column, in the file in which they are. See the Clafer Cheat Sheet for the details.
- clafer compiler, release pull request (0.5.4).
--import, also withhttp://andhttps://URLs; the options of all files are combined (e.g., the largest--maxint)- positions as
file.cfr:line:columneverywhere, also in a model of one file (previouslyline 3 column 5); the JSON output has the source positions of clafers and expressions, with their file, and the HTML output shows each file under its name - options that restrict imports for models that may come from anyone, as in the web tools:
--import-root,--public-importsand--import-base; an imported file must be a.cfrfile - group cardinality
optmakes its children optional again, as in the language's definition - a group cardinality whose lower bound the children cannot reach (e.g.,
xorover no children) is an error instead of being silently unconstrained - fixes: comments no longer count in the indentation, clafer names with apostrophes (
same') work with Alloy and Choco, comments are escaped in the HTML output, and unknown options in//# OPTIONSare an error instead of being ignored
- claferIG Alloy-based instance generator, release pull request (0.5.4).
- uses clafer-0.5.4:
--import, and the options in the model's//# OPTIONSapply - errors and the constraints of UnSAT cores give their file and position; the command
cshows each file under its name, with the scope of the first clafer - instances show the clafers' names from the model
- uses clafer-0.5.4:
- chocosolver Choco-based instance generator, release pull request (0.5.4).
- compiles a
.cfrmodel with its imports, and shows the compiler's errors when it does not compile - fixes: references refined in subclafers of an abstract clafer (a model could have no instances), and a crash with
parent.parentof an optional child of a nested abstract clafer
- compiles a
- claferwiki, release pull request (0.5.4).
- uses clafer-0.5.4
- fixes the model graphs behind HTTPS proxies and the syntax highlighting of code blocks
- Clafer for Visual Studio Code, release pull request (0.5.4).
- compiles the model when it is saved, or with Clafer: Compile, and shows the errors in the model and in the Problems panel, also in imported files
- Clafer: Instances (Alloy) and Clafer: Instances (Choco) run claferIG and chocosolver in a terminal
- install the
.vsixfile from the GitHub release withcode --install-extension clafer-syntax-0.5.4.vsix
- Clafer Tools for Sublime Text, release pull request (0.5.4), now for Sublime Text 4.
- syntax highlighting that follows the Clafer grammar, and the compiler's errors shown in the model; double-click an error's position, or press F4, to open its file
- the instance generators run in a Terminus tab; the tools are found on
PATH - install or update Clafer Tools with Package Control
- Web tools: ClaferIDE, ClaferConfigurator, and ClaferMooVisualizer 0.5.4, with the common platform.
- models can import other models: the tool's examples (
--import=Examples/<file>.cfr) and.cfrfiles on public servers; a model opened from a wiki imports relative to its URL - messages give positions as
model.cfr:line:column - fixed: the welcome window appears again, and the page no longer stays grayed out on the first visit
- models can import other models: the tool's examples (
The Linux binary bundle contains clafer, claferIG with the optimized MiniSat solver, chocosolver.jar with a chocosolver launcher, and the Alloy jars. It runs on Linux x86_64 with glibc 2.39 or newer (Ubuntu 24.04, Debian 13, Arch Linux, Fedora) and needs Java 21 or newer. On Windows, use it through WSL.
Live demos (0.5.4): the Clafer Model Wiki, the Railway Wiki, the Traffic Lights Wiki, ClaferIDE, ClaferConfigurator, and ClaferMooVisualizer.
Note: a claferwiki page cannot import other models yet; it is compiled from its own code blocks. As before, reasoning (instance generation, configuration, optimization) works for the static subset of Clafer; behavioral models can be compiled to HTML.
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.