• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
      • Gl
      • Witness-cp
      • Ccg
      • Install-not-normalized
      • Rewrite$
      • Fgl
        • Fgl-rewrite-rules
        • Fgl-function-mode
        • Fgl-object
          • Fgl-object-eval
          • Fgl-object-p
          • G-map
          • G-ite
          • G-cons
          • G-concrete
          • G-apply
          • G-integer
          • Fgl-object-equiv
          • G-boolean
          • G-var
          • Fgl-bitvector
            • Scdr
              • Bools->int
              • S-endp
              • First/rest/end
            • Fgl-object-kind
            • Summarize-fgl-object
            • Fgl-make-isomorphic
            • Fgl-object-alist
            • Fgl-objectlist
            • Fgl-object-fix
            • Fgl-object-count
          • Fgl-solving
          • Fgl-handling-if-then-elses
          • Fgl-getting-bits-from-objects
          • Fgl-primitive-and-meta-rules
          • Fgl-counterexamples
          • Fgl-interpreter-overview
          • Fgl-correctness-of-binding-free-variables
          • Fgl-debugging
          • Fgl-testbenches
          • Def-fgl-boolean-constraint
          • Fgl-stack
          • Fgl-rewrite-tracing
          • Def-fgl-param-thm
          • Def-fgl-thm
          • Fgl-fast-alist-support
          • Fgl-array-support
          • Advanced-equivalence-checking-with-fgl
          • Fgl-fty-support
          • Fgl-internals
        • Removable-runes
        • Efficiency
        • Rewrite-bounds
        • Bash
        • Def-dag-measure
        • Bdd
        • Remove-hyps
        • Contextual-rewriting
        • Simp
        • Rewrite$-hyps
        • Bash-term-to-dnf
        • Use-trivial-ancestors-check
        • Minimal-runes
        • Clause-processor-tools
        • Fn-is-body
        • Without-subsumption
        • Rewrite-equiv-hint
        • Def-bounds
        • Rewrite$-context
        • Try-gl-concls
        • Hint-utils
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Fgl-bitvector

    Scdr

    Like logcdr for signed bit vectors.

    Signature
    (scdr v) → cdr
    Arguments
    v — Guard (true-listp v).
    Returns
    cdr — Type (true-listp cdr).

    For a signed bit vector, the final bit is the sign bit, which we must implicitly extend out to infinity.

    Definitions and Theorems

    Function: scdr$inline

    (defun scdr$inline (v)
      (declare (xargs :guard (true-listp v)))
      (let ((__function__ 'scdr))
        (declare (ignorable __function__))
        (let ((v (llist-fix v)))
          (if (atom (cdr v)) v (cdr v)))))

    Theorem: true-listp-of-scdr

    (defthm true-listp-of-scdr
      (b* ((cdr (scdr$inline v)))
        (true-listp cdr))
      :rule-classes :type-prescription)

    Theorem: scdr-of-list-fix

    (defthm scdr-of-list-fix
      (equal (scdr (list-fix x))
             (list-fix (scdr x))))

    Theorem: scdr-count-weak

    (defthm scdr-count-weak
      (<= (acl2-count (scdr v))
          (acl2-count v))
      :rule-classes :linear)

    Theorem: scdr-count-strong

    (defthm scdr-count-strong
      (implies (not (s-endp v))
               (< (acl2-count (scdr v))
                  (acl2-count v)))
      :rule-classes :linear)

    Theorem: scdr-len-strong

    (defthm scdr-len-strong
      (implies (not (s-endp v))
               (< (len (scdr v)) (len v)))
      :rule-classes :linear)

    Theorem: scdr-len-weak

    (defthm scdr-len-weak
      (<= (len (scdr v)) (len v))
      :rule-classes :linear)

    Theorem: s-endp-of-scdr

    (defthm s-endp-of-scdr
      (implies (s-endp b) (s-endp (scdr b))))

    Theorem: scdr-when-s-endp

    (defthm scdr-when-s-endp
      (implies (s-endp x)
               (equal (scdr x) (list-fix x))))

    Theorem: scdr$inline-of-list-fix-v

    (defthm scdr$inline-of-list-fix-v
      (equal (scdr$inline (list-fix v))
             (scdr$inline v)))

    Theorem: scdr$inline-list-equiv-congruence-on-v

    (defthm scdr$inline-list-equiv-congruence-on-v
      (implies (acl2::list-equiv v v-equiv)
               (equal (scdr$inline v)
                      (scdr$inline v-equiv)))
      :rule-classes :congruence)