include/boolector.h File Reference

Go to the source code of this file.

Defines

#define BOOLECTOR_SAT   10
#define BOOLECTOR_UNSAT   20

Typedefs

typedef struct BtorExp BtorExp
typedef struct Btor Btor

Functions

Btorboolector_new (void)
void boolector_enable_model_gen (Btor *btor)
void boolector_enable_inc_usage (Btor *btor)
void boolector_set_rewrite_level (Btor *btor, int rewrite_level)
int boolector_get_refs (Btor *btor)
void boolector_delete (Btor *btor)
BtorExpboolector_const (Btor *btor, const char *bits)
BtorExpboolector_zero (Btor *btor, int width)
BtorExpboolector_false (Btor *btor)
BtorExpboolector_ones (Btor *btor, int width)
BtorExpboolector_true (Btor *btor)
BtorExpboolector_one (Btor *btor, int width)
BtorExpboolector_unsigned_int (Btor *btor, unsigned u, int width)
BtorExpboolector_int (Btor *btor, int i, int width)
BtorExpboolector_var (Btor *btor, int width, const char *symbol)
BtorExpboolector_array (Btor *btor, int elem_width, int index_width, const char *symbol)
BtorExpboolector_not (Btor *btor, BtorExp *exp)
BtorExpboolector_neg (Btor *btor, BtorExp *exp)
BtorExpboolector_redor (Btor *btor, BtorExp *exp)
BtorExpboolector_redxor (Btor *btor, BtorExp *exp)
BtorExpboolector_redand (Btor *btor, BtorExp *exp)
BtorExpboolector_slice (Btor *btor, BtorExp *exp, int upper, int lower)
BtorExpboolector_uext (Btor *btor, BtorExp *exp, int width)
BtorExpboolector_sext (Btor *btor, BtorExp *exp, int width)
BtorExpboolector_implies (Btor *btor, BtorExp *e0, BtorExp *e1)
BtorExpboolector_iff (Btor *btor, BtorExp *e0, BtorExp *e1)
BtorExpboolector_xor (Btor *btor, BtorExp *e0, BtorExp *e1)
BtorExpboolector_xnor (Btor *btor, BtorExp *e0, BtorExp *e1)
BtorExpboolector_and (Btor *btor, BtorExp *e0, BtorExp *e1)
BtorExpboolector_nand (Btor *btor, BtorExp *e0, BtorExp *e1)
BtorExpboolector_or (Btor *btor, BtorExp *e0, BtorExp *e1)
BtorExpboolector_nor (Btor *btor, BtorExp *e0, BtorExp *e1)
BtorExpboolector_eq (Btor *btor, BtorExp *e0, BtorExp *e1)
BtorExpboolector_ne (Btor *btor, BtorExp *e0, BtorExp *e1)
BtorExpboolector_add (Btor *btor, BtorExp *e0, BtorExp *e1)
BtorExpboolector_uaddo (Btor *btor, BtorExp *e0, BtorExp *e1)
BtorExpboolector_saddo (Btor *btor, BtorExp *e0, BtorExp *e1)
BtorExpboolector_mul (Btor *btor, BtorExp *e0, BtorExp *e1)
BtorExpboolector_umulo (Btor *btor, BtorExp *e0, BtorExp *e1)
BtorExpboolector_smulo (Btor *btor, BtorExp *e0, BtorExp *e1)
BtorExpboolector_ult (Btor *btor, BtorExp *e0, BtorExp *e1)
BtorExpboolector_slt (Btor *btor, BtorExp *e0, BtorExp *e1)
BtorExpboolector_ulte (Btor *btor, BtorExp *e0, BtorExp *e1)
BtorExpboolector_slte (Btor *btor, BtorExp *e0, BtorExp *e1)
BtorExpboolector_ugt (Btor *btor, BtorExp *e0, BtorExp *e1)
BtorExpboolector_sgt (Btor *btor, BtorExp *e0, BtorExp *e1)
BtorExpboolector_ugte (Btor *btor, BtorExp *e0, BtorExp *e1)
BtorExpboolector_sgte (Btor *btor, BtorExp *e0, BtorExp *e1)
BtorExpboolector_sll (Btor *btor, BtorExp *e0, BtorExp *e1)
BtorExpboolector_srl (Btor *btor, BtorExp *e0, BtorExp *e1)
BtorExpboolector_sra (Btor *btor, BtorExp *e0, BtorExp *e1)
BtorExpboolector_rol (Btor *btor, BtorExp *e0, BtorExp *e1)
BtorExpboolector_ror (Btor *btor, BtorExp *e0, BtorExp *e1)
BtorExpboolector_sub (Btor *btor, BtorExp *e0, BtorExp *e1)
BtorExpboolector_usubo (Btor *btor, BtorExp *e0, BtorExp *e1)
BtorExpboolector_ssubo (Btor *btor, BtorExp *e0, BtorExp *e1)
BtorExpboolector_udiv (Btor *btor, BtorExp *e0, BtorExp *e1)
BtorExpboolector_sdiv (Btor *btor, BtorExp *e0, BtorExp *e1)
BtorExpboolector_sdivo (Btor *btor, BtorExp *e0, BtorExp *e1)
BtorExpboolector_urem (Btor *btor, BtorExp *e0, BtorExp *e1)
BtorExpboolector_srem (Btor *btor, BtorExp *e0, BtorExp *e1)
BtorExpboolector_smod (Btor *btor, BtorExp *e0, BtorExp *e1)
BtorExpboolector_concat (Btor *btor, BtorExp *e0, BtorExp *e1)
BtorExpboolector_read (Btor *btor, BtorExp *e_array, BtorExp *e_index)
BtorExpboolector_write (Btor *btor, BtorExp *e_array, BtorExp *e_index, BtorExp *e_value)
BtorExpboolector_cond (Btor *btor, BtorExp *e_cond, BtorExp *e_if, BtorExp *e_else)
BtorExpboolector_inc (Btor *btor, BtorExp *exp)
BtorExpboolector_dec (Btor *btor, BtorExp *exp)
int boolector_is_array (Btor *btor, BtorExp *exp)
int boolector_get_width (Btor *btor, BtorExp *exp)
int boolector_get_index_width (Btor *btor, BtorExp *e_array)
const char * boolector_get_symbol_of_var (Btor *btor, BtorExp *var)
BtorExpboolector_copy (Btor *btor, BtorExp *exp)
void boolector_release (Btor *btor, BtorExp *exp)
void boolector_dump_btor (Btor *btor, FILE *file, BtorExp *exp)
void boolector_dump_smt (Btor *btor, FILE *file, BtorExp *exp)
void boolector_assert (Btor *btor, BtorExp *exp)
void boolector_assume (Btor *btor, BtorExp *exp)
int boolector_sat (Btor *btor)
char * boolector_bv_assignment (Btor *btor, BtorExp *exp)
void boolector_array_assignment (Btor *btor, BtorExp *e_array, char ***indices, char ***values, int *size)
void boolector_free_bv_assignment (Btor *btor, char *assignment)


