Releases: bitwuzla/bitwuzla
Release 0.4.0
-
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 to
Bitwuzla(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 to
bitwuzla_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)
and
bitwuzla_term_release(BitwuzlaTerm)
for
incrementing/decrementing BitwuzlaTerm reference counts. - New functions
bitwuzla_sort_copy(BitwuzlaSort)
and
bitwuzla_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 to
Bitwuzla(TermManager, Options)
. - New function
Bitwuzla::term_mgr()
to retrieve configured term manager
instance.
- New class
- Solver and parser instances now require a term manager for initialization.
-
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 to
void 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
BitwulzaParser* bitwuzla_parser_new(BitwuzlaOptions*, const char*, FILE*, const char*, uint8_t, const char*)
changed toBitwulzaParser* bitwuzla_parser_new(BitwuzlaTermManager*, BitwuzlaOptions*, const char*, uint8_t, const char*)
. - Function
const char* bitwuzla_parser_parse(BitwulzaParser*, bool)
changed tovoid bitwuzla_parser_parse(BitwulzaParser*, 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 to
Parser.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
Release 0.3.2
- Fix special case handling for equality over constant arrays.
Release 0.3.1
- 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.
Release 0.3.0
-
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.
Release 0.2.0
-
Python API changes:
* New functionBitwuzla.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 functionOptions.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 functionBitwuzla::statistics()
allows to retrieve the current statistics as a dictionary that maps statistic name to value (strings).-
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 tobitwuzla_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 tobitwuzla_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 tobitwuzla_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.
-
Release 0.1.1
Various fixes.
Release 0.1.0
Changes since commit 1230d80
Bitwuzla release 0.1.0 is a complete from-scratch rewrite in C++.
A comprehensive system description will be 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.
Build System
- Bitwuzla now uses meson as build system.
Input Languages
- Bitwuzla supports SMT-LIB v2 and BTOR2 as input languages. Support for BTOR has been dropped.
Term/Sort Handling and Multiple Solver Instances
- Terms and sorts are now independent from a solver instance and can be shared across instances.
Configuration Options
-
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
-
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.
C API
-
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
tobitwulza_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 function
bitwuzla_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
) or
bitwuzla_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()
Python API
- Module renamed to
bitwuzla
frompybitwuzla
- Functions and classes now reflect the functionality of the new C++ API
Parser 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 fu...