CS340 Lab 4 - Propositional Logic
You will use the “Propositional Logic” module of the AI program to answer the following questions. In the module the symbols “&”, “|”, “~”, “->”, “<=>” stand for “and”, “or”, “not”, “implies”, and “equivalent” respectively.
1. Test out the statement of DeMorgan’s law to see whether it is valid by entering ~(p|q)<=> ~p & ~q into the input statement and clicking on “Check Validity”. Examine the truth table generated by the “Display Truth Table” button and make sure you understand each of the steps. Do you think the following statement is valid? Answer before trying it out.
(smoke->fire) -> (~smoke -> ~fire)
2. Statements may be added to create a “knowledge-base” by using the “Tell Knowledge-Base” command. Queries to the knowledge base may be made with the “Ask Knowledge-Base” command. You will create a knowledge-base to answer problem 7.9 (p238) in the text.
For example, add the statement “mythical->immortal” to the knowledge-base.
Do this for all the rest of the statements about the unicorn. From the knowledge-base make queries to find out if the unicorn is mythical, magical, and horned. Turn in your knowledge-base and the answers to each of your three queries.
3.
Jones,
Smith, and Clark hold the jobs of programmer, knowledge engineer, and manager
(not necessarily in that order). Jones
owes the programmer $10. The manager’s
spouse prohibits borrowing money. Smith
is not married. Your task is to figure
out which person has which job.
Create a knowledge-base to answer question.
You should have nine propositional symbols to represent the possible
person/job assignments. For example, you
might use the symbol SM to indicate that Smith is the
manager. You do not need to represent
the relation between owing and borrowing, or being married and have a spouse;
you can just use these to draw conclusions (e.g. from “Smith is not married”
and “the manager’s spouse” we know that Smith can’t be the manager, which you
can then represent as ~SM). The possible
answers to the problem are sentences like JP & SK &
CM. There are six such combinations of
person/job assignments. Solve the
problem by showing that only one of them is implied by your knowledge base.
Turn in your knowledge-base plus the results of the six
queries.