ranker_common — Logtalk 3.100.1

category

# `ranker_common`

Shared predicates for ranker score access, diagnostics, and export.

Availability:
`logtalk_load(ranking_protocols(loader))`
Author: Paulo Moura
Version: 1:0:0
Date: 2026-04-30
Compilation flags:
`static`
Implements:
`public` ranker_protocol
Extends:
`public` options
Uses:
avltree
format
list
type
Remarks:
(none)
Inherited public predicates:
check_option/1 check_options/1 check_ranker/1 default_option/1 default_options/1 diagnostic/2 diagnostics/2 export_to_clauses/4 export_to_file/4 learn/2 learn/3 option/2 option/3 print_ranker/1 rank/3 ranker_options/2 scores/2 valid_option/1 valid_options/1 valid_ranker/1

## Public predicates

(no local declarations; see entity ancestors if any)

## Protected predicates

### `ranker_scores_data/2`

Hook predicate that importing ranker implementations must define in order to expose the learned item-score pairs on the ranker native numeric scale.

Compilation flags:
`static`
Template:
`ranker_scores_data(Ranker,Scores)`
Mode and number of proofs:
`ranker_scores_data(+compound,-list(pair))` - `one`

### `ranker_diagnostics_data/2`

Hook predicate that importing ranker implementations must define in order to expose diagnostics metadata.

Compilation flags:
`static`
Template:
`ranker_diagnostics_data(Ranker,Diagnostics)`
Mode and number of proofs:
`ranker_diagnostics_data(+compound,-list(compound))` - `one`

### `ranker_export_template/4`

Hook predicate that importing ranker implementations must define in order to expose the exported ranker template for a given functor.

Compilation flags:
`static`
Template:
`ranker_export_template(Dataset,Ranker,Functor,Template)`
Mode and number of proofs:
`ranker_export_template(+object_identifier,+compound,+atom,-callable)` - `one`

### `ranker_term_template/2`

Hook predicate that importing ranker implementations must define in order to expose the learned ranker term template used by pretty-printing helpers.

Compilation flags:
`static`
Template:
`ranker_term_template(Ranker,Template)`
Mode and number of proofs:
`ranker_term_template(+compound,-callable)` - `one`

### `print_ranker_template/1`

Pretty-printing helper predicate used by importing ranker implementations to show the learned ranker term template.

Compilation flags:
`static`
Template:
`print_ranker_template(Ranker)`
Mode and number of proofs:
`print_ranker_template(+compound)` - `one`

### `valid_ranker_metadata/2`

True when the diagnostics list contains the expected model identifier, a valid effective options list, and a structurally valid dataset summary.

Compilation flags:
`static`
Template:
`valid_ranker_metadata(Model,Diagnostics)`
Mode and number of proofs:
`valid_ranker_metadata(+atom,+list(compound))` - `zero_or_one`

### `valid_item_value_pairs/2`

True when the second argument is an ordered list of unique `Item-Value` pairs aligned with the first argument item list.

Compilation flags:
`static`
Template:
`valid_item_value_pairs(Items,Pairs)`
Mode and number of proofs:
`valid_item_value_pairs(+list,+list(pair))` - `zero_or_one`

## Private predicates

(no local declarations; see entity ancestors if any)

## Operators

(none)