计算机代写|Comp2022/2922 Assignment 5 (80 marks) s2 2022

这是一篇来自澳洲的关于解决一些万圣节相关问题的计算机代写

Consider the domain of Halloween creatures with the following predicates:

This will be used in the first three problems.

Problem 1. (5 marks) The Halloween creatures want to scare people who have not taken this course by expressing statements about themselves in predicate logic.

1. There is a scary ghost.

2. Somebody is afraid of everything.

3. For every scary zombie, some ghost is afraid of them.

4. If everybody is afraid of a ghost, that ghost is scary.

No additional explanation is needed.

Problem 2. (10 marks) The creatures are developing Logical Principles of Unnatural Philosophy, a book that contains laws about monsters that are true in all possible universes. However, they need help determining which laws are valid or not.

Show the following using the equivalence laws taught in this course.

1. x(G(x) S(x)) ≡ ∃xy(S(y) ∨ ¬G(x))

2. xS(x) ↔ ∃xS(x) ≡ ∀x(S(x) → ∀yS(y))

Problem 3. (10 marks) The proof-readers of the book are skeptical about two of the claimed equivalences. Show the following by providing, for each one, a counterexample over a finite domain.

1. x(yA(y, x) S(x)) ̸≡ ∀xy(A(y, x) S(x))

2. xyz(A(x, y) A(y, z)) ̸≡ ∃xy(A(x, y) A(y, x))

Problem 4. (25 marks, 5/5/5/10) Prove the following consequents using the most horrifying thing of all, natural deduction.

1. x(P(x) → ¬Q(x)), x(R(x) P(x)) ⊢ ∀x(Q(x) → ¬R(x))

2. x(P(x) Q(y)) ⊢ ∀xP(x) Q(y)

3. yzx(P(x, y) P(x, z)) ⊢ ∀xyP(x, y)

xyz((P(x, y) P(y, z)) P(x, z)),

xy(P(x, y) ∧ ∀z(P(z, x) P(y, z))) ⊢ ∀xyP(x, y)

Problem 5. (30 marks, 10/10/10) Let Σ = {a, b}. For each of the following languages, provide a Context-free Grrrrrammar that generates it:

No additional explanation is needed.