[ library(ldsb) | Reference Manual | Alphabetic Index ]

# ldsb_try(+X, ++Value, ?Success)

Try assigning a value to an LDSB variable.

X
  Variable to try
Value
  Value to try
Success
  Whether the assignment succeeded or not

## Description

Tries to assign Value to X. Upon backtracking, excludes Value from the domain of X. The value of Success tells whether the assignment succeeded; Success is 1 if X #= Value and 0 if X #\= Value.

### Resatisfiable

yes

## Examples

    ldsb_indomain(X) :- nonvar(X), !.
    ldsb_indomain(X) :-
            ic:is_solver_var(X), !,
            get_min(X,V),
            ldsb_try(X, V, _),
            ldsb_indomain(X).

## See Also

ldsb_indomain / 1, ldsb_initialise / 2, ldsb_try_set / 3