Adder completo en Prolog
halfadd(X, Y, Z, C) :-
Z is X xor Y,
C is X /\ Y.
fulladd(X, Y, C, Z, D) :-
halfadd(X, Y, H, J),
halfadd(H, C, Z, K),
D is J \/ K.
Bright Booby