0% found this document useful (0 votes)
17 views98 pages

Knowledge Representation

The document discusses knowledge representation in AI, emphasizing its importance for perceiving, reasoning, and acting. It outlines various types of knowledge, representation techniques, and the challenges faced in knowledge representation, such as incompleteness and ambiguity. Additionally, it covers logical representation, including propositional and predicate logic, and their roles in structuring knowledge for AI systems.

Uploaded by

supriyamiishra
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)
17 views98 pages

Knowledge Representation

The document discusses knowledge representation in AI, emphasizing its importance for perceiving, reasoning, and acting. It outlines various types of knowledge, representation techniques, and the challenges faced in knowledge representation, such as incompleteness and ambiguity. Additionally, it covers logical representation, including propositional and predicate logic, and their roles in structuring knowledge for AI systems.

Uploaded by

supriyamiishra
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/ 98

Knowledge Representation

Intelligent agents should have capacity for

• Perceiving, that is, acquiring information from environment,

• Knowledge Representation, that is, representing its understanding of the world,

• Reasoning, that is, inferring the implications of what it knows and of the choices it has, and

• Acting, that is, choosing what it want to do and carry it out


Knowledge Representation
• Deals with how information is stored, organized, and manipulated within AI systems.
• It serves as a bridge between the real world and the computational processes that AI systems use to
reason, make decisions, and solve problems.
• Knowledge representation refers to the methods and techniques used to capture and store information
in a format that can be used by AI systems to perform tasks such as reasoning, problem-solving, and
decision-making.
• The goal is to represent knowledge in a way that is both machine-readable and semantically
meaningful, allowing AI systems to understand and manipulate the information effectively.
Knowledge
• Knowledge can be defined as the body of facts and principles accumulated by humankind or the act,
fact, or state of knowing.
• Knowledge is having familiarity with language, concepts, procedures, rules, ideas, abstractions, places,
customs, facts, and associations, coupled with an ability to use theses notions effectively in modeling
different aspects of the world.
• The meaning of knowledge is closely related to the meaning of intelligence. Intelligent requires the
possession of and access to knowledge.
• Knowledge includes and requires the use of data and information. Knowledge combines relationships,
correlations, dependencies, and the notion of gestalt with data and information.
• A common way to represent knowledge external to a computer or a human is in the form of written
language.
Example:
• Ramu is tall – This expresses a simple fact, an attribute possessed by a person.
Types of Knowledge
• Procedural knowledge is compiled knowledge related to the performance of some task. For example, the
steps used to solve an algebraic equation.

• Declarative knowledge is passive knowledge expressed as statements of facts about the world. For
example, personnel data in a database, such data are explicit pieces of independent knowledge.
Knowledge Representation Language
A knowledge representation language is defined by two aspects:
• Syntax: The syntax of a language defines which configurations of the components of the language
constitute valid sentences.
• Semantics: The semantics defines which facts in the world the sentences refer to, and hence the
statement about the world that each sentence makes.
Some Other Terminologies
• Belief is a meaningful and coherent expression. Thus, belief may be true or false.

• Hypothesis is defined as a belief which is backed up with some supporting evidence, but it may still be
false.

• Knowledge is true justified belief.

• Epistemology is the study of the nature of knowledge.

