Written Assignment 3
The assignment should be submitted via Blackboard.
Some questions in this assignment refer to the same problem as
programming assignment 3,
please refer to the description of that
assignment for additional details.
Problem 1
15 points.
Let S1 be a statement in propositional logic. Write a function
CHECK_TRUE(S1) that:
- returns true if there exists a model (i.e., a row in the
truth table) where S1 is true.
- returns false otherwise.
Your pseudocode can re-use any code from the textbook or slides, and
can call any of the functions given in the textbook or slides, as long
as such code and functions are used correctly, with correct names for
the functions, and with well-specified values for all variables and
arguments.
Remember that a model is a complete assignment of Boolean
values for
each symbol of S1. In other words, a model corresponds to a row of the
truth table. Thus, given a model, for any symbol of S1 we know whether
that symbol is true or false in that model.
Problem 2
20 points.
Suppose that an agent using the program described in programming assignment 3 for
inference, has gone through squares (1,1), (1,2),
(1,3), (1,4) sensing no stench or breeze anywhere, except for a stench
at square (1,4). You can assume that an agent dies if it moves to a
square containing a monster or a pit, and that this particular agent
did not die at any of the four squares. Specify a set of statements
that we need to add to the knowledge base to represent the information
that the agent collected out of those four squares. The set of
statements should be sufficient, meaning that the inference engine will
always give results that are correct and consistent with the
information that the agent obtained from those four squares. Your set
of statements should also be MINIMAL, i.e., it should not be possible
to leave out any of those statements without sacrificing the
correctness of the inference algorithm. You should assume that the
knowledge base already contains the wumpus rules, and in particular the
version of the rules specified in programming assignment 3, not the
version specified in the textbook.
Problem 3
15 points.
Two logical statements A and B are logically equivalent if A
<=>
B. We have two knowledge bases, KB1 and KB2.. Write a function
CHECK_EQUIVALENCE(KB1, KB2) that:
- returns true if KB1 and KB2 are logically equivalent.
- returns false otherwise.
Your pseudocode can re-use any code from the textbook or
slides, and can call any of the functions given in the textbook or
slides, as long as such code and functions are used correctly, with
correct names for the functions, and with well-specified values for all
variables and arguments.
Problem 4
15 points.
A |
B |
C |
KB |
S1 |
True |
True |
True |
True |
True |
True |
True |
False |
False |
True |
True |
False |
True |
True |
True |
True |
False |
False |
False |
True |
False |
True |
True |
False |
False |
False |
True |
False |
False |
False |
False |
False |
True |
False |
False |
False |
False |
False |
False |
False |
KB and S1 are two propositional logic statements, that are constructed
using symbols A, B, C, and using various connectives. The above truth
table shows, for each combination of values of A, B, C, whether KB and
S1 are true or false.
Part a: Given the above
information, does KB entail S1? Justify your answer.
Part b: Given the above
information, does statement NOT(KB) entail statement NOT(S1)? Justify
your answer.
Problem 5
10 points.
Suppose that you have a function f(kb, statement) that returns true iff
kb (the knowledge base) entails the statement (a logical sentence) and
false otherwise. Write pseudocode that, using function f, defines a
function g(kb, statement) that returns +1 iff the statement is
definitely true given kb, -1 iff the statement is definitely false
given kb, and 0 otherwise.
Problem 6
10 points.
Consider a knowledge base with these facts:
- There is a dog called Shadow.
- John gave Shadow to Mary.
- If Shadow is male, Mary gave a smartphone to John.
- If Shadow is female, Mary gave John a laptop.
- John only gives male dogs to people.
- Mary gave John a laptop.
Convert the above knowledge-base to a first-order logic knowledge base.
For each predicate, function, constant, or variable that you use,
explicitly state:
- What type of entity it is (is it a predicate, function,
constant, or variable).
- What its semantics are (what it means).
Problem 7
15 points.
Consider the same knowledge base as in the previous task. Assume that
the knowledge base has been successfully converted to first-order logic
statements. Under the rules of first-order logic, does this knowledge
base entail that Shadow is female? Justify your answer.
Other Instructions
- The answers can be typed as a document or handwritten and
scanned.
- Accepted document formats are (.pdf, .doc or
.docx). Please do not submit
.txt files. If you are using OpenOffice or LibreOffice, make sure to
save as .pdf or .doc
- If
you are scanning handwritten documents make sure to scan it at a
minimum of 600dpi and save as a .pdf or .png file.
- If there are multiple files in your submission, zip them
together and submit the .zip file.