Disclosure: Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

Best Courses Guides

6 Best Free Prolog Courses to Take in 2024

Here are the best free online courses to Master Prolog, a powerful declarative logic programming language used for AI and NLP.

Interested in intelligent systems?

Prolog is a powerful declarative logic programming language that’s mainly used for artificial intelligence, natural language processing, and symbolic computation. It’s based on first-order logic, which means that programs in Prolog consist of logical statements that are interpreted as facts or rules (for example, the premise ‘If it rains, then the ground is wet’ and ‘It is raining’ lead to the conclusion ‘The ground is wet’).

These facts and rules can be used to make logical deductions which can help in developing intelligent systems that can reason, learn, and solve problems using logical rules and data, such as in complex decision making systems and AI.

In this guide, I’ve picked the best free online courses to learn Prolog. If you’re in a hurry, here are my top picks. Click on one to skip to the course details:

Course Workload In Brief
1. The Power of Prolog (Markus Triska) N/A Best overall free up-to-date comprehensive Prolog course for beginners
2. Simply Logical – Intelligent Reasoning by Example (Simply Logical) N/A Best free Prolog course for artificial intelligence and computational logic for beginners
3. Prolog Programming (Ryan Schachte) 1–2 hours Best free short video course for beginners
4. Prolog Tutorial (Derek Banas) 1 hour Best free alternative to 3
5. Prolog Problems (Bern University of Applied Sciences) N/A Best free exercises to practice Prolog programming
6. An introduction to Prolog for SQL programmers (Robert Laing) N/A Best free beginner Prolog course for SQL programmers

What is Prolog?

Prolog, short for Programming Logic, is a declarative programming language that was first developed in 1972 by Alain Colmerauer and Philippe Roussel. It is unique in that it is homoiconic, meaning it treats code as data, and is focused on specifying what you want to achieve rather than how to achieve it. This makes it well-suited for artificial intelligence and natural language processing tasks, as it allows the programmer to define a set of facts and rules that describe a problem and then use these to find a solution, or in other words, to ‘reason’.

Prolog is not only used in academia though, it has also seen commercial applications. The Java Virtual Machine Specification contains Prolog, NASA uses Prolog for voice-control, IBM Watson’s natural language processing abilities come from Prolog, New Zealand’s stock broking system is written in Prolog, and a third of all airline tickets are handled by Prolog.

While Prolog has been around for more than half a century now, that hasn’t stopped it from evolving, with more declarative features that make it easier to understand and use to create general programs with less effort. If you need to model and solve complex problems through symbolic data and logical deductions, a logical programming language like Prolog can save the day.

Find your next course.

Best Courses Guides Methodology

I built this ranking following the now tried-and-tested methodology used in previous Best Courses Guides (you can find them all here). It involves a three-step process:

  1. Research: I started by leveraging Class Central’s database with 100K online courses and 200K+ reviews. Then, I made a preliminary selection of Prolog courses by rating, reviews, and bookmarks.
  2. Evaluate: I read through reviews on Class Central, Reddit, and course providers to understand what other learners thought about each course and combined it with my own experience as a learner.
  3. Select: Well-made courses were picked if they presented valuable and engaging content and they have to fit in a set of criteria and be ranked accordingly: comprehensive curriculum, affordability, release date, ratings and enrollments.

Course Ranking Statistics

Here are some aggregate stats about the ranking:

  • All of the courses in this ranking are free.
  • All of the courses with an exception of one are suitable for beginners to Prolog.
  • Four of the courses are text-based, whereas two are video-based. One course makes use of text and video formats.
  • Two of the courses are interactive in the browser — no installation required!

Without further ado, let’s go through the top picks.

1. The Power of Prolog (Markus Triska)

My number one course for the best Prolog course is The Power of Prolog.

This free course is my top pick because it is the most comprehensive and up-to-date course on Prolog that I have found. It has been consistently updated for two decades, so you can rest assured that you’re learning the latest modern features of the Prolog language. 

The course covers a wide range of topics, including simple integer arithmetic, web applications, theorem proving, and even artificial intelligence! In addition to its comprehensive course material, there are also sample programs for you to practice with and video tutorials to help guide your learning. Before you get started, watch the course’s trailer.

The course presumes no background knowledge about logic or logical programming, although some experience in programming is helpful.

What You’ll Learn

To get started in logical programming, you’ll need to know the foundations of logic first. You’ll understand that Prolog is based on a subset of classical first-order predicate logic called Horn clauses which allows for the proving of theorems through resolution — an amazing tool for solving complex problems!

Once you have the fundamentals of logic under your belt, you’ll soon be writing and reading Prolog programs. First, you’ll learn the most basic concepts of Prolog, such as its program and data structures. From there, you’ll learn how to reason effectively with Prolog by reading and writing Prolog programs, including doing integer arithmetic, sorting, and searching. You’ll level up your Prolog skills by exploring more advanced concepts such as logical purity and definite clause grammars, as well as practical techniques like declarative testing and debugging that can truly be a life-saver.

