• 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
            • Matchstatelist-fix
              • Matchstatelist-equiv
              • Matchstatelist-p
            • 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
        • Riscv
        • Taspi
        • 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
      • ACL2
      • Macro-libraries
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Matchstatelist

    Matchstatelist-fix

    (matchstatelist-fix x) is a usual ACL2::fty list fixing function.

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

    In the logic, we apply matchstate-fix to each member of the x. In the execution, none of that is actually necessary and this is just an inlined identity function.

    Definitions and Theorems

    Function: matchstatelist-fix$inline

    (defun matchstatelist-fix$inline (x)
      (declare (xargs :guard (matchstatelist-p x)))
      (let ((__function__ 'matchstatelist-fix))
        (declare (ignorable __function__))
        (mbe :logic
             (if (atom x)
                 nil
               (cons (matchstate-fix (car x))
                     (matchstatelist-fix (cdr x))))
             :exec x)))

    Theorem: matchstatelist-p-of-matchstatelist-fix

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

    Theorem: matchstatelist-fix-when-matchstatelist-p

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

    Function: matchstatelist-equiv$inline

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

    Theorem: matchstatelist-equiv-is-an-equivalence

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

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

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

    Theorem: matchstatelist-fix-under-matchstatelist-equiv

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

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

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

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

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

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

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

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

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

    Theorem: car-of-matchstatelist-fix-x-under-matchstate-equiv

    (defthm car-of-matchstatelist-fix-x-under-matchstate-equiv
      (matchstate-equiv (car (matchstatelist-fix acl2::x))
                        (car acl2::x)))

    Theorem: car-matchstatelist-equiv-congruence-on-x-under-matchstate-equiv

    (defthm
        car-matchstatelist-equiv-congruence-on-x-under-matchstate-equiv
      (implies (matchstatelist-equiv acl2::x x-equiv)
               (matchstate-equiv (car acl2::x)
                                 (car x-equiv)))
      :rule-classes :congruence)

    Theorem: cdr-of-matchstatelist-fix-x-under-matchstatelist-equiv

    (defthm cdr-of-matchstatelist-fix-x-under-matchstatelist-equiv
      (matchstatelist-equiv (cdr (matchstatelist-fix acl2::x))
                            (cdr acl2::x)))

    Theorem: cdr-matchstatelist-equiv-congruence-on-x-under-matchstatelist-equiv

    (defthm
     cdr-matchstatelist-equiv-congruence-on-x-under-matchstatelist-equiv
     (implies (matchstatelist-equiv acl2::x x-equiv)
              (matchstatelist-equiv (cdr acl2::x)
                                    (cdr x-equiv)))
     :rule-classes :congruence)

    Theorem: cons-of-matchstate-fix-x-under-matchstatelist-equiv

    (defthm cons-of-matchstate-fix-x-under-matchstatelist-equiv
      (matchstatelist-equiv (cons (matchstate-fix acl2::x) acl2::y)
                            (cons acl2::x acl2::y)))

    Theorem: cons-matchstate-equiv-congruence-on-x-under-matchstatelist-equiv

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

    Theorem: cons-of-matchstatelist-fix-y-under-matchstatelist-equiv

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

    Theorem: cons-matchstatelist-equiv-congruence-on-y-under-matchstatelist-equiv

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

    Theorem: consp-of-matchstatelist-fix

    (defthm consp-of-matchstatelist-fix
      (equal (consp (matchstatelist-fix acl2::x))
             (consp acl2::x)))

    Theorem: matchstatelist-fix-under-iff

    (defthm matchstatelist-fix-under-iff
      (iff (matchstatelist-fix acl2::x)
           (consp acl2::x)))

    Theorem: matchstatelist-fix-of-cons

    (defthm matchstatelist-fix-of-cons
      (equal (matchstatelist-fix (cons a x))
             (cons (matchstate-fix a)
                   (matchstatelist-fix x))))

    Theorem: len-of-matchstatelist-fix

    (defthm len-of-matchstatelist-fix
      (equal (len (matchstatelist-fix acl2::x))
             (len acl2::x)))

    Theorem: matchstatelist-fix-of-append

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

    Theorem: matchstatelist-fix-of-repeat

    (defthm matchstatelist-fix-of-repeat
      (equal (matchstatelist-fix (repeat acl2::n acl2::x))
             (repeat acl2::n (matchstate-fix acl2::x))))

    Theorem: list-equiv-refines-matchstatelist-equiv

    (defthm list-equiv-refines-matchstatelist-equiv
      (implies (list-equiv acl2::x acl2::y)
               (matchstatelist-equiv acl2::x acl2::y))
      :rule-classes :refinement)

    Theorem: nth-of-matchstatelist-fix

    (defthm nth-of-matchstatelist-fix
      (equal (nth acl2::n (matchstatelist-fix acl2::x))
             (if (< (nfix acl2::n) (len acl2::x))
                 (matchstate-fix (nth acl2::n acl2::x))
               nil)))

    Theorem: matchstatelist-equiv-implies-matchstatelist-equiv-append-1

    (defthm matchstatelist-equiv-implies-matchstatelist-equiv-append-1
      (implies (matchstatelist-equiv acl2::x fty::x-equiv)
               (matchstatelist-equiv (append acl2::x acl2::y)
                                     (append fty::x-equiv acl2::y)))
      :rule-classes (:congruence))

    Theorem: matchstatelist-equiv-implies-matchstatelist-equiv-append-2

    (defthm matchstatelist-equiv-implies-matchstatelist-equiv-append-2
      (implies (matchstatelist-equiv acl2::y fty::y-equiv)
               (matchstatelist-equiv (append acl2::x acl2::y)
                                     (append acl2::x fty::y-equiv)))
      :rule-classes (:congruence))

    Theorem: matchstatelist-equiv-implies-matchstatelist-equiv-nthcdr-2

    (defthm matchstatelist-equiv-implies-matchstatelist-equiv-nthcdr-2
      (implies (matchstatelist-equiv acl2::l l-equiv)
               (matchstatelist-equiv (nthcdr acl2::n acl2::l)
                                     (nthcdr acl2::n l-equiv)))
      :rule-classes (:congruence))

    Theorem: matchstatelist-equiv-implies-matchstatelist-equiv-take-2

    (defthm matchstatelist-equiv-implies-matchstatelist-equiv-take-2
      (implies (matchstatelist-equiv acl2::l l-equiv)
               (matchstatelist-equiv (take acl2::n acl2::l)
                                     (take acl2::n l-equiv)))
      :rule-classes (:congruence))