Define Documentation

#define BOOLECTOR_SAT   10

Preprocessor constant representing status 'satisfiable'.

See also:
boolector_sat
Examples:
array2.c, array3.c, and bv2.c.

#define BOOLECTOR_UNSAT   20

Preprocessor constant representing status 'unsatisfiable'.

See also:
boolector_sat
Examples:
array1.c, array3.c, and bv1.c.


Typedef Documentation

typedef struct BtorExp BtorExp

Examples:
array1.c, array2.c, array3.c, bv1.c, and bv2.c.

typedef struct Btor Btor

Examples:
array1.c, array2.c, array3.c, bv1.c, and bv2.c.


Function Documentation

Btor* boolector_new ( void   ) 

Creates new instance of Boolector.

Returns:
New Boolector instance.
Remarks:
At the moment Boolector does not support multiple instances. Boolector uses PicoSAT as backend which does not support multiple instances. However, we plan to support multiple instances in the future.
Examples:
array1.c, array2.c, array3.c, bv1.c, and bv2.c.

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.

Parameters:
btor Boolector instance.
See also:
boolector_sat
Examples:
array2.c, and bv2.c.

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.

Parameters:
btor Boolector instance.
Examples:
array3.c.

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.

Parameters:
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.

Parameters:
btor Boolector instance.
Returns:
Number of external references owned by the user.
Examples:
array1.c, array2.c, bv1.c, and bv2.c.

