• 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
          • Rewriting
          • Svex
          • Bit-blasting
            • Svex-focused-equivalence-checking
            • A4vec-operations
              • Aig-head-tail-concat-aux
                • A4vec-part-install
                • Aig-rev-blocks-sss
                • A4vec-wildeq-safe-aux
                • A4vec-concat
                • Aig-overlap-width-ss-aux
                • A4vec-wildeq-aux
                • A4vec-part-select
                • A4vec-rsh
                • A4vec-mask-check
                • Aig-head-of-concat
                • A4vec-===*-aux
                • A4vec-sign-ext
                • A4vec-rev-blocks
                • A3vec-bit?
                • A4vec-zero-ext
                • A3vec-?*
                • A3vec-?
                • A4vec-lsh
                • A4vec-bit?!
                • A4vec-?!
                • Aig-scons-with-hint
                • A4vec-override
                • A4vec-symwildeq
                • A4vec-remainder
                • A4vec-pow
                • A4vec-bit-extract
                • A4vec-wildeq-safe
                • A4vec-quotient
                • A4vec-mask
                • Aig-list->s-upper-bound
                • A4vec-wildeq
                • A4vec-resor
                • A4vec-resand
                • A3vec-bitxor
                • A4vec-times
                • A4vec-syntactic-3vec-p
                • A4vec-plus
                • A4vec-minus
                • A3vec-bitor
                • A3vec-bitand
                • A4vec-===*
                • A4vec-===
                • A4vec-<
                • A4vec-res
                • Aig-list->s-lower-bound
                • A3vec-==
                • A4vec-parity
                • 4vec->a4vec
                • Aig-force-sign-s
                • A4vec-wildeq-safe-bit
                • A4vec-onehot0
                • A4vec-onehot
                • A4vec-countones
                • A3vec-reduction-or
                • A3vec-reduction-and
                • A2vec-p
                • Aig-countones-aux
                • A4vec-uminus
                • A4vec-clog2
                • A3vec-fix
                • Aig-onehot-aux
                • A4vec-xdet
                • A4vec-onset
                • A4vec-offset
                • A3vec-bitnot
                • Aig-iszero-s
                • A4vec-wildeq-bit
                • A4vec-ite
                • Aig-sterm-with-hint
                • A4vec-===*-bit
                • A4vec-x
                • A4vec-1x
                • A4vec-0
                • And4
              • Svexlist-eval-gl
              • Aig-symbolic-arithmetic
              • Svex-varmasks/env->aig-env-rec
              • Svex-varmasks->a4env-rec
              • Svexlist/env-list-eval-gl
              • 4vmask-to-a4vec-rec-env
              • 4vmask-to-a4vec-rec
              • Svexlist->a4vecs-for-varlist
              • Svex-varmasks/env->aig-env-stats-rec
              • Svexlist->a4vec-nrev
              • A4veclist/svex-env-list-eval
              • A4vec
              • Svexlist-x-out-unused-vars
              • Svex->a4vec-memotable-correctp
              • A4vec/svex-env-eval
              • Svex-varmasks->a4env
              • Svex-varmasks/env->aig-env-rec-log
              • 4vmask-to-a4vec-env
              • 4veclist-from-bitlist-log-rec
              • Svex-apply-aig
              • Svexlist-vars-for-symbolic-eval
              • Nat-bool-a4env-upper-boundp
              • 4vmask-to-a4vec
              • Svexlist/env-list-vars-for-symbolic-eval
              • Svex-maskbits-for-vars
              • Svexlist->a4vec-aig-env-for-varlist
              • 4vec-from-bitlist
              • Svexlist-full-masks-p
              • Svex-varmasks/env->aig-env-stats
              • Svex-varmasks/env->aig-env
              • Svexlistlist->a4vec
              • Svex-const-concat-args
              • Svex-mask-alist-extract-vars
              • Svexlist->a4vec-top
              • Nat-bool-a4vec-upper-boundp
              • Nat-bool-a4env-lower-boundp
              • Maybe-a3vec-fix
              • Svex-maskbits-ok
              • Svex-envlist-check-boolmasks
              • Svex-env-check-boolmasks
              • Nat-bool-list-upper-boundp
              • Nat-bool-a4vec-lower-boundp
              • Maybe-svexlist-rewrite-fixpoint
              • 4vmask-to-a4vec-varcount
              • A4vec-eval
              • Svexlist-nth
              • A4veclist-nth
              • Nat-bool-list-lower-boundp
              • 4veclist-from-bitlist
              • V2i-first-n
              • A4veclist-eval-gl
              • Svex-envlist-keyset
              • Svex-a4vec-env-eval
              • A4veclist/env-list-eval
              • Svexlist-variable-mask-alist
              • Sparseint-nfix
              • A4veclist-length
              • A4veclist-eval
              • 4vec-boolmaskp
              • Nat-bool-list-nats
              • Nat-bool-a4env-p
              • Nat-bool-listp
              • A4veclist->aiglist
              • Svexlist-rewrite-fixpoint-memo
              • Nat-bool-a4vec-p
              • A4vec->aiglist
              • Svex-is-const-concat
              • Nat-bool-a4env-vars
              • Svexlist-mask-alist-memo
              • Nat-bool-a4vec-vars
              • Svexlist-vars-memo
              • A4vec-constantp
              • Svex-aig-memotable
              • Svex-a4vec-env
              • A4veclistlist
              • A4veclist
              • Symbolic-params-x-out-cond
            • 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
    • A4vec-operations

    Aig-head-tail-concat-aux

    Signature
    (aig-head-tail-concat-aux rev-shift shift-len 
                              lsbs msbs msbs-len width const-rsh) 
     
      → 
    concat
    Arguments
    rev-shift — Guard (true-listp rev-shift).
    shift-len — Guard (eql shift-len (len rev-shift)).
    lsbs — Guard (true-listp lsbs).
    msbs — Guard (true-listp msbs).
    msbs-len — Guard (eql msbs-len (len msbs)).
    width — Guard (posp width).
    const-rsh — Guard (natp const-rsh).
    Returns
    concat — Type (true-listp concat).

    Definitions and Theorems

    Function: aig-head-tail-concat-aux

    (defun aig-head-tail-concat-aux
           (rev-shift shift-len
                      lsbs msbs msbs-len width const-rsh)
     (declare (xargs :guard (and (true-listp rev-shift)
                                 (true-listp lsbs)
                                 (true-listp msbs)
                                 (posp width)
                                 (natp const-rsh)
                                 (eql shift-len (len rev-shift))
                                 (eql msbs-len (len msbs)))))
     (let ((__function__ 'aig-head-tail-concat-aux))
      (declare (ignorable __function__))
      (b*
       ((width (lposfix width))
        (const-rsh (lnfix const-rsh))
        ((when (atom rev-shift))
         (aig-logext-ns width (aig-logtail-ns const-rsh msbs)))
        (msbs-len (mbe :logic (len msbs) :exec msbs-len))
        (shift-len (1- (mbe :logic (len rev-shift)
                            :exec shift-len)))
        ((when (eq (car rev-shift) nil))
         (aig-head-tail-concat-aux (cdr rev-shift)
                                   shift-len
                                   lsbs msbs msbs-len width const-rsh))
        (width-plus-rsh (+ width const-rsh))
        (shift-too-widep
             (mbe :logic (<= width-plus-rsh (ash 1 shift-len))
                  :exec (or (< (integer-length width-plus-rsh)
                               shift-len)
                            (<= width-plus-rsh (ash 1 shift-len)))))
        (shift-too-narrowp (and (not shift-too-widep)
                                (>= const-rsh
                                    (+ msbs-len
                                       (1- (ash 1 (+ 1 shift-len)))))))
        ((when shift-too-narrowp)
         (aig-sterm (aig-sign-s msbs)))
        (rest1
         (if shift-too-widep (aig-logtail-ns const-rsh lsbs)
          (b* ((nshifted (ash 1 shift-len))
               ((when (<= nshifted const-rsh))
                (aig-head-tail-concat-aux
                     (cdr rev-shift)
                     shift-len (aig-logtail-ns nshifted lsbs)
                     msbs
                     msbs-len width (- const-rsh nshifted))))
           (aig-logapp-nss (- nshifted const-rsh)
                           (aig-logtail-ns const-rsh lsbs)
                           (aig-head-tail-concat-aux
                                (cdr rev-shift)
                                shift-len (aig-logtail-ns nshifted lsbs)
                                msbs
                                msbs-len (- width-plus-rsh nshifted)
                                0)))))
        ((when (eq (car rev-shift) t)) rest1)
        (rest0
         (aig-head-tail-concat-aux (cdr rev-shift)
                                   shift-len
                                   lsbs msbs msbs-len width const-rsh)))
       (aig-ite-bss (car rev-shift)
                    rest1 rest0))))

    Theorem: true-listp-of-aig-head-tail-concat-aux

    (defthm true-listp-of-aig-head-tail-concat-aux
     (b*
      ((concat
         (aig-head-tail-concat-aux rev-shift shift-len
                                   lsbs msbs msbs-len width const-rsh)))
      (true-listp concat))
     :rule-classes :rewrite)

    Theorem: our-logext-identity

    (defthm our-logext-identity
      (implies (signed-byte-p (pos-fix size) i)
               (equal (logext size i) i)))

    Theorem: signed-byte-p-monotonic

    (defthm signed-byte-p-monotonic
      (implies (and (signed-byte-p n x)
                    (<= n m)
                    (integerp m))
               (signed-byte-p m x)))

    Theorem: aig-head-tail-concat-aux-correct

    (defthm aig-head-tail-concat-aux-correct
     (implies
      (signed-byte-p (+ (pos-fix width) (nfix const-rsh))
                     (aig-list->s lsbs env))
      (equal
       (aig-list->s
           (aig-head-tail-concat-aux rev-shift shift-len
                                     lsbs msbs msbs-len width const-rsh)
           env)
       (logext width
               (logtail const-rsh
                        (logapp (aig-list->u (rev rev-shift) env)
                                (aig-list->s lsbs env)
                                (aig-list->s msbs env)))))))

    Theorem: aig-head-tail-concat-aux-of-list-fix-rev-shift

    (defthm aig-head-tail-concat-aux-of-list-fix-rev-shift
     (equal
         (aig-head-tail-concat-aux (list-fix rev-shift)
                                   shift-len
                                   lsbs msbs msbs-len width const-rsh)
         (aig-head-tail-concat-aux rev-shift shift-len
                                   lsbs msbs msbs-len width const-rsh)))

    Theorem: aig-head-tail-concat-aux-list-equiv-congruence-on-rev-shift

    (defthm aig-head-tail-concat-aux-list-equiv-congruence-on-rev-shift
     (implies
      (list-equiv rev-shift rev-shift-equiv)
      (equal
         (aig-head-tail-concat-aux rev-shift shift-len
                                   lsbs msbs msbs-len width const-rsh)
         (aig-head-tail-concat-aux rev-shift-equiv shift-len
                                   lsbs msbs msbs-len width const-rsh)))
     :rule-classes :congruence)

    Theorem: aig-head-tail-concat-aux-of-list-fix-lsbs

    (defthm aig-head-tail-concat-aux-of-list-fix-lsbs
     (equal
         (aig-head-tail-concat-aux rev-shift shift-len (list-fix lsbs)
                                   msbs msbs-len width const-rsh)
         (aig-head-tail-concat-aux rev-shift shift-len
                                   lsbs msbs msbs-len width const-rsh)))

    Theorem: aig-head-tail-concat-aux-list-equiv-congruence-on-lsbs

    (defthm aig-head-tail-concat-aux-list-equiv-congruence-on-lsbs
     (implies
      (list-equiv lsbs lsbs-equiv)
      (equal
           (aig-head-tail-concat-aux rev-shift shift-len
                                     lsbs msbs msbs-len width const-rsh)
           (aig-head-tail-concat-aux rev-shift shift-len lsbs-equiv
                                     msbs msbs-len width const-rsh)))
     :rule-classes :congruence)

    Theorem: aig-head-tail-concat-aux-of-list-fix-msbs

    (defthm aig-head-tail-concat-aux-of-list-fix-msbs
     (equal
      (aig-head-tail-concat-aux rev-shift shift-len lsbs (list-fix msbs)
                                msbs-len width const-rsh)
      (aig-head-tail-concat-aux rev-shift shift-len
                                lsbs msbs msbs-len width const-rsh)))

    Theorem: aig-head-tail-concat-aux-list-equiv-congruence-on-msbs

    (defthm aig-head-tail-concat-aux-list-equiv-congruence-on-msbs
     (implies
      (list-equiv msbs msbs-equiv)
      (equal
        (aig-head-tail-concat-aux rev-shift shift-len
                                  lsbs msbs msbs-len width const-rsh)
        (aig-head-tail-concat-aux rev-shift shift-len lsbs
                                  msbs-equiv msbs-len width const-rsh)))
     :rule-classes :congruence)

    Theorem: aig-head-tail-concat-aux-of-pos-fix-width

    (defthm aig-head-tail-concat-aux-of-pos-fix-width
     (equal
         (aig-head-tail-concat-aux rev-shift shift-len
                                   lsbs msbs msbs-len (pos-fix width)
                                   const-rsh)
         (aig-head-tail-concat-aux rev-shift shift-len
                                   lsbs msbs msbs-len width const-rsh)))

    Theorem: aig-head-tail-concat-aux-pos-equiv-congruence-on-width

    (defthm aig-head-tail-concat-aux-pos-equiv-congruence-on-width
     (implies
      (pos-equiv width width-equiv)
      (equal
        (aig-head-tail-concat-aux rev-shift shift-len
                                  lsbs msbs msbs-len width const-rsh)
        (aig-head-tail-concat-aux rev-shift shift-len lsbs
                                  msbs msbs-len width-equiv const-rsh)))
     :rule-classes :congruence)

    Theorem: aig-head-tail-concat-aux-of-nfix-const-rsh

    (defthm aig-head-tail-concat-aux-of-nfix-const-rsh
     (equal
         (aig-head-tail-concat-aux rev-shift shift-len lsbs
                                   msbs msbs-len width (nfix const-rsh))
         (aig-head-tail-concat-aux rev-shift shift-len
                                   lsbs msbs msbs-len width const-rsh)))

    Theorem: aig-head-tail-concat-aux-nat-equiv-congruence-on-const-rsh

    (defthm aig-head-tail-concat-aux-nat-equiv-congruence-on-const-rsh
     (implies
      (nat-equiv const-rsh const-rsh-equiv)
      (equal
        (aig-head-tail-concat-aux rev-shift shift-len
                                  lsbs msbs msbs-len width const-rsh)
        (aig-head-tail-concat-aux rev-shift shift-len lsbs
                                  msbs msbs-len width const-rsh-equiv)))
     :rule-classes :congruence)