Go to:
Logótipo
You are here: Start > L.EIC024

Functional and Logic Programming

Code: L.EIC024     Acronym: PFL

Keywords
Classification Keyword
OFICIAL Informatics Engineering and Computing

Instance: 2023/2024 - 1S Ícone do Moodle Ícone  do Teams

Active? Yes
Web Page: https://moodle2324.up.pt/course/view.php?id=5563
Responsible unit: Department of Informatics Engineering
Course/CS Responsible: Bachelor 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
L.EIC 343 Syllabus 3 - 6 52 162
Mais informaçõesLast updated on 2023-11-20.

Fields changed: Eligibility for exams, Fórmula de cálculo da classificação final

Teaching language

Portuguese
Obs.: Suitable for english-speaking students

Objectives

The Functional Programming and Logic Programming paradigms present declarative approaches to programming, based on formal reasoning processes, which are more appropriate to the resolution of some types of problems.

Objectives: become familiar with the Functional Programming and Logic Programming paradigms. Develop skills in abstract reasoning and declarative problem representation.

Learning outcomes and competences

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

  1. Use pre-defined and algebraic types in Haskell to represent values of a specific domain
  2. Define generic transformations on inductive data structures (for example, trees) as polymorphic functions in Haskell
  3. Decompose programming problems into pure Haskell functions operating over structured data types
  4. Prove equivalence of Haskell functions using definitions by equations and induction
  5. Represent facts and relations as Prolog programs
  6. Understand the execution model of Prolog programs
  7. Model search problems as logic programs and queries in Prolog.

Working method

Presencial

Program


  1. Logic Programming (6-7 weeks)


    1. Propositional and predicate logic. Horn clauses. Facts and rules. Herbrand terms. Unification.

    2. The Prolog language. Execution model. SLD resolution. Negation by failure.

    3. Databases of facts and relations. Programming with recursive structures.

    4. Arithmetic. Extra-logic and control predicates.

    5. Examples of logic programs: search, games, symbolic manipulation.



  2. Functional Programming (6 weeks)


    1. Expressions, reductions, and values. Built-in simple and structured types. Definitions using equations.

    2. Parametric and bounded polymorphism. Fundamental type classes.

    3. Lambda expressions. Currying and partial application. Higher-order functions of the standard prelude.

    4. Defining algebraic data types; pattern matching and recursive definitions.

    5. Programming examples: search trees; syntax trees; text layout; visualization and games.

    6. Programming with I/O.

    7. Equivalence proofs using equational theory and induction.



Mandatory literature

Simon Thompson; Haskell the craft of functional programming. ISBN: 0- 201-34275-8
Graham Hutton; Programming in Haskell, Cambridge University Press, 2016. ISBN: 978-1316626221
Leon Sterling; The Art of Prolog. ISBN: 0-262-69163-9

Complementary Bibliography

Bryan O'Sullivan, Don Stewart, and John Goerzen; Real World Haskell, O'Reilly Media, 2008. ISBN: 9780596514983
Richard Bird; Introduction to Functional Programming using Haskell, Pearson, 1998. ISBN: 978-0-13-484346-9
Ivan Bratko; Prolog programming for artificial intelligence. ISBN: 0-201-40375-7

Teaching methods and learning activities

Theoretical lectures are used to explain fundamentals, accompanied by the presentation and discussion of illustrative examples. Theoretical-practical (TP) classes allow for the systematization of knowledge through the resolution of programming exercises and monitoring of progress in student’s assignments.

Software

GHC
SICStus Prolog

Evaluation Type

Distributed evaluation without final exam

Assessment Components

Designation Weight (%)
Teste 50,00
Trabalho prático ou de projeto 50,00
Total: 100,00

Amount of time allocated to each course unit

Designation Time (hours)
Elaboração de projeto 60,00
Estudo autónomo 50,00
Frequência das aulas 52,00
Total: 162,00

Eligibility for exams

A student obtains frequency in this course if he concludes both practical assignments (TP1 and TP2) with a minimum grade of 35% in each one.

Calculation formula of final grade

(CF = Final Classification, P = Practical Component, T = Theoretical Component, ER = Appeal Exam)

(TP1, TP2 = Practical Assignment 1 and 2, respectively)

(MT1, MT2 = Mini-Test 1 and 2, respectively)


P = 50% * TP1 + 50% * TP2

T = 50% * MT1 + 50% * MT2


In Regular Exam Season:  

CF = 50% * P + 50% * T


In Appeal Exam Season:

CF = 50% * P + 50% * ER


Notes:
- The minimum grade in each component (TP1, MT1, TP2, and MT2) is 35%
- In the appeal exam season, the minimum grade is 35% for each part of the exam
- The maximum grade between components TP1 and MT1 is, at most, the minimum grade of these two components plus 6 marks
- The maximum grade between components TP2 and MT2 is, at most, the minimum grade of these two components plus 6 marks
- In the appeal exam season, the same rules apply, replacing MT1 and MT2 with the corresponding parts of the exam

Examinations or Special Assignments

There are no special tests or assignments.

Special assessment (TE, DA, ...)

Evaluation rules apply to all students, regardless of their status or condition. Students who, by their status or condition are not obliged to attend the practical classes must contact their teachers for assignment consultation and evaluation sessions.

Classification improvement

The practical component can only be improved in subsequent editions of the course.

The theoretical component can be improved in an exam during the appeal exam season.

Recommend this page Top
Copyright 1996-2025 © Faculdade de Engenharia da Universidade do Porto  I Terms and Conditions  I Accessibility  I Index A-Z  I Guest Book
Page generated on: 2025-06-14 at 03:11:31 | Acceptable Use Policy | Data Protection Policy | Complaint Portal