0% found this document useful (0 votes)
7 views26 pages

5 Knowledge Representation

The document discusses knowledge representation in Artificial Intelligence, emphasizing the importance of choosing the right representation for AI agents to handle facts, procedures, and meanings effectively. It outlines various representation schemes, including logical representations, production rules, and semantic networks, while explaining the syntax and semantics of logic. The document also highlights the flexibility of frame representations and the ability to express non-logical representations in first-order logic, ensuring clarity and ease of reasoning.

Uploaded by

anshikam220
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views26 pages

5 Knowledge Representation

The document discusses knowledge representation in Artificial Intelligence, emphasizing the importance of choosing the right representation for AI agents to handle facts, procedures, and meanings effectively. It outlines various representation schemes, including logical representations, production rules, and semantic networks, while explaining the syntax and semantics of logic. The document also highlights the flexibility of frame representations and the ability to express non-logical representations in first-order logic, ensuring clarity and ease of reasoning.

Uploaded by

anshikam220
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 26

Artificial Intelligence -

KnowledgeRepresentation

By
Lecture Delivered on:
Manish Kumar Sharma 08/11/2021
Assistant Professor
Representation
• AI agents deal with knowledge (data)
– Facts (believe & observe knowledge)
– Procedures (how to knowledge)
– Meaning (relate & defineknowledge)
• Right representation is crucial
– Early realisation in AI
– Wrong choice can lead to project failure
– Active research area
Choosing a Representation

• For certain problem solvingtechniques


– ‘Best’ representation already known
– Often a requirement of the technique
– Or a requirement of the programming language (e.g. Prolog)
• Examples
– First order theorem proving… first order logic
– Inductive logic programming… logic programs
– Neural networks learning… neural networks
• Some general representation schemes
– Suitable for many different (and new) AI applications
Some General Representations

1. Logical Representations
2. Production Rules
3. Semantic Networks
• Conceptual graphs, frames
4. Description Logics (seetextbook)
What is a Logic?

• A language with concrete rules


– No ambiguity in representation (may be other errors!)
– Allows unambiguous communication and processing
– Very unlike natural languages e.g. English
• Many ways to translate betweenlanguages
– A statement can be represented in different logics
– And perhaps differently in same logic
• Expressiveness of a logic
– How much can we say in this language?
• Not to be confused withlogical reasoning
– Logics are languCSa86g9e1-sA,I-KrNeOaWsLoEDnGiEnRgEPRisESaENTpArTIoONcess(may use logic)
Syntax and Semantics

• Syntax
– Rules for constructing legal sentences in the logic
– Which symbols we can use (English: letters, punctuation)
– How we are allowed to combine symbols
• Semantics
– How we interpret (read) sentences in the logic
– Assigns a meaning to each sentence
• Example: “All lecturers are seven foot tall”
– A valid sentence (syntax)
– And we can understand the meaning (semantics)
– This sentence haCpS8p69e1n-AsI-KtNoOWbLeEDfGaElRsEePREtS(EhNeTArTeIONisa counterexample)
PropositionalLogic

• Syntax
– Propositions, e.g. “it is wet”
– Connectives: and, or, not, implies, iff (equivalent)

– Brackets, T(true) and F(false)


• Semantics (Classical AKABoolean)
– Define how connectives affect truth
• “P and Q” is true if and only if Pis true and Q is true
– Use truth tables to work out the truth of statements
PredicateLogic

• Propositional logic combines atoms


– An atom contains no propositional connectives
– Have no structure (today_is_wet, john_likes_apples)
• Predicates allow us to talk about objects
– Properties: is_wet(today)
– Relations: likes(john, apples)
– True or false
• In predicate logic each atom is apredicate
– e.g. first order logic, higher-order logic
First Order Logic

• More expressive logic thanpropositional


– Used in this course (Lecture 6 on representation in FOL)
• Constants are objects: john, apples
• Predicates are properties and relations:
– likes(john, apples)
• Functions transform objects:
– likes(john, fruit_of(apple_tree))
• Variables represent any object: likes(X, apples)
• Quantifiers qualify values of variables
– True for all objects (Universal): X. likes(X, apples)
Example: FOLSentence

• “Every rose has a thorn”

• For all X
– if (X is a rose)
– then there existsY
• (X has Y) and (Y is a thorn)
Example: FOLSentence

