Docsity

Knowledge Bases, Inference Engines, and Chaining Techniques in AI, Summaries of Artificial Intelligence

Toggle sidebar
bg1
Knowledge Base
Knowledge Base is simply a collection of facts. Facts are used
to state things that are unconditionally true of some situation of
interest. For example, we can state that Mia, Jody, and Yolanda
are women, that Jody plays air guitar, and that a party is taking
place, using the following five facts:
woman(mia).
woman(jody).
woman(yolanda).
playsAirGuitar(jody).
Prolog :
whether Mia is a woman by posing the query:
?- woman(mia).
Prolog will answer
yes
Similarly, if Jody plays air guitar by posing the following query:
?- playsAirGuitar(jody).
Prolog will again answer yes, because this is one of the facts.
However, suppose if the query is whether Mia plays air guitar:
?- playsAirGuitar(mia).
We will get the answer
No – as, this is not a fact.
pf3
pf4
pf5
pf8
pf9
pfa
pfd

Partial preview of the text

Download Knowledge Bases, Inference Engines, and Chaining Techniques in AI and more Summaries Artificial Intelligence in PDF only on Docsity!

Knowledge Base Knowledge Base is simply a collection of facts. Facts are used to state things that are unconditionally true of some situation of interest. For example, we can state that Mia, Jody, and Yolanda are women, that Jody plays air guitar, and that a party is taking place, using the following five facts: woman(mia). woman(jody). woman(yolanda). playsAirGuitar(jody). Prolog : whether Mia is a woman by posing the query: ?- woman(mia). Prolog will answer yes Similarly, if Jody plays air guitar by posing the following query: ?- playsAirGuitar(jody). Prolog will again answer yes, because this is one of the facts. However, suppose if the query is whether Mia plays air guitar: ?- playsAirGuitar(mia). We will get the answer No – as, this is not a fact.

Unification Algorithm - The unification algorithm attempts to find the MGU for two terms. The algorithm involves recursively applying substitutions until the terms become identical or a conflict is found that prevents unification. Steps in the Unification Algorithm:

1. Initialization: Start with the two terms you want to unify. 2. Decompose Compound Terms: If the terms are compound (i.e., functions with arguments), break them down into their constituent parts. 3. Check for Conflicts: If a variable is being unified with a term that contains that variable (occurs check), unification fails. 4. Apply Substitutions: Continuously apply the substitutions and simplify the terms until they are identical or no further simplification is possible.

issues. The inference engine uses two mechanisms, forward and backward chaining, in order to extract data from the knowledge base. Let us now discuss both of them one by one. Forward Chaining Forward chaining is a data-driven reasoning approach used by inference engines. It starts with given facts and applies rules to derive new conclusions or facts from them. The engine keeps applying the rules until it reaches a conclusion or cannot apply any more rules. It is based on logical prediction methodology. One of its examples is the prediction of trends in the stock market. Characteristics  It is a bottom-up approach.  It starts with the initial state and progresses toward the end state to reach a conclusion.  It is a data-driven approach which utilises given data.  It derives conclusions without any need for explicit guidance. Example Given below are some facts and some rules: Facts:

  1. Sohail is a coder.
  2. Sohail studies computer science.

Rules:

  1. If a person is a coder, it means he enrolled in a college.
  2. If a person is enrolled in a college and studies computer science, it means he learned DSA. Now, we will use forward chaining to derive a conclusion based on given facts and rules. Step 1: If a person is a coder, it means he enrolled in a college.  FOL: ∀x (coder(x) → Enrolled_IN(x, college))  Applying rule 1 to the fact: Enrolled_IN(Sohail, college) Step 2: If a person is enrolled in a college and studied computer science, it means he learned DSA.  FOL: ∀x,y (Enrolled_In(x, college) ∧ studies(x, computer science) → Learned_DSA(x))  Applying rule 2 to the fact: Learned_DSA(Sohail) Final conclusion: Learned_DSA(Sohail) In the above example, we used forward chaining to derive a conclusion based on given facts and rules. We converted facts and rules into FOL and reached the final conclusion. Note: The FOL (First Order Logic) representation helps the inference engine to reach a conclusion effectively. Advantages Below are a few pros of forward chaining in AI.

 It is a top-down approach.  It uses a depth-first search strategy.  It is a goal-driven approach, as we start from the goal state and reach the initial state.  It divides objectives into sub-goals to validate the facts. Example Given below are some facts and rules from which we would derive the conclusion. Fact:

  1. Sohail is a coder.
  2. Sohail studies computer science. Rules:
  3. If a person is a coder, it means they enrolled in a college.
  4. If a person is enrolled in a college and studies computer science, it means they learned DSA. Goal: Did Sohail learn DSA or not? Now, we will use backward chaining to check whether Sohail learns DSA or not. Step 1: If a person is enrolled in a college and studies computer science, it means they learned DSA. (Rule 1)

FOL: ∀x,y (Enrolled_In(x, college) ∧ studies(x, computer_science) → Learned(x, DSA)) Now, we need to check if Sohail is enrolled in a college and studies computer science. Step 2: If a person is a coder, it means they enrolled in a college. (Rule 2)  FOL: ∀x (coder(x) → Enrolled_In(x, college)) Step 3: We need to check if Sohail is a coder and studies computer science.  Based on fact 1, Sohail is a coder.  Based on fact 2, Sohail studies computer science. From the above, we can conclude that Sohail is enrolled in a college (from Rule 1) and studies computer science. Therefore, using the backward chaining, we can conclude that Sohail learned DSA. Advantages Below are a few pros of backward chaining in AI.  In backward chaining, the process terminates once the fact is verified.  It is a faster process as it only analyses and verifies facts.  It only considers the relevant part of the data and eliminates unnecessary information.

Forward Chaining Backward Chaining It is a slow process. It is a fast process. It operates in the forward direction (initial state to goal state). It operates in the backward direction (goal state to initial state). It may include multiple ASK questions from the information source. Backward chaining includes fewer ASK questions compared to forward chaining. Resolution:

Unit - IV Agent architecture: https://www.slideshare.net/slideshow/agent-architecture-in- artificial-intelligencepptx/ Argumentation: Dungs argument framework: Dung's Abstract Argumentation Framework (AAF) – Simplified Dung's Abstract Argumentation Framework (1995) is a way to model arguments and their interactions logically. It helps in deciding which arguments are accepted, rejected, or undecided in a debate or reasoning system.

1. Basic Idea

Unit – V AI applications: https://www.simplilearn.com/tutorials/artificial-intelligence- tutorial/artificial-intelligence-applications IR: https://www.slideshare.net/slideshow/information-retrieval-in- artificial-intelligence/ Information Extraction: https://www.ibm.com/think/topics/information-extraction Speech recognition: https://www.slideshare.net/slideshow/speech-recognition- system/