• 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
          • Address
          • Wire
          • Module
          • Lhs
            • Lhs.lisp
              • Lhs-vars-normorderedp
              • Lhs-norm
              • Lhatom-normorderedp
              • Lhs-normp
              • Svex-lhsrewrite-aux
              • Lhs-concat
              • Lhs-check-masks
              • Lhrange-combine
              • Svexarr-vars-aux
              • Assigns-check-masks
              • Svex->lhs-range
              • Svex-lhs-preproc-blkrev
              • Svarlist-boundedp-badguy
              • Driverlist-rest-after-strength
              • Aliases-normorderedp
              • Lhs-rsh
              • Lhs-cons
              • Svarlist-boundedp
              • Lhs-bitproj
              • Lhs-vars
              • Driver
              • Svex-override
              • Make-simple-lhs
              • Lhssvex-range-p
              • Lhs-override
              • Lhs-first-aux
              • Lhrange-combinable-dec
              • Lhrange-bitproj
                • Lhatom
                • Driverlist-values-of-strength
                • Lhs-rest-aux
                • Lhs-rest
                • Aliases-normorderedp-aux
                • Svexarr-vars
                • Lhsarr-to-svexarr
                • Svexarr-vars-witness-aux
                • Lhbit
                • Svex-lhsrewrite
                • Svar-boundedp
                • Lhs-decomp-aux
                • Svex->lhs-bound
                • Aliases-vars-aux
                • Svexarr
                • Svexarr-vars-witness
                • Svar-set-index
                • Lhsarr
                • Lhs-override-vars
                • Lhatom-eval-zero
                • Lhatom-bitproj
                • Lhrange-nextbit
                • Lhrange-combinable
                • Driverlist->svex
                • Svexlist-resolve
                • Lhs->svex-zero
                • Lhs-overridelist-vars
                • Lhs-overridelist-keys
                • Lhbit-eval
                • Driverlist-vars
                • Assigns-vars
                • Svex-int
                • Lhssvex-bounded-p
                • Lhslist-vars
                • Lhs-decomp
                • Lhatom-vars
                • Svar-map-vars
                • Lhssvex-unbounded-p
                • Lhspairs-vars
                • Lhs-width
                • Aliases-vars
                • Lhs-first
                • Svar-index
                • Assigns
                • Svar-indexedp
                • Lhspairs
                • Svex-overridelist
                • Lhslist
                • Lhs-overridelist
                • Driverlist
                • Svex-lhs-preproc
                • Svexarr-fix
                • Lhsarr-fix
              • Lhs-p
              • Lhs-fix
              • Lhrange
              • Lhs-eval-zx
              • Lhs-equiv
              • Lhs-eval
              • Lhs->svex
            • Path
            • Svar-add-namespace
            • Design
            • Modinst
            • Lhs-add-namespace
            • Modalist
            • Path-add-namespace
            • Modname->submodnames
            • Name
            • Constraintlist-addr-p
            • Svex-alist-addr-p
            • Svar-map-addr-p
            • Lhspairs-addr-p
            • Modname
            • Assigns-addr-p
            • Lhs-addr-p
            • Lhatom-addr-p
            • Modhier-list-measure
            • Attributes
            • Modhier-measure
            • Modhier-list-measure-aux
            • Modhier-loopfreelist-p
            • Modhier-loopfree-p
          • Svstmt
          • Sv-tutorial
          • Expressions
          • Symbolic-test-vector
          • Vl-to-svex
        • Fgl
        • Vwsim
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Lhs.lisp

    Lhrange-bitproj

    Signature
    (lhrange-bitproj idx x) → bit
    Arguments
    idx — Guard (natp idx).
    x — Guard (lhrange-p x).
    Returns
    bit — Type (lhbit-p bit).

    Definitions and Theorems

    Function: lhrange-bitproj

    (defun lhrange-bitproj (idx x)
      (declare (xargs :guard (and (natp idx) (lhrange-p x))))
      (let ((__function__ 'lhrange-bitproj))
        (declare (ignorable __function__))
        (b* (((lhrange x) x) (idx (lnfix idx)))
          (if (<= x.w idx)
              (lhbit-z)
            (lhatom-bitproj idx x.atom)))))

    Theorem: lhbit-p-of-lhrange-bitproj

    (defthm lhbit-p-of-lhrange-bitproj
      (b* ((bit (lhrange-bitproj idx x)))
        (lhbit-p bit))
      :rule-classes :rewrite)

    Theorem: lhrange-bitproj-of-nfix-idx

    (defthm lhrange-bitproj-of-nfix-idx
      (equal (lhrange-bitproj (nfix idx) x)
             (lhrange-bitproj idx x)))

    Theorem: lhrange-bitproj-nat-equiv-congruence-on-idx

    (defthm lhrange-bitproj-nat-equiv-congruence-on-idx
      (implies (nat-equiv idx idx-equiv)
               (equal (lhrange-bitproj idx x)
                      (lhrange-bitproj idx-equiv x)))
      :rule-classes :congruence)

    Theorem: lhrange-bitproj-of-lhrange-fix-x

    (defthm lhrange-bitproj-of-lhrange-fix-x
      (equal (lhrange-bitproj idx (lhrange-fix x))
             (lhrange-bitproj idx x)))

    Theorem: lhrange-bitproj-lhrange-equiv-congruence-on-x

    (defthm lhrange-bitproj-lhrange-equiv-congruence-on-x
      (implies (lhrange-equiv x x-equiv)
               (equal (lhrange-bitproj idx x)
                      (lhrange-bitproj idx x-equiv)))
      :rule-classes :congruence)

    Theorem: lhrange-bitproj-correct

    (defthm lhrange-bitproj-correct
      (equal (lhbit-eval (lhrange-bitproj idx x) env)
             (4vec-bit-index idx (lhrange-eval x env))))

    Theorem: lhrange-bitproj-of-lhrange-combine

    (defthm lhrange-bitproj-of-lhrange-combine
      (implies (lhrange-combine x y)
               (equal (lhrange-bitproj idx (lhrange-combine x y))
                      (if (< (nfix idx) (lhrange->w x))
                          (lhrange-bitproj idx x)
                        (lhrange-bitproj (- (nfix idx) (lhrange->w x))
                                         y)))))

    Theorem: lhatom-bitproj-of-lhrange-combine-atom

    (defthm lhatom-bitproj-of-lhrange-combine-atom
      (implies
           (lhrange-combine x y)
           (equal (lhatom-bitproj idx
                                  (lhrange->atom (lhrange-combine x y)))
                  (if (< (nfix idx) (lhrange->w x))
                      (lhatom-bitproj idx (lhrange->atom x))
                    (lhatom-bitproj (- (nfix idx) (lhrange->w x))
                                    (lhrange->atom y))))))