• 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
          • Vl-lintconfig-p
          • Lucid
          • Skip-detection
          • Vl-lintresult-p
          • Lint-warning-suppression
          • Condcheck
          • Selfassigns
          • Leftright-check
          • Dupeinst-check
          • Oddexpr-check
            • Vl-modulelist-oddexpr-check
            • *vl-odd-binops-table*
            • Vl-warn-odd-binary-expression-main
            • Vl-expr-probable-selfsize
              • Vl-odd-binop-class
              • Vl-module-oddexpr-check
              • Vl-oddexpr-check
              • Vl-exprctxalist-oddexpr-check
              • Vl-design-oddexpr-check
              • Vl-warn-odd-binary-expression
              • Vl-pp-oddexpr-details
              • *fake-modelement*
            • Remove-toohard
            • Qmarksize-check
            • Portcheck
            • Duplicate-detect
            • Vl-print-certain-warnings
            • Duperhs-check
            • *vl-lint-help*
            • Lint-stmt-rewrite
            • Drop-missing-submodules
            • Check-case
            • Drop-user-submodules
            • Check-namespace
            • Vl-lint
          • Mlib
          • Server
          • Kit
          • Printer
          • Esim-vl
          • Well-formedness
        • Sv
        • Fgl
        • Vwsim
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Oddexpr-check

    Vl-expr-probable-selfsize

    Heuristically estimate an expression's size.

    Signature
    (vl-expr-probable-selfsize x ss) → size
    Arguments
    x — Guard (vl-expr-p x).
    ss — Guard (vl-scopestack-p ss).
    Returns
    size — The probable size of this expression, or nil for failure.
        Type (maybe-natp size).

    There's no reason to believe the size it returns will be the eventual size of the expression because size propagation hasn't been taken into account; in fact we may just fail and return nil for a number of reasons (for instance the wire ranges may not be resolved yet), there's no way to get the failure reason.

    On the other hand, I think it should be the case that the final size of the expression will always be at least as much as this selfsize, if it returns a non-nil value. And we can use this before resolving ranges, etc., which makes it useful for simple linting.

    Definitions and Theorems

    Function: vl-expr-probable-selfsize

    (defun vl-expr-probable-selfsize (x ss)
      (declare (xargs :guard (and (vl-expr-p x)
                                  (vl-scopestack-p ss))))
      (let ((__function__ 'vl-expr-probable-selfsize))
        (declare (ignorable __function__))
        (b* (((mv & size)
              (vl-expr-selfsize x ss *fake-modelement* nil)))
          size)))

    Theorem: maybe-natp-of-vl-expr-probable-selfsize

    (defthm maybe-natp-of-vl-expr-probable-selfsize
      (b* ((size (vl-expr-probable-selfsize x ss)))
        (maybe-natp size))
      :rule-classes :type-prescription)