You are on page 1of 73

10/1/2022

Introduction to AI
Unit 1

There are myths of Mechanical men in Ancient Greek and Egyptian


Myths!!

Topics
● History, Definition of AI
● Emulation of human cognitive process
● Semantic nets
● An abstract view of modeling
● Elementary knowledge
● Computational logic
● Analysis of compound statements using simple logic
connectives
● Predicate logic
● Simple exercises

1
10/1/2022

https://www.javatpoint.com/history-of-
artificial-intelligence

Maturation of Artificial Intelligence (1943-1952)


● Year 1943: The first work which is now recognized as AI was done by Warren
McCulloch and Walter pits in 1943. They proposed a model of artificial
neurons.
● Year 1949: Donald Hebb demonstrated an updating rule for modifying the
connection strength between neurons. His rule is now called Hebbian
learning.
● Year 1950: The Alan Turing who was an English mathematician and
pioneered Machine learning in 1950. Alan Turing publishes "Computing
Machinery and Intelligence" in which he proposed a test. The test can check
the machine's ability to exhibit intelligent behavior equivalent to human
intelligence, called a Turing test.

2
10/1/2022

Turing Test
Alan Turing, in a 1951 paper
entitled “Computing Machinery
and Intelligence”, proposed a test
called the “Turing Test” or “The
Imitation Game”

https://science.jrank.org/programming/Turing_Test.html

The birth of Artificial Intelligence (1952-1956)


● Year 1955: Allen Newell and Herbert A. Simon created the "first artificial
intelligence program which was named as "Logic Theorist". This program had
proved 38 of 52 Mathematics theorems, and find new and more elegant
proofs for some theorems.
● Year 1956: The word "Artificial Intelligence" first adopted by American
Computer scientist John McCarthy at the Dartmouth Conference. For the first
time, AI coined as an academic field.

At that time high-level computer languages such as FORTRAN, LISP, or COBOL


were invented. And the enthusiasm for AI was very high at that time.

3
10/1/2022

4
10/1/2022

The golden years-Early enthusiasm (1956-1974)


● Year 1966: The
researchers emphasized
developing algorithms
which can solve
mathematical problems.
Joseph Weizenbaum
created the first chatbot in
1966, which was named
as ELIZA.
● Year 1972: The first
intelligent humanoid robot
was built in Japan which https://achievements.ai/timeline/joseph-weizenbaum-created-eliza/
was named as WABOT-1.

5
10/1/2022

https://www.researchgate.net/publication/316184347_Evaluating_Quality_of_C
hatbots_and_Intelligent_Conversational_Agents/figures?lo=1

Wabot 1 & 2

6
10/1/2022

The first AI winter (1974-1980)

The duration between years 1974 to 1980 was the first AI winter duration. AI
winter refers to the time period where computer scientist dealt with a severe
shortage of funding from government for AI researches.

During AI winters, an interest of publicity on artificial intelligence was decreased.

A boom of AI (1980-1987)

● Year 1980: After AI winter duration, AI came back with "Expert System".
Expert systems were programmed that emulate the decision-making ability of
a human expert.
● In the Year 1980, the first national conference of the American Association of
Artificial Intelligence was held at Stanford University.

https://www.javatpoint.com/history-of-artificial-intelligence

7
10/1/2022

The second AI winter (1987-1993)

● The duration between the years 1987 to 1993 was the second AI Winter
duration.
● Again Investors and government stopped in funding for AI research as due to
high cost but not efficient result. The expert system such as XCON was very
cost effective.

The emergence of intelligent agents (1993-2011)

● Year 1997: In the year 1997, IBM Deep Blue beats world chess champion,
Gary Kasparov, and became the first computer to beat a world chess
champion.
● Year 2002: for the first time, AI entered the home in the form of Roomba, a
vacuum cleaner.
● Year 2006: AI came in the Business world till the year 2006. Companies like
Facebook, Twitter, and Netflix also started using AI.

8
10/1/2022

IBM’s Deep Blue computer that beat Gary Kasparov.


(Photo Credit : Pedro Villavicencio / Flickr)

https://www.sportshistoryweekly.com/stories/chess-deep-blue-
ibm-gary-kasparov-grandmaster-deep-thought,837

Roomba is a series of autonomous robotic


vacuum cleaners sold by iRobot. Introduced in
September 2002, they have a set of sensors that
enable them to navigate the floor area of a home.
These sensors can detect the presence of
obstacles, particularly dirty spots on the floor, and
steep drops (e.g., to avoid falling down stairs).
As of 2021, iRobot markets models of their
600, i3, j7, and s9 series, while continuing to
provide support and sell accessories for their
previous series. Various models have different
features, including tangle-free brushes, separate
sweep canisters, more powerful vacuums, obstacle
avoidance, and performance maps displayed via
smartphone apps. Newer high-end models also
have a camera, which works in conjunction with
onboard mapping and navigation software to
systematically cover all floor area, move from room
https://en.wikipedia.org/wiki/Roomba to room, and find recharging bases and beacons.

9
10/1/2022

Deep learning, big data and artificial general intelligence


