程序代写代做代考 Haskell 11/9/2020 Grok | COMP30026 Practice Exam

11/9/2020 Grok | COMP30026 Practice Exam
Queson 2 Part A (4 marks)
Queson 2
A proposional logic formula is in prexor normal form (PXNF) if it contains only the
following components and connecves:
The proposional constant true ( ),
proposional variables (for example, , ), and conjuncon ( ) and exclusive-or ( ) connecves.
Part A (4 marks)
The following four formulas are in prexor normal form:
1. 2. 3. 4.
For each of these formulas, give an equivalent but simplified proposional formula that uses exactly one connecve and does not use exclusive-or.
Note: For this queson, you do not need to give answers in prexor normal form; you may use any constants ( , ) and any connecves (that is , , , , or —anything other than ) along with the variables and .
Instrucons
Give your answer as four proposional formulas of type Exp, named exp1, exp2, exp3, and exp4, respecvely.
 Format
The Haskell type Exp has data constructors FALSE, TRUE, VAR, NOT, AND, OR, XOR, BIIM, and IMPL. Its definion is provided in the file Exp.hs, along with a simple parserparse :: String -> Exp.Thesetoolsarethesameasyouarefamiliarwith from worksheets and assignments.
For example, the formula can be expressed as: IMPL (AND (VAR ‘P’) (VAR ‘Q’)) (VAR ‘R’), or
parse “((P & Q) => R)”usingtheparsefuncon. https://groklearning.com/learn/unimelb-comp30026-2020-s2/prac-exam/3/ 1/1
Cheng
⇔ ⇒∨∧¬
QP⊕ ft
R ⇒ )Q ∧ P(
⊕∧ QP
t
)Q∧ P(⊕Q⊕ P )Q∧ P(⊕ P⊕t
Q⊕P⊕t P⊕t