• 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

    Lhs-first-aux

    Signature
    (lhs-first-aux w prev x) → first
    Arguments
    w — Guard (posp w).
    prev — Guard (lhatom-p prev).
    x — Guard (lhs-p x).
    Returns
    first — Type (iff (lhrange-p first) first).

    Definitions and Theorems

    Function: lhs-first-aux

    (defun lhs-first-aux (w prev x)
      (declare (xargs :guard (and (posp w)
                                  (lhatom-p prev)
                                  (lhs-p x))))
      (let ((__function__ 'lhs-first-aux))
        (declare (ignorable __function__))
        (if (atom x)
            (lhrange w prev)
          (if (lhrange-combinable-dec w prev (lhrange->atom (car x)))
              (lhs-first-aux (+ (pos-fix w) (lhrange->w (car x)))
                             prev (cdr x))
            (lhrange w prev)))))

    Theorem: return-type-of-lhs-first-aux

    (defthm return-type-of-lhs-first-aux
      (b* ((first (lhs-first-aux w prev x)))
        (iff (lhrange-p first) first))
      :rule-classes :rewrite)

    Theorem: lhs-first-aux-of-pos-fix-w

    (defthm lhs-first-aux-of-pos-fix-w
      (equal (lhs-first-aux (pos-fix w) prev x)
             (lhs-first-aux w prev x)))

    Theorem: lhs-first-aux-pos-equiv-congruence-on-w

    (defthm lhs-first-aux-pos-equiv-congruence-on-w
      (implies (pos-equiv w w-equiv)
               (equal (lhs-first-aux w prev x)
                      (lhs-first-aux w-equiv prev x)))
      :rule-classes :congruence)

    Theorem: lhs-first-aux-of-lhatom-fix-prev

    (defthm lhs-first-aux-of-lhatom-fix-prev
      (equal (lhs-first-aux w (lhatom-fix prev) x)
             (lhs-first-aux w prev x)))

    Theorem: lhs-first-aux-lhatom-equiv-congruence-on-prev

    (defthm lhs-first-aux-lhatom-equiv-congruence-on-prev
      (implies (lhatom-equiv prev prev-equiv)
               (equal (lhs-first-aux w prev x)
                      (lhs-first-aux w prev-equiv x)))
      :rule-classes :congruence)

    Theorem: lhs-first-aux-of-lhs-fix-x

    (defthm lhs-first-aux-of-lhs-fix-x
      (equal (lhs-first-aux w prev (lhs-fix x))
             (lhs-first-aux w prev x)))

    Theorem: lhs-first-aux-lhs-equiv-congruence-on-x

    (defthm lhs-first-aux-lhs-equiv-congruence-on-x
      (implies (lhs-equiv x x-equiv)
               (equal (lhs-first-aux w prev x)
                      (lhs-first-aux w prev x-equiv)))
      :rule-classes :congruence)

    Theorem: lhs-first-aux-in-terms-of-lhs-norm

    (defthm lhs-first-aux-in-terms-of-lhs-norm
      (equal (lhs-first-aux w prev x)
             (car (lhs-cons (lhrange w prev)
                            (lhs-norm x)))))