Hi guys, im working on writing a prolog permutation function. I know there's some snippets of code here and there on the net, but my permutation has to be in natural order, ie. [1,2,3] [1,3,2]. Regardless, I am just confused on the bindings of the variables. If the function is called
perm([1,2,3], Z).
How is Z being bound slowly to 1, [1,2], [1,2,3]?
I think my not being able to code the function is that mental block. I appreciate any help