Section 16.4
High Level Programming
16.4 Logic Programming
Expert systems and artificial intelligence (AI) systems often make use of logic
programming.
16.4.1 Expert Systems
These are computer programs that attempt to replicate the performance of a human
expert on some specialised reasoning task.
Expert systems have:
A Knowledge Base
E.g. A family tree.
As well as containing facts on who is male and female and who is a parent of
whom, the knowledge base also consists of rules.
An Inference Engine And A HCI
In ProLog this can be done by entering queries.
For example: Does Liz have a brother?
? - brother(X, Liz)
Output: X = Bob
Or: Who is Bob's grandchild?
? - Grandparent (Bob, who)
Output: who = Jim
16.4.2 Artificial Intelligence
All systems are concerned with knowledge. Declaritive programming languages
are a means of solving problems to do with knowledge.
The Turing Test is a functional test of AI.
Applications
- Expert Systems Control
- Problem Solving
- Decision Support Systems
- Pattern Recognition (E.g. Image Recognition)
16.4.3 Processing Natural Langauge
Syntax Rules
Both computer languages and natural languages have well defined syntax rules
which determine whether a statement is correct or not.
Vocabulary
Only programming languages have a small vocabulary.
Ambiguity
Statements in natural languagescan have more than one meaning.
ProLog has been used to process and translate natural lanaguages.
This is because it can parse the phrase-structure grammar.