Prolog: Difference between revisions

From Sea of Fate
Jump to navigationJump to search
Created page with "==Introduction== The main use for Prolog will be to use it as the AI engine for the '''Image Processing Application'''. There may be other applications but that is one that will get things moving. It is assumed that it will take some time to learn how to use it with enough skill so starting now is a good idea. We will be using SWI Prolog."
 
No edit summary
Line 2: Line 2:


The main use for Prolog will be to use it as the AI engine for the '''[[Image Processing Application]]'''. There may be other applications but that is one that will get things moving. It is assumed that it will take some time to learn how to use it with enough skill so starting now is a good idea. We will be using SWI Prolog.
The main use for Prolog will be to use it as the AI engine for the '''[[Image Processing Application]]'''. There may be other applications but that is one that will get things moving. It is assumed that it will take some time to learn how to use it with enough skill so starting now is a good idea. We will be using SWI Prolog.
==Installation==
To install SWI-Prolog on Ubuntu, the most common and recommended method is to use its Personal Package Archive (PPA). This ensures you get the latest stable version. You might be prompted to press Enter to confirm adding the repository.
sudo add-apt-repository ppa:swi-prolog/stable
After adding the PPA, you need to update your system's package information so it knows about the new packages available from the PPA:
sudo apt update
Now you can install the swi-prolog package:
sudo apt install swi-prolog
It is possible that there will be other sources but this is probably the most up to date. To prove that it is installed and working type
swipl
There should be some welcome message as the interactive interpreter try
write('Hello, Prolog!').
The interpreter should return the message Hello, Prolog! followed by true
==Some learning resources==
A quick search with google returned [https://book.simply-logical.space/src/simply-logical.html] and another site [https://lpn.swi-prolog.org/lpnpage.php?pageid=top].

Revision as of 14:15, 21 May 2025

Introduction

The main use for Prolog will be to use it as the AI engine for the Image Processing Application. There may be other applications but that is one that will get things moving. It is assumed that it will take some time to learn how to use it with enough skill so starting now is a good idea. We will be using SWI Prolog.

Installation

To install SWI-Prolog on Ubuntu, the most common and recommended method is to use its Personal Package Archive (PPA). This ensures you get the latest stable version. You might be prompted to press Enter to confirm adding the repository.

sudo add-apt-repository ppa:swi-prolog/stable

After adding the PPA, you need to update your system's package information so it knows about the new packages available from the PPA:

sudo apt update

Now you can install the swi-prolog package:

sudo apt install swi-prolog

It is possible that there will be other sources but this is probably the most up to date. To prove that it is installed and working type

swipl

There should be some welcome message as the interactive interpreter try

write('Hello, Prolog!').

The interpreter should return the message Hello, Prolog! followed by true

Some learning resources

A quick search with google returned [1] and another site [2].