• “On Mondays and Wednesdays I go to John’s


house for dinner”

Note the change from “and” to “or”


– Translating is problematic
Higher OrderLogic

• More expressive than first order


• Functions and predicates are alsoobjects
– Described by predicates: binary(addition)
– Transformed by functions: differentiate(square)
– Can quantify over both
• E.g. define red functions as having zero at 17

• Much harder to reasonwith


Beyond True andFalse

• Multi-valued logics
– More than two truth values
– e.g., true, false & unknown
– Fuzzy logic uses probabilities, truth value in [0,1]
• Modal logics
– Modal operators define mode for propositions
– Epistemic logics (belief)
• e.g. p (necessarily p), p (possibly p), …
– Temporal logics (time)
• e.g. p (aClSw86a91y-AsI-KpNO),W LEDpGE(ReEPvREeSnENtTuATaIOlNlyp),…
Logic is a Good Representation

• Fairly easy to do the translationwhen possible


• Branches of mathematics devoted to it
• It enables us to do logicalreasoning
– Tools and techniques come for free
• Basis for programming languages
– Prolog uses logic programs (a subset of FOL)
– Prolog based on HOL
Non-Logical Representations?

• Production rules
• Semantic networks
– Conceptual graphs
– Frames

• Logic representations have restricitions andcan


be hard to work with
– Many AI researchers searched for better
representations
Production Rules

• Rule set of <condition,action> pairs


– “if condition then action”
• Match-resolve-act cycle
– Match: Agent checks if each rule’s condition holds
– Resolve:
• Multiple production rules may fire at once ( conflictset)
• Agent must choose rule from set ( conflict resolution)
– Act: If so, rule “fires” and the action is carried out
• Working memory:
– rule can write knowledge to working memory
– knowledge may match and fire other rules
Production RulesExample

• IF (at bus stop AND bus arrives) THEN action(get


on the bus)
• IF (on bus AND not paid AND have oyster card)
THEN action(pay with oyster) ANDadd(paid)
• IF (on bus AND paid AND empty seat) THEN sit
down

• conditions and actions must be clearlydefined


– can easily be expressed in first order logic!
Graphical Representation

• Humans draw diagrams all the time, e.g.


– Causal relationships

– And relationships between ideas


Graphical Representation

• Graphs easy to store in acomputer


• To be of any use must impose aformalism

– Jason is 15, Bryan is 40, Arthur is 70, Jim is 74


– How old is Julia?
Semantic Networks

• Because the syntax is the same


– We can guess that Julia’s age is similar to Bryan’s
• Formalism imposes restricted syntax
Semantic Networks

• Graphical representation (a graph)


– Links indicate subset, member, relation, ...
• Equivalent to logical statements (usuallyFOL)
– Easier to understand than FOL?
– Specialised SNreasoning algorithms can be faster
• Example: natural language understanding
– Sentences with same meaning have same graphs
– e.g. Conceptual Dependency Theory (Schank)
Conceptual Graphs

• Semantic network where each graph represents asingle


proposition
• Concept nodes can be
– Concrete (visualisable) such as restaurant, my dog Spot
– Abstract (not easily visualisable) such as anger
• Edges do not have labels
– Instead, conceptual relation nodes
– Easy to represent relations between multiple objects
FrameRepresentations

• Semantic networks where nodes havestructure


– Frame with a number of slots (age, height, ...)
– Each slot stores specific item of information
• When agent faces a new situation
– Slots can be filled in (value may be another frame)
– Filling in may trigger actions
– May trigger retrieval of other frames
• Inheritance of properties betweenframes
– Very similar to objects in OOP
Example: Frame Representation
Flexibility in Frames

• Slots in a frame can contain


– Information for choosing a frame in asituation
– Relationships between this and other frames
– Procedures to carry out after various slotsfilled
– Default information to use where input ismissing
– Blank slots: left blank unless required for atask
– Other frames, which gives a hierarchy

• Can also be expressed in first order logic


Representation & Logic
• AI wanted “non-logicalrepresentations”
– Production rules
– Semantic networks
• Conceptual graphs, frames
• But all can be expressed in first orderlogic!
• Best of both worlds
– Logical reading ensures representation well-defined
– Representations specialised for applications
– Can make reasoning easier, more intuitive

You might also like