void boolector_delete ( Btor btor  ) 

Deletes boolector instance and frees its resources.

Parameters:
btor Boolector instance.
Remarks:
Expressions that have not been release properly will not be deleted from memory. Use boolector_get_refs to debug reference counting.
Examples:
array1.c, array2.c, array3.c, bv1.c, and bv2.c.

BtorExp* boolector_const ( Btor btor,
const char *  bits 
)

Bit-vector constant representing the bit-vector 'bits'.

Parameters:
btor Boolector instance.
bits Non-empty and terminated string consisting of zeroes and/or ones. representing the bit-vector constant specified by 'bits'.
Returns:
Bit-vector constant with bit-width strlen('bits').

BtorExp* boolector_zero ( Btor btor,
int  width 
)

Bit-vector constant zero.

Parameters:
btor Boolector instance.
width Number of bits which must be greater than zero.
Returns:
Bit-vector constant zero with bit-width 'width'.
Examples:
array2.c, and bv2.c.

BtorExp* boolector_false ( Btor btor  ) 

Bit-vector constant zero with bit-width one.

Parameters:
btor Boolector instance.
Returns:
Bit-vector constant zero with bit-width one.

BtorExp* boolector_ones ( Btor btor,
int  width 
)

Binary constant representing 'width' ones.

Parameters:
btor Boolector instance.
width Number of bits which must be greater than zero.
Returns:
Bit-vector constant -1 with bit-width 'width'.

BtorExp* boolector_true ( Btor btor  ) 

Bit-vector constant one with bit-width one.

Parameters:
btor Boolector instance.
Returns:
Bit-vector constant one with bit-width one.

BtorExp* boolector_one ( Btor btor,
int  width 
)

Bit-vector constant one.

Parameters:
btor Boolector instance.
width Number of bits which must be greater than zero.
Returns:
Bit-vector constant one with bit-width 'width'.
Examples:
array2.c.

BtorExp* boolector_unsigned_int ( Btor btor,
unsigned  u,
int  width 
)

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).

Parameters:
btor Boolector instance.
u Unsigned integer value.
width Number of bits which must be greater than zero.
Returns:
Bit-vector constant with bit-width 'width'.

BtorExp* boolector_int ( Btor btor,
int  i,
int  width 
)

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).

Parameters:
btor Boolector instance.
i Signed integer value.
width Number of bits which must be greater than zero.
Returns:
Bit-vector constant with bit-width 'width'.
Examples:
array1.c, and array2.c.

BtorExp* boolector_var ( Btor btor,
int  width,
const char *  symbol 
)

Fresh bit-vector variable with bit-width 'width'.

Parameters:
btor Boolector instance.
width Number of bits which must be greater than zero.
symbol Name of variable.
Returns:
Bit-vector variable with bit-width 'width' and symbol 'symbol'.
Remarks:
Internally, variables are not uniquely hashed. Therefore, every call to this function returns a fresh variable. The symbol is only used as a simple way to identify variables in file dumps of boolector_dump_btor and boolector_dump_smt. The user has to make sure that the symbols are unique. Otherwise, the dump may be incorrect. If you are not interested in dumping expressions, just pass NULL as symbol.
Examples:
array1.c, array3.c, bv1.c, and bv2.c.

BtorExp* boolector_array ( Btor btor,
int  elem_width,
int  index_width,
const char *  symbol 
)

One-dimensional bit-vector array of size 2 ^ 'index_width' with elements of bit-width 'elem_width'.

Parameters:
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.
Returns:
Bit-vector array of size 2 ^ 'index_width' with elements of bit-width 'elem_width', and symbol 'symbol'.
Remarks:
Internally, array variables are not uniquely hashed. Therefore, each call to boolector_array with the same arguments will return a fresh variable. The symbol is only used as a simple way to identify variables in file dumps of boolector_dump_btor and boolector_dump_smt. The user has to make sure that the symbols are unique. Otherwise, the dump may be incorrect. If you are not interested in dumping expressions, just pass NULL as symbol.
Examples:
array1.c, array2.c, and array3.c.

BtorExp* boolector_not ( Btor btor,
BtorExp exp 
)

