• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • ACL2
    • Macro-libraries
    • 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
            • Port-expressions
              • Vl-atomicportexprlist->internalnames
              • Vl-port-direction
              • Vl-portlist->internalnames
              • Vl-portexpr->internalnames
              • Vl-portdecls-with-dir
                • Vl-plainarglist-blankfree-p
                • Vl-namedarglist-blankfree-p
                • Vl-modinstlist-blankfree-p
                • Vl-ports-from-portdecls
                • Vl-portlist-wellformed-p
                • Vl-maybe-portexpr-p
                • Vl-portexpr-p
                • Vl-atomicportexpr-p
                • Vl-atomicportexpr->internalname
                • Vl-port->internalnames
                • Vl-atomicportexprlist-p
                • Vl-port-wellformed-p
                • Vl-plainarg-blankfree-p
                • Vl-namedarg-blankfree-p
                • Vl-modinst-blankfree-p
                • Vl-arguments-blankfree-p
              • Vl-directionlist
            • Lvalues
          • Server
          • Kit
          • Printer
          • Esim-vl
          • Well-formedness
        • Sv
        • Fgl
        • Vwsim
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Port-expressions

    Vl-portdecls-with-dir

    Filter port declarations by direction.

    Signature
    (vl-portdecls-with-dir dir x) → sub-x
    Arguments
    dir — Guard (vl-direction-p dir).
    x — Guard (vl-portdecllist-p x).
    Returns
    sub-x — Type (vl-portdecllist-p sub-x).

    Definitions and Theorems

    Function: vl-portdecls-with-dir

    (defun vl-portdecls-with-dir (dir x)
      (declare (xargs :guard (and (vl-direction-p dir)
                                  (vl-portdecllist-p x))))
      (let ((__function__ 'vl-portdecls-with-dir))
        (declare (ignorable __function__))
        (cond ((atom x) nil)
              ((eq (vl-direction-fix dir)
                   (vl-portdecl->dir (car x)))
               (cons (vl-portdecl-fix (car x))
                     (vl-portdecls-with-dir dir (cdr x))))
              (t (vl-portdecls-with-dir dir (cdr x))))))

    Theorem: vl-portdecllist-p-of-vl-portdecls-with-dir

    (defthm vl-portdecllist-p-of-vl-portdecls-with-dir
      (b* ((sub-x (vl-portdecls-with-dir dir x)))
        (vl-portdecllist-p sub-x))
      :rule-classes :rewrite)

    Theorem: vl-portdecls-with-dir-of-vl-direction-fix-dir

    (defthm vl-portdecls-with-dir-of-vl-direction-fix-dir
      (equal (vl-portdecls-with-dir (vl-direction-fix dir)
                                    x)
             (vl-portdecls-with-dir dir x)))

    Theorem: vl-portdecls-with-dir-vl-direction-equiv-congruence-on-dir

    (defthm vl-portdecls-with-dir-vl-direction-equiv-congruence-on-dir
      (implies (vl-direction-equiv dir dir-equiv)
               (equal (vl-portdecls-with-dir dir x)
                      (vl-portdecls-with-dir dir-equiv x)))
      :rule-classes :congruence)

    Theorem: vl-portdecls-with-dir-of-vl-portdecllist-fix-x

    (defthm vl-portdecls-with-dir-of-vl-portdecllist-fix-x
      (equal (vl-portdecls-with-dir dir (vl-portdecllist-fix x))
             (vl-portdecls-with-dir dir x)))

    Theorem: vl-portdecls-with-dir-vl-portdecllist-equiv-congruence-on-x

    (defthm vl-portdecls-with-dir-vl-portdecllist-equiv-congruence-on-x
      (implies (vl-portdecllist-equiv x x-equiv)
               (equal (vl-portdecls-with-dir dir x)
                      (vl-portdecls-with-dir dir x-equiv)))
      :rule-classes :congruence)