UNIT 3
AI
Predicate Logic in AI is one of the most significant types of logic. Predicate
logic in AI is a formal framework for deducing relationships between objects
and their qualities. Furthermore, it is a mathematical language that enables
knowledge to be expressed precisely and unambiguously, making it perfect for
usage in AI systems.
Characteristics of Predicate Logic
Predicate Logic in AI has several characteristics that make it a powerful tool for
AI applications. Some of these characteristics are:
● The Logical inference is allowed.
● More accurate knowledge representation of facts of the real world.
● Program designing is its application area.
● Better theoretical foundation.
● A predicate with no variable is called a Ground Atom.
What is Predicate Logic in AI Example with a Solution?
Let's consider an example of Predicate Logic to understand better how it works.
Suppose we want to represent the following knowledge:
"All mammals are warm-blooded."
To represent this knowledge in Predicate Logic in AI, we would use the
following symbols:
How Is Predicate Logic Used
In Artificial Intelligence, Predicate Logic is used to describe and reason about
complex relationships between objects and their properties. It is especially
helpful for formalizing and logically representing knowledge about the world,
which can then be used to draw inferences and deductions. For example,
predicate logic in AI determines whether a member of a given set holds a given
property.
It breaks down basic sentences into smaller parts: predicates and individuals.
Predicate logic in AI even allows you to manage generalization
expressions(quantificational expressions). Predicate reasoning allows you to
discuss variables(pronouns). The pronoun's value is an individual in the
universe's domain that context decides.
It allows sentences containing quantificational expressions to be split into two
interpretive components. For example, a simple sentence containing a variable
or a pronoun (a placeholder) could be evaluated as true or false about a person
taken as a value for the pronoun.
The quantificational expression directs you to restrict the domain of people
under consideration to a relevant set. It indicates how many distinct pronoun
values from a particular domain must be considered to determine the sentence's
truth.
Representing instances and the "isa" (is-a) relationship is a fundamental concept
in object-oriented programming and knowledge representation. It's often used in
modeling real-world entities and their relationships in various domains. Here's
how you can represent them:
Instance and Isa Relationships:
pecific attributes instance and isa play important role particularly
in a useful form of reasoning called property inheritance.
The predicates instance and isa explicitly captured the
relationships they are used to express, namely class
membership and class inclusion.
Below figure shows the first five sentences of the last section
represented in logic in three different ways.
The first part of the figure contains the representations we have
already discussed. In these representations, class membership is
represented with unary predicates (such as Roman), each of which
corresponds to a class.
Asserting that P(x) is true is equivalent to asserting that x is an
instance (or element) of P.
The second part of the figure contains representations that use the
instance predicate explicitly.
Figure: Three ways of representing class membership
The predicate instance is a binary one, whose first argument is an
object and whose second argument is a class to which the object
belongs.
But these representations do not use an explicit isa predicate.
Instead, subclass relationships, such as that between Pompeians
and Romans, are described as shown in sentence 3.
The implication rule states that if an object is an instance of the
subclass Pompeian then it is an instance of the superclass Roman.
Note that this rule is equivalent to the standard set-theoretic
definition of the subclass-superclass relationship.
The third part contains representations that use both the instance
and isa predicates explicitly.
Computable functions and predicates:
Computable functions and predicates are fundamental concepts in computer
science, mathematics, and logic, particularly in the field of computability
theory. They deal with what can be computed algorithmically or mechanically.
Here's an explanation of each:
Computable Functions: A computable function is a mathematical function
or transformation that can be computed by an algorithm or a mechanical
procedure. It means there exists a Turing machine (or any equivalent
computational model) that, given an input, will produce the correct output
for that function.
For example, basic arithmetic operations like addition and multiplication
are computable functions. Given two numbers as input, a specific
algorithm or program can compute their sum or product.
The Church-Turing thesis asserts that anything that can be calculated
mechanically can be computed by a Turing machine or an equivalent
computational model. This forms the foundation of computability theory.
Computable Predicates: A computable predicate is a logical proposition
or statement that can be decided (answered as true or false) by an
algorithm or a mechanical procedure. In other words, it's a function that
maps inputs to either true or false, where the function itself is
computable.
For instance, checking if a number is prime is a computable predicate.
There are algorithms, such as the Sieve of Eratosthenes, that can
determine whether a given number is prime or not.
More generally, any property or condition that can be verified or falsified
algorithmically falls under the category of computable predicates.
Computable functions and predicates are central to the study of computability
theory and the foundations of computer science. They help define the limits of
what can be accomplished with algorithms and computational devices. The
concept of computability is essential in understanding the nature of problems
that can be solved by computers and those that are undecidable or unsolvable by
any algorithm. It's also closely related to the concept of decidability, which
deals with determining whether a given statement or problem can be solved
algorithmically.
Resolution:
Resolution is a fundamental concept in logic, particularly in the context of
automated theorem proving and propositional logic. It is a method used to
derive new logical conclusions from existing sets of logical statements (usually
in the form of clauses) to determine the satisfiability or validity of a given
logical formula. Resolution is a key component of resolution-based theorem
proving, which is a widely used technique in artificial intelligence and computer
science. Here's an overview of how resolution works:
Clausal Form: Resolution operates on logical statements that are typically
represented in clausal form. In clausal form, logical statements are
expressed as sets of clauses, where each clause is a disjunction (OR) of
literals. A literal is either a propositional variable or its negation. For
example, the clause (A OR B) represents the logical statement "A is true
or B is true."
Resolution Rule: The resolution rule is the core of the resolution method.
It states that if you have two clauses that contain complementary literals
(i.e., one clause contains a positive literal, and the other contains its
negation), you can resolve them by taking the union of the two clauses
while omitting the complementary literals. This process eliminates
redundancy and produces a new clause.
For example, if you have the clauses:
● Clause 1: (A OR B OR C)
● Clause 2: (¬A OR D OR E)
You can resolve them on the literal "A" and its negation "¬A" to get a
new clause:
● New Clause: (B OR C OR D OR E)
Refutation by Resolution: The resolution method is often used for
refutation, which means proving the unsatisfiability or inconsistency of a
set of clauses. To do this, you add the negation of the statement you want
to prove as a clause to your set of clauses (often referred to as a
knowledge base) and repeatedly apply the resolution rule until either you
derive an empty clause (indicating that the original set of clauses is
unsatisfiable) or you cannot apply the rule anymore.
If you reach an empty clause, you have successfully shown that the
negation of the statement you wanted to prove is true, implying the
original statement is false.
Resolution-based theorem proving is a foundational technique in automated
reasoning and logic programming. It is used in various applications, including
model checking, software verification, and solving logical puzzles. While it is
particularly well-suited for propositional logic, extensions and variations of the
resolution method exist for handling more complex logics, such as first-order
logic.
Representing knowledge using rules:
Representing knowledge using rules is a fundamental concept in artificial
intelligence and knowledge representation. Two primary paradigms for
representing knowledge using rules are procedural and declarative knowledge.
Additionally, there are two common reasoning strategies: forward reasoning and
backward reasoning, which are often used in logic programming. Finally, the
concept of matching is essential for both forward and backward reasoning. Let's
explore these concepts:
Procedural vs. Declarative Knowledge:
● Procedural Knowledge: This type of knowledge focuses on "how"
to do something. It involves a series of steps or procedures to
achieve a specific goal. Procedural knowledge is often represented
as algorithms or sequences of actions. In the context of rule-based
systems, procedural knowledge can be thought of as a set of rules
that dictate a sequence of actions or decisions.
● Declarative Knowledge: Declarative knowledge, on the other hand,
focuses on "what" is true or "what" is the case. It expresses facts,
relationships, and constraints without specifying how to use that
information. In the context of rule-based systems, declarative
knowledge is often represented as a set of rules or logical
statements that describe relationships and conditions.
Logic Programming:
● Forward Reasoning: In forward reasoning (also called forward
chaining), the system starts with the available facts and applies
rules to deduce new facts or conclusions. It continues this process
iteratively until no more conclusions can be drawn. This approach
is useful when you want to find out what can be inferred from the
given knowledge base.
● Backward Reasoning: In backward reasoning (also called
backward chaining), the system starts with a goal or query and
works backward to find a set of conditions or facts that must be
true to satisfy that goal. It recursively uses rules and subgoals to
reach the desired conclusion. Backward reasoning is often used in
query answering or goal-directed reasoning.
Matching:
● Matching: In the context of rule-based systems, matching refers to
the process of comparing facts or conditions in the knowledge base
to the patterns or antecedents in the rules. It involves checking
whether the conditions specified in a rule match the available facts.
Matching plays a crucial role in both forward and backward
reasoning.
For example, in the rule "If A is true and B is true, then C is true,"
matching involves checking if the conditions "A is true" and "B is true"
match the available facts in the knowledge base. If both conditions match,
the rule can be applied, and "C is true" becomes a new fact.
In summary, procedural knowledge is concerned with how to perform tasks,
while declarative knowledge focuses on stating facts and relationships. Logic
programming encompasses both forward and backward reasoning strategies,
which determine the direction in which inference is performed. Matching is the
process of comparing facts to rule conditions and is crucial for rule-based
reasoning in both procedural and declarative knowledge systems.