One's complement.

Parameters:
btor Boolector instance.
exp Bit-vector operand.
Returns:
Bit-vector with the same bit-width as 'exp'.
Examples:
bv1.c, and bv2.c.

BtorExp* boolector_neg ( Btor btor,
BtorExp exp 
)

Two's complement.

Parameters:
btor Boolector instance.
exp Bit-vector operand.
Returns:
Bit-vector with the same bit-width as 'exp'.

BtorExp* boolector_redor ( Btor btor,
BtorExp exp 
)

Or reduction. All bits are combined by or.

Parameters:
btor Boolector instance.
exp Bit-vector operand.
Returns:
Bit-vector with bit-width one.

BtorExp* boolector_redxor ( Btor btor,
BtorExp exp 
)

Xor reduction. All bits are combined by xor.

Parameters:
btor Boolector instance.
exp Bit-vector operand.
Returns:
Bit-vector with bit-width one.

BtorExp* boolector_redand ( Btor btor,
BtorExp exp 
)

And reduction. All bits are combined by and.

Parameters:
btor Boolector instance.
exp Bit-vector operand.
Returns:
Bit-vector with bit-width one.

BtorExp* boolector_slice ( Btor btor,
BtorExp exp,
int  upper,
int  lower 
)

Bit-vector slice of 'exp' from index 'upper' to index 'lower'.

Parameters:
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'.
Returns:
Bit-vector with bit-width 'upper' - 'lower' + 1.

BtorExp* boolector_uext ( Btor btor,
BtorExp exp,
int  width 
)

Unsigned extension. The operand 'exp' is padded with 'width' zeroes.

Parameters:
btor Boolector instance.
exp Bit-vector operand.
width Number of zeroes to pad.
Returns:
Bit-vector with bit-width: bit-width of 'exp' + 'width'.

BtorExp* boolector_sext ( Btor btor,
BtorExp exp,
int  width 
)

Signed extension. The operand 'exp' is padded with 'width' bits. If zeroes or ones are padded depends on the most significant bit of 'exp'.

Parameters:
btor Boolector instance.
exp Bit-vector operand.
width Number of bits to pad.
Returns:
Bit-vector with bit-width: bit-width of 'exp' + 'width'.

BtorExp* boolector_implies ( Btor btor,
BtorExp e0,
BtorExp e1 
)

Implication. The parameters * 'e0' and 'e1' must have bit-width one.

Parameters:
btor Boolector instance.
e0 First bit-vector operand.
e1 Second bit-vector operand.
Returns:
Bit-vector with bit-width one.
Examples:
bv2.c.

BtorExp* boolector_iff ( Btor btor,
BtorExp e0,
BtorExp e1 
)

Equivalence. The parameters 'e0' and 'e1' must have bit-width one.

Parameters:
btor Boolector instance.
e0 First bit-vector operand.
e1 Second bit-vector operand.
Returns:
Bit-vector with bit-width one.

BtorExp* boolector_xor ( Btor btor,
BtorExp e0,
BtorExp e1 
)

Xor. The parameters 'e0' and 'e1' must have the same bit-width.

Parameters:
btor Boolector instance.
e0 First bit-vector operand.
e1 Second bit-vector operand.
Returns:
Bit-vector with the same bit-width as the operands.
Examples:
bv1.c.

BtorExp* boolector_xnor ( Btor btor,
BtorExp e0,
BtorExp e1 
)

Xnor. The parameters 'e0' and 'e1' must have the same bit-width.

Parameters:
btor Boolector instance.
e0 First bit-vector operand.
e1 Second bit-vector operand.
Returns:
Bit-vector with the same bit-width as the operands.

BtorExp* boolector_and ( Btor btor,
BtorExp e0,
BtorExp e1 
)

And. The parameters 'e0' and 'e1' must have the same bit-width.

Parameters:
btor Boolector instance.
e0 First bit-vector operand.
e1 Second bit-vector operand.
Returns:
Bit-vector with the same bit-width as the operands.
Examples:
bv1.c, and bv2.c.

BtorExp* boolector_nand ( Btor btor,
BtorExp e0,
BtorExp e1 
)

Nand. The parameters 'e0' and 'e1' must have the same bit-width.

