1. naloga ========= a) X = tina, Y = eva, D = 636; X = eva, Y = tomi, D = 218; X = tina, Y = eva, D = 436. b) findall(D, (called(eva, _, D); called(_, eva, D)), L), sum(L, Sum). c) called(X, Y, D), \+ (called(_, _, D2), D2 > D). 2. naloga ========= a) merge(SL, [], SL):-!. merge([], SL, SL). merge([H1|SL1], [H2|SL2], SL):- H1 < H2, merge(SL1, [H2|SL2], SLT), SL = [H1 | SLT] ; H1 >= H2, merge([H1|SL1], SL2, SLT), SL = [H2 | SLT]. b) merge_sort([], []). merge_sort([X], [X]):- !. merge_sort(L, SL):- divide(L, L1, L2), merge_sort(L1, SL1), merge_sort(L2, SL2), merge(SL1, SL2, SL). 3. naloga ========= a) true. false. false. true. b) op --> [X], {member(X, [+, *, -, /])}. c) Ni dvoumna. d) ex(X) --> dg(X). ex(X) --> opr(OP), ['('], ex(X1), [','], ex(X2), [')'], { Exp =.. [OP, X1, X2], X is Exp }. opr(X) --> [X], {member(X, [+, *])}. dg(X) --> [X], {member(X, [0,1,2,3,4,5,6,7,8,9])}. ALI ex(X) --> dg(X). ex(X) --> op(OP), ['('], ex(X1), [','], ex(X2), [')'], {(OP = '+', X is X1 + X2; OP = '*', X is X1 * X2)}. op(X) --> [X], {member(X, [+, *])}. dg(X) --> [X], {member(X, [0,1,2,3,4,5,6,7,8,9])}. 4. naloga ========= a) false. false. true. b) A = 1, B = 2; A = 2, B = 1. c) Permutacije. 5. naloga ========= ...