• 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-lookup

    Slow lookup in an svex-alist.

    Signature
    (svex-lookup var a) → value?
    Arguments
    var — Guard (svar-p var).
    a — Guard (svex-alist-p a).
    Returns
    value? — Type (iff (svex-p value?) value?).

    See also svex-fastlookup.

    Definitions and Theorems

    Function: svex-lookup

    (defun svex-lookup (var a)
      (declare (xargs :guard (and (svar-p var) (svex-alist-p a))))
      (let ((__function__ 'svex-lookup))
        (declare (ignorable __function__))
        (mbe :logic (cdr (hons-assoc-equal (svar-fix var)
                                           (svex-alist-fix a)))
             :exec (cdr (assoc-equal var a)))))

    Theorem: return-type-of-svex-lookup

    (defthm return-type-of-svex-lookup
      (b* ((value? (svex-lookup var a)))
        (iff (svex-p value?) value?))
      :rule-classes :rewrite)

    Theorem: svex-lookup-of-svar-fix-var

    (defthm svex-lookup-of-svar-fix-var
      (equal (svex-lookup (svar-fix var) a)
             (svex-lookup var a)))

    Theorem: svex-lookup-svar-equiv-congruence-on-var

    (defthm svex-lookup-svar-equiv-congruence-on-var
      (implies (svar-equiv var var-equiv)
               (equal (svex-lookup var a)
                      (svex-lookup var-equiv a)))
      :rule-classes :congruence)

    Theorem: svex-lookup-of-svex-alist-fix-a

    (defthm svex-lookup-of-svex-alist-fix-a
      (equal (svex-lookup var (svex-alist-fix a))
             (svex-lookup var a)))

    Theorem: svex-lookup-svex-alist-equiv-congruence-on-a

    (defthm svex-lookup-svex-alist-equiv-congruence-on-a
      (implies (svex-alist-equiv a a-equiv)
               (equal (svex-lookup var a)
                      (svex-lookup var a-equiv)))
      :rule-classes :congruence)

    Theorem: svex-lookup-of-nil

    (defthm svex-lookup-of-nil
      (equal (svex-lookup v nil) nil))

    Theorem: svex-lookup-of-svex-acons

    (defthm svex-lookup-of-svex-acons
      (equal (svex-lookup var1 (svex-acons var2 x a))
             (if (equal (svar-fix var1) (svar-fix var2))
                 (svex-fix x)
               (svex-lookup var1 a))))