Key Prolog Questions

Firstly, what do you recommend as a book for studying prologue. Secondly, is there an easy way to upload many .pl files at once? Currently, you just do one at a time with ['name.pl'], but it is annoying to do it again and again. I also use this one to find out.

thanks

+6
source share
6 answers

First, welcome to Prolog! I think you will find it useful and enjoyable.

The books that I usually see recommend: “The Art of Prologue,” “Programming the Prologue,” and “Reservation and Consequence.” I have art and programming, and they are both wonderful books; Art is certainly more encyclopedic, and programming more linear. Recently, I often advise Art and Craft and some stranger ones (like logical grammars). I hope to buy Prolog Programming in Depth. I do not think that there are many bad Prolog books that should be avoided. I would probably retain Craft and Practice later.

You can upload several files at once by specifying them:

:- [file1, file2, file3]. 

Also, since "name.pl" ends with ".pl", you can omit quotation marks; single quotes are really only needed if Prolog does not accept a closed element as normal.

Hope this helps and good luck on your trip. :)

+5
source

In SWI-Prolog also check:

 ?- make. 

to automatically reload files that have changed since they were consulted.

+4
source

You can check this question . There are some good books recommended there.

+4
source

If you are prone to mathematical introduction, Logic, Programming and Prolog (2ED) is an interesting book by Nilsson and Malushinsky.

Programming in Prolog, Clocksin and Mellish, is a classic introductory tutorial.

+3
source

This is a small short introduction: http://www.soe.ucsc.edu/classes/cmps112/Spring03/languages/prolog/PrologIntro.pdf

I also want to say that there is a good swi-oriented pdf file, but I can not find it.

+2
source

I will not repeat the classic options already mentioned in other answers, but I will add a note about programming the prologue in depth to Michael Covington, Donald Nute and Andrew Wellino. The two chapters that I would like to highlight are the chapters on tracking and valid rules. The first shows how to effectively and efficiently track Prolog calculations on pencil and paper. The latter shows you how to create Prolog code that supports valid rules. Unlike the rules that you are accustomed to in Prolog, which either succeed or do not work directly, and are not influenced by anything not specified in the rule itself, valid rules can succeed in the information set out in the rule, but can be undermined other rules in the knowledge base making an expression that is usually true, but has exceptions simpler, more compact, and understandable. On the other hand, it is better said: "On the other hand, an admissible rule is a rule that cannot be applied to some cases, even if these cases satisfy its conditions, because some knowledge in another place of the knowledge base blocks it from application."

This is an intriguing concept that I have not found in other books.

+2
source

Source: https://habr.com/ru/post/909712/


All Articles