• Metaknowledge is knowledge about knowledge, that is, knowledge about what we Know.
Importance of Knowledge Representation
• Facilitating Reasoning and Problem Solving: Knowledge representation provides a structured framework for organizing
and storing information. This organization is essential for AI systems to perform logical reasoning, problem-solving,
and decision-making. By representing knowledge in a machine-readable format, AI can manipulate and process
information effectively.
• Enabling Inference: Inference is the process of deriving new information or conclusions from existing knowledge.
Knowledge representation allows AI systems to perform inference by applying logical rules or patterns to the stored
information. This ability is critical for drawing meaningful insights and making predictions.
• Supporting Natural Language Processing: Language understanding is a complex task that relies on the ability to
represent and process knowledge. Knowledge representation models, such as semantic networks and ontologies, help AI
systems interpret and generate human language, enabling chatbots, language translation, and sentiment analysis.
• Handling Uncertainty: Real-world knowledge often involves uncertainty, incomplete information, or conflicting data.
Knowledge representation techniques, such as probabilistic models and fuzzy logic, enable AI systems to handle and
reason with uncertain or imprecise knowledge effectively.
• Integration of Multimodal Data: Modern AI systems deal with diverse types of data, including text, images, videos, and
sensor data. Knowledge representation allows for the integration of heterogeneous data sources into a unified
Importance of Knowledge Representation
• Domain Expertise: AI systems often need to capture domain-specific knowledge, such as medical expertise, legal
regulations, or engineering principles. Knowledge representation facilitates the encoding and utilization of this
specialized knowledge, making AI systems domain-aware and capable of providing expert advice.
• Adaptation and Learning: AI systems can continuously update their knowledge bases to adapt to changing
environments or evolving domains. This adaptability is essential for keeping AI systems relevant and up-to-date.
• Efficiency and Resource Management: Knowledge representation helps optimize the use of computational resources. It
allows AI systems to focus on relevant information and reduce the computational burden by ignoring irrelevant or
redundant data.
• Ethical AI: Transparent knowledge representation can help address ethical concerns in AI. By making the decision-
making process more understandable and interpretable, it becomes easier to identify and mitigate biases and
unfairness in AI systems.
• Transfer Learning: Well-designed knowledge representations can be reused across different AI applications, enabling
transfer learning. This means that knowledge learned in one domain can be applied to new, related domains, reducing
the need for extensive retraining.
Properties for Good Knowledge Representation
• Representational Adequacy: the ability to represent all the different kinds of knowledge that might be
needed in that domain.

• Inferential Adequacy: It is the ability to manipulate the knowledge represented to produce new
knowledge corresponding to that inferred from the original.

• Inferential Efficiency: The ability to direct the inferential mechanisms into the most productive
directions by storing appropriate guides.

• Acquisitional Efficiency: The ability to acquire new knowledge using automatic methods wherever
possible rather than reliance on human intervention.
Types of Knowledge Representation Techniques
1. Semantic Networks:
• Description: Semantic networks represent knowledge using nodes and links, where nodes represent concepts or
objects, and links represent relationships between them.
• Usage: They are used for organizing and representing hierarchical knowledge and capturing relationships between
entities. Commonly used in natural language processing and knowledge-based systems.
2. Frames:
• Description: Frames are structured data structures that contain slots for attributes and values. They represent
objects or concepts and their properties.
• Usage: Frames are suitable for representing structured knowledge about objects or concepts, such as properties,
behaviors, and relationships. Often used in expert systems.
3. Rules-Based Systems:
• Description: Rule-based systems use a collection of rules that encode knowledge in the form of condition-action
pairs. When conditions are met, corresponding actions are executed.
• Usage: Rule-based systems are used for representing knowledge with explicit rules and conditions, making them
Types of Knowledge Representation Techniques
4. Ontologies:
• Description: Ontologies define a formal, explicit specification of a shared conceptualization. They consist of classes,
properties, and instances to represent knowledge about a domain.
• Usage: Ontologies are used for capturing structured and semantically rich knowledge, enabling interoperability
between different systems and facilitating information sharing on the web (Semantic Web).
5. First-Order Logic:
• Description: First-order logic represents knowledge using logical predicates, quantifiers, and variables. It allows for
precise and formal representation of relationships and facts.
• Usage: First-order logic is essential for knowledge representation in symbolic AI systems, theorem proving, and
formal reasoning.
6. Probabilistic Models:
• Description: Probabilistic models, such as Bayesian networks and Markov networks, represent knowledge using
probabilities to capture uncertainty in data and relationships.
• Usage: They are used in AI systems where uncertainty is a crucial factor, such as medical diagnosis, natural
Types of Knowledge Representation Techniques
7. Fuzzy Logic:
• Description: Fuzzy logic represents knowledge that is imprecise or has degrees of truth. It uses fuzzy sets and
membership functions to handle uncertainty.
• Usage: Fuzzy logic is applied in systems that deal with vague or uncertain information, such as fuzzy control
systems and linguistic modeling.
8. Neural Networks:
• Description: Neural networks, including deep learning models, represent knowledge through a hierarchy of
interconnected artificial neurons, mimicking the structure of the human brain.
• Usage: Neural networks are used for learning and representing patterns in data, making them suitable for
various AI applications like image recognition, natural language processing, and reinforcement learning.
9. Concept Maps:
• Description: Concept maps visually represent knowledge using nodes (concepts) and labeled arcs (relationships).
They are often used to illustrate conceptual relationships.
• Usage: Concept maps are valuable for knowledge visualization, brainstorming, and educational purposes.
Types of Knowledge Representation Techniques
10. Textual and Knowledge Graphs:
1. Description: Textual and knowledge graphs represent knowledge by extracting structured information from text
or unstructured data. They create graph structures with entities and relationships.
2. Usage: These techniques are used in natural language processing and information retrieval for organizing and
linking textual information.

