protocol
partitions_protocol
Protocol for set partition operations over lists.
logtalk_load(partitions(loader))staticPublic predicates
partitions/2
Generates all set partitions of a list using default order. Partitions are represented as lists of non-empty blocks. The empty list has one partition, represented by the empty list of blocks.
staticpartitions(List,Partitions)partitions(+list,-list) - onepartition/2
True iff the second argument is a set partition of a list using default order.
staticpartition(List,Partition)partition(+list,-list) - one_or_morepartitions/3
Generates either all set partitions with the given order (when the second argument is default or lexicographic) or all set partitions with an exact number of blocks using default order (when the first argument is an integer).
staticpartitions(ListOrK,OrderOrList,Partitions)partitions(+list,+atom,-list) - onepartitions(+integer,+list,-list) - onepartition/3
True iff the third argument is a set partition generated either in the given order or with the given exact number of blocks using default order.
staticpartition(ListOrK,OrderOrList,Partition)partition(+list,+atom,-list) - one_or_morepartition(+integer,+list,-list) - one_or_morepartitions/4
Generates all set partitions with an exact number of blocks and the given order: default or lexicographic.
staticpartitions(K,List,Order,Partitions)partitions(+integer,+list,+atom,-list) - onepartition/4
True iff the fourth argument is a set partition with an exact number of blocks and the given order: default or lexicographic.
staticpartition(K,List,Order,Partition)partition(+integer,+list,+atom,-list) - one_or_moredistinct_partitions/2
Generates all distinct set partitions of a list (deduplicating equal-valued partitions after canonicalizing block order) using default order.
staticdistinct_partitions(List,Partitions)distinct_partitions(+list,-list) - onedistinct_partition/2
True iff the second argument is a distinct set partition of a list using default order.
staticdistinct_partition(List,Partition)distinct_partition(+list,-list) - one_or_moredistinct_partitions/3
Generates either all distinct set partitions with the given order (when the second argument is default or lexicographic) or all distinct set partitions with an exact number of blocks using default order (when the first argument is an integer).
staticdistinct_partitions(ListOrK,OrderOrList,Partitions)distinct_partitions(+list,+atom,-list) - onedistinct_partitions(+integer,+list,-list) - onedistinct_partition/3
True iff the third argument is a distinct set partition generated either in the given order or with the given exact number of blocks using default order.
staticdistinct_partition(ListOrK,OrderOrList,Partition)distinct_partition(+list,+atom,-list) - one_or_moredistinct_partition(+integer,+list,-list) - one_or_moredistinct_partitions/4
Generates all distinct set partitions with an exact number of blocks and the given order: default or lexicographic.
staticdistinct_partitions(K,List,Order,Partitions)distinct_partitions(+integer,+list,+atom,-list) - onedistinct_partition/4
True iff the fourth argument is a distinct set partition with an exact number of blocks and the given order: default or lexicographic.
staticdistinct_partition(K,List,Order,Partition)distinct_partition(+integer,+list,+atom,-list) - one_or_morecount_partitions/2
Counts the number of set partitions of a list.
staticcount_partitions(List,Count)count_partitions(+list,-integer) - onenth_partition/3
Returns the set partition at a given zero-based index using default order.
staticnth_partition(List,Index,Partition)nth_partition(+list,+integer,-list) - zero_or_onenth_partition/4
Returns either the set partition at a given zero-based index in the given order (when the second argument is default or lexicographic) or the set partition with an exact number of blocks at a given zero-based index using default order (when the first argument is an integer).
staticnth_partition(ListOrK,OrderOrList,Index,Partition)nth_partition(+list,+atom,+integer,-list) - zero_or_onenth_partition(+integer,+list,+integer,-list) - zero_or_onenth_partition/5
Returns the set partition with an exact number of blocks at a given zero-based index in the given order: default or lexicographic.
staticnth_partition(K,List,Order,Index,Partition)nth_partition(+integer,+list,+atom,+integer,-list) - zero_or_onepartition_index/3
Returns the zero-based index of a set partition using default order.
staticpartition_index(List,Partition,Index)partition_index(+list,+list,-integer) - zero_or_onepartition_index/4
Returns either the zero-based index of a set partition in the given order (when the second argument is default or lexicographic) or the zero-based index of a set partition with an exact number of blocks using default order (when the first argument is an integer).
staticpartition_index(ListOrK,OrderOrList,Partition,Index)partition_index(+list,+atom,+list,-integer) - zero_or_onepartition_index(+integer,+list,+list,-integer) - zero_or_onepartition_index/5
Returns the zero-based index of a set partition with an exact number of blocks in the given order: default or lexicographic.
staticpartition_index(K,List,Order,Partition,Index)partition_index(+integer,+list,+atom,+list,-integer) - zero_or_onecount_partitions/3
Counts the number of set partitions of a list with an exact number of blocks.
staticcount_partitions(K,List,Count)count_partitions(+integer,+list,-integer) - zero_or_onecount_distinct_partitions/2
Counts the number of distinct set partitions of a list (deduplicating equal-valued partitions).
staticcount_distinct_partitions(List,Count)count_distinct_partitions(+list,-integer) - onenth_distinct_partition/3
Returns the distinct set partition at a given zero-based index using default order.
staticnth_distinct_partition(List,Index,Partition)nth_distinct_partition(+list,+integer,-list) - zero_or_onenth_distinct_partition/4
Returns either the distinct set partition at a given zero-based index in the given order (when the second argument is default or lexicographic) or the distinct set partition with an exact number of blocks at a given zero-based index using default order (when the first argument is an integer).
staticnth_distinct_partition(ListOrK,OrderOrList,Index,Partition)nth_distinct_partition(+list,+atom,+integer,-list) - zero_or_onenth_distinct_partition(+integer,+list,+integer,-list) - zero_or_onenth_distinct_partition/5
Returns the distinct set partition with an exact number of blocks at a given zero-based index in the given order: default or lexicographic.
staticnth_distinct_partition(K,List,Order,Index,Partition)nth_distinct_partition(+integer,+list,+atom,+integer,-list) - zero_or_onedistinct_partition_index/3
Returns the zero-based index of a distinct set partition using default order.
staticdistinct_partition_index(List,Partition,Index)distinct_partition_index(+list,+list,-integer) - zero_or_onedistinct_partition_index/4
Returns either the zero-based index of a distinct set partition in the given order (when the second argument is default or lexicographic) or the zero-based index of a distinct set partition with an exact number of blocks using default order (when the first argument is an integer).
staticdistinct_partition_index(ListOrK,OrderOrList,Partition,Index)distinct_partition_index(+list,+atom,+list,-integer) - zero_or_onedistinct_partition_index(+integer,+list,+list,-integer) - zero_or_onedistinct_partition_index/5
Returns the zero-based index of a distinct set partition with an exact number of blocks in the given order: default or lexicographic.
staticdistinct_partition_index(K,List,Order,Partition,Index)distinct_partition_index(+integer,+list,+atom,+list,-integer) - zero_or_onecount_distinct_partitions/3
Counts the number of distinct set partitions of a list with an exact number of blocks.
staticcount_distinct_partitions(K,List,Count)count_distinct_partitions(+integer,+list,-integer) - zero_or_onerandom_partition/2
Returns a random set partition of a list.
staticrandom_partition(List,Partition)random_partition(+list,-list) - onerandom_partition/3
Returns a random set partition of a list with an exact number of blocks.
staticrandom_partition(K,List,Partition)random_partition(+integer,+list,-list) - zero_or_onesample_partitions/3
Returns SampleCount random set partitions of a list, sampled with replacement.
staticsample_partitions(List,SampleCount,Samples)sample_partitions(+list,+integer,-list) - zero_or_onesample_partitions/4
Returns SampleCount random set partitions of a list with an exact number of blocks, sampled with replacement.
staticsample_partitions(K,List,SampleCount,Samples)sample_partitions(+integer,+list,+integer,-list) - zero_or_onerandom_distinct_partition/2
Returns a random distinct set partition of a list (deduplicating equal-valued partitions).
staticrandom_distinct_partition(List,Partition)random_distinct_partition(+list,-list) - onerandom_distinct_partition/3
Returns a random distinct set partition of a list with an exact number of blocks (deduplicating equal-valued partitions).
staticrandom_distinct_partition(K,List,Partition)random_distinct_partition(+integer,+list,-list) - zero_or_onesample_distinct_partitions/3
Returns SampleCount random distinct set partitions of a list, sampled with replacement after deduplicating equal-valued partitions.
staticsample_distinct_partitions(List,SampleCount,Samples)sample_distinct_partitions(+list,+integer,-list) - zero_or_onesample_distinct_partitions/4
Returns SampleCount random distinct set partitions of a list with an exact number of blocks, sampled with replacement after deduplicating equal-valued partitions.
staticsample_distinct_partitions(K,List,SampleCount,Samples)sample_distinct_partitions(+integer,+list,+integer,-list) - zero_or_onenext_partition/3
Returns the next distinct set partition value in lexicographic order induced by the first argument.
staticnext_partition(List,Partition,Next)next_partition(+list,+list,-list) - zero_or_onenext_partition/4
Returns the next distinct set partition value with an exact number of blocks in lexicographic order induced by the second argument.
staticnext_partition(K,List,Partition,Next)next_partition(+integer,+list,+list,-list) - zero_or_oneprevious_partition/3
Returns the previous distinct set partition value in lexicographic order induced by the first argument.
staticprevious_partition(List,Partition,Previous)previous_partition(+list,+list,-list) - zero_or_oneprevious_partition/4
Returns the previous distinct set partition value with an exact number of blocks in lexicographic order induced by the second argument.
staticprevious_partition(K,List,Partition,Previous)previous_partition(+integer,+list,+list,-list) - zero_or_oneProtected predicates
(none)
Private predicates
(none)
Operators
(none)