• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • ACL2
    • Macro-libraries
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
      • Sv
      • 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-counterexamples
          • Fgl-getting-bits-from-objects
          • Fgl-primitive-and-meta-rules
          • 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
        • Vwsim
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Fgl-bitvector

    First/rest/end

    Deconstruct a signed bit vector.

    Signature
    (first/rest/end x) → (mv * * *)
    Arguments
    x — Guard (true-listp x).

    Definitions and Theorems

    Function: first/rest/end

    (defun first/rest/end (x)
      (declare (xargs :guard (true-listp x)))
      (declare (xargs :guard t))
      (let ((__function__ 'first/rest/end))
        (declare (ignorable __function__))
        (mbe :logic (mv (car x) (scdr x) (s-endp x))
             :exec (cond ((atom x) (mv nil x t))
                         ((atom (cdr x)) (mv (car x) x t))
                         (t (mv (car x) (cdr x) nil))))))

    Theorem: first/rest/end-of-list-fix-x

    (defthm first/rest/end-of-list-fix-x
      (equal (first/rest/end (list-fix x))
             (first/rest/end x)))

    Theorem: first/rest/end-list-equiv-congruence-on-x

    (defthm first/rest/end-list-equiv-congruence-on-x
      (implies (acl2::list-equiv x x-equiv)
               (equal (first/rest/end x)
                      (first/rest/end x-equiv)))
      :rule-classes :congruence)