• 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-process-else

    Handler for else directives.

    Signature
    (vl-process-else 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-else

    (defun
     vl-process-else (loc istack activep)
     (declare (xargs :guard (and (vl-location-p loc)
                                 (vl-istack-p istack)
                                 (booleanp activep))))
     (let
      ((__function__ 'vl-process-else))
      (declare (ignorable __function__))
      (b*
       (((when (atom istack))
         (mv
          (cw
           "Preprocessor error (~s0): found an `else, but no ~
                      ifdef/ifndef is open.~%"
           (vl-location-string loc))
          istack activep))
        ((when (vl-iframe->already-saw-elsep (car istack)))
         (mv
          (cw
           "Preprocessor error (~s0): found an `else, but we have ~
                     already seen an `else.~%"
           (vl-location-string loc))
          istack activep))
        (iframe (car istack))
        (prev-satisfiedp (vl-iframe->some-thing-satisfiedp iframe))
        (initially-activep (vl-iframe->initially-activep iframe))
        (new-activep (and initially-activep
                          (not prev-satisfiedp)))
        (new-iframe (make-vl-iframe :initially-activep initially-activep
                                    :some-thing-satisfiedp t
                                    :already-saw-elsep t))
        (new-istack (cons new-iframe (cdr istack))))
       (mv t new-istack new-activep))))

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

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

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

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

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

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