Go to the source code of this file.
#define BOOLECTOR_SAT 10 |
Preprocessor constant representing status 'satisfiable'.
#define BOOLECTOR_UNSAT 20 |
Preprocessor constant representing status 'unsatisfiable'.
Btor* boolector_new | ( | void | ) |
Creates new instance of Boolector.
void boolector_enable_model_gen | ( | Btor * | btor | ) |
Enables model generation. If you want Boolector to produce a model in the satisfiable case, call this function after boolector_new.
btor | Boolector instance. |
void boolector_enable_inc_usage | ( | Btor * | btor | ) |
Enables incremental usage of Boolector. This allows to add assumptions by boolector_assume and to call boolector_sat multiple times. Note that this mode turns off some optimization techniques that cannot be applied anymore.
btor | Boolector instance. |
void boolector_set_rewrite_level | ( | Btor * | btor, | |
int | rewrite_level | |||
) |
Sets the rewrite level of the rewriting engine. Boolector uses rewrite level 3 per default. Call this function before creating any expressions.
btor | Boolector instance. | |
rewrite_level | Rewrite level ranging from 0 (no rewriting) to 3 (full rewriting). |
int boolector_get_refs | ( | Btor * | btor | ) |
Returns the number of external references to the boolector library. Internally, Boolector manages an expression DAG with reference counting. Use boolector_release to properly release an expression. Before you finally call boolector_delete, boolector_get_refs should return 0.
btor | Boolector instance. |
void boolector_delete | ( | Btor * | btor | ) |
Bit-vector constant representing the bit-vector 'bits'.
btor | Boolector instance. | |
bits | Non-empty and terminated string consisting of zeroes and/or ones. representing the bit-vector constant specified by 'bits'. |
Bit-vector constant zero with bit-width one.
btor | Boolector instance. |
Binary constant representing 'width' ones.
btor | Boolector instance. | |
width | Number of bits which must be greater than zero. |
Bit-vector constant one with bit-width one.
btor | Boolector instance. |
Bit-vector constant one.
btor | Boolector instance. | |
width | Number of bits which must be greater than zero. |
Binary constant representing the unsigned integer 'u' with bit-width 'width'. The constant is obtained by either truncating bits or by unsigned extension (padding with zeroes).
btor | Boolector instance. | |
u | Unsigned integer value. | |
width | Number of bits which must be greater than zero. |
Binary constant representing the signed integer 'i' with bit-width 'width'. The constant is obtained by either truncating bits or by signed extension (padding with ones).
btor | Boolector instance. | |
i | Signed integer value. | |
width | Number of bits which must be greater than zero. |
Fresh bit-vector variable with bit-width 'width'.
btor | Boolector instance. | |
width | Number of bits which must be greater than zero. | |
symbol | Name of variable. |
One-dimensional bit-vector array of size 2 ^ 'index_width' with elements of bit-width 'elem_width'.
btor | Boolector instance. | |
elem_width | Number of bits of array elements. The parameter must be greater than zero. | |
index_width | Number of bits of array addresses. The parameter must be greater than zero. | |
symbol | Name of variable. |
Two's complement.
btor | Boolector instance. | |
exp | Bit-vector operand. |
Or reduction. All bits are combined by or.
btor | Boolector instance. | |
exp | Bit-vector operand. |
Xor reduction. All bits are combined by xor.
btor | Boolector instance. | |
exp | Bit-vector operand. |
And reduction. All bits are combined by and.
btor | Boolector instance. | |
exp | Bit-vector operand. |
Bit-vector slice of 'exp' from index 'upper' to index 'lower'.
btor | Boolector instance. | |
exp | Bit-vector operand. | |
upper | Upper index which must be greater than or equal to zero, and less than the bit-width of 'exp'. | |
lower | Lower index which must be greater than or equal to zero, and less than or equal to 'upper'. |
Unsigned extension. The operand 'exp' is padded with 'width' zeroes.
btor | Boolector instance. | |
exp | Bit-vector operand. | |
width | Number of zeroes to pad. |
Signed extension. The operand 'exp' is padded with 'width' bits. If zeroes or ones are padded depends on the most significant bit of 'exp'.
btor | Boolector instance. | |
exp | Bit-vector operand. | |
width | Number of bits to pad. |
Implication. The parameters * 'e0' and 'e1' must have bit-width one.
btor | Boolector instance. | |
e0 | First bit-vector operand. | |
e1 | Second bit-vector operand. |
Equivalence. The parameters 'e0' and 'e1' must have bit-width one.
btor | Boolector instance. | |
e0 | First bit-vector operand. | |
e1 | Second bit-vector operand. |
Xor. The parameters 'e0' and 'e1' must have the same bit-width.
btor | Boolector instance. | |
e0 | First bit-vector operand. | |
e1 | Second bit-vector operand. |
Xnor. The parameters 'e0' and 'e1' must have the same bit-width.
btor | Boolector instance. | |
e0 | First bit-vector operand. | |
e1 | Second bit-vector operand. |
Nand. The parameters 'e0' and 'e1' must have the same bit-width.
btor | Boolector instance. | |
e0 | First bit-vector operand. | |
e1 | Second bit-vector operand. |
Or. The parameters 'e0' and 'e1' must have the same bit-width.
btor | Boolector instance. | |
e0 | First bit-vector operand. | |
e1 | Second bit-vector operand. |
Nor. The parameters 'e0' and 'e1' must have the same bit-width.
btor | Boolector instance. | |
e0 | First bit-vector operand. | |
e1 | Second bit-vector operand. |
Inequality. Either both operands are bit-vectors with the same bit-with or both operands are arrays of the same type.
btor | Boolector instance. | |
e0 | First operand. | |
e1 | Second operand. |
Addition. The parameters 'e0' and 'e1' must have the same bit-width.
btor | Boolector instance. | |
e0 | First bit-vector operand. | |
e1 | Second bit-vector operand. |
Unsigned addition overflow detection. The result represents if the addition overflows when both operands are interpreted as unsigned. The parameters 'e0' and 'e1' must have the same bit-width.
btor | Boolector instance. | |
e0 | First bit-vector operand. | |
e1 | Second bit-vector operand. |
Signed addition overflow detection. The result represents if the addition overflows when both operands are interpreted as signed. The parameters 'e0' and 'e1' must have the same bit-width.
btor | Boolector instance. | |
e0 | First bit-vector operand. | |
e1 | Second bit-vector operand. |
Multiplication. The parameters 'e0' and 'e1' must have the same bit-width.
btor | Boolector instance. | |
e0 | First bit-vector operand. | |
e1 | Second bit-vector operand. |
Unsigned multiplication overflow detection. The result represents if the multiplication overflows when both operands are interpreted as unsigned. The parameters 'e0' and 'e1' must have the same bit-width.
btor | Boolector instance. | |
e0 | First bit-vector operand. | |
e1 | Second bit-vector operand. |
Signed multiplication overflow detection. The result represents if the multiplication overflows when both operands are interpreted as signed. The parameters 'e0' and 'e1' must have the same bit-width.
btor | Boolector instance. | |
e0 | First bit-vector operand. | |
e1 | Second bit-vector operand. |
Unsigned less than. The parameters 'e0' and 'e1' must have the same bit-width.
btor | Boolector instance. | |
e0 | First bit-vector operand. | |
e1 | Second bit-vector operand. |
Signed less than. The parameters 'e0' and 'e1' must have the same bit-width.
btor | Boolector instance. | |
e0 | First bit-vector operand. | |
e1 | Second bit-vector operand. |
Unsigned less than or equal. The parameters 'e0' and 'e1' must have the same bit-width.
btor | Boolector instance. | |
e0 | First bit-vector operand. | |
e1 | Second bit-vector operand. |
Signed less than or equal. The parameters 'e0' and 'e1' must have the same bit-width.
btor | Boolector instance. | |
e0 | First bit-vector operand. | |
e1 | Second bit-vector operand. |
Unsigned greater than. The parameters 'e0' and 'e1' must have the same bit-width.
btor | Boolector instance. | |
e0 | First bit-vector operand. | |
e1 | Second bit-vector operand. |
Signed greater than. The parameters 'e0' and 'e1' must have the same bit-width.
btor | Boolector instance. | |
e0 | First bit-vector operand. | |
e1 | Second bit-vector operand. |
Unsigned greater than or equal. The parameters 'e0' and 'e1' must have the same bit-width.
btor | Boolector instance. | |
e0 | First bit-vector operand. | |
e1 | Second bit-vector operand. |
Signed greater than or equal. The parameters 'e0' and 'e1' must have the same bit-width.
btor | Boolector instance. | |
e0 | First bit-vector operand. | |
e1 | Second bit-vector operand. |
Shift left.
btor | Boolector instance. | |
e0 | First bit-vector operand where the bit-width is a power of two and greater than 1. | |
e1 | Second bit-vector operand with bit-width log2 of the bit-width of 'e0'. |
Shift right logical. Zeroes are shifted in.
btor | Boolector instance. | |
e0 | First bit-vector operand where the bit-width is a power of two and greater than 1. | |
e1 | Second bit-vector operand with bit-width log2 of the bit-width of 'e0'. |
Shift right arithmetic. Whether zeroes or ones are shifted in depends on the most significant bit of 'e0'.
btor | Boolector instance. | |
e0 | First bit-vector operand where the bit-width is a power of two and greater than 1. | |
e1 | Second bit-vector operand with bit-width log2 of the bit-width of 'e0'. |
Rotate left.
btor | Boolector instance. | |
e0 | First bit-vector operand where the bit-width is a power of two and greater than 1. | |
e1 | Second bit-vector operand with bit-width log2 of the bit-width of 'e0'. |
Rotate right.
btor | Boolector instance. | |
e0 | First bit-vector operand where the bit-width is a power of two and greater than 1. | |
e1 | Second bit-vector operand with bit-width log2 of the bit-width of 'e0'. |
Subtraction. The parameters 'e0' and 'e1' must have the same bit-width.
btor | Boolector instance. | |
e0 | First bit-vector operand. | |
e1 | Second bit-vector operand. |
Unsigned subtraction overflow detection. The result represents if the subtraction overflows when both operands are interpreted as unsigned. The parameters 'e0' and 'e1' must have the same bit-width.
btor | Boolector instance. | |
e0 | First bit-vector operand. | |
e1 | Second bit-vector operand. |
Signed subtraction overflow detection. The result represents if the subtraction overflows when both operands are interpreted as signed. The parameters 'e0' and 'e1' must have the same bit-width.
btor | Boolector instance. | |
e0 | First bit-vector operand. | |
e1 | Second bit-vector operand. |
Unsigned division. The parameters 'e0' and 'e1' must have the same bit-width. If 'e1' is zero, then the result is -1.
btor | Boolector instance. | |
e0 | First bit-vector operand. | |
e1 | Second bit-vector operand. |
Signed division. The parameters 'e0' and 'e1' must have the same bit-width.
btor | Boolector instance. | |
e0 | First bit-vector operand. | |
e1 | Second bit-vector operand. |
Signed division overflow detection. The result represents if the division overflows when both operands are interpreted as signed. This happens when 'e0' represents INT_MIN and 'e1' represents -1. The parameters 'e0' and 'e1' must have the same bit-width.
btor | Boolector instance. | |
e0 | First bit-vector operand. | |
e1 | Second bit-vector operand. |
Unsigned remainder. The parameters 'e0' and 'e1' must have the same bit-width. If 'e1' is zero, then the result is 'e0'.
btor | Boolector instance. | |
e0 | First bit-vector operand. | |
e1 | Second bit-vector operand. |
Signed remainder. The parameters 'e0' and 'e1' must have the same bit-width. If 'e1' is zero, then the result is 'e0'.
btor | Boolector instance. | |
e0 | First bit-vector operand. | |
e1 | Second bit-vector operand. |
Signed remainder where sign follows divisor. The parameters 'e0' and 'e1' must have the same bit-width.
btor | Boolector instance. | |
e0 | First bit-vector operand. | |
e1 | Second bit-vector operand. |
Concatenation.
btor | Boolector instance. | |
e0 | First bit-vector operand. | |
e1 | Second bit-vector operand. |
Array read on array 'e_array' at position 'e_index'.
btor | Boolector instance. | |
e_array | Array operand. | |
e_index | Bit-vector index. The bit-width of 'e_index' must have the same bit-width as the indices of 'e_array'. return Bit-vector with the same bit-width as the elements of 'e_array'. |
Array write on array 'e_array' at position 'e_index' with value 'e_value'. The array is updated at one position. All other elements remain the same.
btor | Boolector instance. | |
e_array | Array operand. | |
e_index | Bit-vector index. The bit-width of 'e_index' must have the same bit-width as the indices of 'e_array'. | |
e_value | Bit-vector value. The bit-width of 'e_value' must have the same bit-width as the elements of 'e_array'. |
If-then-else. If the condition 'e_cond' is one, then 'e_if' is returned, otherwise 'e_else'. Either 'e_if' and 'e_else' must be both arrays, or they must be both bit-vectors.
btor | Boolector instance. | |
e_cond | Bit-vector condition with bit-width one. | |
e_if | Operand returned in the if case. | |
e_else | Operand returned in the else case. |
Increments bit-vector by one.
btor | Boolector instance. | |
exp | Bit-vector operand. |
Decrements bit-vector by one.
btor | Boolector instance. | |
exp | Bit-vector operand. |
Determines if expression is an array. If not, expression is a bit-vector.
btor | Boolector instance. | |
exp | Operand. |
Gets the bit-width of an expression. If the expression is an array, it returns the bit-width of the array elements.
btor | Boolector instance. | |
exp | Operand. |
Gets the bit-width of indices of 'e_array'.
btor | Boolector instance. | |
e_array | Array operand. |
Gets the symbol of a variable.
btor | Boolector instance. | |
var | Array or bit-vector variable. |
Copies expression (increments reference counter).
btor | Boolector instance. | |
exp | Operand. |
Recursively dumps expression to file. BTOR is used as format.
btor | Boolector instance. | |
file | File to which the expression should be dumped. The file must be have been opened by the user before. | |
exp | The expression which should be dumped. |
Recursively dumps expression to file. SMT-LIB 1.2 is used as format.
btor | Boolector instance. | |
file | File to which the expression should be dumped. The file must be have been opened by the user before. | |
exp | The expression which should be dumped. |
Adds constraint. Use this function to assert 'exp'. Added constraints can not be deleted anymore. After 'exp' has been asserted, it can be safely released by boolector_release.
btor | Boolector instance. | |
exp | Bit-vector expression with bit-width one. |
Adds assumption. Use this function to assume 'exp'. You must enable Boolector's incremental usage by calling boolector_enable_inc_usage before. In contrast to boolector_assert the assumptions are discarded after each call to boolector_sat. Assumptions and assertions are logically combined by boolean 'and'. This is the same way of using assumptions as in MiniSAT.
btor | Boolector instance. | |
exp | Bit-vector expression with bit-width one. |
int boolector_sat | ( | Btor * | btor | ) |
Solves SAT instance represented by constraints and assumptions added by boolector_assert and boolector_assume. Note that assertions and assumptions are combined by boolean 'and'. If you want to call this function multiple times then you must enable Boolector's incremental usage mode by calling boolector_enable_inc_usage before. Otherwise, this function can only be called once.
btor | Boolector instance. |
Builds assignment string for bit-vector expression if boolector_sat has returned BOOLECTOR_SAT and model generation has been enabled. The expression can be an arbitrary bit-vector expression which occurs in an assertion or current assumption. The assignment string has to be freed by boolector_free_bv_assignment.
btor | Boolector instance. | |
exp | Bit-vector expression. |
void boolector_array_assignment | ( | Btor * | btor, | |
BtorExp * | e_array, | |||
char *** | indices, | |||
char *** | values, | |||
int * | size | |||
) |
Builds a model for an array expression. if boolector_sat has returned BOOLECTOR_SAT and model generation has been enabled. The function creates and stores the array of indices into 'indices' and the array of corresponding values into 'values'. The number size of 'indices' resp. 'values' is stored into 'size'. The array model simply inspects the set of reads rho, which is associated with each array expression. See our publication Lemmas on Demand for the Extensional Theory of Arrays for details. At indices that do not occur in the model, it is assumed that the array stores a globally unique default value, for example 0. The bit-vector assignments to the indices and values have to be freed by boolector_free_bv_assignment. Furthermore, the user has to free the array of indices and the array of values, respectively of size 'size'.
btor | Boolector instance. | |
e_array | Array operand for which the array model should be built. | |
indices | Pointer to array of index strings. | |
values | Pointer to array of value strings. | |
size | Pointer to size. |
void boolector_free_bv_assignment | ( | Btor * | btor, | |
char * | assignment | |||
) |
Frees an assignment string for bit-vectors.
btor | Boolector instance. | |
assignment | String which has to be freed. |