Parameters:
btor Boolector instance.
e0 First bit-vector operand.
e1 Second bit-vector operand.
Returns:
Bit-vector with the same bit-width as the operands.

BtorExp* boolector_or ( Btor btor,
BtorExp e0,
BtorExp e1 
)

Or. The parameters 'e0' and 'e1' must have the same bit-width.

Parameters:
btor Boolector instance.
e0 First bit-vector operand.
e1 Second bit-vector operand.
Returns:
Bit-vector with the same bit-width as the operands.

BtorExp* boolector_nor ( Btor btor,
BtorExp e0,
BtorExp e1 
)

Nor. The parameters 'e0' and 'e1' must have the same bit-width.

Parameters:
btor Boolector instance.
e0 First bit-vector operand.
e1 Second bit-vector operand.
Returns:
Bit-vector with the same bit-width as the operands.

BtorExp* boolector_eq ( Btor btor,
BtorExp e0,
BtorExp e1 
)

Equality. Either both operands are bit-vectors with the same bit-with or both operands are arrays of the same type.

Parameters:
btor Boolector instance.
e0 First operand.
e1 Second operand.
Returns:
Bit-vector with bit-width one.
Examples:
array2.c, array3.c, and bv1.c.

BtorExp* boolector_ne ( Btor btor,
BtorExp e0,
BtorExp e1 
)

Inequality. Either both operands are bit-vectors with the same bit-with or both operands are arrays of the same type.

Parameters:
btor Boolector instance.
e0 First operand.
e1 Second operand.
Returns:
Bit-vector with bit-width one.
Examples:
array3.c.

BtorExp* boolector_add ( Btor btor,
BtorExp e0,
BtorExp e1 
)

Addition. The parameters 'e0' and 'e1' must have the same bit-width.

Parameters:
btor Boolector instance.
e0 First bit-vector operand.
e1 Second bit-vector operand.
Returns:
Bit-vector with the same bit-width as the operands.
Examples:
bv2.c.

BtorExp* boolector_uaddo ( Btor btor,
BtorExp e0,
BtorExp e1 
)

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.

Parameters:
btor Boolector instance.
e0 First bit-vector operand.
e1 Second bit-vector operand.
Returns:
Bit-vector with bit-width one.

BtorExp* boolector_saddo ( Btor btor,
BtorExp e0,
BtorExp e1 
)

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.

Parameters:
btor Boolector instance.
e0 First bit-vector operand.
e1 Second bit-vector operand.
Returns:
Bit-vector with bit-width one.

BtorExp* boolector_mul ( Btor btor,
BtorExp e0,
BtorExp e1 
)

Multiplication. The parameters 'e0' and 'e1' must have the same bit-width.

Parameters:
btor Boolector instance.
e0 First bit-vector operand.
e1 Second bit-vector operand.
Returns:
Bit-vector with the same bit-width as the operands.

BtorExp* boolector_umulo ( Btor btor,
BtorExp e0,
BtorExp e1 
)

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.

Parameters:
btor Boolector instance.
e0 First bit-vector operand.
e1 Second bit-vector operand.
Returns:
Bit-vector with bit-width one.

BtorExp* boolector_smulo ( Btor btor,
BtorExp e0,
BtorExp e1 
)

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.

Parameters:
btor Boolector instance.
e0 First bit-vector operand.
e1 Second bit-vector operand.
Returns:
Bit-vector with bit-width one.

BtorExp* boolector_ult ( Btor btor,
BtorExp e0,
BtorExp e1 
)

Unsigned less than. The parameters 'e0' and 'e1' must have the same bit-width.

Parameters:
btor Boolector instance.
e0 First bit-vector operand.
e1 Second bit-vector operand.
Returns:
Bit-vector with bit-width one.

BtorExp* boolector_slt ( Btor btor,
BtorExp e0,
BtorExp e1 
)

Signed less than. The parameters 'e0' and 'e1' must have the same bit-width.

Parameters:
btor Boolector instance.
e0 First bit-vector operand.
e1 Second bit-vector operand.
Returns:
Bit-vector with bit-width one.

BtorExp* boolector_ulte ( Btor btor,
BtorExp e0,
BtorExp e1 
)