(2011-present)
● Year 2011: In the year 2011, IBM's Watson won jeopardy, a quiz show, where
it had to solve the complex questions as well as riddles. Watson had proved
that it could understand natural language and can solve tricky questions
quickly.
● Year 2012: Google has launched an Android app feature "Google now", which
was able to provide information to the user as a prediction.
● Year 2014: In the year 2014, Chatbot "Eugene Goostman" won a competition
in the infamous "Turing test." [https://en.wikipedia.org/wiki/Eugene_Goostman]

https://yakbots.com/what-is-the-eugene-goostman-chatbot/

10
10/1/2022

Deep learning, big data and artificial general intelligence


(2011-present)
● Google has demonstrated an AI program "Duplex" which was a virtual
assistant and which had taken hairdresser appointment on call, and lady on
other side didn't notice that she was talking with the machine.

Now AI has developed to a remarkable level. The concept of Deep learning,


big data, and data science are now trending like a boom. Nowadays companies
like Google, Facebook, IBM, and Amazon are working with AI and creating
amazing devices. The future of Artificial Intelligence is inspiring and will come
with high intelligence.

Google Assistant, Lens, Cloud TPU

11
10/1/2022

Homo sapiens -
wise or astute
human

12
10/1/2022

"It is a branch of computer science by which we can create


intelligent machines which can behave like a human, think like
humans, and able to make decisions."
Artificial Intelligence is composed of two words Artificial and
Intelligence, where Artificial defines "man-made," and
intelligence defines "thinking power", hence AI means "a man-
made thinking power."

AI - Definition

AI - Definition and Understanding


This image cannot currently be display ed.
Artificial-Intelligence-A-Modern-Approach-3rd-Edition NORVIG

● AI is a field of
study that seeks to
explain and
emulate intelligent
behaviour in terms
of a computational
process

● It is a cross
discipline of
Cognitive science,
Computer science,
Engineering and
Mathematics

13
10/1/2022

What is AI?

1. Cognitive Science: includes philosophy, linguistics and


psychology
2. Computer science: algorithms, programs and databases
that exhibit intelligent behaviour.
– Also called machine intelligence.
– Includes representation and manipulation

Neurons
Neurons (also called neurones or
nerve cells) are the fundamental
units of the brain and nervous
system, the cells responsible for
1. receiving sensory input from
the external world,
2. for sending motor commands
to our muscles, and
3. for transforming and relaying
the electrical signals at every
step in between.

An artificial neuron is a
mathematical function conceived
Source: https://en.wikipedia.org/wiki/Neuron
as a model of biological neurons

14
10/1/2022

Emulation

Emulating Human Cognitive Process


William James, psychologist in 1890 states that “Thought works under strange
conditions”
● Designed to facilitate the survival of the overall system
● The human brain is only as well developed as it needs to be
● Mental concepts need to be studied in the context or environment in which
they occur.

Discrimination and Association


● Breaking down and building up concepts , since it is a consequence of nature
and man’s reasoning and survival ability evolving together.
● It suggests time –varying pattern of thoughts
● Also based on experience and intuition: a clever way of problem solving.

15
10/1/2022

3 questions to be answered in building AI

1. What is knowledge?
2. How can it be represented?
3. How can it / should it be manipulated?

Why is AI difficult?
1. How closely should human intelligence paradigms be simulated?
2. Humans use iconic images of concepts, record visuals and can recall such
images from sentences.
3. Difference between data and knowledge.
4. Need of algorithms that describe reasoning
5. Difficulty in ‘quantifying’ human intelligence since humans use vague
knowledge forms, analogy, common sense or even ‘intuition’.
6. AI can use recursion and search techniques only
7. Use of heuristics (based on experience; a heuristic is a technique designed for
solving a problem more quickly when classic methods are too slow, or for
finding an approximate solution - when classic methods fail to find any exact
solution).

16
10/1/2022

https://www.youtube.com/watch?v=nRMLTHDAVqc

Semantic Networks

Semantics: the study of the meanings of words and phrases.

● Form of knowledge representation


● Predicate logic alternative
● Labelled directed graph
● Components:
○ Nodes – object or concept
○ Links – relation between nodes.

17
10/1/2022

Semantic Networks
A semantic network, or frame network is a knowledge base that represents semantic relations
between concepts in a network. This is often used as a form of knowledge representation. It is a
directed or undirected graph consisting of vertices, which represent concepts, and edges, which
represent semantic relations between concepts, mapping or connecting semantic fields.
A semantic network may be instantiated as, for example, a graph database or a concept map.
Typical standardized semantic networks are expressed as semantic triples.
Semantic networks are used in natural language processing applications such as semantic parsing
and word-sense disambiguation.
Semantic networks can also be used as a method to analyze large texts and identify the main
themes and topics (e.g., of social media posts), to reveal biases (e.g., in news coverage), or even
to map an entire research field.

https://en.wikipedia.org/wiki/Semantic_network

A semantic network
● a classic AI representation
Semantic Networks technique used for propositional
information
● a propositional net
A proposition is a statement that is either
true or false
● A semantic net is a labeled, directed
graph.
● The structure of a semantic net is
shown graphically in terms of nodes
and the arcs connecting them.
○ Nodes are sometimes referred
to as objects
○ Arcs as links or edges
○ The links are used to express
relationships
○ Nodes are to represent physical
objects, concepts, or situation

18
10/1/2022

Semantic Networks

Types of Semantic Networks


The oldest known semantic network was drawn in
the 3rd century AD by the Greek philosopher

1. Definitional Networks Porphyry in his commentary on Aristotle’s


categories.

2. Assertion Networks Porphyry used it to illustrate Aristotle’s method of

3. Implicational Network defining categories by specifying the genus or


general type and the differentiae that distinguish

4. Executable Network different subtypes of the same supertype.

5. Learning Network Figure 1 (next slide) shows a version of the Tree


of Porphyry, as it was drawn by the logician Peter

6. Hybrid Network of Spain (1239). It illustrates the categories under


Substance, which is called the supreme genus or
the most general category.

Compulsory Reading”
http://www.jfsowa.com/pubs/semnet.htm

19
10/1/2022

1. Definitional Networks
● These networks emphasises
and deals with only the
subtype or is a relation
between a concept type and a
newly defined subtype.
● A producing network is
referred to as generalization
hierarchy.
● It supports the inheritance
rule for duplicating
attributes.

2. Assertion Networks
● Designed to assert propositions
is intended to state
recommendations.
● Mostly data in an assertion
network is genuine unless it is
marked with a modal
administrator.
● Some assertion systems are even
considered as the model of the
reasonable structures
underlying the characteristic
semantic natural languages.

20
10/1/2022

3. Implicational Networks Someone walking across a lawn slips on the grass.


Figure represents the kind of background knowledge
that the victim might use to reason about the cause.
An implicational network is a special case
of a propositional semantic network in
which the primary relation is implication.
Other relations may be nested inside the
propositional nodes, but they are ignored
by the inference procedures. Depending
on the interpretation, such networks may
be called belief networks, causal networks,
Bayesian networks, or truth-maintenance
systems. Sometimes the same graph can be
used with any or all of these
interpretations.

4. Executable Networks
Executable semantic networks contain mechanisms that can cause some change to the network
itself. The executable mechanisms distinguish them from networks that are static data
structures, which can only change through the action of programs external to the net itself.
Three kinds of mechanisms are commonly used with executable semantic networks:
1. Message passing networks can pass data from one node to another. For some networks, the
data may consist of a single bit, called a marker, token, or trigger; for others, it may be a
numeric weight or an arbitrarily large message.
2. Attached procedures are programs contained in or associated with a node that perform
some kind of action or computation on data at that node or some nearby node.
3. Graph transformations combine graphs, modify them, or break them into smaller graphs.
In typical theorem provers, such transformations are carried out by a program external to
the graphs. When they are triggered by the graphs themselves, they behave like chemical
reactions that combine molecules or break them apart.

21
10/1/2022

4. Executable Networks
The simplest networks with attached
procedures are dataflow graphs,
which contain passive nodes that
hold data and active nodes that take
data from input nodes and send
results to output nodes.

Figure shows a dataflow graph with


boxes for the passive nodes and
diamonds for the active nodes. The
labels on the boxes indicate the data
type (Number or String), and the
labels on the diamonds indicate the
name of the function (+, ×, or convert
string to number).

5. Learning Networks

A learning system, natural or artificial, responds to new information by modifying its internal
representations in a way that enables the system to respond more effectively to its environment.
Systems that use network representations can modify the networks in three ways:

1. Rote memory. The simplest form of learning is to convert the new information to a
network and add it without any further changes to the current network.
2. Changing weights. Some networks have numbers, called weights, associated with the nodes
and arcs. In an implicational network, for example, those weights might represent
probabilities. Each occurrence of some pattern would increase the estimated probability of
its recurrence.
3. Restructuring. The most complex form of learning makes fundamental changes to the
structure of the network itself. Since the number and kinds of structural changes are
unlimited, the study and classification of restructuring methods is the most difficult, but
potentially the most rewarding.

22
10/1/2022

5. Learning Networks
Commercially, rote memory is of enormous importance, since the world economy depends on
exact record keeping.

For such applications, information is sometimes stored in tables, as in relational databases. But the
Semantic Web and related methods are more flexible for information that is not as rigidly
structured as a table. However, any information represented in one can be converted to the other.
For better efficiency and usability, most database systems add indexes to speed up the search, and
they support query languages, such as SQL, which perform transformations to extract and
combine the information necessary to answer a request.

Since a learning system must be able to distinguish common features and exceptions among
similar examples, another feature is essential: the ability to measure similarity and to search the
database for networks that are similar, but not identical to any given example.

5. Learning Networks
Neural nets are a widely-used
technique for learning by
changing the weights assigned
to the nodes or arcs of a
network.
In his study of learning,
Thorndike (1932) developed a
stimulus-response theory,
which he called connectionism:
rewards strengthen the S-R
connections, and punishments
weaken them.

23
10/1/2022

6. Hybrid Networks

Complex systems are usually hybrids.

A typical example is a combination of HTML for the user interface, a database


system for storing data, and a programming language for detailed computation.

Most applications of the Semantic Web are hybrids that combine several
methods.

An example is BabelNet (Navigli & Ponzetto, 2012), which combines techniques


for semantic networks, machine translation, and the Semantic Web to learn from
and reason with information in the multiple languages of Wikipedia.

Semantic Networks
of blocks on a table

24
10/1/2022

Semantic Network of a car

Construct a semantic network from the following.

25
10/1/2022

Semantic relationships
Semantic relationships are the associations that there exist between the
meanings of words (semantic relationships at word level), between the
meanings of phrases, or between the meanings of sentences (semantic
relationships at phrase or sentence level).
At word level, the study semantic relationships are:
1. synonymy,
2. antonymy,
3. homonymy,
4. polysemy and
5. metonymy.

Semantic relationships
Synonymy is the semantic relationship that exists between two (or more) words
that have the same (or nearly the same) meaning and belong to the same part of
speech, but are spelled differently.

Antonymy is the semantic relationship that exists between two (or more) words
that have opposite meanings.
Homonymy is the relationship that exits between two (or more) words which
belong to the same grammatical category, have the same spelling, may or may not
have the same pronunciation, but have different meanings and origins (i.e., they
are etymologically and semantically unrelated). E.g., to lie (= to rest, be, remain, be
situated in a certain position) and to lie (= not to tell the truth).

26
10/1/2022

Semantic relationships
Hyponymy or inclusion is the semantic relationship that exists between two (or
more) words in such a way that the meaning of one word includes (or contains)
the meaning of other words(s). The term whose meaning is included in the
meaning of the other term(s) is the general term. They are superordinate or
hypernym. The term whose meaning includes the meaning of the other term is the
specific term; linguists usually refer to it as a hyponym.
Superordinate: - vehicle

Hyponyms - bus - car - lorry - van (bus - car - lorry - van are co-hyponyms).

Semantic relationships
Polysemy is the semantic relationship that exists between a word and its multiple
conceptually and historically related meanings.

foot = 1. part of body; 2. lower part of something


plain = 1. clear; 2. unadorned; 3. obvious.
Metonymy is the semantic relationship that exists between two words (or a word
and an expression) in which one of the words is metaphorically used in place of
the other word (or expression) in particular contexts to convey the same meaning.

brass = military officers; jock = athlete; cops = policemen

27
10/1/2022

Advantages

Disadvantages

28
10/1/2022

Conceptual Graphs ★ A system of logic based on the existential


graphs of Charles Sanders Peirce and the
semantic networks of artificial intelligence.
★ A graphic system of logic that has roots in
philosophy, linguistics and artificial
intelligence. In expressive power, the graphs
are equivalent to predicate calculus; however,
in structure, they have a closer affinity to the
semantic forms underlying natural language.
★ Their graphic form and their relationship to
language makes them more readable than
predicate calculus. With their readability and
their semantic structure, they can clarify many
problems in linguistics and knowledge
representation, and help to make them more
tractable for both humans and computers.

Conceptual Graphs
★ Their purpose is to express meaning in a form that is logically precise,
humanly readable, and computationally tractable.
★ A formalism for knowledge representation.

Who does what to


whom?

29
10/1/2022

Abstract Modeling

1. A modelling space M - capture the relevant aspects of a class of objects.


2. Representations R: symbolic structures that obey rules
3. Representation Scheme S: Gives the relationship b/w M & R
4. Domain D: A sub-set of M

Characteristics:

1. Valid
2. Unambiguous
3. Unique
4. Consistent - in case of more than 1 element

Abstract Modeling

S1 (m) = r1

S2 (m) = r2

30
10/1/2022

Knowledge Representation
● Knowledge representation and reasoning (KR, KRR) is the part of Artificial
intelligence which concerned with AI agents thinking and how thinking
contributes to intelligent behavior of agents.
● It is responsible for representing information about the real world so that a
computer can understand and can utilize this knowledge to solve the complex
real world problems such as diagnosis a medical condition or communicating
with humans in natural language.
● It is also a way which describes how we can represent knowledge in artificial
intelligence. Knowledge representation is not just storing data into some
database, but it also enables an intelligent machine to learn from that
knowledge and experiences so that it can behave intelligently like a human.

KR - What is represented?
1. Object: All the facts about objects in our world domain. E.g., Guitars contains
strings, trumpets are brass instruments.
2. Events: Events are the actions which occur in our world.
3. Performance: It describe behavior which involves knowledge about how to do
things.
4. Meta-knowledge: It is knowledge about what we know.
5. Facts: Facts are the truths about the real world and what we represent.
6. Knowledge-Base: The central component of the knowledge-based agents is
the knowledge base. It is represented as KB. The Knowledgebase is a group
of the Sentences (Here, sentences are used as a technical term and not
identical with the English language).

31
10/1/2022

Knowledge - Types
Knowledge: Knowledge is
awareness or familiarity gained
by experiences of facts, data, and
situations.

Following are the types of


knowledge in artificial
intelligence:

Types of Knowledge
1. Declarative Knowledge:

● Declarative knowledge is to know about something.


● It includes concepts, facts, and objects.
● It is also called descriptive knowledge and expressed in declarative sentences.
● It is simpler than procedural language.
2. Procedural Knowledge

● It is also known as imperative knowledge.


● Procedural knowledge is a type of knowledge which is responsible for knowing
how to do something.
● It can be directly applied to any task.
● It includes rules, strategies, procedures, agendas, etc.
● Procedural knowledge depends on the task on which it can be applied.

32
10/1/2022

Types of Knowledge
3. Meta-knowledge:
● Knowledge about the other types of knowledge is called Meta-knowledge.
4. Heuristic knowledge:
● Heuristic knowledge is representing knowledge of some experts in a field or
subject.
● Heuristic knowledge is rules of thumb based on previous experiences,
awareness of approaches, and which are good to work but not guaranteed.
5. Structural knowledge:

● Structural knowledge is basic knowledge to problem-solving.


● It describes relationships between various concepts such as kind of, part of,
and grouping of something.
● It describes the relationship that exists between concepts or objects.

Relation between knowledge and intelligence:

● There is one decision


maker which act by
sensing the
environment and using
knowledge.
● But if the knowledge
part will not present
then, it cannot display
intelligent behavior.

33
10/1/2022

AI knowledge cycle:

An Artificial intelligence
system has the following
components for displaying
intelligent behavior:

● Perception
● Learning
● Knowledge
Representation and
Reasoning
● Planning
● Execution

Four approaches to knowledge representation

1. Simple relational knowledge


2. Inheritable Knowledge
3. Inferential Knowledge
4. Procedural Knowledge

34
10/1/2022

1. Simple relational knowledge


● It is the simplest way of
storing facts which uses the
relational method, and each
fact about a set of the object
is set out systematically in
columns.
● This approach of knowledge
representation is famous in
database systems where the
relationship between
different entities is
represented.
● This approach has little
opportunity for inference.

2. Inheritable knowledge
● In the inheritable knowledge approach, all data must be stored into a hierarchy
of classes.
● All classes should be arranged in a generalized form or a hierarchal manner.
● In this approach, we apply inheritance property.
● Elements inherit values from other members of a class.
● This approach contains inheritable knowledge which shows a relation between
instance and class, and it is called instance relation.
● Every individual frame can represent the collection of attributes and its value.
● In this approach, objects and values are represented in Boxed nodes. We use
Arrows which point from objects to their values.

35
10/1/2022

2. Inheritable knowledge

3. Inferential knowledge
● Inferential knowledge approach represents knowledge in the form of formal
logics.
● This approach can be used to derive more facts.
● It guaranteed correctness.
Example: Let's suppose there are two statements:
Marcus is a man
All men are mortal
Then it can represent as;
man(Marcus)
∀x = man (x) ----------> mortal (x)s

36
10/1/2022

4. Procedural knowledge:

Procedural knowledge approach uses small programs and codes which


describes how to do specific things, and how to proceed.
● In this approach, one important rule is used which is ‘If-then’ rule.
● In this knowledge, we can use various coding languages such as LISP
language and Prolog language.
● We can easily represent heuristic or domain-specific knowledge using this
approach.
● But it is not necessary that we can represent all cases in this approach.

Requirements for knowledge Representation system:


A good knowledge representation system must possess the following properties.
1. Representational Accuracy: KR system should have the ability to represent all
kind of required knowledge.
2. Inferential Adequacy: KR system should have ability to manipulate the
representational structures to produce new knowledge corresponding to existing
structure.
3. Inferential Efficiency: The ability to direct the inferential knowledge mechanism
into the most productive directions by storing appropriate guides.
4. Acquisitional efficiency- The ability to acquire the new knowledge easily using
automatic methods.

37
10/1/2022

Techniques of knowledge representation

There are mainly four ways of


knowledge representation which are
given as follows:

1. Logical Representation
2. Semantic Network Representation
3. Frame Representation
4. Production Rules

1. Logical Representation

● Logical representation is a language with some concrete rules which deals


with propositions and has no ambiguity in representation.
● Logical representation means drawing a conclusion based on various
conditions.
● This representation lays down some important communication rules. It
consists of precisely defined syntax and semantics which supports the sound
inference.
● Each sentence can be translated into logics using syntax and semantics.

38
10/1/2022

1. Logical Representation

Syntax:

● Syntaxes are the rules which decide how we can construct legal sentences in
the logic.
● It determines which symbol we can use in knowledge representation.
● How to write those symbols.
Semantics:

● Semantics are the rules by which we can interpret the sentence in the logic.
● Semantic also involves assigning a meaning to each sentence.

1. Logical Representation - Types, Adv & Disadv


Logical representation can be categorised into mainly two logics:

a. Propositional Logics
b. Predicate logic
Advantages of logical representation:

1. Logical representation enables us to do logical reasoning.


2. Logical representation is the basis for the programming languages.
Disadvantages of logical Representation:
1. Logical representations have some restrictions and are challenging to work with.
2. Logical representation technique may not be very natural, and inference may not
be so efficient.

39
10/1/2022

Slides 35- 37 followed by adv and disadv.

2. Semantic Network Representation- Advantages

1. Semantic networks are a natural representation of knowledge.


2. Semantic networks convey meaning in a transparent manner.
3. These networks are simple and easily understandable.

2. Semantic Network Representation - Disadvantages

1. Semantic networks take more computational time at runtime as we need


to traverse the complete network tree to answer some questions. It
might be possible in the worst case scenario that after traversing the
entire tree, we find that the solution does not exist in this network.
2. Semantic networks try to model human-like memory (Which has 1015
neurons and links) to store the information, but in practice, it is not
possible to build such a vast semantic network.
3. These types of representations are inadequate as they do not have any
equivalent quantifier, e.g., for all, for some, none, etc.
4. Semantic networks do not have any standard definition for the link
names.
5. These networks are not intelligent and depend on the creator of the
system.

40
10/1/2022

3. Frame Representation
A frame is a record like structure which consists of a collection of attributes and
its values to describe an entity in the world.

Frames are the AI data structure which divides knowledge into substructures by
representing stereotypes situations.

It consists of a collection of slots and slot values.

These slots may be of any type and sizes.

Slots have names and values which are called facets.

3. Frame Representation - Example 1

41
10/1/2022

3. Frame Representation
● The various aspects of a slot is known as Facets.
● Facets are features of frames which enable us to put constraints on the
frames.
● Example: IF-NEEDED facts are called when data of any particular slot is
needed.
● A frame may consist of any number of slots, and a slot may include any
number of facets and facets may have any number of values.
● A frame is also known as slot-filter knowledge representation in artificial
intelligence.

3. Frame Representation
● Frames are derived from semantic networks and later evolved into our
modern-day classes and objects.
● A single frame is not much useful.
● Frames system consist of a collection of frames which are connected. In
the frame, knowledge about an object or event can be stored together in the
knowledge base.
● The frame is a type of technology which is widely used in various
applications including Natural language processing and machine visions.

42
10/1/2022

3. Frame Representation - Example 2

3. Frame Representation - Adv & Disadv


Advantages:
1. The frame knowledge representation makes the programming easier by
grouping the related data.
2. The frame representation is comparably flexible and used by many
applications in AI.
3. It is very easy to add slots for new attribute and relations.
4. It is easy to include default data and to search for missing values.
5. Frame representation is easy to understand and visualize.
Disadvantages:

1. In frame system inference mechanism is not be easily processed.


2. Inference mechanism cannot be smoothly proceeded by frame representation.
3. Frame representation has a much generalized approach.

43
10/1/2022

4. Production Rules
Production rules system consist of (condition, action) pairs which mean, "If condition
then action".
It has mainly three parts:
1. The set of production rules
2. Working Memory
3. The recognize-act-cycle
Example:

● IF (at bus stop AND bus arrives) THEN action (get into the bus)
● IF (on the bus AND paid AND empty seat) THEN action (sit down).
● IF (on bus AND unpaid) THEN action (pay charges).
● IF (bus arrives at destination) THEN action (get down from the bus).

4. Production Rules
● In production rules agent checks for the condition and if the condition exists then
production rule fires and corresponding action is carried out. The condition part
of the rule determines which rule may be applied to a problem. And the action
part carries out the associated problem-solving steps. This complete process is
called a recognize-act cycle.
● The working memory contains the description of the current state of problems-
solving and rule can write knowledge to the working memory. This knowledge
match and may fire other rules.
● If there is a new situation (state) generates, then multiple production rules will be
fired together, this is called conflict set. In this situation, the agent needs to select
a rule from these sets, and it is called a conflict resolution.

44
10/1/2022

4. Production Rules
Advantages of Production rule:

1. The production rules are expressed in natural language.


2. The production rules are highly modular, so we can easily remove, add or
modify an individual rule.
Disadvantages of Production rule:

1. Production rule system does not exhibit any learning capabilities, as it does
not store the result of the problem for the future uses.
2. During the execution of the program, many rules may be active hence rule-
based production systems are inefficient.

Propositional logic in Artificial


intelligence
https://www.javatpoint.com/propositional-logic-in-artificial-
intelligence

45
10/1/2022

Propositional logic in Artificial intelligence


Logic can be used to express statements, to validly infer additional statements, and to
rigorously prove (or disprove) statements. At first glance, it appears that if the
concepts of reasoning and intelligent behavior could be formalized using
mathematical logic, AI implementation would be straightforward.

Unfortunately, this is not the case. The application of logic in AI systems development
is actually quite controversial.

Critics of logic point out that

• Humans do not always reason by making logical inferences.

• Logic is too rigorous, and inflexible, to be of use in all AI problem domains.

Propositional logic in Artificial intelligence


● Propositional logic (PL) is the simplest form of logic where all the statements
are made by propositions.
● A proposition is a declarative statement which is either true or false.
● It is a technique of knowledge representation in logical and mathematical form.
Example:
a) It is Sunday.
b) The Sun rises from West (False proposition)
c) 3+3= 7(False proposition)
d) 5 is a prime number.

