maximum(
[minimum(
[maximum([minimum([l(2),l(12)]),minimum([l(6),l(10)])]),
maximum([minimum([l(8),l(19)]),minimum([l(17),l(21)])])]),
minimum(
[maximum([minimum([l(5),l(4)]),minimum([l(15),l(9)])]),
maximum([minimum([l(12),l(16)]),minimum([l(2),l(12)])])])])
For this question you must author prolog code that allows you to apply alpha/beta pruning to a tree in this form using the top-level syntax: ?- alphabeta(T,V) where < T > is a tree in the form above and < V > is the final value. When called your code should also print out the value for each node processed and the pruning steps as it goes of the form:
"Leaf Value: 2" "Max node Value: 4" "Min node Value: 2" "Alpha Prune." "Beta Prune."
Comments
Leave a comment