• 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
            • Matchresult-fix
              • Matchresult-equiv
              • Matchresult->matchedp
              • Make-matchresult
              • Matchresult-p
              • Matchresult->backrefs
              • Change-matchresult
              • Matchresult->str
              • Matchresult->loc
              • Matchresult->len
            • 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
    • Matchresult

    Matchresult-fix

    Fixing function for matchresult structures.

    Signature
    (matchresult-fix x) → new-x
    Arguments
    x — Guard (matchresult-p x).
    Returns
    new-x — Type (matchresult-p new-x).

    Definitions and Theorems

    Function: matchresult-fix$inline

    (defun matchresult-fix$inline (x)
      (declare (xargs :guard (matchresult-p x)))
      (let ((__function__ 'matchresult-fix))
        (declare (ignorable __function__))
        (mbe :logic
             (b* ((loc (maybe-natp-fix (std::da-nth 0 x)))
                  (len (nfix (std::da-nth 1 x)))
                  (str (acl2::str-fix (std::da-nth 2 x)))
                  (backrefs (backref-alist-fix (std::da-nth 3 x))))
               (list loc len str backrefs))
             :exec x)))

    Theorem: matchresult-p-of-matchresult-fix

    (defthm matchresult-p-of-matchresult-fix
      (b* ((new-x (matchresult-fix$inline x)))
        (matchresult-p new-x))
      :rule-classes :rewrite)

    Theorem: matchresult-fix-when-matchresult-p

    (defthm matchresult-fix-when-matchresult-p
      (implies (matchresult-p x)
               (equal (matchresult-fix x) x)))

    Function: matchresult-equiv$inline

    (defun matchresult-equiv$inline (acl2::x acl2::y)
      (declare (xargs :guard (and (matchresult-p acl2::x)
                                  (matchresult-p acl2::y))))
      (equal (matchresult-fix acl2::x)
             (matchresult-fix acl2::y)))

    Theorem: matchresult-equiv-is-an-equivalence

    (defthm matchresult-equiv-is-an-equivalence
      (and (booleanp (matchresult-equiv x y))
           (matchresult-equiv x x)
           (implies (matchresult-equiv x y)
                    (matchresult-equiv y x))
           (implies (and (matchresult-equiv x y)
                         (matchresult-equiv y z))
                    (matchresult-equiv x z)))
      :rule-classes (:equivalence))

    Theorem: matchresult-equiv-implies-equal-matchresult-fix-1

    (defthm matchresult-equiv-implies-equal-matchresult-fix-1
      (implies (matchresult-equiv acl2::x x-equiv)
               (equal (matchresult-fix acl2::x)
                      (matchresult-fix x-equiv)))
      :rule-classes (:congruence))

    Theorem: matchresult-fix-under-matchresult-equiv

    (defthm matchresult-fix-under-matchresult-equiv
      (matchresult-equiv (matchresult-fix acl2::x)
                         acl2::x)
      :rule-classes (:rewrite :rewrite-quoted-constant))

    Theorem: equal-of-matchresult-fix-1-forward-to-matchresult-equiv

    (defthm equal-of-matchresult-fix-1-forward-to-matchresult-equiv
      (implies (equal (matchresult-fix acl2::x)
                      acl2::y)
               (matchresult-equiv acl2::x acl2::y))
      :rule-classes :forward-chaining)

    Theorem: equal-of-matchresult-fix-2-forward-to-matchresult-equiv

    (defthm equal-of-matchresult-fix-2-forward-to-matchresult-equiv
      (implies (equal acl2::x (matchresult-fix acl2::y))
               (matchresult-equiv acl2::x acl2::y))
      :rule-classes :forward-chaining)

    Theorem: matchresult-equiv-of-matchresult-fix-1-forward

    (defthm matchresult-equiv-of-matchresult-fix-1-forward
      (implies (matchresult-equiv (matchresult-fix acl2::x)
                                  acl2::y)
               (matchresult-equiv acl2::x acl2::y))
      :rule-classes :forward-chaining)

    Theorem: matchresult-equiv-of-matchresult-fix-2-forward

    (defthm matchresult-equiv-of-matchresult-fix-2-forward
      (implies (matchresult-equiv acl2::x (matchresult-fix acl2::y))
               (matchresult-equiv acl2::x acl2::y))
      :rule-classes :forward-chaining)