Presentation 3
Presentation 3
Predicates logic
• Predicate logic, also known as first-order logic, is an extension of
propositional logic that introduces additional elements to represent
relationships and properties involving objects. The key components of
predicate logic are predicates and quantifiers.
• Predicates:
• Predicate Symbols: In predicate logic, propositions can contain
predicate symbols that represent relationships or properties. A
predicate symbol followed by its arguments forms a predicate,
denoting a relation or property.
Predicates logic
• Examples:
• P (x): "x is a person."
• Q (x,y): "x loves y."
• R (x,y,z): "x is the parent of y and z."
• Variables in Predicates: Predicates can include variables, allowing
for generalizations and quantifications over individuals.
Quantifiers
Facts Rules
Note that we selected the facts and the rule that would help us prove son(Barney,Adam).
•There's only one rule that allows us to infer the son relationship, so we included that rule.
•We need facts about the parent relationship that include reference to Adam and Barney.
•We need facts about the male relationship that include (possibly) Adam and Barney.
Example Proof with Quantifiers
Prove brother(Barney,Beth):
1. male(Barney). Fact 2
2. parent(Adam,Barney) Fact 9
3. parent(Adam,Beth) Fact 11
4. male(x) AND (E z)(parent(z,x) AND parent(z,y)) -> brother(x,y) Rule 3
5. male(Barney) AND (E z)(parent(z,Barney) AND parent(z,Beth)) -> brother(Barney,Beth) L4, sub
6. male(Barney) AND parent(Adam,Barney) AND parent(Adam,Beth) L1, L2, L3
7. brother(Barney,Beth) L5, L6, m.p.
Predicate logic better than propositional logic?
• Whether predicate logic is "better" than propositional logic depends on
the context and the specific requirements of a given logical task. Both
predicate logic and propositional logic serve different purposes and have
their own strengths and weaknesses.
• Propositional Logic:
• Simplicity: Propositional logic is simpler and more straightforward. It
deals with propositions and their combinations using logical connectives
(AND, OR, NOT).
• Limited Expressiveness: Propositional logic lacks the ability to
represent relationships between objects, quantify over individuals, or
express the internal structure of propositions.
Predicate logic better than propositional logic?
Cont…
• Predicate Logic:
• Expressiveness: Predicate logic is more expressive and allows for the
representation of relationships, properties, and quantifications over
objects. It can express complex statements involving variables,
predicates, and quantifiers.
• Increased Complexity: With increased expressiveness comes
increased complexity. Predicate logic is more intricate than
propositional logic and may require a deeper understanding of logic.
Predicate logic better than propositional logic?
Cont…
• Use Cases:
• Propositional Logic:
• Suitable for tasks where only truth values matter, and relationships between
objects are not a concern.
• Used in simple logical reasoning tasks and some areas of computer science
and artificial intelligence.
• Predicate Logic:
• Essential for representing relationships and properties of objects in a more
detailed and nuanced way.
• Widely used in knowledge representation, database query languages, natural
language processing, and more complex areas of AI and computer science.
Predicate logic better than propositional logic?
Cont…
• Considerations:
• Task Complexity: For simple tasks with no need for complex
relationships or quantification, propositional logic might be sufficient.
• Expressiveness Requirements: If the task involves intricate
relationships, properties, or quantification over individuals, predicate
logic is often necessary.
• Computational Complexity: Predicate logic may be computationally
more intensive than propositional logic due to its increased
expressiveness.
Predicate logic better than propositional logic?
Cont…
• Example:
• Consider the statement:
P: "It is raining."
Q: "John likes pizza."
• In propositional logic, we can say P∧Q to represent "It is raining, and John likes
pizza." However, if we want to express more complex statements involving
relationships or quantifications (e.g., "For all people, if they like pizza, then they
enjoy eating out."), predicate logic becomes necessary.
• In summary, whether predicate logic is better than propositional logic depends on
the nature of the logical task and the level of expressiveness and complexity
required for representation. Both logics have their applications, and the choice
depends on the specific needs of the problem at hand.
The notation of set theory
• Set theory is a branch of mathematical logic that studies sets, which are
collections of objects. The notation of set theory includes symbols and
conventions to represent various operations, relationships, and concepts related
to sets. Here are some commonly used symbols and notations in set theory:
• Basic Notations:
1.Set Notation:
1. A set is typically denoted by curly braces: A={1,2,3}.
2. The empty set is represented by ∅ or {}.
2.Element Relation:
1. a ∈ A: "a is an element of A."
2. b ∉ A:: "b is not an element of A."
The notation of set theory Cont..
• Set Operations:
1. Union:
• A∪B: Union of sets A and B (elements in either A or B or both).
2. Intersection:
• A∩B: Intersection of sets A and B (elements common to both A and B).
3. Complement:
• ′A′ or ‾A: Complement of set A (elements not in A).
4. Difference:
• A−B or A\B: Set difference (elements in A but not in B).
5. Cartesian Product:
• A×B: Cartesian product of sets A and B (set of ordered pairs).
The notation of set theory Cont..
• Set Relations:
1. Subset:
• A⊆B or A⊂B: A is a subset of B.
2. Proper Subset:
• A⊊B: A is a proper subset of B (A is a subset of B, but not equal to B).
3. Power Set:
• P(A): Power set of A (set of all subsets of A).
The notation of set theory Cont..
• Quantifiers:
1. Universal Quantifier:
• ∀: "For all" or "for every."
2. Existential Quantifier:
• ∃: "There exists" or "there is."
The notation of set theory Cont..
Special Sets:
1. Natural Numbers:
• N: Set of natural numbers.
2. Integers:
• Z: Set of integers.
3. Rational Numbers:
• Q: Set of rational numbers.
4. Real Numbers:
• R: Set of real numbers.
5. Complex Numbers:
• C: Set of complex numbers.
The notation of set theory Cont..
Set Builder Notation:
• Intersection (A∩B ) :
• The intersection of sets A and B, denoted by A∩B, is the set of all
elements that are common to both sets A and B.
A∩B={x ∣ x ∈ A and x ∈ B}
Example:
Let's consider two sets: A={1,2,3,4} B={3,4,5,6}
• The intersection of A and B, denoted as A∩B, is: = A∩B={3,4}
• In this case, the common elements between sets A and B are 3 and 4.
Set operations of complementation
Complementation ( ′A′ or ‾A ) :
• The complement of a set A, denoted by ′A′ or ‾A, is the set of all elements in a universal set U
that are not in A.
A′={x ∣ x ∈ / A}
• The complement is taken with respect to some universal set U, which contains all the
elements under consideration.
Example:
• Let's consider a universal set U={1,2,3,4,5} and a set A={2,4}. The complement of A,
denoted as ′A′, is:
A′={1,3,5}
• These are the elements in the universal set U that are not in A.
Set operations of Difference
• Difference ( A−B or A\B ) :
• The difference of sets A and B, denoted by A−B or A\B, is the set of all elements that are in A
but not in B.
A−B={x ∣ x ∈ A and x ∈ / B}
Example:
Let's consider two sets:
A={1,2,3,4} B={3,4,5,6}
• The difference of A and B, denoted as A−B or A\B, is:
A−B={1,2}
• In this case, the result contains all elements from set A that are not in set B.
Set operations of Cartesian product
Cartesian Product ( A×B )
• The Cartesian product of sets A and B, denoted by A×B, is the set of all ordered
pairs where the first element is from set A and the second element is from set B.
A×B={(a,b) ∣ a ∈ A and b ∈ B}
Example:
Let's consider two sets:
A={1,2} B={x,y}
• The Cartesian product of A and B, denoted as A×B, is:
A×B={(1,x),(1,y),(2,x),(2,y)}
• In this case, each ordered pair represents an element of the Cartesian product.
Venn diagrams
• Venn diagrams are visual representations used to illustrate the relationships
between sets. They are named after John Venn, who introduced them in the late
19th century. Venn diagrams use circles or other shapes to depict sets and their
intersections. Here are some key components and conventions of Venn diagrams:
• Basic Components:
1.Sets:
• Each set is represented by a circle or a closed curve. The region enclosed by the curve
represents the elements of the set.
2.Intersections:
• Overlapping regions between sets represent the elements common to those sets.
3.Regions:
• Non-overlapping regions represent elements unique to a particular set.
Venn diagrams Cont..
• Common Notations:
1. Union ( A∪B ):
• The union of sets A and B is represented by the entire area enclosed by both circles.
2. Intersection (A∩B ):
• The overlapping region between sets A and B represents the intersection of the sets.
3. Complementation ( ′A′ or ‾A ):
• The complement of set A is the region outside the circle representing A but inside
the universal set.
4. Difference (A−B ):
• The region in set A but not in set B represents the difference A−B.