A binding to the ECLiPSe Constraint Programming System from node.js
C++ JavaScript Python Other
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
deps/ECLiPSe 5.8
eclipse add ability to get EC_word from EC_functor Jan 18, 2013
install add eclipse files Apr 16, 2013
src
test
.gitignore add initial tests Jan 13, 2013
README.md Update README.md Jan 16, 2013
binding.gyp general tidy up Jan 17, 2013
eclipse.js Change module init function prototype to match newest version of node Aug 23, 2013
package.json
sample.js declare path to eclipse dep Apr 16, 2013

README.md

node-eclipse-clp

Introduction

This is a binding to the ECLiPSe Constraint programming system for javascript. It interfaces with prolog using the C++ interface provided by ECLiPSe.

Setting up

  • Install node.js - http://nodejs.org/
  • Install ECLiPSe Constraint programming system - http://eclipseclp.org/
  • The path to eclipse.dll must be available on your path. This is located at eclipse_installation_path/lib/i386_nt
  • Get the source code git clone git://github.com/danielconnor/node-eclipse-clp.git
  • Set up and build the module npm install

Usage

var
  // load the eclipse module
  eclipse = require("node-eclipse-clp"),
  assert = require("assert");


// initialse the prolog environment and make sure it succeeds
assert.equal(eclipse.init(), eclipse.status.EC_succeed);

// create a reference to a new functor
var writeln = new eclipse.Functor("writeln", 1);

// create a compound term consisting of the functor, writeln, and the argument which is a string.
var compound = eclipse.term(writeln, "hello world");

eclipse.post_goal(compound);

eclipse.resume();

// cleanup the prolog environment
eclipse.cleanup();