• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Debugging
    • Projects
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
        • Warnings
        • Primitives
        • Use-set
        • Syntax
        • Getting-started
        • Utilities
        • Loader
          • Preprocessor
            • Vl-iframe-p
            • Preprocessor-ifdef-minutia
            • Vl-preprocess-loop
            • Vl-read-until-end-of-define
            • Vl-expand-define
            • Vl-read-include
            • Vl-process-ifdef
            • Vl-substitute-into-macro-text
            • Vl-preprocess
            • Vl-define
            • Vl-process-define
            • Vl-process-undef
            • Preprocessor-include-minutia
            • Vl-split-define-text
            • Vl-read-timescale
            • Vl-line-up-define-formals-and-actuals
            • Vl-process-else
            • Vl-process-endif
            • Vl-istack-p
            • Vl-is-compiler-directive-p
            • Vl-check-remaining-formals-all-have-defaults
            • Vl-safe-previous-n
              • Vl-safe-next-n
              • Vl-defines
              • *vl-preprocess-clock*
            • Vl-loadconfig
            • Lexer
            • Vl-loadstate
            • Parser
            • Vl-load-merge-descriptions
            • Scope-of-defines
            • Vl-load-file
            • Vl-flush-out-descriptions
            • Vl-description
            • Vl-loadresult
            • Vl-read-file
            • Vl-find-basename/extension
            • Vl-read-files
            • Vl-find-file
            • Extended-characters
            • Vl-load
            • Vl-load-main
            • Vl-load-description
            • Vl-descriptions-left-to-load
            • Inject-warnings
            • Vl-load-descriptions
            • Vl-load-files
            • Vl-load-summary
            • Vl-collect-modules-from-descriptions
            • Vl-descriptionlist
          • Transforms
          • Lint
          • Mlib
          • Server
          • Kit
          • Printer
          • Esim-vl
          • Well-formedness
        • Sv
        • Fgl
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Testing-utilities
      • Math
    • Preprocessor

    Vl-safe-previous-n

    Used to get a context for error messages.

    Signature
    (vl-safe-previous-n n acc) → prev-n
    Arguments
    n — Guard (natp n).
    Returns
    prev-n — Type (vl-echarlist-p prev-n), given (vl-echarlist-p acc).

    Definitions and Theorems

    Function: vl-safe-previous-n

    (defun vl-safe-previous-n (n acc)
           (declare (xargs :guard (natp n)))
           (let ((__function__ 'vl-safe-previous-n))
                (declare (ignorable __function__))
                (reverse (first-n (min (nfix n) (len acc))
                                  acc))))

    Theorem: vl-echarlist-p-of-vl-safe-previous-n

    (defthm vl-echarlist-p-of-vl-safe-previous-n
            (implies (vl-echarlist-p acc)
                     (b* ((prev-n (vl-safe-previous-n n acc)))
                         (vl-echarlist-p prev-n)))
            :rule-classes :rewrite)