Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 4.2.2 a)
- 2 ?- A = [2,3,1,7,8], findall(X, (member(X,A), X>2), L).
- A = [2, 3, 1, 7, 8]
- X = _G506
- L = [3, 7, 8]
- Yes
- 4.2.2 b)
- 3 ?- A = [2,3,1,7,8], findall(X, (member(X,A), X), L).
- ERROR: Type error: `callable' expected, found `2'
- 4 ?- A = [2,3,1,7,8], findall(X, (member(X,A), member(X,A)), L).
- A = [2, 3, 1, 7, 8]
- X = _G554
- L = [2, 3, 1, 7, 8]
- 4.2.2 d)
- 3 ?- A=[2,3,1,7,8], findall( X, (member(X,A), X>2, X=<7), L).
- 4.2.2 e)
- [1] 8 ?- A=[a, b], B=[[], 1], findall((X,Y), (member(X,A), member(Y,B)), L).
- 4.2.2 4 a)
- [2] 10 ?- A=[a], findall((X,Y), (member(X,A), member(Y,A)), L).
- 4.2.2 5
- A)
- [3] 12 ?- A=[x,y,z], B=[1,2], C=[u], findall((X,Y, Z), (member(X,A), member(Y,B), member(Z, C)), L).
- 6
- a) A=[1,2], B=[1,2,4], findall((X,Y), (member(X,B), member(Y,B), X<Y), L).
- f) [8] 21 ?- A=[1,2], B=[1,2,4], findall((X,Y), (member(X,A), member(Y,B), Y is X*X ), L).
- = porównanie wyglądu
- is przypiasnaie/ porównaie wartości / obliczanie a póżniej podstawianie
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement