9fe4d26c59
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1539 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
22 lines
385 B
Plaintext
22 lines
385 B
Plaintext
|
|
:- object(list(_type),
|
|
extends(list)).
|
|
|
|
:- info([
|
|
version is 1.0,
|
|
author is 'Paulo Moura',
|
|
date is 2006/1/29,
|
|
comment is 'List predicates with elements constrained to a single type.']).
|
|
|
|
valid(List) :-
|
|
nonvar(List),
|
|
parameter(1, Type),
|
|
\+ \+ valid(List, Type).
|
|
|
|
valid([], _).
|
|
valid([Value| List], Type) :-
|
|
Type::valid(Value),
|
|
valid(List, Type).
|
|
|
|
:- end_object.
|