... | @@ -90,3 +90,13 @@ There are several extensions to the NDL query, that can be used in order to incr |
... | @@ -90,3 +90,13 @@ There are several extensions to the NDL query, that can be used in order to incr |
|
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.
|
|
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.
|
|
**Warning:** stochastic ndl query always backtracks.
|
|
|
|
|
|
|
|
### Memory
|
|
|
|
|
|
|
|
Motivation: often one would like to mark a variable as already moved, so the query won't try to change it again. It's not possible to query the memory. It's impossible to remove elements from the memory or query it in a generative manner. This extension adds three additional constructs:
|
|
|
|
|
|
|
|
* `remember(+Arg)` - stored argument in the global memory, argument can be any value
|
|
|
|
* `in_memory(+Arg)` - checks if the argument has ben remembered
|
|
|
|
* `\+ in_memory(+Arg)` - succeeds if the argument hasn't been remembered
|
|
|
|
|
|
|
|
|