• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • 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
            • 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

    Vl-compoundstmt->exprs

    Get all immediate sub-expressions from any compound statement.

    Signature
    (vl-compoundstmt->exprs x) → exprs
    Arguments
    x — Guard (vl-stmt-p x).
    Returns
    exprs — Type (vl-exprlist-p exprs).

    Note that this only returns the top-level expressions that are directly part of the statement.

    Definitions and Theorems

    Function: vl-compoundstmt->exprs

    (defun vl-compoundstmt->exprs (x)
      (declare (xargs :guard (vl-stmt-p x)))
      (declare (xargs :guard (not (vl-atomicstmt-p x))))
      (let ((__function__ 'vl-compoundstmt->exprs))
        (declare (ignorable __function__))
        (vl-stmt-case
             x
             :vl-casestmt (cons x.test
                                (flatten (alist-keys x.caselist)))
             :vl-ifstmt (list x.condition)
             :vl-foreverstmt nil
             :vl-waitstmt (list x.condition)
             :vl-whilestmt (list x.condition)
             :vl-forstmt (list x.test)
             :vl-repeatstmt (list x.condition)
             :vl-blockstmt nil
             :vl-timingstmt nil
             :otherwise nil)))

    Theorem: vl-exprlist-p-of-vl-compoundstmt->exprs

    (defthm vl-exprlist-p-of-vl-compoundstmt->exprs
      (b* ((exprs (vl-compoundstmt->exprs x)))
        (vl-exprlist-p exprs))
      :rule-classes :rewrite)

    Theorem: vl-compoundstmt->exprs-of-vl-stmt-fix-x

    (defthm vl-compoundstmt->exprs-of-vl-stmt-fix-x
      (equal (vl-compoundstmt->exprs (vl-stmt-fix x))
             (vl-compoundstmt->exprs x)))

    Theorem: vl-compoundstmt->exprs-vl-stmt-equiv-congruence-on-x

    (defthm vl-compoundstmt->exprs-vl-stmt-equiv-congruence-on-x
      (implies (vl-stmt-equiv x x-equiv)
               (equal (vl-compoundstmt->exprs x)
                      (vl-compoundstmt->exprs x-equiv)))
      :rule-classes :congruence)