The superscript "(d)" stands for "difficult". Exercises similar to those marked with "(d)" might appear in candidacy exams, but not in the standard exams of CSE 428.
The superscript "(s)" stands for "solution provided". You can find the solution of these exercises here.
father(a,b). father(a,c). father(b,d). father(b,e). father(c,f).whose graphical representation is:
a / \ b c / \ | d e fSay which answers, and in which order, are generated by your definitions for the queries
?- brother(X,Y). ?- cousin(X,Y). ?- grandson(X,Y). ?- descendent(X,Y).Justify your answers by drawing the SLD-tree (akas Prolog search tree) for each query, at least schematically.
?- add_up_list([1,2,3,4],K). K = [1,3,6,10]; no
emptybt the empty binary tree consbt(N,T1,T2) the binary tree with root N and left and right subtrees T1 and T2
arc(a,b).would represent the existence of an arc going from the node a to the node b.
arc(a,b). arc(a,c). arc(b,c). arc(b,d). arc(c,d).What answers are given for the goal ?- path(a,d,P) by your solution to the last point? Justify your answer by drawing the SLD-tree (akas Prolog search tree), at least schematically.
Type ::= Tterm | Tterm -> Type Tterm ::= Tfact | Tterm * Tfact Tfact ::= Tvar | (Type) Tvar ::= ' Name
Exp ::= Ide (identifier) | (Exp Exp) (application) | fn Ide => Exp (abstraction) | fn (Ide,Ide) => Exp (abs. on pair) | (Exp,Exp) (pair)