Skip to content

Commit f705557

Browse files
authored
Merge pull request #387 from SRI-CSL/terminology_fix
Clarified the use of variable in API comments.
2 parents 3e61b88 + c5af9eb commit f705557

File tree

1 file changed

+30
-25
lines changed

1 file changed

+30
-25
lines changed

src/include/yices.h

+30-25
Original file line numberDiff line numberDiff line change
@@ -1998,8 +1998,9 @@ __YICES_DLLSPEC__ extern term_t yices_parse_term(const char *s);
19981998
* - map must be an array of n terms
19991999
* - the type of map[i] must be a subtype of var[i]'s type
20002000
* - every occurrence of var[i] in t is replaced by map[i]
2001-
* - if a variable occurs several times in v, the last occurrence
2002-
* counts. (e.g., if v[i] = x and v[j] = x with i < j, and
2001+
* - if an uninterpreted term / variable occurs several times in v,
2002+
* the last occurrence counts.
2003+
* (e.g., if v[i] = x and v[j] = x with i < j, and
20032004
* there are no other occurrences of x in v, then x is
20042005
* replaced by map[j]).
20052006
*
@@ -3019,7 +3020,9 @@ __YICES_DLLSPEC__ extern int32_t yices_pop(context_t *ctx);
30193020
* unless you really know what you're doing.
30203021
*
30213022
* The following functions selectively enable/disable a preprocessing
3022-
* option. The current options include:
3023+
* option. In the description below we use "variable" for what should be
3024+
* "uninterpreted term" (in the sense of Yices), to stick to standard
3025+
* terminology. The current options include:
30233026
*
30243027
* var-elim: whether to eliminate variables by substitution
30253028
*
@@ -3169,8 +3172,7 @@ __YICES_DLLSPEC__ extern smt_status_t yices_check_context_with_assumptions(conte
31693172
/*
31703173
* Check satisfiability modulo a model.
31713174
*
3172-
* Check whether the assertions stored in ctx conjoined with a variable assignment defined by a
3173-
* model are satisfiable.
3175+
* Check whether the assertions stored in ctx conjoined with a model are satisfiable.
31743176
* - ctx must be a context initialized with support for MCSAT
31753177
* (see yices_new_context, yices_new_config, yices_set_config).
31763178
* - params is an optional structure to store heuristic parameters
@@ -3213,7 +3215,7 @@ __YICES_DLLSPEC__ extern smt_status_t yices_check_context_with_model(context_t *
32133215
* Check satisfiability and compute interpolant.
32143216
*
32153217
* Check whether the combined assertions stored in ctx are satisfiable. If they are
3216-
* not compute an interpolants (defined on variables common to both contexts).
3218+
* not, compute an interpolant (whose uninterpreted terms are common to both contexts).
32173219
* - params is an optional structure to store heuristic parameters
32183220
* - if params is NULL, default parameter settings are used.
32193221
*
@@ -3228,12 +3230,12 @@ __YICES_DLLSPEC__ extern smt_status_t yices_check_context_with_model(context_t *
32283230
*
32293231
* To call this function:
32303232
* - ctx->ctx_A must be a context initialized with support for MCSAT and interpolation.
3231-
* - ctx->ctx_B can be an other context (not necessarily with MCSAT support)
3233+
* - ctx->ctx_B can be another context (not necessarily with MCSAT support)
32323234
*
32333235
* If this function returns STATUS_UNSAT, then an interpolant is returned in ctx->interpolant.
32343236
*
32353237
* If this function returns STATUS_SAT and build_model is true, then
3236-
* a model is returned in ctx->model. This model must be freed when no-longer need by
3238+
* a model is returned in ctx->model. This model must be freed when no-longer needed by
32373239
* calling yices_free_model.
32383240
*
32393241
* If something is wrong, the function returns STATUS_ERROR and sets the yices error report
@@ -3391,7 +3393,7 @@ __YICES_DLLSPEC__ extern term_t yices_get_model_interpolant(context_t *ctx);
33913393
/*
33923394
* Build a model from ctx
33933395
* - keep_subst indicates whether the model should include
3394-
* the eliminated variables:
3396+
* the uninterpreted terms that have been eliminated by simplification:
33953397
* keep_subst = 0 means don't keep substitutions,
33963398
* keep_subst != 0 means keep them
33973399
* - ctx status must be STATUS_SAT or STATUS_UNKNOWN
@@ -3400,25 +3402,25 @@ __YICES_DLLSPEC__ extern term_t yices_get_model_interpolant(context_t *ctx);
34003402
* and sets an error report (code = CTX_INVALID_OPERATION).
34013403
*
34023404
* When assertions are added to the context, the simplifications may
3403-
* eliminate variables (cf. simplification options above). The flag
3404-
* 'keep_subst' indicates whether the model should keep track of these
3405-
* eliminated variables and include their value.
3405+
* eliminate some uninterpreted terms (cf. simplification options above).
3406+
* The flag 'keep_subst' indicates whether the model should keep track
3407+
* of these eliminated terms and include their value.
34063408
*
34073409
* Example: after the following assertions
34083410
*
34093411
* (= x (bv-add y z))
34103412
* (bv-gt y 0b000)
34113413
* (bg-gt z 0b000)
34123414
*
3413-
* variable 'x' gets eliminated. Then a call to 'check_context' will
3415+
* uninterpreted term 'x' gets eliminated. Then a call to 'check_context' will
34143416
* return STATUS_SAT and we can ask for a model 'M'
34153417
* - if 'keep_subst' is false then the value of 'x' in 'M' is unavailable.
34163418
* - if 'keep_subst' is true then the value of 'x' in 'M' is computed,
34173419
* based on the value of 'y' and 'z' in 'M'.
34183420
*
34193421
* It's always better to set 'keep_subst' true. The only exceptions
3420-
* are some of the large SMT_LIB benchmarks where millions of variables
3421-
* are eliminated. In such cases, it saves memory to set 'keep_subst'
3422+
* are some of the large SMT_LIB benchmarks where millions of uninterpreted
3423+
* terms are eliminated. In such cases, it saves memory to set 'keep_subst'
34223424
* false, and model construction is faster too.
34233425
*/
34243426
__YICES_DLLSPEC__ extern model_t *yices_get_model(context_t *ctx, int32_t keep_subst);
@@ -3462,7 +3464,7 @@ __YICES_DLLSPEC__ extern model_t *yices_model_from_map(uint32_t n, const term_t
34623464

34633465

34643466
/*
3465-
* The following functions extend a model by assigning a value to a variable
3467+
* The following functions extend a model by assigning a value to an uninterpreted term
34663468
* - var must be an uninterpreted term
34673469
* - var must not have a value in model
34683470
*
@@ -3472,23 +3474,23 @@ __YICES_DLLSPEC__ extern model_t *yices_model_from_map(uint32_t n, const term_t
34723474
* Error report:
34733475
* - code = INVALID_TERM if var is not valid
34743476
* - code = MDL_UNINT_REQUIRED if var is not uninterpreted
3475-
* - code = TYPE_MISMATCH if the variable and the value don't have compatible types.
3477+
* - code = TYPE_MISMATCH if the uninterpreted term and the value don't have compatible types.
34763478
* - code = MDL_DUPLICATE_VAR if var already has a value in model
34773479
*/
34783480

34793481
/*
3480-
* Assign a value to a Boolean variable
3482+
* Assign a value to a Boolean uninterpreted term
34813483
* - val 0 means false, anything else means true.
34823484
*
34833485
* Since 2.6.4.
34843486
*/
34853487
__YICES_DLLSPEC__ extern int32_t yices_model_set_bool(model_t *model, term_t var, int32_t val);
34863488

34873489
/*
3488-
* Assign a value to a numerical variable. The value can be given as
3490+
* Assign a value to a numerical uninterpreted term. The value can be given as
34893491
* an integer, a GMP integer, a GMP rational, or an algebraic number.
34903492
*
3491-
* The assignment fails (TYPE_MISMATCH) is the variable has integer type
3493+
* The assignment fails (TYPE_MISMATCH) is the uninterpreted term has integer type
34923494
* and the value is not an integer.
34933495
*
34943496
* For functions yices_model_set_rational32 and
@@ -3513,7 +3515,7 @@ __YICES_DLLSPEC__ extern int32_t yices_model_set_algebraic_number(model_t *model
35133515

35143516

35153517
/*
3516-
* Assign an integer value to a bitvector variable.
3518+
* Assign an integer value to a bitvector uninterpreted term.
35173519
*
35183520
* Rules for truncation and zero/sign extension:
35193521
* - let n be the number of bits in var
@@ -3541,8 +3543,8 @@ __YICES_DLLSPEC__ extern int32_t yices_model_set_bv_mpz(model_t *model, term_t v
35413543

35423544

35433545
/*
3544-
* Assign a bitvector variable using an array of bits.
3545-
* - var = bitvector variable
3546+
* Assign a bitvector value to a bitvector uninterpreted term, using an array of bits.
3547+
* - var = bitvector uninterpreted term
35463548
* - a = array of n bits
35473549
* - var must be an uninterpreted term of type (bitvector n)
35483550
* (and var must not have a value in model).
@@ -3579,7 +3581,7 @@ __YICES_DLLSPEC__ extern int32_t yices_model_set_bv_from_array(model_t *model, t
35793581
*
35803582
* (assert (> y 0))
35813583
*
3582-
* then variable 'x' does not occur in the simplified assertions and will
3584+
* then uninterpreted term 'x' does not occur in the simplified assertions and will
35833585
* not be included in vector 'v'.
35843586
*/
35853587
__YICES_DLLSPEC__ extern void yices_model_collect_defined_terms(model_t *mdl, term_vector_t *v);
@@ -4346,7 +4348,10 @@ __YICES_DLLSPEC__ extern int32_t yices_implicant_for_formulas(model_t *mdl, uint
43464348
* MODEL GENERALIZATION
43474349
*/
43484350

4349-
/*
4351+
/* In the description below we use "variable" for what should be
4352+
* "uninterpreted term" (in the sense of Yices), to stick to standard
4353+
* terminology.
4354+
*
43504355
* Given a model mdl for a formula F(X, Y). The following generalization functions
43514356
* eliminate variables Y from F(X, Y) in a way that is guided by the model.
43524357
*

0 commit comments

Comments
 (0)