an easier way that works in every Prolog implementation: declare the predicate digit / 1 (the notation predicate / N means that the predicate has N arguments)
digit(D) :- member(D, [0,1,2,3,4,5,6,7,8,9]).
then you can ask
?- digit(A),digit(B),6 is A+B.
A = 0,
B = 6 ;
A = 1,
B = 5 ;
...
since the sum is symmetric, maybe you want to reduce the duplicate solution with
?- digit(A),digit(B),A=<B,6 is A+B.
Using the library (clpfd), you can avoid the definition of the digit / 1 predicate and get a lot of functionality:
?- [library(clpfd)].
true.
?- [A,B,C] ins 0..9, A+B+C
A = 0,
B = 4,
C = 9 ;
A = 0,
B = 5,
C = 8
...
Note that incognite may now remain to the left of the "destination" ...