... | @@ -81,3 +81,12 @@ NDL query is a Prolog like program, containing rules, with bodies consisting of |
... | @@ -81,3 +81,12 @@ NDL query is a Prolog like program, containing rules, with bodies consisting of |
|
* `swap_values(+Index1:variable_index, +Index2:variable_index)` - swap values of two variables
|
|
* `swap_values(+Index1:variable_index, +Index2:variable_index)` - swap values of two variables
|
|
* `flip_variable(+Index:variable_index, +HeadsValue:integer, +TailsValue:integer)` - if variable has value `HeadsValue` or `TailsValue`, sets the value to the other one. Otherwise fails.
|
|
* `flip_variable(+Index:variable_index, +HeadsValue:integer, +TailsValue:integer)` - if variable has value `HeadsValue` or `TailsValue`, sets the value to the other one. Otherwise fails.
|
|
|
|
|
|
|
|
## Extensions
|
|
|
|
|
|
|
|
There are several extensions to the NDL query, that can be used in order to increase the language expressiveness.
|
|
|
|
|
|
|
|
### Stochastic mode
|
|
|
|
|
|
|
|
NDL Queries can be compiled as stochastic operator. The stochastic mode impacts ordering of the `variable/(2..6)`, `constraint/3`, `range_element/2` results, effectively returning them in a random fashion. It does **not** impact `for_each` generator.
|
|
|
|
|
|
|
|
**Warning:** stochastic ndl query always backtracks. |