|
||||
![]() Homework Fourout Thursday 10/26, due Tuesday 11/7The starter repository has 3 python files in it: agent.py, logic.py, and utils.py. You'll want to run python in the directory with those files and do "import logic". 1. Checking ValidityUse the functions in 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.
|