• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
      • Sv
      • Vwsim
      • Fgl
      • Vl
        • Syntax
        • Loader
        • Warnings
        • Getting-started
        • Utilities
        • Printer
        • Kit
        • Mlib
          • Scopestack
          • Hid-tools
          • Filtering-by-name
          • Vl-interface-mocktype
          • Stripping-functions
          • Genblob
          • Expr-tools
          • Hierarchy
          • Extract-vl-types
          • Range-tools
          • Finding-by-name
          • Stmt-tools
          • Modnamespace
          • Flat-warnings
          • Reordering-by-name
          • Datatype-tools
            • Vl-dimensionlist-total-size
            • Vl-maybe-usertype-resolve
              • Vl-dimensionlist-resolved-p
              • Vl-datatype-packedp
              • Vl-datatype-select-ok
              • Vl-dimension-size
              • Vl-datatype-size
              • Vl-maybe-dimension-size
              • Vl-hidexpr-name1
              • Maybe-nat-list
            • Syscalls
            • Allexprs
            • Lvalues
            • Port-tools
          • Transforms
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Testing-utilities
      • Math
    • Datatype-tools

    Vl-maybe-usertype-resolve

    Signature
    (vl-maybe-usertype-resolve x) → new-x
    Arguments
    x — Guard (vl-datatype-p x).
    Returns
    new-x — Type (vl-datatype-p new-x).

    Definitions and Theorems

    Function: vl-maybe-usertype-resolve

    (defun
     vl-maybe-usertype-resolve (x)
     (declare (xargs :guard (vl-datatype-p x)))
     (declare (xargs :guard (vl-datatype-resolved-p x)))
     (let
       ((__function__ 'vl-maybe-usertype-resolve))
       (declare (ignorable __function__))
       (b* ((x (vl-datatype-fix x))
            ((when (or (consp (vl-datatype->pdims x))
                       (consp (vl-datatype->udims x))))
             x))
           (vl-datatype-case
                x
                :vl-usertype (if x.res (vl-maybe-usertype-resolve x.res)
                                 x)
                :otherwise x))))

    Theorem: vl-datatype-p-of-vl-maybe-usertype-resolve

    (defthm vl-datatype-p-of-vl-maybe-usertype-resolve
            (b* ((new-x (vl-maybe-usertype-resolve x)))
                (vl-datatype-p new-x))
            :rule-classes :rewrite)

    Theorem: vl-datatype-count-of-vl-maybe-usertype-resolve

    (defthm vl-datatype-count-of-vl-maybe-usertype-resolve
            (b* ((?new-x (vl-maybe-usertype-resolve x)))
                (<= (vl-datatype-count new-x)
                    (vl-datatype-count x)))
            :rule-classes :linear)

    Theorem: vl-datatype-resolved-p-of-vl-maybe-usertype-resolve

    (defthm vl-datatype-resolved-p-of-vl-maybe-usertype-resolve
            (b* ((?new-x (vl-maybe-usertype-resolve x)))
                (implies (vl-datatype-resolved-p x)
                         (vl-datatype-resolved-p new-x))))

    Theorem: not-usertype-of-vl-maybe-usertype-resolve

    (defthm not-usertype-of-vl-maybe-usertype-resolve
            (b* ((?new-x (vl-maybe-usertype-resolve x)))
                (implies (and (not (consp (vl-datatype->pdims new-x)))
                              (not (consp (vl-datatype->udims new-x)))
                              (vl-datatype-resolved-p x))
                         (not (equal (vl-datatype-kind new-x)
                                     :vl-usertype))))
            :rule-classes
            ((:forward-chaining
                  :trigger-terms
                  ((vl-datatype-kind (vl-maybe-usertype-resolve x))))))

    Theorem: vl-maybe-usertype-resolve-of-vl-datatype-fix-x

    (defthm vl-maybe-usertype-resolve-of-vl-datatype-fix-x
            (equal (vl-maybe-usertype-resolve (vl-datatype-fix x))
                   (vl-maybe-usertype-resolve x)))

    Theorem: vl-maybe-usertype-resolve-vl-datatype-equiv-congruence-on-x

    (defthm vl-maybe-usertype-resolve-vl-datatype-equiv-congruence-on-x
            (implies (vl-datatype-equiv x x-equiv)
                     (equal (vl-maybe-usertype-resolve x)
                            (vl-maybe-usertype-resolve x-equiv)))
            :rule-classes :congruence)