• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
      • B*
        • B*-binders
          • ACL2::patbind-ret
          • ACL2::patbind-stobj-get
          • Patbind-match
          • Patbind-when
          • Patbind-assocs
          • Patbind-the
          • Patbind-nths*
            • Patbind-er
            • Patbind-nths
            • Patbind-macro
            • Patbind-fun
            • Patbind-faig
            • Patbind-run-when
            • Patbind-pattern
            • Patbind-mv
            • Patbind-list*
            • Patbind-list
            • Patbind-cmp
            • Patbind-with-stolen
            • Patbind-with-fast
            • Patbind-unless-casematch
            • Patbind-cons
            • Patbind-access
            • Patbind-extract-keyword-args
            • Patbind-run-unless
            • Patbind-free-on-exit
            • Patbind-unless
            • Patbind-local-stobjs
            • Patbind-if
            • Patbind-getargs
            • Patbind-run-if
            • Patbind-state-global
            • Patbind-vl-read-zip-header-ret
            • Patbind-test-glmc-interp-nonhyps-ret
            • Patbind-test-glmc-interp-hyps-ret
            • Patbind-glmc-generic-interp-nonhyps-ret
            • Patbind-glmc-generic-interp-hyps-ret
          • Def-b*-binder
        • Defunc
        • Fty
        • Apt
        • Std/util
        • Defdata
        • Defrstobj
        • Seq
        • Match-tree
        • Defrstobj
        • With-supporters
        • Def-partial-measure
        • Template-subst
        • Soft
        • Defthm-domain
        • Event-macros
        • Def-universal-equiv
        • Def-saved-obligs
        • With-supporters-after
        • Definec
        • Sig
        • Outer-local
        • Data-structures
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • B*-binders

    Patbind-nths*

    b* binder for list decomposition, using nth, with one final nthcdr.

    Usage:

    (b* (((nths* a b c d) (list-fn ...)))
      form)

    is equivalent to

    (b* ((tmp (list-fn ...))
         (a   (nth 0 tmp))
         (b   (nth 1 tmp))
         (c   (nth 2 tmp))
         (d   (nthcdr 3 tmp)))
      form)

    Each of the arguments to the nths* binder may be a recursive binder, and nths* may be nested inside other bindings.

    This binder is very similar to the list* binder, see patbind-list*. However, here we put in explicit calls of nth and nthcdr, whereas the list* binder will put in, e.g., car, cadr, etc. The list* binder is likely to be more efficient in general, but the nths* binder may occasionally be useful when you have nth disabled.