EZCSP Home Page


EZCSP is an inference engine that allows computing extended answer sets of ASP programs, as defined in [bal09a,bal09b].
Intuitively, EZCSP allows a lightweight integration of ASP and constraint programming (CP).
An extended answer set of an ASP program P is a pair consisting of an answer set of P, and of a solution to the constraint satisfaction problem (CSP) defined by such answer set of P.
The current version of EZCSP uses lparse+smodels as ASP solver and SICStus Prolog (version 3.x) as constraint solver. Future versions will support multiple solvers.
The latest release is 1.6.10. You can see a history of the major changes here.

The latest major improvements are:

Installation and Usage

To install EZCSP
  1. Download, compile, and install dlv_rsig.
  2. Download, compile, and install EZCSP.
Note: if dlv_rsig is installed in a non-default location, when configuring ezcsp you will need to set environment variables CFLAGS, CXXFLAGS and LDFLAGS so that the include files and libraries installed with dlv_rsig can be found. Please consult with your system administrator if in doubt.

To run EZCSP
  Usage: ezcsp [-n <nmodels>] [--mkatoms] [-a] [--grounder <path>] [--solver <path>] [[<input file 1>] [<input file 2>...]]
  E.g.: ezcsp -n 0 instance1 main_program
    Finds all the extended answer sets of the program consisting of files instance1 and main_program.

Example of use
Let ex1.ez be the program:
cspdomain(fd).

d(1..2).
cspvar(v(X),10,20) :- d(X).
required(v(1) >= v(2)).
required(sum([v/1],>=,39)).

cspvar(s,20,40).
required(sum([v/1],==,s)).
Executing ezcsp -n 0 p.ez will produce:
Answer: 1
Stable Model: cspdomain(fd) d(1) d(2) required(ezcsp__geq(v(1),v(2))) required(ezcsp__sum(list(v,1),ezcsp__geq,39)) cspvar(s,20,40) required(ezcsp__sum(list(v,1),ezcsp__eq,s)) cspvar(v(1),10,20) cspvar(v(2),10,20) s=39 v(1)=20 v(2)=19 
Answer: 2
Stable Model: cspdomain(fd) d(1) d(2) required(ezcsp__geq(v(1),v(2))) required(ezcsp__sum(list(v,1),ezcsp__geq,39)) cspvar(s,20,40) required(ezcsp__sum(list(v,1),ezcsp__eq,s)) cspvar(v(1),10,20) cspvar(v(2),10,20) s=40 v(1)=20 v(2)=20 
False


Supported Global Constraints

Currently, ezcsp supports the following global constraints (refer to the Sicstus 3.x manual for their meaning):
sum/3
scalar_product/4
serialized/2
cumulative/4
all_different/1
all_distinct/1
count/4
element/3
assignment/2
circuit/1
circuit/2


Licensing

EZCSP and dlv_rsig are copyright (c) Eastman Kodak Company 2009.
EZCSP and dlv_rsig are free for non-commercial use.
Please refer to the license for more details.

Downloads

Before downloading, please read carefully the software's license. Note: EZCSP requires The latest version of mkatoms and gringo+clasp to be installed in a directory that occurs in your PATH variable.
EZCSP should run without problems under most Unix variants and C/C++ compilers. It was tested under *BSD and Linux, and gcc 4.0.3 and 4.3.2.


Questions, Bugs, etc.

Send emails to marcello.balduccini@gmail.com.

Authors

EZCSP was written by Marcello Balduccini.


References

[bal09a] Marcello Balduccini, "Representing Constraint Satisfaction Problems in Answer Set Programming", ICLP09 workshop on Answer Set Programming and Other Computing Paradigms (ASPOCP09) 2009.

[bal09b] Marcello Balduccini, "CR-Prolog as a Specification Language for Constraint Satisfaction Problems", LPNMR 2009.

Back to my home page
Author: Marcello Balduccini (marcello.balduccini@gmail.com)
Last Update: 11/04/2009