0% found this document useful (0 votes)
8 views17 pages

Module 3 Workbook

The document contains a series of multiple-choice questions and fill-in-the-blank exercises related to First Order Predicate Logic and Prolog programming. It covers topics such as predicates, quantifiers, unification, inference rules, and knowledge representation in artificial intelligence. The exercises aim to assess understanding of these concepts in a structured format.

Uploaded by

sejal.24bce11199
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
0% found this document useful (0 votes)
8 views17 pages

Module 3 Workbook

The document contains a series of multiple-choice questions and fill-in-the-blank exercises related to First Order Predicate Logic and Prolog programming. It covers topics such as predicates, quantifiers, unification, inference rules, and knowledge representation in artificial intelligence. The exercises aim to assess understanding of these concepts in a structured format.

Uploaded by

sejal.24bce11199
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1/ 17

Module 3 – Worksheet 1

Multiple Choice Questions


Q.No 1. In First Order Predicate Logic, a predicate is a symbol denoting a:
a) Variable
b) Constant
c) Function
d) Relation
Answer:

Q.No 2. The term "Skolemization" in First Order Logic is used to:


a) Eliminate existential quantifiers
b) Introduce existential quantifiers
c) Simplify conjunctions
d) Remove universal quantifiers
Answer:

Q.No 3. The term "Herbrand Universe" in First Order Logic refers to:
a) The set of all individuals
b) The set of all constants
c) The set of all variables
d) The set of all functions
Answer:

a) ∀x P(x)
Q.No 4. The negation of "∃x P(x)" is:

b) ∃x ¬P(x)

d) ∀x ¬P(x)
c) ¬∃x P(x)

Answer:

Q.No 5. What does the term "ground instance" refer to in First Order Logic?
a) An instance of a predicate with no variables
b) An instance of a predicate with universal quantifiers
c) An instance of a function with existential quantifiers
d) An instance of a relation with free variables
Answer:

Q.No 6. In First Order Logic, what does the term "free variable" mean?
a) A variable quantified by an existential quantifier
b) A variable that is not quantified within a formula
c) A variable that is constant across all instances
d) A variable that is quantified by a universal quantifier
Answer:
Q.No 7. In First Order Predicate Logic, a universally quantified statement (∀x) becomes
false if:
a) It is true for at least one value of x
b) It is true for every value of x
c) It is false for at least one value of x
d) It is false for every value of x
Answer:

Q.No 8. What is the purpose of the term "standardization of variables" in First Order
Logic?
a) To make variables unique within a formula
b) To eliminate existential quantifiers
c) To normalize the range of variables
d) To simplify conjunctions
Answer:

Q.No 9. What is the purpose of "universal instantiation" in First Order Logic?


a) To eliminate existential quantifiers
b) To substitute a constant for a universally quantified variable
c) To eliminate universal quantifiers
d) To standardize variables
Answer:

Q.No 10. How are predicates represented in Prolog?


a) By variables
b) By constants
c) By atoms
d) By functions
Answer:

Q.No 11. How are rules represented in Prolog?


a) By facts
b) By clauses
c) By queries
d) By atoms
Answer:

Q.No 12. In Prolog, what does the term "unification" refer to?
a) Merging two databases
b) Combining multiple rules
c) Matching terms and binding variables
d) Splitting a clause into subgoals
Answer:

Q.No 13. How are lists represented in Prolog?


a) Separated by commas
b) Enclosed in square brackets
c) Enclosed in curly braces
d) Separated by semicolons
Answer:

Q.No 14. What is the purpose of the "assert" predicate in Prolog?


a) To check if a fact is true
b) To add a new rule to the database
c) To retract a clause from the database
d) To add a new fact to the database
Answer:

Q.No 15. In Prolog, what does the term "query" refer to?
a) A rule in the database
b) A statement that is always true
c) A goal to be proved
d) A clause in a rule
Answer:

Q.No 16. In Prolog, how are arithmetic operations represented?


a) Using keywords like "add" and "subtract"
b) Using infix notation
c) Using prefix notation
d) Using postfix notation
Answer:

Q.No 17. In Prolog, how is a disjunction of goals represented?


a) Using the and keyword
b) Using the , (comma) operator
c) Using the or keyword
d) Using the ; (semicolon) operator
Answer:

Q.No 18. In Prolog, what is the purpose of the "is" predicate?


a) To check for equality
b) To perform arithmetic operations
c) To negate a goal
d) To concatenate lists
Answer:

Q.No 19. In unification, what is a "substitution"?


a) A set of terms that cannot be unified
b) A set of variable assignments that makes two terms identical
c) A set of rules used for backtracking
d) A set of constants used in a clause
Answer:

Q.No 20. Which of the following is a valid unification?


