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
            • get_assoc/3
            • get_assoc/5
            • max_assoc/3
            • min_assoc/3
            • gen_assoc/3
          • Modifying association lists
          • Conversion predicates
          • Reasoning about association lists and their elements
    • Packages

A.4.3 Querying association lists

An association list can be queried with:

[semidet]get_assoc(+Key, +Assoc, -Value)
True if Key-Value is an association in Assoc.
[semidet]get_assoc(+Key, +Assoc0, ?Val0, ?Assoc, ?Val)
True if Key-Val0 is in Assoc0 and Key-Val is in Assoc.
[semidet]max_assoc(+Assoc, -Key, -Value)
True if Key-Value is in Assoc and Key is the largest key.
[semidet]min_assoc(+Assoc, -Key, -Value)
True if Key-Value is in assoc and Key is the smallest key.
[nondet]gen_assoc(?Key, +Assoc, ?Value)
True if Key-Value is an association in Assoc. Enumerates keys in ascending order on backtracking.
See also
get_assoc/3.