• These are some of the prominent knowledge representation techniques in AI, each tailored to specific
knowledge domains and applications.

• The choice of technique depends on the nature of the knowledge to be represented and the
requirements of the AI system being developed.
Issues of Knowledge Representation
1. Incompleteness: Representing all aspects of real-world knowledge is challenging. Real-world knowledge is
vast, constantly evolving, and sometimes subjective. Capturing every detail is often impossible, leading to
incomplete representations.
2. Ambiguity: Many concepts and entities in the real world can have multiple interpretations or meanings.
Handling ambiguity in knowledge representation is difficult but essential for accurate AI reasoning.
3. Scalability: As the volume of data and knowledge grows, representing and managing large knowledge bases
become computationally expensive and challenging.
4. Formalism: Selecting the appropriate formalism for knowledge representation is crucial. Different problems
may require different representation languages, such as propositional logic, first-order logic, frames,
semantic networks, or ontologies.
5. Expressiveness vs. Efficiency: There is often a trade-off between the expressiveness of a knowledge
representation language and its computational efficiency. More expressive languages can represent complex
knowledge but may require more computational resources.
Issues of Knowledge Representation
6. Integration of Heterogeneous Data: Combining structured and unstructured data, such as text, images, and
sensor data, into a unified knowledge representation is a significant challenge in modern AI systems.
Integrating data from diverse sources while preserving context and semantics can be complex.
7. Maintenance and Updating: Real-world knowledge is dynamic, and AI systems must be able to update their
knowledge bases to reflect changes in the environment or domain.
8. Knowledge Acquisition: The process of acquiring and updating knowledge for AI systems can be time-
consuming and expensive, requiring human experts or automated methods like natural language
processing.
9. Contextual Understanding: Representing and understanding knowledge in context is critical. Information
may have different meanings depending on the context in which it is used.
10. Cognitive Biases and Ethical Concerns: Knowledge representation can inadvertently inherit biases present in
the data it is trained on, leading to ethical concerns and unfair decision-making in AI systems.
11. Common-Sense Reasoning: Capturing common-sense knowledge, which humans often take for granted, is a
Propositional and Predicate Logic
What is Logic?
• "Logic" typically refers to formal logic, a branch of mathematics and philosophy that deals with
reasoning and inference.
• Logic plays a fundamental role in AI because it provides a structured and rigorous framework for
representing and manipulating knowledge, making decisions, and solving problems.
• As per the definition of the Oxford dictionary, Logic is "the reasoning conducted or assessed according
to strict principles and validity".
• A logic is a formal language, with precisely defined syntax and semantics, which supports sound
inference. Different logics exist, which allow you to represent different kinds of things, and which allow
more or less efficient inference.
• The logic may be different types like propositional logic, predicate logic, modal logic, fuzzy logic,
description logic, temporal logic, paraconsistent logic, and many-valued logic
Types of Logics
1. Deductive logic: In deductive logic, the complete evidence is provided about the truth of the conclusion
made. Here, the agent uses specific and accurate premises that lead to a specific conclusion. An
example of this logic can be seen in an expert system designed to suggest medicines to the patient. The
agent gives the complete proof about the medicines suggested by it, like the particular medicines are
suggested to a person because the person has so and so symptoms.

