![]() |
![]() |
#1 (permalink) |
Insane
Location: Wales, UK, Europe, Earth, Milky Way, Universe
|
[Prolog] What is it?
Well, i know i'm going to be learning Prolog sometime next year and i know its some kind of logic programming. I wanted to get a head start so i've downloaded SWI-Prolog but now i just need to know a few things:
- What is prolog used for? - Is it a script type of language or can you make executable files with it? - Any code/implementation examples would be great. I can't seem to find any "Prolog for dummies" kind of web pages around and i really just need a push to get me started past the newbie basics. Cheers ![]()
__________________
There are only two industries that refer to their customers as "users". - Edward Tufte |
![]() |
![]() |
#2 (permalink) |
Sky Piercer
Location: Ireland
|
I too have just started learning prolog.
It is...um....different. ![]() You don't type a sequence of instructions telling the program what to do, instead you give it a list of facts and rules. Prolog is apparently very useful for natural language processing, it has built in features to implement grammars for formal languages. I have been recommended this page, I haven't really gone through it yet, but it looks pretty helpful. Learn Prolog Now.
__________________
![]() |
![]() |
![]() |
#4 (permalink) | |||
Insane
|
Ditto what CSFilm said. Prolog basically queries databases and attempts to match rules (known as predicates). One powerful aspect of it is that it backtracks if there are multiple matches to rules; this makes it possible to implement things concisely, albeit ineffeciently. For example, one could have a sort predicate that just generates a permutation of the list to be sorted, checks if it's sorted, and repeats the process until it is, due to backtracking.
A good example of Prolog's functionality can be illustrated in an append predicate. If we have the code Quote:
Quote:
Quote:
Here is one tutorial that looks helpful. |
|||
![]() |
![]() |
#5 (permalink) |
Insane
Location: Wales, UK, Europe, Earth, Milky Way, Universe
|
Thanks to you too Anomaly_ for the examples and opinions
![]() ![]()
__________________
There are only two industries that refer to their customers as "users". - Edward Tufte |
![]() |
Tags |
prolog |
|
|