I have a custom function findallX:
findallX(Template,Goal,Solutions) :- call(Goal), asserta(findallsolutions(Template)), fail. findallX(Template,G