a) f(X, Y) and f(a, b)
b) g(X) and h(Y)
c) p(a, b, c) and p(X, Y, Z)
d) q(a, b) and q(a, b, c)
Answer:

Q.No 21. In the context of unification, what is a "mgu"?


a) Minimum Generalization Unit
b) Most General Unifier
c) Maximum Generalization Unit
d) Multi-level Generalization Unit
Answer:

Q.No 22. Which of the following is a limitation of Forward Chaining?


a) It may not reach the desired goal
b) It is computationally expensive
c) It is not suitable for rule-based systems
d) It requires extensive preprocessing
Answer:

Q.No 23. Which of the following is a limitation of Backward Chaining?


a) It may not reach the desired goal
b) It is computationally expensive
c) It is not suitable for rule-based systems
d) It requires extensive preprocessing
Answer:

Q.No 24. In Backward Chaining, the process often involves:


a) Generating additional goals
b) Backtracking
c) Both a and b
d) Neither a nor b
Answer:

Q.No 25. In resolution, what is the purpose of the "complementary literals"?


a) To introduce new facts
b) To represent contradictory information
c) To simplify clauses
d) To perform arithmetic operations
Answer:

Q.No 26. What is the result of applying the resolution rule to two clauses with
complementary literals?
a) The creation of a new clause
b) The deletion of one of the clauses
c) The addition of a new rule
d) The resolution fails
Answer:
Q.No 27. What is a limitation of resolution in handling incomplete or uncertain
information?
a) It requires extensive preprocessing
b) It is not suitable for rule-based systems
c) It assumes complete knowledge
d) It is computationally expensive
Answer:

Q.No 28. In first-order logic, what is the extension of the resolution rule?
a) Skolemization
b) Quantification
c) Unification
d) Backtracking
Answer:

Q.No 29. What is the primary goal of knowledge representation in artificial intelligence?
a) To encode information in a machine-readable format
b) To simplify data storage
c) To optimize algorithms
d) To generate random facts
Answer:

Q.No 30. Which knowledge representation approach uses frames to organize


information?
a) Semantic networks
b) Rule-based systems
c) Frames systems
d) Predicate logic
Answer:

Q.No 31. Which representation allows the use of variables and quantifiers to express
general relationships?
a) Semantic networks
b) Rule-based systems
c) Frames systems
d) Predicate logic
Answer:

Q.No 32. Which knowledge representation approach uses a set of production rules to
represent knowledge?
a) Semantic networks
b) Rule-based systems
c) Frames systems
d) Predicate logic
Answer:

Q.No 33. What is the primary goal of ontological engineering?


a) Designing software interfaces
b) Representing and formalizing knowledge
c) Developing algorithms for data analysis
d) Creating user-friendly applications
Answer:

Q.No 34. In ontological engineering, what is an "ontology"?


a) A programming language
b) A set of algorithms
c) A formal representation of knowledge
d) A data storage system
Answer:

Q.No 35. Which of the following statements is true about ontologies?


a) They are static and unchanging representations of knowledge
b) They are dynamic and evolving structures
c) They are only used in natural language processing
d) They focus solely on procedural knowledge
Answer:

Q.No 36. What is the main challenge in ontological engineering?


a) Creating ontologies that are too specific
b) Ensuring the completeness of ontologies
c) Achieving consensus on the meaning of terms across different communities
d) Developing ontologies that are independent of domain knowledge
Answer:

Q.No 37. How are objects typically represented in cognitive science?


a) Through physical events
b) Through mental events
c) Through mental representations
d) Through categorical events
Answer:

Q.No 38. In the context of mental events, what are "schemas"?


a) Mental objects
b) Mental representations of events or situations
c) Physical events
d) Categorical representations
Answer:

Q.No 39. What is the relationship between mental events and mental objects?
a) Mental events are subcategories of mental objects
b) Mental objects are manifestations of mental events
c) They are synonymous terms
d) They are unrelated concepts
Answer:
Q.No 40. In cognitive science, what are "prototypes" related to?
a) Basic level categories
b) Mental events
c) Mental objects
d) Schemas
Answer:
Module 3 – Worksheet 2
Fill in the blanks
Q.No.1. A __________ is a formula that becomes a well-formed sentence when specific values
are substituted for its variables.
Answer:

Q.No.2. Inference rules such as __________ and __________ are commonly employed in first-
order logic for deriving conclusions from premises.
Answer:

Q.No.3. The language of first-order logic allows for the representation of complex relationships
through the use of __________ and __________.
Answer:

Q.No.4. The __________ operator in Prolog is used to represent logical AND between goals in a
clause.
Answer:

Q.No.5. In Prolog, __________ is the process of finding values for variables that satisfy the goals
specified in the query.
Answer:

Q.No.6. The __________ operator in Prolog is used to represent logical OR between goals in a
clause.
Answer:

