I have table, and I wrote a predicate that creates a list from one table column. But unfortunately, it doesn’t work.
I expect the output N = [0, 1, 2]. But in fact I get an error.
Please tell me how to fix it.
t1("A", 0).
t1("B", 1).
t1("C", 2).
create_list(N)
foreach(t1(_, Id), appned(N, Id, N)).