• 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
        • Mlib
          • Scopestack
          • Hid-tools
          • Filtering-by-name
          • Vl-interface-mocktype
          • Stripping-functions
          • Genblob
          • Expr-tools
          • Extract-vl-types
          • Hierarchy
          • Range-tools
          • Finding-by-name
            • Fast-finding-by-name
            • Vl-find-interfaceport
            • Vl-find-portdecl
            • Vl-find-taskdecl
            • Vl-find-paramdecl
            • Vl-find-interface
              • Vl-find-gateinst
              • Vl-find-dpiimport
              • Vl-find-vardecl
              • Vl-find-typedef
              • Vl-find-program
              • Vl-find-package
              • Vl-find-module
              • Vl-find-modport
              • Vl-find-modinst
              • Vl-find-genelement
              • Vl-find-fundecl
              • Vl-find-genvar
              • Vl-find-config
              • Vl-find-class
              • Vl-find-udp
              • Vl-modalist
              • Vl-make-portdecl-alist
              • Vl-fast-find-module
              • Vl-fast-find-portdecl
            • Stmt-tools
            • Modnamespace
            • Flat-warnings
            • Reordering-by-name
            • Datatype-tools
            • Syscalls
            • Allexprs
            • Lvalues
            • Port-tools
          • Transforms
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Finding-by-name
    • Vl-interfacelist-p

    Vl-find-interface

    Naive, O(n) lookup of a vl-interface in a list by its name.

    Signature
    (vl-find-interface name x) → interface?
    Arguments
    name — Guard (stringp name).
    x — Guard (vl-interfacelist-p x).
    Returns
    interface? — Type (iff (vl-interface-p interface?) interface?).

    Definitions and Theorems

    Function: vl-find-interface

    (defun vl-find-interface (name x)
      (declare (xargs :guard (and (stringp name)
                                  (vl-interfacelist-p x))))
      (let ((__function__ 'vl-find-interface))
        (declare (ignorable __function__))
        (cond ((atom x) nil)
              ((equal (string-fix name)
                      (vl-interface->name (car x)))
               (vl-interface-fix (car x)))
              (t (vl-find-interface name (cdr x))))))

    Theorem: return-type-of-vl-find-interface

    (defthm return-type-of-vl-find-interface
      (b* ((interface? (vl-find-interface name x)))
        (iff (vl-interface-p interface?)
             interface?))
      :rule-classes :rewrite)

    Theorem: vl-find-interface-under-iff

    (defthm vl-find-interface-under-iff
      (iff (vl-find-interface name x)
           (member-equal (string-fix name)
                         (vl-interfacelist->names x))))

    Theorem: vl-interface->name-of-vl-find-interface

    (defthm vl-interface->name-of-vl-find-interface
      (implies (vl-find-interface name x)
               (equal (vl-interface->name (vl-find-interface name x))
                      (string-fix name))))

    Theorem: tag-of-vl-find-interface

    (defthm tag-of-vl-find-interface
      (equal (tag (vl-find-interface name x))
             (if (vl-find-interface name x)
                 :vl-interface
               nil)))

    Theorem: member-equal-of-vl-find-interface

    (defthm member-equal-of-vl-find-interface
      (implies (force (vl-interfacelist-p x))
               (iff (member-equal (vl-find-interface name x)
                                  x)
                    (vl-find-interface name x))))

    Theorem: consp-of-vl-find-interface-when-member-equal

    (defthm consp-of-vl-find-interface-when-member-equal
      (implies (and (member-equal name (vl-interfacelist->names x))
                    (force (stringp name)))
               (consp (vl-find-interface name x))))

    Theorem: vl-find-interface-of-str-fix-name

    (defthm vl-find-interface-of-str-fix-name
      (equal (vl-find-interface (str-fix name) x)
             (vl-find-interface name x)))

    Theorem: vl-find-interface-streqv-congruence-on-name

    (defthm vl-find-interface-streqv-congruence-on-name
      (implies (streqv name name-equiv)
               (equal (vl-find-interface name x)
                      (vl-find-interface name-equiv x)))
      :rule-classes :congruence)

    Theorem: vl-find-interface-of-vl-interfacelist-fix-x

    (defthm vl-find-interface-of-vl-interfacelist-fix-x
      (equal (vl-find-interface name (vl-interfacelist-fix x))
             (vl-find-interface name x)))

    Theorem: vl-find-interface-vl-interfacelist-equiv-congruence-on-x

    (defthm vl-find-interface-vl-interfacelist-equiv-congruence-on-x
      (implies (vl-interfacelist-equiv x x-equiv)
               (equal (vl-find-interface name x)
                      (vl-find-interface name x-equiv)))
      :rule-classes :congruence)