0% found this document useful (0 votes)
54 views7 pages

Ai - Unit 3 - Study Resource

This document discusses logic programming and the PROLOG language. It provides explanations of logic programming, how knowledge is represented in clausal form, and how PROLOG differs from first-order logic in its representations. Examples are given of logic statements in first-order logic and their PROLOG equivalents.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views7 pages

Ai - Unit 3 - Study Resource

This document discusses logic programming and the PROLOG language. It provides explanations of logic programming, how knowledge is represented in clausal form, and how PROLOG differs from first-order logic in its representations. Examples are given of logic statements in first-order logic and their PROLOG equivalents.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

FUNDAMENTALS OF ARTIFICIAL INTELLIGENCE

UNIT 3

Assignment Question 1: Logic Programming Explanation - PROLOG logic


Programming Representation with Examples.
Logic Programming
Logic Programming is a method that computer scientists are using to try to allow
machines to do reasoning.
 In logic programming, logic is used to represent knowledge and inference
(application of logical rules to the knowledge base to evaluate and analyse
new information) is used to manipulate it.
 The logic used to represent knowledge in logic programming is called
Clausal form which is a subset of first-order predicate logic, which is well
understood and able to represent all computational problems. The
diagram below shows the essence of logic programming;

 Clauses in Clausal Form can be classified by the number of positive and


negative literals they contain;
 Logic programming, is helping businesses and organizations to be
productive through:
1. Natural language processing
2. Database management
3. Predictive analysis
PROLOG
There are multiple different logic programming languages. The most common
and popular logic programming language is PROLOG. Prolog, PROgramming in
LOGic, is a declarative programming language.
 PROLOG is particularly suitable for programs that involve symbolic or non-
numeric computation. This is the main reason to use Prolog as the
programming language in Artificial Intelligence, where symbol
manipulation and inference manipulation are the fundamental tasks.
 In Prolog, we need not mention the way how one problem can be solved,
we just need to mention what the problem is, so that Prolog automatically
solves it.
 Prolog was developed using first-order logic, also called predicate logic,
which allows for the use of variables rather than propositions.
 Prolog utilizes artificial intelligence (AI) to help form its conclusions and
can quickly process large amounts of data. Prolog can be run with or
without manual inputs, meaning in it can be programmed to run
automatically as part of data processing.
 On top of being the most popular logic programming language, PROLOG
can also interface with other programming languages such as Java and C.
PROLOG Logic Programming
 In PROLOG programming language, each logical statement is considered
as Horn Clause, which means the statement should contain at most one
positive literal, in the left side. Examples are P, ¬ Q, ¬P -> Q; in which there
is at most one positive literal in the left side of all three statement
representations. If there is more than one positive literal in a statement,
like P -> Q, it is converted into ¬P v Q.
 Going deep in to PROLOG representations, the logic statements doesn’t
look like the above represented First Order Logic; above represented are
only for understanding purposes. In PROLOG the symbols are changed to
different symbols as mentioned below; and the statement representation
is also different.

FIRST ORDER PROLOG


LOGIC
LOGIC LOGIC

and ∧ ,
or ∨ ;
if → :-
not ¬ not
Example PROLOG Representations
grandfather(X, Y) :- father(X, Z), parent(Z, Y)
Above statement says that for X to be the grandfather of Y, Z should be a parent
of Y and X should be father of Z.
Other PROLOG example statement representations compared to First Order
Logic representations is given in below table.
FOL PROLOG
Pet(x) :- Cat(x)
∀x: Cat(x) ∨ Dog(x) → Pet(x)
Pet(x) :- Dog(x)
Dog(x) :- Poodle(x)
∀x: Poodle (x) → Dog(x) ∧ Small (x)
Small(x) :- Poodle(x)
∀x: Pet(x) ∧ Small (x) → Apartmentpet(x) apartmentpet(x) :- Pet(x), Small(x)

Assignment Question 2: Forward Versus Backward Reasoning, explanation in


detail and comparison.
Web Reference Link:
https://rb.gy/lqxphl

Assignment Question 3: Explanation about Script Concept in AI with concerned


Example Script
Web Reference Link:
https://rb.gy/ccx0fv
OTHER QUESTIONS FROM QUESTION BANK
1. Explain in detail and differentiate Procedural and Declarative Knowledge
scenarios.
Web Reference Link:
https://rb.gy/nqvbcp
2. Explain in detail Control Knowledge.
Control knowledge is introduced with the aim of simplifying the search process.
The control knowledge is responsible for several activities, as mentioned below,
during the flow of search process;
 Which states are more preferable to others.
 Which rule to apply in given situation.
 The order in which to pursue subgoals.
 Choosing Useful sequences of rules to apply.
