|
||||
![]() Homework Fourout Wednesday 3/29, due Monday 4/10Here are some simple exercises to help you get comfortable with logic representations. Write out your answers and submit them on Monday 4/10. Notes: The aima.logic package requires that propositional variables (i.e., those whose values must be True or False) begin with an uppercase letter and logic variables (i.e., those that can take on any value) begin with a lowercase letter. See here for a an example of using logic.py on gl. The aima's logic.py package is well commented, so take a look if you have questions. The answer might be in the comments. 1. Checking ValidityUse the functions in aima's logic.py to see which of the following are valid, i.e., true in every model. You will have to (i) convert these sentences to the appropriate string form that the python code uses (see the comments in the code) and (ii) use the expr() function in logic.py to turn each into an Expr object, and (iii) use the tt_true() function to check for validity. Provide text from a session that shows the result of checking the validity of each. We've done the first one as an example.
2. SatisfiabilityUse the functions in logic.py to see which of the following are are satisfiable. We've done the first one as an example.
3. Propositional ConsequenceFor each of the following entailment relations, say whether or not it is true. The text on the left of the entailment symbol (⊨) represents one or more sentences (separated by commas) that constitute a knowledge base. We've done the first one for you.
4. English to FOLTranslate the following English sentences into first order logic. Feel free to optionally provide a more direct paraphrase of the meaning of your logic expression in English. If you think a sentence is ambiguous, describe the ambiguity and give logical expressions for all interpretations. We've done the first one for you using a notation with simple ASCII characters for logical operators (e.g., A:∀, E:∃, =>:→, <=>:↔, ^:∧, v:v, ~:¬, >:>)
5. CNF and horn clausesFor each of the following FOL sentences, (a) give a one-sentence, unambiguous paraphrase in English of what you think the FOL sentence means, (b) the say whether or not it can be rewritten as one or more horn clauses and (c) rewrite the sentence as one or more sentences in conjunctive normal form, identifying any skolem constants or functions you introduce.. Feel free to use the simple ASCII forms for logical operators described in the previous problem and to use the to_cnf() function in logic.py to check your answers. We've done the first one for you.
What and how to submitSubmit a single pdf document named hw4.pdf to your 471 github account. If you like you create your document using hw4.doc and saving the final version as pdf.
|