A problem variable may be associated with a tentative value. Typically this tentative value is used to record preferred or previous assignments to this variable.
Assigns tentative values for the variables in a term. These are typically used to register values the variables are given in a partial or initially inconsistent solution. These values may be changed through later calls to the same predicate. Vars can be a variable, a list of variables or any nonground term. Values must be a corresponding ground term. The tentative values of the variables in Vars are set to the corresponding ground values in Values.
Query the variable’s tentative values. Values is a copy of the term Vars with the tentative values filled in place of the variables. If a variable has no tentative value a variable is returned in its place.
A problem variable is tenable when it does not have a tentative value or when it has a tentative value that is consistent e.g. with its finite domain. For example
[eclipse 3]: fd:(X::1..5), X tent_set 3. X = X{fd:[1..5], repair:3}
produces a tenable variable (note how the tentative value is printed as the variable’s repair-attribute), while on the other hand
[eclipse 3]: fd:(X::1..5), X tent_set 7. X = X{fd:[1..5], repair:7}
produces an untenable variable. Note that, unlike logical assignments, the tentative value can be changed:
[eclipse 3]: fd:(X::1..5), X tent_set 7, X tent_set 3. X = X{fd:[1..5], repair:3}
Succeeds if the given variable is tenable. This predicate is the link between repair and any underlying solver that maintains a domain for a variable1.
The notion of a tentative assignment is the means of integration with the consistency methods of ECLiPSe. The tentative assignment is used for identifying whether a repair constraint is being violated.
The tentative assignment is a function of the groundness and tenability of
problem variables according to the following table
Variable Groundness | Variable Tenability | Value in Tentative Assignment |
Ground | Tenable | Ground Value |
Ground | Not Tenable | Ground Value |
Not Ground | Tenable | Tentative Value |
Not Ground | Not Tenable | Undefined |
A repair constraint is violated under two conditions:
It has been noted above that variables with no associated tentative value are considered to be tenable. Since no single value has been selected as a tentative value, the Repair library checks constraints for consistency with respect to the domain of that variable. A temporary variable with identical domains is substituted in the constraint check.
If two variables with distinct tentative values are unified only one is kept for the unified variable. Preference is given to a tentative value that would result in a tenable unified variable.
If a variable with a repair attribute is copied using copy_term/2 or similar, the repair attribute is stripped. If you wish the copy to have the same tentative value as the original, you will need to call tent_get/2 and tent_set/2 yourself.