====== Logic and Constraint Programming ======
----
===== News =====
* **20/5/2021**: Second partial exam ({{ :didattica:magistrale:lcp:ay_2021:20210520_partial.zip |partial}}) ({{ :didattica:magistrale:lcp:ay_2021:20210520_full.zip |full}})
* 22/4/2021: First partial exam. ({{ :didattica:magistrale:lcp:ay_2021:results_first_partial_v2.pdf |results v.2}}) ({{ :didattica:magistrale:lcp:ay_2021:results_first_solutions.zip |solutions}})
* 08/4/2021: the lecture of April 8 is postponed.
* 02/3/2021: first lecture (both in classroom and via Webex: https://unicam.webex.com/meet/francesco.tiezzi)
* **Telegram channel: LCP2021@UNICAM**
----
===== General Info =====
**Teacher**:
* [[https://docenti.unicam.it/pdett.aspx?ids=N&tv=d&UteId=990&ru=PA|Francesco Tiezzi]]
**ESSE3 Link**
* [[https://didattica.unicam.it/Guide/PaginaADErogata.do?cod_lingua=ita&ad_er_id=2019*N0*N0*S2*15669*9986&ANNO_ACCADEMICO=2019&mostra_percorsi=S|Logic and Constraint Programming]]
**Lessons schedule**:
* Tue 16:00-18:00, AB1
* Wed 09:00-11:00, AB1
**Students Office hours**:
* On appointment (via email), second floor of Polo Lodovici, via Madonna delle Carceri 9, Camerino
----
===== Course Objectives =====
D1 – KNOWLEDGE AND UNDERSTANDING
At the end of the course, the student should be able to:
1- Have the knowledge of the issues concerning logic and constraint programming.
2- Have the knowledge of the syntax and the semantics of the Prolog language.
3- Have the knowledge of the syntax and the semantics of the input languages of Drools.
4- Have the knowledge of the syntax and the semantics of the input languages of Minizinc.
D2 – APPLYING KNOWLEDGE AND UNDERSTANDING
At the end of the course, the student should be able to:
1- Writing logic programs in Prolog.
2- Writing rule-based programs in Drools.
3- Writing constraint-based programs in Minizinc.
4- Understand technical manuals on the languages and tools presented in the course and similar ones.
D3 – MAKING JUDGEMENTS
At the end of the course, the student should be able to:
1- Identify the best language suitable for describing the logic of an intelligent system.
D4 - COMMUNICATION SKILLS
At the end of the course, the student should be able to:
1- Describe in a clear way the behaviour of a logic- and constraint-based program.
2- Write a brief survey and state of the art about a given research topic related to constraint and logic programming by searching the scientific literature.
D5 – LEARNING SKILLS
At the end of the course, the student should be able to:
1- Search the scientific literature for specific advances in languages and tools for logic and constraint programming.
2- Autonomously understand and learn to use new features added to tools for logic and constraint programming.
----
===== Course Contents =====
* Constraint programming: Minizinc
* Rule-based programming: Drools
* Logic programming: Prolog
----
===== Study material =====
**Course Slides**
* {{ :didattica:magistrale:lcp:ay_2021:lcp_intro2021.pdf |General Info and Introduction}}
* {{ :didattica:magistrale:lcp:ay_2021:minizinc.pdf |Minizinc}}
* {{ :didattica:magistrale:lcp:ay_2021:drools2021.pdf |Drools}}
* {{ :didattica:magistrale:lcp:ay_2021:lpnchapter1.pdf |LPN Chapter 1}}
* {{ :didattica:magistrale:lcp:ay_2021:lpnchapter2.pdf |LPN Chapter 2}}
* {{ :didattica:magistrale:lcp:ay_2021:lpnchapter3.pdf |LPN Chapter 3}}
* {{ :didattica:magistrale:lcp:ay_2021:lpnchapter4.pdf |LPN Chapter 4}}
* {{ :didattica:magistrale:lcp:ay_2021:lpnchapter5.pdf |LPN Chapter 5}}
* {{ :didattica:magistrale:lcp:ay_2021:lpnchapter6.pdf |LPN Chapter 6}}
* {{ :didattica:magistrale:lcp:ay_2021:lpnchapter10.pdf |LPN Chapter 10}}
**Lectures**
* 03/03/2021: general info, Minizinc ([[https://unicam.webex.com/unicam/ldr.php?RCID=6dd97fc331ea43caad0c783aa3e919c9|recorded lecture]])
* 04/03/2021: Minizinc ([[https://unicam.webex.com/unicam/ldr.php?RCID=44866ccd0e8e47ba858db5e4574c07bc|recorded lecture]])
* 10/03/2021: Minizinc, Drools ([[https://unicam.webex.com/unicam/ldr.php?RCID=1431f1aeea2749018e6d33f615938a17|recorded lecture]])
* 11/03/2021: Drools tutorial ([[https://unicam.webex.com/unicam/ldr.php?RCID=5db48b2e87bf42e38f5fb5b1effbba85|recorded lecture]])
* 17/03/2021: SWI Prolog, Declarative Programming, History of Prolog, examples ([[https://unicam.webex.com/unicam/ldr.php?RCID=bef824b0c9b647d29f7549b1ab8c42f9|recorded lecture]])
* 18/03/2021: Examples, Prolog syntax ([[https://unicam.webex.com/unicam/ldr.php?RCID=a97a4c7aae5b421eb587c9fb962a6294|recorded lecture]])
* 24/03/2021: exercises, unification ([[https://unicam.webex.com/unicam/ldr.php?RCID=c746cdb6ab0b459c8320ae04bb3b3356|recorded lecture]])
* 25/03/2021: proof search, proof search examples ([[https://unicam.webex.com/unicam/ldr.php?RCID=2aacfbf141d14016855ce3b779375515|recorded lecture]])
* 31/04/2021: exercises, recursion ([[https://unicam.webex.com/unicam/ldr.php?RCID=8f4ace4b4b6a46b798478258fa9f6c3a|recorded lecture]])
* 01/04/2021: recursion, exercises on recursion ([[https://unicam.webex.com/unicam/ldr.php?RCID=21518f42f5c64c5587c7814d0d2458ea|recorded lecture]])
* 07/04/2021: exercises, lists ([[https://unicam.webex.com/unicam/ldr.php?RCID=ca38a3a8e3e94aed803c18ed4cc021d0|recorded lecture]])
* 14/04/2021: exercises, arithmetics ([[https://unicam.webex.com/unicam/ldr.php?RCID=ae99270b428a4b3d9d266b2909b7fbef|recorded lecture]])
* 15/04/2021: exercises, accumulators ([[https://unicam.webex.com/unicam/ldr.php?RCID=6aba1bf5389e4218a1f4ddd9e82437b0|recorded lecture]])
* 21/04/2021: exercises, arithmetics, append ([[https://unicam.webex.com/unicam/ldr.php?RCID=d23df04d5ed04da182b72849892acfb5|recorded lecture]])
* 22/04/2021: first partial exam ({{ :didattica:magistrale:lcp:ay_2021:20210422_lcp_first_partial.zip |exam files}})
* 28/04/2021: discussion solutions of the first partial exam ([[https://unicam.webex.com/unicam/ldr.php?RCID=25ecb6802dd840059cf41b92e85949dd|recorded lecture]])
* 29/04/2021: append e reverse ([[https://unicam.webex.com/unicam/ldr.php?RCID=21392417b92244679b791f891e3852e4|recorded lecture]])
* 05/05/2021: cut ([[https://unicam.webex.com/unicam/ldr.php?RCID=6c04e8a3de644821a3508ab8cf0d1fc0|recorded lecture]])
* 06/05/2021: negation, exercises ([[https://unicam.webex.com/unicam/ldr.php?RCID=dcc422b934324acaafb9300c70cdb391|recorded lecture]])
* 20/05/2021: second partial and full exam
* 26/05/2021: project presentations
**Practical sessions**
* 11/03/2021: [[https://github.com/AlessandroMarcellettiUnicam1/Drools_lecture|Files for the Drools tutorial by Alessandro Marcelletti]]
* 24/03/2021: {{ :didattica:magistrale:lcp:ay_2021:20210324practical_session1.zip |exercises}} {{ :didattica:magistrale:lcp:ay_2021:20210324practical_session1_solutions.zip |solutions}}
* 31/03/2021: {{ :didattica:magistrale:lcp:ay_2021:ex2.4.zip |exercise}} {{ :didattica:magistrale:lcp:ay_2021:ex2.4_solution.pl.zip |solution}}
* 01/04/2021: {{ :didattica:magistrale:lcp:ay_2021:lcp2021_ex3.zip |exercises}} {{ :didattica:magistrale:lcp:ay_2021:ch3_solutions.zip |solutions}}
* 14/04/2021: {{ :didattica:magistrale:lcp:ay_2021:exercise_ch4_lcp2021.zip |exercises}} {{ :didattica:magistrale:lcp:ay_2021:solutions_ch4.zip |solutions}}
* 15/04/2021: {{ :didattica:magistrale:lcp:ay_2021:exercises_ch5_lcp2021.zip |exercises}} {{ :didattica:magistrale:lcp:ay_2021:exercises_ch5_solutions_lcp2021.zip |solutions}}
* 06/05/2021: {{ :didattica:magistrale:lcp:ay_2021:ex_ch6_10.zip |exercises}} {{ :didattica:magistrale:lcp:ay_2021:ch6_ch10_solutions.zip |solutions}}
**Reference books**
The main material of the course consists of:
* Stuart J. Russell and Peter Norvig. Artificial Intelligence A Modern Approach. Third Edition. Pearon, 2016.
* Patrick Blackburn, Johan Bos, Kristina Striegnitz. Learn Prolog Now! 2001
* Tutorial of Drools, Minizinc.
* Course's slides.
Moreover, lecture notes, papers and slides may be given by the teacher for studying and for exercises.
----
===== Exams =====
**Exam rules**:
The exam is divided in two parts:
* **Programming test**:
* on the exam date a programming test takes place, using the languages and tools introduced in the course
* during the course in itinere tests take place; in case they are evaluated positively, they replace the programming test of the exam date
* Realisation of a **project** using one or more languages and software tools with a **presentation**