puncrazy
puncrazy

Reputation: 349

How prolog work as intellegent language?

I have written set of rules in prolog, if rule matches particular action occurs. something like:

rule_second_question(X, Y, X, W):-
    (
        LINK_BASE == 'G',
        is_verb_form(X),
        aggregate_all(X, linkage(W, _, _, _, _, _, _, _, _, 'RS'), Y),
        writeln(Y),
        Count == 1,
        SUBJECT = X,
        nb_linkval(rule, 'twol')
    )

I could write similar rules in python, c++ also with if , else.

My program is about linguistic. I don't understand how prolog can make difference compare to other programming language.

Any help of example would be much appreciable.

Upvotes: 3

Views: 237

Answers (1)

CapelliC
CapelliC

Reputation: 60034

Prolog power derives from logical variables, coupled with an embedded search algorithm, and expressive and uniform data structuring facilities.

It implements a relational data model, but on a more structured values domain than SQL. In a sense, I think of it as the antesignan 'No SQL' language.

So we can code - with care - relations among complex data structures, like those that in early NLP research were deemed required.

Some easy to implement syntax sugar (so called DGC - Definite Clause Grammars), then let you write executable ASTs. If you think the language is (more or less) as old as C, you can appreciate its charme.

Then, NLP research was attracted by a more immediately productive paradigm: statistical parsing. Prolog, which is not oriented to arithmetic, loose its fashion.

See project Attempto for a valuable resource implemented in Prolog.

Also, my preferred book about Prolog, by Pereira-Shieber, is freely available. It introduces Prolog by means of NLP.

Upvotes: 3

Related Questions