Did you know ...
Search Documentation:
Predicate max_member/3
HOME
DOWNLOAD
SWI-Prolog
Sources/building
Docker images
Add-ons
Browse GIT
DOCUMENTATION
Manual
Packages
FAQ
Command line
PlDoc
Bluffers
▶
Prolog syntax
PceEmacs
HTML generation
License
Publications
Rev 7 Extensions
TUTORIALS
Beginner
▶
Getting started
Learn Prolog Now!
Simply Logical
Debugger
Development tools
Advanced
▶
Modules
Grammars (DCGs)
clp(fd)
Printing messages
PlDoc
Web applications
▶
Web applications
Let's Encrypt!
Pengines
Semantic web
▶
ClioPatria
RDF namespaces
Graphics
▶
XPCE
GUI options
Machine learning
▶
Probabilistic Logic Programming
External collections
▶
Meta level tutorials
For packagers
▶
Linux packages
COMMUNITY
IRC
Forum & mailing list
Blog
News
Report a bug
Submit a patch
Submit an add-on
Roadmap (on GitHub)
External links
Contributing
Code of Conduct
Contributors
SWI-Prolog items
COMMERCIAL
WIKI
Login
View changes
Sandbox
Wiki help
All tags
Documentation
Reference manual
The SWI-Prolog library
library(lists): List Manipulation
member/2
append/3
append/2
prefix/2
select/3
selectchk/3
select/4
selectchk/4
nextto/3
delete/3
nth0/3
nth1/3
nth0/4
nth1/4
last/2
proper_length/2
same_length/2
reverse/2
permutation/2
flatten/2
clumped/2
subseq/3
max_member/2
min_member/2
max_member/3
min_member/3
sum_list/2
max_list/2
min_list/2
numlist/3
is_set/1
list_to_set/2
intersection/3
union/3
subset/2
subtract/3
Packages
Availability:
:- use_module(
library(lists)
).
(can be autoloaded)
[semidet]
max_member
(
:Pred, -Max, +List
)
True when
Max
is the largest member according to
Pred
, which must be a 2-argument callable that behaves like (
@=<
)/2. Fails if
List
is empty. The following call is equivalent to
max_member/2
:
?- max_member(@=<, X, [6,1,8,4]). X = 8.
See also
max_list/2
for the maximum of a list of numbers.