• 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
        • Transforms
        • Lint
          • Vl-lintconfig-p
          • Lucid
          • Skip-detection
          • Vl-lintresult-p
          • Lint-warning-suppression
          • Condcheck
          • Selfassigns
          • Leftright-check
            • Vl-modulelist-leftright-check
            • Vl-expr-leftright-check
              • Vl-exprlist-leftright-check
            • Vl-leftright-exprlist-duplicates
            • Vl-collect-ac-args
            • Vl-module-leftright-check
            • Vl-exprctxalist-leftright-check
            • Vl-expr-indexy-via-ctx
            • Vl-design-leftright-check
            • Vl-op-ac-p
          • Dupeinst-check
          • Oddexpr-check
          • 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
  • Leftright-check

Vl-expr-leftright-check

Search for strange expressions like A [op] A.

Signature
(vl-expr-leftright-check x indexy ctx) → warnings
Arguments
x — Expression we are considering.
    Guard (vl-expr-p x).
indexy — Heuristic info. We set this to true when we've gone into an index-like expression, e.g., the 3 in foo[3], the replication amount in a multiple concatenation, or similar sorts of contexts. In such a context, we suppress warnings about A+A, A-A, and A*A, because they are occasionally useful in indexing arithmetic.
    Guard (booleanp indexy).
ctx — Context where the expression occurs.
    Guard (vl-context1-p ctx).
Returns
warnings — Type (vl-warninglist-p warnings).

We search through the expression x for sub-expressions of the form A [op] A, and generate a warning whenever we find one. The ctx is a vl-context1-p that says where x occurs, for more helpful warnings. We also use it to suppress warnings in certain cases.

Theorem: return-type-of-vl-expr-leftright-check.warnings

(defthm return-type-of-vl-expr-leftright-check.warnings
  (b* ((?warnings (vl-expr-leftright-check x indexy ctx)))
    (vl-warninglist-p warnings))
  :rule-classes :rewrite)

Theorem: return-type-of-vl-exprlist-leftright-check.warnings

(defthm return-type-of-vl-exprlist-leftright-check.warnings
  (b* ((?warnings (vl-exprlist-leftright-check x indexy ctx)))
    (vl-warninglist-p warnings))
  :rule-classes :rewrite)

Subtopics

Vl-exprlist-leftright-check