46
10/1/2022

Basic facts about propositional logic:


● Propositional logic is also called Boolean logic as it works on 0 and 1.
● In propositional logic, we use symbolic variables to represent the logic, and
we can use any symbol for a representing a proposition (the statement), such
A, B, C, P, Q, R, etc.
● Propositions can be either true or false, but it cannot be both.
● Propositional logic consists of an object, relations or function, and logical
connectives.These connectives are also called logical operators.
● The propositions and connectives are the basic elements of the propositional
logic.
● Connectives can be said as a logical operator which connects two sentences.

Basic facts about propositional logic:


● A proposition formula which is always true is called tautology, and
it is also called a valid sentence.

● A proposition formula which is always false is called


Contradiction.

● Statements which are questions, commands, or opinions are not


propositions such as "Where is Rohini?", "How are you?", "What is
your name?", “Close that door”are not propositions.

47
10/1/2022

Syntax of propositional logic


The syntax of propositional logic defines the allowable sentences for the
knowledge representation. There are two types of Propositions:
● Atomic Propositions
● Compound propositions

Atomic Proposition: Atomic propositions are the simple propositions. It


consists of a single proposition symbol. These are the sentences which
must be either true or false.

Example:
a) 2+2 is 4, it is an atomic proposition as it is a true fact.
b) "The Sun is cold" is also a proposition as it is a false fact.