The potential of Prolog is truly limitless — from web applications, to databases, to cryptography, and of course, building artificial intelligence. Why is Prolog used for these? It’s because Prolog can emulate the process behind human decision making, proving complex mathematical theorems, and solving logic puzzles. You’ll find out how Prolog does this, as well how it is used in all of these applications in detail.

How You’ll Learn

This course consists of 33 chapters. You’ll learn by reading through the course chapters, looking at the code examples, and watching the lecture videos.

Website metalevel.at
Author Markus Triska
Level Beginner — Advanced
Workload N/A
Certificate None

Fun Facts

  • The website the course is hosted on uses a reverse proxy written in Prolog!
  • You can find the course’s Github page here.
  • The Power of Prolog aims to bring traditional old Prolog textbooks up to date with the current modern state of the language. That’s why this book is currently in use by eight university courses.
  • Markus Triska studied at the Vienna University of Technology. He has made significant contributions to the development of the language, like creating several libraries for SWI-Prolog and maintaining Prolog’s FAQ Frequently Asked Questions webpage. In addition, he has won the Prolog Programming Contest twice and received a Master’s degree and a doctoral degree in the field of Prolog and constraints. Tristan has also published numerous scientific papers on combinatorial optimization, Prolog, and constraints, and has contributed to the Prolog ISO standard (N226) and the Prolog teaching environment GUPU.

If you’re interested in this course, you can find more information about the course and how to enroll here.

2. Simply Logical – Intelligent Reasoning by Example (Simply Logical)

My second pick for the best Prolog course is Simply Logical – Intelligent Reasoning by Example.

This free course focuses on Prolog programming in the context of Artificial Intelligence, implementing intelligent behavior in machines, and Computational Logic, automating various kinds of reasoning. The course’s philosophy is ‘teaching by showing, learning by doing’, which is reflected in the interactive code blocks embedded in the course page for you to experiment with. By the end of this course, you’ll understand how logic can be used to solve problems in AI.

What You’ll Learn

The course is divided into 3 parts: Logic and Logic Programming; Reasoning with structured knowledge; Advanced reasoning techniques.

The first part serves as an introduction to Logic Programming with Prolog, where you’ll deal with concepts such as program clauses, query answering, proof trees, and recursive data structures in an intuitive manner. Then, you’ll cover them much more formally by proving soundness and completeness in a program. You’ll also uncover common Prolog programming techniques, including the use of SLD-trees, arithmetic expressions, second-order predicates, and programming techniques.

In Part II, the focus shifts to Artificial Intelligence concepts, specifically structured knowledge. You’ll learn how to represent structured knowledge (relationships) as graphs, and how to answer a problem with no known analytic solutions through two kinds of search — blind and informed.

Part III will explore advanced reasoning techniques beyond the boundaries of clausal logic, where sequences of events are happening over time, where truth is not guaranteed, and knowledge is available in non-logical form such as pictures or spoken text. You’ll learn how to turn natural language into clausal logics, and how to reason with incomplete information, and finally how to conduct inductive reasoning through generalization or specialization.

How You’ll Learn

This course consists of 12 chapters in total. You’ll learn by reading through chapter material, playing around with the interactive code samples, and completing the exercises given, some of them having answers.

Institution Simply Logical
Website book.simply-logical.space
Author Peter Flach
Level Beginner
Workload N/A
Certificate None

Fun Facts

  • About Simply Logical is an open-source project providing a suite of online resources about Artificial Intelligence and Logic Programming with Prolog.
  • Peter Flach is a Professor of Artificial Intelligence at the University of Bristol. He has served as Editor-in-Chief of the Machine Learning journal from 2010 to 2020. Prof Flach has also been involved in organizing several conferences in the field of machine learning, and is a founding board member and current President of the European Association for Data Science. He is a Fellow of the Alan Turing Institute for Data Science and Artificial Intelligence.

If you’re interested in this course, you can find more information about the course and how to enroll here.

3. Prolog Programming (Ryan Schachte)

Ryan Schachte’s Prolog Programming video series will teach you the fundamental concepts of Prolog and how to use it to solve complex problems through logical reasoning and symbolic data representation.

What You’ll Learn

First, you’ll start by getting a handle on the basics. You’ll delve into the basics of running and compiling basic prolog code and understand how facts like “The sky is blue” are represented as simple predicates in Prolog. Next, you’ll learn how to define rules that make use of these facts, such as “If the sky is blue and the sun is shining, then it is a nice day”. Then, you’ll see Prolog do something magical — give it a query like “Is it a nice day?” and watch as it determines the answer for you!

Moving on, you’ll dive into representing information as variable syntax and structs, and figure out how to ask more sophisticated questions about the data you have. Arithmetic operations will become second nature as you see how Prolog performs them. And that’s just the beginning! You’ll learn about Prolog’s support for complex data structures, such as lists and pairs, and how to perform advanced operations like sorting and searching through lists to get the information you need.

How You’ll Learn

This course is 1–2 hours long and consists of 4 parts. You’ll learn by watching the lecture videos and following along with the instructor as he codes.

Channel Ryan Schachte
Provider YouTube
Instructor Ryan Schachte
Level Beginner
Workload 1–2 hours
Views 253K
Likes 2.8K
Certificate None