1. Inductive logic: In Inductive logic, the reasoning is done through a ‘bottom-up’ approach. What this
means is that the agent here takes specific information and then generalizes it for the sake of complete
understanding. An example of this can be seen in the natural language processing by an agent in
which it sums up the words according to their category, i.e. verb, noun article, etc., and then infers the
meaning of that sentence.
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.
• 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:
• The meanings of the atomic symbols of the logic.
Logical Representation

Propositional Logic
• Propositional logic, also known as sentential logic, is that branch of logic that studies ways of combining
or altering statements or propositions to form more complicated statements or propositions.

Predicate logic
• Predicate logic, first-order logic or quantified 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.
Propositional Logic
• Propositional logic (PL) is the simplest form of logic where all the statements are made by propositions.
• A proposition is a declarative sentence (a sentence that declares a fact) that is either true or false, but
not both.
• It is a technique of knowledge representation in logical and mathematical form.
• Propositional logic is also called Boolean logic as it works on 0 and 1.
• Statements which are questions, commands, or opinions are not propositions.
• Also know as Zero-Order Logic. Yes
Are the following sentencesYespropositions?
• Toronto isYesthe capital of Canada.
No
• Read this carefully.No
• 1+2=3
Propositional Logic - Concept
• Propositional Variables – variables that represent propositions: p, q, r, s
• E.g. Proposition p – “Today is Friday.”

• Truth values – T, F

• Negation – Let p be a proposition. The negation of p, denoted by ¬p, is the statement “It is not the case
that p.” The proposition ¬p is read “not p.” The truth value of the negation of p, ¬p is the opposite of the
truth value of p.
• E.g. Proposition ¬ p – “Today is not Friday.”

• Literal is an atomic sentence or its negation (P, ¬P)


• Logical operators are used to form new propositions from two or more existing propositions. The logical
Truth Table
• A truth table is a mathematical table used in logic to represent the possible values of logical
expressions.
• It shows all the possible combinations of inputs and the corresponding output for a given logical
expression.
• A truth table shows how the truth or falsity of a compound statement depends on the truth or falsity of
the simple statements from which it's constructed.

• A proposition formula which is always true is called Tautology, and it’s also called a valid sentence.
Propositional Logic

Atomic Propositions
• Atomic propositions are the simple propositions. It consists of a single proposition symbol.
These are the sentences which must be either true or false. E.g., "The Sun is cold"

Compound Propositions
• Compound propositions are constructed by combining simpler or atomic propositions, using
parenthesis and logical connectives. E.g., "It is raining today, and street is wet."
Propositional Logic Connectives
• Negation: A sentence such as ¬ P is called negation of P. A literal can be either Positive literal or negative
literal.
• Conjunction: A sentence which has ∧ (AND) 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.
so, we can write as P∧ Q.
• Disjunction: A sentence which has ∨ (OR) connective, such as P ∨ Q is called disjunction, where P and Q
are the propositions. Exclusive Disjunction (XOR) Only one of the A & B will be true.
• Example: "Ritika is a doctor or Engineer", Here P= Ritika is Doctor. Q= Ritika is Engineer, so we can write it as P ∨ Q.
• Implication: A sentence such as P → Q, is called an implication. Implications are also known as if-then
rules.
• Example: “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
• Biconditional: A sentence such as P⇔ Q is a Biconditional sentence if it a conditional statement
combined with its converse : if P, then Q and if Q, then P. Also called “iff”.
Propositional Logic Connectives
Propositional Logic Connective - Truth Table

AND OR Implication Biconditional


Truth Tables of Compound Propositions
• We can use connectives to build up complicated compound propositions involving any number of
propositional variables, then use truth tables to determine the truth value of these compound
propositions.
• Example: Construct the truth table of the compound proposition
• (p ν ¬q) → (p Λ q).
How be an English sentence translated into a logical expression?
• Translating an English sentence into a logical expression involves representing the meaning of the
sentence using formal logic symbols and operators. This process is known as formalization.
1. Identify the Propositions: Start by identifying the key propositions or statements within the sentence.
These are the pieces of information that you want to represent logically. Propositions are usually
represented by letters or symbols.
2. Define Logical Operators: Determine the logical operators that connect the propositions. Common
logical operators include AND (∧), OR (∨), NOT (¬), IMPLIES (→), and IF AND ONLY IF (↔). Use
these operators to express the relationships between the propositions.
3. Express Logical Relationships: Use the logical operators to express the logical relationships between the
propositions identified in step 1. Pay attention to the meaning of the sentence to ensure you capture the
correct relationships.
4. Parentheses for Clarity: Use parentheses to clarify the order of operations, just as you would in
How be an English sentence translated into a logical expression?
• “You cannot ride the roller coaster if you are under 4 feet tall unless you are older than 16 years old.”

