Im trying to solve this Cryptarithmetic puzzle:
in which "*" represents any digit.
This is the code that i came up with so far.
permutation(Xs,[Z|Zs]) :-
delete(Z,Xs,Ys),
permutation(Ys,Zs).
delete(X,[X|Xs],Xs).
delete(X,[Y|Ys],[Y|Zs]) :-
delete(X,Ys,Zs).
ca(A, B, C, D, E, F, G, H, I, J) :-
permutation([1, 2, 3, 4, 5, 6, 7, 8, 9, 0],
[A, B, C, D, E, F, G, H, I, J]),
(A*10000+B*1000+C*100+D*10+E*1) * (A * 1)
=:=
(_ * 100000 + _ * 10000 + H * 1000 + _ * 100 + _ * 10 + _ * 1).
I am fully aware that Prolog cannot just simply solve this equation using the _ operator.
What I'm trying to figure out is how to implement those unimportant digits which are represented in my code as single underscores.
Thanks for your help.

Solved with clpfd as suggested in the comments (try this video to learn clpfd):
Try on SWIPL: https://swish.swi-prolog.org/p/NSmyRcuA.pl
A query results in the unique solution: