Write a predicate that tests if all elements of a numeric list are positive. @mndrix

前端 未结 0 969
星月不相逢
星月不相逢 2021-01-30 00:35

how to write clauses, predicates and domains correctly?

all_greater_than_zero([]).
all_greater_than_zero([H|T]) :-
    H > 0,
    all_greater_than_zero(T).


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题