The code that runs http://chrjs.net
JavaScript HTML CSS
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
_includes
_layouts
public
src/playground
.gitignore
CNAME
Gemfile
README.md
_config.yml
index.md
package.json
playground.md

README.md

CHR.js Website

The static site that is chrjs.net. Just enter your Constraint Handling Rules, try adding some constraints, and download the generated solver code. Based on CHR.js.

Notation

Rules follow the CHR.js syntax. Additionally, the specification of a preamble containing native JavaScript is allowed:

{
  // preamble
  // code in this block can be used in the rules' guards and bodies

  function print (v) {
    console.log(v)
  }

  function pred (v) {
    return v < 5
  }
}

print_num     @ num(v) ==> ${ (v) => print(v) }
generate_nums @ num(v) ==> ${ (v) => pred(v) } | num(v+1)