Skip to main content

ID1213 Logic Programming, Basic Course 7.5 credits

Choose semester and course offering

Choose semester and course offering to see information from the correct course syllabus and course offering.

Headings with content from the Course syllabus ID1213 (Autumn 2021–) are denoted with an asterisk ( )

Content and learning outcomes

Course contents

The course presents logic and logic programming for software development. The course presents algorithms over lists and tree, and also search algorithms over graphs. Various more efficient data structures, such as difference structures, are introduced. We show how techniques from functional programming fit in the framework of logic programming and can be expressed in the programming language Prolog. Finally, the course presents some AI applications, such as simple expert systems, and gives a short overview of current methodological trends. In this course students will meet theory and the basic design principles within logic programming while they in later project course, for example in the degree project, can practise the methods.

Intended learning outcomes

After passing the course, the student shall be able to

  • describe a problem as logical statements, facts and rules
  • express algorithms as rules in Prolog
  • design and/or choose appropriate data representations in a logic program
  • use Prolog's mechanisms to streamline search in execution of a logic program

in order to

  • master logic programming as method to develop software.

Course disposition

No information inserted

Literature and preparations

Specific prerequisites

  • Completed course ID1018 Programming I or DD1393 Software Engineering, or the equivalent. 
  • Completed course ID1020 or DD1338 Algorithms and Data Structures, or the equivalent. 
  • Completed course SF1624 or IX1303 Algebra and Geometry, or the equivalent.
  • Completed course SF1610 or IX1500 Discrete Mathematics, or the equivalent.

Recommended prerequisites

No information inserted


No information inserted


No information inserted

Examination and completion

If the course is discontinued, students may request to be examined during the following two academic years.

Grading scale

A, B, C, D, E, FX, F


  • TEN1 - Examination, 7.5 credits, grading scale: A, B, C, D, E, FX, F

Based on recommendation from KTH’s coordinator for disabilities, the examiner will decide how to adapt an examination for students with documented disability.

The examiner may apply another examination format when re-examining individual students.

Written examination.

Opportunity to complete the requirements via supplementary examination

No information inserted

Opportunity to raise an approved grade via renewed examination

No information inserted


Profile picture Thomas Sjöland

Ethical approach

  • All members of a group are responsible for the group's work.
  • In any assessment, every student shall honestly disclose any help received and sources used.
  • In an oral assessment, every student shall be able to present and answer questions about the entire assignment and solution.

Further information

Course web

Further information about the course can be found on the Course web at the link below. Information on the Course web will later be moved to this site.

Course web ID1213

Offered by

EECS/Computer Science

Main field of study


Education cycle

First cycle

Add-on studies

A course on Artificial Intelligence. Courses on formal semantics, logical methods in software design, e.g. program analysis or software verification.

A project based on this course can be performed as a thesis project on the 1st cycle level ("kandidat", or "högskoleingenjör") or on the advanced level, 2nd cycle,  ("civilingenjör" or "master thesis").


Thomas Sjöland

Supplementary information

The content coincides with ID2213 that is given in english at the same time. ID2213 also contains a project course.

In this course, the EECS code of honor applies, see: