|
Revision 2737, 386 bytes
(checked in by pmoura, 3 years ago)
|
|
Avoid false singleton warnings with named anonymous variables on recent version of SWI-Prolog.
|
-
Property svn:eol-style set to
native
-
Property svn:keywords set to
Author Date Id Revision
|
| Line | |
|---|
| 1 | |
|---|
| 2 | :- object(list(_Type), |
|---|
| 3 | extends(list)). |
|---|
| 4 | |
|---|
| 5 | :- info([ |
|---|
| 6 | version is 1.01, |
|---|
| 7 | author is 'Paulo Moura', |
|---|
| 8 | date is 2006/4/25, |
|---|
| 9 | comment is 'List predicates with elements constrained to a single type.']). |
|---|
| 10 | |
|---|
| 11 | valid(List) :- |
|---|
| 12 | nonvar(List), |
|---|
| 13 | parameter(1, Type), |
|---|
| 14 | \+ \+ valid(List, Type). |
|---|
| 15 | |
|---|
| 16 | valid([], _). |
|---|
| 17 | valid([Value| List], Type) :- |
|---|
| 18 | Type::valid(Value), |
|---|
| 19 | valid(List, Type). |
|---|
| 20 | |
|---|
| 21 | :- end_object. |
|---|