Compound proposition
Compound propositions are constructed by combining simpler
or atomic propositions, using parentheses and logical
connectives.

Example:
a) "It is raining today, and street is wet."
b) "Ankit is a doctor, and his clinic is in Mumbai."

48
10/1/2022

Logical connectives
● Logical connectives are used to connect two simpler
propositions or representing a sentence logically.
● We can create compound propositions with the help of logical
connectives.
● There are mainly five connectives, which are given as follows:
a. Negation
b. Conjunction
c. Disjunction
d. Implication
e. Biconditional

Logical connectives

1. Negation: A sentence such as ¬ P is called negation of P. A literal can be


either Positive literal or negative literal.

1. Conjunction: A sentence which has ∧ connective such as, P ∧ Q is called a


conjunction.
Example: Rohan is intelligent and hardworking. It can be written as,
P= Rohan is intelligent,
Q= Rohan is hardworking. → P∧ Q.

49
10/1/2022

Logical connectives

3. Disjunction: A sentence which has ∨ connective, such as P ∨ Q. is


called disjunction, where P and Q are the propositions.
Example: "Ritika is a doctor or Engineer",
Here P= Ritika is Doctor. Q= Ritika is Doctor, so we can write it as P ∨ Q.
4. Implication: A sentence such as P → Q, is called an implication.
Implications are also known as if-then rules. It can be represented as
If it is raining, then the street is wet.
Let P= It is raining, and Q= Street is wet, so it is represented as P → Q

