BSc in Computer Science / Бакалавр в Области Компьютерных Наук

Course Details

Course Information Package

Course Unit TitleLOGIC PROGRAMMING
Course Unit CodeACSC300
Course Unit Details
Number of ECTS credits allocated5
Learning Outcomes of the course unitBy the end of the course, the students should be able to:
  1. Describe the differences between the declarative and procedural programming paradigms, discuss the potential applications of the Prolog programming language and identify its strengths and weaknesses.
  2. Define and interpret the syntax and semantics of Prolog’s core concepts, develop basic Prolog programs and queries, and devise and employ compound terms to represent complex information.
  3. Recognise, analyse, explain, develop and illustrate the execution of, recursive predicates and predicates that manipulate lists, arithmetic and structures.
  4. Employ Prolog’s built-in predicates for obtaining input from the keyboard or a file and for producing output to the screen or a file, explain the outcome that backtracking has for predicates with side effects and use the repeat predicate to achieve repeated execution of input/output predicates.
  5. Employ Prolog’s built-in predicates for testing the type of terms, constructing and decomposing terms, adding and deleting clauses to/from a program, and collecting all the objects that satisfy some goal into a list (bagof, setof, findall).
  6. Demonstrate backtracking, employ Prolog’s control facilities (cut and not), identify green and red cuts and explain their difference, illustrate the execution of predicates that contain cuts and analyse the issues associated with negation in goals.
  7. Develop and illustrate the execution of a non-trivial Prolog program.
Mode of DeliveryFace-to-face
PrerequisitesACSC191Co-requisitesNONE
Recommended optional program componentsNONE
Course Contents

Introduction to Logic Programming: The declarative programming paradigm; The Prolog programming language and what it is used for.

Basics of Prolog Programming: Terms, clauses, predicates, facts, rules and queries; The logical meaning of a Prolog program; Recursion and defining recursive rules.

Syntax and Meaning of Prolog Programs: Atoms, variables and structures; Matching; The declarative and the procedural meaning of Prolog programs; Prolog execution and search trees; Backtracking in Prolog.

Arithmetic and Lists: Arithmetic operators; Various kinds of equality and comparison operators; Representation of lists; Defining operations on lists; Sorting lists.

Using Structured Data: Creating a simple database; Retrieving structured information from a database; Data abstraction; Solving logic puzzles with Prolog.

Input and Output: Getting input from the keyboard; Writing output to the screen; File input and output; The repeat predicate.

Controlling Backtracking: Preventing backtracking; Using cut; Green and red cuts; Negative information; Negation as failure; The closed world assumption; Problems with cut and not.

System Predicates: Testing the type of terms; Constructing and decomposing terms; Assert and retract; Control facilities; The bagof, setof and findall predicates.  

Recommended and/or required reading:
Textbooks
  • Ivan Bratko, Prolog-Programming for Artificial Intelligence, 3rd Edition, Addison Wesley, 2001.
References
  • Leon Sterling and Ehud Shapiro, The Art of Prolog, 2nd Edition, MIT Press, 1994.
  • W. F. Clocksin, C. S. Mellish, Programming in Prolog: Using the Iso Standard, 5th edition, Springer-Verlag, 2003.
Planned learning activities and teaching methods

The course is delivered through three hours of lectures per week, which include presentation of the core structure and concepts of Prolog and examples of their use. A lot of work is done through in-class exercises by defining and experimenting with Prolog predicates and queries. Further exercises are given to students as non-assessed homework. Both in class and home exercises provide the students with the necessary practical experience and skills while they also help in assessing the student level of understanding and providing feedback.

All lecture notes and other material are available to students through the course homepage.
Assessment methods and criteria
Assignments24%
Tests16%
Final Exam60%
Language of instructionEnglish
Work placement(s)NO

 Печать  E-mail