Artificial Intelligence Tutorial

Introduction to Artificial Intelligence Intelligent Agents

Search Algorithms

Problem-solving Uninformed Search Informed Search Heuristic Functions Local Search Algorithms and Optimization Problems Hill Climbing search Differences in Artificial Intelligence Adversarial Search in Artificial Intelligence Minimax Strategy Alpha-beta Pruning Constraint Satisfaction Problems in Artificial Intelligence Cryptarithmetic Problem in Artificial Intelligence

Knowledge, Reasoning and Planning

Knowledge based agents in AI Knowledge Representation in AI The Wumpus world Propositional Logic Inference Rules in Propositional Logic Theory of First Order Logic Inference in First Order Logic Resolution method in AI Forward Chaining Backward Chaining Classical Planning

Uncertain Knowledge and Reasoning

Quantifying Uncertainty Probabilistic Reasoning Hidden Markov Models Dynamic Bayesian Networks Utility Functions in Artificial Intelligence


What is Artificial Super Intelligence (ASI) Artificial Satellites Top 7 Artificial Intelligence and Machine Learning trends for 2022 8 best topics for research and thesis in artificial intelligence 5 algorithms that demonstrate artificial intelligence bias AI and ML Trends in the World AI vs IoT Difference between AI and Neural Network Difference between Artificial Intelligence and Human Intelligence Virtual Assistant (AI Assistant) ARTIFICIAL INTELLIGENCE PAINTING ARTIFICIAL INTELLIGENCE PNG IMAGES Best Books to learn Artificial Intelligence Certainty Factor in AI Certainty Factor in Artificial Intelligence Disadvantages of Artificial Intelligence In Education Eight topics for research and thesis in AI Engineering Applications of Artificial Intelligence Five algorithms that demonstrate artificial intelligence bias 6th Global summit on artificial intelligence and neural networks Acting Humanly In Artificial Intelligence AI and ML Trends in the World AI vs IoT Artificial Communication Artificial intelligence assistant operating system Artificial Intelligence in Pharmacy Artificial Intelligence in Power Station Artificial Intelligence in Social Media Artificial Intelligence in Supply Chain Management Artificial Intelligence in Transportation Artificial Intelligence Interview Questions and Answers Artificial Intelligence Jobs in India For Freshers Integration of Blockchain and Artificial Intelligence Interesting Facts about Artificial Intelligence Machine Learning and Artificial Intelligence Helps Businesses Operating System Based On Artificial Intelligence SIRI ARTIFICIAL INTELLIGENCE SKILLS REQUIRED FOR ARTIFICIAL INTELLIGENCE Temporal Models in Artificial Intelligence Top 7 Artificial Intelligence and Machine Learning trends for 2022 Types Of Agents in Artificial Intelligence Vacuum Cleaner Problem in AI Water Jug Problem in Artificial Intelligence What is Artificial Super Intelligence (ASI) What is Logic in AI Which language is used for Artificial Intelligence Essay on Artificial Intelligence Upsc Flowchart for Genetic Algorithm in AI Hill Climbing In Artificial Intelligence IEEE Papers on Artificial Intelligence Impact of Artificial Intelligence On Everyday Life Impact of Artificial Intelligence on Jobs

Theory of First-order Logic

Theory of First-order Logic

First-order logic is also called Predicate logic and First-order predicate calculus (FOPL). It is a formal representation of logic in the form of quantifiers. In predicate logic, the input is taken as an entity, and the output it gives is either true or false.

Syntax and Semantics of FOPL

Syntax: It defines the way of representing the given predicates. As these predicates are represented via quantifiers, there are different types of quantifiers used:

  • Universal Quantifier(For all/every): When the predicate is indicating about all/everything, we use for all quantifier. It is denoted as " ? "
  • Existential Quantifier(For some): When the predicate is indicating about some quantity, we use for some quantifier. It is denoted as “?”
  • Nested Quantifiers: It is the nesting of the same type of quantifier. One predicate is nested under the other predicate.
  • Atomic Sentences: These sentences are formed via predicate symbols may or may not be followed by a list of terms.

 Example: Parents(Ram, Sita) where Ram and Sita are the parents.

  • Complex Sentences: These sentences make use of logical connectives to construct more complex sentences.
  • Equality: We use the equality symbol to express that two terms refer to the same object. For example, Eleveenth_President(India)= Dr. APJ Abdul Kalam. Here, both LHS is equal to RHS. It means that both terms refer to the same entity/ person.

