Go to:
Esta página em português Ajuda Autenticar-se
Formação regular da Biblioteca |fevereiro a maio
You are here: Start > EIC0026

Site map
Edifício A (Administração) Edifício B (Aulas) - Bloco I Edifício B (Aulas) - Bloco II Edifício B (Aulas) - Bloco III Edifício B (Aulas) - Bloco IV Edifício C (Biblioteca) Edifício D (CICA) Edifício E (Química) Edifício F (Minas e Metalurgia) Edifício F (Minas e Metalurgia) Edifício G (Civil) Edifício H (Civil) Edifício I (Electrotecnia) Edifício J (Electrotecnia) Edifício K (Pavilhão FCNAUP) Edifício L (Mecânica) Edifício M (Mecânica) Edifício N (Garagem) Edifício O (Cafetaria) Edifício P (Cantina) Edifício Q (Central de Gases) Edifício R (Laboratório de Engenharia do Ambiente) Edifício S (INESC) Edifício T (Torre do INEGI) Edifício U (Nave do INEGI) Edifício X (Associação de Estudantes)

Logic Programming

Code: EIC0026     Acronym: PLOG

Classification Keyword
OFICIAL Programming

Instance: 2014/2015 - 1S Ícone do Moodle

Active? Yes
Responsible unit: Department of Informatics Engineering
Course/CS Responsible: Master in Informatics and Computing Engineering

Cycles of Study/Courses

Acronym No. of Students Study Plan Curricular Years Credits UCN Credits ECTS Contact hours Total Time
MIEIC 155 Syllabus since 2009/2010 3 - 5 56 135

Teaching language

Suitable for English-speaking students


The Logic Programming paradigm is a declarative approach to programming, based on formal reasoning processes, which is more appropriate to address some types of problems. Constraint logic programming allows addressing constraint satisfaction and optimization problems by modeling them in a straightforward and elegant fashion.

Aims: To get acquainted with the Logic Programming and Constraint Programming paradigms. To develop skills for abstract reasoning and declarative problem representation.

The course focuses on first-order logic programming. On the practical side the Prolog programming language is explored. Additionally, constraint logic programming is also introduced, and several application examples are provided.

Percentual Distribution: Scientific component: 50%; Technological component: 50%

Learning outcomes and competences

At the end of this course, students should be able to:

  • Identify classes of problems where Logic Programming (and with Constraints) is particularly relevant.
  • Apply Prolog programming and constraint logic programming techniques.
  • Build full Prolog applications, with possible connections to other programming languages.

Moreover, students should have acquired programming skills required for assignments of other courses in the domain of Artificial Intelligence.

Working method


Pre-requirements (prior knowledge) and co-requirements (common knowledge)

Although the course does not have any special prerequisites, any knowledge obtained from the courses of Programming Fundamentals, Programming, Algorithms and Data Structures, and Algorithm Design and Analysis, are useful for the course of Logic Programming.


Foundations of Logic Programming

  • Propositional logic. Predicate lógic. Inference rules. Horn clauses. Unification. Resolution. Conjunctive normal form.
  • The logic programming paradigm. Origins of Prolog.

Logic Programming

  • Clauses. Predicates. Facts. Queries. Rules. Logic variables. Instantiation.
  • Logic programming and databases. Recursion. Lists. Trees. Symbolic expressions.
  • Computation model of a logic program. The unification algorithm. Abstract interpreter. Traces. Search trees. Negation.

The Prolog Language

  • Execution model. Backtracking. Rule and goal order. Termination.
  • Arithmetic. Iteration. Structure inspection. Meta-logical predicates. Control: cuts and negation. Extra-logical predicates.

Advanced Prolog Programming Techniques

  • Non-deterministic programming. Incomplete data structures. Meta-interpreters. Search techniques.

Constraint Logic Programming

  • Constraints. Constraint satisfaction. Constraints in finite domains.
  • Constraint logic programming (CLP). Search control. Variable and value ordering. Modelling problems in CLP. Constraint programming using SICStus Prolog.


