<?xml version="1.0" encoding="iso-8859-1"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>My Constraint Programming Blog</title>
    <link rel="alternate" type="text/html" href="http://www.hakank.org/constraint_programming_blog/" />
    <link rel="self" type="application/atom+xml" href="http://www.hakank.org/constraint_programming_blog/atom.xml" />
   <id>tag:www.hakank.org,2013:/constraint_programming_blog/3</id>
    <link rel="service.post" type="application/atom+xml" href="http://www.hakank.org/webblogg/mt-atom.cgi/weblog/blog_id=3" title="My Constraint Programming Blog" />
    <updated>2013-05-12T06:26:52Z</updated>
    <subtitle>This is my blog about constraint programming and related paradigms, e.g. news about and models in some of my favorite constraint programming languages (MiniZinc, Zinc, JaCoP, Choco, Gecode, Gecode/R, Comet, ECLiPSe, Minion/Tailor, SICStus Prolog, Numberjack, OscaR, AIMMS-CP, Google or-tools, B-Prolog, etc). See http://www.hakank.org/ for more about me (Hakan Kjellerstrand, hakank@gmail.com). Twitter:  hakankj.</subtitle>
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type 3.2</generator>
 
<entry>
    <title>Program for SweConsNet Workshop 2013 (Lund, 27 May 2013)</title>
    <link rel="alternate" type="text/html" href="http://www.hakank.org/constraint_programming_blog/2013/05/program_for_sweconsnet_workshop_2013_lund_27_may_2013.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.hakank.org/webblogg/mt-atom.cgi/weblog/blog_id=3/entry_id=1485" title="Program for SweConsNet Workshop 2013 (Lund, 27 May 2013)" />
    <id>tag:www.hakank.org,2013:/constraint_programming_blog//3.1485</id>
    
    <published>2013-05-12T06:26:13Z</published>
    <updated>2013-05-12T06:26:52Z</updated>
    
    <summary>Here is the program for The 12th Workshop of the Network of Sweden-based researchers and practitioners of Constraint programming: SweConsNet is the Network for Sweden-based researchers and practitioners of Constraint programming. Following the previous successful workshops, we would like to...</summary>
    <author>
        <name>hakank</name>
        <uri>http://www.hakank.org/webblogg</uri>
    </author>
    
    <content type="html" xml:lang="en" xml:base="http://www.hakank.org/constraint_programming_blog/">
        <![CDATA[Here is the program for <a href="http://www.lth.se/programvaruportalen/kalendarium/sweconsnet_workshop_2013">The 12th Workshop of the Network of Sweden-based researchers and practitioners of Constraint programming</a>:

<blockquote>
<a href="http://www.it.uu.se/SweConsNet/">SweConsNet</a> is the Network for Sweden-based researchers and practitioners of Constraint programming.
<br><br>
Following the previous successful workshops, we would like to announce the 12th SweConsNet workshop, which will take place in Lund, Sweden on May 27th 2013. The purpose of this workshop is to learn about ongoing research in constraint programming, as well as existing projects and products. We will also discuss the further development of the network, such as a possible widening to other Nordic countries.
<br><br>
The workshop is open to everybody interested in the theory and practice of constraint programming, whether based in Sweden or elsewhere. The scope of the workshop spans all areas of Constraint Programming, and is open to presentations and discussions addressing topics related to both theory and application.
<br><br>
Please forward a link of this page to people who might be interested but are not yet on the SweConsNet mailing list. They can subscribe to it by sending a message to Justin.Pearson [at] it.uu.se.
<br><br>
We hope for your participation, and highly encourage you to submit a proposal for a presentation of your ongoing work, recent results, or of a relevant discussion topic. There are no paper submissions, reviews, or proceedings, hence recent conference/journal papers may also be presented.
<br><br>
To register for partcipation  in the <a href="http://www.lth.se/programvaruportalen/kalendarium/sweconsnet_workshop_2013/registration_for_sweconsnet13/">registration form</a> no later than May 22.  The workshop does not have a registration fee.
<br><br>

<h4>Program</h4>
<table>
<tbody><tr><td><b>Time</b></td><td><b>Content</b></td></tr>
<tr><td>09.30</td><td><b>Registration and coffee</b></td></tr>
<tr>
<td style="vertical-align: top;" >10.00</td><td><p>Jean-Noël Monette (Uppsala University)<br><b>Towards solver-independent propagators</b></p><p>We present an extension to indexicals to describe propagators for global constraints. The resulting language is compiled into actual propagators for different solvers, and is solver-independent. In addition, we show how this high-level description eases the proof of propagator properties, such as correctness and monotonicity. Experimental results show that propagators compiled from their indexical descriptions are sometimes not significantly slower than built-in propagators of Gecode. Therefore, our language can be used for the rapid prototyping of new global constraints</p></td></tr>

<tr><td style="vertical-align: top; " abbr="">10.40</td><td><p>Mats Carlsson (SICS) (joint work with Nicolas Beldiceanu &amp; Aranud Letort)<br><b>Scalable Scheduling Constraints</b></p><p>The topic of this talk is synchronized sweep-based filtering algorithms for resource and precedence constraints that are common in scheduling problems. &nbsp;We first describe a sweep-based implementation of the time-tabling method for "cumulative". Step by step, we then extend this algorithm to handle colored resources, multiple resources, and precedences. &nbsp;We also derive from the filtering algorithm a greedy assignment algorithm, which is useful for very large scale problems where normal tree search would run out of memory.</p></td></tr>

<tr><td style="vertical-align: top; " abbr="">11.20</td><td><p>Mehmet A. Arslan (LTH)<br><b>Instruction Selection and Scheduling for DSP Kernels on Custom Architectures</b></p><p>As custom architectures become more and more common for DSP applications, instruction selection and scheduling for such applications and architectures become important topics. In this paper, we explore the effects of defining the problem of finding an optimal instruction selection and scheduling as a constraint satisfaction problem (CSP). We incorporate methods based on sub-graph isomorphism and global constraints designed for scheduling. We experiment using several media applications on a custom architecture, a generic VLIW architecture and a RISC architecture, all three with several cores. Our results show that defining the problem with constraints gives flexibility in modeling, while state-of-the-art constraint solvers enable optimal solutions for large problems, hinting a new method for code generation.&nbsp;</p></td></tr>

<tr><td>12.00</td><td>LUNCH</td></tr><tr><td style="vertical-align: top; " abbr="">13.00</td><td><p>Kim-Anh Tran (SICS)<br><b>Investigation of Implied Constraints in a Constraint-Based Compiler Back-end<br></b><br>Adding implied constraints addressing register allocation and&nbsp;instruction scheduling to the constraint model of a compiler back-end&nbsp;can be crucial to the performance of the code generator. In the hope&nbsp;of cutting down the search effort, implied constraints are&nbsp;investigated, implemented and evaluated. The talk will cover current&nbsp;findings of a master thesis on a set of implied constraints and give&nbsp;an insight into their actual impact on the code generation problem.</p></td></tr>

<tr><td rowspan="1" style="vertical-align: top; " abbr="">13.40</td><td rowspan="1"><p>Håkan Kjellerstrand<br><b>What I like about Constraint Programming</b></p><p>This is a presentation about fascinating features in Constraint Programming: those I personally find very appealing and/or unique (e.g. compared to other programming paradigms/systems), especially regarding the modeling aspect.</p></td></tr>

<tr><td rowspan="1" style="vertical-align: top; " abbr="">14.20</td><td rowspan="1"><p>Björn Regnell (LTH)<br><b>A Scala DSL for Constraint-based Requirement Engeineering</b></p><p>Software Requirements Engineering (RE) includes the challenging activities of release planning and prioritization, which both are suitable to be tackled by constraint solving. However, there is a need for integrating the representation of software requirements with the representation of constraints in a way that is easy to use by practitioners. This talk aims to interactively discuss what types of constraints are essential in this domain and present and invite feedback on a prototype tool that provides a Scala-internal DSL for Constraint-based RE, wrapping the JaCoP solver.</p></td></tr>

<tr><td rowspan="1">15.00</td><td rowspan="1">Coffee break</td></tr>

<tr><td rowspan="1" style="vertical-align: top; " abbr="">15.30</td><td rowspan="1"><p>Krzysztof Kuchcinski (LTH)&nbsp;<br><b>Mapping Streaming Application into MPSoc</b></p><p></p></td></tr><tr><td rowspan="1">16.10</td><td rowspan="1">Workshop closure</td>
</table>
</blockquote>]]>
        
    </content>
</entry>
<entry>
    <title>CP-2013 Workshops</title>
    <link rel="alternate" type="text/html" href="http://www.hakank.org/constraint_programming_blog/2013/05/cp2013_workshops.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.hakank.org/webblogg/mt-atom.cgi/weblog/blog_id=3/entry_id=1484" title="CP-2013 Workshops" />
    <id>tag:www.hakank.org,2013:/constraint_programming_blog//3.1484</id>
    
    <published>2013-05-06T19:30:51Z</published>
    <updated>2013-05-06T19:31:43Z</updated>
    
    <summary>The Workshops for CP-2013 (Uppsala, 16 September 2013) has been published. From the Workshops page: The following workshops will take place before the main conference on September 16. WCB13: Constraint Based Methods for Bioinformatics WCB&apos;13 is the 9-th of a...</summary>
    <author>
        <name>hakank</name>
        <uri>http://www.hakank.org/webblogg</uri>
    </author>
            <category term="Conferences" />
    
    <content type="html" xml:lang="en" xml:base="http://www.hakank.org/constraint_programming_blog/">
        <![CDATA[The <a href="http://cp2013.a4cp.org/workshops">Workshops</a> for <a href="http://cp2013.a4cp.org/">CP-2013</a> (Uppsala, 16 September 2013) has been published. From the <a href="http://cp2013.a4cp.org/workshops">Workshops</a> page:

<blockquote>
<p>The following workshops will take place before the main conference on September 16.</p>

<h4>WCB13: Constraint Based Methods for Bioinformatics</h4>
<p>WCB'13 is the 9-th of a series of consecutive Workshop on Constraint Based Methods for Bioinformatics. The topics of interest are all those concerning bioinformatics and constraints and related techniques.<br><em><a href="http://cp2013.a4cp.org/workshops/wcb">workshop homepage</a></em></p>

<h4>TRICS13: Techniques foR Implementing Constraint programming Systems</h4>
<p>Constraint programming systems are software systems that support the modeling and solving of problems using constraint programming. Such systems include constraint programming libraries and runtime systems for constraint programming languages. This workshop, the fourth in the series, will focus on implementation issues of such systems.<br><em><a href="http://cp2013.a4cp.org/workshops/trics">workshop homepage</a></em></p>

<h4>CSP-SAT: 3rd International Workshop on the Cross-Fertilization between CSP and SAT</h4>
<p>Constraint Satisfaction Problems (CSP’s) and Boolean Satisfiability Problems (SAT) have much in common. However, they also differ in many important aspects, which result in major differences in solution techniques. This workshop is designed as a venue for bridging the gap and for cross-fertilization between the two communities.</p>

<h4>CP Solvers: Modeling, Applications, Integration, and Standardization</h4>
<p>The objective of this workshop is to get an industrial overview of currently available CP solvers and their use in real-world applications. The focus of the workshop will be not on implementation but rather on modeling, applications, integration, and standardization. Such an overview will fill a gap in the program of recent CP conferences and will allow CP developers and researchers to share the most recent experience of the actual use of different CP-based tools.<br><em><a href="http://cp2013.a4cp.org/workshops/cpsolvers">workshop homepage</a></em></p>

<h4>Workshop on Optimization for Smart Cities</h4>
<p>Policy makers who run the complex network of diverse people, expected services and aging infrastructure are on a constant search for more efficient ways to analyse data, anticipate problems and coordinate resources in their cities. This workshop has the purpose of bringing together scholars and practitioners that work on the solution of problems related to the improvement of the quality of life and the use of resources in cities, to make cities smarter.<br><em><a href="http://cp2013.a4cp.org/workshops/opt4smartcities">workshop homepage</a></em></p>

<h4>COSpeL: Domain Specific Languages in Combinatorial Optimization</h4>
<p>Domain Specific Languages (DSLs) are programming languages or libraries developed to handle specific tasks. The aim of COSpeL is to bring together people interested in the development and use of DSLs in the context of combinatorial optimization.<br><em><a href="http://cp2013.a4cp.org/workshops/cospel">workshop homepage</a></em></p>

<h4>ModRef: Constraint Modelling and Reformulation</h4>
<p>This workshop covers modelling and reformulation techniques that make constraint programming more accessible and easier to use, widening the use of CP technology.<br><em><a href="http://cp2013.a4cp.org/workshops/modref">workshop homepage</a></em></p>
</div>
</blockquote>

As mentioned <a href="http://www.hakank.org/constraint_programming_blog/2013/04/cp2013_workshop_cp_solvers_modeling_applications_integration_and_stand.html">earlier</a>, I have a special interest in the <a href="http://cp2013.a4cp.org/workshops/cpsolvers">CP Solvers: Modeling, Applications, Integration, and Standardization</a> Workshop 
]]>
        
    </content>
