• 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
            • Backref-fix
              • Backref-equiv
              • Make-backref
              • Change-backref
              • Backref->loc
              • Backref->len
              • Backref-p
            • 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
    • Backref

    Backref-fix

    Fixing function for backref structures.

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

    Definitions and Theorems

    Function: backref-fix$inline

    (defun backref-fix$inline (x)
      (declare (xargs :guard (backref-p x)))
      (let ((__function__ 'backref-fix))
        (declare (ignorable __function__))
        (mbe :logic
             (b* ((loc (nfix (std::prod-car x)))
                  (len (nfix (std::prod-cdr x))))
               (std::prod-hons loc len))
             :exec x)))

    Theorem: backref-p-of-backref-fix

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

    Theorem: backref-fix-when-backref-p

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

    Function: backref-equiv$inline

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

    Theorem: backref-equiv-is-an-equivalence

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

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

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

    Theorem: backref-fix-under-backref-equiv

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

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

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

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

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

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

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

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

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