column(A,B,S,Carry,Left,CarryOut,LeftOut) :- (nonvar(A) -> L = Left;delete(Left,A,L)), (nonvar(B) -> M = L;delete(L,B,M)), Sum is A + B + Carry, S2 is Sum mod 10, CarryOut is (Sum - S2) / 10, (nonvar(S) -> S = S2,LeftOut = M;S = S2,delete(M,S,LeftOut)).