• Top
    • Documentation
    • Books
    • Boolean-reasoning
      • Ipasir
      • Aignet
      • Aig
      • Satlink
        • Sat-solver-options
        • Config-p
        • Logical-story
        • Dimacs
        • Gather-benchmarks
        • Cnf
          • Litp
          • Varp
          • Env$
          • Eval-formula
          • Max-index-formula
          • Max-index-clause
            • Fast-max-index-clause
            • Formula-indices
            • Clause-indices
          • Satlink-extra-hook
          • Sat
        • Truth
        • Ubdds
        • Bdd
        • Faig
        • Bed
        • 4v
      • Projects
      • Debugging
      • Std
      • Community
      • Proof-automation
      • ACL2
      • Macro-libraries
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Max-index-clause

    Fast-max-index-clause

    Tail-recursive version of max-index-clause.

    Signature
    (fast-max-index-clause clause max) → *
    Arguments
    clause — Guard (lit-listp clause).
    max — Guard (natp max).

    Definitions and Theorems

    Function: fast-max-index-clause

    (defun fast-max-index-clause (clause max)
      (declare (xargs :guard (and (lit-listp clause) (natp max))))
      (let ((__function__ 'fast-max-index-clause))
        (declare (ignorable __function__))
        (b* (((when (atom clause)) (lnfix max))
             (id1 (lit->var (car clause)))
             (max (max (lnfix max) id1)))
          (fast-max-index-clause (cdr clause)
                                 max))))

    Theorem: fast-max-index-clause-of-lit-list-fix-clause

    (defthm fast-max-index-clause-of-lit-list-fix-clause
      (equal (fast-max-index-clause (lit-list-fix clause)
                                    max)
             (fast-max-index-clause clause max)))

    Theorem: fast-max-index-clause-lit-list-equiv-congruence-on-clause

    (defthm fast-max-index-clause-lit-list-equiv-congruence-on-clause
      (implies (lit-list-equiv clause clause-equiv)
               (equal (fast-max-index-clause clause max)
                      (fast-max-index-clause clause-equiv max)))
      :rule-classes :congruence)

    Theorem: fast-max-index-clause-of-nfix-max

    (defthm fast-max-index-clause-of-nfix-max
      (equal (fast-max-index-clause clause (nfix max))
             (fast-max-index-clause clause max)))

    Theorem: fast-max-index-clause-nat-equiv-congruence-on-max

    (defthm fast-max-index-clause-nat-equiv-congruence-on-max
      (implies (nat-equiv max max-equiv)
               (equal (fast-max-index-clause clause max)
                      (fast-max-index-clause clause max-equiv)))
      :rule-classes :congruence)