• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • 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
            • Vl-interfaceportlist->ifnames
            • Vl-scope-find-item
            • Vl-blockscope
            • Vl-importlist-find-explicit-item
            • Vl-scopestack-find-item/context
            • Vl-importlist-find-implicit-item
            • Vl-import-stars-find-item
            • Vl-importlist->explicit-item-alist
            • Vl-scopestack-find-definition/ss
            • Vl-scopeitem
              • Vl-scopeitem-p
              • Vl-scopeitem-fix
              • Vl-maybe-scopeitem
              • Vl-scopeitem-equiv
              • Vl-scopeitem-alist-count
                • Vl-scopeitem-alist
                • Vl-scopeitemlist
              • Vl-scopestack-find-package/ss
              • Vl-scopeinfo-find-item
              • Vl-scopestack-find-item/ss
              • Vl-scopestack
              • Vl-scopeinfo
              • Scopestack-constants
              • Vl-scopestack-push
              • Vl-scope->scopeinfo
              • Vl-scope-find-item-fast
              • Vl-module-scope-find-item
              • Vl-importresult
              • Vl-genblob-scope-find-item
              • Vl-design-scope-find-definition
              • Vl-scopestack-find-item
              • Vl-scopestack-find-definition
              • Vl-scope-find-portdecl
              • Vl-scope-find-definition
              • Vl-package-scope-find-item
              • Vl-interface-scope-find-portdecl
              • Vl-interface-scope-find-item
              • Vl-genblob-scope-find-portdecl
              • Vl-design-scope-find-item
              • Vl-blockscope-scope-find-item
              • Vl-scopestack-find-package
              • Vl-scope-find-package
              • Vl-module-scope-find-portdecl
              • Vl-design-scope-find-package
              • Vl-scope-find-portdecl-fast
              • Vl-package-scope-item-alist-top
              • Vl-scopedef
              • Vl-scope-portdecl-alist
              • Vl-scope-package-alist
              • Vl-scope-find-definition-fast
              • Vl-scope-definition-alist
              • Vl-scope-find-package-fast
              • Vl-scopestack->path-aux
              • Vl-scopestack->path
              • Vl-scopestack->design
              • Vl-scopestack-init
              • Vl-scopeitem->name
              • Vl-importlist->star-packages
              • Vl-scopestack-pop
              • Vl-scopestack-nesting-level
              • Vl-scope
              • Vl-design-scope-package-alist-top
              • Vl-scopestack-toplevel-p
              • Vl-scope->name
              • Vl-scopestacks-free
              • Vl-importresult-alist
            • 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
          • Server
          • Kit
          • Printer
          • Esim-vl
          • Well-formedness
        • Sv
        • Fgl
        • Vwsim
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Vl-scopeitem

    Vl-scopeitem-alist-count

    Signature
    (vl-scopeitem-alist-count x) → count
    Arguments
    x — Guard (vl-scopeitem-alist-p x).
    Returns
    count — Type (natp count).

    Definitions and Theorems

    Function: vl-scopeitem-alist-count

    (defun vl-scopeitem-alist-count (x)
      (declare (xargs :guard (vl-scopeitem-alist-p x)))
      (let ((__function__ 'vl-scopeitem-alist-count))
        (declare (ignorable __function__))
        (let ((x (mbe :logic (vl-scopeitem-alist-fix x)
                      :exec x)))
          (if (atom x)
              1
            (+ 1
               (vl-scopeitem-alist-count (cdr x)))))))

    Theorem: natp-of-vl-scopeitem-alist-count

    (defthm natp-of-vl-scopeitem-alist-count
      (b* ((count (vl-scopeitem-alist-count x)))
        (natp count))
      :rule-classes :type-prescription)

    Theorem: vl-scopeitem-alist-count-of-vl-scopeitem-alist-fix-x

    (defthm vl-scopeitem-alist-count-of-vl-scopeitem-alist-fix-x
      (equal (vl-scopeitem-alist-count (vl-scopeitem-alist-fix x))
             (vl-scopeitem-alist-count x)))

    Theorem: vl-scopeitem-alist-count-vl-scopeitem-alist-equiv-congruence-on-x

    (defthm
      vl-scopeitem-alist-count-vl-scopeitem-alist-equiv-congruence-on-x
      (implies (vl-scopeitem-alist-equiv x x-equiv)
               (equal (vl-scopeitem-alist-count x)
                      (vl-scopeitem-alist-count x-equiv)))
      :rule-classes :congruence)

    Theorem: vl-scopeitem-alist-count-of-cons

    (defthm vl-scopeitem-alist-count-of-cons
      (>= (vl-scopeitem-alist-count (cons acl2::a acl2::b))
          (vl-scopeitem-alist-count acl2::b))
      :rule-classes :linear)

    Theorem: vl-scopeitem-alist-count-of-cdr

    (defthm vl-scopeitem-alist-count-of-cdr
      (<= (vl-scopeitem-alist-count (cdr x))
          (vl-scopeitem-alist-count x))
      :rule-classes :linear)

    Theorem: vl-scopeitem-alist-count-of-cdr-strong

    (defthm vl-scopeitem-alist-count-of-cdr-strong
      (implies (and (vl-scopeitem-alist-p x) (consp x))
               (< (vl-scopeitem-alist-count (cdr x))
                  (vl-scopeitem-alist-count x)))
      :rule-classes :linear)