category

# `sequential_pattern_mining_common`

Shared predicates for sequential pattern miner dataset validation, support counting, and pattern ordering helpers.

Availability:
`logtalk_load(sequential_pattern_mining_protocols(loader))`
Author: Paulo Moura
Version: 1:0:0
Date: 2026-04-29
Compilation flags:
`static`
Extends:
`public` pattern_miner_common
Uses:
list
type
Remarks:
(none)
Inherited public predicates:
check_option/1 check_options/1 check_pattern_miner/1 default_option/1 default_options/1 diagnostic/2 diagnostics/2 export_to_clauses/4 export_to_file/4 mine/2 mine/3 option/2 option/3 pattern_miner_options/2 print_pattern_miner/1 valid_option/1 valid_options/1 valid_pattern_miner/1

## Public predicates

(no local declarations; see entity ancestors if any)

## Protected predicates

### `check_sequences/4`

Validates the collected dataset sequences and returns the maximum total sequence length.

Compilation flags:
`static`
Template:
`check_sequences(Dataset,ItemDomain,Sequences,MaxSequenceLength)`
Mode and number of proofs:
`check_sequences(+object_identifier,+list(atom),+list(pair(integer,list(list(atom)))),-integer)` - `one`

### `pattern_length/2`

Computes the total number of items in a sequential pattern.

Compilation flags:
`static`
Template:
`pattern_length(Pattern,PatternLength)`
Mode and number of proofs:
`pattern_length(+list(list(atom)),-integer)` - `one`

### `sort_patterns/2`

Sorts sequence patterns first by total item count and then lexicographically.

Compilation flags:
`static`
Template:
`sort_patterns(Patterns0,Patterns)`
Mode and number of proofs:
`sort_patterns(+list(compound),-list(compound))` - `one`

### `filter_patterns/3`

Filters sequence patterns by minimum total item count.

Compilation flags:
`static`
Template:
`filter_patterns(Patterns0,MinimumPatternLength,Patterns)`
Mode and number of proofs:
`filter_patterns(+list(compound),+integer,-list(compound))` - `one`

### `count_items/4`

Accumulates support counts for a list of items.

Compilation flags:
`static`
Template:
`count_items(Items,Count,ItemCounts0,ItemCounts)`
Mode and number of proofs:
`count_items(+list(atom),+integer,+list(pair(atom,integer)),-list(pair(atom,integer)))` - `one`

### `select_frequent_item_supports/3`

Selects the item supports that satisfy the minimum support count.

Compilation flags:
`static`
Template:
`select_frequent_item_supports(ItemCounts,SupportCount,FrequentItemSupports)`
Mode and number of proofs:
`select_frequent_item_supports(+list(pair(atom,integer)),+integer,-list(compound))` - `one`

### `sort_item_supports/2`

Sorts item supports lexicographically by item.

Compilation flags:
`static`
Template:
`sort_item_supports(ItemSupports0,ItemSupports)`
Mode and number of proofs:
`sort_item_supports(+list(compound),-list(compound))` - `one`

### `valid_sequence_patterns/2`

True when the patterns are valid `sequence_pattern(Pattern, Support)` terms over the given item domain with positive integer supports.

Compilation flags:
`static`
Template:
`valid_sequence_patterns(ItemDomain,Patterns)`
Mode and number of proofs:
`valid_sequence_patterns(+list(atom),+list(compound))` - `zero_or_one`

## Private predicates

(no local declarations; see entity ancestors if any)

## Operators

(none)