• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • 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
          • Vl-lint
            • Vl-lintconfig-p
            • Condcheck
              • Vl-interfacelist-condcheck
              • Vl-modulelist-condcheck
              • Vl-expr-condcheck
                • Vl-exprlist-condcheck
              • Vl-condcheck-fix
              • Vl-module-condcheck!
              • Vl-interface-condcheck!
              • Vl-modelement-condcheck!
              • Vl-iftest-condcheck
              • Vl-maybe-delayoreventcontrol-condcheck
              • Vl-repeateventcontrol-condcheck
              • Vl-delayoreventcontrol-condcheck
              • Vl-design-condcheck!
              • Vl-vardecllist-condcheck
              • Vl-typedeflist-condcheck
              • Vl-portdecllist-condcheck
              • Vl-paramtype-condcheck
              • Vl-paramdecllist-condcheck
              • Vl-maybe-gatedelay-condcheck
              • Vl-maybe-exprdist-condcheck
              • Vl-exprdistlist-condcheck
              • Vl-blockitemlist-condcheck
              • Vl-blockitem-condcheck
              • Vl-vardecl-condcheck
              • Vl-repetition-condcheck
              • Vl-propspec-condcheck
              • Vl-portdecl-condcheck
              • Vl-importlist-condcheck
              • Vl-gatedelay-condcheck
              • Vl-eventcontrol-condcheck
              • Vl-distlist-condcheck
              • Vl-distitem-condcheck
              • Vl-delaycontrol-condcheck
              • Vl-typedef-condcheck
              • Vl-paramdecl-condcheck
              • Vl-maybe-rhs-condcheck
              • Vl-letdecl-condcheck
              • Vl-exprdist-condcheck
              • Vl-rhs-condcheck
              • Vl-import-condcheck
              • Vl-fundecl-condcheck!-aux
              • Vl-taskdecl-condcheck!-aux
              • Vl-package-condcheck!
              • Vl-function-specialization-map-condcheck!
              • Vl-portdecl-or-blockitem-list-condcheck!
              • Vl-portdecl-or-blockitem-condcheck!
              • Vl-condcheck-negate
              • Vl-class-condcheck!
              • Vl-parse-temps-condcheck!
              • Vl-modinst-condcheck!-aux
              • Vl-function-specialization-condcheck!
              • Vl-clkdecl-condcheck!
              • Vl-ansi-portdecl-condcheck!
              • Vl-vardecl-condcheck!-aux
              • Vl-modport-portlist-condcheck!
              • Vl-gateinst-condcheck!-aux
              • Vl-defaultdisablelist-condcheck!
              • Vl-defaultdisable-condcheck!
              • Vl-assign-condcheck!-aux
              • Vl-ansi-portdecllist-condcheck!
              • Vl-udp-condcheck!
              • Vl-taskdecllist-condcheck!
              • Vl-sequencelist-condcheck!
              • Vl-sequence-condcheck!
              • Vl-propportlist-condcheck!
              • Vl-propport-condcheck!
              • Vl-propertylist-condcheck!
              • Vl-property-condcheck!
              • Vl-plainarglist-condcheck!
              • Vl-paramdecl-condcheck!-aux
              • Vl-namedarglist-condcheck!
              • Vl-modport-port-condcheck!
              • Vl-maybe-parse-temps-condcheck!
              • Vl-gclkdecllist-condcheck!
              • Vl-gateinstlist-condcheck!
              • Vl-fwdtypedeflist-condcheck!
              • Vl-elabtasklist-condcheck!
              • Vl-dpiimportlist-condcheck!
              • Vl-dpiimport-condcheck!
              • Vl-dpiexportlist-condcheck!
              • Vl-covergrouplist-condcheck!
              • Vl-clkassignlist-condcheck!
              • Vl-cassertionlist-condcheck!
              • Vl-assertionlist-condcheck!
              • Vl-typedef-condcheck!-aux
              • Vl-regularport-condcheck!
              • Vl-programlist-condcheck!
              • Vl-plainarg-condcheck!
              • Vl-packagelist-condcheck!
              • Vl-namedarg-condcheck!
              • Vl-modportlist-condcheck!
              • Vl-modinstlist-condcheck!
              • Vl-maybe-clkskew-condcheck!
              • Vl-interfaceport-condcheck!
              • Vl-interface-condcheck
              • Vl-initiallist-condcheck!
              • Vl-initial-condcheck!-aux
              • Vl-genvarlist-condcheck!
              • Vl-gclkdecl-condcheck!
              • Vl-fundecllist-condcheck!
              • Vl-finallist-condcheck!
              • Vl-final-condcheck!-aux
              • Vl-configlist-condcheck!
              • Vl-clkdecllist-condcheck!
              • Vl-clkassign-condcheck!
              • Vl-classlist-condcheck!
              • Vl-bind-condcheck!
              • Vl-assignlist-condcheck!
              • Vl-arguments-condcheck!
              • Vl-alwayslist-condcheck!
              • Vl-always-condcheck!-aux
              • Vl-aliaslist-condcheck!
              • Vl-alias-condcheck!-aux
              • Vl-udplist-condcheck!
              • Vl-taskdecl-condcheck!
              • Vl-program-condcheck!
              • Vl-portlist-condcheck!
              • Vl-port-condcheck!
              • Vl-paramdecl-condcheck!
              • Vl-module-condcheck
              • Vl-modport-condcheck!
              • Vl-gateinst-condcheck!
              • Vl-fwdtypedef-condcheck!
              • Vl-elabtask-condcheck!
              • Vl-dpiexport-condcheck!
              • Vl-design-condcheck
              • Vl-covergroup-condcheck!
              • Vl-clkskew-condcheck!
              • Vl-bindlist-condcheck!
              • Vl-vardecl-condcheck!
              • Vl-typedef-condcheck!
              • Vl-modinst-condcheck!
              • Vl-initial-condcheck!
              • Vl-genvar-condcheck!
              • Vl-fundecl-condcheck!
              • Vl-final-condcheck!
              • Vl-config-condcheck!
              • Vl-assign-condcheck!
              • Vl-always-condcheck!
              • Vl-alias-condcheck!
            • Lint-warning-suppression
            • Lucid
            • Lvaluecheck
            • Vl-interfacelist-alwaysstyle
            • Truncation-warnings
            • Vl-modulelist-alwaysstyle
            • Skip-detection
            • Vl-lint-report
            • Vl-lintresult
            • Vl::vl-design-sv-use-set
            • Oddexpr-check
            • Leftright-check
            • Duplicate-detect
            • Selfassigns
            • *vl-lint-help*
            • Arith-compare-check
            • Dupeinst-check
            • Qmarksize-check
            • Lint-whole-file-suppression
            • Run-vl-lint-main
            • Logicassign
            • Run-vl-lint
            • Vl-print-certain-warnings
            • Duperhs-check
            • Vl-lint-top
            • Sd-filter-problems
            • Vl-modulelist-add-svbad-warnings
            • Vl-module-add-svbad-warnings
            • Check-case
            • Vl-lint-extra-actions
            • Drop-lint-stubs
            • Vl-lint-print-warnings
            • Drop-user-submodules
            • Check-namespace
            • Vl-lintconfig-loadconfig
            • Vl-lint-design->svex-modalist-wrapper
            • Vl-delete-sd-problems-for-modnames-aux
            • Vl-collect-new-names-from-orignames
            • Vl-lint-print-all-warnings
            • Vl-design-remove-unnecessary-modules
            • Vl-delete-sd-problems-for-modnames
            • Vl-always-check-style
            • Vl-vardecllist-svbad-warnings
            • Vl-vardecl-svbad-warnings
            • Vl-reportcard-remove-suppressed
            • Vl-reportcard-keep-suppressed
            • Vl-alwayslist-check-style
            • Vl-remove-nameless-descriptions
            • Vl-lint-apply-quiet
            • Vl-warninglist-remove-suppressed
            • Vl-warninglist-keep-suppressed
            • Vl-print-eliminated-descs
            • Vl-module-alwaysstyle
            • Vl-jp-reportcard-aux
            • Vl-interface-alwaysstyle
            • Vl-design-alwaysstyle
            • Vl-jp-description-locations
            • Vl-jp-reportcard
            • Vl-pp-stringlist-lines
            • Vl-jp-design-locations
            • Vl-datatype-svbad-p
            • Unpacked-range-check
            • Sd-problem-major-p
            • Vl-alwaysstyle
          • Vl-server
          • Vl-gather
          • Vl-zip
          • Vl-main
          • Split-plusargs
          • Vl-shell
          • Vl-json
        • Mlib
        • Transforms
      • X86isa
      • Svl
      • Rtl
    • Software-verification
    • Math
    • Testing-utilities
  • Condcheck

