• 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
        • Transforms
        • Lint
        • Mlib
          • Scopestack
          • Filtering-by-name
          • Vl-namefactory
          • Substitution
          • Allexprs
          • Hid-tools
          • Vl-consteval
          • Range-tools
          • Lvalexprs
          • Hierarchy
          • Finding-by-name
          • Expr-tools
          • Expr-slicing
          • Stripping-functions
          • Stmt-tools
            • Vl-rebuild-caselist
            • Vl-stmt-atomicstmts
            • Vl-compoundstmt->stmts
            • Change-vl-compoundstmt
              • Change-vl-compoundstmt-core
            • Vl-compoundstmt->vardecls
            • Vl-compoundstmt->paramdecls
            • Vl-compoundstmt->exprs
            • Vl-compoundstmt->ctrl
            • Vl-atomicstmt-p
            • Vl-atomicstmtlist-p
            • Vl-stmt->atts
            • Vl-vardecllist->initvals
            • Vl-assignstmt-p
            • Vl-whilestmt-p
            • Vl-timingstmt-p
            • Vl-repeatstmt-p
            • Vl-foreverstmt-p
            • Vl-enablestmt-p
            • Vl-waitstmt-p
            • Vl-nullstmt-p
            • Vl-ifstmt-p
            • Vl-forstmt-p
            • Vl-casestmt-p
          • Modnamespace
          • Vl-parse-expr-from-str
          • Welltyped
          • Reordering-by-name
          • Flat-warnings
          • Genblob
          • Expr-building
          • Datatype-tools
          • Syscalls
          • Relocate
          • Expr-cleaning
          • Namemangle
          • Caremask
          • Port-tools
          • Lvalues
        • Server
        • Kit
        • Printer
        • Esim-vl
        • Well-formedness
      • Sv
      • Fgl
      • Vwsim
      • Vl
      • X86isa
      • Svl
      • Rtl
    • Software-verification
    • Math
    • Testing-utilities
  • Stmt-tools

Change-vl-compoundstmt

Mutate a compound statement.

General form:

(change-vl-compoundstmt x
                        [:stmts stmts]
                        [:exprs exprs]
                        [:ctrl ctrl]
                        [:vardecls vardecls]
                        [:paramdecls paramdecls])

This expands into a suitable call of change-vl-compoundstmt-core. It allows you to modify statements without paying much attention to the kind of statement being modified.

Note that change-vl-compoundstmt-core has an elaborate guard; e.g., you must provide the same number of statements and expressions, and only provide a :ctrl when there is one, etc.

Macro: change-vl-compoundstmt

(defmacro change-vl-compoundstmt (x &rest args)
 (change-vl-compoundstmt-fn
   x
   (std::da-changer-args-to-alist 'change-vl-compoundstmt
                                  args
                                  '(:stmts :exprs :ctrl
                                           :vardecls :paramdecls))))

Definitions and Theorems

Function: change-vl-compoundstmt-fn

(defun change-vl-compoundstmt-fn (x alist)
  (cons 'change-vl-compoundstmt-core
        (list x
              (if (assoc :stmts alist)
                  (cdr (assoc :stmts alist))
                (list 'vl-compoundstmt->stmts x))
              (if (assoc :exprs alist)
                  (cdr (assoc :exprs alist))
                (list 'vl-compoundstmt->exprs x))
              (if (assoc :ctrl alist)
                  (cdr (assoc :ctrl alist))
                (list 'vl-compoundstmt->ctrl x))
              (if (assoc :vardecls alist)
                  (cdr (assoc :vardecls alist))
                (list 'vl-compoundstmt->vardecls x))
              (if (assoc :paramdecls alist)
                  (cdr (assoc :paramdecls alist))
                (list 'vl-compoundstmt->paramdecls
                      x)))))

Subtopics

Change-vl-compoundstmt-core
Mutate an arbitrary compound (non-atomic) statement.