1,230 research outputs found
The Ciao clp(FD) library. A modular CLP extension for Prolog
We present a new free library for Constraint Logic Programming over Finite Domains, included with the Ciao Prolog system. The library is entirely written in Prolog, leveraging on Ciao's module system and code transformation capabilities in order to achieve a highly modular design without compromising performance. We describe the interface,
implementation, and design rationale of each modular component. The library meets several design goals: a high level of modularity, allowing the individual components to be replaced by different versions; highefficiency, being competitive with other TT> implementations; a glass-box
approach, so the user can specify new constraints at different levels; and a Prolog implementation, in order to ease the integration with Ciao's code analysis components. The core is built upon two small libraries which implement integer ranges and closures. On top of that, a finite domain
variable datatype is defined, taking care of constraint reexecution depending on range changes. These three libraries form what we call the TT> kernel of the library. This TT> kernel is used in turn to implement several higher-level finite domain constraints, specified using indexicals. Together with a labeling module this layer forms what we name the TT> solver. A final level integrates the CLP (J7©) paradigm with our TT> solver. This is achieved using attributed variables and a compiler from
the CLP (J7©) language to the set of constraints provided by the solver. It should be noted that the user of the library is encouraged to work in any of those levels as seen convenient: from writing a new range module to enriching the set of TT> constraints by writing new indexicals
Logic-Based Decision Support for Strategic Environmental Assessment
Strategic Environmental Assessment is a procedure aimed at introducing
systematic assessment of the environmental effects of plans and programs. This
procedure is based on the so-called coaxial matrices that define dependencies
between plan activities (infrastructures, plants, resource extractions,
buildings, etc.) and positive and negative environmental impacts, and
dependencies between these impacts and environmental receptors. Up to now, this
procedure is manually implemented by environmental experts for checking the
environmental effects of a given plan or program, but it is never applied
during the plan/program construction. A decision support system, based on a
clear logic semantics, would be an invaluable tool not only in assessing a
single, already defined plan, but also during the planning process in order to
produce an optimized, environmentally assessed plan and to study possible
alternative scenarios. We propose two logic-based approaches to the problem,
one based on Constraint Logic Programming and one on Probabilistic Logic
Programming that could be, in the future, conveniently merged to exploit the
advantages of both. We test the proposed approaches on a real energy plan and
we discuss their limitations and advantages.Comment: 17 pages, 1 figure, 26th Int'l. Conference on Logic Programming
(ICLP'10
Using parametric set constraints for locating errors in CLP programs
This paper introduces a framework of parametric descriptive directional types
for constraint logic programming (CLP). It proposes a method for locating type
errors in CLP programs and presents a prototype debugging tool. The main
technique used is checking correctness of programs w.r.t. type specifications.
The approach is based on a generalization of known methods for proving
correctness of logic programs to the case of parametric specifications.
Set-constraint techniques are used for formulating and checking verification
conditions for (parametric) polymorphic type specifications. The specifications
are expressed in a parametric extension of the formalism of term grammars. The
soundness of the method is proved and the prototype debugging tool supporting
the proposed approach is illustrated on examples.
The paper is a substantial extension of the previous work by the same authors
concerning monomorphic directional types.Comment: 64 pages, To appear in Theory and Practice of Logic Programmin
A Transformation-based Implementation for CLP with Qualification and Proximity
Uncertainty in logic programming has been widely investigated in the last
decades, leading to multiple extensions of the classical LP paradigm. However,
few of these are designed as extensions of the well-established and powerful
CLP scheme for Constraint Logic Programming. In a previous work we have
proposed the SQCLP (proximity-based qualified constraint logic programming)
scheme as a quite expressive extension of CLP with support for qualification
values and proximity relations as generalizations of uncertainty values and
similarity relations, respectively. In this paper we provide a transformation
technique for transforming SQCLP programs and goals into semantically
equivalent CLP programs and goals, and a practical Prolog-based implementation
of some particularly useful instances of the SQCLP scheme. We also illustrate,
by showing some simple-and working-examples, how the prototype can be
effectively used as a tool for solving problems where qualification values and
proximity relations play a key role. Intended use of SQCLP includes flexible
information retrieval applications.Comment: 49 pages, 5 figures, 1 table, preliminary version of an article of
the same title, published as Technical Report SIC-4-10, Universidad
Complutense, Departamento de Sistemas Inform\'aticos y Computaci\'on, Madrid,
Spai
- …