</entry>
<entry>
    <title>CP-2013 CP Solver Workshop: Survey of CP Solvers</title>
    <link rel="alternate" type="text/html" href="http://www.hakank.org/constraint_programming_blog/2013/04/cp2013_cp_solver_workshop_survey_of_cp_solvers.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.hakank.org/webblogg/mt-atom.cgi/weblog/blog_id=3/entry_id=1483" title="CP-2013 CP Solver Workshop: Survey of CP Solvers" />
    <id>tag:www.hakank.org,2013:/constraint_programming_blog//3.1483</id>
    
    <published>2013-04-25T06:14:54Z</published>
    <updated>2013-04-25T06:15:27Z</updated>
    
    <summary>An addendum to CP-2013 Workshop &quot;CP Solvers: Modeling, Applications, Integration, and Standardization&quot; (Uppsala, Sweden): If you an author of a CP solver, we ask you to fill out the following questionnaire (even if you do not plan to submit a...</summary>
    <author>
        <name>hakank</name>
        <uri>http://www.hakank.org/webblogg</uri>
    </author>
            <category term="Conferences" />
            <category term="Constraint programming, general" />
    
    <content type="html" xml:lang="en" xml:base="http://www.hakank.org/constraint_programming_blog/">
        <![CDATA[An addendum to <a href="http://www.hakank.org/constraint_programming_blog/2013/04/cp2013_workshop_cp_solvers_modeling_applications_integration_and_stand.html">CP-2013 Workshop "CP Solvers: Modeling, Applications, Integration, and Standardization" (Uppsala, Sweden)</a>:

<blockquote>
If you an author of a CP solver, we ask you to fill out the following <a href="http://openrules.com/cpsolvers/">questionnaire</a> (even if you do not plan to submit a presentation or attend the workshop). We plan to present a summary of all CP Solvers at this website before the start of the conference. 
</blockquote>


And here is the link to the workshop page: <a href="http://cp2013.a4cp.org/workshops/cpsolvers">Workshop "CP Solvers: Modeling, Applications, Integration, and Standardization"</a>.]]>
        
    </content>
</entry>
<entry>
    <title>CP-2013 Workshop &quot;CP Solvers: Modeling, Applications, Integration, and Standardization&quot; (Uppsala, Sweden)</title>
    <link rel="alternate" type="text/html" href="http://www.hakank.org/constraint_programming_blog/2013/04/cp2013_workshop_cp_solvers_modeling_applications_integration_and_stand.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.hakank.org/webblogg/mt-atom.cgi/weblog/blog_id=3/entry_id=1482" title="CP-2013 Workshop &quot;CP Solvers: Modeling, Applications, Integration, and Standardization&quot; (Uppsala, Sweden)" />
    <id>tag:www.hakank.org,2013:/constraint_programming_blog//3.1482</id>
    
    <published>2013-04-23T20:27:25Z</published>
    <updated>2013-04-25T06:07:15Z</updated>
    
    <summary>I&apos;m very happy to announce the CP-2013 Workshop &quot;CP Solvers: Modeling, Applications, Integration, and Standardization&quot;: To be held at the 19th International Conference on the Principles and Practice of Constraint Programming (http://cp2013.a4cp.org/) in Uppsala, Sweden on Monday September 16, 2013....</summary>
    <author>
        <name>hakank</name>
        <uri>http://www.hakank.org/webblogg</uri>
    </author>
            <category term="Conferences" />
    
    <content type="html" xml:lang="en" xml:base="http://www.hakank.org/constraint_programming_blog/">
        <![CDATA[I'm very happy to announce the <a href="http://cp2013.a4cp.org/">CP-2013</a> <a href="http://cp2013.a4cp.org/workshops/cpsolvers">Workshop "CP Solvers: Modeling, Applications, Integration, and Standardization"</a>:
<blockquote>
To be held at the 19th International Conference on the Principles and Practice of Constraint Programming (<a href="http://cp2013.a4cp.org/">http://cp2013.a4cp.org/</a>) in Uppsala, Sweden on Monday September 16, 2013.
<br><br>

<p><strong>Objectives and Scope</strong><br>
The objective of this workshop is to get an industrial overview of currently available CP solvers and their use in real-world applications. The focus of the workshop will be not on implementation but rather on modeling, applications, integration, and standardization. Such an overview will fill a gap in the program of recent CP conferences and will allow CP developers and researchers to share the most recent experience of the actual use of different CP-based tools. 
</p>

<p>We invite authors of all commercial and open source CP solvers to submit their presentations that should include (but not be limited to) the following topics: </p>
<ul><li>Demonstration of modeling facilities using a commonly known problem from the <a target="_blank" href="http://www.csplib.org">CSPLib</a>
<li>Implementation programming languages and why they were selected
<li>Covered variable types, global constraints, and search algorithms
<li>Integration with LP/MIP/SAT tools
<li>Integration with business rules, predictive analytics, and other decision making techniques
<li>Real-world use: positive and negative experience
<li>Standardization and future plans
</ul>

If you an author of a CP solver, we ask you to fill out the following <a href="http://openrules.com/cpsolvers/">questionnaire</a> (even if you do not plan to submit a presentation or attend the workshop). We plan to present a summary of all CP Solvers at this website before the start of the conference.

<p>We also welcome application developers and researchers who use different CP tools and who are willing to share their practical experience.

<p>A special focus will be on CP standardization efforts including:</p>
<ul>
<li> Development of CP APIs for different programming environments
<li>CP XML for interchange of constraint satisfaction/optimization problems
<li>CP design patterns
<li>Libraries of commonly used constraints
<li>Collections of constraint satisfaction and optimization problems.
</ul><p>An expert panel discussion will be held at the end of this one-day workshop.
<p>We hope that the workshop will help to improve communication between different CP vendors, between solver developers and their users, and will ultimately encourage a wider use of CP technology as a key component of the modern decision making applications.

<p><strong>Target Audience</strong></p>
<ul><li>Developers and users of different CP solvers
<li>Business application developers who want to incorporate CP-based tools into their decision support systems</li>
<li>CP researchers.</li>
</ul><p><strong> Schedule</strong><br>
[To be defined]</p>
<p><strong>Important Dates</strong></p>
<ul><li><strong>Sunday, June 16</strong>           Presentation title and abstract submission
<li><strong>Tuesday, July 16</strong>           Acceptance notification
<li><strong>Friday, August 16</strong>         Complete presentation submission
<li><strong>Monday, September 16</strong> Workshop
</ul>

<p><strong>Organizing Committee</strong></p>
<p>•         Jacob Feldman, OpenRules, Monroe, NJ, USA <a href="mailto:jacobfeldman@openrules.com">jacobfeldman@openrules.com</a><br>
•         Helmut Simonis, 4C, Cork, Ireland <a href="mailto:h.simonis@4c.ucc.ie">h.simonis@4c.ucc.ie</a><br>
•         Hakan Kjellerstrand, Independent Researcher, Malmo, Sweden <a href="mailto:hakank@gmail.com">hakank@gmail.com</a></p>
<p><strong>Submission</strong><br>

All abstracts and presentations must be submitted in PDF format using <a target="_blank" href="https://www.easychair.org/conferences/?conf=cpsolvers2013">EasyChair</a>. All accepted presentations will be made publicly available of the workshop’s website. At least one author of any accepted presentation must attend the event. An accepted presentation will be withdrawn if no such participation is secured with the payment of the workshop dues.</p>
</blockquote>

Please note that we invite authors of <b>all</b> CP solvers written using any languages to make brief presentations of their tools.
<br><br>
This is exciting, not only for the workshop itself (which is about my favorite areas in CP), but also because I'm a co-organizer (an honourable task). This will be very interesting. I hope to see you there!
]]>
        
    </content>
</entry>
<entry>
    <title>SweConsNet Workshop 2013 - Second call for presentations and participation</title>
    <link rel="alternate" type="text/html" href="http://www.hakank.org/constraint_programming_blog/2013/04/sweconsnet_workshop_2013_second_call_for_presentations_and_participati.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.hakank.org/webblogg/mt-atom.cgi/weblog/blog_id=3/entry_id=1481" title="SweConsNet Workshop 2013 - Second call for presentations and participation" />
    <id>tag:www.hakank.org,2013:/constraint_programming_blog//3.1481</id>
    
    <published>2013-04-22T18:10:00Z</published>
    <updated>2013-04-22T18:11:12Z</updated>
    
    <summary>Second call for presentations and participation: The 12th workshop of SweConsNet, the Network for Sweden-based researchers and practitioners of Constraint programming, Hosted at Lund University, Lund, Sweden, May 27th, 2013. The 12th Workshop of the Network of Sweden-based researchers and...</summary>
    <author>
        <name>hakank</name>
        <uri>http://www.hakank.org/webblogg</uri>
    </author>
            <category term="SweConsNet" />
    
    <content type="html" xml:lang="en" xml:base="http://www.hakank.org/constraint_programming_blog/">
        <![CDATA[Second call for presentations and participation: <a href="http://www.lth.se/programvaruportalen/kalendarium/sweconsnet_workshop_2013">The 12th workshop of SweConsNet</a>,  the Network for Sweden-based researchers and practitioners of Constraint programming, Hosted at Lund University, Lund, Sweden, May 27th, 2013.


<blockquote>
The 12th Workshop of the Network of Sweden-based researchers and practitioners of Constraint programming
<br><br>
SweConsNet is the Network for Sweden-based researchers and practitioners of Constraint programming.
<br><br>
Following the previous successful workshops, we would like to announce the 12th SweConsNet workshop, which will take place in Lund, Sweden on May 27th 2013. The purpose of this workshop is to learn about ongoing research in constraint programming, as well as existing projects and products. We will also discuss the further development of the network, such as a possible widening to other Nordic countries.
<br><br>
The workshop is open to everybody interested in the theory and practice of constraint programming, whether based in Sweden or elsewhere. The scope of the workshop spans all areas of Constraint Programming, and is open to presentations and discussions addressing topics related to both theory and application.
<br><br>
Please forward a link of this page to people who might be interested but are not yet on the SweConsNet mailing list. They can subscribe to it by sending a message to Justin.Pearson [at] it.uu.se.
<br><br>
We hope for your participation, and highly encourage you to submit a proposal for a presentation of your ongoing work, recent results, or of a relevant discussion topic. There are no paper submissions, reviews, or proceedings, hence recent conference/journal papers may also be presented.
<br><br>
To register, please fill your data <a href="http://www.lth.se/programvaruportalen/kalendarium/sweconsnet_workshop_2013/registration_for_sweconsnet13/">in the registration form</a>. If you want to propose a presentation, please send also the title and the abstract of your talk. In order to facilitate organization, please notify us of your intention to participate as soon as possible, and at the latest before May 10th, 2013. The workshop does not have a registration fee.
<br><br>
<b>In the program so far</b>
<br><br>
<b>Participants will be presented continously</b>
<br><br>
1. Jean-Noël Monette (Uppsala University): Towards solver-independent propagators
<br><br>
2. Håkan Kjellerstrand: What I <b>(still)</b> like about Constraint Programming
<br><br>
3. Mats Carlsson (SICS), TBD.
<br><br>
4. Christian Schulte (KTH), TBD.
<br><br>
5. Björn Regnell (LTH),A Scala DSL for Constraint-based Requirement Engeineering
<br><br>
6. Mehmet A. Arslan (LTH), Instructions Selection and Scheduling for DSP Kernels on Custom Architectures.
</blockquote>

I just registered my own talk: <b>What I (still) like about Constraint Programming.</b>
with the Presentation abstract:
<blockquote>
This is a presentation about fascinating features in Constraint Programming: those I personally find very
appealing and/or unique (e.g. compared to other programming
paradigms/systems), especially regarding the modeling aspect.
</blockquote>

I guess that many/most of the attendants know these "fascinating features" already, but all might not agree (I hope) that they are as important (or fascinating) as I find them.

]]>
        
    </content>
</entry>
<entry>
    <title>The MiniZinc Challenge 2013 and other MiniZinc news</title>
    <link rel="alternate" type="text/html" href="http://www.hakank.org/constraint_programming_blog/2013/04/the_minizinc_challenge_2013_and_other_minizinc_news.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.hakank.org/webblogg/mt-atom.cgi/weblog/blog_id=3/entry_id=1480" title="The MiniZinc Challenge 2013 and other MiniZinc news" />
    <id>tag:www.hakank.org,2013:/constraint_programming_blog//3.1480</id>
    
    <published>2013-04-11T05:40:37Z</published>
    <updated>2013-04-11T05:41:22Z</updated>
    
    <summary>Here are some news from the G12 MiniZinc world. MiniZinc main page: www.minizinc.org The MiniZinc main page has changed to www.minizinc.org. MiniZinc challenge From MiniZinc Challenge 2013: The aim of the MiniZinc Challenge is to start to compare various constraint...</summary>
    <author>
        <name>hakank</name>
        <uri>http://www.hakank.org/webblogg</uri>
    </author>
            <category term="Competitions" />
            <category term="MiniZinc/Zinc" />
    
    <content type="html" xml:lang="en" xml:base="http://www.hakank.org/constraint_programming_blog/">
        <![CDATA[Here are some news from the <a href="http://www.minizinc.org/">G12 MiniZinc</a> world.

<h3>MiniZinc main page: www.minizinc.org</h3>
The MiniZinc main page has changed to <a href="http://www.minizinc.org/">www.minizinc.org</a>.

<h3>MiniZinc challenge</h3>
From <a href="http://www.minizinc.org/challenge2013/challenge.html">MiniZinc Challenge 2013</a>:
<blockquote>
The aim of the MiniZinc Challenge is to start to compare various constraint
solving technology on the same problems sets. The focus is on finite domain
propagation solvers. An auxiliary aim is to build up a library of
interesting problem models, which can be used to compare solvers and solving
technologies.
<br><br>
Entrants to the challenge provide a FlatZinc solver and global constraint
definitions specialized for their solver. Each solver is run on 100 MiniZinc
model instances. We run the translator mzn2fzn on the MiniZinc model and
instance using the provided global constraint definitions to create a
FlatZinc file. The FlatZinc file is input to the provided solver. Points are
awarded for solving problems, speed of solution, and goodness of solutions
(for optimization problems).
<br><br>
Registration opens: Wed, 1 May 2013.<br>
Problem submission deadline: Fri, 14 June 2013.<br>
Initial submission round begins: Mon, 1 July 2013.<br>
Initial submission round ends: Fri, 19 July 2013.<br>
Final submissions: Fri, 2 August 2013.<br>
Announcement of results at CP2013: 17 - 20 September 2013.<br>
<br><br>
For details of the competition see:
<br><br>
    http://www.minizinc.org/challenge2013/challenge.html
<br><br>
Note that the scoring system has slightly changed this year, so that solvers
that obtain indistiguishable results in quality of solution split the points
inversely proportional to the time taken
<br><br>
To register for the challenge please email
<br><br>
   mzn-challenge@minizinc.org
<br><br>
</blockquote>

Here is the <a href="http://www.minizinc.org/challenge2013/call_for_problems.html">Call for Problem Submission</a>:
<blockquote>
The MiniZinc Challenge is an annual solver competition in the Constraint Programming (CP) community held before the International Conference on Principles and Practice of Constraint Programming. The MiniZinc Challenge 2013 is seeking interesting problem sets on which various constraint solving technologies should be compared on this year. Everyone is allowed to submit problems regardless of whether they are an entrant in the challenge.
<br><br>
Important dates and deadlines:
<br><br>
    Problem submission open: now<br>
    Problem submission deadline: Fri, 14 June 2013
<br><br>
Problem submission
<br><br>
    Send an email with the subject line “[MZNC13] benchmark” to mzn-challenge 'at' minizinc.org 
<br><br>
There are no restrictions on the kind of problems, but ideally they should be of interesting nature such as practice-related problems and puzzles etc. Problem submissions with real-world instances are welcome warmly. Models for the 2013 challenge can only use integer and Boolean variables.
<br><br>
The problem submitter provides a MiniZinc model of the problem and 20 instances ranging from easy-to-solve to hard-to-solve for an “ordinary” CP system. It is strongly encouraged to make use of the global constraint definitions provided in the MiniZinc 1.6 distribution. Please, follow the links below for submission instructions and requirements.
<br>
<a href="http://www.minizinc.org/challenge2013/">MiniZinc Challenge 2013</a>
</blockquote>

Also see:  <a href="http://www.minizinc.org/challenge.html">MiniZinc Challenge Medals 2008-2012</a>


<h3>MiniZinc forum</h3>
Also just released is <a href="https://www.minizinc.org/forum/index.php">The MiniZinc forums</a>  with three forums:
  <ul>
    <li> <a href="https://www.minizinc.org/forum/viewforum.php?f=3">Beginners</a>: All beginner-level questions about MiniZinc. 
    <li> <a href="https://www.minizinc.org/forum/viewforum.php?f=4">Users</a>: General discussion about MiniZinc. For beginners' questions please use the dedicated Beginners' Forum. 
    <li> <a href="https://www.minizinc.org/forum/viewforum.php?f=5">Developers</a>: Discussions about developing the MiniZinc system and solvers that interface with MiniZinc. 
  </ul>
]]>
        
    </content>
</entry>
<entry>
    <title>Gecode version 4.0.0 released</title>
    <link rel="alternate" type="text/html" href="http://www.hakank.org/constraint_programming_blog/2013/03/gecode_version_400_released_1.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.hakank.org/webblogg/mt-atom.cgi/weblog/blog_id=3/entry_id=1479" title="Gecode version 4.0.0 released" />
    <id>tag:www.hakank.org,2013:/constraint_programming_blog//3.1479</id>
    
    <published>2013-03-14T20:46:46Z</published>
    <updated>2013-03-14T21:00:51Z</updated>
    
    <summary>Gecode version 4.0.0 has been released. Congrats to the developers! From the Changelog: Changes in Version 4.0.0 (2013-03-14) This release adds a multitude of new features, fixes many bugs, and offers a number of performance improvements. There are too many...</summary>
    <author>
        <name>hakank</name>
        <uri>http://www.hakank.org/webblogg</uri>
    </author>
            <category term="Gecode" />
    
    <content type="html" xml:lang="en" xml:base="http://www.hakank.org/constraint_programming_blog/">
        <![CDATA[<a href="http://www.gecode.org">Gecode</a> version 4.0.0 has been released.  Congrats to the developers!
<br><br>
From the <a href="http://www.gecode.org/doc-latest/reference/PageChange.html#SectionChanges_4_0_0">Changelog</a>:

<blockquote>
<b>Changes in Version 4.0.0 (2013-03-14)</b>

<p>This release adds a multitude of new features, fixes many bugs, and offers a number of performance improvements. There are too many major improvements to even summarize them here all, so here are just some highlights: LDSB as automatic symmetry breaking during search; restart-based search; complete redesign and reimplementation of branching enhancing the expressiveness massively (AFC with decay, activity, user-defined variable and value selection, tie-break control, better randomization, ...); half-reification; addition of floating point constraints.</p>
<p>It is recommended to read the new Chapter in MPG on branching as the changes are substantial and require you to change your programs, see also the full list of changes below.</p>
<p>As the interfaces has changed, please consult How to Change to Gecode 4.0.0.</p>
<ul>
<li>Kernel<ul>
<li>Additions<ul>
<li>The random seeds for variable and value branching options can now be initialized from a hardware random number generator (see MPG for details). (minor)
<li>All ArgArrays now accept STL vectors and input iterators for construction. (minor)
<li>The kernel now can record the activity of variables. The activity of a variable is defined as how often the domain of a variable has been pruned during search. For details, see "Modeling and
        Programming with Gecode". (major)
</ul>

<li>Other changes<ul>
<li>The default constrain() function for best-solution search now does by default nothing (it used to throw an exception). (minor)
<li>The entire infrastructure for variable-value branchers has been reimplemented from scratch. The new design makes a much better compromise between code size, efficiency, and expressiveness: the efficiency is about the same (for examples with no propagation and just branching one can note a slowdown of 2-4%) while code size shrinks drastically (the overall code size for integer variables shrinks by 20%) and the architecture is much more expressive (in particular, it supports tie-break limits, see MPG). (major)
<li>Throw exception when the user-defined copy constructor of a class that inherits from Space does not call the Space copy constructor. (minor)
</ul>

<li>Performance improvements<ul>
<li>Fixed a bug in the main memory allocation routine: now heap block sizes are decreased dynamically as they should be. Also changed the memory configuration parameters as explained in: Zandra Norman, Memory Management for Gecode. KTH Royal Institute of Technology, Sweden, Bachelor thesis, TRITA-ICT-EX-2012:143, 2012. (major, thanks to Zandra Norman)
</ul>

</ul>

<li>Search engines<ul>
<li>Additions<ul>
<li>Added support for restart-based search, see MPG for details. (major)
</ul>

<li>Other changes<ul>
<li>Variable selection for branching used the quotient of size divided by degree, accumulated failure count, or activity. They now use the inverse. That is, for example, it is not any longer INT_VAR_SIZE_DEGREE_MIN() but INT_VAR_DEGREE_SIZE_MAX() (that is, largest degree divided by size). (major)  That looks like an annoying change but is in fact essential: the strategies using accumulated failure count and activity now could have run into division by zero issues. And just changing the implementation is not good enough because the values of these measures can now be exposed during tie-breaking. 
<li>The restart best solution search engine has been removed (it is subsumed by the new restart-based meta search engine RBS). (major)
</ul>

<li>Performance improvements<ul>
<li>The search engines now do not allocate memory on the search stack for the rightmost branch of each node. This means that the search tree depth is now computed differently. It now represents the actual peak depth required at any one time, taking into account that rightmost branches reuse the stack entry of their parents. (minor)
</ul>

</ul>

<li>Finite domain integers<ul>
<li>Additions<ul>
<li>Gecode now supports Lightweight Dynamic Symmetry Breaking (LDSB), see MPG for details. (major , contributed by Christopher Mears)
<li>Added value selection strategies for branching INT_VAL_NEAR_MIN(), INT_VAL_NEAR_MAX(), INT_VAL_NEAR_INC(), and INT_VAL_NEAR_DEC(). They can take a previous assignment to the variables to branch on and try to choose values which are near (see MPG for details). (major, thanks to Manuel Loth)
<li>Added domain constraint that constrains a variable (or an array) according to the domain of another variable. (minor)
<li>Added variants of dom that copy the domain from one variable to another. (minor)
<li>The nooverlap constraint now allows sharing of unassigned variables in its argument arrays. (minor)
<li>Added half-reification for reified constraints (see Modeling and Programming with Gecode for details). (major)
<li>Added pow and nroot constraints. (major)
<li>The binpacking constraint now also accepts items of size zero. (minor, thanks to Kathrin Dannmann, Roberto Castañeda Lozano)
<li>Added activity-based branching strategies for integer and Boolean variables: INT_VAR_ACTIVITY_MIN, INT_VAR_ACTIVITY_MAX, INT_VAR_ACTIVITY_SIZE__MIN, INT_VAR_ACTIVITY_SIZE_MAX. For details, see "Modeling and Programming with Gecode". (major)
</ul>

<li>Other changes<ul>
<li>The coefficients for linear constraints are now divided by their greatest common divisor. That means that some equations can be handled now that previously threw an OutOfLimits exception, and some equations can be handled with the more efficient integer precision propagators that previously required double precision. (minor)
<li>Generalized definition of no-overlap propagators for better reuse. (minor, thanks to Roberto Castañeda Lozano)
<li>The interface for branching on integer and Boolean variables has changed considerably (supporting user-defined variable and value selection, tie-break limit functions, handlers to created branchers, and more). In order to change, you have to add () to all variants of INT_VAR, INT_VAL, and INT_ASSIGN. For example, INT_VAR_SIZE_MIN becomes the function call INT_VAR_SIZE_MIN() and INT_VAL_MIN_MIN becomes the function call INT_VAL_MIN_MIN(). Some of these functions expect additional arguments and can take also optional arguments (this replaces the VarBranchOptions and ValBranchOptions). Please read the new "Branching" chapter in MPG. (major)
<li>Respect IntConLevel argument for reified linear constraints with a single integer variable. (minor)
</ul>

<li>Bug fixes<ul>
<li>Fixed precede constraint with less than two values. (minor, thanks to Roberto Castañeda Lozano)
<li>Fixed a bug where bounds consistent distinct reported subsumption instead of failure in certain cases. (major, thanks to Lin Yong)
<li>Fixed potential rounding issues in sqr and sqrt constraints. (minor)
<li>Fixed copying of tuple sets in extensional constraints and IntSets in sequence constraints (could lead to crashes when using parallel search). (major, thanks to Manuel Baclet)
<li>Added missing propagation for nary min/max constraint. (minor, thanks to Jean-Noël Monette)
<li>Make extensional constraints work with empty tuple sets. (minor, thanks to Peter Nightingale)
<li>Fix count (global cardinality constraint) for multiple occurrences of the same value in the cover array. (minor, thanks to Peter Nightingale)
</ul>

<li>Performance improvements<ul>
<li>Arithmetic, linear, and cumulative constraints now resort to internal operations using "long long int" rather than "double". This improves performance but also extends the range over integer coefficients that can be handled by linear constraints. (major)
</ul>

</ul>

<li>Finite integer sets<ul>
<li>Additions<ul>
<li>Gecode now supports Lightweight Dynamic Symmetry Breaking (LDSB), see MPG for details. (major , contributed by Christopher Mears)
<li>Added domain constraint that constrains a variable (or an array) according to the domain of another variable. (minor)
<li>Added domain constraints for arrays of set variables. (minor)
<li>Added half-reification for reified constraints (see Modeling and Programming with Gecode for details). (major)
<li>Added activity-based branching strategies for set variables: SET_VAR_ACTIVITY_MIN, SET_VAR_ACTIVITY_MAX, SET_VAR_ACTIVITY_SIZE_MIN, SET_VAR_ACTIVITY_SIZE_MAX. For details, see "Modeling and Programming with Gecode". (major)
<li>Added channeling constraint between arrays of set variables. (major , contributed by Denys Duchier)
</ul>

<li>Other changes<ul>
<li>The interface for branching on integer and Boolean variables has changed considerably (supporting user-defined variable and value selection, tie-break limit functions, handlers to created branchers, and more). In order to change, you have to add () to all variants of SET_VAR, SET_VAL, and SET_ASSIGN. For example, SET_VAR_SIZE_MIN becomes the function call SET_VAR_SIZE_MIN() and SET_VAL_MIN_INC becomes the function call SET_VAL_MIN_INC(). Some of these functions expect additional arguments and can take also optional arguments (this replaces the VarBranchOptions and ValBranchOptions). Please read the new "Branching" chapter in MPG. (major)
</ul>

<li>Bug fixes<ul>
<li>Fixed precede constraint with less than two values. (minor, thanks to Roberto Castañeda Lozano)
</ul>

</ul>

<li>Floats<ul>
<li>Additions<ul>
<li>Added support for float variables. (major , contributed by Vincent Barichard)
</ul>

</ul>

<li>Minimal modeling support<ul>
<li>Additions<ul>
<li>Added pow and nroot expressions for integer variables. (minor)
</ul>

<li>Other changes<ul>
<li>Made implementations of MiniModel expressions private, so that the MiniModel headers do not have to include propagator headers like gecode/int/linear.hh any longer. (minor)
</ul>

</ul>

<li>Script commandline driver<ul>
<li>Additions<ul>
<li>Added commandline options to control restart-based search, see MPG for details. (major)
<li>Decay values can now be passed on the command line using the switch -decay. (minor)
<li>Added options -file-sol and -file-stat for writing solutions and statistics to arbitrary files and streams. (minor, thanks to Andrea Pretto)
<li>The command line -print-last configures whether only the last solution found is printed. (minor, thanks to Josef Eisl)
</ul>

<li>Other changes<ul>
<li>Boolean options (BoolOption) can now be given a false or true argument and hence are in-line with all other option types. (minor)
</ul>

</ul>

<li>Range and value iterators<ul>
<li>Documentation fixes<ul>
<li>Clarified for several iterators that when using the assignment operator both iterators must be allocated from the very same region. (minor)
</ul>

</ul>

<li>Support algorithms and datastructures<ul>
<li>Bug fixes<ul>
<li>Fixed a concurrency problem that caused an exception to be thrown at the end of a multi-threaded search on some platforms. (minor)
<li>Fixed a bug in the allocation of very large bitsets. (minor, thanks to Max Ostrowski)
</ul>

</ul>

<li>Example scripts<ul>
<li>Additions<ul>
<li>New example: Colored matrix without monochromatic rectangles. (minor)
</ul>

</ul>

<li>Gist<ul>
<li>Additions<ul>
<li>Added option to invoke move cursors during the automatic search. (minor)
</ul>

<li>Other changes<ul>
<li>Updated to compile with Qt version 5.0 (still works with Qt &gt;= 4.3 as well). (minor)
</ul>

</ul>

<li>Gecode/FlatZinc<ul>
<li>Additions<ul>
<li>Added support for more search annotations (defined in gecode.mzn), and for the restart and decay command line options. (minor)
<li>Added native support for lex_less_bool and lex_lesseq_bool. (minor)
<li>Gecode/FlatZinc now supports float constraints and variables. (major)
<li>The FlatZinc interpreter now supports comparing of nodes in Gist. (major, thanks to Gabriel Hjort Blindell)
<li>Added native support for the inverse_set constraint. (minor)
</ul>

<li>Other changes<ul>
<li>Renamed the FlatZinc executable to fzn-gecode, to better distinguish it when installed alongside other FlatZinc implementations. (minor)
<li>The FlatZinc interpreter no longer performs a complete search on variables annotated as var_is_introduced, but tries to extend a solution on the model variables to a solution that includes the introduced variables. Each solution on the model variables is therefore only reported once. (major)
</ul>

<li>Bug fixes<ul>
<li>The mzn-gecode shell script now passes arguments correctly to the FlatZinc interpreter. (minor)
<li>Removed spurious debug output for among constraint. (minor, thanks to Simon Ekvy)
<li>Exported registry and helper functions so that users can add constraint handlers to the FlatZinc interpreter. (minor, thanks to Jean-Noël Monette)
</ul>

</ul>

<li>General<ul>
<li>Additions<ul>
<li>Added CMake build script for Gecode (CMakeLists.txt). (minor, thanks to Victor Zverovich)
<li>Variable selection using AFC now supports decay. Read more in MPG. (major)
</ul>
<li>Other changes<ul>
<li>Compiles with MSVC 2012. (minor)
</ul>
</ul>
</ul>
</blockquote>

Also see:
<ul>
  <li> <a href="http://www.gecode.org/documentation.html">Documentation</a>
  <li> <a href="http://www.gecode.org/download.html">Download</a>
   <li> <a href="http://www.gecode.org/community.html">Community</a>
</ul>]]>
        
    </content>
</entry>
<entry>
    <title>A first look at B-Prolog</title>
    <link rel="alternate" type="text/html" href="http://www.hakank.org/constraint_programming_blog/2013/03/a_first_look_at_bprolog.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.hakank.org/webblogg/mt-atom.cgi/weblog/blog_id=3/entry_id=1478" title="A first look at B-Prolog" />
    <id>tag:www.hakank.org,2013:/constraint_programming_blog//3.1478</id>
    
    <published>2013-03-10T07:55:20Z</published>
    <updated>2013-03-10T08:14:14Z</updated>
    
    <summary>First, here&apos;s my B-Prolog page with a lot of CLP models. B-Prolog is a Prolog implementation that, besides extensions such as CLP(FD), CLP(Set), and CLP(Bool), also shines with the following extensions: Arrays and subscript notation Declarative Loops and List Comprehensions,...</summary>
    <author>
        <name>hakank</name>
        <uri>http://www.hakank.org/webblogg</uri>
    </author>
            <category term="B-Prolog" />
    
    <content type="html" xml:lang="en" xml:base="http://www.hakank.org/constraint_programming_blog/">
        <![CDATA[First, here's my <a href="http://www.hakank.org/bprolog">B-Prolog page</a> with a lot of
CLP models.
<br><br>

<a href="http://www.probp.com">B-Prolog</a> is a Prolog implementation that, besides extensions such as CLP(FD), CLP(Set), and CLP(Bool), also shines with the following extensions:
<ul>
  <li> <a href="http://www.probp.com/manual/node47.html">Arrays and subscript notation</a>
  <li> <a href="http://www.probp.com/manual/node51.html">Declarative Loops and List Comprehensions</a>, also see <a \
href="http://www.probp.com/download/loops.pdf">Foreach and list comprehension</a> (PDF)
  <li> <a href="http://www.probp.com/manual/node105.html">Constraints</a> (CLP(FD), CLP(Sets), CLP(Boolean))
  <li> <a href="http://www.probp.com/manual/node126.html">A Common Interface to SAT and MP Solvers</a>
</ul>

B-Prolog also has built in support for memoization (<code>table</code>) which
make dynamic programming easier (see some examples <a href="http://www.probp.com/examples/#TAB">here</a>). It also has an almost seamless support for changing between CLP(FD), LP/MIP, and SAT solver.
<br><br>
However, here I have almost exclusively concentrated on the CLP(FD) extensions and with
heavily use of foreach loops, list comprehensions, and arrays/matrices (since this is how
I tend to think when modeling these kind of combinatorial problems).
Most problems has been implemented in other C(L)P systems before, see <a href="http://hakank.org/common_cp_models/">Common constraint programming problems</a>.
<br><br>
<h2>More info about B-Prolog</h2>
<ul>
  <li> <a href="http://www.probp.com/manual/manual.html">B-Prolog Manual</a>
  <li> <a href="http://www.probp.com/example.html">Examples</a>
  <li> <a href="http://lists.probp.com/pipermail/bp-users//">Mailing list</a>
  <li> <a href="http://www.probp.com/publib/index.html">Third party libraries</a> (Note: Most of this code is not included in the B-Prolog distribution)
</ul>

<h3>First model: SEND+MORE=MONEY</h3>
Model: <a href="http://www.hakank.org/bprolog/send_more_money.pl">send_more_money.pl</a>
<br><br>
Let's start with one of the standard problems just to get a feeling for the syntax of B-Prolog
<pre>
sendmore(Digits) :-
    Digits = [S,E,N,D,M,O,R,Y],
    Digits :: 0..9,
    alldifferent(Digits),
    S #> 0, M #> 0,
                 1000*S + 100*E + 10*N + D
    +            1000*M + 100*O + 10*R + E
    #= 10000*M + 1000*O + 100*N + 10*E + Y,       
    labeling(Digits).
</pre>

This is no different from most CLP(FD) systems. Note that there is no need to
load a specific clpfd module since everything is loaded already (and B-Prolog
currently don't support modules).
<br><br>
Here's a short explanation:
<ul>
  <li> <code>Digits :: 0..9</code>: This means that all the elements in the
        list <code>Digits</code> must be in the domain between 0..9.
  <li> The specific CLP(FD) operators starts with <code>#</code>, e.g. <code>#=</code> and <code>#></code>.
  <li> <code>labeling(Digits)</code>: starts the search of the solution.
</ul>


<h3>N-Queens: introducing list comprehensions</h3>
Model: <a href="http://www.hakank.org/bprolog/queens.pl">queens.pl</a>
<br><br>
Tthis N-Queens model show more of the differences between B-Prolog
and standard Prolog with CLP(FD) support, namely it's use of list comprehensions.
<pre>
queens2(N, Q) :-
        length(Q, N),
        Q :: 1..N,
        Q2 @= [Q[I]+I : I in 1..N],
        Q3 @= [Q[I]-I : I in 1..N],
        alldifferent(Q),
        alldifferent(Q2),
        alldifferent(Q3),       
        labeling([ff],Q).
</pre>

The extraction the two diagonals is done via list comprehensions (<code>Q2</code> and <code>Q3</code>), i.e.
<pre>
  <b>Q2 @= [Q[I]+I : I in 1..N]</b>,
  alldifferent(Q2),
</pre>

This works since the special operator <code>V @= [....]</code> extracts the elements
<code>Q[I]</code> (note the use of array index here).
<br><br>
Here is a small benchmark using the above encoding (predicate <code>queens2</code> in the file).
<code>queens/2</code> is the same as the above but use <code>alldistinct</code> instead
of <code>alldifferent</code>:
<br>
Both take very long time for N=500, but is much faster for N=499 and N=501. As we see,
using <code>alldifferent</code> is faster than using <code>alldistinct</code>. The latter use
a stronger consistency checking, but that don't help in this encoding:
<pre>
  For N=400:
    queens2/2: 0.62s 10 backtracks
    queens5/2: 0.71s 10 backtracks
    queens/2:  2.16s 1 backtrack
  For N=499:
    queens2/2: 0.76 1 backtracks
    queens5/2: 1.1s  1 backtracks
    queens/2:  4.168 0 backtracks
  For N=500: too slow 
  For N=501:
    queens5/2: 1.1s 1 backtracks
    queens2/2: 3.14s 1 backtrack
    queens/2:  3.524s 2 backtracks
  For N=1000:
    queens5/2: 8.9s 2 backtracks
    queens2/2: 24.2s 2 backtracks
    queens/2:  34.146s 0 backtracks

</pre>

[I don't understand why N=500 is so hard when 499 and 501 is solved quite fast.
No other CP solver/system I've tested show this behaviour.]
<br><br>
B-Prolog is not the only Prolog based system using foreach loops. See below for some
discussion of the differences between B-Prolog and ECliPSe CLP's do-loop construct
(also used in SICStus Prolog).


<h3>alphametic.pl: a fairly general alphametic solver</h3>
Model: <a href="http://www.hakank.org/bprolog/alphametic.pl">alphametic.pl</a>
<br><br>
Using list comprehensions, foreach loops and arrays makes
it quite easy to implement a fairly general solver for this kind
of alphametic problems. It's not completely general since it
(still) use Prolog's feature of handling variables.
<pre>
go :-
    L = [[_S,E,N,_D],[M,O,_R,E],[M,O,N,E,_Y]],
    alphametic(L, Base, Res),
    writeln(Res).

alphametic(L,Base, Vars) :- 
    reverse(L,Rev),
    Rev = [Last|Sums],

    term_variables(L, Vars),
    Vars :: 0..Base-1,

    alldifferent(Vars),
    Vals #= sum([Val : S in Sums,[Val],calc(S,Base,Val)]),
    calc(Last,Base,Vals),
    foreach(S in Sums,S[1]#>0),

    labeling([ff,split], Vars).

calc(X,Base,Y) :-
    length(X,Len),
    Y #= sum([X[I]*Base**(Len-I) : I in 1..Len]).
</pre>

The main work here is done with <code>term_variables/2</code> which extracts
the variables used, the <code>sum/1</code> which sums all the terms, and
<code>calc</code> that is really a special case of scalar product.


<h3>Sudoku solver: more lists/arrays</h3>
Model: <a href="http://www.hakank.org/bprolog/sudoku.pl">sudoku.pl</a>
<br><br>
Here is a Sudoku solver in B-Prolog:
<pre>
go :-
   time(solve(1)).

solve(ProblemName) :-
   problem(ProblemName, Board),
   print_board(Board),
   sudoku(3, Board),
   print_board(Board).

print_board(Board) :-
   N @= Board^length,
   foreach(I in 1..N, 
      (foreach(J in 1..N, [X],
         (X @= Board[I,J],
         (var(X) -> write('  _')
           ;
          format('  ~q', [X]))
         )),
      nl)),
    nl.

problem(1, [](
    [](_, _, 2, _, _, 5, _, 7, 9),
    [](1, _, 5, _, _, 3, _, _, _),
    [](_, _, _, _, _, _, 6, _, _),
    [](_, 1, _, 4, _, _, 9, _, _),
    [](_, 9, _, _, _, _, _, 8, _),
    [](_, _, 4, _, _, 9, _, 1, _),
    [](_, _, 9, _, _, _, _, _, _),
    [](_, _, _, 1, _, _, 3, _, 6),
    [](6, 8, _, 3, _, _, 4, _, _))).

alldifferent_matrix(Board) :-
   Rows @= Board^rows,
   foreach(Row in Rows, alldifferent(Row)),
   Columns @= Board^columns,
   foreach(Column in Columns, alldifferent(Column)).

sudoku(N, Board) :-
   N2 is N*N,
   array_to_list(Board,BoardVar),
   BoardVar :: 1..N2,

   alldifferent_matrix(Board),
   foreach(I in 1..N..N2, J in 1..N..N2, 
          [SubSquare],
          (SubSquare @= [Board[I+K,J+L] : 
                        K in 0..N-1, L in 0..N-1],
          alldifferent(SubSquare))
   ),
   labeling([ff,down], BoardVar).
</pre>

One of the most interesting things here is the code for
the sub squares (<code>SubSquare</code>):
<code>(SubSquare @= [Board[I+K,J+L] :<br>
       K in 0..N-1, L in 0..N-1]<br>
</code>
<br>

Unlike most Prolog implementations, it works to access the
entries in the matrix with <code>I+K</code> and <code>J+L</code>.
However this works only when the indices (<code>I, J, K, L</code>)
are ground integers. If any of the indices would be decision
variables, then one have to use <code>element/3</code>
(or perhaps <code>nth1/3</code>) to obtain the same thing.
See below for more about this.
<br><br>
Running this models yield the following result:
<pre>
  _  _  2  _  _  5  _  7  9
  1  _  5  _  _  3  _  _  _
  _  _  _  _  _  _  6  _  _
  _  1  _  4  _  _  9  _  _
  _  9  _  _  _  _  _  8  _
  _  _  4  _  _  9  _  1  _
  _  _  9  _  _  _  _  _  _
  _  _  _  1  _  _  3  _  6
  6  8  _  3  _  _  4  _  _

  3  6  2  8  4  5  1  7  9
  1  7  5  9  6  3  2  4  8
  9  4  8  2  1  7  6  3  5
  7  1  3  4  5  8  9  6  2
  2  9  6  7  3  1  5  8  4
  8  5  4  6  2  9  7  1  3
  4  3  9  5  7  6  8  2  1
  5  2  7  1  8  4  3  9  6
  6  8  1  3  9  2  4  5  7
</pre>

<b>Time and backtracks</b>: Since there is no built-in predicate in B-Prolog for getting
both time and number of backtracks (failures etc), let's add this:
<pre>
time2(Goal):-
   cputime(Start),
   statistics(backtracks, Backtracks1),
   call(Goal),
   statistics(backtracks, Backtracks2),
   cputime(End),
   T is (End-Start)/1000,
   Backtracks is Backtracks2 - Backtracks1,
   format('CPU time ~w seconds. Backtracks: ~d\n', [T, Backtracks]).
</pre>

Running this on the command line:
<pre>
 $ time bp -g "[sudoku], time2(solve(1)),halt"
</pre>

writes the following after the solution, i.e. that it's a 0 backtrack problem.
<pre>
CPU time 0.0 seconds. Backtracks: 0
</pre>

In the model <a href="http://www.hakank.org/bprolog/sudoku.pl">sudoku.pl</a>
there is a predicate <code>go3/0</code> which runs all the 13 problem
instances and shows the statistics (time and backtracks). The <code>len:1</code>
in the output is for ensuring that the solution
is unique (a requirement on traditional Sudoku problems).
This check caught two problem instances that was either typed in erroneously
by me or by the source I got them from (and thus I removed these two
problems from this model).

<pre>
go3 :-
   foreach(P in 1..13,
      [L,Len],
      (writeln(problem:P),
      time2(findall(P,solve2(P),L)),
      length(L,Len),
      writeln(len:Len),
      (Len > 1 ->
         writeln('This has more than one solution!') 
        ; 
      true
      ), nl)).
</pre>

The result is:
<pre>
problem:1
CPU time 0.004 seconds. Backtracks: 0
len:1

....

problem:13
CPU time 0.04 seconds. Backtracks: 0
len:1
</pre>


<h3>What you can - and cannot - do with list comprehensions</h3>
When using <code>@=</code> it works to get a list comprehension (provided that
there's no problem with array access etc). If one want to use it directly in
a (global) constraint, then the requirement is that it
must be in an <b>arithmetic context</b> (I first missed that in the documentation).
<br><br>
The following works since <code>sum/1</code> is a special function in an arithmetic
context:
<pre>
  Sum #= sum([X[I] : I in 1..N])
</pre>

However, using comprehensions in global constraints such as
<code>alldifferent</code> don't work since it's not in an arithmetic context:
<pre>
  % <b>this don't work</b>
  alldifferent([X[I]+I : I in 1..N])
</pre>

The following works (as we saw above in the N-Queens model) since we extract the
elements to a list using <code>@=</code> before using it.
<pre>
  % <b>this works</b>
  Q1 @= [X[I]+I : I in 1..N],
  alldifferent(Q1),
  % ...
</pre>

As mentioned above, array indexing don't work when
the indices are decision variables. Then one must use <code>element/3</code>
(or <code>nth/3</code>). See more about <code>element</code> below.


<h3>foreach loops</h3>
The foreach loop extension i B-Prolog is quite intuitive. They are a often
easier to use than the do-loops in ECLiPSe CLP (and SICStus Prolog)
since in B-Prolog one declare the <b>local</b> variables in the loop
(i.e. "global by default"), whereas in ECLiPSe do-loops one declares
the <b>global</b> variables to be used ("local by default") which perhaps is not as intuitive.
Both these systems have helpful warnings where a local/global variable is used out of
context.
<br><br>
Note that B-Prolog's foreach construct don't have all features found in ECLiPSe's
do-loop so certain things might be easier to state in ECLiPSe CLP and SICStus Prolog than in B-Prolog.
<br><br>
In B-Prolog there is also support for accumulators via
<code>ac(Var, StartValue)</code> (or <code>ac1/2</code> which I have not
used much), which collects the local variables in the loop to a global variable
(here <code>Var</code>). 
<br><br>
An example of a foreach loop which use <code>ac</code> is in
<a href="http://www.hakank.org/bprolog/photo_problem.pl">photo_problem.pl</a>
<pre>
preferences(1, 7, [[1,5],
                   [1,6],
                   [2,1],
                   [2,5],
                   [4,6],
                   [4,3],
                   [7,4],
                   [7,3]]).

foreach([Pref1,Pref2] in Preferences,
        <b>ac(Diffs,[])</b>, [P1,P2,<b>Diff</b>],
        (
            element(Pref1,Positions,P1),
            element(Pref2,Positions,P2),
            Diff #= (abs(P1-P2) #= 1),
            <b>Diffs^1 = [Diff|Diffs^0]</b>
        )),
</pre>

Here the <code>Diff</code> list collects the differences of the positions
(from the local <code>Diff</code> variable). The local declarations
<code>[P1,P2,Diff]</code> is needed here, otherwise they would be considered
global variables in the model (with disastrous result).
<br><br>
Also note that the foreach loop handles the list of lists in <code>Preferences</code>,
so the foreach is not limited to integer ranges that is shown in a couple
of the other examples here.
<br><br>
More about foreach loops is found in the manual, section <a href="http://www.probp.com/manual/node51.html">Declarative Loops and List Comprehensions</a>.


<h3>new_array and lists</h3>
Creating an <b>array</b> (of "any" dimension) in B-Prolog is done with
<code>new_array(Var,Dimensions)</code>: 
<pre>
   N = 3,
   new_array(X,[N,N]),
</pre>
where <code>Dimensions</code> is a list of the dimensions (of "any" size; I don't
know if there is any limitations of the number of dimensions).
<br><br>
The result of <code>new_array</code> is an array structure such as
<pre>
  | ?- new_array(X,[3,3])
  X = []([](_7a8,_7b0,_7b8),[](_7c8,_7d0,_7d8),[](_7e8,_7f0,_7f8))
</pre>

Converting an array structure to a list is done with <code>array_to_list(Array,List)</code>:
<pre>
| ?- new_array(X,[3,3]), array_to_list(X,List)
X = []([](_8e0,_8e8,_8f0),[](_900,_908,_910),[](_920,_928,_930))
List = [_8e0,_8e8,_8f0,_900,_908,_910,_920,_928,_930]
</pre>

Setting the domains for the variables in an array must be done via the converted list
(i.e. not directly on the array structure):
<pre>
   N = 3,
   new_array(X, [N,N]),
   array_to_list(X, Vars),
   Vars :: 1..N*N,
   % ...
</pre>

After that conversion, one can freely use constraints on either the array structure (e.g. as
a matrix) or on the list representation, such as <code>alldifferent(Vars)</code>. This
"dual representation" sometimes simplifies modeling much. Note that labeling must be
done via the list representation, or by using <code>term_variables/2</code>.

<h3>Reifications: alldifferent_except_0</h3>
Model: <a href="http://www.hakank.org/bprolog/alldifferent_except_0.pl">alldifferent_except_0.pl</a>
<br><br>
Using reifications (reasoning about satisfing constraints using boolean decision variables) is
quite direct, using <code>#=</code> (equality), <code>#=></code> (implication) and
<code>#<=></code> (equivalence). Here is an decomposition of the global constraint
<code>alldifferent_except_0.pl</code>:
<pre>
alldifferent_except_0(Xs) :-
   Len @= Xs^length,
   foreach(I in 1..Len, J in 1..Len,
      (I #\=J #/\ Xs[I] #\= 0 #/\ Xs[J] #\= 0)
       #=> 
      (Xs[I] #\= Xs[J])
     ).
</pre>

One thing I noticed when playing with reifications was that foreach don't seems
be in boolean context. Example: this don't work as I expected (or hoped), i.e.
that if not all <code>X[I]</code> are larger than 0 then B is 0 (and vice versa):
<pre>
  % don't work
  foreach(I in 1..N, X[I] #> 0) #<=> (B #= 1)
</pre>


<h3>Table constraint</h3>
Model: <a href="http://www.hakank.org/bprolog/hidato_table.pl">hidato_table.pl</a>
<br><br>
The <code>table</code> constraint is used in <a href="http://www.hakank.org/bprolog/hidato_table.pl">hidato_table.pl</a> and is quite easy to use.
<br><br>
First, define the valid connections that can be used. This is - of course - done via
a list comprehension:
<pre>
Connections
   @= [(I1,J1,I2,J2) :
       I1 in 1..N, J1 in 1..N, 
       I2 in 1..N, J2 in 1..N,
       (abs(I1-I2) =< 1,
       abs(J1-J2) =< 1,
       (I1 \=I2; J1 \= J2)
       )],
</pre>

Then place all the numbers 1..N*N in the grid where the places are restriced by the
connections in <code>Connections</code>. Note that since we are using
decision variables for the indices (<code>I1,J1,I2,J2</code>) of the grid
(<code>X</code>), we cannot use array extraction. My solution of this is
to use the <code>XVar</code> list (which we must have for the labeling anyway),
and calculate the corresponding position in this list for each (<code>I,J</code>)
postition in the grid. 
<pre>
XVar @= [X[I,J] : I in 1..N, J in 1..N],
XVar :: 1..N*N,

% ....

% place all integers from 1..N*N
alldifferent(XVar),
foreach(K in 1..(N*N)-1,
   [I1,J1,I2,J2,K2,Offset1,Offset2],
   [ac(AllConn,[]),ac(Offsets,[])],
   (
     K2 is K+1,
     [I1,J1,I2,J2] :: 1..N,
     % [(I1,J1,I2,J2)] in Connections,
     [Offset1,Offset2] :: 1..N*N,
     Offset1 #= (I1-1)*N+J1,
     element(Offset1,XVar,K),
     Offset2 #= (I2-1)*N+J2,
     element(Offset2,XVar,K2),
     AllConn^1 = [(I1,J1,I2,J2)|AllConn^0],
     Offsets^1 = [[Offset1,Offset2]|Offsets^0]
    )
   ),

% the table constraint
<b>AllConn in Connections,</b>
...
</pre>

The table constraint is used by simply putting all the variables in
a list of parenthesis structure <code>(I1,J1,I2,J2)</code> and then checking
all these using <code>AllConn <b>in</b> Connections</code>.
<br><br>
Also, note that both <code>AllConn</code> (the collection of selected connections)
as well as the offsets (collected in the <code>Offsets</code> list) is included in
the labeling to get faster results.

<pre>
% ...
term_variables([Offsets,XVar,AllConn],Vars),
labeling([ff],Vars),
% ...
</pre>

In my experiments with this model, it seems to be faster to put
<code>Offsets</code> before <code>XVar</code> and <code>AllConn</code>
in the labeling.
<br><br>
This model is not blazingly fast, though it's much faster than the model without
the <code>table</code> constraint (the model
<a href="http://www.hakank.org/bprolog/hidato.pl">hidato.pl</a>).
For example, problem instance #6 takes 6.5 seconds without the <code>table</code> constraint,
and 0.17 seconds with (both versions have 0 backtracks). 
<br><br>
Note: B-Prolog also have a powerful built-in memoisation feature called <code>table</code>.
Please don't confuse these two usages of "table".


<h3>Element</h3>
As usual, when porting models from my <a href="http://www.hakank.org/minizinc/">MiniZinc</a>
models, I got the most problem with the <code>element</code> constraint. (Porting
to B-Prolog has not been the worst case in this matter, though.)
<br><br>
B-Prolog's support for arrays with decision variables is not as good as
compared with the ECLiPSe CLP system, and both have quite a way to go before
it's as nice as MiniZinc's and Comet's support (where <code>element</code> is
encoded very natural). It's especially when using <code>element</code> in a matrix
where I had to stop in my "porting flow" (often the port was quite "flowy") and then use
<code>element</code>/<code>nth1</code> constraints and often a few temporary variables.
<br><br>
When there are much matrices with decision variable indices, I tend to use these two
predicates instead (and skipping B-Prolog's arrays):
<pre>
matrix_element(X, I, J, Val) :-
   element(I, X, Row),
   element(J, Row, Val).
 
matrix(_, []) :- !.
matrix(L, [Dim|Dims]) :-
   length(L, Dim),
   foreach(X in L, matrix(X, Dims)).
</pre>

(The latter predicate was suggested by Mats Carlsson when I implemented a lot of
<a href="http://www.hakank.org/sicstus/">SICStus Prolog</a> models some years ago.)
<br><br>
Here is an example in the stable marriage model (<a href="http://www.hakank.org/bprolog/stable_marriage.pl">stable_marriage.pl</a>).
<br><br>
In MiniZinc one can code element within decision variables like this (where both
<code>husband</code> and <code>wife</code> are lists of decision variables). Here's
a snippet from the MiniZinc model <a href="http://www.hakank.org/minizinc/stable_marriage.mzn">stable_marriage.mzn</a>:
<pre>
forall(m in 1..num_men) ( 
  husband[wife[m]] = m 
)
</pre>

In B-Prolog, I use the following (using the same overall approach): 
<pre>
foreach(M in 1..NumMen,[WifeM,HusbandWifeM],
   (element(M,Wife,WifeM),
     element(WifeM,Husband,HusbandWifeM),
     HusbandWifeM #= M )),
</pre>


Another example is the Five element problem (from Charles W. Trigg):
<a href="http://www.hakank.org/bprolog/five_elements.pl">five_elements.pl</a>
<br><br>
The problem statement:<br>
<code>
Charles W. Trigg, PI MU EPSILON JOURNAL, Valume 6, Fall 1977, Number 5<br>
"""<br>
From the following square array of the first 25 positive integers, 
choose five, no two of the same row or column, so that the maximum of
the five elements is as small as possible.<br>
<br>
   2 13 16 11 23<br>
  15  1  9  7 10<br>
  14 12 21 24  8<br>
   3 25 22 18  4<br>
  20 19  6  5 17<br>
</code>

<br><br>
Ensuring the unicity of rows and columns is simple:
<pre>
foreach(I in 1..N, 
       (sum([X[I,J] : J in 1..N]) #= 1,
        sum([X[J,I] : J in 1..N]) #= 1
        ))
</pre>

However, we also want to find the specific numbers in the matrix
for which <code>X[I,J] #= 1</code>. The following way do not work:
<pre>
% <b>This don't work</b>
foreach(J in 1..N, [I],ac(Is,[]),
   (I :: 1..N,
    1 #= X[I,J],
    Y[J] #= Matrix[I,J]
   ))
</pre>

If we - still - want to use this matrix approach, then 
<code>freeze/2</code> can be used. However, we then have to
collect the <code>I</code> indices in an accumulator list
<code>Is</code> to be used in the labeling:
<pre>
% Find the specific row I for which X[I,J] is 1.
foreach(J in 1..N, [I],<b>ac(Is,[])</b>,
    (I :: 1..N,
    <b>freeze</b>(I, 1 #= X[I,J]),
    <b>freeze</b>(I, Y[J] #= Matrix[I,J]),
    Is^1 = [I|Is^0])
    ),

MaxY #= max(Y),

term_variables([XVar,Y,MaxY,<b>Is</b>], Vars),
minof(labeling([ff], Vars),MaxY),
labeling(Vars),
% ....
</pre>

Using <code>freeze/2</code> is not ideal, but it makes the
code more intuitive than with a lot of <code>element/3</code>
or <code>nth1/3</code>, if that even work.


<h3>MIP/SAT</h3>
Model: <a href="http://www.hakank.org/coins_grid.pl">coins_grid.pl</a>
<br>
As mentioned in the introduction above, B-Prolog also have support for
LP/MIP problems (using GLPK as the solver) and an interface to a SAT solver.
<br><br>
Here I just show the MIP solver by one of my standard problems for which
CP solvers tend to be worse than MIP solvers, namely
<a href="http://www.hakank.org/bprolog/coins_grid.pl">coins_grid.pl</a>. The model also
implements a CLP(FD) and a <code>cp_solve</code>.
<br><br>
Some differences between the other CLP(FD) models shown here:
<ul>
  <li> The CP, MIP, and SAT solvers has a little different syntax than the CLP(FD) solver:
       <br>
        <ul>
          <li> The numeric constraints use <code>$=</code> instead of <code>#=</code>
               (i.e. "$" instead of "#") to mark that it's a CLP constraint.
          <li> The labeling is different: <code>cp_solve</code>, <code>lp_solve</code>,
                <code>ip_solve</code>, and <code>sat_solve</code>.
        </ul>
  <li> There are just a few global constraint that is supported using this:
          <code>$alldifferent</code> and <code>$element</code>, and the usual arithmetic
        <code>sum/1, min/1, max/1, min/2, max/2</code>. The CLP(FD) solver has support for
        many more global constraints.
</ul>
<pre>
coins(N, C) :-
   % N = 10, % 31 the grid size
   % C = 6,  % 14, number of coins per row/column
   
   new_array(X, [N,N]),
   array_to_list(X, Vars),
   Vars :: 0..1,

   Sum $>= 0,
   foreach(I in 1..N, 
       (C $= sum([T : J in 1..N, [T], T @= X[I,J]]), % rows
        C $= sum([T : J in 1..N, [T], T @= X[J,I]]) % columns
       )),

   % quadratic horizontal distance
   Sum $= sum([
               T : I in 1..N, J in 1..N, [T],
               T @= (X[I,J] * abs(I-J)*abs(I-J))
              ]),

   <b>ip_solve([min(Sum),ff,reverse_split], Vars),</b>
   % cp_solve([min(Sum),ff,reverse_split], Vars),
   % sat_solve([min(Sum),ff,reverse_split], Vars),
   writeln(sum:Sum),
   pretty_print(X).
</pre>

By changing <code>ip_solve</code> to <code>cp_solve</code> (or <code>sat_solve</code>)
we use the CP solver (or SAT solver). This is quite nifty.
<br><br>
And as usual the MIP solver solves this problem immediately, whereas CP solvers tend
to be much slower.


<h3>Things not tested or mentioned</h3>
Here are some other things that I have not mentioned above:
<ul>
  <li> <a href="http://www.probp.com/manual/node97.html">Action rules and events</a>. These are the used to implement propagators and more effective constraints. However, I have not played with these much. Also, see <a href="http://www.probp.com/manual/node117.html">Programming Constraint Propagators</a>.
  <li> B-Prolog is not an open source project, i.e. the free distribution just contains the
  executable, documentation and examples. (This was a little unfortunately since then I had not opportunity to study certain features, e.g. how the global constraints where implemented in Action rules.) For individual, academic and non-commercial use, B-Prolog is free to use. There is commercial licenses where source code is included. See more here: <a href="http://www.probp.com/license.htm">Licenses</a>.
  <li> And then there are other features that I have not mentioned. See the <a href="http://www.probp.com/manual/manual.html">Manual</a> for detailed descriptions about these.
</ul>


<h2>Summary</h2>
I like B-Prolog, especially the nice support for list comprehensions,
array access and foreach loops. They are a nodge neater than the one used
in ECLiPSe CLP and SICStus Prolog, though not as good as in MiniZinc (or Comet).
<br><br>
It was quite easy to port my <a href="http://www.hakank.org/eclipse/">ECLiPSe</a>
and <a href="http://www.hakank.org/sicstus/">SICStus Prolog</a>
models to B-Prolog, mostly because these already used the do-loop constructs,
and it was mostly easy to port directly from my
<a href="http://www.hakank.org/minizinc/">MiniZinc</a> models, except when using matrices
with decision variables as indices. Right now I think that B-Prolog's approach
is often neater to use than the other Prolog's, especially list comprehensions.


<h2>Picat</h2>
Finally, I must mention <a href="http://picat-lang.org/">Picat</a> (<b>P</b>redicates,
<b>I</b>mperative, <b>C</b>onstraints, <b>A</b>ctors, and <b>T</b>abling).
Picat is a C(L)P language also created by B-Prolog's creator Neng-Fa Zhou (together
with Jonathan Fruhman), which is inspired by Prolog (especially B-Prolog). From the Picat site:
<blockquote>
Picat is a general-purpose hybrid language that incorporates many declarative language features for better productivity of software development, including explicit non-determinism, explicit unification, functions, constraints, and tabling. Picat also provides imperative language constructs for programming everyday things. The Picat system will be used for not only symbolic computations, such as knowledge engineering, NLP, and search problems, but also for scripting tasks for the Web, games, and mobile applications.
<br><br>
....
<br><br>
The Picat implementation will be based on the B-Prolog engine and the first version that has the basic functionality is expected to be released by May, 2013. The project is open to anybody and you are welcome to join, as a developer, a sponsor, a user, or a reviewer. Please contact picat@picat-lang.org .
</blockquote>

This sounds very interesting, and I will definitely give it a try when it's released (and perhaps blog about it as well).


<h2>My B-Prolog models/programs</h2>
Here are my public B-Prolog encodings. As of writing it's over 200, most
using CLP(FD), some use CLP(Set), and just a few are non-CP Prolog + foreach/list comprehension.
<ul>
  <li> <a href="http://www.hakank.org/bprolog/1d_rubiks_cube.pl">1d_rubiks_cube.pl</a>: 1-D Rubik's Cube (not CLP)
  <li> <a href="http://www.hakank.org/bprolog/a_round_of_golf.pl">a_round_of_golf.pl</a>: A round of golf (Dell Logic Puzzles)
  <li> <a href="http://www.hakank.org/bprolog/abbots_puzzle.pl">abbots_puzzle.pl</a>: Abbot's puzzle (Dudeney)
  <li> <a href="http://www.hakank.org/bprolog/added_corner.pl">added_corner.pl</a>: Added corner problem
  <li> <a href="http://www.hakank.org/bprolog/all_differ_from_at_least_k_pos.pl">all_differ_from_at_least_k_pos.pl</a>: Decomposition of the global constraint <code>all_differ_from_at_least_k_pos</code>
  <li> <a href="http://www.hakank.org/bprolog/all_equal.pl">all_equal.pl</a>: Decomposition of the global constraint <code>all_equal</code>  
  <li> <a href="http://www.hakank.org/bprolog/all_interval.pl">all_interval.pl</a>: All interval problem (CSPLib problem #7)
  <li> <a href="http://www.hakank.org/bprolog/all_min_dist.pl">all_min_dist.pl</a>: Decomposition of the global constraint <code>all_min_dist</code>
  <li> <a href="http://www.hakank.org/bprolog/alldiff_test.pl">alldiff_test.pl</a>: Test of alldifference
  <li> <a href="http://www.hakank.org/bprolog/alldifferent_cst.pl">alldifferent_cst.pl</a>: Decomposition of the global constraint <code>alldifferent_cst</code>
  <li> <a href="http://www.hakank.org/bprolog/alldifferent_except_0.pl">alldifferent_except_0.pl</a>: Decomposition of the global constraint <code>alldifferent_except_0</code>
  <li> <a href="http://www.hakank.org/bprolog/alldifferent_modulo.pl">alldifferent_modulo.pl</a>: Decomposition of the global constraint <code>alldifferent_modulo</code>
  <li> <a href="http://www.hakank.org/bprolog/alldifferent_on_intersection.pl">alldifferent_on_intersection.pl</a>: Decomposition of the global constraint <code>alldifferent_on_intersection</code>  
  <li> <a href="http://www.hakank.org/bprolog/allpartitions.pl">allpartitions.pl</a>: Generating all partitions
  <li> <a href="http://www.hakank.org/bprolog/alphametic.pl">alphametic.pl</a>: Fairly generic alphametic (cryptarithmetic) solver
  <li> <a href="http://www.hakank.org/bprolog/among.pl">among.pl</a>: Decomposition of the global constraint <code>among</code>
  <li> <a href="http://www.hakank.org/bprolog/among_seq.pl">among_seq.pl</a>: Decomposition of the global constraint <code>among_seq</code>  
  <li> <a href="http://www.hakank.org/bprolog/arch_friends.pl">arch_friends.pl</a>: Arch friends puzzle (Dell Logic Puzzles)
  <li> <a href="http://www.hakank.org/bprolog/assignment.pl">assignment.pl</a>: Some assigmnents problems
  <li> <a href="http://www.hakank.org/bprolog/averbach_1.2.pl">averbach_1.2..pl</a>: Seating problem (Problem 1.2 from Averbach &amp; Chein "Problem Solving Through Recreational Mathematics")
  <li> <a href="http://www.hakank.org/bprolog/averbach_1.3.pl">averbach_1.3..pl</a>: Problem 1.3 from Averbach &amp; Chein "Problem Solving Through Recreational Mathematics")    
  <li> <a href="http://www.hakank.org/bprolog/averbach_1.4.pl">averbach_1.4..pl</a>: Problem 1.4 from Averbach &amp; Chein "Problem Solving Through Recreational Mathematics"
  <li> <a href="http://www.hakank.org/bprolog/bales_of_hay.pl">bales_of_hay.pl</a>: Bales of hay problem (from "Math Less Traveled" )
  <li> <a href="http://www.hakank.org/bprolog/babysitting.pl">babysitting.pl</a>: Baby sitting puzzle  (Dell Logic Puzzles)
  <li> <a href="http://www.hakank.org/bprolog/best_host.pl">best_host.pl</a>: Best host puzzle  (PuzzlOR problem)
  <li> <a href="http://www.hakank.org/bprolog/bin_packing.pl">bin_packing.pl</a>: Some bin packing problems
  <li> <a href="http://www.hakank.org/bprolog/bin_packing2.pl">bin_packing2.pl</a>: Decomposition of the global constraint <code>bin_packing</code>
  <li> <a href="http://www.hakank.org/bprolog/breaking_news.pl">breaking_news.pl</a>: Breaking news puzzle (Dell Logic Puzzles)
  <li> <a href="http://www.hakank.org/bprolog/broken_weights.pl">broken_weights.pl</a>: Broken weights (weighing problem)
  <li> <a href="http://www.hakank.org/bprolog/build_a_house.pl">build_a_house.pl</a>: Simple scheduling problem
  <li> <a href="http://www.hakank.org/bprolog/bus_schedule.pl">bus_schedule.pl</a>: Bus scheduling 
  <li> <a href="http://www.hakank.org/bprolog/calculs_d_enfer.pl">calculs_d_enfer.pl</a>: Calculs d'Enfer
  <li> <a href="http://www.hakank.org/bprolog/car.pl">car.pl</a>: Car sequence problem
  <li> <a href="http://www.hakank.org/bprolog/changes.pl">changes.pl</a>: Coin change
  <li> <a href="http://www.hakank.org/bprolog/circling_squares.pl">circling_squares.pl</a>: Circling the squares puzzle
  <li> <a href="http://www.hakank.org/bprolog/circuit.pl">circuit.pl</a>: Decomposition of the global constraint <code>circuit</code>
  <li> <a href="http://www.hakank.org/bprolog/clique.pl">clique.pl</a>: Decomposition of the global constraint <code>clique</code>
  <li> <a href="http://www.hakank.org/bprolog/combinatorial_auction.pl">combinatorial_auction.pl</a>: Combinatorial auction
  <li> <a href="http://www.hakank.org/bprolog/clock_triplet.pl">clock_triplet.pl</a>: Clock triplet puzzle
  <li> <a href="http://www.hakank.org/bprolog/coins3.pl">coins3.pl</a>: Coins problem
  <li> <a href="http://www.hakank.org/bprolog/coins_grid.pl">coins_grid.pl</a>: Coins grid problem
  <li> <a href="http://www.hakank.org/bprolog/contracting_costs.pl">contracting_costs.pl</a>: Contracting costs (Sam Loyd)
  <li> <a href="http://www.hakank.org/bprolog/costas_array.pl">costas_array.pl</a>: Costas array
  <li> <a href="http://www.hakank.org/bprolog/covering_opl.pl">covering_opl.pl</a>: Set covering problem
  <li> <a href="http://www.hakank.org/bprolog/crew.pl">crew.pl</a>: Crew scheduling
  <li> <a href="http://www.hakank.org/bprolog/crossword2.pl">crossword2.pl</a>: Simple cross word problem
  <li> <a href="http://www.hakank.org/bprolog/crypta.pl">crypta.pl</a>: Crypta alphametic problem
  <li> <a href="http://www.hakank.org/bprolog/crypto.pl">crypto.pl</a>: Crypta alphametic problem
  <li> <a href="http://www.hakank.org/bprolog/cumulative_test.pl">cumulative_test.pl</a>: Test of built-in constraint <code>cumulative</code>
  <li> <a href="http://www.hakank.org/bprolog/cur_num.pl">cur_num.pl</a>: Curious numbers (Dudeney)
  <li> <a href="http://www.hakank.org/bprolog/curious_set_of_integers.pl">curious_set_of_integers.pl</a>: Curious set of integers (Martin Gardner)
  <li> <a href="http://www.hakank.org/bprolog/debruijn.pl">debruijn.pl</a>: de Bruijn sequences
  <li> <a href="http://www.hakank.org/bprolog/devils_word.pl">devils_word.pl</a>:  Devil's word (sum of ASCII character of a word) 
  <li> <a href="http://www.hakank.org/bprolog/diet.pl">diet.pl</a>: Diet problem
  <li> <a href="http://www.hakank.org/bprolog/dinner.pl">dinner.pl</a>: A dinner problem
  <li> <a href="http://www.hakank.org/bprolog/discrete_tomography.pl">discrete_tomography.pl</a>: Discrete Tomography
  <li> <a href="http://www.hakank.org/bprolog/distribute.pl">distribute.pl</a>: Decomposition of the global constraint <code>distribute</code>
  <li> <a href="http://www.hakank.org/bprolog/donald_gerald.pl">donald_gerald.pl</a>: Alphametic problem: DONALD + ROBERT = GERALD
  <li> <a href="http://www.hakank.org/bprolog/divisible_by_9_through_1.pl">divisible_by_9_through_1.pl</a>: Divisible by 9 through 1 (only works for base 2..8)
  <li> <a href="http://www.hakank.org/bprolog/dudeney_numbers.pl">dudeney_numbers.pl</a>: Dudeney numbers 
  <li> <a href="http://www.hakank.org/bprolog/einav_puzzle.pl">einav_puzzle.pl</a>: Solving <a href="http://gcanyon.wordpress.com/2009/10/28/a-programming-puzzle-from-einav/">A programming puzzle from Einav</a>
  <li> <a href="http://www.hakank.org/bprolog/einstein_opl.pl">einstein_opl.pl</a>: Einstein logic puzzle (variant of the Zebra problem)
  <li> <a href="http://www.hakank.org/bprolog/eq10.pl">eq10.pl</a>: 10 equations (standard benchmark problem)
  <li> <a href="http://www.hakank.org/bprolog/eq20.pl">eq20.pl</a>: 20 equations (standard benchmark problem)
  <li> <a href="http://www.hakank.org/bprolog/euler1.pl">euler1.pl</a>: Euler #1 (11 different approaches, just a few CLP)
  <li> <a href="http://www.hakank.org/bprolog/euler2.pl">euler2.pl</a>: Euler #2 (not CLP)
  <li> <a href="http://www.hakank.org/bprolog/euler3.pl">euler3.pl</a>: Euler #3 (not CLP)
  <li> <a href="http://www.hakank.org/bprolog/euler4.pl">euler4.pl</a>: Euler #4 (not CLP)
  <li> <a href="http://www.hakank.org/bprolog/euler5.pl">euler5.pl</a>: Euler #5 (not CLP)
  <li> <a href="http://www.hakank.org/bprolog/euler6.pl">euler6.pl</a>: Euler #6 (not CLP)
  <li> <a href="http://www.hakank.org/bprolog/euler7.pl">euler7.pl</a>: Euler #7 (not CLP)
  <li> <a href="http://www.hakank.org/bprolog/euler8.pl">euler8.pl</a>: Euler #8 (not CLP)
  <li> <a href="http://www.hakank.org/bprolog/euler9.pl">euler9.pl</a>: Euler #9 (CLP)
  <li> <a href="http://www.hakank.org/bprolog/euler10.pl">euler10.pl</a>: Euler #10 (not CLP)
  <li> <a href="http://www.hakank.org/bprolog/euler11.pl">euler11.pl</a>: Euler #11 (not CLP)
  <li> <a href="http://www.hakank.org/bprolog/exodus.pl">exodus.pl</a>: Exodus puzzle (Dell Logic Puzzles)
  <li> <a href="http://www.hakank.org/bprolog/fancy.pl">fancy.pl</a>: Mr Greenguest puzzle (Fancy dress problem)
  <li> <a href="http://www.hakank.org/bprolog/fib.pl">fib.pl</a>: Fibonacci (not CLP)
  <li> <a href="http://www.hakank.org/bprolog/fill_a_pix.pl">fill_a_pix.pl</a>: Fill a pix
  <li> <a href="http://www.hakank.org/bprolog/fill_in_the_squares.pl">fill_in_the_squares.pl</a>: Fill in the squares problem (Brainjammer)
  <li> <a href="http://www.hakank.org/bprolog/finding_celebrities2.pl">finding_celebrities2.pl</a>: Finding celebrities at a party
  <li> <a href="http://www.hakank.org/bprolog/five_brigands.pl">five_brigands.pl</a>: Five bridands problem (Dudeney)
  <li> <a href="http://www.hakank.org/bprolog/five_elements.pl">five_elements.pl</a>: Five elements problem (Charles W. Trigg)
  <li> <a href="http://www.hakank.org/bprolog/four_islands.pl">four_islands.pl</a>: Four islands  (Dell Logic Puzzles)
  <li> <a href="http://www.hakank.org/bprolog/fractions.pl">fractions.pl</a>: Fractions (arithmentic puzzle)
  <li> <a href="http://www.hakank.org/bprolog/furniture_moving.pl">furniture_moving.pl</a>: Furniture moving scheduling (using <code>cumulative</code>)
  <li> <a href="http://www.hakank.org/bprolog/futoshiki.pl">futoshiki.pl</a>: Futoshiki grid puzzle
  <li> <a href="http://www.hakank.org/bprolog/game_theory_taha.pl">game_theory_taha.pl</a>: Game theory (simple zero-sum problem from Taha's "OR" book)
  <li> <a href="http://www.hakank.org/bprolog/general_store.pl">general_store.pl</a>: General store alphametic problem
  <li> <a href="http://www.hakank.org/bprolog/global_contiguity.pl">global_contiguity.pl</a>: Decomposition of the global constraint <code>global_contiguity</code>
  <li> <a href="http://www.hakank.org/bprolog/global_cardinality.pl">global_cardinality.pl</a>: Simple (and limited) decomposition of the global constraint <code>global_cardinality</code>
  <li> <a href="http://www.hakank.org/bprolog/golomb_ruler.pl">golomb_ruler.pl</a>: Golomb ruler
  <li> <a href="http://www.hakank.org/bprolog/hamming_distance.pl">hamming_distance.pl</a>: Hamming distance
  <li> <a href="http://www.hakank.org/bprolog/handshaking.pl">handshaking.pl</a>: Halmos' handshake problem
  <li> <a href="http://www.hakank.org/bprolog/hanging_weights.pl">hanging_weights.pl</a>: Hanging weights problem
  <li> <a href="http://www.hakank.org/bprolog/heterosquare.pl">heterosquare.pl</a>: Heterosquare grid problem
  <li> <a href="http://www.hakank.org/bprolog/hidato.pl">hidato.pl</a>: Hidato puzzle
  <li> <a href="http://www.hakank.org/bprolog/hidato_table.pl">hidato_table.pl</a>: Hidato puzzle, using <b>table</b> constraint
  <li> <a href="http://www.hakank.org/bprolog/huey_dewey_louie.pl">huey_dewey_louie.pl</a>: Huey Dewey Louie problem (Marriott and Stuckey)
  <li> <a href="http://www.hakank.org/bprolog/isbn.pl">isbn.pl</a>: Some explorations of ISBN 13
  <li> <a href="http://www.hakank.org/bprolog/jobs_puzzle.pl">jobs_puzzle.pl</a>: Jobs puzzle
  <li> <a href="http://www.hakank.org/bprolog/just_forgotten.pl">just_forgotten.pl</a>: Just forgotten puzzle (Enigma 1517)
  <li> <a href="http://www.hakank.org/bprolog/K4P2GracefulGraph2.pl">K4P2GracefulGraph2.pl</a>: K4P2 Graceful Graph 
  <li> <a href="http://www.hakank.org/bprolog/kakuro.pl">kakuro.pl</a>: Kakuro puzzle
  <li> <a href="http://www.hakank.org/bprolog/kenken2.pl">kenken2.pl</a>: KenKen puzzle
  <li> <a href="http://www.hakank.org/bprolog/killer_sudoku.pl">killer_sudoku.pl</a>: Killer Sudoku puzzle
  <li> <a href="http://www.hakank.org/bprolog/knapsack_investments.pl">knapsack_investments.pl</a>: Knapsack problem with investments (from Lundgren, Rönnqvist, Värbrand: "Optimeringslära")
  <li> <a href="http://www.hakank.org/bprolog/labeled_dice.pl">labeled_dice.pl</a>: Two word problem: Labeled dice and Building blocks
  <li> <a href="http://www.hakank.org/bprolog/langford.pl">langford.pl</a>: Langford number problem
  <li> <a href="http://www.hakank.org/bprolog/latin_squares.pl">latin_squares.pl</a>: Latin squares
  <li> <a href="http://www.hakank.org/bprolog/lecture_series.pl">lecture_series.pl</a>: Lecture series puzzle (Dell Logic Puzzles)
  <li> <a href="http://www.hakank.org/bprolog/lectures.pl">lectures.pl</a>: Lectures problem (Biggs: Discrete Mathematics)
  <li> <a href="http://www.hakank.org/bprolog/least_diff.pl">least_diff.pl</a>: Least Diff problem
  <li> <a href="http://www.hakank.org/bprolog/lichtenstein_coloring.pl">lichtenstein_coloring.pl</a>: Lichtenstein Coloring problem
  <li> <a href="http://www.hakank.org/bprolog/magic_hexagon.pl">magic_hexagon.pl</a>: Magic hexagon
  <li> <a href="http://www.hakank.org/bprolog/magic_sequence.pl">magic_sequence.pl</a>: Magic sequence (CSPLib problem #19)
  <li> <a href="http://www.hakank.org/bprolog/magic_square.pl">magic_square.pl</a>: Magic squares
  <li> <a href="http://www.hakank.org/bprolog/magic_square_and_cards.pl">magic_square_and_cards.pl</a>: Magic square and cards (Martin Gardner)
  <li> <a href="http://www.hakank.org/bprolog/mankell.pl">mankell.pl</a>: "All" misspellings of "Mankell" and "Kjellerstrand" using DCG (not CLP)
  <li> <a href="http://www.hakank.org/bprolog/map.pl">map.pl</a>: Simple coloring problem
  <li> <a href="http://www.hakank.org/bprolog/marathon2.pl">marathon2.pl</a>: Marathon puzzle
  <li> <a href="http://www.hakank.org/bprolog/max_flow_taha.pl">max_flow_taha.pl</a>: Maximum flow problem (from Taha: "Operations Research")
  <li> <a href="http://www.hakank.org/bprolog/max_flow_winston1.pl">max_flow_winston1.pl</a>: Maximum flow problem (from Winston: "Operations Research")
<li> <a href="http://www.hakank.org/bprolog/minesweeper.pl">minesweeper.pl</a>: Minesweeper solver
<li> <a href="http://www.hakank.org/bprolog/monks_and_doors.pl">monks_and_doors.pl</a>: Monks and doors problem
<li> <a href="http://www.hakank.org/bprolog/mr_smith.pl">mr_smith.pl</a>: Mr Smith logical problem
<li> <a href="http://www.hakank.org/bprolog/music_men.pl">music_men.pl</a>: Music men logical problem
<li> <a href="http://www.hakank.org/bprolog/nadel.pl">nadel.pl</a>: B.A. Nadel's construction problem (Rina Dichter)
<li> <a href="http://www.hakank.org/bprolog/number_of_days.pl">number_of_days.pl</a>: Number of days knapsack problem (Nathan Brixius)
<li> <a href="http://www.hakank.org/bprolog/nvalue.pl">nvalue.pl</a>: Decomposition of the global constraint <code>nvalue</code>
<li> <a href="http://www.hakank.org/bprolog/nvalues.pl">nvalues.pl</a>: Decomposition of the global constraint <code>nvalues</code>
<li> <a href="http://www.hakank.org/bprolog/olympic.pl">olympic.pl</a>: Olympic arithmetic puzzle
<li> <a href="http://www.hakank.org/bprolog/organize_day.pl">organize_day.pl</a>: Organizing a day, simple scheduling problem
<li> <a href="http://www.hakank.org/bprolog/ormat_game.pl">ormat_game.pl</a>: Ormat game (from bit-player: <a href="http://bit-player.org/2010/the-ormat-game">The ormat game</a>)
<li> <a href="http://www.hakank.org/bprolog/p_median.pl">p_median.pl</a>: P median problem (OPL)
<li> <a href="http://www.hakank.org/bprolog/pair_divides_the_sum.pl">pair_divides_the_sum.pl</a>: Pair divides the sum puzzle
<li> <a href="http://www.hakank.org/bprolog/pandigital_numbers.pl">pandigital_numbers.pl</a>: Pandigital number problem
<li> <a href="http://www.hakank.org/bprolog/partition_into_subset_of_equal_values.pl">partition_into_subset_of_equal_values.pl</a>: Partition into subset of equal sums (Stack Exchange)
<li> <a href="http://www.hakank.org/bprolog/pert.pl">pert.pl</a>: Simple PERT model (Van Hentenryck)
<li> <a href="http://www.hakank.org/bprolog/photo_problem.pl">photo_problem.pl</a>: Photo problem (Mozart/Oz)
<li> <a href="http://www.hakank.org/bprolog/pigeon_hole.pl">pigeon_hole.pl</a>: Pigeon hole problem
<li> <a href="http://www.hakank.org/bprolog/place_number_puzzle.pl">place_number_puzzle.pl</a>: Place number puzzle
<li> <a href="http://www.hakank.org/bprolog/post_office_problem2.pl">post_office_problem2.pl</a>: Post office problem
<li> <a href="http://www.hakank.org/bprolog/pythagoras.pl">pythagoras.pl</a>: Pythagora's problem
<li> <a href="http://www.hakank.org/bprolog/quasigroup_completion.pl">quasigroup_completion.pl</a>: Quasigroup completion
<li> <a href="http://www.hakank.org/bprolog/queens.pl">queens.pl</a>: N-Queens problem
<li> <a href="http://www.hakank.org/bprolog/rabbits.pl">rabbits.pl</a>: Rabbits problem (Van Hentenryck)
<li> <a href="http://www.hakank.org/bprolog/remainders.pl">remainders.pl</a>: Remainders problem (Kordemsky)
<li> <a href="http://www.hakank.org/bprolog/remarkable_sequence.pl">remarkable_sequence.pl</a>: A Remarkable Sequence (Alma-0)
<li> <a href="http://www.hakank.org/bprolog/safe_cracking.pl">safe_cracking.pl</a>: Safe cracking (Mozart/Oz)
<li> <a href="http://www.hakank.org/bprolog/schedule1.pl">schedule1.pl</a>: Scheduling problem (from SICStus Prolog)
<li> <a href="http://www.hakank.org/bprolog/scheduling_speakers.pl">scheduling_speakers.pl</a>: Scheduling speakers (Rina Dechter)
<li> <a href="http://www.hakank.org/bprolog/secret_santa.pl">secret_santa.pl</a>: Secret Santa problem
<li> <a href="http://www.hakank.org/bprolog/send_more_money.pl">send_more_money.pl</a>: SEND+MORE=MONEY
<li> <a href="http://www.hakank.org/bprolog/send_most_money.pl">send_most_money.pl</a>: SEND+MOST=MONEY (and maximize MONEY)
<li> <a href="http://www.hakank.org/bprolog/sequence.pl">sequence.pl</a>: Decomposition of the global constraint <code>sequence</code>
<li> <a href="http://www.hakank.org/bprolog/seseman.pl">seseman.pl</a>: Seseman Convent problem
<li> <a href="http://www.hakank.org/bprolog/set_covering.pl">set_covering.pl</a>: Set covering: placing of firestations (Winston "Operations Research")
<li> <a href="http://www.hakank.org/bprolog/set_covering2.pl">set_covering2.pl</a>: Set covering: security telephone on campus (Taha "Operations Research", example 9.1-2)
<li> <a href="http://www.hakank.org/bprolog/set_covering3.pl">set_covering3.pl</a>: Set covering: assigning senators to committees (Murty "Optimization Models for Decision Making")
<li> <a href="http://www.hakank.org/bprolog/set_covering4.pl">set_covering4.pl</a>: Set covering/partition problem (Lundgren, Rönnqvist, Värbrand "Optimeringslära", page 408)
<li> <a href="http://www.hakank.org/bprolog/set_covering5.pl">set_covering5.pl</a>: Set covering, work scheduling (Lundgren, Rönnqvist, Värbrand "Optimeringslära", page 410) 
<li> <a href="http://www.hakank.org/bprolog/set_covering_deployment.pl">set_covering_deployment.pl</a>: Set covering deployment
<li> <a href="http://www.hakank.org/bprolog/set_covering_skiena.pl">set_covering_skiena.pl</a>: Set covering (Skiena)
<li> <a href="http://www.hakank.org/bprolog/set_partition.pl">set_partition.pl</a>: Set partition problem
<li> <a href="http://www.hakank.org/bprolog/sicherman_dice.pl">sicherman_dice.pl</a>: Sicherman Dice
<li> <a href="http://www.hakank.org/bprolog/ski_assignment.pl">ski_assignment.pl</a>: Ski assignment
<li> <a href="http://www.hakank.org/bprolog/sliding_sum.pl">sliding_sum.pl</a>: Decomposition of the global constraint <code>sliding_sum</code>
<li> <a href="http://www.hakank.org/bprolog/smugglers_knapsack.pl">smugglers_knapsack.pl</a>: Smuggler's knapsack (Marriott and Stuckey)
<li> <a href="http://www.hakank.org/bprolog/social_golfers1.pl">social_gofters1.pl</a>: Social golfer problem (CSPLib # 10)
<li> <a href="http://www.hakank.org/bprolog/social_golfers2.pl">social_gofters2.pl</a>: Social golfer problem (CSPLib # 10)
<li> <a href="http://www.hakank.org/bprolog/sonet.pl">sonet.pl</a>: SONET problem
<li> <a href="http://www.hakank.org/bprolog/spreadsheet.pl">spreadsheet.pl</a>: Simple spreadsheet (using <code>lp_solve</code>)
<li> <a href="http://www.hakank.org/bprolog/stable_marriage.pl">stable_marriage.pl</a>: Stable marriage problem
<li> <a href="http://www.hakank.org/bprolog/steiner.pl">steiner.pl</a>: Steiner triplets (emulating sets)
<li> <a href="http://www.hakank.org/bprolog/strimko2.pl">strimko2.pl</a>: Strimko grid puzzle
<li> <a href="http://www.hakank.org/bprolog/stuckey_seesaw.pl">stuckey_seesaw.pl</a>: Seesaw problem (Marriott and Stuckey)
<li> <a href="http://www.hakank.org/bprolog/subset_sum.pl">subset_sum.pl</a>: Subset sum
<li> <a href="http://www.hakank.org/bprolog/sudoku.pl">sudoku.pl</a>: Sudoku
<li> <a href="http://www.hakank.org/bprolog/survo_puzzle.pl">survo_puzzle.pl</a>: Survo puzzle
<li> <a href="http://www.hakank.org/bprolog/table.pl">table.pl</a>: (Simple) decomposition of the global constraint <code>table</code>
<li> <a href="http://www.hakank.org/bprolog/talisman_square.pl">talisman_square.pl</a>: Talisman square
<li> <a href="http://www.hakank.org/bprolog/the_family_puzzle.pl">the_family_puzzle.pl</a>: The family puzzle
<li> <a href="http://www.hakank.org/bprolog/timpkin.pl">timpkin.pl</a>: Mrs Timpkin's Age (Dudeney)
<li> <a href="http://www.hakank.org/bprolog/to_num.pl">to_num.pl</a>: converts a number to a digit list (and vice versa)
<li> <a href="http://www.hakank.org/bprolog/torn_numbers.pl">torn_numbers.pl</a>: Torn numbers (Dudeney)
<li> <a href="http://www.hakank.org/bprolog/tourist_site_competition.pl">tourist_site_competition.pl</a>: Tourist Site Competition
<li> <a href="http://www.hakank.org/bprolog/traffic_lights.pl">traffic_lights.pl</a>: Traffic lights (CSPLib problem #16)
<li> <a href="http://www.hakank.org/bprolog/trains.pl">trains.pl</a>: Trains (example from SWI-Prolog of using table constraint)
<li> <a href="http://www.hakank.org/bprolog/tunapalooza.pl">tunapalooza.pl</a>: Tunapalooza puzzle (Dell Logic Puzzles)
<li> <a href="http://www.hakank.org/bprolog/twin_letters.pl">twin_letters.pl</a>: Twin letters (Mozart/Oz)
<li> <a href="http://www.hakank.org/bprolog/volsay1.pl">volsay1.pl</a>: Volsay problem (OPL)
<li> <a href="http://www.hakank.org/bprolog/volsay2.pl">volsay2.pl</a>: Volsay problem (OPL), slightly different from volsay1.pl
<li> <a href="http://www.hakank.org/bprolog/warehouse.pl">warehouse.pl</a>: Warehouse location (OPL)
<li> <a href="http://www.hakank.org/bprolog/who_killed_agatha.pl">who_killed_agatha.pl</a>: Who killed Agatha (logical puzzle)
<li> <a href="http://www.hakank.org/bprolog/xkcd.pl">xkcd.pl</a>: Xkcd knapsack problem
<li> <a href="http://www.hakank.org/bprolog/young_tableaux.pl">young_tableaux.pl</a>: Young tableaux and partition
<li> <a href="http://www.hakank.org/bprolog/zebra.pl">zebra.pl</a>: Zebra problem (Lewis Carroll)
</ul>

]]>
        
    </content>
</entry>
<entry>
    <title>SweConsNet Workshop 2013 (Call for speakers)</title>
    <link rel="alternate" type="text/html" href="http://www.hakank.org/constraint_programming_blog/2013/02/sweconsnet_workshop_2013_call_for_speakers_1.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.hakank.org/webblogg/mt-atom.cgi/weblog/blog_id=3/entry_id=1477" title="SweConsNet Workshop 2013 (Call for speakers)" />
    <id>tag:www.hakank.org,2013:/constraint_programming_blog//3.1477</id>
    
    <published>2013-02-05T16:52:24Z</published>
    <updated>2013-02-05T16:53:28Z</updated>
    
    <summary>The SweConsNet Workshop 2013 will take place in Lund, Sweden on May 27th 2013. From the site: The 12th Workshop of the Network of Sweden-based researchers and practitioners of Constraint programming SweConsNet is the Network for Sweden-based researchers and practitioners...</summary>
    <author>
        <name>hakank</name>
        <uri>http://www.hakank.org/webblogg</uri>
    </author>
            <category term="SweConsNet" />
    
    <content type="html" xml:lang="en" xml:base="http://www.hakank.org/constraint_programming_blog/">
        <![CDATA[The <a href="http://www.lth.se/programvaruportalen/kalendarium/sweconsnet_workshop_2013">SweConsNet Workshop 2013</a> will take place in Lund, Sweden on May 27th 2013. 
<br><br>
From the site:
<blockquote>
The 12th Workshop of the Network of Sweden-based researchers and practitioners of Constraint programming
<br><br>
SweConsNet is the Network for Sweden-based researchers and practitioners of Constraint programming.
<br><br>
Following the previous successful workshops, we would like to announce the 12th SweConsNet workshop, which will take place in <b>Lund, Sweden on May 27th 2013</b>. The purpose of this workshop is to learn about ongoing research in constraint programming, as well as existing projects and products. We will also discuss the further development of the network, such as a possible widening to other Nordic countries.
<br><br>
The workshop is open to everybody interested in the theory and practice of constraint programming, whether based in Sweden or elsewhere. The scope of the workshop spans all areas of Constraint Programming, and is open to presentations and discussions addressing topics related to both theory and application. 
<br><br>
...
<br><br>
We hope for your participation, and highly encourage you to submit a proposal for a presentation of your ongoing work, recent results, or of a relevant discussion topic. There are no paper submissions, reviews, or proceedings, hence recent conference/journal papers may also be presented. 
</blockquote>

Here's the first and preliminary program (the site will be updated continuously):
<ul>
 <li> Jean-Noël Monette (Uppsala University): Towards solver-independent propagators
 <li> Håkan Kjellerstrand: What I like about Constraint Programming
 <li> Mats Carlsson (SICS), TBD.
 <li> Christian Schulte (KTH), TBD.
 <li> Krzysztof Kuchcinski (LTH), TBD.
</ul>

Krzysztof Kuchcinski is the organizer this time.
<br><br>
My own talk will probably be titles <i>What I <b>(still)</b> like about Constraint Programming</i> - or on the same theme: <i>Why I'm (still) fascinated by Constraint Programming</i>. It will be a talk about things that is so great about CP; i.e. no ground breaking research stuff (unless ...).

<br><br>
Also see: <a href="http://www.it.uu.se/research/SweConsNet/">SweConsNet</a>.


]]>
        
    </content>
</entry>
<entry>
    <title>CP2013:  Organization and Call for Papers</title>
    <link rel="alternate" type="text/html" href="http://www.hakank.org/constraint_programming_blog/2013/01/cp2013_organization_and_call_for_papers.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.hakank.org/webblogg/mt-atom.cgi/weblog/blog_id=3/entry_id=1476" title="CP2013:  Organization and Call for Papers" />
    <id>tag:www.hakank.org,2013:/constraint_programming_blog//3.1476</id>
    
    <published>2013-01-23T06:00:01Z</published>
    <updated>2013-01-23T06:01:49Z</updated>
    
    <summary>The site of CP2013 (The 19th International Conference on Principles and Practice of Constraint Programming, September 16-20, 2013, Uppsala, Sweden) has been updated with the following: Organization: now has information about the full program committees for both the technical and...</summary>
    <author>
        <name>hakank</name>
        <uri>http://www.hakank.org/webblogg</uri>
    </author>
            <category term="Constraint programming, general" />
    
    <content type="html" xml:lang="en" xml:base="http://www.hakank.org/constraint_programming_blog/">
        <![CDATA[The site of <a href="http://cp2013.a4cp.org/">CP2013</a> (The 19th International Conference on
Principles and Practice of Constraint Programming, September 16-20, 2013, Uppsala, Sweden) has been updated with the following:
<ul>
 <li> <a href="http://cp2013.a4cp.org/organization">Organization</a>: <i>now has information about the full program committees for both the technical and the application track.</i>
 <li> <a href="http://cp2013.a4cp.org/call-workshops">Call for Workshop Proposals</a>:<b>
<blockquote>
The CP 2013 Workshop Chair invites proposals for the Workshops immediately preceding the main conference in Uppsala. <br>
<br>
 The CP workshops offer an informal venue where participants are given the opportunity to present discuss and brainstorm on new ideas, technical topics, exciting new application areas and cross-fertilization with other domains. The forums are meant as a petri dish for new ideas and emerging topics in the field of constraint programming. The topics can overspread many areas ranging from modeling, tools, techniques, algorithms, methodology, discrete and continuous optimization as well as complete and incomplete methods. Relevant areas showcasing or contributing to CP such as cloud computing, cryptography, energy, sustainability, databases, machine learning or data mining — to name just a few — are all equally encouraged.
<br><br>
All workshops will take place on September 16, 2013 at the site of the main conference. Workshops can follow a half-day or a full-day format. The details of the organization of each workshop are left to its organizers
</blockquote>
 <li> <a href="http://cp2013.a4cp.org/call-tutorials">Call for Tutorials</a>: <br>
<blockquote>
The CP 2013 Tutorial Chair invites proposals for tutorials in Uppsala.
<br><br>
Tutorials are expected to give an in-depth presentation of emerging and exciting topics that are relevant to a broad swath of the constraint programming community. Past CP conferences featured tutorials on numeral CSPs, global constraints, languages, Disaster Management, Decision Diagrams and connection with mathematical programming. Topics currently at the fore-front of research activities with successes, major advances and significant impact are particularly welcome.
<br><br>
The tutorials will take place during the main technical program. 
</blockquote>
</ul>]]>
        
    </content>
</entry>
<entry>
    <title>Administratrivialities: Technorati claim</title>
    <link rel="alternate" type="text/html" href="http://www.hakank.org/constraint_programming_blog/2012/12/administratrivialities_technorati_claim.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.hakank.org/webblogg/mt-atom.cgi/weblog/blog_id=3/entry_id=1475" title="Administratrivialities: Technorati claim" />
    <id>tag:www.hakank.org,2012:/constraint_programming_blog//3.1475</id>
    
    <published>2012-12-03T17:48:23Z</published>
    <updated>2012-12-03T17:52:08Z</updated>
    
    <summary>Sorry about this administrative post, but Technorati wants me to post this to claim this blog. Well, here is the code: NSQNSF9S9TMW...</summary>
    <author>
        <name>hakank</name>
        <uri>http://www.hakank.org/webblogg</uri>
    </author>
    
    <content type="html" xml:lang="en" xml:base="http://www.hakank.org/constraint_programming_blog/">
        <![CDATA[Sorry about this administrative post, but <a href="http://technorati.com/">Technorati</a> wants me to post this to claim  this blog.  Well, here is the code: NSQNSF9S9TMW 

]]>
        
    </content>
</entry>
<entry>
    <title>A first look at AIMMS+CP (AIMMS with Constraint Programming)</title>
    <link rel="alternate" type="text/html" href="http://www.hakank.org/constraint_programming_blog/2012/11/a_first_look_at_aimmscp_aimms_with_constraint_programming.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.hakank.org/webblogg/mt-atom.cgi/weblog/blog_id=3/entry_id=1472" title="A first look at AIMMS+CP (AIMMS with Constraint Programming)" />
    <id>tag:www.hakank.org,2012:/constraint_programming_blog//3.1472</id>
    
    <published>2012-11-23T20:00:03Z</published>
    <updated>2012-11-23T20:04:36Z</updated>
    
    <summary>In the Summer of 2011 I had the opportunity to test an early beta version of AIMMS+CP (AIMMS with Constraint Programming), and then did a second test round in September 2012 (with a late beta version). Here are some of...</summary>
    <author>
        <name>hakank</name>
        <uri>http://www.hakank.org/webblogg</uri>
    </author>
    
    <content type="html" xml:lang="en" xml:base="http://www.hakank.org/constraint_programming_blog/">
        <![CDATA[In the Summer of 2011 I had the opportunity to test an early beta version of AIMMS+CP (AIMMS with Constraint Programming), and then did a second test round in September 2012 (with a late beta version). Here are some of my comments of my experiences with AIMMS+CP during these tests. A little later, in October 2012, Paragon released version 13.1 to the public including <a href="http://www.aimms.com/operations-research/mathematical-programming/constraint-programming">AIMMS+CP</a>.
<br><br>
My <a href="http://www.hakank.org/aimms/">AIMMS+CP page</a> links to both .aim files (which shows the textual representation of parameters, variables and constraints) and the .aimmspack file (a binary file containing the full model project including the GUI part and other settings). As usual I have implemented many of my "starting/learning" models to be able to <a href="http://www.hakank.org/common_cp_models/">compare</a> them with other CP systems. I would like to thank especially Chris Kuip and Gertjan de Lange from Paragon for great support, suggestions and inspirations during these tests.
<br><br>
First a little about Paragon and their commercial product AIMMS, from the <a href="http://www.aimms.com/aimms/overview">Overview</a>:
<blockquote>
AIMMS offers an all-round development environment for the creation of high-performance decision
support and advanced planning applications to optimize strategic operations. It allows organizations
to rapidly improve the quality, service, profitability, and responsiveness of their operations.
The AIMMS development environment possesses a unique combination of advanced features and
design tools, such as the graphical model explorer, which allow you to build and maintain complex
decision support applications and advanced planning systems  in a fraction of the time required
by conventional programming tools.
</blockquote>

One distinct feature of AIMMS is the integrated GUI where one both define the parameters, variable and constraints as well as the graphical input/output of the model. I should note that this is the first time in my CP experience that I've worked with this kind of tight integrated tool, which might explain some of the comments below.
<br><br>
AIMMS GUI tool was (and still is AFAIK) only for Windows, so I used VirtualBox under my Linux Ubuntu 12.04 when testing. Also, before the test, I have not used AIMMS at all.

<h3>Documentation, examples</h3>
There is a lot of documentations of how AIMMS work (PDF files available from the <b>Help</b> menu):
<ul>
    <li> AIMMS Getting Started 
    <li> AIMMS User's Guide
    <li> AIMMS Language Reference
    <li> AIMMS Optimization Modeling
    <li> AIMMS Function Reference
    <li> AIMMS Tutorial
    <li> etc
</ul>

The documentation of the CP related features has been incorporated in these documents, especially
AIMMS Language Reference, chapter 21 ("Constraint Programming") including a short introduction
to CP and a discussion of the different variables types (<code>Variable</code>, <code>Element Variable</code>) used in CP modeling.
<br><br>
For a person that knows AIMMS well and also know how CP works, the documentation is probably enough.
But for someone like me that didn't know AIMMS before or someone who know AIMMS but not CP,
the documentation is a little thin, especially since the examples are quite advanced to get started.
I missed some of the standard CP examples such as N-queens, Send More Money,
Sudoku, etc and examples of the basic stuff, such as how handle single variables, comparisons etc.
Hopefully my <a href="http://www.hakank.org/aimms/">AIMMS+CP implementations</a> might be of some help.
<br><br>
The documentation don't say much about the CP solver and what options it has (and what they mean); though the is some documentation available with the Help button for the options. It is great that there are good support for scheduling and the example models are interesting, but - again - too complicated to start learning from. 
<br><br>
I should mention that I have not read the complete documentation of AIMMS. Instead I started to
code in AIMMS almost directly. This might have been a bad decision since I got stumped a couple of
times with some of AIMMS basic concepts.
<br><br>
I later realized that <a href="http://blog.aimms.com/">AIMMS Blog</a> contains tips and documentation regarding certain AIMMS features. 

<h2>Modeling in AIMMS</h2>
Here I will focus on the modeling part. I have actually done very little extra with the graphics:
it's just a Solve button, input fields and output fields/tables, i.e. nothing fancy at all. The models that
is distributed with AIMMS is, on the other hand, much more elaborated and tasty and shows a huge number
of general different possibilities in AIMMS; though - as mentioned above - there are not many CP
specific models. In part, I wrote some of the detailed comments below with a hope to help newcomers in AIMMS+CP. 
<br><br>
Below I will try to explain CP modeling in AIMMS+CP as well as some personal comments during my
tests. So, let's start with the standard example: SEND+MORE=MONEY (or perhaps Sudoku is more standard nowadays?).
<br><br>
A word of caution: These models are tested with a beta version of AIMMS+CP (albeit a late beta), so some constraints/features might have been changed in the current version.

<h2>SEND + MORE = MONEY: Some concepts</h2>
Model: <a href="http://hakank.org/aimms/SendMoreMoney2.aim">SendMoreMoney2.aim</a>
<br><br>
Compared to other CP systems, AIMMS use a little different concepts and approach when modeling,
and here I will show this using the SEND+MORE=MONEY problem, where the object - of course - is to
assign each letter to an integer so that the equation holds.
<br><br>
In this problem we define the array <code>x</code> with the <b>index domain</b> <code>i</code> (defined as a subset of Integers with the values <code>{1,2,3,4,5,6,7,8}</code>. Then all the <b>parameters</b>
(constants) <code>S,E,N,D,M,O,R,Y</code> are defined to be able to be index in <code>x</code>, e.g.
such as <code>1000*x(S)+ 100*x(E)+ 10*x(N)+x(D)</code> (defining SEND) etc.
<br><br>
All these definitions are done via AIMMS' GUI, the <b>Model Explorer</b>. Here is a picture how it looks like; the graphical I/O is shown to the right (the Page Manager):
<br><br><br>
<a href="http://hakank.org/aimms/AIMMS_SEND_MORE_MONEY.png"><image src="http://hakank.org/aimms/AIMMS_SEND_MORE_MONEY.png" alt="AIMMS SEND+MORE=MONEY" width="463"></a>
<br><br><br>
Below is the full definition of the model except for the graphical part (compare
with the .aim file <a href="http://hakank.org/aimms/SendMoreMoney2.aim">SendMoreMoney2.aim</a>). Note that one very important feature in AIMMS is that one define the <b>set</b> of the indices to be used in an array: here the index <code>i</code> is defined via the set <code>ii</code> (the name of the set is not so important except for documentation purposes). When defining the array (<code>x</code>) the size is defined by the range of the index. So we define the array <code>x(i)</code> (<b>identifier</b>: <code>x</code>, <b>index domain</b>: <code>(i)</code>) and makes it a <code>Variable</code> with the <b>range</b> of <code>{0..9}</code> (i.e. the <b>domain</b> of the values in <code>x</code>).
<br><br>
Then we define the traditional constraints:
<ul>
 <li> The values of S and M must be &gt; 0: <code>x(S) &gt; 0 and x(M) &gt; 0</code>
 <li> The main constraint SEND+MORE=MONEY is defined as usual:<br>
<code>
             (1000*x(S) + 100*x(E)+ 10*x(N) + x(D)  +<br>
              1000*x(M) + 100*x(O)+ 10*x(R) + x(E)) =<br>
(10000*x(M) + 1000*x(O) + 100*x(N) + 10*x(E) + x(Y))
</code>
</ul>  

And here are most of the definitions (slightly edited). A text representation of the model
is available via the GUI: <code>View, Text Representation, All</code>.
<pre>
DECLARATION SECTION 
    SET:
       identifier   :  ii
       subset of    :  Integers
       index        :  i
       definition   :  {1,2,3,4,5,6,7,8} ;

    CONSTRAINT:
       identifier   :  SendMoreMoney
       definition   :  (1000*x(S) + 100*x(E)+ 10*x(N) + x(D) +
                        1000*x(M) + 100*x(O)+ 10*x(R) + x(E)) =
            (10000*x(M) + 1000*x(O) + 100*x(N) + 10*x(E) + x(Y)) ;

    MATHEMATICAL PROGRAM:
       identifier   :  SendMoreMoney2Plan
       direction    :  minimize
       constraints  :  AllConstraints
       variables    :  AllVariables
       type         :  CSP ;

    CONSTRAINT:
       identifier   :  SM
       definition   :  x(S) > 0 and x(M) > 0  ;

    <b>VARIABLE:
       identifier   :  x
       index domain :  (i)
       range        :  {0..9} ;</b>

    PARAMETER:
       identifier   :  S
       definition   :  1 ;

    PARAMETER:
       identifier   :  E
       definition   :  2 ;

    PARAMETER:
       identifier   :  N
       definition   :  3 ;

    PARAMETER:
       identifier   :  D
       definition   :  4 ;

    PARAMETER:
       identifier   :  M
       definition   :  5 ;

    PARAMETER:
       identifier   :  O
       definition   :  6 ;

    PARAMETER:
       identifier   :  R
       definition   :  7 ;

    PARAMETER:
       identifier   :  Y
       definition   :  8 ;

    CONSTRAINT:
       identifier   :  AllDiff
       definition   :  cp::AllDifferent(i, x(i)) ;

  ENDSECTION  ;

  PROCEDURE
    identifier :  MainInitialization

  ENDPROCEDURE  ;

  PROCEDURE
    identifier :  <b>MainExecution</b>
    body       :  
      ShowProgressWindow;
      solve SendMoreMoney2Plan;

  ENDPROCEDURE  ;

ENDMODEL Main_SendMoreMoney2 ;
</pre>

The call <code>cp::AllDifferent(i, x(i))</code> works like this: The first parameter <code>i</code> is the
"loop index" which is used to loop through the second argument <code>x(i)</code>, i.e. it states that all
the elements in <code>x</code> should be distinct. This is how for-loops are done in AIMMS and is a very
common idiom.
<br><br>

The procedure <b>MainExecution</b> is where the program is started and is essential to get
things working. Here we just do the following:
<ul>
    <li> <code>ShowProgressWindow</code>: the <b>Progress window</b> shows how the model progress as well as
         the time, number of failures, etc.
    <li> <code>solve SendMoreMoney2Plan</code> which actuall start the solving process. This must be defined for all models.
  <b>SendMoreMoney2Plan</b> is of type <b>mathematical program</b> (select this type of identifier via type options labeled "<code>...</code>"). For Constraint Satisfaction models like this, select <code>Type: CSP</code>, and let <code>Direction</code> be whatever (minimize or maximize). For optimization models, the type should be <code>COP</code> (Constraint OPtimization), and state the objective variable, and the direction. (Note: The objective variable must be <code>Free</code> for some reason.)
</ul>

In the <b>Page Manager</b>, the <b>Solve</b> button is then connected to the action running <code>Main Execution</code> (not
shown in the listing above since it belongs to the GUI.)


<h2>NQueens</h2>
The first <b>naive</b> version of the N-queens problem is <a href="http://hakank.org/aimms/NQueens.aim">NQueens.aim</a>, but is slow for larger N:
<pre>
CONSTRAINT:
   identifier   :  C1
   index domain :  (i,j)
   definition   :  (i < j) and x(i) <> x(j)   ;

CONSTRAINT:
   identifier   :  C2
   index domain :  (i,j)
   definition   :  (i < j) and x(i) + i <> x(j) + j ;

CONSTRAINT:
   identifier   :  C3
   index domain :  (i,j)
   definition   :  (i < j) and x(i) - i <> x(j) - j ;

CONSTRAINT:
   identifier   :  AllDiff
   definition   :  cp::AllDifferent(i, x(i)) ;
</pre>

The more modern - and faster - version is shown in <a href="http://hakank.org/aimms/NQueens2.aim">NQueens2.aim</a>
which use three <code>alldifferent</code> constraints:
<pre>
CONSTRAINT:
  identifier   :  alldiff1
  definition   :  cp::AllDifferent(i, x(i)) ;

CONSTRAINT:
  identifier   :  alldiff2
  definition   :  cp::AllDifferent(i, x(i)-i) ;

CONSTRAINT:
  identifier   :  alldiff3
  definition   :  cp::AllDifferent(i, x(i)+i) ;
</pre>


To see the number of solutions of a model, just add this line last in MainExecution:
<pre>
DialogMessage(GMP::Solution::Count('ProjectPlan'));
</pre>
together with a large enough value of <code>Solution storage limit</code> in <code>Setting, Project Settings, Specific Solvers, CPoptimizer 12.4, General</code>.
<br><br>
It would be nice to have an easy way to actually showing all solutions, but I'm
often quite happy with this feature.
<br><br>
One could note that AIMMS - with <a href="http://www.aimms.com/aimms/solvers/cp-optimizer">CPoptimizer</a> as solver - shows the first solution of N=1000 in 3 seconds (422 failures).
<br>My system setup for this benchmark: Running AIMMS in a Virtual Box running Windows 7, allotted 2Gb RAM, under a Linux Ubuntu 12.04, 64-bit with 12Gb RAM and 8 core Intel 930@2.80GHz.


<h2>CoinsGrid</h2>
Model: <a href="http://www.hakank.org/aimms/CoinsGridCP.aim">CoinsGridCP.aim</a><br>
Model: <a href="http://www.hakank.org/aimms/CoinsGridCPMIP.aim">CoinsGridCPMIP.aim</a>
<br><br>

This is originally a MIP problem but I use it to see how a CP solver handles the
problem (often not very good so I'm yet to be surprised). I originally thought of
doing two versions of this, one CP version and one MIP version. But it's so easy to
change to MIP version so I first settled with just one  project, hence the name
CoinsGridCP.
<br><br>
Note: Chris Kuip was kind enought to later add a way to select between CP and MIP, see <a href="http://www.hakank.org/aimms/CoinsGridCPMIP.aim">CoinsGridCPMIP.aim</a>.


<h2>Map, Map2</h2>
Model: <a href="http://www.hakank.org/aimms/Map.aim">Map.aim</a><br>
Model: <a href="http://www.hakank.org/aimms/Map2.aim">Map2.aim</a>
<br><br>
This is a simple Map coloring problem, with two variants: Map and Map2.
<br><br>
For the standard settings the model <a href="http://www.hakank.org/aimms/Map.aim">Map.aim</a> shows this solution:
<pre>
   Country     Colors
   ------------------
   Belgium     2 
   Denmark     1 
   France      4 
   Germany     3 
   Netherlands 1 
   Luxembourg  1
</pre>

which is perfectly fine. Without any symmetry breaking there are 144 solutions.
<br><br>
<b>Symmetry breaking</b><br>
Here is a simple symmetry breaking, where we state that Belgium has color 1 (whatever that
color represents) with a restriction in the Index domain:
<pre>
     Index domain: c1 | c1 = "Belgium"
     Colors(c1) = 1
</pre>

The solution is now:
<pre>
   Country     Colors
   ------------------
   Belgium     1
   Denmark     1 
   France      4 
   Germany     3 
   Netherlands 2 
   Luxembourg  2
</pre>
which is also a correct solution.

<br><br>
Since that worked quite well, I also tried another version of Map (<a href="http://www.hakank.org/aimms/Map2.aim">Map2.aim</a>) that use real color names instead of integers, and also
use another representation of the connections between the countries. This is perhaps more in the
spirit of AIMMS.
<br><br>
The set <code>Colors</code> is defined as:
<pre>
data {red, blue, green, yellow}
</pre>

It was also very easy to do the direct representation of the 
connections between the countries. AIMMS converts automatically to a boolean 
connection matrix (a nice feature):
<br><br>
<pre>
DATA { (Belgium, [France, Germany, Netherlands, Luxembourg]),
       (Denmark, [Germany]),
       (France, [Belgium, Germany, Netherlands, Luxembourg]),
       (Germany, [Belgium, Denmark, France, Netherlands, Luxembourg]),
       (Netherlands, [Belgium, France, Germany]),
       (Luxembourg, [Belgium, Germany]) }
</pre>

However, it was a little bit harder to define the "DifferentColor" constraint using the
color names, but after changing <code>CountryColors</code> to a <code>ElementVariable</code>
and <code>Range: Colors </code> it worked as expected.

<pre>
SET:
   identifier   :  Countries
   indices      :  c1, c2
   definition   :  data {Belgium, Denmark, France, Germany, Netherlands, Luxembourg} ;

SET:
   identifier   :  Colors
   index        :  c
   initial data :  data {red, blue, green, yellow} ;

ELEMENT VARIABLE:
   identifier   :  CountryColor
   index domain :  (c1)
   range        :  Colors ;

CONSTRAINT:
   identifier   :  DifferentColors
   index domain :  (c1,c2)
   definition   :  if (c1 <> c2 and Connections(c1, c2) = 1) then
                       CountryColor(c1) <> CountryColor(c2)
                   endif  ;
</pre>

And the solution:

<pre>
   Solution:
     Belgium     blue
     Denmark     red
     France      yellow
     Germany     gree
     Netherlands red
     Luxembourg  red
</pre>


<h2>Minesweeper</h2>
Model: <a href="http://hakank.org/aimms/Minesweeper.aim">Minesweeper.aim</a>
<br><br>
As I have mentioned before, I'm always amazed how easy it is to
state this problem in a CP system (cudos to these high
level programming languages). Here is the problem specification
(from Gecode's Minesweeper model):
<pre>
A specification is a square matrix of characters. Alphanumeric 
characters represent the number of mines adjacent to that field. 
Dots represent fields with an unknown number of mines adjacent to 
it (or an actual mine).

E.g.
     ..2.3.
     2.....
     ..24.3
     1.34..
     .....3
     .3.3..
</pre>

The main constraint states that the number in "this" cell (if &gt; 0)
is the sum of the number of mines surrounding this cell.
The indices <code>i</code> and <code>j</code> are defined as sets <code>1..#rows</code>
and <code>1..#cols</code>, respectively. The four <code>if</code>s in the <code>Sum</code>
constraint restricts the value of <code>i+a</code> and <code>j+b</code> to be
inside the matrix.
<pre>
CONSTRAINT:
identifier   :  C1
index domain :  (i,j)
definition   :
   if (Problem(i,j) &gt; 0) then
       Sum[(a,b), x(i+a, j+b) |
           (i+a &gt; 0) and
           (j+b &gt; 0) and
           (i+a &lt;= R) and
           (j+b &lt;= C)] =
       Problem(i,j)
   endif;
</pre>

However, this constraint is not enough since it don't rule out
that a hint cell can contain a mine (or if a cell contains a hint, it
cannot contain a mine). So we must add either of these two constraints
<pre>
CONSTRAINT:
identifier   :  C2
index domain :  (i,j)
definition   :
   if (Problem(i,j) >= 0) then
       x(i,j) = 0
   endif
comment      :
   "If a cell contains a hint (>= 0) then there can be no mine.
    Either C2 or C3 must be active." ;

CONSTRAINT:
identifier   :  C3
index domain :  (i,j)
definition   :
   if (x(i,j) = 1) then
      Problem(i,j) = -1
   endif
comment      :
    "If this cell contains a mine, then there can be no hint
     (i.e. >= 0). Either C2 or C3 must be active." ;
</pre>
I tend to prefer constraint C2.
<br><br>
Here's the solution to the problem shown above, where a "1"
marks where the mines are.
<pre>
1 0 0 0 0 1
0 1 0 1 1 0
0 0 0 0 1 0
0 0 0 0 1 0
0 1 1 1 0 0
1 0 0 0 1 1
</pre>

(A more artistic modeler than me would show the result in a nicer way.)


<h2>Sudoku</h2>
Model: <a href="http://www.hakank.org/aimms/Sudoku2.aim">Sudoku2.aim</a>
<br><br>

Here is the way to fill the given hints:
<pre>
CONSTRAINT:
   identifier   :  FillData
   index domain :  (i,j)
   definition   :  if (Problem(i,j) > 0) then
                      x(i,j) = Problem(i,j)
                   endif  ;
</pre>

Note that this can also be written without the <code>if</code> clause, which more show the
advantage of AIMMS modeling principle:
<pre>
   index domain: (i,j) | Problem(i,j) > 0
   definition: x(i,j) = Problem(i,j)
</pre>

The Latin Square requirements are very easy to state, using two
<code>alldifferent</code> constraints:
<pre>
  index: i
  cp::alldifferent(i, x(i,j))
</pre>
and
<pre>
  index: j
  cp::alldifferent(i, x(i,j))
</pre>

However the block constraint is a little more tricky (as in all CP systems).
In AIMMS one has (as I understand it) to define a special parameter,
<code>Blocks</code> to be used in the constraint:
<pre>
PARAMETER:
   identifier   :  Blocks
   index domain :  (i,j)
   definition   :  1+N*Div(i-1,N)+Div(j-1,n) ;

CONSTRAINT:
   identifier   :  C3
   index domain :  k
   definition   :  cp::AllDifferent( (i,j) | Blocks(i,j) = k, x(i,j) ) ;
</pre>


The unique solution to the problem instance is
<pre>
7 9 5 1 4 6 8 2 3 
6 4 3 8 2 5 7 9 1 
2 1 8 3 9 7 4 6 5 
5 2 7 9 6 1 3 8 4 
8 6 4 7 5 3 2 1 9 
1 3 9 2 8 4 6 5 7 
4 5 1 6 7 2 9 3 8 
9 7 6 5 3 8 1 4 2 
3 8 2 4 1 9 5 7 6 
</pre>

To ensure that this is a unique solution, simply counts the number of solutions: any value larger than 1 means that the model is wrong in some way. Here's to do it:
<ul>
  <li> Increase the number of <code>Solution storage limit</code> in <code>Setting, Project Settings, Specific Solvers, CPoptimizer 12.4, General</code> to <code>2</code> (the default is 1).
  <li> Show the number of solutions with this code in <code>MainExecution</code>: <code>DialogMessage(GMP::Solution::Count('Sudoku2Plan') + " solutions");</code>
</ul>

When running the model, it shows "1 solutions" which indicates a unique solution.
  

<h2>AllDifferentExcept0</h2>
Model: <a href="http://www.hakank.org/aimms/AllDifferentExcept0.aim">AllDifferentExcept0.aim</a>
<br><br>
AIMMS has excellent support for reification and I'm (happily) surprised that it worked as I expected.
This is the constraint <code>CAllDifferentExcept0</code> which states that all values in <code>x</code>
that are not 0 (zero) must be distinct (hence the name of the global constraint <code>AllDifferentExcept0</code>).
<pre>
   if (i < j and x(i) <> 0 and x(j) <> 0) then
     x(i) <> x(j)
   endif;
</pre>

I also added an increasing constraint, <code>CIncreasing</code>:
<pre>
   if (ord(i) > 1) then
      x(i-1) <= x(i)
   endif;
</pre>

Though it might be more clear to write it as:
<pre>
    index domain :  i | ord(i) > 1
    definition   :  x(i-1) <= x(i)
</pre>

<h2> WhoKilledAgatha: reification and Element variables</h2>
Model:<a href="http://www.hakank.org/aimms/WhoKilledAgatha.aim">WhoKilledAgatha.aim</a>
<br><br>
This is a standard benchmark for theorem proving and I use it for testing how well a CP system
supports boolean decision variables and reifications. The way I usually model this problem yields 8 solutions, all indicating the same murder (guess who). 
<br><br>
 This AIMMS model also yields 8 solutions, and the tables for <code>Hates</code> and <code>Richer</code> are valid so I conclude that this model is correct (or rather: as correct as my
other versions of this problem).
<br>
Here is the problem:
<blockquote>
Someone in Dreadsbury Mansion killed Aunt Agatha. 
Agatha, the butler, and Charles live in Dreadsbury Mansion, and 
are the only ones to live there. A killer always hates, and is no 
richer than his victim. Charles hates noone that Agatha hates. Agatha 
hates everybody except the butler. The butler hates everyone not richer 
than Aunt Agatha. The butler hates everyone whom Agatha hates. 
Noone hates everyone. Who killed Agatha? 
</blockquote>

This was not as hard as I first thought it should be, though I had to experiment a little
with <code>Element Variables</code> to get it to work.
<br>
Some comments:
<ul>
<li> The two decision variables <code>Hates</code> and <code>Richer</code> are set to
  <code>Element Variables</code> to be able to handle <code>Element</code> constraints such as 
<pre>
  Hates(TheKiller, TheVictim) = 1
  Richer(TheKiller, TheVictim) = 0
</pre>
Note that <code>TheKiller</code> is a decision variable.
<br><br>
It's great that AIMMS support these kind of "matrix element constraint", even though
one have to declare the variable as a special type.
<br><br>
<li> I like that AIMMS has the same syntax for <code>if-then else</code> whether
or not decision variables or parameters are involved in the <code>if</code> clause. 
This makes creating constraints much easier.
<br><br>   
<li> When using other CP systems I will certainly miss 
AIMMS elegant ways of creating certain constraints.
</ul>

The way the constraints are stated in AIMMS is shown below, where we also show how
a matrix is defined. As usual the size and indices of the matrix (<code>Hates</code>) are are defined via the set (<code>ij</code>), defining the indices and their domains (<code>i</code> and <code>j</code>).
<pre>
PARAMETER:
       identifier   :  N
       definition   :  3 ;

SET:
       identifier   :  ij
       subset of    :  Integers
       indices      :  i, j
       definition   :  {1..N} ;

VARIABLE:
       identifier   :  Hates
       index domain :  (i,j)
       range        :  binary ;

CONSTRAINT:
       identifier   :  KillerHatesAVictim
       definition   :  hates(TheKiller, TheVictim) = 1 ;

CONSTRAINT:
       identifier   :  ButlerHaveEveryoneWhomAgataHates
       index domain :  i
       definition   :  if (Hates(Agatha, i) = 1) then
                         Hates(Butler, i) = 1
                       endif ;
</pre>

(Sometimes I don't like to have to name all constraints in the model, but right now when
writing about them it's is quite useful.)


<h2>DivisibleBy9Through1</h2>
Model: <a href="http://hakank.org/aimms/DivisibleBy9Through1.aim">DivisibleBy9Through1.aim</a>
<br><br>

This problem is mainly used to test a CP system regarding two things:
<ul>
   <li> the <code>modulo</code> constraint, which is quite essential for some recreational mathematics problems. AIMMS has support for this (otherwise I would have tried to implement it).
<li> how large integers can be handled<br>
AIMMS can manage up to base 10 (which is quite normal).
I have seen solutions of this problem for base 12 and
14 (found by the ECLiPSe CP system). Here are the solutions for <code>N</code> &lt;= 10
  (the AIMMS model just show one of the alternative solutions):
<pre>
2: [1]
4: [1, 2, 3] 
   [3, 2, 1]
6: [1, 4, 3, 2, 5] 
   [5, 4, 3, 2, 1]
8: [3, 2, 5, 4, 1, 6, 7]
   [5, 2, 3, 4, 7, 6, 1]
   [5, 6, 7, 4, 3, 2, 1]
10: [3, 8, 1, 6, 5, 4, 7, 2, 9]
</pre>
</ul>
  
Chris Kuip suggested the following addition to <code>MainExecution</code> procedure
which saves the variables for the first solution to a file:
<pre>
write AllVariables to file "DivisibleBy9Through1.wrt";
</pre>

<h2>FurnitureMoving: simple scheduling problem</h2>
File: <a href="http://www.hakank.org/aimms/FurnitureMoving.aim">FurnitureMoving.aim</a>
<br><br>
This is a simple scheduling problem from Kim Marriott &amp; Peter Stuckey:
"Programming with constraints", page  112f, where the object is to
optimize the tasks of moving some furnitures. In AIMMS the
<code>ParallelSchedule</code> constraint is used, which is much
like the traditional <code>cumulative</code> constraint:
<pre>
cp::ParallelSchedule(
       upperLimit,
       jobDomain,
       jobStart,
       jobDuration,
       jobEnd,
       jobHeight
    )
</pre>

Here are the specific values used in the model:
<pre>
   UpperLimit: 4           (resources, i.e. persons)
   UpperLimit2: 120        (minutes)
   jobDomain: j            (index for domain Jobs: {1..UpperLimit2})
   jobStart: Start         (minutes, variable)
   jobDuration: Duration   (minutes, may involve variables)
   jobEnd:  End            (minutes, variable)
   jobHeight: Resources    (persons, may involve variables)
</pre>
  
The only trouble I had here was how to define <code>jobDomain</code>, but
after reading the definition a couple of times it's quite clear that
<code>UpperLimit</code>, and <code>jobHeight</code> should have the same unit (i.e.
resources), while the other are time (in minutes); that is, for this specific model.
<br><br>
It seems that we can assume that the End job requirement is automatically ensured 
by the cp::ParallelSchedule constraint, e.g. this constraint:
<pre>
jobEnd(i) = jobStart(i) + jobDuration(i) 
</pre>
(In many other CP systems one have to ensure this explicitly.)
<br><br>
This is a optimization model where <code>MaxEndTime</code> is to be <b>minimized</b>, stated
in the <b>mathematical program</b> (here called <code>FurnitureMovingPlan</code>).
<br><br>
In some variants of <code>cumulative</code> (e.g. some of MiniZinc's solvers) 
I've seen that the total number of required resources can be a 
decision variable as well (and thus can be an objective variable), but this variant 
is not supported in AIMMS.
<br><br>
Later note: The AIMMS Blog's blog post <a href="http://blog.aimms.com/2012/11/scheduling-example-narrowing-time-window-for-smaller-jobs/">Scheduling example: Narrowing time window for smaller jobs</a> explains a little how to use scheduling with AIMMS+CP.

<h2>Langford number problem: indices</h2>
<a href="http://www.hakank.org/aimms/Langford.aim">Langford.aim</a><br><br>
Problem statement:
<blockquote>
Langford's number problem (CSP lib problem 24)<br>
Arrange 2 sets of positive integers 1..k to a sequence,
such that, following the first occurence of an integer i, 
each subsequent occurrence of i, appears i+1 indices later
than the last. <br>
For example, for k=4, a solution would be 41312432
</blockquote>
In this model I had some problems understanding how AIMMS' indices works,
which emphasize that they don't work exactly as the "array based" indices that
I'm used to from other CP systems.
<br><br>
In the constraints <code>pos1</code> and <code>pos3</code> shown below, it's important
to restrict the index <code>j</code> so it don't go "over the edge" of the <code>position</code>
array, which is interpreted by AIMMS as an error in the model, i.e. it throws an
UNSAT when this happens. [Or perhaps it's the solver CPLEX CP Optimizer that does
this interpretation.] Using the traditional "array based" for-loops this would have
been easier, at least for me using a traditional for-loop. So beware of this gotcha.
(Note: When writing this now much later, this behaviour actually makes much more sense
than when I did the model.)
<pre>
CONSTRAINT:
  identifier   :  pos1
  index domain :  <b>j |j <= k</b>
  definition   :  position(j) + j+1 = position(j+k)
  comment      :  "Note the index domain." ;

CONSTRAINT:
  identifier   :  pos2
  index domain :  (i)
  definition   :  solution(position(i)) = i ;

CONSTRAINT:
  identifier   :  pos3
  index domain :  <b>j |j <= k</b>
  definition   :  solution(position(k+j)) = j
  comment      :  "Note the index domain." ;
</pre>

A similar case is in the <a href="http://www.hakank.org/aimms/AllInterval.aim">AllInterval</a>
where one of the constraints is to restrict the index <code>i</code> to not be the last
value of the Set <code>i1</code> set (defined as the range <code>1..N</code>), so it
restricts <code>i</code> in the <code>DiffsK</code> constraint to not be <code>N</code>.
<pre>
SET:
  identifier   :  i1
  subset of    :  Integers
  index        :  i
  definition   :  {1..N} ;

...

CONSTRAINT:
 identifier   :  DiffsK
 index domain :  <b>i | i <> last( i1 )</b>
 definition   :  diffs(i) = Abs(x(i)-x(i+1))
 comment      :  "Note the special handling of the index domain for this constraint." ;
</pre>

These kind of behaviour (different to what I'm used to) have caused some long debugging
sessions. 
<br><br>
Fortunately Chris Kuip was kind enough to explain all this to me. And today
he also wrote the blog post <a href="http://blog.aimms.com/2012/11/what-is-the-element-after-the-last/">What is the element after the last?</a> explaining this in some detail.


<h2>Magic Square and Magic Square Water Retention problem</h2>
Model: <a href="http://www.hakank.org/aimms/MagicSquare.aim">MagicSquare.aim</a>
<br>
Model: <a href="http://www.hakank.org/aimms/MagicSquareWaterRetention.aim">MagicSquareWaterRetention.aim</a>
<br><br>
The plain <a href="http://www.hakank.org/aimms/MagicSquare.aim">MagicSquare</a> model is not so interesting, except perhaps that in the GUI one can select which symmetry breaking constraints to use. This is done via the four binary variables <code>UseSymmetry1</code> ... <code>UseSymmetry4</code>. 
<br><br>

<b>Magic Square Water Retention problem</b><br>
More interesting is <a href="http://www.hakank.org/aimms/MagicSquareWaterRetention.aim">MagicSquareWaterRetention.aim</a> which is one of few model where I have tested with different search heuristics and other settings (see below for a little more about these). The object is to create a magic square where the numbers represents heights and retains as much water as possible in the "cavaties" that is created. More info about this problem is in Wikipedia article <a href="http://en.wikipedia.org/wiki/Water_retention_on_mathematical_surfaces">Water retention on mathematical surfaces</a>. This AIMMS model also use the <a href="http://en.wikipedia.org/wiki/Fr%C3%A9nicle_standard_form">Frénicle standard form</a> for symmetry breaking.
<br><br>
It seems that the big win is to use <code>Search Type::Restart</code> instead of Automatic. Using this option solves the problem for <code>N=4</code> in about 3 seconds (with 168662 failures) compared to 20 seconds (663751 failures) when using <code>Search Type: Automatic</code>.
<br><br>
Trying with N=5, my small allotted 2Gb for the VirtualBox Windows 7 was probably not enough since
AIMMS unfortunately crashed. (Chris Kuip mentioned that this crasch is not reproducible
in the released version of AIMMS+CP.)
<br><br>
[My best shot of this problem has so far been with a MiniZinc model where Gecode/fz 
solves N=4 in 0.8 seconds (48619 failures) using the heuristics "most_constrained"/"indomain_random".]
<br><br>
In this model we see some of the benefits and drawbacks of the AIMMS approach (as I perceive them):
<ul>
  <li> benefit: It's quite easy and descriptive to state the
  water retention constraint (first part). There is no explicit for-loop, just using the
  defined indices and adjust for the border cases (1 and N).
  <pre>
   (i,j) | i > 1 and j > 1 and i < N and j < N
   water(i,j) = Max(x(i,j), Min(water(i-1,j), water(i,j-1),
                            water(i+1,j), water(i,j+1)))
   </pre>
   <li> drawback: When defining the ranges (domains) - which in this model
        are <code>1..N</code>, <code>1..N*N</code>, and <code>1..N*N*N</code>, it must be
        done with two extra help parameters (<code>N2</code>, N*N, and <code>N3</code>, N*N*N) since
        the <b>Range Wizard</b> for the variable cannot calculate formulas for the upper bound.
   <li> drawback: Defining the optimization problem the objective (<code>z</code>) must be declared as a <b>Free Range</b> variable (-inf .. inf) and not using the Range domain (<code>1..N3</code>). Intuitively this seems to be a too large domain for the solver to handle, but perhaps the solver is intelligent in calculating the bounds.
</ul>  


<h2>Some other comments</h2>
Here are some more asorted comments about AIMMS+CP and my way of using it.


<h3>Number of solutions</h3>
One of the drawback in AIMMS is that it's not easy to generate all
the solutions. It is possible but I have not done that. However,
it's easy to count the number of solutions using the following:
<ul>
  <li> Change <code>Settings, Project Options...</code> select <code>Specific solvers, CPoptimizer 12.4, General</code> and change <code>Solution storage limit</code> to a higher value, e.g. 1000.
  <li> Add this code to the MainExecution procedure: 
  <code>DialogMessage("It was " + GMP::Solution::Count('ProjectPlan') + " solution(s).");</code>
</ul>  


<h3>Data instances, data files</h3>
Many of models contain some data (as a parameter that might be changed when running the project).
There is in principle two approaches
for using data files in AIMMS:
 <ul>
   <li> enter the data via the <code>Parameter</code> definition and keep it there.
   <li> define a couple of data files and load the appropriate via <code>Data, Load Case,
        as active</code>
</ul>
I have used both principles in the models, though with the second approach one of the data
instances is loaded automatically via <code>Settings, Project, Startup &amp; authorization,
Startup case</code>.

<h3>Automatically saving .aim files</h3>
Since I often want to look in other models when implementing a new (mostly done with the .aim files),
I tend to set the projects to save the .aim file when closing the project:
<b>Settings, Autosave &amp; Backups, Project, Create an AIM file at Project Close.</b>
<br>There seems to be no way to set this option globaly, i.e. for all new projects created.

<h3>Heuristics</h3>
I like that there is a lot of different heuristics, though I have not
explored them as much. They are defined in <code>Settings, Project Option,
Specific solvers, CPoptimizer 12.4, Search</code>
<ul>
     <li> Variable selection:
       <ul>
       <li> Automatic
       <li> Random
       <li> Smallest domain size
       <li> Largest domain size
       <li> Smallest maximum domain value
       <li> Largest maximum domain value
       <li> Smallest minimum domain value
       <li> Largest minimum domain value
       <li> Smallest impact
       <li> Largest impact
       <li> Smallest impact last branch
       <li> Largest impact last branch
       <li> Smallest local impact
       <li> Largest local impact
       <li> Smallest success rate
       <li> Largest success rate
       </ul>
     <li> Value selection:
       <ul>
       <li> Automatic
       <li> Smallest impact
       <li Largest impact
       <li Smallest success rate
       <li> Largest success rate
       <li> Smallest value
       <li> Largest value
        </ul>
     </ul>

Note that these search heuristics are globally on the model. I have found no way
to select the specific variable(s) to branch on.


<h3>Procedures</h3>
One drawback in AIMMS is that there is no way (I know of) to implement a user-defined
"procedure" that is easy accessible in different models/projects. Instead one has to
copy the constraint verbatim. I have mostly copied the definitions from the saved .aim files.
There is also a way of viewing the textual representation in the current model (presented much
like the .aim files). This is done via <code>View, Text Representational, All</code> when in the Model Explorer.
<br><br>
Later note: Guido Diepen (Paragon) blogged about this a year ago <a href="http://blog.aimms.com/2011/11/exporting-a-section-and-importing-it-in-another-aimms-project/">Exporting a section and importing it in another AIMMS project</a>, though I didn't now that until very recently.

<h3>Some tips</h3>
Stop a calculation: Ctrl-Shift-S
<br><br>
Don't forget to set Set <code>ii</code> to a subset of integers.


<h2>Pros / Cons: A kind of summary</h2>
And finally, here is a subjective list of pros/cons about AIMMS (as I have understood it). 
<b>Pros</b>
<ul>
  <li>AIMMS has a very nice GUI to create and checking constraints and the related data.
    The online checking of constraints, indices, lengths etc is very handy.
  <li> Certain constructs are nice and powerful, e.g. that there is no syntactic
    difference between "if" on plain boolean variables/conditions and on
    decision variables.
  <li> Another nice thing is that some loops can be written quite naturally
without "for" just via the index (i,j etc).
  <li> Using a GUI makes it easy to connect different parts of the model, especially between
       data/variables and the output.
  </ul>

<b>Cons</b>
<ul>
  <li> For an "integer array based" constraint programmer like me it took some time
       to get used to the "items based" approach that is AIMMS' forte.
    Example: Some intuitions from "integer index based" modelling don't apply directly to
    AIMMS; e.g. see the dicussion about the Langford model above.
  <li> Also, the focus on defining indices and their connection with arrays
    was a little uncommon for me, and took some time from the rest of the modeling.
  <li> It's not very easy to generate and show all solutions to a problem.
    Though it's very easy to generate the <b>number</b> of solutions (see NQueens etc).
  <li> Using a GUI as the main modeling is a bit strange to me since I'm almost always
    use a texteditor (Emacs) and then run via command line (under Linux).
    There are ways to use textfiles directly but since this is Windows I'm not
    very confortable which that.
  <li> I used Windows 7 in VirtualBox under Ubuntu 12.04 and some things didn't work,
   for example copying backup files from my Linux box to the Windows' AIMMS' directory. This was - of course - not AIMMS' fault, but it made my experience sometimes a little frustrating... 
</ul>


<h2>My AIMMS+CP models</h2>
Here are some of my AIMMS+CP models, many originally written in the Summer 2011. Around mid-September 2012, I re-checked (and re-modelled) these with AIMMS version 3.13 (beta) and also added a few new. Thanks to Chris Kuip (Paragon) for comments, suggestions and improvements on many of these models.
<ul>
  <li> <a href="http://www.hakank.org/aimms/AllDifferentExcept0.aimmspack">AllDifferentExcept0.aimmspack</a>: Alldifferent except 0, <a href="http://www.hakank.org/aimms/AllDifferentExcept0.aim">AllDifferentExcept0.aim</a>
  <li> <a href="http://www.hakank.org/aimms/AllInterval.aimmspack">AllInterval.aimmspack</a>: All Interval, <a href="http://www.hakank.org/aimms/AllInterval.aim">AllInterval.aim</a>
  <li> <a href="http://www.hakank.org/aimms/BinPackingTest.aimmspack">BinPackingTest.aimmspack</a>: Binpacking test, <a href="http://www.hakank.org/aimms/BinPackingTest.aim">BinPackingTest.aim</a>
  <li> <a href="http://www.hakank.org/aimms/CoinsGridCP.aimmspack">CoinsGridCP.aimmspack</a> Coins grid, CP only version, <a href="http://www.hakank.org/aimms/CoinsGridCP.aim">CoinsGridCP.aim</a>
  li&gt; <a href="http://www.hakank.org/aimms/CoinsGridCPMIP.aimmspack">CoinsGridCPMIP.aimmspack</a> Coins grid, both CP and MIP version, <a href="http://www.hakank.org/aimms/CoinsGridCPMIP.aim">CoinsGridCPMIP.aim</a>
  <li> <a href="http://www.hakank.org/aimms/Diet.aimmspack">Diet.aimmspack</a>: Simple diet problem, <a href="http://www.hakank.org/aimms/Diet.aim">Diet.aim</a>
  <li> <a href="http://www.hakank.org/aimms/DivisibleBy9Through1Chris.aimmspack">DivisibleBy9Through1Chris.aimmspack</a>:  Divisible by 9 through 1, <a href="http://www.hakank.org/aimms/DivisibleBy9Through1.aim">DivisibleBy9Through1.aim</a>
  <li> <a href="http://www.hakank.org/aimms/FurnitureMoving.aimmspack">FurnitureMoving.aimmspack</a>:  Furniture moving, scheduling
  <li> <a href="http://www.hakank.org/aimms/Langford.aimmspack">Langford.aimmspack</a>: Langford, <a href="http://www.hakank.org/aimms/Langford.aim">Langford.aim</a>
  <li> <a href="http://www.hakank.org/aimms/LeastDiff.aimmspack">LeastDiff.aimmspack</a>: Least Diff, <a href="http://www.hakank.org/aimms/LeastDiff.aim">LeastDiff.aim</a>
  <li> <a href="http://www.hakank.org/aimms/MagicSequence.aimmspack">MagicSequence.aimmspack</a>: Magic sequence, <a href="http://www.hakank.org/aimms/MagicSequence.aim">MagicSequence.aim</a>
  <li> <a href="http://www.hakank.org/aimms/MagicSquare.aimmspack">MagicSquare.aimmspack</a>: Magic square, <a href="http://www.hakank.org/aimms/MagicSquare.aim">MagicSquare.aim</a>
  <li> <a href="http://www.hakank.org/aimms/MagicSquareWaterRetention.aimmspack">MagicSquareWaterRetention.aimmspack</a>: Magic square Water Retention (with Frénicle normal form for symmetry breaking), <a href="http://www.hakank.org/aimms/MagicSquareWaterRetention.aim">MagicSquareWaterRetention.aim</a>
  <li> <a href="http://www.hakank.org/aimms/Map.aimmspack">Map.aimmspack</a>: Map problem, <a href="http://www.hakank.org/aimms/Map.aim">Map.aim</a>
  <li> <a href="http://www.hakank.org/aimms/Map2.aimmspack">Map2.aimmspack</a>: Map problem, alternative version, <a href="http://www.hakank.org/aimms/Map2.aim">Map2.aim</a>
  <li> <a href="http://www.hakank.org/aimms/Marathon.aimmspack">Marathon.aimmspack</a>: Marathon logic problem, <a href="http://www.hakank.org/aimms/Marathon.aim">Marathon.aim</a>
  <li> <a href="http://www.hakank.org/aimms/Marathon2.aimmspack">Marathon2.aimmspack</a>: Marathon logic problem, different approach, <a href="http://www.hakank.org/aimms/Marathon2.aim">Marathon2.aim</a>
  <li> <a href="http://www.hakank.org/aimms/Marathon3.aimmspack">Marathon3.aimmspack</a>: Marathon logic problem, different approach suggested by Chris Kuip, <a href="http://www.hakank.org/aimms/Marathon3.aim">Marathon3.aim</a>
  <li> <a href="http://www.hakank.org/aimms/Minesweeper.aimmspack">Minesweeper.aimmspack</a>: Minesweeper (updated 20121004), <a href="http://www.hakank.org/aimms/Minesweeper.aim">Minesweeper.aim</a>
  <li> <a href="http://www.hakank.org/aimms/NQueens.aimmspack">NQueens.aimmspack</a>: N-queens problem, decomposition, slower, <a href="http://www.hakank.org/aimms/NQueens.aim">NQueens.aim</a>
  <li> <a href="http://www.hakank.org/aimms/NQueens2.aimmspack">NQueens2.aimmspack</a>: N-queens problem, 3 alldifferent approach, faster, <a href="http://www.hakank.org/aimms/NQueens2.aim">NQueens2.aim</a>
  <li> <a href="http://www.hakank.org/aimms/PlaceNumberPuzzle.aimmspack">PlaceNumberPuzzle.aimmspack</a>: Place number puzzle, <a href="http://www.hakank.org/aimms/PlaceNumberPuzzle.aim">PlaceNumberPuzzle.aim</a>
  <li> <a href="http://www.hakank.org/aimms/QuasigroupCompletion.aimmspack">QuasigroupCompletion.aimmspack</a>: Quasigroup completion, <a href="http://www.hakank.org/aimms/QuasigroupCompletion.aim">QuasigroupCompletion.aim</a>
  <li> <a href="http://www.hakank.org/aimms/SendMoreMoney.aimmspack">SendMoreMoney.aimmspack</a>: SEND+MORE=MONEY, <a href="http://www.hakank.org/aimms/SendMoreMoney.aim">SendMoreMoney.aim</a>
  <li> <a href="http://www.hakank.org/aimms/SendMoreMoney2.aimmspack">SendMoreMoney2.aimmspack</a>: SEND+MORE=MONEY, alternative version, <a href="http://www.hakank.org/aimms/SendMoreMoney2.aim">SendMoreMoney2.aim</a>
  <li> <a href="http://www.hakank.org/aimms/SendMostMoney.aimmspack">SendMostMoney.aimmspack</a>: SEND+MOST=MONEY and optimize MONEY, <a href="http://www.hakank.org/aimms/SendMostMoney.aim">SendMostMoney.aim</a>
  <li> <a href="http://www.hakank.org/aimms/SequenceTest.aimmspack">SequenceTest.aimmspack</a>: Sequence test, <a href="http://www.hakank.org/aimms/SequenceTest.aim">SequenceTest.aim</a>
  <li> <a href="http://www.hakank.org/aimms/Seseman.aimmspack">Seseman.aimmspack</a>: Seseman problem, <a href="http://www.hakank.org/aimms/Seseman.aim">Seseman.aim</a>
  <li> <a href="http://www.hakank.org/aimms/SetCovering.aimmspack">SetCovering.aimmspack</a>: Simple set covering problem (Winston), <a href="http://www.hakank.org/aimms/SetCovering.aim">SetCovering.aim</a>
  <li> <a href="http://www.hakank.org/aimms/Sudoku2.aimmspack">Sudoku2.aimmspack</a>: Sudoku, alternative version, <a href="http://www.hakank.org/aimms/Sudoku2.aim">Sudoku2.aim</a>
  <li> <a href="http://www.hakank.org/aimms/SurvoPuzzle.aimmspack">SurvoPuzzle.aimmspack</a>: Survo Puzzle, <a href="http://www.hakank.org/aimms/SurvoPuzzle.aim">SurvoPuzzle.aim</a>
  <li> <a href="http://www.hakank.org/aimms/TableTest.aimmspack">TableTest.aimmspack</a>: A simple version of Table constraint, using FORALL, <a href="http://www.hakank.org/aimms/TableTest.aim">TableTest.aim</a>
  <li> <a href="http://www.hakank.org/aimms/Tomography.aimmspack">Tomography.aimmspack</a>: Discrete Tomography, <a href="http://www.hakank.org/aimms/Tomography.aim">Tomography.aim</a>
  <li> <a href="http://www.hakank.org/aimms/WhoKilledAgatha.aimmspack">WhoKilledAgatha.aimmspack</a>: Who Killed Agatha logic problem, <a href="http://www.hakank.org/aimms/WhoKilledAgatha.aim">WhoKilledAgatha.aim</a>
  <li> <a href="http://www.hakank.org/aimms/Xkcd.aimmspack">Xkcd.aimmspack</a>: Xkcd "knapsack" problem, <a href="http://www.hakank.org/aimms/Xkcd.aim">Xkcd.aim</a>
  </ul>
]]>
        
    </content>
</entry>
<entry>
    <title>Beldiceanu and Simonis: A Model Seeker</title>
    <link rel="alternate" type="text/html" href="http://www.hakank.org/constraint_programming_blog/2012/10/beldiceanu_and_simonis_a_model_seeker.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.hakank.org/webblogg/mt-atom.cgi/weblog/blog_id=3/entry_id=1471" title="Beldiceanu and Simonis: A Model Seeker" />
    <id>tag:www.hakank.org,2012:/constraint_programming_blog//3.1471</id>
    
    <published>2012-10-20T07:11:33Z</published>
    <updated>2012-10-20T07:13:32Z</updated>
    
    <summary>Nicolas Beldiceanu and Helmut Simonis has written a very interesting paper about A Model Seeker, a system that finds the problem given a solution. Or more to the truth: suggests the appropriate global constraints given positive data instances (solution(s) to...</summary>
    <author>
        <name>hakank</name>
        <uri>http://www.hakank.org/webblogg</uri>
    </author>
            <category term="Constraint programming, general" />
    
    <content type="html" xml:lang="en" xml:base="http://www.hakank.org/constraint_programming_blog/">
        <![CDATA[Nicolas Beldiceanu and <a href="http://www.4c.ucc.ie/~hsimonis/">Helmut Simonis</a> has written a very interesting paper about A Model Seeker, a system that finds the problem given a solution. Or more to the truth: suggests the appropriate global constraints given positive data instances (solution(s) to a certain problem). It was presented at the technical track of <a href="http://www.cp2012.org/">CP2012</a> (18th International Conference on
Principles and Practice of Constraint Programming).
<br><br>
The system (A Model Seeker) is described in the paper: <a href="http://www.4c.ucc.ie/~hsimonis/modelseeker.pdf">A Model Seeker: Extracting Global Constraint Models From Positive Examples</a> (also: <a href="http://www.4c.ucc.ie/~hsimonis/modelseeker-beamer.pdf">Presentation</a> and <a href="http://www.4c.ucc.ie/~hsimonis/modelseeker-poster.pdf">Poster</a> from the CP2012 conference). 
<br><br>
From the Abstract:
<blockquote>
We describe a system which generates finite domain constraint models
from positive example solutions, for highly structured problems. The system is
based on the global constraint catalog, providing the library of constraints that
can be used in modeling, and the Constraint Seeker tool, which finds a ranked list
of matching constraints given one or more sample call patterns.
<br>
We have tested the modeler with 230 examples, ranging from 4 to 6,500 variables,
using between 1 and 7,000 samples. These examples come from a variety of
domains, including puzzles, sports-scheduling, packing & placement, and design
theory. When comparing against manually specified “canonical” models for the
examples, we achieve a hit rate of 50%, processing the complete benchmark set
in less than one hour on a laptop. Surprisingly, in many cases the system finds
usable candidate lists even when working with a single, positive example.
</blockquote>

A companion technical report presents the details of the 230 tested examples: <a href="http://4c.ucc.ie/~hsimonis/modelling/report.pdf">A Model Seeker Description and Detailed Results</a> (over 1400 pages).
<br><br>
This is a system I really would like to test...
]]>
        
    </content>
</entry>
<entry>
    <title>CP2013 (Constraint Programming Conference)  will be held in Uppsala,  16 - 20 September 2013</title>
    <link rel="alternate" type="text/html" href="http://www.hakank.org/constraint_programming_blog/2012/10/cp2013_constraint_programming_conference_will_be_in_uppsala_16_20_sept.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.hakank.org/webblogg/mt-atom.cgi/weblog/blog_id=3/entry_id=1470" title="CP2013 (Constraint Programming Conference)  will be held in Uppsala,  16 - 20 September 2013" />
    <id>tag:www.hakank.org,2012:/constraint_programming_blog//3.1470</id>
    
    <published>2012-10-16T18:55:44Z</published>
    <updated>2012-10-16T18:56:31Z</updated>
    
    <summary>Just a short note about the next Constraint Programming Conference (CP2013). It will be in Uppsala, Sweden. From SweConsNet: CP&apos;13, the 19th International Conference on the Principles and Practice of Constraint Programming, will be held at Uppsala University on 16...</summary>
    <author>
        <name>hakank</name>
        <uri>http://www.hakank.org/webblogg</uri>
    </author>
            <category term="Constraint programming, general" />
    
    <content type="html" xml:lang="en" xml:base="http://www.hakank.org/constraint_programming_blog/">
        <![CDATA[Just a short note about the next Constraint Programming Conference (CP2013). It will be in Uppsala, Sweden.
From <a href="http://www.it.uu.se/research/SweConsNet/events?lang=en">SweConsNet</a>:
<blockquote>
CP'13, the 19th International Conference on the Principles and Practice of Constraint Programming, will be held at Uppsala University on 16 - 20 September 2013.
</blockquote>
More details will come.
<br><br>
I'm quite excited about this since it's in my home country which makes everything easier.  At last I will have a chance to meet all the nice, smart and interesting people that I have read and read about (and in some case had mail conversation with).
<br><br>
See a list of the former CP conferences: <a href="https://cs.uwaterloo.ca/~vanbeek/cp/">International Conference on Principles and Practice of Constraint Programming</a>.  The last one finished some days ago: <a href="http://www.cp2012.org/">CP2012</a>.
]]>
        
    </content>
</entry>
<entry>
    <title>Results MiniZinc Challenge 2012</title>
    <link rel="alternate" type="text/html" href="http://www.hakank.org/constraint_programming_blog/2012/10/results_minizinc_challenge_2012.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.hakank.org/webblogg/mt-atom.cgi/weblog/blog_id=3/entry_id=1469" title="Results MiniZinc Challenge 2012" />
    <id>tag:www.hakank.org,2012:/constraint_programming_blog//3.1469</id>
    
    <published>2012-10-14T19:40:45Z</published>
    <updated>2012-10-14T19:40:47Z</updated>
    
    <summary>The result from MiniZinc Challenge 2012 was presented this Friday (the last day of CP2012, 18th International Conference on Principles and Practice of Constraint Programming ). The official contestants (solvers) this year was: BProlog (description) Choco (description) Fzn2smt (description). Translates...</summary>
    <author>
        <name>hakank</name>
        <uri>http://www.hakank.org/webblogg</uri>
    </author>
            <category term="Competitions" />
            <category term="MiniZinc/Zinc" />
    
    <content type="html" xml:lang="en" xml:base="http://www.hakank.org/constraint_programming_blog/">
        <![CDATA[The <a href="http://www.g12.cs.mu.oz.au/minizinc/challenge2012/results2012.html">result</a> from
<a href="http://www.g12.cs.mu.oz.au/minizinc/challenge2012/challenge.html">MiniZinc Challenge 2012</a>
was presented this Friday (the last day of <a href="http://www.cp2012.org/">CP2012</a>,
18th International Conference on Principles and Practice of Constraint Programming ).
<br><br>
The official contestants (solvers) this year was:
<ul>
<li> <a href="http://probp.com">BProlog </a> (<a href="http://www.g12.cs.mu.oz.au/minizinc/challenge2012/description_bprolog.txt">description</a>)
<li> <a href="http://choco.emn.fr">Choco</a> (<a href="http://www.g12.cs.mu.oz.au/minizinc/challenge2012/description_choco.txt">description</a>)
<li> <a href="http://ima.udg.edu/Recerca/GrupESLIP.html">Fzn2smt</a> (<a href="http://www.g12.cs.mu.oz.au/minizinc/challenge2012/description_fzn2smt.txt">description</a>). Translates to SMT, uses <a href="http://yices.csl.sri.com/">Yices</a>.
<li> <a href="http://www.gecode.org">Gecode</a> (<a href="http://www.g12.cs.mu.oz.au/minizinc/challenge2012/description_gecode.txt">description</a>)
<li> <a href="http://products.ndis.jp/iz/download.html">izplus</a> (<a href="http://www.g12.cs.mu.oz.au/minizinc/challenge2012/description_izplus.txt">description</a>) (note: the site is in Japanese)
<li> <a href="http://jacop.osolpro.com">JaCoP</a> (<a href="http://www.g12.cs.mu.oz.au/minizinc/challenge2012/description_jacop.txt">description</a>)
<li> Mistral 2.0 (<a href="http://www.g12.cs.mu.oz.au/minizinc/challenge2012/description_mistral.txt">description</a>)
<li> <a href="http://code.google.com/p/or-tools">OR-Tools</a> (<a href="http://www.g12.cs.mu.oz.au/minizinc/challenge2012/description_or_tools.txt">description</a>)
</ul>

Of these solvers, the only one I haven't tested (yet) is izplus.

<h2>Official results</h2>
The official results are:
<ul>
    <li> <b>Fixed search</b>:
    <ul>
        <li> Gold medal: Gecode
        <li> Silver medal: Jacop
        <li> Bronze medal: OR-Tools 
    </ul>
    <li> <b>Free search</b>:
    <ul>
        <li> Gold medal: Gecode
        <li> Silver medal: Fzn2smt
        <li> Bronze medal: izplus 
    </ul>
    <li> <b>Parallel search</b>:
    <ul>
        <li> Gold medal: Gecode
        <li> Silver medal: Fzn2smt
        <li> Bronze medal: izplus
    </ul>
</ul>

Congratutations to all!

<br><br>
<h2>Result including all solvers</h2>
It can be interesting to see the results for all solvers in the Challenge, including the G12's
internal solvers such as Chuffed and CPX (which "are not eligible for prizes, but do modify the
scoring results").  For a short description of these non-eligible solvers, see the short description
at the result page.
<br><br>
I took the results from the "Selection" section of the <a href="http://www.g12.cs.mu.oz.au/minizinc/challenge2012/results2012.html">result page</a> and for each categories selected "Select all problems", "Compute results" and then sorted on the points (most is best). The result is quite interesting since it shows that Chuffed and G12 CPX got most points in all the three categories, and G12 Lazy FD also got good places.
<br><br>
Note: The mixing in the categories is explained by the management: <i>entries in the FD search category were automatically included in the free search category, while entries in the free search category (including promoted FD entries) were automatically included in the parallel search category</i>.

The official winners (gold, silver, bronze) has been embolded.
<ul>
  <li> <b>Fixed search</b> ("FD category solvers")<br>
  <table>
<tr><td>chuffed-fd</td><td>1136</td></tr>
<tr><td>g12_cpx-fd</td><td>1060</td></tr>
<tr><td><b>gecode-fd</b></td><td><b>881</b></td></tr>
<tr><td>g12_lazyfd-fd</td><td>783</td></tr>
<tr><td><b>jacop-fd</b></td><td><b>548</b></td></tr>
<tr><td>g12_fd-fd</td><td>525</td></tr>
<tr><td><b>or_tools-fd</b></td><td><b>488</b></td></tr>
<tr><td>choco-fd</td><td>430</td></tr>
<tr><td>bprolog-fd</td><td>265</td></tr>
   </table>
   <br>
  <li> <b>Free category</b> ("Free category solvers")<br>
  <table>
<tr><td>chuffed-free</td><td>2359</td></tr>
<tr><td>g12_cpx-free</td><td>1915</td></tr>
<tr><td>g12_lazyfd-free</td><td>1782</td></tr>
<tr><td><b>gecode-free</b></td><td><b>1620</b></td></tr>
<tr><td><b>fzn2smt-free</b></td><td><b>1522</b></td></tr>
<tr><td>gurobi-free</td><td>1481</td></tr>
<tr><td><b>izplus-free</b></td><td><b>1413</b></td></tr>
<tr><td>cplex-free</td><td>1367</td></tr>
<tr><td>jacop-free</td><td>1326</td></tr>
<tr><td>bprolog-free</td><td>1203</td></tr>
<tr><td>mistral-free</td><td>1199</td></tr>
<tr><td>g12_fd-free</td><td>998</td></tr>
<tr><td>choco-free</td><td>805</td></tr>
<tr><td>or_tools-free</td><td>692</td></tr>
<tr><td>minisatid-free</td><td>648</td></tr>
<tr><td>cbc-free</td><td>222</td></tr>
   </table>
   <br>
  <li> <b>Par category</b> ("Par category solvers")<br>
  <table>
<tr><td>chuffed-free</td><td>2341</td></tr>
<tr><td>g12_cpx-free</td><td>1897</td></tr>
<tr><td><b>gecode-par</b></td><td><b>1846</b></td></tr>
<tr><td>g12_lazyfd-free</td><td>1758</td></tr>
<tr><td><b>fzn2smt-free</b></td><td><b>1504</b></td></tr>
<tr><td>gurobi-par</td><td>1499</td></tr>
<tr><td><b>izplus-free</b></td><td><b>1380</b></td></tr>
<tr><td>cplex-par</td><td>1351</td></tr>
<tr><td>jacop-free</td><td>1293</td></tr>
<tr><td>bprolog-free</td><td>1178</td></tr>
<tr><td>mistral-free</td><td>1173</td></tr>
<tr><td>g12_fd-free</td><td>974</td></tr>
<tr><td>or_tools-par</td><td>810</td></tr>
<tr><td>choco-free</td><td>789</td></tr>
<tr><td>minisatid-free</td><td>627</td></tr>
<tr><td>cbc-free</td><td>222</td></tr>
   </table>
   <br>
</ul>

Note that all the problem instances are available for download from the Result page (<a href="http://www.g12.cs.mu.oz.au/minizinc/challenge2012/mznc12-problems.tar.gz">mznc12-problems.tar.gz</a>).
<br><br>
Also see: <a href="http://www.g12.cs.mu.oz.au/minizinc/challenge.html">MiniZinc Challenge Medals 2008-2012</a>
]]>
        
    </content>
</entry>

</feed> 

