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

    Given a variable and a size in bits, create an LHS that covers those bits.

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

    Definitions and Theorems

    Function: svar->lhs-by-size

    (defun sv::svar->lhs-by-size (acl2::x sv::size)
     (declare (xargs :guard (and (sv::svar-p acl2::x)
                                 (natp sv::size))))
     (let ((__function__ 'sv::svar->lhs-by-size))
      (declare (ignorable __function__))
      (if (mbe :logic (zp sv::size)
               :exec (eql sv::size 0))
          nil
        (list (sv::make-lhrange :w sv::size
                                :atom (sv::make-lhatom-var :name acl2::x
                                                           :rsh 0))))))

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

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

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

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

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

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

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

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

    Theorem: svar->lhs-by-size-of-nfix-size

    (defthm sv::svar->lhs-by-size-of-nfix-size
      (equal (sv::svar->lhs-by-size acl2::x (nfix sv::size))
             (sv::svar->lhs-by-size acl2::x sv::size)))

    Theorem: svar->lhs-by-size-nat-equiv-congruence-on-size

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