Course Details
Course Information Package
Course Unit Title | LOGIC PROGRAMMING | ||||||||
Course Unit Code | ACSC300 | ||||||||
Course Unit Details | |||||||||
Number of ECTS credits allocated | 5 | ||||||||
Learning Outcomes of the course unit | By the end of the course, the students should be able to:
| ||||||||
Mode of Delivery | Face-to-face | ||||||||
Prerequisites | ACSC191 | Co-requisites | NONE | ||||||
Recommended optional program components | NONE | ||||||||
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 |
| ||||||||
References |
| ||||||||
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 |
| ||||||||
Language of instruction | English | ||||||||
Work placement(s) | NO |