| Home | • | Intro | • | Docs | • | Wiki | • | FAQ | • | Download | - | • | Awards | • | Status | • | FM Tools |
|---|
Typedefs | |
| typedef void * | yices_expr |
| Yices expressions (abstract syntax tree). | |
| typedef void * | yices_type |
| Yices types (abstract syntax tree). | |
| typedef void * | yices_var_decl |
| Variable declaration. | |
| typedef void * | yices_context |
| Yices context. | |
| typedef int | assertion_id |
| Assertion index, to identify retractable assertions. | |
| typedef void * | yices_model |
| Model. | |
| typedef void * | yices_var_decl_iterator |
| Iterator for scanning the boolean variables. | |
Enumerations | |
| enum | lbool { l_false = -1, l_undef, l_true } |
| Extended booleans: to represent the value of literals in the context. More... | |
Functions | |
| void | yices_set_verbosity (int l) |
| Set the verbosity level. | |
| char * | yices_version () |
| Return the yices version number. | |
| void | yices_set_max_num_conflicts_in_maxsat_iteration (unsigned n) |
| Set the maximum number of conflicts that are allowed in a maxsat iteration. | |
| void | yices_enable_type_checker (int flag) |
| Force Yices to type check expressions when they are asserted (default = false). | |
| void | yices_set_max_num_iterations_in_maxsat (unsigned n) |
| Set the maximum number of iterations in the MaxSAT algorithm. | |
| void | yices_set_maxsat_initial_cost (long long c) |
| Set the initial cost for a maxsat problem. | |
| void | yices_set_arith_only (int flag) |
| Inform yices that only arithmetic theory is going to be used. | |
| void | yices_enable_log_file (char *file_name) |
| Enable a log file that will store the assertions, checks, decls, etc. | |
| yices_context | yices_mk_context () |
| Create a logical context. | |
| void | yices_del_context (yices_context ctx) |
| Delete the given logical context. | |
| void | yices_reset (yices_context ctx) |
| Reset the given logical context. | |
| void | yices_dump_context (yices_context ctx) |
Display the internal representation of the given logical context on stderr. | |
| void | yices_push (yices_context ctx) |
| Create a backtracking point in the given logical context. | |
| void | yices_pop (yices_context ctx) |
| Backtrack. | |
| void | yices_assert (yices_context ctx, yices_expr expr) |
| Assert a constraint in the logical context. | |
| assertion_id | yices_assert_weighted (yices_context ctx, yices_expr expr, long long w) |
Assert a constraint in the logical context with weight w. | |
| assertion_id | yices_assert_retractable (yices_context ctx, yices_expr expr) |
| Assert a constraint that can be later retracted. | |
| void | yices_retract (yices_context ctx, assertion_id id) |
| Retract a retractable or weighted constraint. | |
| int | yices_inconsistent (yices_context ctx) |
| Return 1 if the logical context is known to be inconsistent. | |
| lbool | yices_check (yices_context ctx) |
| Check if the logical context is satisfiable. | |
| lbool | yices_find_weighted_model (yices_context ctx, int random) |
Search for a model of the constraints asserted in ctx and compute its cost. | |
| lbool | yices_evaluate_in_model (yices_model m, yices_expr e) |
| Evaluate a formula in a model. | |
| lbool | yices_max_sat (yices_context ctx) |
| Compute the maximal satisfying assignment for the asserted weighted constraints. | |
| lbool | yices_max_sat_cost_leq (yices_context c, long long max_cost) |
Similar to yices_max_sat, but start looking for models with cost less than of equal to max_cost. | |
| yices_model | yices_get_model (yices_context ctx) |
| Return a model for a satisfiable logical context. | |
| lbool | yices_get_value (yices_model m, yices_var_decl v) |
Return the assignment for the variable v. | |
| int | yices_get_int_value (yices_model m, yices_var_decl d, long *value) |
Get the integer value assigned to variable v in model m. | |
| int | yices_get_arith_value (yices_model m, yices_var_decl d, long *num, long *den) |
Get the rational value assigned to variable v in model m. | |
| int | yices_get_double_value (yices_model m, yices_var_decl d, double *value) |
Convert the value assigned to variable v in model m to a floating point number. | |
| int | yices_get_mpq_value (yices_model m, yices_var_decl d, mpq_t value) |
Convert the value assigned to variable v in model m to a GMP rational (mpq_t). | |
| int | yices_get_mpz_value (yices_model m, yices_var_decl d, mpz_t value) |
Convert the value assigned to variable v in model m to a GMP integer (mpz_t). | |
| int | yices_get_bitvector_value (yices_model m, yices_var_decl d, unsigned n, int bv[]) |
| Get the bitvector constant assigned to a variable v in model m. | |
| int | yices_get_assertion_value (yices_model m, assertion_id id) |
Return 1 (0) if the assertion of the given id is satisfied (not satisfied) in the model m. | |
| void | yices_display_model (yices_model m) |
| Display the given model in the standard output. | |
| long long | yices_get_cost (yices_model m) |
Return the cost of model m. | |
| double | yices_get_cost_as_double (yices_model m) |
| Return the cost of the model m, converted to a double-precision floating point number. | |
| yices_expr | yices_mk_true (yices_context ctx) |
Return an expression representing true. | |
| yices_expr | yices_mk_false (yices_context ctx) |
Return an expression representing false. | |
| yices_expr | yices_mk_bool_var (yices_context ctx, char *name) |
| Return a name expression for the given variable name. | |
| yices_expr | yices_mk_fresh_bool_var (yices_context ctx) |
| Return a fresh boolean variable. | |
| yices_var_decl | yices_get_var_decl (yices_expr e) |
| Return the variable declaration object associated with the given name expression. | |
| yices_var_decl | yices_mk_bool_var_decl (yices_context ctx, char *name) |
| Return a new boolean variable declaration. | |
| char * | yices_get_var_decl_name (yices_var_decl d) |
| Return a name of a variable declaration. | |
| yices_expr | yices_mk_bool_var_from_decl (yices_context ctx, yices_var_decl d) |
| Return a name expression (instance) using the given variable declaration. | |
| yices_expr | yices_mk_or (yices_context ctx, yices_expr args[], unsigned n) |
Return an expression representing the or of the given arguments. | |
| yices_expr | yices_mk_and (yices_context ctx, yices_expr args[], unsigned n) |
Return an expression representing the and of the given arguments. | |
| yices_expr | yices_mk_eq (yices_context ctx, yices_expr a1, yices_expr a2) |
Return an expression representing a1 = a2. | |
| yices_expr | yices_mk_diseq (yices_context ctx, yices_expr a1, yices_expr a2) |
Return an expression representing a1 /= a2. | |
| yices_expr | yices_mk_ite (yices_context ctx, yices_expr c, yices_expr t, yices_expr e) |
Return an expression representing (if c t e). | |
| yices_expr | yices_mk_not (yices_context ctx, yices_expr a) |
Return an expression representing (not a). | |
| yices_var_decl_iterator | yices_create_var_decl_iterator (yices_context c) |
| Create an iterator that can be used to traverse the boolean variables (var_decl objects) in the given logical context. | |
| int | yices_iterator_has_next (yices_var_decl_iterator it) |
Return 1 if the iterator it still has elements to be iterated. Return 0 otherwise. | |
| yices_var_decl | yices_iterator_next (yices_var_decl_iterator it) |
| Return the next variable, and move the iterator. | |
| void | yices_iterator_reset (yices_var_decl_iterator it) |
| Reset the given iterator, that is, move it back to the first element. | |
| void | yices_del_iterator (yices_var_decl_iterator it) |
| Delete an iterator created with yices_create_var_decl_iterator. | |
| yices_type | yices_mk_type (yices_context ctx, char *name) |
| Return the type associated with the given name. If the type does not exist, a new uninterpreted type is created. | |
| yices_type | yices_mk_function_type (yices_context ctx, yices_type domain[], unsigned domain_size, yices_type range) |
Return a function type (-> d1 ... dn r). | |
| yices_type | yices_mk_bitvector_type (yices_context ctx, unsigned size) |
| Returns the bitvector type (bv[size]). | |
| yices_type | yices_mk_tuple_type (yices_context ctx, yices_type *args[], unsigned size) |
| Constructs the tuple type (arg[0], ..., arg[size-1]). | |
| yices_var_decl | yices_mk_var_decl (yices_context ctx, char *name, yices_type ty) |
| Return a new (global) variable declaration. It is an error to create two variables with the same name. | |
| yices_var_decl | yices_get_var_decl_from_name (yices_context ctx, char *name) |
| Return a variable declaration associated with the given name. | |
| yices_expr | yices_mk_var_from_decl (yices_context ctx, yices_var_decl d) |
| Return a name expression (instance) using the given variable declaration. | |
| yices_expr | yices_mk_app (yices_context ctx, yices_expr f, yices_expr args[], unsigned n) |
Return a function application term (f t1 ... tn). | |
| yices_expr | yices_mk_num (yices_context ctx, int n) |
| Return an expression representing the given integer. | |
| yices_expr | yices_mk_num_from_string (yices_context ctx, char *n) |
| Return an expression representing the number provided in ASCII format. | |
| yices_expr | yices_mk_num_from_mpz (yices_context ctx, const mpz_t z) |
| Construct a numerical expression form a GMP integer. | |
| yices_expr | yices_mk_num_from_mpq (yices_context ctx, const mpq_t q) |
| Construct a numerical expression form a GMP rational. | |
| yices_expr | yices_mk_sum (yices_context ctx, yices_expr args[], unsigned n) |
Return an expression representing args[0] + ... + args[n-1]. | |
| yices_expr | yices_mk_sub (yices_context ctx, yices_expr args[], unsigned n) |
Return an expression representing args[0] - ... - args[n-1]. | |
| yices_expr | yices_mk_mul (yices_context ctx, yices_expr args[], unsigned n) |
Return an expression representing args[0] * ... * args[n-1]. | |
| yices_expr | yices_mk_lt (yices_context ctx, yices_expr a1, yices_expr a2) |
Return an expression representing a1 < a2. | |
| yices_expr | yices_mk_le (yices_context ctx, yices_expr a1, yices_expr a2) |
Return an expression representing a1 <= a2. | |
| yices_expr | yices_mk_gt (yices_context ctx, yices_expr a1, yices_expr a2) |
Return an expression representing a1 > a2. | |
| yices_expr | yices_mk_ge (yices_context ctx, yices_expr a1, yices_expr a2) |
Return an expression representing a1 >= a2. | |
| yices_expr | yices_mk_bv_constant (yices_context ctx, unsigned size, unsigned long value) |
Create a bit vector constant of size bits and of the given value. | |
| yices_expr | yices_mk_bv_constant_from_array (yices_context ctx, unsigned size, int bv[]) |
| Create a bit vector constant from an array. | |
| yices_expr | yices_mk_bv_add (yices_context ctx, yices_expr a1, yices_expr a2) |
| Bitvector addition. | |
| yices_expr | yices_mk_bv_sub (yices_context ctx, yices_expr a1, yices_expr a2) |
| Bitvector subtraction. | |
| yices_expr | yices_mk_bv_mul (yices_context ctx, yices_expr a1, yices_expr a2) |
| Bitvector multiplication. | |
| yices_expr | yices_mk_bv_minus (yices_context ctx, yices_expr a1) |
| Bitvector opposite. | |
| yices_expr | yices_mk_bv_concat (yices_context ctx, yices_expr a1, yices_expr a2) |
| Bitvector concatenation. | |
| yices_expr | yices_mk_bv_and (yices_context ctx, yices_expr a1, yices_expr a2) |
| Bitwise and. | |
| yices_expr | yices_mk_bv_or (yices_context ctx, yices_expr a1, yices_expr a2) |
| Bitwise or. | |
| yices_expr | yices_mk_bv_xor (yices_context ctx, yices_expr a1, yices_expr a2) |
| Bitwise exclusive or. | |
| yices_expr | yices_mk_bv_not (yices_context ctx, yices_expr a1) |
| Bitwise negation. | |
| yices_expr | yices_mk_bv_extract (yices_context ctx, unsigned end, unsigned begin, yices_expr a) |
| Bitvector extraction. | |
| yices_expr | yices_mk_bv_sign_extend (yices_context ctx, yices_expr a, unsigned n) |
| Sign extension. | |
| yices_expr | yices_mk_bv_shift_left0 (yices_context ctx, yices_expr a, unsigned n) |
Left shift by n bits, padding with zeros. | |
| yices_expr | yices_mk_bv_shift_left1 (yices_context ctx, yices_expr a, unsigned n) |
Left shift by n bits, padding with ones. | |
| yices_expr | yices_mk_bv_shift_right0 (yices_context ctx, yices_expr a, unsigned n) |
Right shift by n bits, padding with zeros. | |
| yices_expr | yices_mk_bv_shift_right1 (yices_context ctx, yices_expr a, unsigned n) |
Right shift by n bits, padding with ones. | |
| yices_expr | yices_mk_bv_lt (yices_context ctx, yices_expr a1, yices_expr a2) |
Unsigned comparison: (a1 < a2). | |
| yices_expr | yices_mk_bv_le (yices_context ctx, yices_expr a1, yices_expr a2) |
Unsigned comparison: (a1 <= a2). | |
| yices_expr | yices_mk_bv_gt (yices_context ctx, yices_expr a1, yices_expr a2) |
Unsigned comparison: (a1 > a2). | |
| yices_expr | yices_mk_bv_ge (yices_context ctx, yices_expr a1, yices_expr a2) |
Unsigned comparison: (a1 >= a2). | |
| yices_expr | yices_mk_bv_slt (yices_context ctx, yices_expr a1, yices_expr a2) |
Signed comparison: (a1 < a2). | |
| yices_expr | yices_mk_bv_sle (yices_context ctx, yices_expr a1, yices_expr a2) |
Signed comparison: (a1 <= a2). | |
| yices_expr | yices_mk_bv_sgt (yices_context ctx, yices_expr a1, yices_expr a2) |
Signed comparison: (a1 > a2). | |
| yices_expr | yices_mk_bv_sge (yices_context ctx, yices_expr a1, yices_expr a2) |
Signed comparison: (a1 >= a2). | |
| void | yices_pp_expr (yices_expr e) |
| Pretty print the given expression in the standard output. | |
|
|
Assertion index, to identify retractable assertions.
|
|
|
Yices context. A context stores a collection of declarations and assertions. |
|
|
Yices expressions (abstract syntax tree).
|
|
|
Model. A model assigns constant values to variables defined in a context. The context must be known to be consistent for a model to be available. The model is constructed by calling yices_check (or its relatives) then yices_get_model. |
|
|
Yices types (abstract syntax tree).
|
|
|
Variable declaration.
A declaration consists of a name and a type (such as |
|
|
Iterator for scanning the boolean variables.
|
|
|
Extended booleans: to represent the value of literals in the context.
|
|
||||||||||||
|
Assert a constraint in the logical context. After one assertion, the logical context may become inconsistent. The method yices_inconsistent may be used to check that. |
|
||||||||||||
|
Assert a constraint that can be later retracted.
|
|
||||||||||||||||
|
Assert a constraint in the logical context with weight
|
|
|
Check if the logical context is satisfiable.
If the context is satisfiable, then yices_get_model can be used to obtain a model.
|
|
|
Create an iterator that can be used to traverse the boolean variables (var_decl objects) in the given logical context. An iterator is particulary useful when we want to extract the assignment (model) produced by the yices_check command. Example: yices_context ctx = yices_mk_context(); ... if (yices_check(ctx) == l_true) { yices_var_decl_iterator it = yices_create_var_decl_iterator(ctx); yices_model m = yices_get_model(ctx); while (yices_iterator_has_next(it)) { yices_var_decl d = yices_iterator_next(it); char * val; switch(yices_get_value(m, d)) { case l_true: val = "true"; break; case l_false: val = "false"; break; case l_undef: val = "unknown"; break; } printf("%s = %s\n", yices_get_var_decl_name(d), val); } yices_del_iterator(it); }
|
|
|
Delete the given logical context.
|
|
|
Delete an iterator created with yices_create_var_decl_iterator.
|
|
|
Display the given model in the standard output.
|
|
|
Display the internal representation of the given logical context on This function is mostly for debugging. |
|
|
Enable a log file that will store the assertions, checks, decls, etc. If the log file is already open, then nothing happens. |
|
|
Force Yices to type check expressions when they are asserted (default = false).
|
|
||||||||||||
|
Evaluate a formula in a model.
Model
|
|
||||||||||||
|
Search for a model of the constraints asserted in
If
If there are no weighted constaints in
Otherwise, it searches for a model that satisfies all the non-weighted constraints but not necessarily the weighted constraints. The function returns
The function returns
The function may also return |
|
||||||||||||||||||||
|
Get the rational value assigned to variable
The numerator is stored in A return code of 0 indicates one of the following errors:
|
|
||||||||||||
|
Return 1 (0) if the assertion of the given This function is only useful for assertion ids obtained using yices_assert_weighted, and yices_max_sat was used to build the model. That is the only scenario where an assertion may not be satisfied in a model produced by yices. |
|
||||||||||||||||||||
|
Get the bitvector constant assigned to a variable v in model m.
The value stored in array
The return code is 0 if an error occurs, 1 otherwise. Possible errors are:
|
|
|
Return the cost of model The cost is the sum of the weights of unsatisfied constraints.
|
|
|
Return the cost of the model m, converted to a double-precision floating point number.
|
|
||||||||||||||||
|
Convert the value assigned to variable
The value is stored in
|
|
||||||||||||||||
|
Get the integer value assigned to variable
The value is stored in
|
|
|
Return a model for a satisfiable logical context.
|
|
||||||||||||||||
|
Convert the value assigned to variable Return 1 on success. A return code of 0 indicates one of the following errors:
|
|
||||||||||||||||
|
Convert the value assigned to variable Return 1 on success A return code of 0 indicates one of the following errors:
|
|
||||||||||||
|
Return the assignment for the variable
The result is
|
|
|
Return the variable declaration object associated with the given name expression.
|
|
||||||||||||
|
Return a variable declaration associated with the given name. Return 0 if there is no variable declaration associated with the given name. |
|
|
Return a name of a variable declaration.
|
|
|
Return 1 if the logical context is known to be inconsistent.
|
|
|
Return 1 if the iterator
|
|
|
Return the next variable, and move the iterator.
|
|
|
Reset the given iterator, that is, move it back to the first element.
|
|
|
Compute the maximal satisfying assignment for the asserted weighted constraints.
|
|
||||||||||||
|
Similar to yices_max_sat, but start looking for models with cost less than of equal to
|
|
||||||||||||||||
|
Return an expression representing the
|
|
||||||||||||||||||||
|
Return a function application term
The type of |
|
||||||||||||
|
Returns the bitvector type (bv[size]). Size must be positive. |
|
||||||||||||
|
Return a name expression for the given variable name.
|
|
||||||||||||
|
Return a new boolean variable declaration. It is an error to create two variables with the same name. |
|
||||||||||||
|
Return a name expression (instance) using the given variable declaration.
|
|
||||||||||||||||
|
Bitvector addition.
|
|
||||||||||||||||
|
Bitwise and.
|
|
||||||||||||||||
|
Bitvector concatenation.
Assuming |
|
||||||||||||||||
|
Create a bit vector constant of
|
|
||||||||||||||||
|
Create a bit vector constant from an array.
bit |
|
||||||||||||||||||||
|
Bitvector extraction.
|
|
||||||||||||||||
|
Unsigned comparison: (
|
|
||||||||||||||||
|
Unsigned comparison: (
|
|
||||||||||||||||
|
Unsigned comparison: (
|