Logical connectives

5. Biconditional: A sentence such as P⇔ Q is a Biconditional sentence, example


If I am breathing, then I am alive
P= I am breathing, Q= I am alive, it can be represented as P ⇔ Q.

Summarized table for Propositional Logic Connectives:

50
10/1/2022

In propositional logic, we need


to know the truth values of
propositions in all possible
Truth Tables scenarios. We can combine all
the possible combination with
logical connectives, and the
representation of these
combinations in a tabular
format is called Truth table.

Truth Tables: Negation & Conjunction

51
10/1/2022

Logical connectives: Disjunction & Implication

Logical connectives: Biconditional

52
10/1/2022

Truth table with three propositions


We can build a proposition composing three propositions P, Q, and R. This truth
table is made-up of 8n Tuples as we have taken three proposition symbols.

Precedence of connectives
Just like arithmetic operators, there is a precedence order for propositional
connectors or logical operators. This order should be followed while evaluating a
propositional problem. Following is the list of the precedence order for operators:
Precedence Operators
Note: For better
First Precedence Parenthesis
understanding use
parentheses to make sure of
Second Precedence Negation
the correct interpretations.
Such as ¬R∨ Q, It can be
Third Precedence Conjunction(AND) interpreted as (¬R) ∨ Q.

Fourth Precedence Disjunction(OR)