Vl-expr-condcheck

Look for strange conditions throughout an expression.

Signature
(vl-expr-condcheck x tests-above) → warnings
Arguments
x — Guard (vl-expr-p x).
tests-above — Guard (vl-exprlist-p tests-above).
Returns
warnings — Type (vl-warningtree-p warnings).

We recursively look throughout x for problematic tests.

The tests-above are all the tests we have seen as we have descended through expressions of the form

test ? then : else

Except:

  • all of the tests-above have been fixed with vl-condcheck-fix, and
  • when we descend into the else branch, we add ~test to tests-above; more precisely, we use vl-condcheck-negate to form this term.

The basic idea is that tests-above acts as a list of things we can assume must be true as we are seeing X.

ctx is a vl-context-p that should explain where this expression occurs, and is used in any warning messages we produce.

Theorem: return-type-of-vl-expr-condcheck.warnings

(defthm return-type-of-vl-expr-condcheck.warnings
  (b* ((?warnings (vl-expr-condcheck x tests-above)))
    (vl-warningtree-p warnings))
  :rule-classes :rewrite)

Theorem: return-type-of-vl-exprlist-condcheck.warnings

(defthm return-type-of-vl-exprlist-condcheck.warnings
  (b* ((?warnings (vl-exprlist-condcheck x tests-above)))
    (vl-warningtree-p warnings))
  :rule-classes :rewrite)

