• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
        • Symbolic-test-vectors
          • Defstv
          • Stv-compile
            • Stv-expand-input-entry
            • Stv-expand-output-entry
            • Stv-restrict-alist
            • Stv-extraction-alists
            • Stv-expand-input-lines
            • Stv-expand-input-entries
            • Stv-expand-output-entries
            • Stv-expand-internal-lines
            • Stv-expand-output-lines
            • Stv-expand-internal-line
            • Stv-gensyms
            • Stv-forge-state-bit
            • Safe-pairlis-onto-acc
            • Symbolic-test-vector-format
            • Stv-implementation-details
            • Compiled-stv-p
            • Stv-run-for-all-dontcares
            • Stv-run
            • Stv-process
            • Stv-run-check-dontcares
            • Symbolic-test-vector-composition
            • Stv-expand
            • Stv-easy-bindings
            • Stv-debug
            • Stv-run-squash-dontcares
            • Stvdata-p
            • Stv-doc
            • Stv2c
            • Stv-widen
            • Stv-out->width
            • Stv-in->width
            • Stv->outs
            • Stv-number-of-phases
            • Stv->ins
            • Stv-suffix-signals
            • Stv->vars
          • Esim-primitives
          • E-conversion
          • Esim-steps
          • Patterns
          • Mod-internal-paths
          • Defmodules
          • Esim-simplify-update-fns
          • Esim-tutorial
          • Esim-vl
        • Vl2014
        • Sv
        • Vwsim
        • Fgl
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Testing-utilities
      • Math
    • Stv-compile

    Safe-pairlis-onto-acc

    Just pairlis$ onto an accumulator, but for safety cause an error if the lists to pair up aren't the same length.

    Signature
    (safe-pairlis-onto-acc x y acc) → *

    Definitions and Theorems

    Function: safe-pairlis-onto-acc

    (defun
     safe-pairlis-onto-acc (x y acc)
     (declare (xargs :guard t))
     (let
      ((__function__ 'safe-pairlis-onto-acc))
      (declare (ignorable __function__))
      (mbe
       :logic (revappend (pairlis$ x y) acc)
       :exec
       (b* (((when (and (atom x) (atom y))) acc)
            ((when (atom x))
             (raise "Too many values!")
             acc)
            ((when (atom y))
             (raise "Not enough values!")
             (safe-pairlis-onto-acc (cdr x)
                                    nil (cons (cons (car x) nil) acc))))
           (safe-pairlis-onto-acc (cdr x)
                                  (cdr y)
                                  (cons (cons (car x) (car y)) acc))))))