• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
        • Acre-internals
          • Regex
          • Match-string-at
          • Matchstatelist-measure
          • Parse-primitive
          • Matches-remove-zero-length
          • Parse-repeatop
          • Parse-repeatbase
          • Matchstatelist-in-bounds
          • Parse-range
          • Parse-charset-set
          • Parse-charset-atom
          • Match-regex-locs
          • Parse-octal-charcode
          • Parse-k-backref
          • Parse-g-backref
          • Matchstatelist-all-have-backref
          • Parse-repeatmod
          • Parse-charset-elem
          • Parse-charset-aux
          • Parse-hex-charcode
          • Parse-charset
          • Matchstatelist-indices-lte
          • Matchstatelist-indices-gte
          • Match-exact
          • Matches-add-backref
          • Matchresult
          • Preproc-legible-aux
          • Maybe-backref
          • Match-charset
          • Undup-equiv
          • Find-substr
          • Maybe-backref-extract-substr
          • Matchstatelist-min-index
            • Matchstate-in-bounds
            • Match-add-backref
            • Undup
            • Backref-alist-in-bounds
            • Backref
            • Matchstate
            • Matchresult->matched-substr
            • Matchresult->captured-substr!
            • Matchresult->captured-substr
            • Maybe-backref-in-bounds
            • Matchmode
            • Backref-extract-substr
            • Charset-range
            • Matchstate-measure
            • Backref-in-bounds
            • Rev-keys
            • Parse-regex
            • Undup-exec
            • Get-charset
            • Regex-concat2
            • Preproc-legible
            • Matchresult-in-bounds
            • Regex-disjunct2
            • Backref-alist
            • Named-captures-bindings
            • Captures-bindings
            • Matchstatelist
            • Charset-char-regex
            • Repeatmod-p
          • Parse-and-match-regex
          • Match-regex
          • Parse
          • Matchresult->matchedp
          • Match
        • Milawa
        • Smtlink
        • Abnf
        • Vwsim
        • Isar
        • Wp-gen
        • Dimacs-reader
        • Pfcs
        • Legacy-defrstobj
        • C
        • Proof-checker-array
        • Soft
        • Farray
        • Rp-rewriter
        • Instant-runoff-voting
        • Imp-language
        • Sidekick
        • Ethereum
        • Leftist-trees
        • Java
        • Riscv
        • Taspi
        • Bitcoin
        • Zcash
        • Des
        • X86isa
        • Sha-2
        • Yul
        • Proof-checker-itp13
        • Regex
        • ACL2-programming-language
        • Json
        • Jfkr
        • Equational
        • Cryptography
        • Axe
        • Poseidon
        • Where-do-i-place-my-book
        • Aleo
        • Bigmems
        • Builtins
        • Execloader
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Community
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Acre-internals

    Matchstatelist-min-index

    Signature
    (matchstatelist-min-index sts) → index
    Arguments
    sts — Guard (matchstatelist-p sts).
    Returns
    index — Type (natp index).

    Definitions and Theorems

    Function: matchstatelist-min-index

    (defun matchstatelist-min-index (sts)
      (declare (xargs :guard (matchstatelist-p sts)))
      (declare (xargs :guard (consp sts)))
      (let ((__function__ 'matchstatelist-min-index))
        (declare (ignorable __function__))
        (if (atom (cdr sts))
            (matchstate->index (car sts))
          (min (matchstate->index (car sts))
               (matchstatelist-min-index (cdr sts))))))

    Theorem: natp-of-matchstatelist-min-index

    (defthm natp-of-matchstatelist-min-index
      (b* ((index (matchstatelist-min-index sts)))
        (natp index))
      :rule-classes :type-prescription)

    Theorem: matchstatelist-min-index-of-append

    (defthm matchstatelist-min-index-of-append
      (implies (or (consp a) (consp b))
               (equal (matchstatelist-min-index (append a b))
                      (if (consp a)
                          (if (consp b)
                              (min (matchstatelist-min-index a)
                                   (matchstatelist-min-index b))
                            (matchstatelist-min-index a))
                        (matchstatelist-min-index b)))))

    Theorem: matchstatelist-min-index-of-rev

    (defthm matchstatelist-min-index-of-rev
      (equal (matchstatelist-min-index (rev x))
             (matchstatelist-min-index x)))

    Theorem: matchstatelist-min-index-of-matches-add-backref

    (defthm matchstatelist-min-index-of-matches-add-backref
      (equal (matchstatelist-min-index
                  (matches-add-backref name start-index matches))
             (matchstatelist-min-index matches)))

    Theorem: matchstatelist-indices-gte-by-matchstatelist-min-index

    (defthm matchstatelist-indices-gte-by-matchstatelist-min-index
      (implies (<= (nfix idx)
                   (matchstatelist-min-index x))
               (matchstatelist-indices-gte idx x)))

    Theorem: matchstatelist-min-index-of-matchstatelist-fix-sts

    (defthm matchstatelist-min-index-of-matchstatelist-fix-sts
      (equal (matchstatelist-min-index (matchstatelist-fix sts))
             (matchstatelist-min-index sts)))

    Theorem: matchstatelist-min-index-matchstatelist-equiv-congruence-on-sts

    (defthm
        matchstatelist-min-index-matchstatelist-equiv-congruence-on-sts
      (implies (matchstatelist-equiv sts sts-equiv)
               (equal (matchstatelist-min-index sts)
                      (matchstatelist-min-index sts-equiv)))
      :rule-classes :congruence)