Theorem: vl-expr-condcheck-of-vl-expr-fix-x

(defthm vl-expr-condcheck-of-vl-expr-fix-x
  (equal (vl-expr-condcheck (vl-expr-fix x)
                            tests-above)
         (vl-expr-condcheck x tests-above)))

Theorem: vl-expr-condcheck-of-vl-exprlist-fix-tests-above

(defthm vl-expr-condcheck-of-vl-exprlist-fix-tests-above
  (equal (vl-expr-condcheck x (vl-exprlist-fix tests-above))
         (vl-expr-condcheck x tests-above)))

Theorem: vl-exprlist-condcheck-of-vl-exprlist-fix-x

(defthm vl-exprlist-condcheck-of-vl-exprlist-fix-x
  (equal (vl-exprlist-condcheck (vl-exprlist-fix x)
                                tests-above)
         (vl-exprlist-condcheck x tests-above)))

Theorem: vl-exprlist-condcheck-of-vl-exprlist-fix-tests-above

(defthm vl-exprlist-condcheck-of-vl-exprlist-fix-tests-above
  (equal (vl-exprlist-condcheck x (vl-exprlist-fix tests-above))
         (vl-exprlist-condcheck x tests-above)))

Theorem: vl-expr-condcheck-vl-expr-equiv-congruence-on-x

(defthm vl-expr-condcheck-vl-expr-equiv-congruence-on-x
  (implies (vl-expr-equiv x x-equiv)
           (equal (vl-expr-condcheck x tests-above)
                  (vl-expr-condcheck x-equiv tests-above)))
  :rule-classes :congruence)

Theorem: vl-expr-condcheck-vl-exprlist-equiv-congruence-on-tests-above

(defthm
      vl-expr-condcheck-vl-exprlist-equiv-congruence-on-tests-above
  (implies (vl-exprlist-equiv tests-above tests-above-equiv)
           (equal (vl-expr-condcheck x tests-above)
                  (vl-expr-condcheck x tests-above-equiv)))
  :rule-classes :congruence)

Theorem: vl-exprlist-condcheck-vl-exprlist-equiv-congruence-on-x

(defthm vl-exprlist-condcheck-vl-exprlist-equiv-congruence-on-x
  (implies (vl-exprlist-equiv x x-equiv)
           (equal (vl-exprlist-condcheck x tests-above)
                  (vl-exprlist-condcheck x-equiv tests-above)))
  :rule-classes :congruence)

Theorem: vl-exprlist-condcheck-vl-exprlist-equiv-congruence-on-tests-above

(defthm
  vl-exprlist-condcheck-vl-exprlist-equiv-congruence-on-tests-above
  (implies (vl-exprlist-equiv tests-above tests-above-equiv)
           (equal (vl-exprlist-condcheck x tests-above)
                  (vl-exprlist-condcheck x tests-above-equiv)))
  :rule-classes :congruence)

Subtopics

Vl-exprlist-condcheck