Home | • | Docs | • | Download | • | FM Tools |
---|
Yices 1 is no longer maintained. You can still download it and use it, but we do not provide support for Yices 1.
Our more recent Yices 2 solver is here
Typedefs | |
typedef void * | yices_context |
Yices context. | |
typedef void * | yices_type |
Yices types (abstract syntax tree). | |
typedef void * | yices_expr |
Yices expressions (abstract syntax tree). | |
typedef void * | yices_var_decl |
Variable declaration. | |
typedef int | assertion_id |
Assertion index, to identify weighted and 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... | |
Structures | |
struct | srec_s |
String allocation structure used by yices_get_arith_value_as_string and yices_free_string. More... | |
Functions | |
const char * | yices_version () |
Return the yices version number. | |
void | yices_set_verbosity (int l) |
Set the verbosity level. | |
void | yices_enable_type_checker (int flag) |
Force Yices to type check expressions when they are asserted (default = false). | |
int | yices_enable_log_file (const char *file_name) |
Enable a log file that will store the assertions, checks, declartationss, etc. | |
void | yices_set_arith_only (int flag) |
Inform Yices that only the arithmetic theory is going to be used. | |
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_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. | |
yices_context | yices_mk_context () |
Create the logical context. | |
void | yices_del_context (yices_context ctx) |
Delete the logical context. | |
void | yices_reset (yices_context ctx) |
Reset the logical context. | |
void | yices_dump_context (yices_context ctx) |
Display the internal representation of the logical context on stderr . | |
void | yices_push (yices_context ctx) |
Create a backtracking point. | |
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) |
Check whether the logical context is known to be inconsistent. | |
lbool | yices_check (yices_context ctx) |
Check if the logical context is satisfiable. | |
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 . | |
lbool | yices_find_weighted_model (yices_context ctx, int random) |
Search for a model of the constraints asserted in ctx and compute its cost. | |
unsigned | yices_get_unsat_core_size (yices_context ctx) |
Return the size of the unsatisfiable core. | |
unsigned | yices_get_unsat_core (yices_context ctx, assertion_id a[]) |
Return the unsatisfiable core. | |
yices_model | yices_get_model (yices_context ctx) |
Return a model for a satisfiable context. | |
lbool | yices_get_value (yices_model m, yices_var_decl v) |
Return the value of variable v in model m . | |
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 poin 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_arith_value_as_string (yices_model m, yices_var_decl d, srec_t *r) |
Get the value assigned to variable v in model m as a string. | |
int | yices_free_string (srec_t *r) |
Free a string allocated by Yices | |
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_scalar_value (yices_model m, yices_var_decl d) |
Get the value assigned to a scalar variable v in model m. | |
const char * | yices_get_scalar_value_name (yices_model m, yices_var_decl d) |
Get the value assigned to a scalar 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 . | |
lbool | yices_evaluate_in_model (yices_model m, yices_expr e) |
Evaluate a formula in a model. | |
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_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 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_expr | yices_parse_expression (yices_context ctx, const char* s) |
Parse string s as an expression in the Yices syntax. | |
yices_type | yices_parse_type (yices_context ctx, const char* s) |
Parse string s as a type in the Yices syntax. | |
int | yices_parse_command (yices_context ctx, const char* s) |
Parse string s as a command in the Yices syntax and execute the command. | |
const char * | yices_get_last_error_message (void) |
Return the last error message. | |
yices_type | yices_mk_type (yices_context ctx, const 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_bitvector_type (yices_context ctx, unsigned size) |
Returns the bitvector type (bv[size]). | |
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_tuple_type (yices_context ctx, yices_type args[], unsigned size) |
Constructs the tuple type (arg[0], ..., arg[size-1]). | |
yices_var_decl | yices_mk_bool_var_decl (yices_context ctx, const char *name) |
Return a new boolean variable declaration. | |
yices_var_decl | yices_mk_var_decl (yices_context ctx, const 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, const char *name) |
Return a variable declaration associated with the given name. | |
yices_var_decl | yices_get_var_decl (yices_expr e) |
Return the variable declaration object associated with the given name expression. | |
const char * | yices_get_var_decl_name (yices_var_decl d) |
Return the name of a variable declaration. | |
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_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_bool_var (yices_context ctx, const 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_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_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_not (yices_context ctx, yices_expr a) |
Return an expression representing (not a) . | |
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_app (yices_context ctx, yices_expr f, yices_expr args[], unsigned n) |
Return a function application term (f t1 ... tn) . | |
yices_expr | yices_mk_function_update (yices_context ctx, yices_expr f, yices_expr args[], unsigned n, yices_expr v) |
Build a function update term (update f (t1 ... tn) v) . | |
yices_expr | yices_mk_tuple_literal (yices_context ctx, yices_expr args[], unsigned n) |
Build a tuple term (tuple 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, const 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_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_concat (yices_context ctx, yices_expr a1, yices_expr a2) |
Bitvector concatenation. | |
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 Instances are also called name expressions. Instances can be created using yices_mk_bool_var_from_decl or yices_mk_var_from_decl. |
|
Iterator for scanning the boolean variables.
|
|
Extended booleans to represent the value of literals in the context.
|
|
This structure consists of an integer
If the flag is
If the flag is
|
|
Return the yices version number.
|
|
Set the verbosity level.
|
|
Force Yices to type check expressions when they are asserted (default = false).
|
|
Enable a log file that will store the assertions, checks, decls, etc. If the log file is already open, then nothing happens. Return code:
|
|
Inform yices that only the arithmetic theory is going to be used. This flag usually improves performance (default = false). |
|
Set the maximum number of conflicts that are allowed in a maxsat iteration. If the maximum is reached, then "unknown" (i.e., l_undef) is returned by maxsat. |
|
Set the maximum number of iterations in the MaxSAT algorithm. If the maximum is reached, then "unknown" (i.e., l_undef) is returned by maxsat. |
|
Set the initial cost for a maxsat problem.
|
|
Create the logical context.
|
|
Delete the logical context.
|
|
Reset the logical context.
|
|
Display the internal representation of the logical context on This function is mostly for debugging. |
|
Create a backtracking point. The logical context can be viewed as a stack of contexts. The scope level is the number of elements on this stack. The stack of contexts is simulated using trail (undo) stacks. |
|
Backtrack.
Restores the context from the top of the stack, and pops it off the stack.
Any changes to the logical context (by yices_assert or other functions) between
the matching yices_push and
|
|
Assert a constraint in the logical context. After one assertion, the logical context may become inconsistent. Function yices_inconsistent may be used to check that. |
|
Assert a constraint in the logical context with weight
|
|
Assert a constraint that can be retracted later.
|
|
Retract a retractable or weighted constraint.
|
|
Check whether the logical context is known to be inconsistent. If the function returns true (i.e., a non-zero value) then the context is inconsistent. If the function returns false (i.e., zero) then the context's status is not known. To determine the status, function yices_check must be used.
|
|
Check if the logical context is satisfiable.
If the context is satisfiable, then yices_get_model can be used to obtain a model.
|
|
Compute the maximal satisfying assignment for the asserted weighted constraints.
If the result is
|
|
Similar to yices_max_sat, but start looking for models with cost less than or equal to
|
|
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
|
|
Return the size of the unsat core or
|
|
Copy the unsatisfiable core into array The unsatisfiable core is a (small) subset of the retractable assertions that is inconsistent by itself.
The returned value is the size of the unsat core, that is, the number
of assertion ids copied into array
|
|
Return a model for a satisfiable logical context.
Return 0 if a model is not available. Calls to functions that modify the context invalidate the model.
|
|
Return the value of variable
The result is
|
|
Get the integer value assigned to variable
The value is stored in A return code of 0 indicates one of the following errors:
|
|
Get the rational value assigned to variable
The numerator is stored in A return code of 0 indicates one of the following errors:
|
|
Convert the value assigned to variable
The value is stored in 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:
|
|
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
Yices internally allocates a string to store the value. The result is returned in record
If
If
The string |
|
Free the string returned in
Also resets |
|
Get the bitvector value assigned to a variable
The value is stored in array
The return code is 0 if an error occurs, 1 otherwise. Possible errors are:
|
|
Get the value assigned to a scalar variable
If
This function returns the value of variable
The function returns Possible errors are:
|
|
Get the value assigned to a scalar variable
If
This function returns the value of variable
The function returns Possible errors are:
|
|
Return 1 (0) if the assertion of the given This function is only useful for assertion ids obtained using yices_assert_weighted, and if yices_max_sat was used to build the model. This is the only scenario where an assertion may not be satisfied in a model produced by Yices. |
|
Evaluate a formula in a model.
Model
|
|
Display the given model on standard output.
|
|
Return the cost of model The cost is the sum of the weights of the unsatisfied constraints.
|
|
Return the cost of model
|
|
Create an iterator that can be used to traverse the boolean variables (var_decl objects) in the 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); }
|
|
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.
|
|
Delete an iterator created with yices_create_var_decl_iterator.
|
|
Parse string
The string must be terminated by If there's an error during parsing, Yices will generate an error message that can be retrieved using function yices_get_last_error_message.
|
|
Parse string
The string must be terminated by If there's an error during parsing, Yices will generate an error message that can be retrieved using function yices_get_last_error_message.
|
|
Parse string
The string must be terminated by If there's an error during parsing or if the command fails, Yices will generate an error message that can be retrieved using function yices_get_last_error_message.
|
|
Return the last error message produced by the functions yices_parse_expression, yices_parse_type, or yices_parse_command. |
|
Return the type with the given
|
|
Return the type
|
|
Return the type
|
|
Return the tuple type
|
|
Return a new boolean variable declaration. It is an error to create two variables with the same name. |
|
Return a new (global) variable declaration of type It is an error to create two variables with the same name.
|
|
Return the variable declaration associated with the given Return 0 if there is no such variable declaration. |
|
Return the variable declaration object associated with the given expression.
Return 0 if
This can be use to get the delcration of an
expression |
|
Return the name of variable declaration
|
|
Return an instance of the variable declaration
|
|
Return an instance of variable declaration
|
|
Return a name expression for the given variable
|
|
Return a fresh boolean variable.
|
|
Return an expression representing
|
|
Return an expression representing
|
|
Return an expression representing the
|
|
Return an expression representing the
|
|
Return an expression representing
|
|
Return an expression representing
|
|
Return an expression representing
|
|
Return an expression representing
|
|
Return the term
The type of |
|
Return the term
The type of
|
|
Return the term
|
|
Return an expression representing the given integer.
|
|
Return an expression representing the number provided in ASCII format.
<number> , <fractional part> ,
<numerator> , and <denominator> are strings of decimal digits.
The |
|
Construct a numerical expression form a GMP integer.
|
|
Construct a numerical expression form a GMP rational. q must be canonicalized (see GMP documentation).
|
|
Return an expression representing
|
|
Return an expression representing
|
|
Return an expression representing
|
|
Return an expression representing
|
|
Return an expression representing
|
|
Return an expression representing
|
|
Return an expression representing
|
|
Create a bit vector constant of
|
|
Create a bit vector constant from an array.
bit |
|
Bitvector addition.
|
|
Bitvector subtraction.
|
|
Bitvector multiplication.
|
|
Bitvector opposite (2s complement).
|
|
Bitwise and.
|
|
Bitwise or.
|
|
Bitwise exclusive or.
|
|
Bitwise negation.
|
|
Bitvector concatenation.
Assuming
Bit 0 of |
|
Bitvector extraction.
The result is the subvector |
|
Sign extension.
Append |
|
Left shift by
|
|
Left shift by
|
|
Right shift by
|
|
Right shift by
|
|
Unsigned comparison: (
|
|
Unsigned comparison: (
|
|
Unsigned comparison: (
|
|
Unsigned comparison: (
|
|
Signed comparison: (
|
|
Signed comparison: (
|
|
Signed comparison: (
|
|
Signed comparison: (
|
|
Pretty print the given expression on standard output.
|
Home | • | Docs | • | Download | • | FM Tools |
---|