Prolog - school project

Discussions related to Visual Prolog
kim0
Posts: 1
Joined: 3 Jun 2020 22:57

Prolog - school project

Unread post by kim0 » 3 Jun 2020 23:03

Hey guys,
I have to create Project about project. Project is going to be about modules and objects. Presentation really doesn't have to be complex - just what objects and modules are + simple code.

I know it's more professional forum, but I still need help. :-(
Talking about modules, I found this video, but I don't understand at all what happens there: https://www.youtube.com/watch?v=fG2HgTquAh4

All in all I ask you to tell me something about objects, modules and if it's possible simple codes to them.

Martin Meyer
VIP Member
Posts: 279
Joined: 14 Nov 2002 0:01

Re: Prolog - school project

Unread post by Martin Meyer » 4 Jun 2020 13:03

Hi Kim,

very different Prolog implementations exist. Only some of them are modular within a framework of object-oriented programming.

Visual Prolog gives a fine example of objects and modules in a programming language. It comes with a programming environment for developing programs. The environment presents the files containing object types, modules, and else program parts in a tree.

There is a free version of Visual Prolog available for download. The Prolog language is identical in the free and commercial version, the free version is limited to build 32-bit applications only.

See the Hello World! demonstration. When you follow the steps shown in the video (the current Visual Prolog version differs very little), you get a -simple- program which contains objects and modules. Class main in file main.cl is for example a module, i.e. the class states no construction type. Interface time in file time.i, which you find in pfc ("Prolog Foundation Classes"), is an object type. The interface is not used in the main code of the "Hello World!" example, but the package of the time class is required by the surrounding code which calls the main code run predicate.

Comprehensive details of Visual Prolog's object model are covered by the Language Reference and in the Introduction to Classes and Objects tutorial. In the Language Reference you can also find example code of using objects.
Regards Martin

Post Reply