Question: What is it called for the variable matching process in Prolog? What would it be the result of the following prolog query? 2. ?- p(X,
What is it called for the variable matching process in Prolog?
| What would it be the result of the following prolog query? | ||
| 2. | ?- p(X, f(Y), a) = p(a, f(a), Y). |
|
| 3. | ?- p(X, f(Y), a) = p(a, f(b), Y). |
|
| 4. | ?- [a, b, c] = [X | Y]. |
|
| 5. | ?- [a, b, c] = [X, Y | Z]. |
|
| 6. | ?- [a, b, c] = [X, Y, Z | T]. |
|
| 7. | ?- transpose([[1,2,3],[4,5,6],[7,8,9]], Ts). |
|
| 8. | ?- (31 is (36-5)). |
|
9. Consider the following query. How many answers will it have? _____
?- member(X,[1,2,3,4]), Y = X*X, Y<10.
10. What is a correct definition of negation in Prolog?
11. Given the following facts and predicates
mystery(A,B) :- mystery(A,[],B). mystery([X|Y],Z,W) :- mystery(Y,[X|Z],W). mystery([],X,X).
What would be the result of the query below? ?- mystery([1,2,3], A).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
