• 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-plainarg-p
    • Lvaluecheck

    Vl-plainarg-lvaluecheck

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

    Signature
    (vl-plainarg-lvaluecheck x loc instname warnings) 
      → 
    new-warnings
    Arguments
    x — Guard (vl-plainarg-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-plainarg-lvaluecheck

    (defun vl-plainarg-lvaluecheck (x loc instname warnings)
     (declare (xargs :guard (and (vl-plainarg-p x)
                                 (vl-warninglist-p warnings))))
     (declare (xargs :guard (and (vl-location-p loc)
                                 (maybe-stringp instname))))
     (let ((__function__ 'vl-plainarg-lvaluecheck))
      (declare (ignorable __function__))
      (b* ((dir (vl-plainarg->dir x))
           (expr (vl-plainarg->expr x))
           ((unless expr) (ok))
           ((unless dir) (ok))
           ((when (eq dir :vl-input)) (ok))
           ((when (vl-expr-lvaluep expr)) (ok)))
       (warn
        :type :vl-bad-lvalue
        :msg
        "~l0: expression for ~s1 port ~s2 of instance ~w3 is not a ~
                    valid lvalue: ~a4.~%"
        :args (list loc
                    (if (eq dir :vl-inout) "inout" "output")
                    (vl-plainarg->portname x)
                    instname expr)))))

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

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

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

    (defthm vl-plainarg-lvaluecheck-of-vl-plainarg-fix-x
      (equal (vl-plainarg-lvaluecheck (vl-plainarg-fix x)
                                      loc instname warnings)
             (vl-plainarg-lvaluecheck x loc instname warnings)))

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

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

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

    (defthm vl-plainarg-lvaluecheck-of-vl-warninglist-fix-warnings
     (equal
        (vl-plainarg-lvaluecheck x loc
                                 instname (vl-warninglist-fix warnings))
        (vl-plainarg-lvaluecheck x loc instname warnings)))

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

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