• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
      • Sv
        • Svex-stvs
        • Svex-decomposition-methodology
        • Sv-versus-esim
        • Svex-decomp
        • Svex-compose-dfs
        • Svex-compilation
        • Moddb
        • Svmods
          • Address
          • Wire
          • Module
          • Lhs
          • Path
            • Path-fix
            • Path-p
            • Path-scope
            • Path-equiv
            • Path-count
              • Path-append
              • Path-wire
              • Path-kind
            • Svar-add-namespace
            • Design
            • Modinst
            • Lhs-add-namespace
            • Modalist
            • Path-add-namespace
            • Modname->submodnames
            • Name
            • Constraintlist-addr-p
            • Svex-alist-addr-p
            • Svar-map-addr-p
            • Lhspairs-addr-p
            • Modname
            • Assigns-addr-p
            • Lhs-addr-p
            • Lhatom-addr-p
            • Modhier-list-measure
            • Attributes
            • Modhier-measure
            • Modhier-list-measure-aux
            • Modhier-loopfreelist-p
            • Modhier-loopfree-p
          • Svstmt
          • Sv-tutorial
          • Expressions
          • Symbolic-test-vector
          • Vl-to-svex
        • Fgl
        • Vwsim
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Path

    Path-count

    Measure for recurring over path structures.

    Signature
    (path-count x) → count
    Arguments
    x — Guard (path-p x).
    Returns
    count — Type (natp count).

    Definitions and Theorems

    Function: path-count

    (defun path-count (x)
      (declare (xargs :guard (path-p x)))
      (let ((__function__ 'path-count))
        (declare (ignorable __function__))
        (case (path-kind x)
          (:wire 1)
          (:scope (+ 3
                     (path-count (path-scope->subpath x)))))))

    Theorem: natp-of-path-count

    (defthm natp-of-path-count
      (b* ((count (path-count x)))
        (natp count))
      :rule-classes :type-prescription)

    Theorem: path-count-of-path-fix-x

    (defthm path-count-of-path-fix-x
      (equal (path-count (path-fix x))
             (path-count x)))

    Theorem: path-count-path-equiv-congruence-on-x

    (defthm path-count-path-equiv-congruence-on-x
      (implies (path-equiv x x-equiv)
               (equal (path-count x)
                      (path-count x-equiv)))
      :rule-classes :congruence)

    Theorem: path-count-of-path-scope

    (defthm path-count-of-path-scope
      (implies t
               (< (+ (path-count subpath))
                  (path-count (path-scope subpath namespace))))
      :rule-classes :linear)

    Theorem: path-count-of-path-scope->subpath

    (defthm path-count-of-path-scope->subpath
      (implies (equal (path-kind x) :scope)
               (< (path-count (path-scope->subpath x))
                  (path-count x)))
      :rule-classes :linear)