• 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
            • Backref-alist-p
            • Backref-alist-fix
              • Backref-alist-equiv
            • 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
        • Pfcs
        • Wp-gen
        • Dimacs-reader
        • Legacy-defrstobj
        • Proof-checker-array
        • Soft
        • C
        • Farray
        • Rp-rewriter
        • Instant-runoff-voting
        • Imp-language
        • Sidekick
        • Leftist-trees
        • Java
        • Taspi
        • Riscv
        • Bitcoin
        • 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
        • Aleo
        • Bigmems
        • Builtins
        • Execloader
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Community
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Backref-alist

    Backref-alist-fix

    (backref-alist-fix x) is an ACL2::fty alist fixing function that follows the drop-keys strategy.

    Signature
    (backref-alist-fix x) → fty::newx
    Arguments
    x — Guard (backref-alist-p x).
    Returns
    fty::newx — Type (backref-alist-p fty::newx).

    Note that in the execution this is just an inline identity function.

    Definitions and Theorems

    Function: backref-alist-fix$inline

    (defun backref-alist-fix$inline (x)
      (declare (xargs :guard (backref-alist-p x)))
      (let ((__function__ 'backref-alist-fix))
        (declare (ignorable __function__))
        (mbe :logic
             (if (atom x)
                 nil
               (if (consp (car x))
                   (cons (cons (caar x) (backref-fix (cdar x)))
                         (backref-alist-fix (cdr x)))
                 (backref-alist-fix (cdr x))))
             :exec x)))

    Theorem: backref-alist-p-of-backref-alist-fix

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

    Theorem: backref-alist-fix-when-backref-alist-p

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

    Function: backref-alist-equiv$inline

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

    Theorem: backref-alist-equiv-is-an-equivalence

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

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

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

    Theorem: backref-alist-fix-under-backref-alist-equiv

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

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

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

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

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

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

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

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

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

    Theorem: cons-of-backref-fix-v-under-backref-alist-equiv

    (defthm cons-of-backref-fix-v-under-backref-alist-equiv
      (backref-alist-equiv (cons (cons acl2::k (backref-fix acl2::v))
                                 acl2::x)
                           (cons (cons acl2::k acl2::v) acl2::x)))

    Theorem: cons-backref-equiv-congruence-on-v-under-backref-alist-equiv

    (defthm cons-backref-equiv-congruence-on-v-under-backref-alist-equiv
      (implies
           (backref-equiv acl2::v v-equiv)
           (backref-alist-equiv (cons (cons acl2::k acl2::v) acl2::x)
                                (cons (cons acl2::k v-equiv) acl2::x)))
      :rule-classes :congruence)

    Theorem: cons-of-backref-alist-fix-y-under-backref-alist-equiv

    (defthm cons-of-backref-alist-fix-y-under-backref-alist-equiv
      (backref-alist-equiv (cons acl2::x (backref-alist-fix acl2::y))
                           (cons acl2::x acl2::y)))

    Theorem: cons-backref-alist-equiv-congruence-on-y-under-backref-alist-equiv

    (defthm
     cons-backref-alist-equiv-congruence-on-y-under-backref-alist-equiv
     (implies (backref-alist-equiv acl2::y y-equiv)
              (backref-alist-equiv (cons acl2::x acl2::y)
                                   (cons acl2::x y-equiv)))
     :rule-classes :congruence)

    Theorem: backref-alist-fix-of-acons

    (defthm backref-alist-fix-of-acons
      (equal (backref-alist-fix (cons (cons acl2::a acl2::b) x))
             (cons (cons acl2::a (backref-fix acl2::b))
                   (backref-alist-fix x))))

    Theorem: hons-assoc-equal-of-backref-alist-fix

    (defthm hons-assoc-equal-of-backref-alist-fix
      (equal (hons-assoc-equal acl2::k (backref-alist-fix acl2::x))
             (let ((fty::pair (hons-assoc-equal acl2::k acl2::x)))
               (and fty::pair
                    (cons acl2::k
                          (backref-fix (cdr fty::pair)))))))

    Theorem: backref-alist-fix-of-append

    (defthm backref-alist-fix-of-append
      (equal (backref-alist-fix (append std::a std::b))
             (append (backref-alist-fix std::a)
                     (backref-alist-fix std::b))))

    Theorem: consp-car-of-backref-alist-fix

    (defthm consp-car-of-backref-alist-fix
      (equal (consp (car (backref-alist-fix x)))
             (consp (backref-alist-fix x))))