Unsigned less than or equal. The parameters 'e0' and 'e1' must have the same bit-width.

Parameters:
btor Boolector instance.
e0 First bit-vector operand.
e1 Second bit-vector operand.
Returns:
Bit-vector with bit-width one.

BtorExp* boolector_slte ( Btor btor,
BtorExp e0,
BtorExp e1 
)

Signed less than or equal. The parameters 'e0' and 'e1' must have the same bit-width.

Parameters:
btor Boolector instance.
e0 First bit-vector operand.
e1 Second bit-vector operand.
Returns:
Bit-vector with bit-width one.

BtorExp* boolector_ugt ( Btor btor,
BtorExp e0,
BtorExp e1 
)

Unsigned greater than. The parameters 'e0' and 'e1' must have the same bit-width.

Parameters:
btor Boolector instance.
e0 First bit-vector operand.
e1 Second bit-vector operand.
Returns:
Bit-vector with bit-width one.
Examples:
array1.c.

BtorExp* boolector_sgt ( Btor btor,
BtorExp e0,
BtorExp e1 
)

Signed greater than. The parameters 'e0' and 'e1' must have the same bit-width.

Parameters:
btor Boolector instance.
e0 First bit-vector operand.
e1 Second bit-vector operand.
Returns:
Bit-vector with bit-width one.
Examples:
bv2.c.

BtorExp* boolector_ugte ( Btor btor,
BtorExp e0,
BtorExp e1 
)

Unsigned greater than or equal. The parameters 'e0' and 'e1' must have the same bit-width.

Parameters:
btor Boolector instance.
e0 First bit-vector operand.
e1 Second bit-vector operand.
Returns:
Bit-vector with bit-width one.

BtorExp* boolector_sgte ( Btor btor,
BtorExp e0,
BtorExp e1 
)

Signed greater than or equal. The parameters 'e0' and 'e1' must have the same bit-width.

Parameters:
btor Boolector instance.
e0 First bit-vector operand.
e1 Second bit-vector operand.
Returns:
Bit-vector with bit-width one.

BtorExp* boolector_sll ( Btor btor,
BtorExp e0,
BtorExp e1 
)

Shift left.

Parameters:
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'.
Returns:
Bit-vector with the same bit-width as 'e0'.

BtorExp* boolector_srl ( Btor btor,
BtorExp e0,
BtorExp e1 
)

Shift right logical. Zeroes are shifted in.

Parameters:
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'.
Returns:
Bit-vector with the same bit-width as 'e0'.

BtorExp* boolector_sra ( Btor btor,
BtorExp e0,
BtorExp e1 
)

Shift right arithmetic. Whether zeroes or ones are shifted in depends on the most significant bit of 'e0'.

Parameters:
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'.
Returns:
Bit-vector with the same bit-width as 'e0'.

BtorExp* boolector_rol ( Btor btor,
BtorExp e0,
BtorExp e1 
)

Rotate left.

Parameters:
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'.
Returns:
Bit-vector with the same bit-width as 'e0'.

BtorExp* boolector_ror ( Btor btor,
BtorExp e0,
BtorExp e1 
)

Rotate right.

Parameters:
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'.
Returns:
Bit-vector with the same bit-width as 'e0'.

BtorExp* boolector_sub ( Btor btor,
BtorExp e0,
BtorExp e1 
)

Subtraction. The parameters 'e0' and 'e1' must have the same bit-width.

Parameters:
btor Boolector instance.
e0 First bit-vector operand.
e1 Second bit-vector operand.
Returns:
Bit-vector with the same bit-width as the operands.

BtorExp* boolector_usubo ( Btor btor,
BtorExp e0,
BtorExp e1 
)

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.

Parameters:
btor Boolector instance.
e0 First bit-vector operand.
e1 Second bit-vector operand.
Returns:
Bit-vector with bit-width one.

BtorExp* boolector_ssubo ( Btor btor,
BtorExp e0,
BtorExp e1 
)

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.

Parameters:
btor Boolector instance.
e0 First bit-vector operand.
e1 Second bit-vector operand.
Returns:
Bit-vector with bit-width one.

BtorExp* boolector_udiv ( Btor btor,
BtorExp e0,
BtorExp e1 
)

