Hint
This task is very similar to the task that the predicate
element_of/2
, which we saw in the lecture, is
solving.
There are two cases which can be distinguished.
-
The first element of the input list is a 0. In this case the
list obviously contains 0 and
element_of
should succeed. -
The first element is not 0. In this case, the tail of the list
should contain a 0. That is,
element_of
should be true of the tail.