• Solution: Let q, r, and s represent “You can ride the roller coaster,” “You are under 4 feet tall,” and “You
are older than 16 years old,” respectively.
• Then the sentence can be translated to (r ∧¬s)→¬q.

• “You can access the Internet from campus only if you are a computer science major or you are not a
freshman.”

• Solution: Let a, c, and f represent “You can access the Internet from campus,” “You are a computer
science major,” and “You are a freshman.”
• The sentence can be translated into: a → (c ∨ ¬f).
Precedence of Logic Connectives
• We can use parentheses to specify the order in which logical operators in a compound proposition are
to be applied.
• To reduce the number of parentheses, the precedence order is defined for logical operators.

E.g. ¬p Λ q = (¬p ) Λ q
p Λ q ν r = (p Λ q ) ν r
p ν q Λ r = p ν (q Λ r)
Tautology, Contradiction, Contingency & Satisfiability
• The terms tautology, contradiction, contingency, and satisfiability are used to describe the nature of
logical statements or formulas. Each term characterizes different aspects of the truth values of these
statements.
• Tautology:
• Definition: A tautology is a logical statement or formula that is always true, regardless of the truth
values of its individual components or variables. In other words, it has a truth value of "true" for
every possible assignment of truth values to its variables.
• Example: The statement "(P ∨ ¬P)" is a tautology because it is always true. It represents the law of
excluded middle, stating that either "P" is true or "¬P" (not P) is true.
• Contradiction:
• Definition: A contradiction is a logical statement or formula that is always false, regardless of the
truth values of its individual components or variables. It has a truth value of "false" for every possible
assignment of truth values to its variables.
Tautology, Contradiction, Contingency & Satisfiability
• Example: The statement "(P ∧ ¬P)" is a contradiction because it is always false. It represents a
situation where "P" is simultaneously true and false, which is logically impossible.
• Contingency:
• Definition: A contingency is a logical statement or formula that is neither a tautology nor a
contradiction. It can be true for some assignments of truth values to its variables and false for others,
depending on the specific values chosen.
• Example: The statement "P" is a contingency because its truth value depends on the value assigned
to "P." If "P" is true, the statement is true; if "P" is false, the statement is false.
• Satisfiability:
• Definition: A statement or formula is satisfiable if there exists at least one assignment of truth values
to its variables that makes it true. In other words, a statement is satisfiable if it can be made true
under some conditions.
• Example: The statement "(P ∨ Q)" is satisfiable because it can be made true by assigning "P" or "Q" (or both) to true.
Tautology, Contradiction, Contingency & Satisfiability
Tautology vs. Contradiction:
• A tautology is always true, while a contradiction is always false.
• These are opposite extremes of logical statements, with tautologies being overly permissive and
contradictions being overly restrictive.
Tautology and Contradiction Relationship:
• A statement cannot be both a tautology and a contradiction. These are mutually exclusive categories.
• A statement can be a contingency and a tautology (if it is sometimes true and always true), or a
contingency and a contradiction (if it is sometimes true and always false).
Tautology, Contradiction, Contingency & Satisfiability
Contingency vs. Satisfiability:
• A contingency is a statement that can be either true or false depending on the assignment of truth
values to its variables.
• Satisfiability refers to the property of a statement being capable of being made true under some
assignment of truth values.
• All tautologies are not needing proof for contingencies or satisfiable because they are always true.
Similarly, all contradictions are not contingencies or satisfiable because they are always false.
• Contingent statements can be satisfiable if there exists an assignment that makes them true, or they
can be unsatisfiable if no assignment makes them true.
Validity and Inference
• "Validity" and "inference" are two fundamental concepts in logic and critical thinking. They are closely
related and often used when evaluating arguments and reasoning.
• An interpretation is the process for assignment of True or False to each atomic proposition.
• Validity refers to the property of an argument in which the conclusion logically follows from the
premises(or hypothesis). In other words, an argument is valid if, assuming all the premises are true, it
is impossible for the conclusion to be false.
• A sentence that is true under any interpretation is valid (also called a tautology or analytic sentence).
• For example, consider the following argument:
• Premise 1: All humans are mortal.
• Premise 2: Socrates is a human.
• Conclusion: Therefore, Socrates is mortal.
• This argument is valid because the conclusion logically follows from the premises. If the premises are
Validity and Inference
• Validity can be checked by exhaustively exploring each possible interpretation in a truth table:

