0
votes

enter image description here enter image description here

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.

how to do Arithmetic Operations in DCG in prolog

1
Just add , X=1, Y=2 to the line?lurker
no,no,no,during the runtime, not assign after runtimeSwordW
Then you put them before... :) X=1, Y=2, .... If that still doesn't meet your needs, then it's unclear what you're asking.lurker
I edited question , how about now?SwordW

1 Answers

1
votes

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.)