unit 3
unit 3
18CSE305J
UNIT-3
Presented By
Dr.Pritee Parwekar
Associate Professor
Dept. of CSE
SRMIST Delhi NCR
Syllabus
► Knowledge and reasoning-Approaches ► Knowledge representation using frames
and issues of knowledge reasoning
► Inferences
► Knowledge base agents-Logic Basics ► Uncertain Knowledge and reasoning-
Methods
► Logic-Propositional logic-syntax ► Bayesian probability and belief network
,semantics and inferences
► Probabilistic reasoning
► Propositional logic- Reasoning patterns
► Probabilistic reasoning over time
► Forward and backward reasoning
► Predicate logic – Syntax and semantics,
instance and is relationship ► Other uncertain techniques-Data mining
Example:Syntax,Semantic
Propositional Logic
► Propositions: p, q
► Logical Connectives: AND (^) conjuction, OR (v)disjunction, NOT
(~), IMPLIES (->)if-then,<-> iff, Negation (Negative)
► Compound Propositions:
► p ^ q (p AND q)
► ~p (NOT p)
► p -> q (p IMPLIES q)
Propositional Logic
Qu.1.Let p and q be the following propositions:
p : Fail grade can be given.
q : Student scores more than 50% marks.
Consider the statement: "Fail grade cannot be given when student scores more
than 50%marks."
Which one of the following is the CORRECT representation of the above statement in
propositional logic?
1. q→¬p
2. q→p
3. p→q
4. ¬p → q
Knowledge base agents-Predicate Logic
Some boys play cricket. In this question, the predicate is "play(x, y),"
where x= boys, and y= game. Since there are some boys so we will use
∃, and it will be represented as: ∃x boys(x) → play(x, cricket).
Example
Qu.4.
"∃x IsHungry(x)" asserts that there is at least one object that is hungry.
► Universal Quantifier (∀): Denoted as ∀, it indicates that the statement
within the quantifier is true for all objects in the domain.
For example, "∀x IsHuman(x) → IsMortal(x)" asserts that all humans are
mortal.
Instances and the "is" Relationship
► Instances and the "is" Relationship:
► In predicate logic, an instance refers to a specific assignment of values to variables that
makes a logical formula true.
► For example, consider the predicate P(x) which represents the property "x is a prime
number." The instance P(2) would be true, as 2 is a prime number. Similarly, P(3) would
also be true, but P(4) would be false.
► The "is" relationship is often expressed using predicates in predicate logic. For instance,
the predicate "Equals(x, y)" could represent the relationship "x is equal to y." Instances
of this predicate might include Equals(2, 2) and Equals(3, 3), which would both evaluate
to true.
► Predicate logic provides a rich and expressive language for representing and reasoning about
relationships between objects and properties. It forms the basis for many formal systems
used in various fields, including mathematics, computer science, and philosophy.
Logic-Propositional logic-syntax
,semantics and inferences
Syntax of Propositional Logic:
► Propositions: In propositional logic, propositions are statements that can be either
true or false. Propositions are represented by propositional symbols, often denoted
by uppercase letters (e.g., P, Q, R).
► Connectives: Propositional logic includes several logical connectives that allow
the construction of compound propositions:
► Conjunction (∧): Represents the logical "AND" operation. It is true only
when both propositions it connects are true.
► Disjunction (∨): Represents the logical "OR" operation. It is true if at least
one of the propositions it connects is true.
Logic-Propositional logic-syntax
,semantics and inferences
► Negation (¬): Represents the logical "NOT" operation. It negates the truth
value of the proposition it precedes.
► Implication (→): Represents the logical "IF...THEN" operation. It is true
unless the antecedent (the proposition before the arrow) is true and the
consequent (the proposition after the arrow) is false.
► Biconditional (↔): Represents the logical "IF AND ONLY IF" operation. It
is true if both propositions have the same truth value.
► Parentheses: Parentheses are used to indicate the grouping of propositions and to
specify the order of operations.
Logic-Propositional logic-syntax ,semantics
and inferences
Semantics of Propositional Logic:
► Truth Assignments: A truth assignment is an assignment of truth values (true or
false) to propositional symbols.
► Truth Tables: Truth tables are used to define the semantics of propositional logic.
They list all possible combinations of truth values for the propositional symbols and
indicate the resulting truth value of the compound propositions under each
assignment.
► Validity: A propositional formula is valid if it evaluates to true under every possible
truth assignment. In other words, it is impossible for the formula to be false under any
interpretation.
Logic-Propositional logic-syntax ,semantics
and inferences
Inferences in Propositional Logic:
► Modus Ponens: Modus Ponens is a valid inference rule that states if we have a
conditional proposition "P → Q" (if P then Q) and we know that P is true, then we
can infer that Q is true.
► Modus Tollens: Modus Tollens is another valid inference rule that states if we have a
conditional proposition "P → Q" (if P then Q) and we know that Q is false, then we
can infer that P is false.
► Resolution: Resolution is a rule of inference used in propositional logic. It involves
applying the resolution principle to resolve clauses (disjunctions of literals) in logical
formulas to infer new clauses.
Predicate logic – Syntax and semantics,
instance and is relationship
► Predicate logic, also known as first-order logic, is a formal system for
representing and reasoning about relationships between objects and
properties.
► Let's break down the key components of predicate logic, including its
syntax and semantics, as well as the concepts of instances and the "is"
relationship:
Syntax of Predicate Logic:
► Terms: Terms are basic elements in predicate logic that represent objects or individuals in
the domain of discourse. Terms can be constants, variables, or functions applied to terms.
For example, in the expression "f(x, y)", "x" and "y" are variables, and "f" is a function
symbol.
► Predicates: Predicates are expressions that represent properties or relations between
objects. Predicates take terms as arguments and can be either atomic (e.g., P(x)) or
compound (e.g., Q(x) ∧ R(y)). Atomic predicates are often denoted by uppercase letters.
► Quantifiers: Quantifiers are used to express the scope of variables in logical statements.
The two main quantifiers in predicate logic are the universal quantifier (∀), which
indicates "for all," and the existential quantifier (∃), which indicates "there exists."
► Connectives: Predicate logic includes logical connectives such as AND (∧), OR (∨),
NOT (¬), IMPLIES (→), and IF AND ONLY IF (↔), which are used to form compound
logical expressions.
Semantics of Predicate Logic:
► Interpretations: An interpretation assigns meanings to the terms, predicates, and
functions in a logical expression. It specifies a domain of discourse (the set of objects
under consideration) and provides interpretations for the constants, functions, and
predicates.
► Satisfaction: A logical formula is said to be satisfied (true) under an interpretation if,
when its variables are replaced by elements from the domain of discourse, the formula
evaluates to true.
► Validity: A logical formula is valid if it is true under all possible interpretations. In
other words, a formula is valid if it holds true regardless of the specific interpretation
chosen.
Knowledge representation using Rules
Knowledge representation using rules
► It is the method used to organize and formalize the knowledge in the knowledge base. It
is in the form of IF-THEN-ELSE rules.
► The classic methods of representing knowledge use either rules or logic. Table displays
the knowledge for the zoo animals problem in two formats–using rules on the left as
implemented within the Knowledge Representation NetLogo model, and using first
orderlogic on the right.
► Rules are often used in rule-based expert systems, and are either specified explicitly by
a knowledge engineer (usually through a process called ‘knowledge acquisition’ from a
human expert), or they are derived from data using a machine learning or data mining
algorithm. Rules use a logic-based form for reasoning. Logic is the use of symbolic and
mathematical techniques for deductive reasoning
Knowledge representation using semantic
nets
► Asemantic network is a graphic notation for representing knowledge in
patterns of interconnected nodes. Semantic networks became popular in
artificial intelligence and natural language processing only because it
represents knowledge or supports reasoning. These act as another
alternative for predicate logic in a form of knowledge representation.
► The structural idea 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.
Knowledge representation using semantic
nets
Knowledge representation using frames
► Every frame provides a number of slots which are designated as slot values.
This is the way the frame network is created. Instead of simply processing
links among frames, every relationship is indicated by away from a value
being put into any slot.
► The frame is just like a record construction and related to the fields and
values which are generally slots as well as slot fillers. Generally speaking,
the frame is a set of fillers and slots which are identified as stereotypical
objects. An individual frame isn’t much beneficial. The frame technique has
a set of frames that can be joined together. The attribute value of one of the
frames may become another frame.
Knowledge representation using frames
Difference between semantic net &
Frame
Semantic networks are a natural representation of knowledge. Semantic
networks convey meaning in a transparent manner. These networks are simple
and easily understandable.
► Find the probability that the grass is wet when it sprinkler and
but no rain
► Find the probability that the grass is wet in absence of
sprinkler and in absence of rain.
► P(W^S^~R)
► P(W^~S^~R)
Solve the question find P(S,D,A,¬B,¬E)
Solve the question
Solve the questions
► Questions 1:
Calculate the probability that in spite of the exam level being difficult, the student
having a low IQ level and a low Aptitude Score, manages to pass the exam and secure
admission to the university.
► Questions 2:
In another case, calculate the probability that the student has a High IQ level and
Aptitude Score, the exam being easy yet fails to pass and does not secure admission to
the university.
Solve the question
Other uncertain techniques-Data mining
► Data mining in AI involves the process of discovering patterns, trends, and
insights from large datasets. It encompasses various techniques for analyzing data
to extract valuable information and make predictions or decisions. Here are some
other uncertain techniques commonly used in data mining:
1. Clustering
2. Association Rule Mining
3. Anomaly Detection
4. Regression Analysis
5. Probabilistic Graphical Models
Fuzzy logic
► Fuzzy logic is a mathematical framework for dealing with uncertainty and
imprecision in data. Unlike classical binary logic, which assigns values of true or
false, fuzzy logic allows for gradual truth values between 0 and 1, representing
degrees of membership in a fuzzy set. Fuzzy logic is used in various data mining
tasks, such as fuzzy clustering, fuzzy classification, and fuzzy rule-based systems,
to handle uncertainty and vagueness in data.
Dempster -shafer theory
► Dempster-Shafer Theory, also known as the theory of belief functions or evidence
theory, is a mathematical framework used in artificial intelligence and decision
theory to reason under uncertainty. It was developed by Glenn Shafer and Arthur
P. Dempster in the 1970s. This theory generalizes and extends classical probability
theory to handle situations where there is incomplete or ambiguous evidence.
► Dempster-Shafer Theory has applications in various fields, including pattern
recognition, data fusion, diagnostic systems, decision support systems, and expert
systems. It provides a flexible and powerful framework for reasoning under
uncertainty, where classical probability theory may be inadequate due to
incomplete or conflicting evidence.
Thank you