Elements and their symbols in Predicate Logic

The elements for which different symbols are defined are:

  • Objects: It refers to an entity that exists in the real world. For example, Ram, John, etc. are referred to as Objects.
  • Functions: Any function performed by the object/on the object. For example, LeftLeg, writes, eats, etc. are some of the functions.
  • Relations: The relation of an object with the other object defines its relation. For example, brother, mother, king, etc. are some types of relations which exist in the real world.

Now, let’s discuss the symbols used to represent these elements. They are as follows:

  • Constant Symbols: These symbols are used to represent the objects.
  • Predicate Symbols: These symbols are used to represent relations.
  • Function Symbols: These symbols are used to represent the functions performed by the object.

Semantics: It defines the sense of the given predicate. It allows to make more logical expression by devising its semantics. Semantics allow us to understand the sentence meaning.

Let’s understand Predicate logic with the help of below examples:

Example 1: Lipton is a tea.

Solution: Here, the object is Lipton.

It will be represented as Tea(Lipton).

Note: In this example, there is no requirement of quantifiers because the quantity  is not specified in the given predicate. Let’s see more.

Example 2: Every man is mortal.

 Solution: Here, the quantifier is the universal identifier, and the object is man.

Let x be the man.

Thus, it will be represented as x: man(x)  ? mortal(x).

Example 3: All girls are beautiful.

Solution: Here, we are talking about all girls. It means universal quantifier will be used. The object is girls. Let, y be the girls.

Therefore, it will be represented as girls(y)  ? beautiful(y).

Example 4: All that glitters is not gold.

Solution: Here, we will represent gold as x.

Therefore, it will be represented as glitters(x)  ? ¬gold(x).

Example 5: Some boys are obedient.

Solution: Here, boys are objects. The quantifier used will be existential quantifier. Let x be the boys. Thus, it will be represented as

?x: boys(x) ? obedient(x).

Example 6: Some cows are black and some cows are white.

Solution: Let, x be the cows. Therefore, it will be represented as:

?x: cows(x) ? black(x) ? white(x).

Note: There can be several examples of Predicate logic.

Knowledge Engineering in FOPL

Knowledge engineering is the process where a knowledge engineer investigates a specific domain, learn the important concepts regarding that domain, and creates the formal representation of the objects and relations in that domain.

Knowledge Engineering Process

An engineering term is used when we are talking about any project. Therefore, knowledge engineering over a project involves the below described steps:

Knowledge Engineering in FOPL
  • Identify the task: A knowledge engineer should be able to identify the task by asking a few questions like:
  • Do the knowledge base will support?
  • What kinds of facts will be available for each specific problem?

The task will identify the knowledge requirement needed to connect the problem instance with the answers.

  • Assemble the relevant knowledge: A knowledge engineer should be an expert in the domain. If not, he should work with the real experts to extract their knowledge. This concept is known as Knowledge Acquisition.

Note: Here, we do not represent the knowledge formally. But to understand the scope of the knowledge base and also to understand the working of the domain.

  • Decide on a vocabulary of constants, predicates, and functions: Translating important domain-level concepts into logical level concepts.

Here, the knowledge engineer asks questions like:

  • What are the elements which should be represented as objects?
  • What functions should be chosen?

After satisfying all the choices, the vocabulary is decided. It is known as the Ontology of the domain. Ontology determines the type of things that exists but does not determine their specific properties and interrelationships.

  • Encode general knowledge about the domain: In this step, the knowledge engineer pen down the axioms for all the chosen vocabulary terms.

Note: Here, misconceptions occur between the vocabulary terms.

  • Encode description of the specific problem instance: We write the simple atomic sentences for the selected vocabulary terms. We encode the chosen problem instances.
  • Raise queries to the inference procedure and get answers: It is the testing step. We apply the inference procedure on those axioms and problem-specific facts which we want to know.
  • Debug the knowledge base: It is the last step of the knowledge engineering process where the knowledge engineer debugs all the errors.