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 short query specification. authored Oct 18, 2018 by Mateusz Ślażyński's avatar Mateusz Ślażyński
Hide whitespace changes
Inline Side-by-side
specification.md
View page @ 495a7a56
......@@ -39,4 +39,17 @@ NDL model is a typed Prolog program consisting of following predicates:
* Constraint related:
* `constraint(+Name:string, ?Index1:variable_index, ?Index2:variable_index) is nondet` - allows to non-deterministically check if two variables indexed `Index1` and `Index2` are constrained with a constraint named `Name`. Also allows to find indexes satisfying those requirements. Used in the NDL query.
* `is_satisfied(+Name:String, +Index1:variable_index, +Index2:variable_index)` - allows to check if the constraint named `Name` is satisfied on variables indexed `Index1` and `Index2`. Used in the NDL query. **FIXME**
dynamic_predicate(constraint/3, public).
\ No newline at end of file
dynamic_predicate(constraint/3, public).
## Query
NDL query is a Prolog like program, containing rules, with bodies consisting of goals from a predefined set of clauses:
* NDL model clauses: `constraint/2`, `constraint_range/2`, `variable/2`, `new_value/2`, `constraint/3`, `is_satisfied/3`
* binary arithmetic operations: +, -, /, *, div, mod
* binary arithmetic comparisons: =, >=, >, <, <=
* heads of the rules defined in the query itself (allows recursion)
* operation operating on the current solution:
* `get_value(+Index:variable_index, -Value:integer)` - gets the variable's current value
* `set_value(+Index:variable_index, +Value:integer)` - set the variable's value to `Value`
* `swap_values(+Index1:variable_index, +Index2:variable_index)` - swap values of two variables
Clone repository
  • 20181018
  • Theory
  • Home
  • knowledge base
  • specification