True or false.
Using a cut can reduce the time used by a backtracking program.
Using a cut can reduce the amount of memory used by a backtracking program.
Using a cut in a predicate definition usually restricts the modes in which a predicate can run.
It is rare to find cuts in logic programs.
When a variable occurs in a logic programming goal, the interpreter is being asked whether that goal holds for all values of the variable.
In logic programming, a variable in an axiom might be used as an input variable sometimes, and as an output variable at other times, when computation uses that axiom.
Unification is a form of pattern matching. Which of the following is not a characteristic of unification?
Explain negation as failure. What is its goal, and how does it work?
In a logic programming style, write axioms for computing predicate samelength(X,Y), which is true just when X and Y are lists that have the same length.
In a logic programming style, write axioms for computing predicate allsame(X), which is true just when all members of list X are the same. For example, allsame([5,5,5]) is true, as is allsame([a,a]), but allsame([2,4,4]) is false. Note that allsame([]) is true, and allsame([b]) is true.
Two individuals are cousins if they have a grandparent in common, but they are not the same person, and are not siblings. Using predicate grandparent(X, Y), meaning that X is a grandparent of Y, and predicate sibling(X, Y) meaning that X and Y are siblings, write a definition of cousin(X, Y) using Prolog notation, meaning that X and Y are cousins.
Show the logic programming search tree for goal (member(X,[3,4,5]), member(X,[4])), up to the point where a success is found. The definition of the member predicate is as follows, written in Prolog syntax.
member(M, [M|X]). member(M, [X|T]) :- member(M, T).