A.4 library(assoc): Association lists
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
      • The SWI-Prolog library
        • library(assoc): Association lists
          • Introduction
          • Creating association lists
          • Querying association lists
          • Modifying association lists
          • Conversion predicates
            • assoc_to_list/2
            • assoc_to_keys/2
            • assoc_to_values/2
          • Reasoning about association lists and their elements
    • Packages

A.4.5 Conversion predicates

Conversion of (parts of) an association list to lists is possible with:

[det]assoc_to_list(+Assoc, -Pairs)
Translate Assoc to a list Pairs of Key-Value pairs. The keys in Pairs are sorted in ascending order.
[det]assoc_to_keys(+Assoc, -Keys)
True if Keys is the list of keys in Assoc. The keys are sorted in ascending order.
[det]assoc_to_values(+Assoc, -Values)
True if Values is the list of values in Assoc. Values are ordered in ascending order of the key to which they were associated. Values may contain duplicates.