Q.No.7. __________ is commonly used in rule-based systems where the knowledge base is
extensive and conclusions need to be reached incrementally.
Answer:

Q.No.8. __________ is often used in diagnostic systems and problem-solving scenarios where
the goal is to identify the root cause of a particular issue.
Answer:

Q.No.9. A __________ is a logical sentence expressed in disjunctive normal form (DNF) that
serves as input to the resolution process.
Answer:

Q.No.10. The resolution rule applies to two clauses with __________ literals, leading to the
creation of a resolvent.
Answer:

Q.No.11. The result of applying the resolution rule to two clauses with complementary literals is
the creation of a new __________.
Answer:

Q.No.12. In resolution-based theorem proving, the __________ clause represents the


hypothesis to be proved.
Answer:

Q.No.13. Objects in cognitive science are typically represented through __________, which are
mental representations.
Answer:

Q.No.14. In the context of mental events, __________ represent mental representations of


events or situations.
Answer:

Q.No.15. The relationship between mental events and mental objects is that mental events are
often considered as __________ of mental objects.
Answer:

Match the following

Q.1. PART A PART B ANSWER


A Variables and Constants 1 Elements are used to represent objects and individuals in
logic.
B Quantifiers 2 Expressions like "for all" and "there exists" are used to
quantify statements.
C Predicates 3 Logical sentences that include variables and represent
relationships between objects.
D Functions 4 Operations that take objects as arguments and produce
new objects.
E Universal and Existential 5 Expressions used to represent statements about the
Quantifiers quantity of objects satisfying a predicate.

F Well-Formed Sentences 6 A logical sentence with specific values substituted for its
variables.
G Unification 7 The process of finding values for variables that make a
given formula true.
H Inference Rules 8 Mechanisms used for deriving conclusions from premises in
first-order logic.
I Ground Instance 9 Formulas that become valid sentences when specific values
are substituted for variables.
J Skolemization 10 A process that introduces new functions to eliminate
existential quantifiers.
Answer
Q.2. PART A PART B ANSWER
A Prolog uses a form of _________, where facts and rules are 1 Declarative
used to derive new information.
B Prolog supports _________, allowing the definition of recursive 2 Clauses
rules and relationships.
C Prolog is a _________ programming language designed for 3 Predicate
symbolic reasoning and manipulation.
D In Prolog, _________ is the process of finding values for 4 Logic
variables that satisfy the goals specified in the query. Programming
E Prolog's execution strategy, known as _________, involves 5 Queries
searching through the clauses to find solutions.
F The _________ operator in Prolog is used to represent logical 6 Comma (,)
OR between goals in a clause.
G The basic building block in Prolog is a _________, which is a 7 Unification
statement that can be true or false.
H In Prolog, a program consists of a set of _________ that define 8 Recursion
relationships and rules.
I The _________ operator in Prolog is used to represent logical 9 Semicolon (;)
AND between goals in a clause.
J Queries in Prolog are posed using _________, seeking solutions 10 Depth-First
to specific goals. Search
Answer

Q.3. PART A PART B ANSWER


A ________ is a reasoning strategy that starts with known facts and 1 Goal-Driven
derives conclusions as new information becomes available. Approach
B ________ is a reasoning strategy that starts with specific goals 2 Goal Selection
and works backward to find the necessary facts and rules.
C One advantage of ________ is its ability to explore a large 3 Backward
solution space, potentially discovering multiple paths to a goal. Chaining
D The process of ________ involves applying rules and making 4 Process of
inferences until no further conclusions can be drawn. Deriving
Conclusions
E One advantage of ________ is that it can be more goal-driven, 5 Exploration of
focusing on what information is required to achieve a specific Solution Space
objective.
F ________ involves selecting appropriate rules and facts to 6 Forward Chaining
achieve a goal and moving step by step toward a solution.
Answer

Q.4. PART A PART B ANSWER


A ________ is a powerful inference rule used in propositional and 1 Logical Sentences
first-order logic for proving or disproving statements. in DNF
B In ________, two clauses with complementary literals are 2 Inference Process
resolved to create a new clause.
C A ________ is a logical sentence expressed in disjunctive normal 3 Resolution Rule
form (DNF) that serves as input to the resolution process.
D The result of applying the resolution rule to two clauses with 4 Unification in
complementary literals is the creation of a new ________. First-Order Logic
E The process of ________ involves applying the resolution rule to 5 Resolvent
derive new clauses until a contradiction or the desired conclusion
is reached.
F In ________, unification extends the resolution rule and involves 6 Elimination of
unifying terms in the resolution process. Complementary
Literals
Answer

Q.5. PART A PART B ANSWER


