• 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

    Matches-add-backref

    Signature
    (matches-add-backref name start-index matches) → new-matches
    Arguments
    start-index — Guard (natp start-index).
    matches — Guard (matchstatelist-p matches).
    Returns
    new-matches — Type (matchstatelist-p new-matches).

    Definitions and Theorems

    Function: matches-add-backref

    (defun matches-add-backref (name start-index matches)
     (declare (xargs :guard (and (natp start-index)
                                 (matchstatelist-p matches))))
     (declare
        (xargs :guard (matchstatelist-indices-gte start-index matches)))
     (let ((__function__ 'matches-add-backref))
       (declare (ignorable __function__))
       (if (atom matches)
           nil
         (cons (match-add-backref name start-index (car matches))
               (matches-add-backref name start-index (cdr matches))))))

    Theorem: matchstatelist-p-of-matches-add-backref

    (defthm matchstatelist-p-of-matches-add-backref
      (b* ((new-matches (matches-add-backref name start-index matches)))
        (matchstatelist-p new-matches))
      :rule-classes :rewrite)

    Theorem: matches-add-backref-preserves-matchstatelist-indices-gte

    (defthm matches-add-backref-preserves-matchstatelist-indices-gte
     (b* ((?new-matches (matches-add-backref name start-index matches)))
       (implies (matchstatelist-indices-gte n matches)
                (matchstatelist-indices-gte n new-matches))))

    Theorem: consp-of-matches-add-backref

    (defthm consp-of-matches-add-backref
     (b* ((?new-matches (matches-add-backref name start-index matches)))
       (equal (consp new-matches)
              (consp matches))))

    Theorem: matchstatelist-indices-gte-of-add-backref

    (defthm matchstatelist-indices-gte-of-add-backref
     (iff
       (matchstatelist-indices-gte n (matches-add-backref name start x))
       (matchstatelist-indices-gte n x)))

    Theorem: matchstatelist-indices-lte-of-add-backref

    (defthm matchstatelist-indices-lte-of-add-backref
     (iff
       (matchstatelist-indices-lte n (matches-add-backref name start x))
       (matchstatelist-indices-lte n x)))

    Theorem: matches-add-backref-of-nfix-start-index

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

    Theorem: matches-add-backref-nat-equiv-congruence-on-start-index

    (defthm matches-add-backref-nat-equiv-congruence-on-start-index
      (implies
           (acl2::nat-equiv start-index start-index-equiv)
           (equal (matches-add-backref name start-index matches)
                  (matches-add-backref name start-index-equiv matches)))
      :rule-classes :congruence)

    Theorem: matches-add-backref-of-matchstatelist-fix-matches

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

    Theorem: matches-add-backref-matchstatelist-equiv-congruence-on-matches

    (defthm
         matches-add-backref-matchstatelist-equiv-congruence-on-matches
      (implies
           (matchstatelist-equiv matches matches-equiv)
           (equal (matches-add-backref name start-index matches)
                  (matches-add-backref name start-index matches-equiv)))
      :rule-classes :congruence)