Fun Facts

  • Ryan Schatche’s YouTube channel discusses programming in C, C++, Java, Javascript, HTML, CSS, Assembly, MIPS, computer architecture, mathematics, and computer science theory. He also covers numerous topics for web design, algorithm analysis, statistics, discrete mathematics, and more.

If you’re interested in this course, you can find more information about the course and how to enroll here.

4. Prolog Tutorial (Derek Banas)

Derek Banas’s Prolog Tutorial is a very concise one-hour video teaching the essentials of Prolog. You’ll learn how to use Prolog to describe facts and relationships about problems to facilitate automated reasoning.

What You’ll Learn

Prolog is a programming language that enables you to describe facts and relationships about problems rather than merely outlining a series of steps to solve them. You’ll learn how to define facts and rules to facilitate automated reasoning, and use variables as a placeholder for values that might change. Then, you’ll learn how to use if statements to create complex terms and rules.

Prolog also has logical and arithmetic operators. You’ll learn how to use them, both sequentially as well as recursively. You’ll also see how you can read and write to consoles and files. In fact, one of the things you’ll discuss is how to modify the database of facts and rules directly. Finally, you’ll learn how to create lists in Prolog to represent more similarity-related values and work with strings.

How You’ll Learn

This course is 1 hour long. You’ll learn by watching the lecture video and following along on your PC.

Channel Derek Banas
Provider YouTube
Instructor Derek Banas
Level Beginner
Workload 1 hour
Views 816K
Likes 13K
Certificate None

Fun Facts

If you’re interested in this course, you can find more information about the course and how to enroll here.

5. Prolog Problems (Bern University of Applied Sciences)

Prolog Problems is a free collection of problems aimed to help students practice their logic programming skills in Prolog, where your goal should be to find the most elegant or logically clear solution of the given problems. Problems are marked by their difficulty, from easiest to hardest. 

What You’ll Learn

The collection is structured into seven sections:

  1. Prolog Lists: Manipulating lists in Prolog. Example questions:
    • Find the last but one element of a list.
    • Drop every N’th element from a list.
  2. Arithmetic: Primes, mathematical algorithms, and functions. Example questions:
    • Determine whether two positive integer numbers are coprime.
    • Determine whether a given integer number is prime.
  3. Logic and Codes: Creating truth tables and encoding sequences. Example questions:
    • Truth tables for logical expressions.
    • Huffman code.
  4. Binary Trees: Manipulation of binary trees. Example questions:
    • Check whether a given term represents a binary tree
    • Construct height-balanced binary trees
  5. Multiway Trees: Manipulation of Multiway Trees. Example questions:
    • Count the nodes of a multiway tree
    • Lisp-like tree representation
  6. Graphs: Manipulation of Graphs. Example questions:
    • Cycle from a given node
    • Construct all spanning trees
    • Generate K-regular simple graphs with N nodes
  7. Miscellaneous: Miscellaneous computer science questions. Example questions:
    • Syntax checker
    • Crossword puzzle
    • Von Koch’s conjecture

How You’ll Learn

This course consists of seven sections. You’ll learn by going through the problems and solving them hands-on. The course provides solutions to the problems at the end of each section if you get stuck.

Institution Bern University of Applied Sciences
Author Werner Hett
Level Beginner — Advanced
Workload N/A
Certificate None

Fun Facts

If you’re interested in this course, you can find more information about the course and how to enroll here.

6. An introduction to Prolog for SQL programmers (Robert Laing)

If you’re primarily familiar with SQL, then thinking of Prolog as a relational database query language might be a great way to get started. That’s what this free course is about.

An introduction to Prolog for SQL programmers teaches Prolog by simulating basic SQL operations through Prolog code, from querying to modifying databases.

What You’ll Learn

This course is made up of three parts.

The first part walks you through querying databases where you simulate traditional SQL commands like SELECT, INSERT, WHERE, and JOINs in Prolog. 

The second part is a translation of the Social-Network quiz questions from Databases: Relational Databases and SQL Stanford course. You’ll convert natural language questions into Prolog prompts.

The third part of the course is all about recursion, or in mathematical terms transitive closures. Here, you’ll also learn commands that are easy to do in Prolog but not in SQL, for example returning paths and guarding against endless cycles.

How You’ll Learn

This course consists of three parts. You’ll learn by going through each part and doing the interactive in-browser exercises for hands-on practice.

Provider SWISH: SWI-Prolog for Sharing
Author Robert Laing
Level Beginner
Workload N/A
Certificate None

Fun Facts

  • Robert Laing has a Prolog Cookbook website where he writes down notes on logic programming with Prolog.
  • He has also made a website where you can play Chinese Checkers coded in Prolog.

If you’re interested in this course, you can find more information about the course and how to enroll here.

Elham Nazif Profile Image

Elham Nazif

Part-time content writer, full-time computer science student.

Comments 0

Leave a reply

Your email address will not be published. All comments go through moderation, so your comment won't display immediately.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Browse our catalog

Discover thousands of free online courses from top universities around the world like MIT, Stanford, and Harvard.

Browse all subjects