Fifth Precedence Implication
Six Precedence Biconditional

53
10/1/2022

Logical equivalence:
Logical equivalence is one of the features of propositional logic. Two propositions
are said to be logically equivalent if and only if the columns in the truth table are
identical to each other.

Let's take two propositions A and B, so for logical equivalence, we can write it as
A⇔B. In below truth table we can see that column for ¬A∨ B and A→B, are
identical hence A is Equivalent to B.

Properties of Operators:

● Commutativity:
○ P∧ Q= Q ∧ P, or
○ P ∨ Q = Q ∨ P.
● Associativity:
○ (P ∧ Q) ∧ R= P ∧ (Q ∧ R),
○ (P ∨ Q) ∨ R= P ∨ (Q ∨ R)
● Identity element:
○ P ∧ True = P,
○ P ∨ True= True.

54
10/1/2022

Properties of Operators:

● Distributive:
○ P∧ (Q ∨ R) = (P ∧ Q) ∨ (P ∧ R).
○ P ∨ (Q ∧ R) = (P ∨ Q) ∧ (P ∨ R).
● DE Morgan's Law:
○ ¬ (P ∧ Q) = (¬P) ∨ (¬Q)
○ ¬ (P ∨ Q) = (¬ P) ∧ (¬Q).
● Double-negation elimination:
○ ¬ (¬P) = P.

