11/9/2020 Grok | COMP30026 Practice Exam
Ques on 3
Ques on 3 Part A (1 mark)
For parts A, B, and C, consider these closed first-order predicate logic formulas and :
: :
Part A (1 mark)
Show that is sa sfiable.
Show this by giving an interpreta on involving the finite domain of three objects
. That is, give a defini on of the two-place predicate which, along with
this domain, is a model for . Instruc ons
Define asaHaskellfunc onpredicateP :: Domain -> Domain -> Bool. Format
You can use any available Haskell syntax to define your func on. You should make sure that:
predicateP x yevaluatesto ,and
predicateP x yisdefinedforallvaluesofxandyfromthedomain.
The objects in the domain have type Domain, which derives familiar typeclasses such as Ord and Eq, so you can even use ==, <, and other standard opera ons to compare elements.
For example, either of the following two snippets define the predicate :
predicateP x y = not (x == y)
predicateP A A = False
predicateP B B = False
predicateP C C = False
predicateP _ _ = True
https://groklearning.com/learn/unimelb-comp30026-2020-s2/prac-exam/5/ 1/1
Cheng
F
P
}C ,B ,A{ G∧F
)y,x(P
G∧F
))x,y(P⇒)y,x(P(y∀x∀ G )x,x(Px∀ F
)y ≠ x( : )y,x(P
P
G