... | ... | @@ -71,6 +71,12 @@ NDL query is a Prolog like program, containing rules, with bodies consisting of |
|
|
* first argument is a non-deterministic model clause, i.e. `variable/(2..6)`, `constraint/3`, `range_element/2`
|
|
|
* all `Generator`'s variables are instantiated and available in the `Query`
|
|
|
* queries are run in order, independently, it the query fails on the specific variables' instantiation, it continues with the next assignment
|
|
|
* breadth-first search walk over the constraint graph, in form `walk_over(+Constraint:constraint_query, +Start:constrained_element, +Query:query)`, where:
|
|
|
* `Constraint` is a model clause `constraint/3` with no bound arguments
|
|
|
* `Start` defines the point of walk start; it should be a value that appears as the first argument of Constraint in the model (there is a second operation `walk_over_inverted/3` that inverts the edges direction)
|
|
|
* `Query` can use variables introduced in the `Constraint` term
|
|
|
* if `Query` fails during the walk, the failed branch gets cut, but the walk continues
|
|
|
* BFS remembers all the visited edges, so no edge is visited twice
|
|
|
* conditions `if(+Condition:query,+Then:query)` and `if(+Condition:test,+Then:query,+Else:query)`
|
|
|
* `Condition` contains only one term
|
|
|
* if `Condition` succeeds, `Then` query is evaluated
|
... | ... | |