Limitations of Propositional logic:

1. We cannot represent relations like ALL, some, or none with propositional


logic.
Example:
a. All children are intelligent.
b. Some apples are sweet.
1. Propositional logic has limited expressive power.
2. In propositional logic, we cannot describe statements in terms of their
properties or logical relationships.

55
10/1/2022

Computational Logic
•Also called symbolic logic and dates back to Aristotle (384 – 322BC)
•In AI, logic is used to
1.express statements
2.Validly infer additional statements
3.To rigorously prove/disprove statements

However, application of logic is not straight forward since


1.Humans do not ALWAYS decide based on logic
2.Logic is too inflexible and rigorous (extremely thorough)
This is called ‘CLASSICAL LOGIC’- the basis of all rule-based systems.

Computational Logic
Extensions of classical logic (monotonic) are
1.Non-monotonic logic – when observation of new facts often cause revision of
previously believed facts.
2.Temporal logic – related to time
3.Fuzzy logic, probabilistic logic or multi-valued logic – those that deal with
uncertainties
All these can be formulated mathematically
Inference: the process of deducing new facts from other existing facts
Induction: reasoning from a part to the whole.
Deduction: a logically sound and systematic inference procedure

56
10/1/2022

Computational Logic
Axiom: a statement that is always true
Symbolic logic uses mathematical symbols to represent statements

Computational
Logic

57
10/1/2022

Computational Logic
Statement, assertion, proposition = a declarative sentence that is either true or false.

Representation of statements- ranging from English-like sentences to abstraction as


a single variable.

Analysis of
Compound 1.Implication
Statements 2.Deduction
Using Simple Logical https://classroom.google.com/w/NDk2ODk0

Connectives MTY0MDEy/tc/NTM3MTIxMjcwMjU0

58
10/1/2022

The language
of logic -
Statements

Rules of Inference in Artificial intelligence


● In artificial intelligence, we need intelligent computers which can
create new logic from old logic or by evidence, so,
● Generating the conclusions from evidence and facts is termed as
Inference.
● Inference rules are the templates for generating valid arguments.
● Inference rules are applied to derive proofs in artificial intelligence,
and the proof is a sequence of the conclusion that leads to the
desired goal.
● In inference rules, the implication among all the connectives plays an
important role.

59
10/1/2022

SIMPLE LOGICAL CONNECTIVES

EQUALITY OF TRUTH VALUES VERSUS EQUALITY OF MEANING.

