• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • 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-parse-define-formal-arguments
            • 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-split-define-text

Split up the rest of a define line into macro arguments and macro text.

Signature
(vl-split-define-text text config) 
  → 
(mv successp formals body)
Arguments
text — The text that occurs after `define foo, perhaps including any macro arguments such as (a,b) in the case of macros such as `define max(a,b) ....
    Guard (vl-echarlist-p text).
config — Guard (vl-loadconfig-p config).
Returns
successp — Type (booleanp successp).
formals — Type (vl-define-formallist-p formals).
body — Remaining characters after any macro arguments.
    Type (vl-echarlist-p body), given (force (vl-echarlist-p text)).

Definitions and Theorems

Function: vl-split-define-text

(defun vl-split-define-text (text config)
  (declare (xargs :guard (and (vl-echarlist-p text)
                              (vl-loadconfig-p config))))
  (let ((__function__ 'vl-split-define-text))
    (declare (ignorable __function__))
    (b* (((unless (and (consp text)
                       (eql (vl-echar->char (car text)) #\()))
          (mv t nil (vl-echarlist-fix text))))
      (vl-parse-define-formal-arguments
           (cdr text)
           config (vl-echar->loc (car text))))))

Theorem: booleanp-of-vl-split-define-text.successp

(defthm booleanp-of-vl-split-define-text.successp
  (b* (((mv ?successp ?formals ?body)
        (vl-split-define-text text config)))
    (booleanp successp))
  :rule-classes :type-prescription)

Theorem: vl-define-formallist-p-of-vl-split-define-text.formals

(defthm vl-define-formallist-p-of-vl-split-define-text.formals
  (b* (((mv ?successp ?formals ?body)
        (vl-split-define-text text config)))
    (vl-define-formallist-p formals))
  :rule-classes :rewrite)

Theorem: vl-echarlist-p-of-vl-split-define-text.body

(defthm vl-echarlist-p-of-vl-split-define-text.body
  (implies (force (vl-echarlist-p text))
           (b* (((mv ?successp ?formals ?body)
                 (vl-split-define-text text config)))
             (vl-echarlist-p body)))
  :rule-classes :rewrite)

Subtopics

Vl-parse-define-formal-arguments