• 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
        • Proof-checker-array
        • Soft
        • C
        • Farray
        • Rp-rewriter
        • Instant-runoff-voting
        • Imp-language
        • Sidekick
        • Leftist-trees
        • Java
        • Taspi
        • Bitcoin
        • Riscv
        • Des
        • Ethereum
        • X86isa
        • Sha-2
        • Yul
        • Zcash
        • Proof-checker-itp13
        • Regex
        • ACL2-programming-language
        • Json
        • Jfkr
        • Equational
        • Cryptography
        • Poseidon
        • Where-do-i-place-my-book
        • Axe
        • Bigmems
        • Builtins
        • Execloader
        • Aleo
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Acre-internals

    Matchstate-in-bounds

    Signature
    (matchstate-in-bounds st str) → *
    Arguments
    st — Guard (matchstate-p st).
    str — Guard (stringp str).

    Definitions and Theorems

    Function: matchstate-in-bounds

    (defun matchstate-in-bounds (st str)
      (declare (xargs :guard (and (matchstate-p st) (stringp str))))
      (let ((__function__ 'matchstate-in-bounds))
        (declare (ignorable __function__))
        (b* (((matchstate st)))
          (and (<= (matchstate->index st) (strlen str))
               (backref-alist-in-bounds st.backrefs str)))))

    Theorem: matchstate-in-bounds-of-make-matchstate

    (defthm matchstate-in-bounds-of-make-matchstate
      (equal (matchstate-in-bounds (make-matchstate :index index
                                                    :backrefs backrefs)
                                   str)
             (and (<= (nfix index) (strlen str))
                  (backref-alist-in-bounds backrefs str))))

    Theorem: matchstate-in-bounds-implies-backref-alist-in-bounds

    (defthm matchstate-in-bounds-implies-backref-alist-in-bounds
      (implies (matchstate-in-bounds st str)
               (backref-alist-in-bounds (matchstate->backrefs st)
                                        str)))

    Theorem: matchstate-in-bounds-implies-index-in-bounds

    (defthm matchstate-in-bounds-implies-index-in-bounds
      (implies (matchstate-in-bounds st str)
               (<= (matchstate->index st)
                   (len (acl2::explode str))))
      :rule-classes ((:linear :trigger-terms ((matchstate->index st)))))

    Theorem: matchstate-in-bounds-of-matchstate-fix-st

    (defthm matchstate-in-bounds-of-matchstate-fix-st
      (equal (matchstate-in-bounds (matchstate-fix st)
                                   str)
             (matchstate-in-bounds st str)))

    Theorem: matchstate-in-bounds-matchstate-equiv-congruence-on-st

    (defthm matchstate-in-bounds-matchstate-equiv-congruence-on-st
      (implies (matchstate-equiv st st-equiv)
               (equal (matchstate-in-bounds st str)
                      (matchstate-in-bounds st-equiv str)))
      :rule-classes :congruence)

    Theorem: matchstate-in-bounds-of-str-fix-str

    (defthm matchstate-in-bounds-of-str-fix-str
      (equal (matchstate-in-bounds st (acl2::str-fix str))
             (matchstate-in-bounds st str)))

    Theorem: matchstate-in-bounds-streqv-congruence-on-str

    (defthm matchstate-in-bounds-streqv-congruence-on-str
      (implies (acl2::streqv str str-equiv)
               (equal (matchstate-in-bounds st str)
                      (matchstate-in-bounds st str-equiv)))
      :rule-classes :congruence)