• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
      • Theories
      • Rule-classes
      • Proof-builder
      • Recursion-and-induction
      • Hons-and-memoization
      • Events
      • Parallelism
      • History
      • Programming
        • Defun
        • Declare
        • System-utilities
        • Stobj
        • State
        • Mutual-recursion
        • Memoize
        • Mbe
        • Io
        • Defpkg
        • Apply$
        • Loop$
        • Programming-with-state
        • Arrays
        • Characters
        • Time$
        • Defconst
        • Fast-alists
        • Defmacro
        • Loop$-primer
        • Evaluation
        • Guard
        • Equality-variants
        • Compilation
        • Hons
        • ACL2-built-ins
        • Developers-guide
        • System-attachments
        • Advanced-features
        • Set-check-invariant-risk
        • Numbers
        • Efficiency
        • Irrelevant-formals
        • Introduction-to-programming-in-ACL2-for-those-who-know-lisp
        • Redefining-programs
        • Lists
        • Invariant-risk
        • Errors
        • Defabbrev
        • Conses
        • Alists
          • Std/alists
          • Fast-alists
          • Alistp
          • Misc/records
          • Assoc
          • Remove-assocs
          • Symbol-alistp
          • Rassoc
          • Remove-assoc
          • Depgraph
          • Remove1-assoc
          • Alist-map-vals
          • Alist-map-keys
            • Alist-map-keys-functions-and-macros
            • Alist-map-keys-theorems
          • Put-assoc
          • Strip-cars
          • Pairlis$
          • Strip-cdrs
          • Sublis
          • Acons
          • Eqlable-alistp
          • Assoc-string-equal
          • Alist-to-doublets
          • Character-alistp
          • String-alistp
          • Alist-keys-subsetp
          • R-symbol-alistp
          • R-eqlable-alistp
          • Pairlis
          • Pairlis-x2
          • Pairlis-x1
          • Delete-assoc
        • Set-register-invariant-risk
        • Strings
        • Program-wrapper
        • Get-internal-time
        • Basics
        • Packages
        • Oracle-eval
        • Defmacro-untouchable
        • <<
        • Primitive
        • Revert-world
        • Unmemoize
        • Set-duplicate-keys-action
        • Symbols
        • Def-list-constructor
        • Easy-simplify-term
        • Defiteration
        • Fake-oracle-eval
        • Defopen
        • Sleep
      • Operational-semantics
      • Real
      • Start-here
      • Miscellaneous
      • Output-controls
      • Bdd
      • Macros
      • Installation
      • Mailing-lists
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
    • Math
    • Testing-utilities
  • Std/alists
  • Alists

Alist-map-keys

Keys of the map represented by an alist.

General Forms:
(alist-map-keys alist)
(alist-map-keys alist :test 'eql)   ; same as above (eql as equality test)
(alist-map-keys alist :test 'eq)    ; same, but eq is equality test
(alist-map-keys alist :test 'equal) ; same, but equal is equality test

This returns the ordered list of keys of the alist, after removing any shadowed pairs. When an alist represents a map, any shadowed pairs are irrelevant. This function is similar to strip-cars and alist-keys, except that these two may return lists with duplicates, which alist-map-keys always returns a list without duplicates. This function is a companion of alist-map-vals.

The optional keyword, :test, has no effect logically, but provides the test (default eql) used for comparing the keys of the alist in order to remove shadowed pairs.

The guard for a call of alist-map-keys depends on the test. In all cases, the argument must satisfy alistp. If the test is eql, the argument must satisfy eqlable-alistp. If the test is eq, the argument must satisfy symbol-alistp.

See equality-variants for a discussion of the relation between alist-map-keys and its variants:

(alist-map-keys-eq alist) is equivalent to (alist-map-keys alist :test 'eq);

(alist-map-keys-equal alist) is equivalent to (alist-map-keys alist :test 'equal).

In particular, reasoning about any of these primitives reduces to reasoning about the function alist-map-keys-equal.

Subtopics

Alist-map-keys-functions-and-macros
Definitions of the alist-map-keys functions and macros, and basic theorems about them.
Alist-map-keys-theorems
Theorems about alist-map-keys.