I'm doing a bunch of Prolog tasks and I have very little idea of how lists work. I have the following:
is_a_list(+L)
. Test whetherL
is a valid Prolog list.
How can I write a predicate for that? What does the +
mean?
I'm doing a bunch of Prolog tasks and I have very little idea of how lists work. I have the following:
is_a_list(+L)
. Test whetherL
is a valid Prolog list.
How can I write a predicate for that? What does the +
mean?
The following can be simplified to give You the solution You seek .
is_a_list_of_integer([]) .
is_a_list_of_integer([ITEM|LISTs])
:-
prolog:integer(ITEM) ,
is_a_list_of_integer(LISTs)
.