Wednesday, February 21, 2024

Determining if a term is a list.

 Determining if a term is a list.


list([]).
list([X|Xs]) :- list(Xs).



?- list([a,b,c]).

yes

?- list(abc).

no

No comments:

Post a Comment