• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • 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
        • Symbolic-test-vector
        • Vl-to-svex
          • Vl-to-sv
          • Vl-design->sv-design
            • Vl-simpconfig
            • Vl-hierarchy-sv-translation
            • Vl-expr-svex-translation
            • Vl-design->svex-modalist
            • Vl-svstmt
              • Vl-svstmt.lisp
                • Vl-casestmt-violation-conds
                • Vl-caselist-none/multiple
                • Vl-elaborated-expr-consteval
                • Vl-always->svex
                • Vl-caseexprs->svex-test
                • Vl-always->svex-checks
                • Vl-implicitvalueparam-final-type
                • Vl-assignstmt->svstmts
                • Vl-fundecl-to-svex
                • Vl-evatomlist-delay-substitution
                • Vl-consteval
                • Vl-alwayslist->svex
                • Vl-index-expr-svex/size/type
                • Vl-vardecllist->svstmts
                • Sv::svex-alist->assigns
                • Vl-case-conservative-test-expr
                • Vl-evatomlist->svex
                • Vl-case-xcond-wrapper
                • Sv::constraintlist-maybe-rewrite-fixpoint
                • Vl-always-apply-trigger-to-updates
                • Vl-initiallist-size-warnings
                • Vl-initial-size-warnings
                • Vl-finallist-size-warnings
                • Vl-always->svex-latch-warnings
                • Vl-final-size-warnings
                • Sv::svarlist-masked-x-subst
                • Sv::svar->lhs-by-mask
                  • Svstmt-config
                  • Sv::svex-alist-unset-nonblocking
                  • Sv::svar->lhs-by-size
                  • Combine-mask-alists
                  • Sv::svarlist-delay-subst
                  • Vttree-constraints-to-svstmts
                  • Sv::4vmask-alist-unset-nonblocking
                  • Sv::svarlist-remove-delays
                  • Vl-caselist->caseexprs
                  • Vl-evatomlist-has-edge
            • Vl-to-sv-main
            • Vl-simplify-sv
            • Vl-user-paramsettings->unparam-names
            • Vl-user-paramsettings->modnames
        • Fgl
        • Vwsim
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Vl-svstmt.lisp

    Sv::svar->lhs-by-mask

    Given a variable and a mask of bits, create an LHS that covers those bits.

    Signature
    (sv::svar->lhs-by-mask acl2::x sv::mask) → sv::lhs
    Arguments
    acl2::x — Guard (sv::svar-p acl2::x).
    sv::mask — Guard (sv::4vmask-p sv::mask).
    Returns
    sv::lhs — Type (sv::lhs-p sv::lhs).

    Fails by returning an empty LHS if the mask is negative, i.e. an ~ infinite range of bits should be written.

    Definitions and Theorems

    Function: svar->lhs-by-mask

    (defun sv::svar->lhs-by-mask (acl2::x sv::mask)
     (declare (xargs :guard (and (sv::svar-p acl2::x)
                                 (sv::4vmask-p sv::mask))))
     (let ((__function__ 'sv::svar->lhs-by-mask))
      (declare (ignorable __function__))
      (and
       (bitops::sparseint-< 0 (sv::4vmask-fix sv::mask))
       (list
            (sv::make-lhrange
                 :w (bitops::sparseint-length (sv::4vmask-fix sv::mask))
                 :atom (sv::make-lhatom-var :name acl2::x
                                            :rsh 0))))))

    Theorem: lhs-p-of-svar->lhs-by-mask

    (defthm sv::lhs-p-of-svar->lhs-by-mask
      (b* ((sv::lhs (sv::svar->lhs-by-mask acl2::x sv::mask)))
        (sv::lhs-p sv::lhs))
      :rule-classes :rewrite)

    Theorem: vars-of-svar->lhs-by-mask

    (defthm sv::vars-of-svar->lhs-by-mask
     (implies
      (not (equal sv::v (sv::svar-fix acl2::x)))
      (not
        (member
             sv::v
             (sv::lhs-vars (sv::svar->lhs-by-mask acl2::x sv::mask))))))

    Theorem: svar->lhs-by-mask-of-svar-fix-x

    (defthm sv::svar->lhs-by-mask-of-svar-fix-x
      (equal (sv::svar->lhs-by-mask (sv::svar-fix acl2::x)
                                    sv::mask)
             (sv::svar->lhs-by-mask acl2::x sv::mask)))

    Theorem: svar->lhs-by-mask-svar-equiv-congruence-on-x

    (defthm sv::svar->lhs-by-mask-svar-equiv-congruence-on-x
      (implies (sv::svar-equiv acl2::x sv::x-equiv)
               (equal (sv::svar->lhs-by-mask acl2::x sv::mask)
                      (sv::svar->lhs-by-mask sv::x-equiv sv::mask)))
      :rule-classes :congruence)

    Theorem: svar->lhs-by-mask-of-4vmask-fix-mask

    (defthm sv::svar->lhs-by-mask-of-4vmask-fix-mask
      (equal (sv::svar->lhs-by-mask acl2::x (sv::4vmask-fix sv::mask))
             (sv::svar->lhs-by-mask acl2::x sv::mask)))

    Theorem: svar->lhs-by-mask-4vmask-equiv-congruence-on-mask

    (defthm sv::svar->lhs-by-mask-4vmask-equiv-congruence-on-mask
      (implies (sv::4vmask-equiv sv::mask sv::mask-equiv)
               (equal (sv::svar->lhs-by-mask acl2::x sv::mask)
                      (sv::svar->lhs-by-mask acl2::x sv::mask-equiv)))
      :rule-classes :congruence)