• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
        • Term-level-reasoning
        • Glmc
        • Other-resources
        • Optimization
        • Reference
          • Def-gl-thm
          • Shape-specs
          • Symbolic-objects
          • Gl-aside
          • Def-gl-param-thm
          • Symbolic-arithmetic
          • Bfr
          • Def-gl-boolean-constraint
          • Gl-mbe
          • Bvec
            • Scdr
            • Bfr-list->s
            • Bfr-eval-list
            • Bfr-scons
            • Bfr-ucons
            • Bfr-list->u
            • Bfr-sterm
            • Bfr-snorm
            • Pbfr-list-depends-on
            • V2i
            • N2v
            • V2n
            • S-endp
            • I2v
            • First/rest/end
              • Bool->sign
            • Flex-bindings
            • Auto-bindings
            • Gl-interp
            • Gl-set-uninterpreted
            • Def-gl-clause-processor
            • Def-glcp-ctrex-rewrite
            • ACL2::always-equal
            • Gl-hint
            • Def-gl-rewrite
            • Def-gl-branch-merge
            • Gl-force-check
            • Gl-concretize
            • Gl-assert
            • Gl-param-thm
            • Gl-simplify-satlink-mode
            • Gl-satlink-mode
            • Gl-bdd-mode
            • Gl-aig-bddify-mode
            • Gl-fraig-satlink-mode
          • Debugging
          • Basic-tutorial
        • Esim
        • Vl2014
        • Sv
        • Fgl
        • Vwsim
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Bvec

    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))))))