Unsigned division. The parameters 'e0' and 'e1' must have the same bit-width. If 'e1' is zero, then the result is -1.

Parameters:
btor Boolector instance.
e0 First bit-vector operand.
e1 Second bit-vector operand.
Returns:
Bit-vector with the same bit-width as the operands.
Remarks:
The behavior that division by zero returns -1 does not exactly comply with the SMT-LIB standard 1.2 where division by zero is handled as uninterpreted function. Our semantics are motivated by real circuits where division by zero cannot be uninterpreted and of course returns a result.

BtorExp* boolector_sdiv ( Btor btor,
BtorExp e0,
BtorExp e1 
)

Signed division. The parameters 'e0' and 'e1' must have the same bit-width.

Parameters:
btor Boolector instance.
e0 First bit-vector operand.
e1 Second bit-vector operand.
Returns:
Bit-vector with the same bit-width as the operands.
Remarks:
Signed division is expressed by unsigned division and the sign bits of 'e0' and 'e1'. If the sign bit of 'e0' resp. 'e1' is one then two's complement is applied to normalize them. Then, unsigned division is performed. Finally, two's complement is applied to the result if the sign bits of 'e0' and 'e1' are different. Therefore, the behavior upon dividing zero depends on boolector_udiv.

BtorExp* boolector_sdivo ( Btor btor,
BtorExp e0,
BtorExp e1 
)

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.

Parameters:
btor Boolector instance.
e0 First bit-vector operand.
e1 Second bit-vector operand.
Returns:
Bit-vector with bit-width one.
Remarks:
Unsigned division cannot overflow.

BtorExp* boolector_urem ( Btor btor,
BtorExp e0,
BtorExp e1 
)

Unsigned remainder. The parameters 'e0' and 'e1' must have the same bit-width. If 'e1' is zero, then the result is 'e0'.

Parameters:
btor Boolector instance.
e0 First bit-vector operand.
e1 Second bit-vector operand.
Returns:
Bit-vector with the same bit-width as the operands.
Remarks:
As in boolector_udiv the behavior if 'e1' is zero, does not exactly comply with the SMT-LIB standard 1.2 where the result is handled as uninterpreted. Our semantics are motivated by real circuits where results cannot be uninterpreted.

BtorExp* boolector_srem ( Btor btor,
BtorExp e0,
BtorExp e1 
)

Signed remainder. The parameters 'e0' and 'e1' must have the same bit-width. If 'e1' is zero, then the result is 'e0'.

Parameters:
btor Boolector instance.
e0 First bit-vector operand.
e1 Second bit-vector operand.
Returns:
Bit-vector with the same bit-width as the operands.
Remarks:
Analogously to boolector_sdiv signed remainder is expressed by unsigned remainder and the sign bits of 'e0' and 'e1'. Therefore, if 'e1' is zero, the result depends on boolector_urem.

BtorExp* boolector_smod ( Btor btor,
BtorExp e0,
BtorExp e1 
)

Signed remainder where sign follows divisor. The parameters 'e0' and 'e1' must have the same bit-width.

Parameters:
btor Boolector instance.
e0 First bit-vector operand.
e1 Second bit-vector operand.
Returns:
Bit-vector with the same bit-width as the operands.
Remarks:
The behavior, if 'e1' is zero depends on boolector_urem.

BtorExp* boolector_concat ( Btor btor,
BtorExp e0,
BtorExp e1 
)

Concatenation.

Parameters:
btor Boolector instance.
e0 First bit-vector operand.
e1 Second bit-vector operand.
Returns:
Bit-vector with bit-width: bit-width of 'e0' + bit-width of 'e1'.

BtorExp* boolector_read ( Btor btor,
BtorExp e_array,
BtorExp e_index 
)

Array read on array 'e_array' at position 'e_index'.

Parameters:
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'.
Examples:
array1.c, and array3.c.

BtorExp* boolector_write ( Btor btor,
BtorExp e_array,
BtorExp e_index,
BtorExp e_value 
)

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.

Parameters:
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'.
Returns:
Array where the value at one specific index has been updated.
Examples:
array2.c.

BtorExp* boolector_cond ( Btor btor,
BtorExp e_cond,
BtorExp e_if,
BtorExp e_else 
)

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.

