Professional Documents
Culture Documents
what is prolog
The general idea behind declarative languages is that you describe a situation.
Based on this code, the interpreter or compiler will tell you a solution. In the
case of prolog, it will tell you whether a prolog sentence is true or not and, if
it contains variables, what the values of the variables need to be.
FEATURES
The main characteristics/notions of the Visual Prolog programming language are:
Prolog is a rich collection of data structures in the language and human reasoning,
and a powerful notation for encoding end-user applications. It has its logical and
declarative aspects, interpretive natur, compactness, and inherent modularity.
ADVANTAGES
Logic based languages are able to represent the real world more accurately.
Prolog is able to derive new rules from the existing rules contained within the
knowledge base.
DISADVANTAGES
USES
The language has been used for theorem proving,[8] expert systems,[9] term
rewriting,[10] type inference,[11] and automated planning,[12] as well as its
original intended field of use, natural language processing.[13][14] Modern Prolog
environments support the creation of graphical user interfaces, as well as
administrative and networked applications.
Prolog is well-suited for specific tasks that benefit from rule-based logical
queries such as searching databases, voice control systems, and filling templates
Prolog is still being used nowadays in various industrial, medical & commercial
areas to:
build expert systems that solve complex problems without the help of humans
(e.g. automatically planning, monitoring, controlling and troubleshooting complex
systems)
build decision support systems that aid organizations in decision-making (e.g.
decision systems for medical diagnoses)
online support service for customers, etc.
SYNTAX
The User inputs a series of predicates that have three different meanings - facts
to be stored, goals to be searched for(queries), or commands(directives) which do
one thing. There is also a special kind of rule called a clause which defines
conditions underwhich a fact can be true.
facts
Facts are used to state things that are unconditionally true of some situation of
interest. For example, we can state that Mia, Jody, and Yolanda are women,
woman(mia).
woman(jody).
woman(yolanda).
Rules
happy(yolanda).
listens2Music(mia).
listens2Music(yolanda):- happy(yolanda).
playsAirGuitar(mia):- listens2Music(mia).
playsAirGuitar(yolanda):- listens2Music(yolanda).
There are two facts in KB2, listens2Music(mia) and happy(yolanda) . The last three
items it contains are rules.