Just thought I’d post a very quick question here, as I don’t use any online chat services. I’ve been catching up with some of the Advent of Code challenges and my few remaining brain cells are starting to struggle with some very simple stuff.
I’m using: SWI-Prolog version 8.5.3 for Linux.
In this case, for example, I have a list like this:
[[1], [1, 2], [1, 2, 3], [1, 2, 3, 4]]
And I want it to turn into something like this:
[[A], [A, B], [A, B, C], [A, B, C, D]]
For the challenge, I need to try to instantiate the variables depending on the sets that they come in. And I need to generate one unique variable per unique token.
I’m sure there’s some really easy, fundamental, Prological technique for doing this, but my head is fried at the minute and I can’t think of it.
Thanks!