This file collects a summary of important and/or user-visible changes.
-
SMT2 parser now supports non-indexed rotate operators. These operators are binary, with the second argument representing the number of bits to rotate by:
(bvror <term> <term>)
(bvrol <term> <term>)
-
Added new CLI option
--pp-only
(preprocess only). -
C++ API: Output streams can now be configured to disable letification of terms when printing (letification is enabled by default). To disable, for
std::ostream os
, useos << set_letify(false);
. -
Fixed BV_AND_CONCAT rewrite (issues #131 and #134).
-
Fixed a GMP memory leak in the BitVector move constructor.
-
Fixed errors detected with UBSan.
-
Added new abstraction module for abstracting bit-vector arithmetic operators, see Aina Niemetz, Mathias Preiner and Yoni Zohar. Scalable Bit-Blasting with Abstractions. CAV 2024, Springer, 2024.. Enable with option
--abstraction
, the minimum bit-width of relevant terms to abstract can be configured via option--abstraction-bv-size
. -
Quantification over array variables now supported.
-
Improved arithmetic normalization.
-
Added new command-line option
--print-model
. This enables auto-printing of models after a satisfiable query. Must be enabled to print models for BTOR2 input (automatically enables-m
). Command line option-m
,--produce-models
alone now does not print models for BTOR2 input anymore. -
Parser now allows to configure auto-printing of models (corresponding to command-line option
--print-model
above) via:- C++ API:
Parser::configure_auto_print_model(bool)
- C API:
bitwuzla_parser_configure_auto_print_model(BitwuzlaParser*,bool)
- Python API:
Parser.configure_auto_print_model(bool)
- C++ API:
-
Bumped Kissat to version 4.0.1.
-
Fixed version string generation for dev versions. Previously, git information that is included in the version string was not regenerated at compile time, only at configure time.
-
Fixed incorrect result with rewrite level 0 (issue #110) (missing guard, normalization preprocessing pass expects terms to be fully rewritten).
-
Refactored node data storage and unique table handling, improves performance and memory footprint.
-
Added support for BTOR2 model printing.
-
Added support for querying the parser for declared sorts and terms.
- C++ API:
- New Function
Parser::get_declared_sorts()
to retrieve user-declared sorts (SMT-LIB: declared viadeclare-sort
, BTOR2: always empty). - New Function
Parser::get_declared_funs()
to retrieve user-declared function symbols (SMT-LIB: declared viadeclare-const
anddeclare-fun
, BTOR2: inputs with a symbol).
- New Function
- C API:
- New Function
bitwuzla_parser_get_declared_sorts(BitwuzlaParser*, size_t*)
. - New Function
bitwuzla_parser_get_declared_funs(BitwuzlaParser*, size_t*)
.
- New Function
- Python API:
- New Function
Parser.get_declared_sorts()
. - New Function
Parser.get_declared_funs()
.
- New Function
- C++ API:
-
Refactored statistics printing to not print NaN values.
-
Improved logging and statistics for local search engine.
-
Several improvements to build system configuration.
-
Several fixes for Windows cross compilation.
-
Added Linux aarch64 cross-compilation support (configure flag:
--arm64
). -
Introduce TermManager interface for creating Term and Sort (major API change).
- Solver and parser instances now require a term manager for initialization. Terms and sorts can be shared across solver/parser instances if they were initialized with the same term manager. The term manager is responsible for managing Term and Sort objects.
- C++ API:
- New class
TermManager
for creating Term and Sort objects. - Term and Sort creation function
mk_*
moved toTermManager
class. - Substitution functions
substitute_term
andsubstitute_terms
moved toTermManager
. - Constructor
Bitwuzla(const Options &options)
changed toBitwuzla(TermManager&, const Options &options)
. - New function
Bitwuzla::term_mgr()
to retrieve configured term manager instance.
- New class
- C API:
- New functions
bitwuzla_term_manager_new()
,bitwuzla_term_manager_delete
for creating and deleting term manager instances. - Function
bitwuzla_new(const BitwuzlaOptions*)
changed tobitwuzla_new(BitwuzlaTermManager*, const BitwuzlaOptions*)
. - New function
bitwuzla_get_term_mgr(Bitwuzla*)
to retrieve configured term manager instance from Bitwuzla instance. - New reference counting interface for fine-grained resource management:
- New function
bitwuzla_term_manager_release(BitwuzlaTermManager*)
to release all created terms and sorts of a term manager instance. - New functions
bitwuzla_term_copy(BitwuzlaTerm)
andbitwuzla_term_release(BitwuzlaTerm)
for incrementing/decrementing BitwuzlaTerm reference counts. - New functions
bitwuzla_sort_copy(BitwuzlaSort)
andbitwuzla_sort_release(BitwuzlaSort)
for incrementing/decrementing BitwuzlaSort reference counts.
- New function
- New functions
- Python API:
- New class
TermManager
for creating Term and Sort objects. - Term and Sort creation function
mk_*
moved toTermManager
class. - Substitution functions
substitute_term
andsubstitute_terms
moved toTermManager
. - Constructor
Bitwuzla(Options)
changed toBitwuzla(TermManager, Options)
. - New function
Bitwuzla::term_mgr()
to retrieve configured term manager instance.
- New class
-
Refactor parser interface to allow parsing from string inputs.
- A parser instance is not tied to an input file anymore.
- Added support for parsing from string inputs.
- Added support for parsing terms and sorts from string inputs.
- Interface for parsing functions now returns
bool
instead of string. - C++ API:
- Constructor
Parser(Options&, const std::string&, const std::string&, std::ostream*)
changed toParser(TermManager&, Options&, const std::string&, std::ostream*)
- Function
std::string Parser::parse(bool)
changed tovoid Parser::parse(const std::string, bool, bool)
and now throws an exception on error. It now also supports parsing from string input. - New Function
void Parser::parse(const std::string&, std::istream&, bool)
allows parsing from an already open input stream and now throws an exception on error. This function is not limited to input files but also supports parsing fromstd::cin
and strings. - New function
bitwuzla::Term parse_term(const std::string&)
to parse a term from string. - New function
bitwuzla::Sort parse_sort(const std::string&)
to parse a sort from string. - New
bitwuzla::parser::Exception
(derived frombitwuzla::Exception
) which is thrown on parse error.
- Constructor
- C API:
- Function
BitwuzlaParser* bitwuzla_parser_new(BitwuzlaOptions*, const char*, FILE*, const char*, uint8_t, const char*)
changed toBitwuzlaParser* bitwuzla_parser_new(BitwuzlaTermManager*, BitwuzlaOptions*, const char*, uint8_t, const char*)
. - Function
const char* bitwuzla_parser_parse(BitwuzlaParser*, bool)
changed tovoid bitwuzla_parser_parse(BitwuzlaParser*, const char*, bool, bool, const char*)
. - New function
const char* bitwuzla_parser_get_error_msg(BitwuzlaParser*)
to query error message. - New function
BitwuzlaTerm bitwuzla_parser_parse_term(BitwuzlaParser*, const char*, const char*)
to parse a term from string. - New function
BitwuzlaSort bitwuzla_parser_parse_sort(BitwuzlaParser*, const char*, const char*)
to parse a sort from string.
- Function
- Python API:
- Class
Parser
is now constructed from options, a language and a base for the string representation of bit-vector values (does not require an input file name anymore). - Function
Parser.parse(self, parse_only: bool) -> str
changed toParser.parse(self, infile_name, parse_only: bool, parse_file: bool) -> bool
. - New function
parse_term(self, iinput) -> Term
to parse term from string. - New function
parse_sort(self, iinput) -> Sort
to parse sort form string.
- Class
- Fix special case handling for equality over constant arrays.
-
Added option
-M
/--memory-limit
to set memory limit. -
Printer: Fix printing of empty formulas.
-
SMT2 Parser: Fix error handling for indexed bit-vector values.
-
Allow special case for equality over constant arrays. This is part of ongoing work towards generally allowing equality over constant arrays.
-
Added support for bit-vector overflow operator
bvnego
. -
Added
--lang
option for specifying input language. -
Added Windows cross-compilation support (configure flag:
--win64
). -
Python API changes:
- Simplified Function
mk_bv_value(sort: Sort, value, uint8_t base = 2)
, changed tomk_bv_value(sort: Sort, value, *args)
to allow, e.g.,mk_bv_value(s, 2)
to create a bit-vector value representation2
of sorts
instead ofmk_bv_value(s, 2, 10)
. - Added support for term substitution via functions
substitute_term()
andsubstitute_terms()
.
- Simplified Function
-
C API changes:
- Functions
bitwuzla_substitute_term()
andbitwuzla_substitute_terms()
do not require the (previously already unused)Bitwuzla*
argument anymore.bitwuzla_substitute_term(Bitwuzla*, BitwuzlaTerm, size_t, BitwuzlaTerm[], BitwuzlaTerm[])
changed tobitwuzla_substitute_term(BitwuzlaTerm, size_t, BitwuzlaTerm[], BitwuzlaTerm[])
bitwuzla_substitute_terms(Bitwuzla*, BitwuzlaTerm[], size_t, BitwuzlaTerm[], BitwuzlaTerm[])
changed tobitwuzla_substitute_term(BitwuzlaTerm[], size_t, BitwuzlaTerm[], BitwuzlaTerm[])
- Functions
-
Internally, options now have a notion of "user configured". If an option was configured by the user, it will not be reconfigured internally. Previously, we did not reconfigure any options, but now we set defaults in case the BV solver is configured in "preprop" mode.
-
Python API changes:
- New function
Bitwuzla.print_formula()
returns the current input formula as a string in the given format (currently, as in the C++/C APIs, only SMT-LIB2 is supported). This function can optionally be configured with a bv output number format. - Enum values for Kind, Result and RoundingMode can now be converted to their string representation via str().
- Added support for input file parsing.
- New function
Options.is_valid()
allows to query if a given options name is valid. Term.value()
now allows to retrieve FP values as a list of sign, exponent and significand bit-vector strings.- New function
Bitwuzla::statistics()
allows to retrieve the current statistics as a dictionary that maps statistic name to value (strings).
- New function
-
Bitwuzla now supports configuring the output number format for bit-vector values. This is configured via the CLI option
--bv-output-format
, or via the output stream modifierbitwuzla::set_bv_format
when printing bit-vector values via the API.- C API changes:
bitwuzla_term_value_get_str(BitwuzlaTerm, uint8_t)
changed to
bitwuzla_term_value_get_str(BitwuzlaTerm)
:
The parameter to configure the bv output number format when getting the string representation of a term is now dropped to simplify the default case. New API functionbitwuzla_term_value_get_str_fmt(BitwuzlaTerm, uint8_t)
now offers the previous behavior of this function.- New API function
bitwuzla_term_to_string_fmt(BitwuzlaTerm, uint8_t)
allows to configure the bv output number format when getting the string representation of a term. - New API function
bitwuzla_term_print_fmt(BitwuzlaTerm, FILE*, uint8_t)
allows to configure the bv output number format when printing terms. Functionbitwuzla_term_print(BitwuzlaTerm)
remains unchanged and, as previously, defaults to binary bit-vector output format. bitwuzla_term_print_formula(Bitwuzla*, const char*, FILE*)
changed to
bitwuzla_term_print_formula(Bitwuzla*, const char*, FILE*, uint8_t)
:
The bv output number format when printing the currently asserted input formula can now be configured via (new, required) parameteruint8_t base
.bitwuzla_parser_new(BitwuzlaOptions*, const char*, FILE*, const char*)
changed to
bitwuzla_parser_new(BitwuzlaOptions*, const char*, FILE*, const char*, uint8_t, const char*)
BitwuzlaParser
is now configured with a bv output number format (when printing model values) via (new, required) parameteruint8_t base
, and the name of the output file (<stdout>
to usestdout
) via (new, required) parameterconst char* outfile_name
.- Renamed
BitwuzlaOptionInfo.desc
todescription
for consistency between C and C++ API.
- C++ API changes:
- New stream modifier
set_bv_format(uint8_t)
allows to configure the output number format of bit-vector values of any output stream. Term::str()
now takes an optional parameteruint8_t base
(default: binary) to configure the bv output number format in the string representation of the term.bitwuzla::Parser
can now be configured with an output stream.
- New stream modifier
- Python API changes:
- New function
Term.str()
, which takes an optional parameterbase
(default: binary) to configure the bv output number format in the string representation of the term. FunctionTerm.__str__()
uses default binary bv output number format.
- New function
- C API changes:
-
The SMT2 parser is now less restrictive with respect to setting unsupported options and using unsupported annotation attributes. This is now ignored (with a warning at verbosity level > 0) rather than rejected with an error.
-
Added command line option -t/--time-limit for specifying a time limit for the overall runtime of the binary.
-
Added library option -T/--time-limit-per for specifying a time limit per satisfiability check.
-
Command line option --verbose renamed to --verbosity for consistency with option kind.
Various fixes.
Bitwuzla release 0.1.0 is a complete from-scratch rewrite in C++.
A comprehensive system description was presented at CAV 2023:
Aina Niemetz and Mathias Preiner. Bitwuzla. CAV 2023, Springer, 2023.
Bitwuzla now provides a C++ API as its main API, with a Python and C API based on top of it. Compared to commit 1230d80, the C API has been slightly simplified and refactored. All three APIs can be considered largely stable, and will be locked in for release 1.0.
The most notable user-visible changes are listed below.
- Bitwuzla now uses meson as build system.
- Bitwuzla supports SMT-LIB v2 and BTOR2 as input languages. Support for BTOR has been dropped.
- Terms and sorts are now independent from a solver instance and can be shared across instances.
-
Incremental solving is now always enabled and thus option
INCREMENTAL
is removed. -
SMT-LIB option
:produce-unsat-assumptions
was previously always enabled, but must now be explicitly enabled via optionPRODUCE_UNSAT_ASSUMPTIONS
. -
Option
SAT_ENGINE
has been renamed toSAT_SOLVER
. -
Option
RW_LEVEL
has been renamed toREWRITE_LEVEL
. -
Bitwuzla solver instances are created from an options instance, and this options instance must be configured prior to creating the solver instance. After creating the solver instance, configuration options are frozen.
-
Preprocessing API calls do not return a result anymore (
bitwuzla_simplify
in the C API,Bitwuzla::simplify
in the C++ API,Bitwuzla.simplify
in the Python API). -
Preprocessin is now fully incremental. All preprocessing passes are applied to the current set of assertions, from all assertion levels (including assumptions), and simplifications derived from lower levels are applied to all assertions of higher levels.
-
A
Bitwuzla
instance is now created from aBitwuzlaOptions
instance, which must be configured prior to creating the solver instance.Bitwuzla
andBitwuzlaOptions
instances are created and deleted via:bitwuzla_options_new()
bitwuzla_options_delete(BitwuzlaOptions*)
bitwuzla_new(BitwuzlaOptions*)
bitwuzla_delete(Bitwuzla*)
(as before)
-
BitwuzlaTerm
is now auint64_t
instead of an anonymous struct. -
BitwuzlaSort
is now auint64_t
instead of an anonymous struct. -
All functions with
const BitwuzlaTerm*
andconst BitwuzlaSort*
as arguments, now takeBitwuzlaTerm
andBitwuzlaSort
as arguments. -
struct
BitwuzlaOptionInfo
:- struct
string
has been renamed tomode
- The following fields in struct
numeric
have been renamed:cur_val
tocur
def_val
todflt
min_val
tomin
max_val
tomax
- The following fields in struct
string
(nowmode
) have been renamed:cur_val
tocur
def_val
todflt
num_values
tonum_modes
values
tomodes
- struct
-
Functions to set and get options (and option info data) changed their signature and/or have been renamed. In particular, they now take a
BitwuzlaOptions*
instead ofBitwuzla*
as argument:- Create options instance with
bitwuzla_options_new()
- Delete options instance with
bitwuzla_options_delete(BitwuzlaOptions*)
uint32_t bitwuzla_get_option(Bitwuzla*, BitwuzlaOption)
changed to
uint64_t bitwuzla_get_oiption(BitwuzlaOptions, BitwuzlaOption)
const char* bitwuzla_get_option_str(Bitwuzla*, BitwuzlaOption)
changed to
const char* bitwuzla_get_oiption(BitwuzlaOptions, BitwuzlaOption)
bitwuzla_set_option(Bitwuzla*, BitwuzlaOption, uint32_t)
changed to
bitwuzla_set_option(BitwuzlaOptions*, BitwuzlaOption, uint64_t)
bitwuzla_set_option_str(Bitwuzla*, BitwuzlaOption, const char*)
changed to
bitwuzla_set_option_mode(BitwuzlaOptions, BitwuzlaOption, const char*)
bitwuzla_get_option_info(Bitwuzla*, BitwuzlaOption, BitwuzlaOptionInfo*)
changed to
bitwuzla_get_option_info(BitwuzlaOptions*, BitwuzlaOption, BitwuzlaOptionInfo*)
- Create options instance with
-
The following kinds (enum
BitwuzlaKind
) have been renamed:BITWUZLA_KIND_CONST
toBITWUZLA_KIND_CONSTANT
BITWUZLA_KIND_VAL
toBITWUZLA_KIND_VALUE
BITWUZLA_KIND_VAR
toBITWUZLA_KIND_VARIABLE
BITWUZLA_KIND_FP_EQ
toBITWUZLA_KIND_FP_EQUAL
-
enum
BitwuzlaBVBase
has been removed and replaced withuint8_t
in { 2, 10, 16 }. The signatures of the following functions has changed:bitwuzla_mk_bv_value(Bitwuzla*, const BitwuzlaSort*, const char*, BitwuzlaBVBase)
has changed tobitwuzla_mk_bv_value(BitwuzlaSort, const char*, uint8_t)
-
The following API functions have been renamed:
bitwuzla_mk_fp_value_from_real
tobitwuzla_mk_fp_from_real
bitwuzla_mk_fp_value_from_rational
tobitwuzla_mk_fp_from_rational
bitwuzla_dump_formula
tobitwuzla_print_formula
bitwuzla_sort_dump
tobitwuzla_print_sort
bitwuzla_term_dump
tobitwuzla_print_term
-
bitwuzla_print_formula
currently only supports printing the current input formula in SMT-LIB format. Support for printing the circuit representation of the (bit-vector abstraction) of the current input formula in AIGER format as well as printing its CNF representation are planned. -
bitwuzla_term_print
andbitwuzla_sort_print
allow printing terms and sorts in SMT-LIB format only (previously, viabitwuzla_term_dump
andbitwuzla_sort_dump
, it was also possible to print them in the now unsupported BTOR format). -
The following API functions changed their signature:
- All
bitwuzla_mk_*
functions do not requireBitwuzla*
as argument anymore. bitwuzla_push(Bitwuzla*, uint32_t)
changed tobitwuzla_push(Bitwuzla*, uint64_t)
bitwuzla_pop(Bitwuzla*, uint32_t)
changed tobitwuzla_pop(Bitwuzla*, uint64_t)
bitwuzla_get_unsat_assumptions
now returns aBitwuzlaTerm*
instead ofconst BitwuzlaTerm**
bitwuzla_get_unsat_core
now returns aBitwuzlaTerm*
instead ofconst BitwuzlaTerm**
bitwuzla_sort_get_fun_get_domain_sorts
now returns aBitwuzlaTerm*
instead ofconst BitwuzlaTerm**
BitwuzlaResult simplify(Bitwuzla*)
changed tovoid simplify(Bitwuzla*)
- All
-
Removed support for
bitwuzla_assume
, solving under assumptions is now available via new API functionbitwuzla_check_sat_assuming(Bitwuzla*, uint32_t, BitwuzlaTerm[])
-
Removed support for obsolete functions
bitwuzla_fixate_assumptions
bitwuzla_reset_assumptions
-
Removed support for
bitwuzla_term_set_symbol
-
Removed support for
bitwuzla_get_array_value
, usebitwuzla_get_value
in combination withbitwuzla_term_value_get_*
instead -
Removed support for
bitwuzla_get_bv_value
, usebitwuzla_get_value
in combination withbitwuzla_term_value_get_str
instead -
Removed support for
bitwuzla_get_fp_value
, usebitwuzla_get_value
(in combination withbitwuzla_term_value_get_str
) orbitwuzla_term_value_get_fp_ieee
instead -
Removed support for
bitwuzla_get_fun_value
, usebitwuzla_get_value
in combination withbitwuzla_term_value_get_*
instead -
Renamed
bitwuzla_get_rm_value
tobitwuzla_term_value_get_rm
, now returns aBitwuzlaRoundingMode
instead ofconst char*
. For a string representation, usebitwuzla_get_value
in combination withbitwuzla_term_value_get_str
. -
Removed support for
bitwuzla_print_model
, seeexamples/c/quickstart.c
for an example of how to print the model. -
Removed support for
bitwuzla_reset
, discard current Bitwuzla instance and create new instance (with a new options instance) instead. Note: terms and sorts are not associated with a solver instance and will not be released when the current instance is released. Seeexamples/c/reset.c
for an example of how to reset a solver instance. -
SMT-LIB command
reset-assertions
is similarly simulated via discarding the current Bitwuzla instance and creating new instance with the same options instance instead. Note: terms and sorts are not associated with a solver instance and will not be released when the current instance is released. Seeexamples/c/reset_assertions.c
for an example of how to realize SMT-LIB commandreset-assertions
. -
The following parse functions are replaced by the new parser API (see below):
bitwuzla_parse
bitwuzla_parse_format
-
New API functions:
bitwuzla_option_is_numeric(BitwuzlaOptions*, BitwuzlaOption)
bitwuzla_option_is_mode(BitwuzlaOptions*, BitwuzlaOption)
bitwuzla_check_sat_assuming(Bitwuzla*, uint32_t, BitwuzlaTerm[])
bitwuzla_term_value_get_bool(BitwuzlaTerm)
bitwuzla_term_value_get_str(BitwuzlaTerm, uint8_t)
bitwuzla_term_value_get_rm(BitwuzlaTerm)
bitwuzla_term_to_string(BitwuzlaTerm term)
bitwuzla_sort_to_string(BitwuzlaSort sort)
bitwuzla_mk_uninterpreted_sort()
bitwuzla_sort_is_uninterpreted()
bitwuzla_term_is_uninterpreted()
bitwuzla_sort_get_uninterpreted_symbol(BitwuzlaSort)
bitwuzla_get_statistics()
- Module renamed to
bitwuzla
frompybitwuzla
- Functions and classes now reflect the functionality of the new C++ API
Bitwuzla now provides a clean C and C++ API for parsing input files. This API will be extended with support for parsing terms and sorts from strings in the future. Python bindings for the parser API will be made available in the future.
The C parser API is available at include/bitwuzla/c/parser.h
and the C++
parser API is available at include/bitwuzla/cpp/parser.h
.