I’m using: SWI-Prolog version 8.0.3
I need to create a predicate in C like the following,
sum(X, Y, s)
The usage of this predicate is to resolve X and Y given s, like
sum(X, Y, 3)
The results should be {X=1, Y=2}, and {X=2, Y=1}, assuming we only want positive integers.
My question is not about the calculation logic to find values for X and Y, but how to return multiple results to the caller. The examples I saw from the prolog reference is all about one single result, like https://www.swi-prolog.org/pldoc/man?section=foreignxmp and https://www.swi-prolog.org/pldoc/man?section=cpp-examples.
Thanks!
Jackson