The document discusses predicate logic and its use in representing knowledge in artificial intelligence. It introduces several key concepts:
- Predicate logic uses predicates, constants, variables, functions and quantifiers to represent objects and their relations in a knowledge base.
- Well-formed formulas in predicate logic can be used to represent facts about the world. Logical inference rules like resolution and unification can be used to derive new facts or answer queries.
- Knowledge bases can be represented as sets of clauses in conjunctive normal form to apply inference rules like resolution and forward/backward chaining. Converting to clausal form involves techniques like Skolemization.
It covers knowledge representation techniques using propositional and predicate logic. It also discusses about the knowledge inference using resolution refutation process, rule based system and bayesian network.
It covers knowledge representation techniques using propositional and predicate logic. It also discusses about the knowledge inference using resolution refutation process, rule based system and bayesian network.
AI Greedy & A* Informed Search Strategies by ExampleAhmed Gad
Explaining how informed search strategies in Artificial Intelligence (AI) works by an example.
Two informed search strategies are explained by an example:
Greedy Best-First Search.
A* Search.
Find me on:
AFCIT
http://www.afcit.xyz
YouTube
https://www.youtube.com/channel/UCuewOYbBXH5gwhfOrQOZOdw
Google Plus
https://plus.google.com/u/0/+AhmedGadIT
SlideShare
https://www.slideshare.net/AhmedGadFCIT
LinkedIn
https://www.linkedin.com/in/ahmedfgad/
ResearchGate
https://www.researchgate.net/profile/Ahmed_Gad13
Academia
https://www.academia.edu/
Google Scholar
https://scholar.google.com.eg/citations?user=r07tjocAAAAJ&hl=en
Mendelay
https://www.mendeley.com/profiles/ahmed-gad12/
ORCID
https://orcid.org/0000-0003-1978-8574
StackOverFlow
http://stackoverflow.com/users/5426539/ahmed-gad
Twitter
https://twitter.com/ahmedfgad
Facebook
https://www.facebook.com/ahmed.f.gadd
Pinterest
https://www.pinterest.com/ahmedfgad/
Part of Lecture series on EE646, Fuzzy Theory & Applications delivered by me during First Semester of M.Tech. Instrumentation & Control, 2012
Z H College of Engg. & Technology, Aligarh Muslim University, Aligarh
Reference Books:
1. T. J. Ross, "Fuzzy Logic with Engineering Applications", 2/e, John Wiley & Sons,England, 2004.
2. Lee, K. H., "First Course on Fuzzy Theory & Applications", Springer-Verlag,Berlin, Heidelberg, 2005.
3. D. Driankov, H. Hellendoorn, M. Reinfrank, "An Introduction to Fuzzy Control", Narosa, 2012.
Please comment and feel free to ask anything related. Thanks!
Agreement Protocols, Distributed Resource Management: Issues in distributed File Systems, Mechanism for building distributed file systems, Design issues in Distributed Shared Memory, Algorithm for Implementation of Distributed Shared Memory.
AI Greedy & A* Informed Search Strategies by ExampleAhmed Gad
Explaining how informed search strategies in Artificial Intelligence (AI) works by an example.
Two informed search strategies are explained by an example:
Greedy Best-First Search.
A* Search.
Find me on:
AFCIT
http://www.afcit.xyz
YouTube
https://www.youtube.com/channel/UCuewOYbBXH5gwhfOrQOZOdw
Google Plus
https://plus.google.com/u/0/+AhmedGadIT
SlideShare
https://www.slideshare.net/AhmedGadFCIT
LinkedIn
https://www.linkedin.com/in/ahmedfgad/
ResearchGate
https://www.researchgate.net/profile/Ahmed_Gad13
Academia
https://www.academia.edu/
Google Scholar
https://scholar.google.com.eg/citations?user=r07tjocAAAAJ&hl=en
Mendelay
https://www.mendeley.com/profiles/ahmed-gad12/
ORCID
https://orcid.org/0000-0003-1978-8574
StackOverFlow
http://stackoverflow.com/users/5426539/ahmed-gad
Twitter
https://twitter.com/ahmedfgad
Facebook
https://www.facebook.com/ahmed.f.gadd
Pinterest
https://www.pinterest.com/ahmedfgad/
Part of Lecture series on EE646, Fuzzy Theory & Applications delivered by me during First Semester of M.Tech. Instrumentation & Control, 2012
Z H College of Engg. & Technology, Aligarh Muslim University, Aligarh
Reference Books:
1. T. J. Ross, "Fuzzy Logic with Engineering Applications", 2/e, John Wiley & Sons,England, 2004.
2. Lee, K. H., "First Course on Fuzzy Theory & Applications", Springer-Verlag,Berlin, Heidelberg, 2005.
3. D. Driankov, H. Hellendoorn, M. Reinfrank, "An Introduction to Fuzzy Control", Narosa, 2012.
Please comment and feel free to ask anything related. Thanks!
Agreement Protocols, Distributed Resource Management: Issues in distributed File Systems, Mechanism for building distributed file systems, Design issues in Distributed Shared Memory, Algorithm for Implementation of Distributed Shared Memory.
GDSC SSN - solution Challenge : Fundamentals of Decision MakingGDSCSSN
This session aims to provide participants with a comprehensive understanding of decision-making fundamentals in AI/ML, covering key concepts like reinforcement learning, different representations, and an exploration of current state-of-the-art methodologies.
Microprocessor and Computer Architecture note for BCA in Tribhuvan University and Purbanchal University, Prepared by Asst. Professor Bal Krishna Subedi
Microprocessor and Computer Architecture note for BCA in Tribhuvan University and Purbanchal University, Prepared by Asst. Professor Bal Krishna Subedi
Microprocessor and Computer Architecture note for BCA in Tribhuvan University and Purbanchal University, Prepared by Asst. Professor Bal Krishna Subedi
Microprocessor and Computer Architecture note for BCA in Tribhuvan University and Purbanchal University, Prepared by Asst. Professor Bal Krishna Subedi
Microprocessor and Computer Architecture note for BCA in Tribhuvan University and Purbanchal University, Prepared by Asst. Professor Bal Krishna Subedi
Palestine last event orientationfvgnh .pptxRaedMohamed3
An EFL lesson about the current events in Palestine. It is intended to be for intermediate students who wish to increase their listening skills through a short lesson in power point.
The Roman Empire A Historical Colossus.pdfkaushalkr1407
The Roman Empire, a vast and enduring power, stands as one of history's most remarkable civilizations, leaving an indelible imprint on the world. It emerged from the Roman Republic, transitioning into an imperial powerhouse under the leadership of Augustus Caesar in 27 BCE. This transformation marked the beginning of an era defined by unprecedented territorial expansion, architectural marvels, and profound cultural influence.
The empire's roots lie in the city of Rome, founded, according to legend, by Romulus in 753 BCE. Over centuries, Rome evolved from a small settlement to a formidable republic, characterized by a complex political system with elected officials and checks on power. However, internal strife, class conflicts, and military ambitions paved the way for the end of the Republic. Julius Caesar’s dictatorship and subsequent assassination in 44 BCE created a power vacuum, leading to a civil war. Octavian, later Augustus, emerged victorious, heralding the Roman Empire’s birth.
Under Augustus, the empire experienced the Pax Romana, a 200-year period of relative peace and stability. Augustus reformed the military, established efficient administrative systems, and initiated grand construction projects. The empire's borders expanded, encompassing territories from Britain to Egypt and from Spain to the Euphrates. Roman legions, renowned for their discipline and engineering prowess, secured and maintained these vast territories, building roads, fortifications, and cities that facilitated control and integration.
The Roman Empire’s society was hierarchical, with a rigid class system. At the top were the patricians, wealthy elites who held significant political power. Below them were the plebeians, free citizens with limited political influence, and the vast numbers of slaves who formed the backbone of the economy. The family unit was central, governed by the paterfamilias, the male head who held absolute authority.
Culturally, the Romans were eclectic, absorbing and adapting elements from the civilizations they encountered, particularly the Greeks. Roman art, literature, and philosophy reflected this synthesis, creating a rich cultural tapestry. Latin, the Roman language, became the lingua franca of the Western world, influencing numerous modern languages.
Roman architecture and engineering achievements were monumental. They perfected the arch, vault, and dome, constructing enduring structures like the Colosseum, Pantheon, and aqueducts. These engineering marvels not only showcased Roman ingenuity but also served practical purposes, from public entertainment to water supply.
2024.06.01 Introducing a competency framework for languag learning materials ...Sandy Millin
http://sandymillin.wordpress.com/iateflwebinar2024
Published classroom materials form the basis of syllabuses, drive teacher professional development, and have a potentially huge influence on learners, teachers and education systems. All teachers also create their own materials, whether a few sentences on a blackboard, a highly-structured fully-realised online course, or anything in between. Despite this, the knowledge and skills needed to create effective language learning materials are rarely part of teacher training, and are mostly learnt by trial and error.
Knowledge and skills frameworks, generally called competency frameworks, for ELT teachers, trainers and managers have existed for a few years now. However, until I created one for my MA dissertation, there wasn’t one drawing together what we need to know and do to be able to effectively produce language learning materials.
This webinar will introduce you to my framework, highlighting the key competencies I identified from my research. It will also show how anybody involved in language teaching (any language, not just English!), teacher training, managing schools or developing language learning materials can benefit from using the framework.
How to Make a Field invisible in Odoo 17Celine George
It is possible to hide or invisible some fields in odoo. Commonly using “invisible” attribute in the field definition to invisible the fields. This slide will show how to make a field invisible in odoo 17.
Read| The latest issue of The Challenger is here! We are thrilled to announce that our school paper has qualified for the NATIONAL SCHOOLS PRESS CONFERENCE (NSPC) 2024. Thank you for your unwavering support and trust. Dive into the stories that made us stand out!
Unit 8 - Information and Communication Technology (Paper I).pdfThiyagu K
This slides describes the basic concepts of ICT, basics of Email, Emerging Technology and Digital Initiatives in Education. This presentations aligns with the UGC Paper I syllabus.
Biological screening of herbal drugs: Introduction and Need for
Phyto-Pharmacological Screening, New Strategies for evaluating
Natural Products, In vitro evaluation techniques for Antioxidants, Antimicrobial and Anticancer drugs. In vivo evaluation techniques
for Anti-inflammatory, Antiulcer, Anticancer, Wound healing, Antidiabetic, Hepatoprotective, Cardio protective, Diuretics and
Antifertility, Toxicity studies as per OECD guidelines
Francesca Gottschalk - How can education support child empowerment.pptxEduSkills OECD
Francesca Gottschalk from the OECD’s Centre for Educational Research and Innovation presents at the Ask an Expert Webinar: How can education support child empowerment?
Synthetic Fiber Construction in lab .pptxPavel ( NSTU)
Synthetic fiber production is a fascinating and complex field that blends chemistry, engineering, and environmental science. By understanding these aspects, students can gain a comprehensive view of synthetic fiber production, its impact on society and the environment, and the potential for future innovations. Synthetic fibers play a crucial role in modern society, impacting various aspects of daily life, industry, and the environment. ynthetic fibers are integral to modern life, offering a range of benefits from cost-effectiveness and versatility to innovative applications and performance characteristics. While they pose environmental challenges, ongoing research and development aim to create more sustainable and eco-friendly alternatives. Understanding the importance of synthetic fibers helps in appreciating their role in the economy, industry, and daily life, while also emphasizing the need for sustainable practices and innovation.
Honest Reviews of Tim Han LMA Course Program.pptxtimhan337
Personal development courses are widely available today, with each one promising life-changing outcomes. Tim Han’s Life Mastery Achievers (LMA) Course has drawn a lot of interest. In addition to offering my frank assessment of Success Insider’s LMA Course, this piece examines the course’s effects via a variety of Tim Han LMA course reviews and Success Insider comments.
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...Levi Shapiro
Letter from the Congress of the United States regarding Anti-Semitism sent June 3rd to MIT President Sally Kornbluth, MIT Corp Chair, Mark Gorenberg
Dear Dr. Kornbluth and Mr. Gorenberg,
The US House of Representatives is deeply concerned by ongoing and pervasive acts of antisemitic
harassment and intimidation at the Massachusetts Institute of Technology (MIT). Failing to act decisively to ensure a safe learning environment for all students would be a grave dereliction of your responsibilities as President of MIT and Chair of the MIT Corporation.
This Congress will not stand idly by and allow an environment hostile to Jewish students to persist. The House believes that your institution is in violation of Title VI of the Civil Rights Act, and the inability or
unwillingness to rectify this violation through action requires accountability.
Postsecondary education is a unique opportunity for students to learn and have their ideas and beliefs challenged. However, universities receiving hundreds of millions of federal funds annually have denied
students that opportunity and have been hijacked to become venues for the promotion of terrorism, antisemitic harassment and intimidation, unlawful encampments, and in some cases, assaults and riots.
The House of Representatives will not countenance the use of federal funds to indoctrinate students into hateful, antisemitic, anti-American supporters of terrorism. Investigations into campus antisemitism by the Committee on Education and the Workforce and the Committee on Ways and Means have been expanded into a Congress-wide probe across all relevant jurisdictions to address this national crisis. The undersigned Committees will conduct oversight into the use of federal funds at MIT and its learning environment under authorities granted to each Committee.
• The Committee on Education and the Workforce has been investigating your institution since December 7, 2023. The Committee has broad jurisdiction over postsecondary education, including its compliance with Title VI of the Civil Rights Act, campus safety concerns over disruptions to the learning environment, and the awarding of federal student aid under the Higher Education Act.
• The Committee on Oversight and Accountability is investigating the sources of funding and other support flowing to groups espousing pro-Hamas propaganda and engaged in antisemitic harassment and intimidation of students. The Committee on Oversight and Accountability is the principal oversight committee of the US House of Representatives and has broad authority to investigate “any matter” at “any time” under House Rule X.
• The Committee on Ways and Means has been investigating several universities since November 15, 2023, when the Committee held a hearing entitled From Ivory Towers to Dark Corners: Investigating the Nexus Between Antisemitism, Tax-Exempt Universities, and Terror Financing. The Committee followed the hearing with letters to those institutions on January 10, 202
1. Artificial Intelligence Knowledge & Reasoning
Predicate Logic.
Reading: Sections 8.1, 8.2 & 8.3 of Textbook R&N
The world is blessed with many objects, some of which are
related to other objects.
Objects: people, houses, numbers, colors, baseball games, wars, …
Relations: red, round, brother of, bigger than, part of, comes between, …
How to represent the objects and their relation?
By Bal Krishna Subedi 1
2. Artificial Intelligence Knowledge & Reasoning
Predicate Logic: Basic Elements
Constants: John, 2, TU,...
Predicates Brother, >,...
Functions Sqrt, LeftLegOf,...
Variables x, y, a, b,...
Connectives ¬, ⇒, ∧, ∨, ⇔
Equality =
Quantifiers ∀, ∃
By Bal Krishna Subedi 2
3. Artificial Intelligence Knowledge & Reasoning
Predicate Logic: Syntax
Sentence → AtomicSentence
| (Sentence Connective Sentence)
| Quantifier Variable, ... Sentence
| ¬ Sentence
AtomicSentence → Predicate(Term, …) | Term = Term
Term → Function(Term, …) | Constant | Variable
Connective → ∧ | ∨ | ⇒ | ⇔
Quantifier → ∀ | ∃
Constant → A, B, C, X1 , X2, Jim, Jack
Variable → a, b, c, x1 , x2, counter, position, ...
Predicate → Adjacent-To, Younger-Than, HasColor, ...
Function → Father-Of, Square-Position, Sqrt, Cosine
ambiguities are resolved through precedence or parentheses
By Bal Krishna Subedi 3
4. Artificial Intelligence Knowledge & Reasoning
Sentences
Atomic Sentence:
A atomic sentence is formed from a predicate symbol followed by a parenthesized
list of terms.
E.g., Brother (Bill, Mary),
Father (Jack, John), Mother (Jill, John),
Sister (Jane, John)
Married (Jack, Jill)
BrotherOf (Bill) = Bob
Complex Sentence:
Complex sentences are made from atomic sentences using connectives.
E.g., Sibling (Tom, Bill) ⇒ Sibling (Bill, Tom).
Father (Jack, John) ∧ Mother (Jill, John) ∧ Sister (Jane, John).
¬ Sister (John, Jane).
Older (Father-Of (John), 30) ∨ Older (Mother-Of (John), 20).
By Bal Krishna Subedi 4
5. Artificial Intelligence Knowledge & Reasoning
Truth in first-order logic
Sentences are true with respect to a model and an interpretation
Model contains objects (domain elements) and relations among
them.
Interpretation specifies referents for
constant symbols → objects.
predicate symbols → relations.
function symbols → functional relations.
An atomic sentence predicate(term1,...,termn) is true iff the objects
referred to by term1,...,termn are in the relation referred to by
predicate.
Syntactically correct logical formulas are called well-formed
formulas (wff). Such wff are thus used to represent real-world
facts.
By Bal Krishna Subedi 5
6. Artificial Intelligence Knowledge & Reasoning
Quantifiers
• can be used to express properties of the
collections of objects
– eliminates the need to explicitly enumerate all
objects
• predicate logic uses two quantifiers
– universal quantifier ∀ : We can make a statement for all the
objects in the universe
– existential quantifier ∃ :We can make a statement about some
objects in the universe
By Bal Krishna Subedi 6
7. Artificial Intelligence Knowledge & Reasoning
Universal Quantification
∀<variables> <sentence>
Every CSG student needs a course in AI: ∀x Student (x, CSG) ⇒ Needs (x, AI)
∀x P is equivalent to the conjunction of instantiations of P and is interpreted as
P(x) is true for any possible x from the universe.
E.g., ∀x Student (x, CSG) ⇒ Needs (x, AI) is equivalent to claiming that
Student (John, CSG) ⇒ Needs (John, AI)
∧ Student (Richard, CSG) ⇒ Needs (Richard, AI)
∧ Student (Mike, CSG) ⇒ Needs (Mike, AI) ∧ ...
Typically, ⇒ is the main connective with ∀.
A common mistake to avoid: using ∧ as the main connective with ∀:
∀x Student (x, CSG) ∧ Needs (x, AI)
means “Everyone are CSG student and everyone needs AI” – very strong
statement - does not reflect the semantic.
By Bal Krishna Subedi 7
8. Artificial Intelligence Knowledge & Reasoning
Existential Quantification
∃<variables> <sentence>
Someone at CDCSIT is smart: ∃x At (x, CDCSIT) ∧ Smart (x)
∃x P is equivalent to the disjunction of instantiations of P and is interpreted as P(x)
is true for some object x in the universe.
E. g., ∃x At (x, CDCSIT) ∧ Smart (x) is equivalent to claiming that
At (John, CDCSIT) ∧ Smart (John)
∨ At (Richard, CDCSIT) ∧ Smart (Richard)
∨ At (Mike, CDCSIT) ∧ Smart (Mike) ∨ ...
Typically, ∧ is the main connective with ∃
Common mistake: using ⇒ as the main connective with ∃:
∃x At (x, CDCSIT) ⇒ Smart (x) is true if there is anyone who is not at
CDCSIT – very weak statement - does not reflect the semantic.
By Bal Krishna Subedi 8
9. Artificial Intelligence Knowledge & Reasoning
Multiple Quantifiers
more complex sentences can be formulated by
multiple variables and by nesting quantifiers
– the order of quantification is important
– variables must be introduced by quantifiers, and belong
to the innermost quantifier that mention them
Examples
∀x ∀y Brother (x, y) ⇒ Sibling (x, y)
∀x, y Parent (x, y) ⇒ Child (y, x)
∀x Human (x) ∃ y Mother (y, x)
∀x ∃ y Loves (x, y)
By Bal Krishna Subedi 9
10. Artificial Intelligence Knowledge & Reasoning
Properties of quantifiers
∀x ∀y is the same as ∀y ∀x.
∃x ∃y is the same as ∃y ∃x.
∃x ∀y is not the same as ∀y ∃x.
∃x ∀y Loves (x, y)
“There is a person who loves everyone in the world”.
∀y ∃x Loves (x, y)
“Everyone in the world is loved by at least one person”
Quantifier duality: each can be expressed using the other.
∀x Likes (x, IceCream) ¬∃x ¬Likes (x, IceCream).
∃x Likes (x, Cabbage) ¬∀x ¬Likes (x, Cabbage).
By Bal Krishna Subedi 10
11. Artificial Intelligence Knowledge & Reasoning
Some Examples
Everybody loves Jerry: ∀x Loves (x, Jerry)
Everybody loves somebody: ∀x ∃y Loves (x, y)
Brothers are siblings: ∀x, y Brother (x, y) ⇒ Sibling (x, y)
“Sibling” is reflexive: ∀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 cousin is a child of a parent's sibling:
∀ x, y Cousin (x, y) ⇔ ∃ p, ps Parent (p, x) ^ Sibling
(ps, p) ^Parent (ps, y)
By Bal Krishna Subedi 11
12. Artificial Intelligence Knowledge & Reasoning
Inference With Predicate Logic
Reading: Chapter 9 of Textbook R&N
How to answer the questions if KB represented in
Predicate logic?
By Bal Krishna Subedi 12
13. Artificial Intelligence Knowledge & Reasoning
Inference rules for Quantifiers
Universal Instantiation:
if ∀ x P(x) is true then P(A) is true for any
individual “A”.
E.g., If we know that
∀ x Man (x) ⇒ Mortal (x),
then we can conclude
Man (Socrates) ⇒ Mortal (Socrates)
By Bal Krishna Subedi 13
14. Artificial Intelligence Knowledge & Reasoning
Reduction to Propositional Inference
How to convert quantified sentence to nonquantified?
∀x Student (x, CSG) ⇒ Needs (x, AI) is equivalent to
Student (John, CSG) ⇒ Needs (John, AI)
∧ Student (Richard, CSG) ⇒ Needs (Richard, AI)
∧ Student (Mike, CSG) ⇒ Needs (Mike, AI) ∧ ...
An existential quantifier sentence replaced by one instances where as
universal quantifier replaced by the set all possible instances.
Now we can apply any propositional inference rules.
By Bal Krishna Subedi 14
15. Artificial Intelligence Knowledge & Reasoning
Example
Bob is a buffalo. 1. Buffalo(Bob)
Pat is a pig 2. Pig(Pat)
Buffaloes run faster than pigs 3. ∀x, y Buffalo(x) ^ Pig(y) ⇒ Faster(x, y).
Bob runs faster than Pat ..?
From 1&2 (and-introduction) 4. Buffalo(Bob) ^ Pig(Pat)
∀ Elimination {x/Bob, y/Pat}5. Buffalo(Bob) ^ Pig(Pat) ⇒ Faster(Bob, Pat)
Modus Ponen 4 & 5 6. Faster(Bob, Pat)
Problem: branching factor huge –inefficient approach.
By Bal Krishna Subedi 15
16. Artificial Intelligence Knowledge & Reasoning
Generalized Modus Ponens (GMP)
n atomic sentence (p’i )and one implication, and the conclusion is
the result of applying the substitution (σ) to the consequent (q).
E.g. p’1= Faster(Bob,Pat)
p’2 = Faster(Pat,Steve)
p1 ^ p2 ⇒ q = Faster(x,y) ^ Faster(y, z) ⇒ Faster(x, z)
σ = {x/Bob, y/Pat, z/Steve}
qσ = Faster(Bob, Steve)
GMP used with KB of definite clauses (exactly one positive literal in conclusion):
either a atomic sentence or (conjunction of atomic sentences) ⇒ (atomic sentence)
All variables assumed universally quantified
By Bal Krishna Subedi 16
17. Artificial Intelligence Knowledge & Reasoning
Unification
To apply inference rule (e.g Modus Ponen) an inference system must
be able to find substitutions that make different logical expression
look identical.
Unification is an algorithm for determining the such substitutions
needed to make two predicate expression identical.
E. g., is P(x) and P(y) equivalent? – when y is substituted by x.
By Bal Krishna Subedi 17
18. Artificial Intelligence Knowledge & Reasoning
Unification
A substitution σ unifies atomic sentences p and q if pσ = qσ
p q σ
Knows(John, x) Knows(John, Jane) {x/Jane}
Knows(John, x) Knows(y,OJ) {x/John, y/OJ}
Knows(John, x) Knows(y, Mother(y)) {y/John, x/Mother(John)}
Idea: Unify rule premises with known facts, apply unifier to conclusion
E.g., if we know q and Knows(John, x) ⇒ Likes(John, x)
then we conclude Likes(John, Jane)
Likes(John,OJ)
Likes(John, Mother(John))
By Bal Krishna Subedi 18
19. Artificial Intelligence Knowledge & Reasoning
Most General Unifier (MGU)
Let the premises:
Knows(John, x) Knows(y, z)
The unify algorithm can return {y/John, x/z} or {x/John, y/John,
z/John} for the given premises.
The first gives the unification result as Knows(John, z) and second
gives Knows(John, John)
The first is more general then second.
For every unifiable pair of expressions, there is single most general
unifier that is unique up to the remaining of variables.
By Bal Krishna Subedi 19
20. Artificial Intelligence Knowledge & Reasoning
Predicate Definite Clauses
A definite clause is either a atomic sentence or a implication
whose antecedent is a conjunction of positive literals and whose
consequent is a single positive literal.
Buffalo(Bob).
Pig(Pat).
Buffalo(x) ^ Pig(y) ⇒ Faster(x, y).
- Universal quantifier is omitted.
Definite clauses are suitable normal form for use with GMP.
Problem: Not all knowledge bases can be converted into a set
of definite clauses, because of single positive restriction.
By Bal Krishna Subedi 20
21. Artificial Intelligence Knowledge & Reasoning
Forward chaining
When a new fact p is added to the KB
for each rule such that p unifies with a premise
if the other premises are known
then add the conclusion to the KB and continue
chaining
Forward chaining is also called data-driven reasoning
e.g., inferring properties and categories from percepts
By Bal Krishna Subedi 21
22. Artificial Intelligence Knowledge & Reasoning
Forward chaining example
Add facts 1, 2, 3, 4, 5, 6 in turn.
1. Buffalo(x) ^ Pig(y) ⇒ Faster(x, y)
2. Pig(y) ^ Slug(z) ⇒ Faster(y, z)
3. Faster(x, y) ^ Faster(y, z) ⇒ Faster(x, z)
4. Buffalo(Bob)
5. Pig(Pat)
6. Slug(Steve)
On the first iteration: {x/Bob, y/Pat, z/steve}
On the second iteration:
rule 1 is satisfied and Faster(Bob, Pat) is added
rule 2 is satisfied and Faster(Pat, Steve) is added
7. Faster(Bob, Pat)
8. Faster(Pat, Steve)
On the 3rd iteration: rule 3 is satisfied and Faster(Bob, Steve)
9. Faster(Bob, Steve)
By Bal Krishna Subedi 22
23. Artificial Intelligence Knowledge & Reasoning
Backward Chaining
When a query q is asked
if a matching fact q’ is known, return the unifier
for each rule whose consequent q’ matches q
attempt to prove each premise of the rule by backward
chaining
It is a recursive call, when goal unifies with known fact, no new subgoals
are added and the goal is solved.
Some added complications in keeping track of the unifiers.
More complications help to avoid infinite loops.
Two versions: find any solution, find all solutions.
Backward chaining is the basis for logic programming, e.g., Prolog
Back ward chaining also called goal-driven reasoning.
By Bal Krishna Subedi 23
25. Artificial Intelligence Knowledge & Reasoning
Resolution
Resolution inference rule combines two clauses to make a new one
C1 C2
C
Inference continues until an empty clause is derived (contradiction)
Resolution is a refutation procedure.
to prove KB |= α , show that KB ^ ¬ α is unsatisable
Resolution uses KB in CNF (conjunction of clauses)
By Bal Krishna Subedi 25
27. Artificial Intelligence Knowledge & Reasoning
Conjunctive Normal Form
Literal = (possibly negated) atomic sentence. e.g., ¬ Rich(Me)
Clause = disjunction of literals, e.g., ¬ Rich(Me) ∨ Unhappy(Me)
The KB is a conjunction of clauses
Any predicate KB can be converted to CNF as follows:
1. Replace P ⇒ Q by ¬ P ∨ Q.
2. Move ¬ inwards, e.g., ¬∀x P becomes ∃x ¬P.
3. Standardize variables apart, e.g., ∀x P ∨ ∃x Q becomes ∀x P ∨ ∃y Q.
4. Move quantifiers left in order, e.g., ∀x P ∨ ∃y Q becomes ∀x ∃y P ∨ Q.
5. Eliminate ∃ by Skolemization (next slide).
6. Drop universal quantifiers.
7. Distribute ^ over ∨, e.g., (P ^ Q) ∨ R becomes (P ∨ Q) ^ (P ∨ R).
By Bal Krishna Subedi 27
28. Artificial Intelligence Knowledge & Reasoning
Skolemization
Skolemization is the process of removing existential quantifiers by
elimination.
∃x Rich(x) becomes Rich(G1) where G1 is a new “Skolem constant”
More tricky when ∃ is inside ∀
E.g., “Everyone has a heart"
∀x Person(x) ⇒ ∃y Heart(y) ^ Has(x, y)
Incorrect:
∀x Person(x) ⇒ Heart(H1) ^ Has(x, H1)
Correct:
∀x Person(x) ⇒ Heart(H(x)) ^ Has(x, H(x))
where H is a new symbol (“Skolem function")
Skolem function arguments: universally quantified variables
By Bal Krishna Subedi 28
29. Artificial Intelligence Knowledge & Reasoning
Resolution proof
To prove α:
- negate it
- convert to CNF
- add to CNF KB
- infer contradiction
E.g., to prove Rich(me), add ¬Rich(me) to the CNF KB
¬ PhD(x) ∨ HighlyQualified(x)
PhD(x) ∨ EarlyEarnings(x)
¬ HighlyQualified(x) ∨ Rich(x)
¬ EarlyEarnings(x) ∨ Rich(x)
By Bal Krishna Subedi 29
31. Artificial Intelligence Knowledge & Reasoning
Completeness of Resolution
• Resolution is complete (for proof see page 300) and usually
necessary for mathematics.
• Completeness theorem by German mathematician KURT
Gaedel in 1930, J. A. Robinsion published resolution
algorithm in 1965.
• Automated theorem provers are starting to be useful to
mathematicians and have proved several new theorems; it has
been used to verify hardware designs and to generate logically
correct programs.
• Other detailed examples of resolution can be found on pages
298-300.
By Bal Krishna Subedi 31