• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
      • Sv
        • Svex-stvs
        • Svex-decomposition-methodology
        • Sv-versus-esim
        • Svex-decomp
        • Svex-compose-dfs
        • Svex-compilation
        • Moddb
        • Svmods
        • Svstmt
        • Sv-tutorial
        • Expressions
          • Rewriting
            • Svex-rewrite
            • Svexlist-rewrite-nrev
            • Svex-args-apply-masks
            • 4veclist-quote
            • Svex-simpconfig-p
            • Svex-rewrite-memo-correct
            • Svex-alist-maybe-rewrite-fixpoint
            • Svexlist-compute-masks
            • Svexlist-rewrite-under-masks
            • Svex-alist-rewrite-fixpoint
            • Svexlist-maybe-rewrite-fixpoint
            • Svexlist-rewrite-fixpoint
            • Svexlist-mask-acons
            • Svexlist-mask-alist/toposort
            • Svex-call-simp
            • Svex-alist-compose
            • Svexlist-rewrite-top
            • Svex-alist-subst
            • Svex-alist-compose-rw
            • Svex-argmasks-lookup
            • Svex-alist-subst-rw
            • Svexlist-mask-acons-rev
            • Svex-mask-lookup
              • Svex-mask-acons
              • Svexlist-mask-alist
              • Svex-alist-rewrite-top
              • Constraintlist-compose
              • Svex-substconfig
              • Svex-simpconfig-fix
              • Svex-subst
              • Svex-rewrite-memo-vars-ok
              • Svex-norm-call
              • Svex-3value-mask
              • Svexlist-count-calls-aux
              • Svex-mask-alist-keys
              • Rewriter-tracing
              • Svex-rewrite-top
              • Svexlist-maskfree-rewrite-nrev
              • Svexlist-multirefs-top
              • Svexlist-count-calls
              • Svex-unify
              • Svexlist-toposort-p
              • Svexlist-maskfree-rewrite-top
              • Svex-alist-compose-nrev
              • Rewriting-concatenations
              • Svex-svex-memo
              • Svex-mask-alist
              • Svex-alist-subst-nrev
              • Svex-simpconfig-fix!
              • Svex-rewrite-rules
            • Svex
            • Bit-blasting
            • Functions
            • 4vmask
            • Why-infinite-width
            • Svex-vars
            • Evaluation
            • Values
          • Symbolic-test-vector
          • Vl-to-svex
        • Fgl
        • Vwsim
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Rewriting

    Svex-mask-lookup

    Signature
    (svex-mask-lookup x al) → mask
    Arguments
    x — Guard (svex-p x).
    al — Guard (svex-mask-alist-p al).
    Returns
    mask — Type (4vmask-p mask).

    Definitions and Theorems

    Function: svex-mask-lookup

    (defun svex-mask-lookup (x al)
      (declare (xargs :guard (and (svex-p x)
                                  (svex-mask-alist-p al))))
      (let ((__function__ 'svex-mask-lookup))
        (declare (ignorable __function__))
        (b* ((look (hons-get (svex-fix x) al)))
          (if look (4vmask-fix (cdr look)) 0))))

    Theorem: 4vmask-p-of-svex-mask-lookup

    (defthm 4vmask-p-of-svex-mask-lookup
      (b* ((mask (svex-mask-lookup x al)))
        (4vmask-p mask))
      :rule-classes :type-prescription)

    Theorem: svex-mask-lookup-of-svex-fix-x

    (defthm svex-mask-lookup-of-svex-fix-x
      (equal (svex-mask-lookup (svex-fix x) al)
             (svex-mask-lookup x al)))

    Theorem: svex-mask-lookup-svex-equiv-congruence-on-x

    (defthm svex-mask-lookup-svex-equiv-congruence-on-x
      (implies (svex-equiv x x-equiv)
               (equal (svex-mask-lookup x al)
                      (svex-mask-lookup x-equiv al)))
      :rule-classes :congruence)

    Theorem: svex-mask-lookup-of-svex-mask-alist-fix-al

    (defthm svex-mask-lookup-of-svex-mask-alist-fix-al
      (equal (svex-mask-lookup x (svex-mask-alist-fix al))
             (svex-mask-lookup x al)))

    Theorem: svex-mask-lookup-svex-mask-alist-equiv-congruence-on-al

    (defthm svex-mask-lookup-svex-mask-alist-equiv-congruence-on-al
      (implies (svex-mask-alist-equiv al al-equiv)
               (equal (svex-mask-lookup x al)
                      (svex-mask-lookup x al-equiv)))
      :rule-classes :congruence)

    Theorem: svex-mask-lookup-of-svex-mask-acons

    (defthm svex-mask-lookup-of-svex-mask-acons
      (equal (svex-mask-lookup x (svex-mask-acons y m al))
             (if (equal (svex-fix x) (svex-fix y))
                 (4vmask-fix m)
               (svex-mask-lookup x al))))

    Theorem: svex-mask-lookup-of-nil

    (defthm svex-mask-lookup-of-nil
      (equal (svex-mask-lookup k nil) 0))

    Theorem: svex-mask-lookup-of-cons

    (defthm svex-mask-lookup-of-cons
      (equal (svex-mask-lookup key1 (cons (cons key val) rest))
             (if (equal (svex-fix key1) key)
                 (4vmask-fix val)
               (svex-mask-lookup key1 rest))))