Hi, I've got this function:

This is rather a more general question, then particular to the problem of bruteforce proof of associativity
Thanks!
(defun operation-associative-p (operation set)
(not
(find-if
#'(lambda (x)
(find-if
#'(lambda (y)
(find-if
#'(lambda (z)
(let ((a (funcall
operation x (funcall operation y z)))
(b (funcall
operation (funcall operation x y) z)))
(if (eq a b)
(format t "~a * (~a * ~a) = ~a <=> (~a * ~a) * ~a = ~a~&"
x y z a x y z b)
t))) set)) set)) set)))
And it looks like it must be possible to reduce it somehow to only define the top-level lambda once (basically it, and the next lambda are the same functions!) but I cannot think of a way to do it This is rather a more general question, then particular to the problem of bruteforce proof of associativity
Thanks!