Share
Embed
KNOWLEDGE REPRESENTATION AND REASONING
Logic and inference, Ontologies, Bayesian Reasoning, Temporal reasoning , Knowledge, Case study: Medical diagnosis
Keerthana B
October 28, 2026
Transcript
129 slides
-
KNOWLEDGE REPRESENTATION AND REASONING Logic and inference, Ontologies, Bayesian Reasoning,
Temporal reasoning, Knowledge, Case study: Medical diagnosis Hours Planned : 07 17/07/2026 20CS242-AI 2 -
PREDICATE LOGIC • Predicate logic is a formal language in
which propositions are expressed in terms of predicates, variables and quantifiers. It is different from propositional logic which lacks quantifiers. • Predicates express similar kinds of propositions involving it's arguments • Predicates are generalization of relations • Consider the following famous argument: 1. All men are mortal. 2. Aristotle is a man. 3. Therefore, Aristotle is mortal. Can we represent this using propositional logic? 17/07/2026 3 -
PREDICATE LOGIC : • The quantifiers involving entire sets of
objects, some of them, enumerate them, etc. • The Universal Quantifier ( for all )(∀) • The Existential Quantifier ( exists/ for some )(∃) 4 -
fol First-order logic (like natural language) assumes the world contains
• Objects: people, houses, numbers, colors, baseball games, wars, … • Relations: red, round, prime, brother of, bigger than, part of, comes between, … • Functions: father of, best friend, one more than, plus, … 17/07/2026 5 -
Predicate logic - examples “Every house is a physical object”
∀x.(house(x) → physical object(x)), where house and physical object are unary predicate symbols. “Some physical objects are houses” ∃x.(physical object(x) ∧ house(x)) ”Every house has an owner” or, equivalently, “every house is owned by somebody” ∀x(house(x) → ∃y.owns(y, x)), here owns is a binary predicate symbol. ”Everybody owns a house” ∀x.∃y.(owns(x, y) ∧ house(y)) 17/07/2026 9 -
First order logic Solve the following • “Everyone is happy”
• “Sue owns a house” • “Peter doesn’t own a house” • “Somebody does not own a house” • “Someone in the room can dance” • “The only one who respects Richard is sue” 17/07/2026 10 -
SOLUTION • ∀x Happy(x) • ∃x (owns(Sue, x) ∧ house(x))
• ¬∃x (owns(Peter, x) ∧ house(x)) • ∃x ∀y (owns(x, y) → ¬house(y)) • ∃x (inroom(x) ∧ dance(x)) • ∃x (respects(Sue,x) ∧ (Richard(x)) 17/07/2026 11 -
INFERENCE Substitution: • Substitution is a fundamental operation performed on
terms and formulas. It occurs in all inference systems in first-order logic. The substitution is complex in the presence of quantifiers in FOL. • If we write F[a/x], so it refers to substitute a constant "a" in place of variable "x". Equality: • First-Order logic does not only use predicate and terms for making atomic sentences but also uses another way, which is equality in FOL. For this, we can use equality symbols which specify that the two terms refer to the same object. Example: Brother (John) = Smith. • As in the above example, the object referred by the Brother (John) is similar to the object referred by Smith. The equality symbol can also be used with negation to represent that two terms are not the same objects. Example: ¬(x=y) which is equivalent to x ≠y. 17/07/2026 12 -
inference rules in first-order logic • Universal Generalization • Universal
Instantiation • Existential Instantiation • Existential introduction 17/07/2026 13 -
UNIVERSAL GENERALIZATION • Universal generalization is a valid inference rule
which states that if premise P(c) is true for any arbitrary element c in the universe of discourse, then we can have a conclusion as ∀ x P(x). • It can be represented as: • This rule can be used if we want to show that every element has a similar property. • In this rule, x must not appear as a free variable. Example: Let's represent, P(c): "A byte contains 8 bits", so for ∀ x P(x) "All bytes contain 8 bits.", it will also be true. 17/07/2026 14 -
Universal Instantiation • Universal instantiation is also called as universal
elimination or UI is a valid inference rule. It can be applied multiple times to add new sentences. • The new KB is logically equivalent to the previous KB. • As per UI, we can infer any sentence obtained by substituting a ground term for the variable. • The UI rule state that we can infer any sentence P(c) by substituting a ground term c (a constant within domain x) from ∀ x P(x) for any object in the universe of discourse. • It can be represented as: 17/07/2026 15 -
Universal Instantiation Example:1. • IF "Every person like ice-cream" THEN
∀x P(x) so we can infer that "John likes ice-cream" => P(c) Example: 2. • "All kings who are greedy are Evil." So let our knowledge base contains this detail as in the form of FOL: • ∀ x king(x) ∧ greedy (x) → Evil (x), • So from this information, we can infer any of the following statements using Universal Instantiation: • King(John) ∧ Greedy (John) → Evil (John), • King(Richard) ∧ Greedy (Richard) → Evil (Richard), • King(Father(John)) ∧ Greedy (Father(John)) → Evil (Father(John)), 17/07/2026 16 -
Existential Instantiation • Existential instantiation is also called as Existential
Elimination, which is a valid inference rule in first-order logic. • It can be applied only once to replace the existential sentence. • The new KB is not logically equivalent to old KB, but it will be satisfiable if old KB was satisfiable. • This rule states that one can infer P(c) from the formula given in the form of ∃x P(x) for a new constant symbol c. • The restriction with this rule is that c used in the rule must be a new term for which P(c ) is true. • It can be represented as: 17/07/2026 17 -
Existential Instantiation Example: • From the given sentence: ∃ x
Crown(x) ∧ OnHead(x, John), • So we can infer: Crown(K) ∧ OnHead( K, John), as long as K does not appear in the knowledge base. The above used K is a constant symbol, which is called Skolem constant. The Existential instantiation is a special case of Skolemization process. 17/07/2026 18 -
Existential introduction • An existential introduction is also known as
an existential generalization, which is a valid inference rule in first-order logic. • This rule states that if there is some element c in the universe of discourse which has a property P, then we can infer that there exists something in the universe which has the property P. • It can be represented as: Example: Let's say that, "Priyanka got good marks in English." "Therefore, someone got good marks in English." 17/07/2026 19 -
UNIFICATION & Generalized Modus Ponens Rule • For the inference
process in FOL, we have a single inference rule which is called Generalized Modus Ponens. It is lifted version of Modus ponens. • Generalized Modus Ponens can be summarized as, " P implies Q and P is asserted to be true, therefore Q must be True." • According to Modus Ponens, for atomic sentences pi, pi', q. Where there is a substitution θ such that SUBST (θ, pi',) = SUBST(θ, pi), it can be represented as: 17/07/2026 20 -
Generalized Modus Ponens Rule Example: We will use this rule
for Kings are evil, so we will find some x such that x is king, and x is greedy so we can infer that x is evil. p1 is king(x) 1.Here let say, p1' is king(John) p2 is Greedy(x) 2.p2' is Greedy(y) q is evil(x) 3.θ is {x/John, y/John} 4.SUBST(θ,q). 17/07/2026 21 -
ONTOLOGIES IN Inference engine • The inference engine is the
component of the intelligent system in artificial intelligence, which applies logical rules to the knowledge base to infer new information from known facts. The first inference engine was part of the expert system. Inference engine commonly proceeds in two modes, which are: 1. Forward chaining 2. Backward chaining 17/07/2026 26 -
HORN & DEFINITE CLAUSE Definite clause: A clause which is
a disjunction of literals with exactly one positive literal is known as a definite clause or strict horn clause. Horn clause: A clause which is a disjunction of literals with at most one positive literal is known as horn clause. Hence all the definite clauses are horn clauses. Example: (¬ p V ¬ q V k). It has only one positive literal k. It is equivalent to p ∧ q → k. 17/07/2026 27 -
FORWARD CHAINING • It is a down-up approach, as it
moves from bottom to top. • It is a process of making a conclusion based on known facts or data, by starting from the initial state and reaches the goal state. • Forward-chaining approach is also called as data-driven as we reach to the goal using available data. • Example: "As per the law, it is a crime for an American to sell weapons to hostile nations. Country A, an enemy of America, has some missiles, and all the missiles were sold to it by Robert, who is an American citizen." Prove that "Robert is criminal." To solve the above problem, first, we will convert all the above facts into first-order definite clauses, and then we will use a forward-chaining algorithm to reach the goal. 17/07/2026 28 -
BACKWARD CHAINING • It is known as a top-down approach.
• Backward-chaining is based on modus ponens inference rule. • In backward chaining, the goal is broken into sub-goal or sub-goals to prove the facts true. • It is called a goal-driven approach, as a list of goals decides which rules are selected and used. • Backward -chaining algorithm is used in game theory, automated theorem proving tools, inference engines, proof assistants, and various AI applications. • The backward-chaining method mostly used a depth-first search strategy for proof. 17/07/2026 32 -
Outline Why first-order logic? Syntax and semantics of first-order logic
Fun with sentences Wumpus world in first-order logic 17/07/2026 -
Pros and Cons of Propositional Logic Propositional logic is declarative:
pieces of syntax correspond to facts 17/07/2026 -
Pros and Cons of Propositional Logic Propositional logic is declarative:
pieces of syntax correspond to facts Propositional logic allows partial / disjunctive / negated information (unlike most data structures and databases) 17/07/2026 -
Pros and Cons of Propositional Logic Propositional logic is declarative:
pieces of syntax correspond to facts Propositional logic allows partial / disjunctive / negated information (unlike most data structures and databases) Propositional logic is compositional: meaning of B1,1 ∧ P1,2 is derived from meaning of B1,1 and of P1,2 17/07/2026 -
Pros and Cons of Propositional Logic Propositional logic is declarative:
pieces of syntax correspond to facts Propositional logic allows partial / disjunctive / negated information (unlike most data structures and databases) Propositional logic is compositional: meaning of B1,1 ∧ P1,2 is derived from meaning of B1,1 and of P1,2 Meaning in propositional logic is context-independent (unlike natural language, where meaning depends on context) 17/07/2026 -
Pros and Cons of Propositional Logic Propositional logic is declarative:
pieces of syntax correspond to facts Propositional logic allows partial / disjunctive / negated information (unlike most data structures and databases) Propositional logic is compositional: meaning of B1,1 ∧ P1,2 is derived from meaning of B1,1 and of P1,2 Meaning in propositional logic is context-independent (unlike natural language, where meaning depends on context) Propositional logic has very limited expressive power (unlike natural language) Example: Cannot say “pits cause breezes in adjacent squares” 17/07/2026 except by writing one sentence for each square -
First-order Logic Propositional logic Assumes that the world contains facts
First-order logic Assumes that the world contains Objects people, houses, numbers, theories, Donald Duck, colors, centuries, . . . 17/07/2026 -
First-order Logic Propositional logic Assumes that the world contains facts
First-order logic Assumes that the world contains Objects people, houses, numbers, theories, Donald Duck, colors, centuries, . . . Relations red, round, prime, multistoried, . . . brother of, bigger than, part of, has color, occurred after, owns, . . . 17/07/2026 -
First-order Logic Propositional logic Assumes that the world contains facts
First-order logic Assumes that the world contains Objects people, houses, numbers, theories, Donald Duck, colors, centuries, . . . Relations red, round, prime, multistoried, . . . brother of, bigger than, part of, has color, occurred after, owns, . . . Functions +, middle of, father of, one more than, beginning of, . . . 17/07/2026 -
Syntax of First-order Logic: Basic Elements Symbols 17/07/2026 Constants KingJohn,
2, Koblenz, C,... Predicates Brother, >, =, . . . Functions Sqrt, LeftLegOf , . . . x, y, a, b, . . . Variable s Connectives ∧ ∨ ¬ ⇒ ⇔ Quantifiers ∀ ∃ -
Syntax of First-order Logic: Basic Elements Symbols Constants KingJohn, 2,
Koblenz, C,... Predicates Brother, >, =, . . . Functions Sqrt, LeftLegOf , . . . x, y, a, b, . . . Variable s Connectives ∧ ∨ ¬ ⇒ ⇔ Quantifiers ∀ ∃ Note The equality predicate is always in the vocabulary It is written in infix notation 17/07/2026 -
Syntax of First-order Logic: Atomic sentence predicate ( term1, .
. . , termn ) or term1 = term2 17/07/2026 Atomic Sentences -
Syntax of First-order Logic: Atomic Sentences Atomic sentence predicate (
term1, . . . , termn ) or term1 = term2 Term function ( term1, . . . , termn ) or constant or variable 17/07/2026 .52 -
Syntax of First-order Logic: Atomic Sentences Example Brother ( KingJohn,
RichardTheLionheart ) 17/07/2026 .53 .7 -
Syntax of First-order Logic: Atomic Sentences Example Brother ( KingJohn,
RichardTheLionheart ) s ˛¸ x s ˛¸ x s ˛¸ x predicateconstant constant 17/07/2026 .54 .7 -
Syntax of First-order Logic: Atomic Sentences Example Brother ( KingJohn,
RichardTheLionheart ) s ˛¸ x s ˛¸ x s ˛¸ x constant constant predicate ˛¸ x s ˛¸ x term tersm 17/07/2026 .55 .7 -
Syntax of First-order Logic: Atomic Sentences Example Brother ( KingJohn,
RichardTheLionheart ) s ˛¸ x s ˛¸ x s ˛¸ x constant constant predicate s ˛¸ x ˛¸ x tersm ˛¸ x term s atomic sentence 17/07/2026 .56 .7 -
Syntax of First-order Logic: Atomic Sentences Example > ( Length(LeftLegOf
(Richard)), Length(LeftLegOf (KingJohn)) ) 17/07/2026 .57 .8 -
Syntax of First-order Logic: Atomic Sentences Example > ( Length(LeftLegOf
(Richard)), Length(LeftLegOf (KingJohn)) ) s ˛¸ x s ˛¸ x s ˛¸ x s ˛¸ x s ˛¸ x s ˛¸ x s ˛¸ x predicate function function constant function function constant 17/07/2026 .58 .8 -
Syntax of First-order Logic: Atomic Sentences Example > ( Length(LeftLegOf
(Richard)), Length(LeftLegOf (KingJohn)) ) s˛¸x s ˛¸ x s ˛¸ x cson˛sta̧nt x consstant ˛¸ x s ˛¸ x s ˛¸ x function predicate function function function ˛¸ x x s ˛¸ term term s 17/07/2026 .59 .8 -
Syntax of First-order Logic: Atomic Sentences Example > ( Length(LeftLegOf
(Richard)), Length(LeftLegOf (KingJohn)) ) s˛¸x s ˛¸ x s ˛¸ x cson˛sta̧nt x consstant ˛¸ x s ˛¸ x s ˛¸ x function predicate function function function ˛¸ x x s ˛¸ s term term ˛¸ x atomic senstence 17/07/2026 .60 .8 -
Syntax of First-order Logic: Complex Sentences Built from atomic sentences
using connectives ¬S S1 ∧ S2 S1 ∨ S2 S1 ⇒ S2 S1 ⇔ S2 (as in propositional logic) 17/07/2026 .61 .9 -
Syntax of First-order Logic: Complex Sentences Built from atomic sentences
using connectives ¬S S1 ∧ S2 S1 ∨ S2 S1 ⇒ S2 S1 ⇔ S2 (as in propositional logic) Example Sibling( KingJohn, Richard ) ) ~ Sibling( Richard, KingJohn 17/07/2026 .62 .9 -
Syntax of First-order Logic: Complex Sentences Built from atomic sentences
using connectives ¬S S1 ∧ S2 S1 ∨ S2 S1 ⇒ S2 S1 ⇔ S2 (as in propositional logic) Example Sibling( KingJohn, Richard ) s) ˛¸ x x s ˛¸ term x s ˛¸ predicate term ~ Sibling( Richard, KingJohn s ˛¸ s ˛¸ x s ˛¸ term x x predicate term 17/07/2026 .63 .9 -
Syntax of First-order Logic: Complex Sentences Built from atomic sentences
using connectives ¬S S1 ∧ S2 S1 ∨ S2 S1 ⇒ S2 S1 ⇔ S2 (as in propositional logic) Example Sibling( KingJohn, Richard ) s) ˛¸ x x s ˛¸ term x ˛¸ x s ˛¸ predicate atomic sentence term ~ Sibling( Richard, KingJohn predicate term term s ˛˛¸¸ x s ˛¸ x s x ˛¸ x atomic sentence 17/07/2026 .64 .9 -
Syntax of First-order Logic: Complex Sentences Built from atomic sentences
using connectives ¬S S1 ∧ S2 S1 ∨ S2 S1 ⇒ S2 S1 ⇔ S2 (as in propositional logic) Example Sibling( KingJohn, Richard ) s) ˛¸ s ˛¸ x s ˛¸ x x term ˛¸ x predicate term atomic sentence s ~ Sibling( Richard, KingJohn predicate term term s ˛˛¸¸ x s ˛¸ x s x ˛¸ x atomic sentence x ˛ complex¸sentence 17/07/2026 .65 .9 -
Semantics in First-order Logic Models of first-order logic Sentences are
true or false with respect to models, which consist of – a domain (also called universe) – an interpretation 17/07/2026 .66 .10 -
Semantics in First-order Logic Models of first-order logic Sentences are
true or false with respect to models, which consist of – a domain (also called universe) – an interpretation Domain A non-empty (finite or infinite) set of arbitrary elements 17/07/2026 .67 .10 -
Semantics in First-order Logic Models of first-order logic Sentences are
true or false with respect to models, which consist of – a domain (also called universe) – an interpretation Domain A non-empty (finite or infinite) set of arbitrary elements Interpretation Assigns to each – 17/07/2026 constant symbol: a domain element – predicate symbol: a relation on the domain (of appropriate arity) – a function on the domain (of appropriate arity) function symbol: .10 .68 -
Semantics in First-order Logic Definition An atomic sentence predicate (
term1, . . . , termn ) is true in a certain model (that consists of a domain and an interpretation) iff the domain elements that are the interpretations of term1,..., termn are in the relation that is the interpretation of predicate 17/07/2026 .69 .11 -
Semantics in First-order Logic Definition An atomic sentence predicate (
term1, . . . , termn ) is true in a certain model (that consists of a domain and an interpretation) iff the domain elements that are the interpretations of term1,..., termn are in the relation that is the interpretation of predicate The truth value of a complex sentence in a model is computed from the truth-values of its atomic sub-sentences in the same way as in propositional logic 17/07/2026 .70 .11 -
Models for First-order Logic: 17/07/2026 Constants: KingJohn, Richard Predicates: person,
king, crown Functions: brother, on_head, left_leg Example .12 -
Universal Quantification: Syntax Syntax ∀ variables sentence Example “Everyone studying
in Koblenz is smart: ∀ x (StudiesAt(x, Koblenz) ⇒ Smart(x)) s˛¸x s ˛¸ x variables sentence 17/07/2026 .73 .13 -
Universal Quantification: Semantics Semantics ∀xP is true in a model
iff for all domain elements d in the model: P is true in the model when x is interpreted by d 17/07/2026 .74 .14 -
Universal Quantification: Semantics Semantics ∀xP is true in a model
iff for all domain elements d in the model: P is true in the model when x is interpreted by d Intuition ∀x P is roughly equivalent to the conjunction of all instances of P 17/07/2026 .75 .14 -
Universal Quantification: Semantics Semantics ∀xP is true in a model
iff for all domain elements d in the model: P is true in the model when x is interpreted by d Intuition ∀x P is roughly equivalent to the conjunction of all instances of P ∀ x StudiesAt(x, Koblenz) ⇒ Example equivalent to: Smart(x) StudiesAt(KingJohn, Koblenz) ⇒ Smart(KingJohn) ∧ StudiesAt(Richard, Koblenz) ⇒ Smart(Richard) ∧ StudiesAt(Koblenz, Koblenz) ⇒ Smart(Koblenz) 17/07/2026 ∧ ... .76 .14 -
A Common Mistake to Avoid Note ~ is the main
connective with ∀ Common mistake Using ∧ as the main connective with ∀ 17/07/2026 .77 .15 -
A Common Mistake to Avoid Note ~ is the main
connective with ∀ Common mistake Using ∧ as the main connective with ∀ Example Correct: ∀x (StudiesAt(x, Koblenz) ⇒ Smart(x)) “Everyone who studies at Koblenz is smart” 17/07/2026 .78 .15 -
A Common Mistake to Avoid Note ~ is the main
connective with ∀ Common mistake Using ∧ as the main connective with ∀ Example Correct: ∀x (StudiesAt(x, Koblenz) ⇒ Smart(x)) “Everyone who studies at Koblenz is smart” Wrong: ∀x (StudiesAt(x, Koblenz) ∧ Smart(x)) “Everyone studies at Koblenz and is smart”, i.e., “Everyone studies at Koblenz and everyone is smart” 17/07/2026 .79 .15 -
Existential Quantification: Syntax Syntax ∃ variables sentence Example “Someone studying
in Landau is smart: ∃ x s˛¸x variables (StudiesAt(x, Landau) ∧ Smart(x)) s ˛¸ x sentence 17/07/2026 .81 .16 -
Existential Quantification: Semantics Semantics is true in a model •
∃xP • iff d in the model such that: • P is true in the model when x is interpreted by d • there is a domain element 17/07/2026 .82 .17 -
Existential Quantification: Semantics Semantics is true in a model •
∃xP • iff d in the model such that: • P is true in the model when x is interpreted by d Intuition • there is a domain element ∃x P is roughly equivalent to the disjunction of all instances of P 17/07/2026 .83 .17 -
Existential Quantification: Semantics Semantics is true in a model •
∃xP • iff d in the model such that: • P is true in the model when x is interpreted by d Intuition • there is a domain element ∃x P is roughly equivalent to the disjunction of all instances of P ∃ x StudiesAt(x, Landau) ∧ Example equivalent to: Smart(x) StudiesAt(KingJohn, Landau) ∧ Smart(KingJohn) ∨ StudiesAt(Richard, Landau) ∧ Smart(Richard) ∨ StudiesAt(Landau, Landau) ∧ Smart(Landau) 17/07/2026 ∨ ... .84 .17 -
Another Common Mistake to Avoid Note ∧ is the main
connective with ∃ Common mistake Using ⇒ as the main connective with ∃ 17/07/2026 .85 .18 -
Another Common Mistake to Avoid Note ∧ is the main
connective with ∃ Common mistake Using ⇒ as the main connective with ∃ Example Correct: ∃x (StudiesAt(x, Landau) ∧ Smart(x)) “There is someone who studies at Landau and is smart” 17/07/2026 .86 .18 -
Another Common Mistake to Avoid Note ∧ is the main
connective with ∃ Common mistake Using ⇒ as the main connective with ∃ Example Correct: ∃x (StudiesAt(x, Landau) ∧ Smart(x)) “There is someone who studies at Landau and is smart” Wrong: ∃x (StudiesAt(x, Landau) ⇒ Smart(x)) “There is someone who, if he/she studies at Landau, is smart” This is true if there is anyone not studying at Landau 17/07/2026 .87 .18 -
Properties of Quantifiers Quantifiers of same type commute 17/07/2026 ∀x∀y
is the same as ∀y∀x ∃x∃y is the same as ∃y∃x .19 -
Properties of Quantifiers Quantifiers of different type do NOT commute
∃x∀y ∀ is yn∃ otxthe same as Example ∃x∀yLoves(x, y) “There is a person who loves everyone in the world” ∀y∃xLoves(x, y) “Everyone in the world is loved by at least one person” (Both hopefully true but different) 17/07/2026 .20 -
Properties of Quantifiers Quantifiers of different type do NOT commute
∃x∀y ∀ is yn∃ otxthe same as Example ∀x∃yMother(x, y) “Everyone has a mother” (correct) ∃y∀xMother(x, y) “There is a person who is the mother of everyone” 17/07/2026 (wrong) .21 -
Properties of Quantifiers Quantifier duality 17/07/2026 ∀xLikes(x, IceCream) is the
same as ∃xLikes(x, Broccoli) is the same as ¬∃x¬Likes(x, IceCream) ¬∀x¬Likes(x, Broccoli) .22 -
Fun with Sentences “Brothers are siblings” ∀x, y (Brother(x, y)
⇒ Sibling(x, y)) 17/07/2026 .92 .23 -
Fun with Sentences “Brothers are siblings” ∀x, y (Brother(x, y)
⇒ Sibling(x, y)) “Sibling” is symmetric ∀x, y (Sibling(x, y) ⇔ Sibling(y, x)) 17/07/2026 .93 .23 -
Fun with Sentences “Brothers are siblings” ∀x, y (Brother(x, y)
⇒ Sibling(x, y)) “Sibling” is symmetric ∀x, y (Sibling(x, y) ⇔ Sibling(y, x)) “One’s mother is one’s female parent” ∀x, y (Mother(x, y) ⇔ (Female(x) ∧ Parent(x, y))) 17/07/2026 .94 .23 -
Fun with Sentences “Brothers are siblings” ∀x, y (Brother(x, y)
⇒ Sibling(x, y)) “Sibling” is symmetric ∀x, y (Sibling(x, y) ⇔ Sibling(y, x)) “One’s mother is one’s female parent” ∀x, y (Mother(x, y) ⇔ (Female(x) ∧ Parent(x, y))) “A first cousin is a child of a parent’s sibling” ∀x, y (FirstCousin(x, y) ⇔ ∃p, ps (Parent(p, x) ∧ Sibling(ps, p) ∧ Parent(ps, y))) 17/07/2026 .95 .23 -
Equality Semantics term1 = term2 is true under a given
interpretation if and only if term1 and term2 have the same interpretation 17/07/2026 .24 -
Equality Example Definition of (full) sibling in terms of Parent
∀x, y Sibling(x, y) ⇔ (¬(x = y) ∧ ∃m, f (¬(m = f ) ∧ Parent(m, x) ∧ Parent( f , x) ∧ Parent(m, y) ∧ Parent( f , y))) 17/07/2026 .25 -
Properties of First-order Logic Important notions – validity – satisfiability
– unsatisfiablity – entailment are defined for first-order logic in the same way as for propositional logic 17/07/2026 .98 .26 -
Properties of First-order Logic Important notions – validity – satisfiability
– unsatisfiablity – entailment are defined for first-order logic in the same way as for propositional logic Calculi There are sound and complete calculi for first-order logic (e.g. resolution) Whenever KB €α, it is also true that KB |= α Whenever KB |= α, it is also true that KB €α But these calculi CANNOT decide validity, entailment, etc. 17/07/2026 .99 .26 -
Properties of First-order Logic In propositional logic Validity, satisfiability, unsatisfiablity
are decidable In first-order logic The set of valid, and the set of unsatisfiable formulas are enumerable The set of satisfiable formulas is NOT EVEN enumerable 17/07/2026 .100 .27 -
What do you mean by the term “Reasoning” ? ▪
Reasoning is an act of deriving a conclusion from certain premises using a given methodology. ▪ Reasoning is a process of thinking; logically arguing; drawing nfheerennaces.ystem is required to do something, that it has not been explicitly ▪ iW told how to do, it must reason. It must figure out what it needs to know from what it already knows. ▪ Many types of reasoning have been identified and recognized, but many questions regarding their logical and computational properties still remained under controversy. ▪ Popular methods of Reasoning include: Abduction, Induction, modelbased, explanation and confirmation. All of them are intimately related to problems of belief revision and theory development, knowledge assimilation, discovery and learning. -
□ When a system is required to do something, that
it has not been explicitly told how to do, it must reason. It must figure out what it needs to know from what it already knows. Example: Fact-1 : Robins are birds, Fact-2 : All birds have wings. Then we can ask: DO ROBINS HAVE WINGS? □ Reasoning is an act of deriving a conclusion from certain premises using a given methodology. □F □oA r rneyaksnoonw inlgedsgyestseymstm em usm t fuinsdt roeuats,ownh,aift it inseredqsuitroedkntow dofro so mmw ehthaitng wiht ia ch lrehaadsynkontobwesin. g told explicitly. Hence to answer the above question- some reasoning must go. -
Human reasoning capabilities □ Broadly it is being divided into
three areas: □ Mathematical Reasoning- axioms, definitions, theorems, proofs □ Logical Reasoning- deductive, inductive, abductive □ Non-logical Reasoning- linguistic, language □ Above three mentioned are in every human being, but the ability level depends on education, genetics and environment. □ Intelligent Quotient (IQ)= mathematical + logical reasoning, whereas, Emotional Quotient mostly depends on non-logical reasoning capabilities. □ Logical Reasoning is our major concern in AI. -
Logical Reasoning □ Logic is a language of reasoning. It
is a collection of rules called logic arguments, lh Reenasdoinnigngloigsicaalpre oa cseo sn s in ofg.drawing conclusions from premises using rule □ wLeougsic eaw of inference. □ The study of is divided into two: formal and informal logic. □ The formal logic is sometimes called symbolic logic. □ Symbolic logic is the study of symbolic abstraction (construct) that capture the formal features of logical inference by a formal system. □ Formal system consists of two components, a formal language and a set of inference rules. The formal system has axioms. □ Axiom is a sentence that is always true within the system. □ Sentences are derived using the system’s axioms and rules of derivation are called theorems. -
Formal Vs Informal Logic Formal Logic □ study of inference
with purely formal content, i.e. where content is made explicit. Eg: Propositional logic and Predicate Logic. □ Here the logical arguments are set of rules for manipulating symbols. The rules are of two types: □ Syntax rules: how to build meaningful expressions. □ Inference rules: how to obtain true formulas from other true formulas. □ Logic also need semantics, which Informal Logic □ study of natural language arguments. □ The analysis of argument structures in ordinary language is part of informal logic □ The focus lies in distinguishing good arguments (valid) and bad arguments (invalid). -
Formal systems □ Formal system can have following three properties:
□ Consistency: system’s theorems do not contradict □ Soundness: system’s rules of derivation will never infer anything false, so long as start is with only true premises. □Completeness: there are no true sentences in the system that cannot be proved usidnegrivation rules of the system. □ □ Elements of formal systems: □ The finite set of symbols for constructing formulae. □ A grammar, is the way of constructing well-formed formulae (wff). □ A set of axioms; each axiom has to be a wff. □ A set of inference rules. □ A set of theorems. A well-formed formulae, wff, is any string generated a grammar. Example: the sequence of symbols ((a□b)□(~b□~a)) is a by WFF because its is grammatically correct in propositional logic. -
Formal Language □ A formal language may be viewed as
being analogous to a collection of words or a collection of sentences. □ In computer science, a formal language is defined as precise mathematical or machine process able formulas. □ A formal language L is characterized as a set F of finite length sequences of elements drawn from a specified finite set A of symbols. □ The mathematical theory that treats formal language in general is known as formal language theory. -
Uncertainty in Reasoning □ The world is an uncertain places;
often the knowledge is imperfect which causes uncertainty. Therefore reasoning must be able to operate under uncertainty. □ AI systems must have ability to reason under conditions of uncertainty. □ Incompleteness knowledge□ compensate for lack of knowledge. □ Inconsistencies knowledge□ Resolve ambiguities and contradictions □ Changing knowledge□ update the knowledgebase over time. -
Methods of reasoning □ To a certain extend this will
depend on the chosen knowledge reprA esltehnotuagtihona. good knowledge representation scheme has to allow easy, natural, and plausible reasoning. □ Three types of logical reasoning: □ Deduction □ Induction □ Abduction -
Deductive Reasoning □ Deductive Reasoning is a process in which
general premises are used to obtasin peacific inference. Reasoning moves from a general principle to a csopneccliufiscion. □ Example: Premise : I wash my car when the weather is good on weekends. □ Premise: Today is Sunday and the weather is hot □ □ C usdioen armtoudsatyg.enerally be formatted in this way. To nucsle d:uT cthiveererfeoares,oInw inigll tw haesphrombylecm Once the format has been achieved , the conclusion must be valid if the are true. The whole idea is to develop new knowledge from previously pgrievm enises knowledge. □ One of the basic rules of inference of deductive logic is the modus ponens ruleA . formal English statement of this rule is : If X is true and if X being true implies Y □ is true then Y is true. (X∧(X→Y)→Y □ Example: All cats are felines. Bosty is a cat. I can deduce that Bosty is a feline -
Abduction Reasoning □ Abduction is a form of deductive logic
which provides only a ‘plausible inference’. For instance: If I read Smoking causes lung cancer and Frank died of lung cancer , I may infer that Frank was a smoker. Again this may or may not be true. Using statistics and probability theory , abduction may yield the most probable inference among many possible inferences. □ Abduction is heuristic in the sense that it provides a plausible conclusion caobndsuiscte mwaitniognl,obguictaolnseyswtehm ichco mnasyisitninfgacotf baegw ionnt wwoitrhksa,vcaoilnasbildeeirnffoolrlo ernoenrg a.l rTuole and illusatrsaptechifoicwproposition: 1)All successful , entrepreneurial industrialists are rich persons. 2)John is a rich person. □ If this was only information available, a plausible inference would be that John was a successful , entrepreneurial industrialist. This conclusion could also be false since there are other roads to riches such as inheritance , the lottery...If we had a table of the income distribution of wealthy persons along with their personal histories, we could refine our abduction inference with the probability of the inference being true . -
Inductive Reasoning □ A principle of reasoning to a conclusion
about all members of a class from oa ntlyioa exao mfin n few members of the class; broadly, reasoning from the particular to the general. □ For example : In 1998, The best model of Turkey is from İzmir In 1999, The best model of Turkey □ fisrom İzmir In 2000, The best model of Turkey is from İzmir I would logically infer that all the girls from İzmir is beautiful. □ This may or may not be true. But it provides a useful generalization. □ Another example : □ Falcon can fly. Canary can fly. Gull can fly. □ CThoencolustcionm:eBoirfdtshceaindfluyc.tive reasoning process will frequently contain some measure □ of uncertainty because including all possible facts in the premises is usually impossible. Deductive or inductive approaches are used in logic, rule-based systems, and frames. -
Other types of Reasoning □ Analogical Reasoning: Analogical reasoning assumes
that when a queasstikoendi,sthe answer can be derived by analogy. □ Example: Premise : All football teams gets 3 point when they win. Question: How many points did GS take this weekend? Conclusion: Because GS is a football team and won, hence, they took 3 points. □ Analogical reasoning is a type of verbalization of an internalized learning process. An individual uses processes that require an ability to recognize previously encountered experiences. The use of this approach has not been exploited yet in AI field. However, case-based reasoning is an attempt. -
Other types of Reasoning □ Formal Reasoning: Formal reasoning involves
syntactic manipulation of data structures to deduce new facts. A typical example is the mathematical logic used in proving theorems in geometry. □ Procedural Numeric Reasoning: Procedural numeric reasoning uses mathematical models or simulation to solve problems. Model-based reasoning is an example of this approach. □ Generalization and Abstraction: Generalization and abstraction can be successfully used with both logical and semantic representation of knowledge. □ Meta level Reasoning: Meta level reasoning involves “knowledge about what you know”. Which approach to use, how successful the inference will be, depends to a great extent on which knowledge representation method is used. For example; reasoning by analogy can be more successful with semantic networks than with frames. -
Reasoning with LOGIC □ We utilize various rules of inference
to manipulate the logical expressions to create newexpressions. □ Modus If tPhoen reen issa rule “if A, then B,” and if we know that A is true, then it is valid to conclude □ that B is also true. [A AND (A →B)] →B □ Example : A: It is rainy. B: I will stay at home. A→B : If is rainy, I will stay at home. □ M Wo hd eu n sBTisolkle nn os wn to be false, and if there is a rule "if A, then ,” it is valid to thaist also false. □ conclude A □ Resolution is a method of discovering whether a new fact is valid, given a set of taltements. It is a method of “theorem proving”. The resolution process, which can be logicsa computerized because of its well-formed structure, is applied to a pair of parent clauses to produce a derived new clause. -
More about Reasoning □ Monotonic Reasoning [Preferred in Certainty]- Monotonic
reasoning is static, in other words the truth of the statement doesn’t change when any new information is added. □ Non-Monotonic Reasoning [Preferred in uncertainty]- In real life we frequently deal with non-monotonic reasoning. In these situations the truth of a statement can change when a new information is added. □ Shallow and Deep Reasoning. □ Inheritance Method □ Pattern- Matching Method □ Meta-Rules: Meta-rules are the rules about rules. They are used for deciding about which rules to use next. Meta-rules make the knowledge base harder to u nadderasnta nd because one meta-rule affects the sequence in which all other r e d rules caa relled. □ Conflict Resolution -
Alternative Reasoning Methods □ Theorem Provin □ egmphasis on mathematical
proofs and correctness, not so much on performance and ease of use □ Probabilistic Reasoning □ □ Certainty Factors □ □ integrates probabilities into the reasoning process Express subjective assessment of truth of fact or rule Fuzzy Reasoning □ allows the use of vaguely defined predicates and rules -
Reasoning Types □ Model –based Reasoning □ Case-based Reasoning □
Rule-based Reasoning □ Blackboard Systems. □ Truth Maintenance systems. -
Model Based Reasoning □ In artificial intelligence, model-based reasoning refers
to an inference method used in expert systems based on a model of the physical world. □ With this approach, the main focus of application development is developing the model. □ Then at run time, an "engine" combines this model knowledge with observed data to derive conclusions such as a diagnosis or a prediction. □ In a model-based reasoning system knowledge can be represented using causal rules. -
Case-Based Reasoning □ Case-based reasoning (CBR), broadly construed, is the
process of solving new problems based on the solutions of similar past problems. □ An auto mechanic who fixes an engine by recalling another car that exhibited similar symptoms is using case-based reasoning. □ A lawyer who advocates a particular outcome in a trial based on legal precedents or a judge who creates case law is using case-based reasoning. -
Rule-based Reasoning □ A particular type of reasoning which uses
"if-then-else" rule statements. □ As mentioned above, rules are simply patterns and an inference engine searches for patterns in the rules that match patterns in the data. □ The "if" means "when the condition is true," the "then" means "take action A" andthe "else" means "when the condition is not true take action B." □ Here is an example with the rule PROBABLE CAUSE: □ IF robbery is TRUE AND suspect witness identification is TRUE AND suspect physical evidence is TRUE AND suspect lacks alibi is TRUE THEN probable cause is TRUE ELSE round up usual suspects -
Black-board Reasoning □ A blackboard system is an artificial intelligence
application based on the blackboard architectural model, where a common knowledge base, the "blackboard", is iteratively updated by a diverse group of specialist knowledge sources, starting with a problem specification and ending with a solution. □ Each knowledge source updates the blackboard with a partial solution when its internal constraints match the blackboard state. □ In this way, the specialists work together to solve the problem. □ The blackboard model was originally designed as a way to handle complex, ill- defined problems, where the solution is the sum of its parts. -
Truth Maintenance System □ Necessary when changes in the fact-base
lead to inconsistency / incorrectness among the facts non-monotonic reasoning □ A Truth Maintenance System tries to adjust the Knowledge Base or Fact Base upon changes to keep it consistent and correct. □ A TMS uses dependencies among facts to keep track of conclusions and allow revision / retraction of facts and conclusions. -
Confidence Factor (CF) □ A certainty factor (CF) is a
number that reflects the degree of belief in a hypothesis. □ Positive certainty factors indicate that there is evidence that the hypothesis is valid. □ The larger the CF, the greater is the belief in the hypothesis. □ When CF is 1, the hypothesis is known to be correct. □ Negative CF suggests that the hypothesis is false. □ A small CF indicates that there is a greater belief that the hypothesis is invalid. □ CF -1 implies that the hypothesis is effectively disapproved. □ CF o implies that there is neither evidence regarding the hypothesis being true nor false. -
Reason for uncertainty □ Due to incomplete knowledge □ Due
to incorrect knowledge □ Data derived from assumptions □ Inconsistency between knowledge from different experts □ Bad choice of knowledge representation mechanism □ Incomplete because of some conditions are unknown □ Uncertainty in rules or inference process -
Approacuhnecseo f r e asoning under rtainty □ Symbolic reasoning
□ Statistical reasoning □ Fuzzy logic reasoning -
Symbolic Reasoning □ Monotonic and non-monotonic reasoning (defined already) □
Non-monotonic: 1. Default reasoning: The conclusions are drawn based on what is most likely to be true. 2. Circumscriptionfo:rTmoaflo hfe gcuoem izremdarliuzlee to sm s tohnatsceannse beasusuem d patlioonngs.wItitihs tahe rules of inference of FOL. 3. Truth maintenance system (already discussed). -
Statistical Reasoning □ In logic based reasoning, we believe that
everything is either TRUE or FALSE. □ However, it is often useful to represent the fact that we believe such that something is probably true □ This is useful for dealing with problems where there is Randomness and Unpredictability and also for dealing with problems where we could, if we had sufficient information, work out exactly what is true. □ To do all this in a principled way requires techniques for Probabilistic Reasoning. Further, first we will discus Bayesian Probability Theory and then, later on, how uncertainties are treated.