High-Level Modelling and Reformulation of Constraint Satisfaction Problems

Author(s):  
Brahim Hnich
2018 ◽  
Author(s):  
Mauricio Toro

Constraint Satisfaction Problems (CSPs) in computer music are used to solve harmonic, rhythmic or melodic problems. In addition,they can be used for automatic generation of musical structures satisfying a set of rules. Forinstance, the CSP proposed by compositor Michael Jarrell, which we explain in this document anddetail its implementation. Usually, a CSP is represented by a script defining the variables, theirdomain, and its constraints.Instead of writing a script, in Gelisp for OpenMusic (OM) we represent a program with a specialpatch. A patch is a visual algorithm, in which boxes represent functional calls, and connectionsare functional compositions. Inside this CSP patch, we can place special boxes: to connect eachconstraint in the CSP, to define variable and value heuristics, to define a time limit in the search,to connect the list of variables that we want to observe, and a box to connect the variable to bethe optimization criterion during the search.Furthermore, we provide a variety of boxes to represent simple constraints (e.g., a = b anda < 2) and high-level constraints (e.g., “the motive A occurs n times in the sequence S”). Theoutput of a CSP patch can be connected to three different kind of boxes: to find one solution, tofind all the solutions, and to perform propagation (narrow the domain of the variables) withoutsearch.


2020 ◽  
Vol 34 (09) ◽  
pp. 13436-13443
Author(s):  
Chenliang Zhou ◽  
Dominic Kuang ◽  
Jingru Liu ◽  
Hanbo Yang ◽  
Zijia Zhang ◽  
...  

AIspace is a set of tools used to learn and teach fundamental AI algorithms. The original version of AIspace was written in Java. There was not a clean separation of the algorithms and visualization; it was too complicated for students to modify the underlying algorithms. Its next generation, AIspace2, is built on AIPython, open source Python code that is designed to be as close as possible to pseudocode. AISpace2, visualized in JupyterLab, keeps the simple Python code, and uses hooks in AIPython to allow visualization of the algorithms. This allows students to see and modify the high-level algorithms in Python, and to visualize the output in a graphical form, aiming to better help them to build confidence and comfort in AI concepts and algorithms. So far we have tools for search, constraint satisfaction problems (CSP), planning and Bayesian network. In this paper we outline the tools and give some evaluations based on user feedback.


2013 ◽  
Vol 44 (2) ◽  
pp. 131-156 ◽  
Author(s):  
Laura Climent ◽  
Richard J. Wallace ◽  
Miguel A. Salido ◽  
Federico Barber

Author(s):  
Marlene Arangú ◽  
Miguel Salido

A fine-grained arc-consistency algorithm for non-normalized constraint satisfaction problems Constraint programming is a powerful software technology for solving numerous real-life problems. Many of these problems can be modeled as Constraint Satisfaction Problems (CSPs) and solved using constraint programming techniques. However, solving a CSP is NP-complete so filtering techniques to reduce the search space are still necessary. Arc-consistency algorithms are widely used to prune the search space. The concept of arc-consistency is bidirectional, i.e., it must be ensured in both directions of the constraint (direct and inverse constraints). Two of the most well-known and frequently used arc-consistency algorithms for filtering CSPs are AC3 and AC4. These algorithms repeatedly carry out revisions and require support checks for identifying and deleting all unsupported values from the domains. Nevertheless, many revisions are ineffective, i.e., they cannot delete any value and consume a lot of checks and time. In this paper, we present AC4-OP, an optimized version of AC4 that manages the binary and non-normalized constraints in only one direction, storing the inverse founded supports for their later evaluation. Thus, it reduces the propagation phase avoiding unnecessary or ineffective checking. The use of AC4-OP reduces the number of constraint checks by 50% while pruning the same search space as AC4. The evaluation section shows the improvement of AC4-OP over AC4, AC6 and AC7 in random and non-normalized instances.


2001 ◽  
Vol 1 (6) ◽  
pp. 713-750 ◽  
Author(s):  
KRZYSZTOF R. APT ◽  
ERIC MONFROY

We study here a natural situation when constraint programming can be entirely reduced to rule-based programming. To this end we explain first how one can compute on constraint satisfaction problems using rules represented by simple first-order formulas. Then we consider constraint satisfaction problems that are based on predefined, explicitly given constraints. To solve them we first derive rules from these explicitly given constraints and limit the computation process to a repeated application of these rules, combined with labeling. We consider two types of rule here. The first type, that we call equality rules, leads to a new notion of local consistency, called rule consistency that turns out to be weaker than arc consistency for constraints of arbitrary arity (called hyper-arc consistency in Marriott & Stuckey (1998)). For Boolean constraints rule consistency coincides with the closure under the well-known propagation rules for Boolean constraints. The second type of rules, that we call membership rules, yields a rule-based characterization of arc consistency. To show feasibility of this rule-based approach to constraint programming, we show how both types of rules can be automatically generated, as CHR rules of Frühwirth (1995). This yields an implementation of this approach to programming by means of constraint logic programming. We illustrate the usefulness of this approach to constraint programming by discussing various examples, including Boolean constraints, two typical examples of many valued logics, constraints dealing with Waltz's language for describing polyhedral scenes, and Allen's qualitative approach to temporal logic.


Sign in / Sign up

Export Citation Format

Share Document