Is it possible to table a term with cycles? Say I have the followig DCG:
'S'([a,b|A],A) 'S'([a,a,b,b|A],A) 'S'([a,a,a,b,b,b|A],A)
Without wanting to go into too much length how this is called and so on, tabling ‘S’/2 and then running a program that calls it taises a type error with "acyclic_term expected, found … " and so on.
ERROR: Type error: `acyclic_term' expected, found `@(ret('S',S_1),[S_1=[a,b|S_1]])' (a cyclic)
Is there a way to avoid this?