• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • 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
          • 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
            • Vl-expr-lvaluep
            • Lvaluecheck
              • Vl-plainarglist-lvaluecheck
              • Vl-plainarg-lvaluecheck
              • Vl-taskdecllist-lvaluecheck
              • Vl-gateinstlist-lvaluecheck
              • Vl-arguments-lvaluecheck
              • Vl-modinstlist-lvaluecheck
              • Vl-initiallist-lvaluecheck
              • Vl-fundecllist-lvaluecheck
              • Vl-assignlist-lvaluecheck
              • Vl-alwayslist-lvaluecheck
              • Vl-modinst-lvaluecheck
              • Vl-gateinst-lvaluecheck
              • Vl-assign-lvaluecheck
                • Vl-taskdecl-lvaluecheck
                • Vl-initial-lvaluecheck
                • Vl-fundecl-lvaluecheck
                • Vl-always-lvaluecheck
          • Server
          • Kit
          • Printer
          • Esim-vl
          • Well-formedness
        • Sv
        • Fgl
        • Vwsim
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Vl-assign-p
    • Lvaluecheck

    Vl-assign-lvaluecheck

    Check well-formedness of lvalues in a vl-assign-p.

    Signature
    (vl-assign-lvaluecheck x warnings) → new-warnings
    Arguments
    x — Guard (vl-assign-p x).
    warnings — Ordinary warnings accumulator.
        Guard (vl-warninglist-p warnings).
    Returns
    new-warnings — Type (vl-warninglist-p new-warnings).

    We check the lvalues throughout x for well-formedness in the sense of vl-expr-lvaluep, and generate non-fatal warnings for any problematic lvalues encountered.

    Definitions and Theorems

    Function: vl-assign-lvaluecheck

    (defun vl-assign-lvaluecheck (x warnings)
      (declare (xargs :guard (and (vl-assign-p x)
                                  (vl-warninglist-p warnings))))
      (declare (xargs :guard t))
      (let ((__function__ 'vl-assign-lvaluecheck))
        (declare (ignorable __function__))
        (b* ((lvalue (vl-assign->lvalue x))
             ((when (vl-expr-lvaluep lvalue)) (ok))
             (loc (vl-assign->loc x)))
          (warn :type :vl-bad-lvalue
                :msg "~l0: assignment to bad lvalue ~a1."
                :args (list loc lvalue)))))

    Theorem: vl-warninglist-p-of-vl-assign-lvaluecheck

    (defthm vl-warninglist-p-of-vl-assign-lvaluecheck
      (b* ((new-warnings (vl-assign-lvaluecheck x warnings)))
        (vl-warninglist-p new-warnings))
      :rule-classes :rewrite)

    Theorem: vl-assign-lvaluecheck-of-vl-assign-fix-x

    (defthm vl-assign-lvaluecheck-of-vl-assign-fix-x
      (equal (vl-assign-lvaluecheck (vl-assign-fix x)
                                    warnings)
             (vl-assign-lvaluecheck x warnings)))

    Theorem: vl-assign-lvaluecheck-vl-assign-equiv-congruence-on-x

    (defthm vl-assign-lvaluecheck-vl-assign-equiv-congruence-on-x
      (implies (vl-assign-equiv x x-equiv)
               (equal (vl-assign-lvaluecheck x warnings)
                      (vl-assign-lvaluecheck x-equiv warnings)))
      :rule-classes :congruence)

    Theorem: vl-assign-lvaluecheck-of-vl-warninglist-fix-warnings

    (defthm vl-assign-lvaluecheck-of-vl-warninglist-fix-warnings
      (equal (vl-assign-lvaluecheck x (vl-warninglist-fix warnings))
             (vl-assign-lvaluecheck x warnings)))

    Theorem: vl-assign-lvaluecheck-vl-warninglist-equiv-congruence-on-warnings

    (defthm
      vl-assign-lvaluecheck-vl-warninglist-equiv-congruence-on-warnings
      (implies (vl-warninglist-equiv warnings warnings-equiv)
               (equal (vl-assign-lvaluecheck x warnings)
                      (vl-assign-lvaluecheck x warnings-equiv)))
      :rule-classes :congruence)