• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
      • Sv
      • Fgl
      • Vwsim
      • Vl
        • Syntax
        • Loader
        • Warnings
        • Getting-started
        • Utilities
        • Printer
        • Kit
        • Mlib
          • Scopestack
          • Hid-tools
          • Filtering-by-name
          • Vl-interface-mocktype
          • Stripping-functions
          • Genblob
          • Expr-tools
          • Extract-vl-types
          • Hierarchy
          • Range-tools
          • Finding-by-name
          • Stmt-tools
            • Vl-rebuild-caselist
            • Vl-stmt-atomicstmts
            • Vl-compoundstmt->stmts
            • Vl-compoundstmt->exprs
              • Vl-compoundstmt->vardecls
              • Change-vl-compoundstmt
              • Vl-compoundstmt->paramdecls
              • Vl-compoundstmt->ctrl
              • Vl-atomicstmtlist-p
              • Vl-stmt->atts
              • Vl-atomicstmt-p
              • Vl-timingstmt-p
              • Vl-repeatstmt-p
              • Vl-foreverstmt-p
              • Vl-assignstmt-p
              • Vl-whilestmt-p
              • Vl-waitstmt-p
              • Vl-nullstmt-p
              • Vl-ifstmt-p
              • Vl-forstmt-p
              • Vl-dostmt-p
              • Vl-casestmt-p
              • Vl-callstmt-p
              • Vl-exprlistlist
            • Modnamespace
            • Flat-warnings
            • Reordering-by-name
            • Datatype-tools
            • Syscalls
            • Allexprs
            • Lvalues
            • Port-tools
          • Transforms
        • 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-dostmt (list x.condition)
                      :vl-forstmt (list x.test)
                      :vl-repeatstmt (list x.condition)
                      :vl-blockstmt
                      nil :vl-timingstmt nil :vl-assertstmt
                      (b* (((vl-assertion x.assertion)))
                        (list x.assertion.condition))
                      :vl-cassertstmt 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)