In the tutorial we will be modeling constraint problems in the logic-based multi-paradigm language Picat (

Pattern-matching,Intuitive,Constraints,Actors,Tabling).

There will be 12 homework assignments each of which is worth 1 point. In order to get the credit, you must gain at least 8 points, out of which at least 4 points must be from the second half of the semester (assignments 7-). Expect increasing complexity of the assignments as the semester progresses. There will be an additional option to get at most 4 points after the end of classes for solving somewhat harder problems.

The solutions to the homework assignments must be 100% your own work. Do not discuss them with anyone but me, do not search for solutions on the internet, and do not share your code.

Homework assignments will be posted in ReCodEx. The deadlines will be set to the beginning of the next tutorial, unless stated otherwise. Materials from the tutorial are posted below as PDFs. The source codes and live notebooks are available on GitHub.

- Install Picat and try it out. (See Getting started with Picat.)
- Join our ReCodEx group.
- Solve the (ungraded) “Hello, world!” assignment.
- Let me know if you encounter any issues!

**Program:**Overview of Picat.**Notebook:**tutorial1.pdf**Homework:**Leaves (deadline extended by one week, until 2pm on Oct 16)

**Program:**Intro to CP.**Notebook:**tutorial2.pdf**Homework:**Crypt-arithmetic

**Program:**Improving models, symmetry breaking, solvers.**Notebook:**tutorial3.pdf**Homework:**Boardomino

**Program:**Search space, search strategies.**Notebook:**tutorial4.pdf**Homework:**Knapsack

**Program:**Dual modeling, channeling. Assignment.**Notebook:**tutorial5.pdf**Homework:**Stable marriage

**Program:**Modeling functions. Scheduling, the cummulative constraint**Notebook:**tutorial6.pdf**Homework:**Moving

**Program:**Rostering**Notebook:**tutorial7.pdf**Homework:**Feast

**Program:**Routing**Notebook:**tutorial8.pdf**Homework:**Routing

**Program:**Implicit constraints**Notebook:**tutorial9.pdf**Homework:**Life

**Program:**Modeling with sets**Notebook:**tutorial10.pdf**Homework:**Golfers

**Program:**Tabling**Notebook:**tutorial11.pdf**Homework:**Triangle

**Program:**Planning**Notebook:**tutorial12.pdf**Homework:**Farmer

**Program:**Homework help**Additional homework problems:**Packing, MCSP, Digest, Hanoi (due end of March)

- Picat homepage
- Getting started with Picat
- Constraint solving and planning with Picat
- Modeling and Solving AI Problems in Picat (tutorial by R. Barták and N. Zhou)
- CSPLib: A problem library for constraints
- Håkan Kjellerstrand’s Picat page
- The lecture by R. Barták
- Previous tutorial by R. Barták in SICStus Prolog
- Previous tutorial by me in MiniZinc

*What should I do if I have a question?*— Check the FAQ. If you don’t see the answer here email me putting “nopt042” in the subject.*What if I want a consultation?*— Talk to me after class, come to the scheduled office hours, or email me to arrange an appointment.