Mandatory literature

Sterling, Leon; The Art of Prolog. ISBN: 0-262-69163-9
Marriot, Kim; Programming with constraints. ISBN: 0-262-13341-5
Clocksin, W. F.; Programming in prolog. ISBN: 0-387-58350-5

Complementary Bibliography

Torres, Delfim Fernando Marado; Introdução à programação em lógica. ISBN: 972-8021-93-3
Bratko, Ivan; Prolog programming for artificial intelligence. ISBN: 0-201-40375-7
O.Keefe, Richard A.; The craft of Prolog. ISBN: 0-262-15039-5
Stuart Russell, Peter Norvig; Artificial intelligence. ISBN: 978-0-13-207148-2

Teaching methods and learning activities

Theoretical classes are used for exposition of the main (constraint) logic programming concepts, presentation and discussion of practical examples. Practical classes are used to solve programming exercises and for assisting students on their practical assignments.


SICStus Prolog - http://www.sics.se/sicstus/


Technological sciences > Engineering > Knowledge engineering
Physical sciences > Computer science > Programming
Physical sciences > Mathematics > Mathematical logic
Physical sciences > Computer science > Cybernetics > Artificial intelligence

Evaluation Type

Distributed evaluation with final exam

Assessment Components

Designation Weight (%)
Exame 50,00
Participação presencial 0,00
Trabalho laboratorial 50,00
Total: 100,00

Amount of time allocated to each course unit

Designation Time (hours)
Estudo autónomo 10,00
Frequência das aulas 60,00
Trabalho laboratorial 65,00
Total: 135,00

Eligibility for exams

Enrolled students are admitted to exam if they do not exceed the allowed number of non-attendance to lab classes (maximum 25% of non-attendance) and provided that they obtain a minimum of 7 values (out of 20) in the evaluation of each practical assignment.

Calculation formula of final grade

Final Grade = 50% * Assignments + 50% * Exam

Assignments = 65% * Assignment1 + 35% * Assignment2

Assignment1 = 25% * Inter1 + 75% * Final1

Exam: Exam final grade.

Assignments: Final grade for both Assignments.

Inter1: Interim evaluation grade for Assignment 1.

Final1: Final evaluation grade for Assignment 1 (Report and Demo).

Assignment2: Evaluation grade for Assignment 2 (Report and Demo).

To obtain approval in the course, a minimum grade of 7 values (out of 20) is required in the Exam. The Exam will be open-book.

Examinations or Special Assignments

The course has 50% of practical evaluation required to all students. Practical assignments must be performed in the appropriate semester following the rules available at the course website. The 1st assignment interfaces with the LAIG course (for students enrolled in that course).

Important dates for assignments and demos:

  • Assignment 1
    • Interim submission for Assignment 1: 12/10
    • Final submission for Assignment 1: 9/11
    • Demos for Assignment 1: 10-14/11
  • Assignment 2
    • Submission of Assignment 2: 14/12
    • Demos for Assignment 2: 15-19/12

Evaluation in special seasons consists of one practical Assignment and a written Exam, where each of these components weights 50% on the final grade.

Special assessment (TE, DA, ...)

Practical evaluation is required to ALL students. Students must perform and present two practical assignments (see course website for details). The practical assignments are evaluated as described in the course website (report+demo). Students’ enrolled using special frequency modes, without obligation to attend to the practical classes, must arrange with the teachers appropriate consultation and evaluation sessions.

Classification improvement

Exam grade improvement: in the available exam dates.

Distributed evaluation improvement: this is practical evaluation and can only be improved in the assignment dates of the course, in the following edition.

Recommend this page Top
Copyright 1996-2019 © Faculdade de Engenharia da Universidade do Porto  I Terms and Conditions  I Accessibility  I Index A-Z  I Guest Book
Page generated on: 2019-05-25 at 23:10:28