Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • N ndl
  • Project information
    • Project information
    • Activity
    • Labels
    • Planning hierarchy
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 1
    • Merge requests 1
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • pro
  • ndl
  • Wiki
  • specification

specification · Changes

Page history
Adds stack authored Nov 06, 2018 by Mateusz Ślażyński's avatar Mateusz Ślażyński
Hide whitespace changes
Inline Side-by-side
specification.md
View page @ 7d3b791b
......@@ -87,6 +87,7 @@ There are several extensions to the NDL query, that can be used in order to incr
### Stochastic mode
Motivation: many meta-heuristics sample only a random subset of neighbohood.
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.
......@@ -99,4 +100,15 @@ Motivation: often one would like to mark a variable as already moved, so the que
* `in_memory(+Arg)` - checks if the argument has ben remembered
* `\+ in_memory(+Arg)` - succeeds if the argument hasn't been remembered
### Stack
Motivation: stack is a useful data structure, allowing to simulate primitive recursion.
Comparing to the **Memory** extension, stacks are ordered (LIFO) and can be queried.
This extension adds three additional constructs:
* `push(+Type:type, +Arg:Type)` - pushes value of `Type` on the stack
* 'pop(+Type:type, -Arg:Type)` - pops value of `Type` from the stack, fails if there is no value of this type on the stack
* `top(+Type:type, -Arg:Type)` - gets the last added element of `Type` from the stack, but doesn't remove it from the stack
* new loop `while(pop(+Type:type, -Arg:Type), Query:query)` - that loops while the stack contains value of a type `Type`
Clone repository
  • 20181018
  • Theory
  • Home
  • knowledge base
  • specification