• An inference is the process of drawing a conclusion based on available evidence or premises. It is the act
of reasoning from one or more statements to reach a logical judgment or deduction.
• Inferences can be either deductive or inductive:
1. Deductive Inference: In a deductive inference, if the premises are true, the conclusion must be true. Deductive
reasoning aims for certainty. The example given above about Socrates is an example of a deductive inference.
2. Inductive Inference: In an inductive inference, the conclusion is likely but not guaranteed to be true based on the
Relationship between Validity and Inference
• Validity is a property of an argument itself. An argument is either valid or invalid based on its logical
structure.

• Inference, on the other hand, is the act of using reasoning to draw conclusions. Inferences can be valid
or invalid based on the quality of reasoning and the relationship between the premises and conclusion.

• A valid argument is one where the conclusion follows logically from the premises. In other words, if the
argument is valid, then the inference made in that argument is valid as well.

• In everyday language, people might refer to "making a valid inference" when they mean "making a
correct inference," but it's important to distinguish between the validity of an argument and the
correctness of an inference. A valid argument can have true premises and a true conclusion (a correct
Rules of Inference
• Rules of inference are fundamental
principles or logical techniques used to
draw valid conclusions from given
premises in deductive reasoning.
• These rules help ensure that the
conclusions are logically sound and
follow from the premises.
• There are several well-established rules
of inference.
• A |- B denotes that B can be derived by
some inference procedure from the set
of sentences A.
• The symbol “∴”, (read therefore) is
placed before the conclusion.
Rules of Inference - Examples
Addition: If P is a premise, we can use Addition rule to derive P∨Q
• Example: Let P be the proposition, “He studies very hard” is true. Therefore − "Either he studies very hard Or he
is a very bad student." Here Q is the proposition “he is a very bad student”.
Conjunction: If P and Q are two premises, we can use Conjunction rule to derive P∧Q
• Example: Let P − “He studies very hard”. Let Q − “He is the best boy in the class”. Therefore − "He studies very
hard and he is the best boy in the class“.
Simplification: If P∧Q is a premise, we can use Simplification rule to derive P.
• Example: "He studies very hard and he is the best boy in the class", P∧Q. Therefore − "He studies very hard“.x`
Modus Ponens: If P and P→Q are two premises, we can use Modus Ponens to derive Q.
• Example: "If you have a password, then you can log on to facebook", P→Q. "You have a password", P. Therefore
− "You can log on to facebook“.
Modus Tollens: If P→Q and ¬Q are two premises, we can use Modus Tollens to derive ¬P
Rules of Inference - Examples
Disjunctive Syllogism: If ¬P and P∨Q are two premises, we can use Disjunctive Syllogism to derive Q.
• Example: "The ice cream is not vanilla flavored", ¬P. "The ice cream is either vanilla flavored or chocolate
flavored", P∨Q. Therefore − "The ice cream is chocolate flavored”.
Hypothetical Syllogism: If P→Q and Q→R are two premises, we can use Hypothetical Syllogism to derive P→R.
• Example: "If it rains, I shall not go to school”, P→Q. "If I don't go to school, I won't need to do homework",
Q→R. Therefore − "If it rains, I won't need to do homework“.
Constructive Dilemma: If (P→Q)∧(R→S) and P∨R are two premises, we can use constructive dilemma to derive
Q∨S.
• Example: “If it rains, I will take a leave”, (P→Q). “If it is hot outside, I will go for a shower”, (R→S). “Either it
will rain or it is hot outside”, P∨R. Therefore − "I will take a leave or I will go for a shower“.
Destructive Dilemma: If (P→Q)∧(R→S) and ¬Q∨¬S are two premises, we can use destructive dilemma to derive
¬P∨¬R.
• Example: “If it rains, I will take a leave”, (P→Q). “If it is hot outside, I will go for a shower”, (R→S). “Either I
Propositional vs. Predicate Logic
• In propositional logic, each possible atomic fact requires a separate unique propositional symbol.
• If there are n people and m locations, representing the fact that some person moved from one location
to another requires nm2 separate symbols.

• Predicate logic includes a richer ontology:


• objects (terms)
• properties (unary predicates on terms)
• relations (n-ary predicates on terms)
• functions (mappings from terms to other terms)
• Allows more flexible and compact representation of knowledge
• e.g.: Move(x, y, z) for person x moved from location y to z.
Predicate Logic
• Predicate logic is an extension of propositional logic that permits concisely reasoning about whole
classes of entities.
E.g., “x>1”, “x+y=10”, “x is an animal”
• Such statements are neither true or false when the values of the variables are not specified.
• Thus, these are not propositions.
• It extends propositional logic by introducing variables, quantifiers, and predicates, making it a powerful
tool for knowledge representation and inference in AI.
• It is the formal notation for writing perfectly clear, concise, and unambiguous mathematical
definitions, axioms, and theorems for any branch of mathematics.
• Supported by some of the more sophisticated database query engines.
• Basis for automatic theorem provers and many other Artificial Intelligence systems.
Subjects and Predicates
• The subject and predicate are fundamental components of a logical statement or formula that describe
the relationships and properties of objects within a domain.
• The proposition – “The dog is sleeping” – has two parts:
• “the dog” denotes the subject – the object or entity that the sentence is about. It is typically a
variable that takes on specific values from the domain of discourse.
• “is sleeping” denotes the predicate – a property relationship, or characteristic that one or more
subjects can have. It is a function or relation that takes arguments (variables) and returns a truth
value (true or false).

• You can see how the subject and predicate work together to represent relationships and properties
within a logical framework.
• Predicate logic allows for the precise description of various facts and relationships within a domain.
Pros of Predicate Logic
• Predicate Logic assumes that the world contains:
• Objects
• E.g. people, houses, numbers, theories, colors, football games, wars, centuries, …

• Relations
• E.g. red, round, prime, bogus, multistoried, brother of, bigger than, inside, part of, has color,
occurred after, owns, comes between, …

• Functions
• E.g. father of, best friend, third quarter of, one more than, beginning of, …
Elements of Predicate Logic
• Variables: Predicate logic uses variables (usually represented by letters like x, y, z) to represent objects
or entities whose properties and relationships we want to describe. Variables allow us to express general
statements that apply to a range of individuals.

• Predicates: Predicates are functions or relations that take one or more arguments and return a truth
value (true or false). They represent properties or relationships between objects. Predicates are usually
denoted by uppercase letters and can be customized to represent various concepts (e.g.,
"IsMarriedTo(x, y)" to express the marriage relationship).

• Connectives: Predicate logic also uses logical connectives, similar to propositional logic, to combine and
manipulate propositions. Common connectives include AND (∧), OR (∨), NOT (¬), IMPLIES (→), and
IF AND ONLY IF (↔).
Elements of Predicate Logic
• Quantifiers: Predicate logic introduces quantifiers to specify the scope of variables in a statement.
1. Universal Quantifier (∀): Denoted by ∀, it represents "for all" or "for every." It asserts that a statement is
true for all possible values of a variable. For example, ∀x P(x) means "For all x, P(x) is true."

1. Existential Quantifier (∃): Denoted by ∃, it represents "there exists" or "there is at least one." It asserts
that there is at least one value of a variable for which a statement is true. For example, ∃x P(x) means
"There exists an x for which P(x) is true."
T
T
T
T
T
T
T
T
T
T
T
T
T
T
T
T
T
T
T
T
T
T
“Thank you for being such an
engaged audience during my
presentation.”

You might also like