Skip to content

EMGraeter/PrologTutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 

Repository files navigation

PrologTutorial

A tutorial explaining the AI programming language Prolog

Prolog is a fun and easy programming language to learn. It serves a very important role in artificial inteligence. It is a programming language made for artificial inteligence rather than an AI algorithm made for programming languages. Prolog answers questions based on the knowledge given unlike most other programming languages which perform actions based on instructions given. You might not be able to use Prolog to solve your math homework for you, but the language is great for deducing relations between objects (Geeks for Geeks).

The most basic thing to know about Prolog is that the main code is the knowledge base and it can be used with queries. The knowledge base is made of two parts, facts and rules. While the knowledge base can just be made of facts, I find it isn't as fun to query without rules. Just like most code the best and, some would argue, only way to learn Prolog is by example, so the actual tutorial is in the tutorial.pl file in the comments.

A good website for practicing your Prolog skills on is SWISH (https://swish.swi-prolog.org/).

I didn't include everything in my tutorial. I left out a lot of the vocabulary because I wanted the tutorial to be concise. If you are really interested in Prolog and want to learn more, Learn Prolog Now! is a fantastic site for that. It's even the site I used when I first started learning Prolog, and I also used it as reference while I was writing the tutorial. Prolog code can be much more complicated than what I included, but it would just be a recombination of the things I wrote in the tutorial.pl file or the extraExamples.pl file. I encourage you to practice by finishing up the knowledge base I started, or make a new one with whatever facts and rules you want. Prolog is a great example of logic based artificial intelligence and can be great for deducing answers from large knowledge bases.

Prolog might not be that well-known but it is still important today especially in machine learning. Prolog is even used in IBM Watson, one of the best artificial inteligence computers in the world, known for being able to answer questions posed in natural language (IBM Developer).

Sources: Geeks for Geeks By: Prasad_Kshirsagar, Improved By: ManasChhabra2 - https://www.geeksforgeeks.org/prolog-an-introduction/ Learn Prolog Now! By: Patrick Blackburn, Johan Bos, and Kristina Striegnitz - http://www.learnprolognow.org/lpnpage.php?pagetype=html&pageid=lpn-htmlli1 Stack Overflow By: snr - Reinstate Monica - https://stackoverflow.com/questions/50668708/what-does-the-symbol-mean-in-prolog IBM Developer By: M. Tim Jones - https://developer.ibm.com/technologies/artificial-intelligence/articles/cc-languages-artificial-intelligence/

About

A tutorial explaining the AI programming language Prolog

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published