A An ________ is a formal specification of a conceptualization, 1 Reuse of
providing a structured representation of entities and their Knowledge
relationships. Representations
B The goal of ________ is to enhance knowledge sharing and 2 Formal
interoperability across different systems and domains. Specification of
Conceptualization
C ________ leverages existing ontologies for new applications, 3 Representation of
promoting the reuse of knowledge representations. Complex
Relationships
D A key challenge in ________ is achieving consensus on the 4 Knowledge
meaning of terms and concepts across different communities and Sharing and
domains. Interoperability
E In the context of ________, ontologies play a vital role in 5 Consensus on
representing complex relationships and entities within a specific Meaning
domain.
F ________ involves creating, refining, and maintaining ontologies 6 Design and
to capture and organize knowledge in a machine-readable format. Development of
Ontologies
Answer
Module 3 – Worksheet 3
Q.No 1 : Discuss the role of unification in the First Order Predicate Logic. Provide
examples to illustrate how unification is applied in resolving variables in different clauses.
Hint : Unification Steps
Solution:

Q.No 2: Write a Prolog program to illustrate how FOPL concepts are used, considering a
case study of relationships between people in terms of parent-child relationships.
Hint :
• The parent( , ) predicate represents parent-child relationships.
• The ancestor( , ) predicate is defined recursively using rules to find ancestors. An
ancestor is either a parent or a parent of an ancestor.
• The query ?- parent(john, mary). checks if John is a parent of Mary, and Prolog will
respond true.
• The query ?- ancestor(X, jim). asks Prolog to find all ancestors of Jim, and Prolog will
respond with all possible values of X such that X is an ancestor of Jim.
Solution:

Q. No 3 : Think critically about the diverse aspects of knowledge representation to foster


a deeper understanding of the field in the artificial intelligence arena.
Hint : Real world applications of knowledge representation

Solution:

Q. No: 4. Create a Prolog program with a basic knowledge about animals and their
characteristics and implement queries to retrieve information.
Hint :
% Queries to identify and classify animals
% Example Query: Is a dog a mammal?
% Query: ?- mammal(dog).

% Example Query: Can a chicken fly?


% Query: ?- can_fly(chicken).
Solution :
Q. No: 5. Consider a real-world scenario called “Smart City Traffic Management System”.
The problem is depicted as:
In a smart city, managing traffic flow is crucial for minimizing congestion and ensuring
efficient transportation. The goal is to create an intelligent traffic management system
that utilizes forward chaining algorithm to dynamically adjust traffic signals and provide
real-time route recommendations.

Hint : Forward Chaining: The system starts with high congestion on a road and uses
forward
chaining to optimize traffic flow by adjusting traffic signals.
• The knowledge base includes information about current traffic conditions,
historical traffic patterns, road infrastructure, and optimal routes.
• Dynamic Route Recommendations: The system uses backward chaining to calculate the
optimal route based on real-time traffic conditions.
% Forward chaining query
% How can we optimize traffic flow on avenue_b?
?- optimize_traffic_flow(avenue_b).
Solution :
Q. No: 6. Create a Prolog program demonstrating backward chaining with a knowledge
base
related to the courses and prerequisites of a B. Tech. student in VIT Bhopal University.
Hint :
• The prerequisite( , ) facts represent the initial knowledge about course prerequisites.
• The can_take( , ) rule represents backward chaining rules. It infers that a student can
take a course if the student has completed the course directly or has completed the
prerequisites for that course.
• The has_completed( , ) facts represent the initial completion status of some courses for
students.
Solution :

Q. No: 7. Create a Prolog program of an ontology for vehicles and their classifications
involving definition of concepts, relationships, and rules within a specific domain.
Hint :
% Queries
% 1. Find all vehicles and their classifications
?- is_a(Object, vehicle).

% 2. Find all vehicles with 4 wheels


?- has_property(Object, has_wheels, 4).
Solution :
Q. No 8. Write a Prolog program illustrating the use of resolution to query about family
relationships:
Hint:
• The parent( , ) predicates represent parent-child relationships in the knowledge base.
• The ancestor( , ) rule defines that someone is an ancestor if they are a direct parent or if
they are the parent of an ancestor.
• The query ancestor(bob, mary) is a resolution query, asking whether "bob" is an
ancestor of "mary" based on the rules and facts.
Solution:

Q. No 9. Create a Prolog program defining categories, objects, events, mental events,


and mental objects within a knowledge base.
Hint:
?- is_category(book, Category). % Output: Category = physical_object
?- is_category(reading, Category). % Output: Category = physical_object
?- is_category(dreaming, Category). % Output: Category = mental_object
Solution:
Q. No 10. Reasoning with default information involves handling situations where certain
assumptions or defaults are made unless there is explicit information to the contrary.
Write a Prolog program that represents reasoning systems for categories and
incorporates default information.
Hint:
• The default_category() predicate represents default information that assumes
an unspecified item belongs to the 'object' category by default.
• The has_category( , ) rule includes both explicit category information
and default information.
Solution:

You might also like