Control knowledge can also be termed as Search Control Knowledge. For every
AI based system, this Search Control Knowledge is built in form of rules, which
are labelled and portioned for easy of application. For example, a medical
diagnosis system might have one set of rules for reasoning about bacteriological
diseases and another set of rules for reasoning about immunological diseases.
Another method also exists, in which Cost and Success Probability is assigned to
rules. Then problem solver can easily choose the appropriate rule he required.
This is called the representation of knowledge about knowledge which is called
as Meta Knowledge.
Two issues concerning control knowledge rules
 The first issue is called the Utility Problem. As we add more and more
control knowledge rules to a system, the system is able to search more
judiciously, which might be incorrect in some social situations, where only
a human brain can decide.
 Second is the Complexity Problem. If there are many control rules, simply
matching them all can be very time consuming.
3. What is Slot and Filler in AI?
Slot is an attribute value pair in its simplest form. Filler is a value that a slot can
take could be a numeric, string value or a pointer to another slot. The knowledge
in slot and filler systems consists of structures as a set of entities and their
attributes. Slot and Filler is classified in to two types;
Weak Slot and Filler
 Weak slot and filler structures enables attribute values to be retrieved
quickly and also properties of relations are easy to describe.
 Here the data/knowledge is represented by two data structures named
as; Frames and Semantic Nets.
Strong Slot and Filler
 Strong slot and filler structures typically represent links between objects
according to more rigid rules, specific notions of what types of object and
relations between them are provided.
 Here the data/knowledge is represented by data structure named as,
Scripts and Procedure named as Conceptual Dependency.
Both Weak and Strong Slot and Filler structures has their own advantages and
disadvantages, which can be used in different situations based on the
application. Strong Slot and Filler structures, are ideal to represent knowledge
about common situations than weak slot and filler structure. On other hand
weak slot and filler structure is ideal to represent simple relational data. Hence
by using slot and filler structure is used to represent the knowledge.
4. Explain the concept of Semantic Nets with appropriate example.
 A semantic network is a graphic notation for representing knowledge in
patterns of interconnected nodes. Semantic Nets act as another
alternative for predicate logic in a form of knowledge representation.
 The structural idea of Semantic Nets is that knowledge can be stored in
the form of graphs, with nodes representing objects in the world, and arcs
representing relationships between those objects.
 Semantic nets consist of nodes, links and link labels. Nodes appear in form
of circles or ellipses or even rectangles which represents objects such as
physical objects, concepts or situations. Links appear as arrows to express
the relationships between objects, and link labels specify relations.
 Semantic Networks Are Majorly Used for Representing data & Revealing
structure (relations, proximity, relative importance).
 Semantic nets are also referred to as associative nets as the nodes are
associated with other nodes.
Semantic Nets - Example 1

Above is the Semantic Net representation of a object CAR. We can observe the
labelled nodes, which are labelled as, HAS & IS-A, representing the relation
between the object and attribute.
Semantic Nets - Example 2

Above is the Semantic Net representation of a object MAMMAL. We can observe


the labelled nodes, which are labelled as, HAS & IS-A, IS-AN, LIVES IN
representing the relation between the object and attribute.
5. What is Conceptual Dependency?
Web Reference Link:
https://rb.gy/m7etjw
6. What is Matching in AI?
Matching is the process to extract the required rule, which helps us to reach the
goal quickly, from the entire collection of rules that can be applied at a given
point. This requires some kind of Matching between current state and the
precondition of the rules.
INDEXING MATCHING
 One way to select applicable rules/matching is to do a simple search
through all the rules, comparing each one’s preconditions to the current
state and extracting all the ones that match. But the problem with this
Indexing form of matching is; In some situations, it will be necessary to
use a large number of rules, then scanning through all of them at every
step of the search would be hopelessly inefficient. I.e., large number of
rules is directly proportional to slow processing.
APPROXIMATE MATCHING
 In this style of matching process, rules can be chosen and applied if their
preconditions approximately match the current situation.
 This is often the case in situations involving physical descriptions of the
world. For example, a speech- understanding program must contain rules
that map from a description of a physical waveform. There will be so much
variability in the physical signal, as a result of background noise,
differences in the way individuals speak, and so forth, that one can hope
to find only an approximate match between the rule that describes an
ideal sound and the input that describes an unideal world.
 Approximate matching is particularly difficult to deal with because as we
increase the tolerance allowed in the match, we also increase the number
of rules that will match, thus increasing the size of the main search
process.
 But approximate matching is nevertheless superior to exact matching in
situations such as speech understanding.
END

You might also like