B5727 - INTRODUCTION TO LANGUAGES FOR ARTIFICIAL INTELLIGENCE

Anno Accademico 2025/2026

  • Docente: Maurizio Gabbrielli
  • Crediti formativi: 6
  • SSD: ING-INF/05
  • Lingua di insegnamento: Inglese
  • Moduli: Michael Lodi (Modulo 1) Maurizio Gabbrielli (Modulo 2)
  • Modalità didattica: Convenzionale - Lezioni in presenza (Modulo 1) Convenzionale - Lezioni in presenza (Modulo 2)
  • Campus: Bologna
  • Corso: Laurea Magistrale in Artificial intelligence (cod. 6700)

Conoscenze e abilità da conseguire

At the end of the course, the student has an understanding of the main linguistic techniques used in the context of AI, including the main aspects related to functional, logic and constraint programming.

Contenuti

Module 1

Abstract machines. Python machine. Programming in Python: names and visibility, functions, immutable and mutable objects, basic data types (numbers, strings, tuples, lists, dictionaries), and their use in the solution of problems. Classes and objects. Methods and inheritance. Exceptions. Introduction to the library NumPy and its N-dimensional array objects.

Module 2

Introduction to mathematical logic. Unification. Resolution.
Introduction to logic programming. Prolog languages.
Constraint logic programming and concurrent constraint programming. Constraint programming. The language MiniZinc.

Testi/Bibliografia

Module 1

No textbook is mandatory: all the material (slides, source code, exercises, past exam examples) will be made available after each lecture on Virtuale.

Suggested introductory level textbook:

John V. Guttag. Introduction to Computation and Programming Using Python. Third Edition: With Application to Computational Modeling and Understanding Data. MIT Press, 2021. https://mitpress.mit.edu/books/introduction-computation-and-programming-using-python-third-edition

Other, very elementary-level, textbooks

Allen B. Downey. Think Python 2e. O'Reilly Media, 2012. ISBN 978-1449330729. Online manuscript: https://greenteapress.com/wp/think-python-2e/

Jessen Havill. Discovering Computer Science: Interdisciplinary Problems, Principles, and Python Programming. Chapman and Hall/CRC. ISBN 9781482254143

Reference books

Mark Lutz. Learning Python 5e. O'Reilly Media, 2013 [For Python, not for learning programming from scratch]

M. Gabbrielli, S. Martini. Programming Languages: Principles and Paradigms (2nd ed). Springer, 2023. [To learn how programming languages work.]

 

Module 2

Dirk van Dalen. Logic and structure. 4th edition, Springer.

K. Doets. From Logic to Logic Programming. The Mit Press.

Russell, Norvig. Artificial Intelligence: A Modern Approach (any edition). Pearson.

Metodi didattici

Theoretical and practical class lectures.

Regarding the teaching methods of this course unit, all students are required to attend Modules 1 and 2 on Health and Safety online. [https://elearning-sicurezza.unibo.it/]

Module 1

Formal in-class lectures with live coding examples.

Lectures (24 hours) will be concentrated at the beginning of the semester (From the third week of September to before the end of October).

Autonomous work on guided programming exercises (outside the scheduled class times), on Virtuale. The platform provides automatic feedback on test cases.

Module 2

Class lectures and exercises

Modalità di verifica e valutazione dell'apprendimento


As this course (Introduction to Languages for Artificial Intelligence) is part of the Integrated Course “Languages and Algorithms for Artificial Intelligence”, to get a grade in the gradebook, students have to

  • Pass Module 1 (binary outcome: pass/fail) with Prof. Lodi

  • Pass Module 2 (mark expressed in thirties, you need to obtain at least 18) with Prof. Gabbrielli

  • Pass the course “Introduction to Computability and Complexity” with Prof. Dal Lago (mark expressed in thirties, you need to obtain at least 18)

The three exams can be taken in any order, and positive marks are valid for an indefinite period.

The final grade is obtained as the arithmetic mean of the grades in Module 2 and the Course "Introduction to Computability and Complexity", rounded to the nearest natural number.

For each module, you will have four calls (i.e., four attempts) each academic year.

Module 1 will be assessed through a 2-hour Python programming test, with automatic correction on test cases, on the EOL platform. The test will evaluate students' ability to correctly solve simple procedural programming problems using Python (and the NumPy library).

The system will assign a score to each test case for each exercise. Reaching a score of 18/30 or higher will result in a “pass”, while a score below 18/30 will result in a “fail” (the numerical score is not recorded).

The test will be held in the University laboratories, and students will have access to an IDE and to the documentation of Python and NumPy. No other websites or any documentation can be accessed (closed books).

A preliminary test could be offered at the end of October / early November. Other calls will be in Winter, Summer, and Autumn.

Following the lectures is crucial to understanding the theoretical concepts. For those who are unable to attend, recordings will be made available. Several exercises that do not contribute to the grade are provided for personal training. Doing the exercises assigned each week on Virtuale is crucial for learning the required programming skills. The automatic evaluation on test cases is a first relevant help. Tutors and the main instructor are also available for clarification.

 

Module 2

Module 2 will be evaluated by menas of a written exam consisting of 6 exercises on the different part of the course, to be done in 2 hours.It is important to attend the lectures in order to practice with the exam exercises.


Strumenti a supporto della didattica

Lectures. Practical exercises.

For Module 1, slides and source code will be provided. Exercises with automatic correction on test cases will be available weekly on Virtuale (through CodeRunner, a Moodle plugin). Past exams (with automatic correction) will be available for personal training.

Fore Module 2 there will be exercises done in the class.


Orario di ricevimento

Consulta il sito web di Maurizio Gabbrielli

Consulta il sito web di Michael Lodi