● Care must be taken in interpreting the concept of the equality of two


statements.
● A compound statement based upon equality does not mean that the
component statements are in any way equal in meaning, but rather it means
that they have the same truth value.

Implication
● In developing knowledge representations, one of the most useful logical
connectives is the implication (IF) operator.

● The implication operator is used to formulate conditional statements, that is,


statements of the form
● IF antecedent
● THEN consequent

● Symbolic information encoded via (possibly compound) "antecedent" and


consequent" statements, together with the implication connective, form the
basis for many AI implementations, including rule-based systems.

60
10/1/2022

Implication

● The implication or conditional operator is written as ← or → depending upon


the direction of the implication.

● When written as p → q, the term on the left (the antecedent, i.e., p) implies the
term on the right (the consequent, i.e., q).

● If the implication is TRUE when the term on the left is TRUE, the term on the
right must also be TRUE.

● The implication operator is so fundamental to AI, and so often conceptually


misunderstood.
Implication

61
10/1/2022

THE "WEAK" REPRESENTATIONAL CAPABILITY OF IMPLICATION.

This is row 4 from the implication truth table!

Implication Truth Table

Which is why we have


other inference rules!

62
10/1/2022

Inference rules:
1. Implication: It is one of the logical connectives which can be represented as P
→ Q. It is a Boolean expression.
2. Converse: The converse of implication, which means the right-hand side
proposition goes to the left-hand side and vice-versa. It can be written as Q →
P.
3. Contrapositive: The negation of converse is termed as contrapositive, and it
can be represented as ¬ Q → ¬ P.
4. Inverse: The negation of implication is called inverse. It can be represented as
¬ P → ¬ Q.

https://www.javatpoint.com/rules-of-inference-in-artificial-intelligence

Inference rules: Truth Table

From the above truth table, we can prove that


1. P → Q is equivalent to ¬ Q → ¬ P, and
2. Q→ P is equivalent to ¬ P → ¬ Q.

63
10/1/2022

Inference rules:Type 1- Modus Ponens:


The Modus Ponens rule is one of the most important rules of inference, and it
states that if P and P → Q is true, then we can infer that Q will be true. It can be
represented as:
Example:
Statement-1: "If I am sleepy then I go to bed" ==> P→ Q
Statement-2: "I am sleepy" → P
Conclusion: "I go to bed." → Q.
Hence, we can say that, if P→ Q is true and P is true then Q will be true.

Proof by Truth table:

Inference rules:Type 2 - Modus Tollens


The Modus Tollens rule state that if P→ Q is true and ¬ Q is true, then ¬ P will also
true. It can be represented as:

Statement-1: "If I am sleepy then I go to bed" ==> P→ Q


Statement-2: "I do not go to the bed."==> ~Q
Statement-3: Which infers that "I am not sleepy" => ~P

Proof by Truth table:

64
10/1/2022

Inference rules: Other Types


3. Hypothetical Syllogism
4. Disjunctive Syllogism

5. Addition

6. Simplification

7. Resolution

https://www.javatpoint.com/rules-of-inference-in-artificial-intelligence

Implication of Compound statements


1. It is often necessary to determine the logical consequences of assertion-based
statements where the antecedents and the consequents themselves are
compound statements. Parentheses are used to indicate the precedence of
connectives in these formulations.
2. The mapping of the logic incorporated in a complex statement into a simple
logical variable masks a great deal of knowledge representation and manipulation
difficulties. Questions that arise include the following:
1. How do we determine the "meaning" of and consequently the truth of a
statement entered in English?
2. Is the knowledge in a relatively complex sentence best coded in a single, two-
value logical variable?
3. What modifications in the statement would lead to a change in the truth value
of the statement?

65
10/1/2022

Implication Example 2. Forward chaining using implication.


Consider a series of assertions or IF-THEN statements. Variables pi and qi are used
to represent the truth values of the antecedents and consequents, respectively, in
the following implications:
Implication 1
p1 A college professor teaches in the summer
q1 The professor can't do anything but teach
Implication 2
p2 The professor can't do anything but teach (same as q1)
q2 The professor does not have time to do research
Implication 3
p3 The professor does not have time to do research (same as q2)
q3 The professor is unhappy

Example for Forward chaining using implication.

66
10/1/2022

Example for Forward chaining using implication.

Example for Forward chaining using implication.

67
10/1/2022

Inference Net

Inference Net
● This type of diagram is referred to as an inference net.
● Inference nets are seldom as simple as that shown; for example, in databases
containing 10,000 rules, it may not even be practical to view the inference net.
● The action indicated by following an arrow from the antecedent of a rule to the
consequent (and thus producing a statement whose truth value is known to be
TRUE) is shown.
● This is also referred to as firing the rule.
● The process of deciding which rule to fire is fundamental to our inference
control strategy.

THIS IS ALSO CALLED DEDUCTION BY PROPOSITIONAL LOGIC.

68
10/1/2022

Predicate Logic A predicate is a parameterized


proposition, that is, a
proposition with variables.
Pgs 48 - 55
Schalkoff

PREDICATE FUNCTIONS.

69
10/1/2022

Practice Problems

Practice Problems -1

70
10/1/2022

Practice Problems -1

Practice Problems -1

71
10/1/2022

Practice Problems -1

Practice Problems

Refer to the documents shared on the link below to practice for 10 mark
questions.

https://classroom.google.com/c/NDk2ODk0MTY0MDEy/m/NDg4Njc4MTEzMTA0
/details

72
10/1/2022

73

You might also like