<?xml version="1.0"?>
<!DOCTYPE logtalk SYSTEM "logtalk.dtd">
<?xml-stylesheet type="text/xsl" href="lgtxml.xsl"?>
<logtalk>
<entity>
<name><![CDATA[listp]]></name>
<type>protocol</type>
<compilation>static</compilation>
<comment><![CDATA[List protocol.]]></comment>
<authors><![CDATA[Paulo Moura]]></authors>
<version>1.0</version>
<date>2000/7/24</date>
</entity>
<relations>
</relations>
<predicates>
<public>
<predicate>
<name><![CDATA[append/3]]></name>
<scope>public</scope>
<compilation>static</compilation>
<mode>
<template><![CDATA[append(?list,?list,?list)]]></template>
<solutions>zero_or_more</solutions>
</mode>
<comment><![CDATA[Appends two lists.]]></comment>
<template><![CDATA[append(List1,List2,List)]]></template>
</predicate>
<predicate>
<name><![CDATA[delete/3]]></name>
<scope>public</scope>
<compilation>static</compilation>
<mode>
<template><![CDATA[delete(+list,@term,?list)]]></template>
<solutions>one</solutions>
</mode>
<comment><![CDATA[Deletes from a list all ocurrences of an element returning the list of remaining elements.]]></comment>
<template><![CDATA[delete(List,Element,Remaining)]]></template>
</predicate>
<predicate>
<name><![CDATA[delete_matches/3]]></name>
<scope>public</scope>
<compilation>static</compilation>
<mode>
<template><![CDATA[delete_matches(+list,@term,?list)]]></template>
<solutions>one</solutions>
</mode>
<comment><![CDATA[Deletes all matching elements from a list, returning the list of remaining elements.]]></comment>
<template><![CDATA[delete_matches(List,Element,Remaining)]]></template>
</predicate>
<predicate>
<name><![CDATA[empty/1]]></name>
<scope>public</scope>
<compilation>static</compilation>
<mode>
<template><![CDATA[empty(@list)]]></template>
<solutions>zero_or_one</solutions>
</mode>
<comment><![CDATA[True if the argument is an empty list.]]></comment>
<template><![CDATA[empty(List)]]></template>
</predicate>
<predicate>
<name><![CDATA[flatten/2]]></name>
<scope>public</scope>
<compilation>static</compilation>
<mode>
<template><![CDATA[flatten(+list,-list)]]></template>
<solutions>one</solutions>
</mode>
<comment><![CDATA[Flattens a list of lists into a list.]]></comment>
<template><![CDATA[flatten(List,Flatted)]]></template>
</predicate>
<predicate>
<name><![CDATA[keysort/2]]></name>
<scope>public</scope>
<compilation>static</compilation>
<mode>
<template><![CDATA[keysort(+list,-list)]]></template>
<solutions>one</solutions>
</mode>
<comment><![CDATA[Sorts a list of key-value pairs in ascending order.]]></comment>
<template><![CDATA[keysort(List,Sorted)]]></template>
</predicate>
<predicate>
<name><![CDATA[last/2]]></name>
<scope>public</scope>
<compilation>static</compilation>
<mode>
<template><![CDATA[last(?list,?term)]]></template>
<solutions>zero_or_more</solutions>
</mode>
<comment><![CDATA[List last element (if it exists).]]></comment>
<template><![CDATA[last(List,Last)]]></template>
</predicate>
<predicate>
<name><![CDATA[length/2]]></name>
<scope>public</scope>
<compilation>static</compilation>
<mode>
<template><![CDATA[length(?list,?integer)]]></template>
<solutions>zero_or_more</solutions>
</mode>
<comment><![CDATA[List length.]]></comment>
<template><![CDATA[length(List,Length)]]></template>
</predicate>
<predicate>
<name><![CDATA[max/2]]></name>
<scope>public</scope>
<compilation>static</compilation>
<mode>
<template><![CDATA[max(+list,-term)]]></template>
<solutions>zero_or_one</solutions>
</mode>
<comment><![CDATA[Determines the list maximum value using standard order. Fails if the list is empty.]]></comment>
<template><![CDATA[max(List,Maximum)]]></template>
</predicate>
<predicate>
<name><![CDATA[member/2]]></name>
<scope>public</scope>
<compilation>static</compilation>
<mode>
<template><![CDATA[member(?term,?list)]]></template>
<solutions>zero_or_more</solutions>
</mode>
<comment><![CDATA[Element is a list member.]]></comment>
<template><![CDATA[member(Element,List)]]></template>
</predicate>
<predicate>
<name><![CDATA[memberchk/2]]></name>
<scope>public</scope>
<compilation>static</compilation>
<mode>
<template><![CDATA[memberchk(?term,?list)]]></template>
<solutions>zero_or_one</solutions>
</mode>
<comment><![CDATA[Checks if a term is a member of a list.]]></comment>
<template><![CDATA[memberchk(Element,List)]]></template>
</predicate>
<predicate>
<name><![CDATA[min/2]]></name>
<scope>public</scope>
<compilation>static</compilation>
<mode>
<template><![CDATA[min(+list,-term)]]></template>
<solutions>zero_or_one</solutions>
</mode>
<comment><![CDATA[Determines the minimum value in a list using standard order. Fails if the list is empty.]]></comment>
<template><![CDATA[min(List,Minimum)]]></template>
</predicate>
<predicate>
<name><![CDATA[nth/3]]></name>
<scope>public</scope>
<compilation>static</compilation>
<mode>
<template><![CDATA[nth(?integer,+list,?term)]]></template>
<solutions>zero_or_more</solutions>
</mode>
<comment><![CDATA[Nth element of a list.]]></comment>
<template><![CDATA[nth(Nth,List,Element)]]></template>
</predicate>
<predicate>
<name><![CDATA[permutation/2]]></name>
<scope>public</scope>
<compilation>static</compilation>
<mode>
<template><![CDATA[permutation(?list,?list)]]></template>
<solutions>zero_or_more</solutions>
</mode>
<comment><![CDATA[The two lists are a permutation of the same list.]]></comment>
<template><![CDATA[permutation(List,Permutation)]]></template>
</predicate>
<predicate>
<name><![CDATA[prefix/2]]></name>
<scope>public</scope>
<compilation>static</compilation>
<mode>
<template><![CDATA[prefix(?list,+list)]]></template>
<solutions>zero_or_more</solutions>
</mode>
<comment><![CDATA[Prefix is a prefix of List.]]></comment>
<template><![CDATA[prefix(Prefix,List)]]></template>
</predicate>
<predicate>
<name><![CDATA[reverse/2]]></name>
<scope>public</scope>
<compilation>static</compilation>
<mode>
<template><![CDATA[reverse(+list,?list)]]></template>
<solutions>zero_or_one</solutions>
</mode>
<mode>
<template><![CDATA[reverse(?list,+list)]]></template>
<solutions>zero_or_one</solutions>
</mode>
<mode>
<template><![CDATA[reverse(-list,-list)]]></template>
<solutions>one_or_more</solutions>
</mode>
<comment><![CDATA[Reverses a list.]]></comment>
<template><![CDATA[reverse(List,Reversed)]]></template>
</predicate>
<predicate>
<name><![CDATA[same_length/2]]></name>
<scope>public</scope>
<compilation>static</compilation>
<mode>
<template><![CDATA[same_length(+list,?list)]]></template>
<solutions>zero_or_one</solutions>
</mode>
<mode>
<template><![CDATA[same_length(?list,+list)]]></template>
<solutions>zero_or_one</solutions>
</mode>
<mode>
<template><![CDATA[same_length(-list,-list)]]></template>
<solutions>one_or_more</solutions>
</mode>
<comment><![CDATA[The two lists have the same length.]]></comment>
<template><![CDATA[same_length(List1,List2)]]></template>
</predicate>
<predicate>
<name><![CDATA[select/3]]></name>
<scope>public</scope>
<compilation>static</compilation>
<mode>
<template><![CDATA[select(?term,+list,?list)]]></template>
<solutions>zero_or_more</solutions>
</mode>
<mode>
<template><![CDATA[select(?term,?list,+list)]]></template>
<solutions>zero_or_more</solutions>
</mode>
<comment><![CDATA[Selects an element from a list, returning the list of remaining elements.]]></comment>
<template><![CDATA[select(Element,List,Remaining)]]></template>
</predicate>
<predicate>
<name><![CDATA[sort/2]]></name>
<scope>public</scope>
<compilation>static</compilation>
<mode>
<template><![CDATA[sort(+list,-list)]]></template>
<solutions>one</solutions>
</mode>
<comment><![CDATA[Sorts a list in ascending order.]]></comment>
<template><![CDATA[sort(List,Sorted)]]></template>
</predicate>
<predicate>
<name><![CDATA[sublist/2]]></name>
<scope>public</scope>
<compilation>static</compilation>
<mode>
<template><![CDATA[sublist(?list,+list)]]></template>
<solutions>zero_or_more</solutions>
</mode>
<comment><![CDATA[The first list is a sublist of the second.]]></comment>
<template><![CDATA[sublist(Sublist,List)]]></template>
</predicate>
<predicate>
<name><![CDATA[subtract/3]]></name>
<scope>public</scope>
<compilation>static</compilation>
<mode>
<template><![CDATA[subtract(+list,+list,-list)]]></template>
<solutions>one</solutions>
</mode>
<comment><![CDATA[Removes all elements in the second list from the first list, returning the list of remaining elements.]]></comment>
<template><![CDATA[subtract(List,Elements,Remaining)]]></template>
</predicate>
<predicate>
<name><![CDATA[suffix/2]]></name>
<scope>public</scope>
<compilation>static</compilation>
<mode>
<template><![CDATA[suffix(?list,+list)]]></template>
<solutions>zero_or_more</solutions>
</mode>
<comment><![CDATA[Suffix is a suffix of List.]]></comment>
<template><![CDATA[suffix(Suffix,List)]]></template>
</predicate>
</public>
<protected>
</protected>
<private>
</private>
</predicates>
</logtalk>
