Go to:
Esta página em português Ajuda Autenticar-se
DCE 2017
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: 2011/2012 - 1S

Active? Yes
E-learning page: http://moodle.fe.up.pt/
Responsible unit: Department of Informatics Engineering
Course/CS Responsible: Master in Informatics and Computing Engineering

Study cycles/ courses

Acronym No. of students Study Plan Curricular Years Credits UCN Credits ECTS Contact hours Total Time
MIEEC 5 Syllabus (Transition) since 2010/2011 4 - 5 56 135
Syllabus 4 - 5 56 135
MIEIC 115 Syllabus since 2009/2010 3 - 5 56 135

Teaching - Responsibilities

Teacher Responsibility
Henrique Daniel de Avelar Lopes Cardoso

Teaching - Hours

Lectures: 2,00
Recitations: 2,00
Type Teacher Classes Hour
Lectures Totals 1 2,00
Henrique Daniel de Avelar Lopes Cardoso 2,00
Recitations Totals 6 12,00
Daniel Cardoso de Moura 4,00
Henrique Daniel de Avelar Lopes Cardoso 2,00
Gustavo Alexandre Teixeira Laboreiro 2,00
Inês Coimbra Morgado 4,00

Teaching language

Portuguese - 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.

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.

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.

Scientific component: 50%
Technological component: 50%

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.


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/
SWI-Prolog - http://www.swi-prolog.org/


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

Type of assessment

Distributed evaluation with final exam

Assessment Components

Description Type Time (Hours) Weight (%) End date
Attendance (estimated) Participação presencial 56,00
First Assignment Defesa pública de dissertação, de relatório de projeto ou estágio, ou de tese 30,00
Second Assignment Trabalho escrito 20,00
Interim Report for the First Assignment Defesa pública de dissertação, de relatório de projeto ou estágio, ou de tese 6,00
Final Report for the First Assignment Defesa pública de dissertação, de relatório de projeto ou estágio, ou de tese 12,00
Final Report for the Second Assignment Defesa pública de dissertação, de relatório de projeto ou estágio, ou de tese 8,00
Final Exam Exame 3,00
Total: - 0,00

Eligibility for exams

Students approve in practical evaluation if they don’t exceed the fault limit and get a minimum of 30% grade in the required practical assignments.

Calculation formula of final grade

Final Grade = 50% * Practical Assignments + 50% * Exam
- Exam – Examination Final Grade
- Practical Assignments - Practical Assignments Final Grade.

Practical Assignments = 15%*Mid1 + 50%*Final1 + 35%*Assignment2

- Mid1 – Grade of the Assignment 1 intermediate report.
- Final1 – Final grade of assignment 1 (Report and Demonstration).
- Assignment2 - Final grade of assignment 2 (Report and Demonstration).

Minimum grade required in final examination to be approved is 6 (out of 20).


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 has interface with LAIG.

Important dates:

Deadline for submitting the intermediate report: 2/10
Deadline for submitting the 1st assignment: 06/11
Demonstrations of the 1st assignment: 7/11 a 11/11

Deadline for submitting the 2nd assignment: 11/12
Demonstrations of the 2nd assignment: 12/12 a 16/12

Special assessment (TE, DA, ...)

Practical evaluation is required for 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+demonstration+oral presentation). Students’ registered using special frequency modes, without obligation to attend to the practical classes, must arrange with the teachers the evaluation sessions to present their practical assignments.

Classification improvement

Students may perform exams to improve their grade in the appropriate periods. Practical evaluation may only be improved in the appropriate semester.


Although there are no special prerequisites, knowledge acquired in Programming Fundamentals, Programming, Algorithms and Data Structures, and Algorithm Design and Analysis is useful for Logic Programming.
Recommend this page Top
Copyright 1996-2017 © Faculdade de Engenharia da Universidade do Porto  I Terms and Conditions  I Accessibility  I Index A-Z  I Guest Book
Page generated on: 2017-05-24 at 08:49:32