Based on the code in the pics, How can I bind those unbounded variables with processing the structure? For example, how can I let the X=1,Y=2 for the example in first pic.
a more clear example:
I asked another question to be more specific. if it is still unclear,whatever.
Your question is still unclear. You don't bind anything "manually", do you?
Do you mean that you do the unification in the head of the predicate?
foobar(1, 2) --> [1, 2].
(A trivial example, since I don't know if this is what you are asking.)