Parameters:
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.
Returns:
Result with the same type as 'e_if' and 'e_else'.
Examples:
array1.c.

BtorExp* boolector_inc ( Btor btor,
BtorExp exp 
)

Increments bit-vector by one.

Parameters:
btor Boolector instance.
exp Bit-vector operand.
Returns:
Bit-vector with the same bit-width as 'exp'.

BtorExp* boolector_dec ( Btor btor,
BtorExp exp 
)

Decrements bit-vector by one.

Parameters:
btor Boolector instance.
exp Bit-vector operand.
Returns:
Bit-vector with the same bit-width as 'exp'.

int boolector_is_array ( Btor btor,
BtorExp exp 
)

Determines if expression is an array. If not, expression is a bit-vector.

Parameters:
btor Boolector instance.
exp Operand.
Returns:
True if expression is an array, and false otherwise.

int boolector_get_width ( Btor btor,
BtorExp exp 
)

Gets the bit-width of an expression. If the expression is an array, it returns the bit-width of the array elements.

Parameters:
btor Boolector instance.
exp Operand.
Returns:
bit-width of 'exp'.

int boolector_get_index_width ( Btor btor,
BtorExp e_array 
)

Gets the bit-width of indices of 'e_array'.

Parameters:
btor Boolector instance.
e_array Array operand.
Returns:
bit-width of indices of 'e_array'.

const char* boolector_get_symbol_of_var ( Btor btor,
BtorExp var 
)

Gets the symbol of a variable.

Parameters:
btor Boolector instance.
var Array or bit-vector variable.
Returns:
Symbol of variable.
See also:
boolector_var

boolector_array

BtorExp* boolector_copy ( Btor btor,
BtorExp exp 
)

Copies expression (increments reference counter).

Parameters:
btor Boolector instance.
exp Operand.
Returns:
The expression 'exp'.
Examples:
bv1.c.

void boolector_release ( Btor btor,
BtorExp exp 
)

Releases expression (decrements reference counter).

Parameters:
btor Boolector instance.
exp Operand.
Examples:
array1.c, array2.c, array3.c, bv1.c, and bv2.c.

void boolector_dump_btor ( Btor btor,
FILE *  file,
BtorExp exp 
)

Recursively dumps expression to file. BTOR is used as format.

Parameters:
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.

void boolector_dump_smt ( Btor btor,
FILE *  file,
BtorExp exp 
)

Recursively dumps expression to file. SMT-LIB 1.2 is used as format.

Parameters:
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.

void boolector_assert ( Btor btor,
BtorExp exp 
)

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.

Parameters:
btor Boolector instance.
exp Bit-vector expression with bit-width one.
Examples:
array1.c, array2.c, array3.c, bv1.c, and bv2.c.

void boolector_assume ( Btor btor,
BtorExp exp 
)

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.

Parameters:
btor Boolector instance.
exp Bit-vector expression with bit-width one.
Examples:
array3.c.

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.

Parameters:
btor Boolector instance.
Returns:
It returns BOOLECTOR_SAT if the instance is satisfiable and BOOLECTOR_UNSAT if the instance is unsatisfiable.
See also:
boolector_bv_assignment

boolector_array_assignment

Examples:
array1.c, array2.c, array3.c, bv1.c, and bv2.c.

char* boolector_bv_assignment ( Btor btor,
BtorExp exp 
)

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.

Parameters:
btor Boolector instance.
exp Bit-vector expression.
Returns:
String representing a satisfying assignment to bit-vector variables and a consistent assignment for arbitrary bit-vector expressions. Each character of the string can be '0', '1' or 'x'. The latter represents that the corresponding bit can be assigned arbitrarily.
See also:
boolector_enable_model_gen
Examples:
bv2.c.

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'.

Parameters:
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.
See also:
boolector_enable_model_gen
Examples:
array2.c.

void boolector_free_bv_assignment ( Btor btor,
char *  assignment 
)

Frees an assignment string for bit-vectors.

Parameters:
btor Boolector instance.
assignment String which has to be freed.
See also:
boolector_bv_assignment

boolector_array_assignment

Examples:
array2.c, and bv2.c.


Generated on Thu Apr 30 16:49:50 2009 for Boolector by  doxygen 1.5.5