• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
      • Sv
        • Svex-stvs
        • Svex-fixpoint-decomposition-methodology
        • Sv-versus-esim
        • Svex-decomp
        • Svex-compose-dfs
        • Moddb
        • Svex-compilation
        • Svmods
        • Svstmt
        • Sv-tutorial
        • Expressions
          • Rewriting
          • Svex
            • Svar
            • Least-fixpoint
            • Svex-p
            • Svex-select
            • Svex-alist
              • Svex-alist-p
              • Svex-alist-fix
              • Svex-alist-vars
              • Svex-alist-eval
              • Svex-lookup
              • Svex-fastacons
              • Svex-alist-vals
              • Svex-alist-keys
                • Svex-acons
                • Svex-alist-equiv
                • Svex-fastlookup
              • Svex-equiv
              • Svexlist
              • Svex-call
              • Fnsym
              • Svex-quote
              • Svex-var
              • Svcall-rw
              • Svcall
              • Svex-kind
              • Svcall*
              • Svex-fix
              • Svex-count
              • Svex-1z
              • Svex-1x
              • Svex-z
              • Svex-x
            • Bit-blasting
            • Functions
            • 4vmask
            • Why-infinite-width
            • Svex-vars
            • Evaluation
            • Values
          • Symbolic-test-vector
          • Vl-to-svex
        • Vwsim
        • Fgl
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Testing-utilities
      • Math
    • Svex-alist

    Svex-alist-keys

    Like alist-keys but with proper fty-discipline for svex-alists.

    Signature
    (svex-alist-keys x) → keys
    Arguments
    x — Guard (svex-alist-p x).
    Returns
    keys — Type (svarlist-p keys).

    Definitions and Theorems

    Function: svex-alist-keys

    (defun svex-alist-keys (x)
      (declare (xargs :guard (svex-alist-p x)))
      (let ((__function__ 'svex-alist-keys))
        (declare (ignorable __function__))
        (mbe :logic
             (if (atom x)
                 nil
               (if (mbt (and (consp (car x)) (svar-p (caar x))))
                   (cons (caar x)
                         (svex-alist-keys (cdr x)))
                 (svex-alist-keys (cdr x))))
             :exec (strip-cars x))))

    Theorem: svarlist-p-of-svex-alist-keys

    (defthm svarlist-p-of-svex-alist-keys
      (b* ((keys (svex-alist-keys x)))
        (svarlist-p keys))
      :rule-classes :rewrite)

    Theorem: svex-alist-keys-of-svex-alist-fix-x

    (defthm svex-alist-keys-of-svex-alist-fix-x
      (equal (svex-alist-keys (svex-alist-fix x))
             (svex-alist-keys x)))

    Theorem: svex-alist-keys-svex-alist-equiv-congruence-on-x

    (defthm svex-alist-keys-svex-alist-equiv-congruence-on-x
      (implies (svex-alist-equiv x x-equiv)
               (equal (svex-alist-keys x)
                      (svex-alist-keys x-equiv)))
      :rule-classes :congruence)

    Theorem: member-svex-alist-keys

    (defthm member-svex-alist-keys
      (iff (member k (svex-alist-keys x))
           (and (svar-p k) (svex-lookup k x))))

    Theorem: svex-alist-keys-of-svex-acons

    (defthm svex-alist-keys-of-svex-acons
      (equal (svex-alist-keys (svex-acons k v x))
             (cons (svar-fix k)
                   (svex-alist-keys x))))

    Theorem: svex-alist-keys-of-pairlis$

    (defthm svex-alist-keys-of-pairlis$
      (equal (svex-alist-keys (pairlis$ x y))
             (svarlist-filter x)))