• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • 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-find-file
            • Vl-read-files
            • 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
        • Vwsim
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Preprocessor

    Vl-process-endif

    Handler for endif directives.

    Signature
    (vl-process-endif loc istack activep) 
      → 
    (mv successp new-istack new-activep)
    Arguments
    loc — Guard (vl-location-p loc).
    istack — Guard (vl-istack-p istack).
    activep — Guard (booleanp activep).
    Returns
    successp — Type (booleanp successp).
    new-istack — Type (vl-istack-p new-istack), given (force (vl-istack-p istack)).
    new-activep — Type (booleanp new-activep), given (booleanp activep).

    Definitions and Theorems

    Function: vl-process-endif

    (defun vl-process-endif (loc istack activep)
     (declare (xargs :guard (and (vl-location-p loc)
                                 (vl-istack-p istack)
                                 (booleanp activep))))
     (let ((__function__ 'vl-process-endif))
      (declare (ignorable __function__))
      (b*
       (((when (atom istack))
         (mv
          (cw
           "Preprocessor error (~s0): found an `endif, but no ifdef/ifndef ~
                     is open.~%"
           (vl-location-string loc))
          istack activep))
        (new-istack (cdr istack))
        (new-activep (vl-iframe->initially-activep (car istack))))
       (mv t new-istack (and new-activep t)))))

    Theorem: booleanp-of-vl-process-endif.successp

    (defthm booleanp-of-vl-process-endif.successp
      (b* (((mv ?successp ?new-istack ?new-activep)
            (vl-process-endif loc istack activep)))
        (booleanp successp))
      :rule-classes :type-prescription)

    Theorem: vl-istack-p-of-vl-process-endif.new-istack

    (defthm vl-istack-p-of-vl-process-endif.new-istack
      (implies (force (vl-istack-p istack))
               (b* (((mv ?successp ?new-istack ?new-activep)
                     (vl-process-endif loc istack activep)))
                 (vl-istack-p new-istack)))
      :rule-classes :rewrite)

    Theorem: booleanp-of-vl-process-endif.new-activep

    (defthm booleanp-of-vl-process-endif.new-activep
      (implies (booleanp activep)
               (b* (((mv ?successp ?new-istack ?new-activep)
                     (vl-process-endif loc istack activep)))
                 (booleanp new-activep)))
      :rule-classes :type-prescription)