views:

89

answers:

2

Hi, what are the two stars in a list?

[53, 5, 1, 53, 97, 115, 53, 50, 52, 121, 55, 56, 55, 97, 4, 1, 98, **]

I tried searching but no success.

Thanks, Jan

+6  A: 

The stars indicate that the term contains itself, e.g.

?- X = f(X).
X = f(**).

?- L = [53, L].
L = [53, **].

This is the case at least in SWI-Prolog. See also https://mailbox.iai.uni-bonn.de/mailman/public/swi-prolog/2009/001707.html.

Kaarel
A: 

You are right. It is an infinite recursion. Do you know any way how to get rid of it?

I mean how to get from [9,8,7,6,**] to [9,8,7,6]. I tried different approaches but nothing has helped so far.

I get ** while using flatten/2.

Jan
Open a new question explaining why do you want to get rid of the recursion, what have you tried so far, and what is the input list for flatten/2. Then delete this "answer" because this in not an answer but a question.
Kaarel