• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Debugging
    • Projects
    • Std
    • Proof-automation
      • Gl
      • Witness-cp
      • Ccg
      • Install-not-normalized
      • Rewrite$
      • Removable-runes
      • Efficiency
      • Rewrite-bounds
      • Bash
      • Def-dag-measure
      • Fgl
        • Fgl-rewrite-rules
        • Fgl-function-mode
        • Fgl-object
        • Fgl-solving
        • Fgl-handling-if-then-elses
        • Fgl-getting-bits-from-objects
        • Fgl-primitive-and-meta-rules
        • Fgl-interpreter-overview
        • Fgl-counterexamples
        • Fgl-correctness-of-binding-free-variables
        • Fgl-debugging
        • Fgl-testbenches
        • Def-fgl-boolean-constraint
        • Fgl-stack
        • Fgl-rewrite-tracing
        • Def-fgl-param-thm
        • Def-fgl-thm
        • Fgl-fast-alist-support
          • Advanced-equivalence-checking-with-fgl
          • Fgl-array-support
          • Fgl-internals
        • Bdd
        • Remove-hyps
        • Contextual-rewriting
        • Simp
        • Rewrite$-hyps
        • Bash-term-to-dnf
        • Use-trivial-ancestors-check
        • Minimal-runes
        • Clause-processor-tools
        • Fn-is-body
        • Without-subsumption
        • Rewrite-equiv-hint
        • Def-bounds
        • Rewrite$-context
        • Try-gl-concls
        • Hint-utils
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Testing-utilities
      • Math
    • Fgl

    Fgl-fast-alist-support

    Support for hash-based fast alists in FGL

    FGL supports the use of fast alist primitives (see ACL2::fast-alists) in its rewriter. However, for accesses and updates to be fast, the user must ensure the following conditions are met:

    • The keys of the alist are always concrete values. (The values need not be concrete.)
    • The alist must only be used in a single-threaded, imperative-style manner, just as with ACL2 fast alists. For example, the following usage will cause a slow lookup to occur:
    • (let* ((al1 (hons-acons 'a 'aa nil))
             (al2 (hons-acons 'b 'bb al1)))
          (hons-get 'a al1))
    • The alist must not be modified within an if branch and then accessed outside that branch, unless care is taken to arrange the branch merging such that the keys of the alist remain concrete.

    For another approach to fast lookups in alists, see fgl-array-support.