• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
      • Theories
      • Rule-classes
      • Proof-builder
      • Recursion-and-induction
      • Hons-and-memoization
      • Events
      • Parallelism
      • History
      • Programming
        • Defun
        • Declare
        • System-utilities
        • Stobj
        • State
        • Mutual-recursion
        • Memoize
        • Mbe
        • Io
        • Defpkg
        • Apply$
        • Loop$
        • Programming-with-state
        • Arrays
        • Characters
        • Time$
        • Defmacro
        • Loop$-primer
        • Fast-alists
        • Defconst
        • Evaluation
        • Guard
        • Equality-variants
        • Compilation
        • Hons
        • ACL2-built-ins
        • Developers-guide
        • System-attachments
        • Advanced-features
        • Set-check-invariant-risk
        • Numbers
        • Efficiency
        • Irrelevant-formals
        • Introduction-to-programming-in-ACL2-for-those-who-know-lisp
        • Redefining-programs
        • Lists
        • Invariant-risk
        • Errors
        • Defabbrev
        • Conses
        • Alists
          • Omaps
          • Std/alists
          • Fast-alists
          • Alistp
          • Misc/records
          • Remove-assocs
          • Assoc
          • Symbol-alistp
          • Rassoc
          • Remove-assoc
          • Remove1-assoc
          • Alist-map-vals
          • Depgraph
            • Toposort
            • Transdeps
            • Invert
            • Mergesort-alist-values
            • Alist-values-are-sets-p
            • Topologically-ordered-p
            • Dependency-chain-p
            • Alist-map-keys
            • Put-assoc
            • Strip-cars
            • Pairlis$
            • Strip-cdrs
            • Sublis
            • Acons
            • Eqlable-alistp
            • Assoc-string-equal
            • Alist-to-doublets
            • Character-alistp
            • String-alistp
            • Alist-keys-subsetp
            • R-symbol-alistp
            • R-eqlable-alistp
            • Pairlis
            • Pairlis-x2
            • Pairlis-x1
            • Delete-assoc
          • Set-register-invariant-risk
          • Strings
          • Program-wrapper
          • Get-internal-time
          • Basics
          • Packages
          • Oracle-eval
          • Defmacro-untouchable
          • <<
          • Primitive
          • Revert-world
          • Unmemoize
          • Set-duplicate-keys-action
          • Symbols
          • Def-list-constructor
          • Easy-simplify-term
          • Defiteration
          • Fake-oracle-eval
          • Defopen
          • Sleep
        • Operational-semantics
        • Real
        • Start-here
        • Debugging
        • Miscellaneous
        • Output-controls
        • Macros
        • Interfacing-tools
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Depgraph

    Dependency-chain-p

    (dependency-chain-p nodes graph) determines if a list of nodes indeed follows a set of dependencies in graph.

    Signature
    (dependency-chain-p nodes graph) → depchain-p
    Arguments
    nodes — List of nodes to check.
    graph — Alist that binds nodes to their dependents.

    Say nodes is (n1 n2 ... nk). We check that n2 is a dependent of n1, n3 is a dependent of n2, and so forth. This is mainly used as a sanity check on any loops we claim to have found.

    Definitions and Theorems

    Function: dependency-chain-p

    (defun dependency-chain-p (nodes graph)
      (declare (xargs :guard t))
      (let ((__function__ 'dependency-chain-p))
        (declare (ignorable __function__))
        (b* (((when (atom nodes)) t)
             ((when (atom (cdr nodes))) t)
             (node1 (first nodes))
             (node2 (second nodes))
             (deps1 (cdr (hons-get node1 graph))))
          (and (hons-member-equal node2 deps1)
               (dependency-chain-p (cdr nodes)
                                   graph)))))