• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • C
      • Proof-checker-array
      • Soft
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Ethereum
      • Leftist-trees
      • Java
      • Riscv
      • Taspi
      • Bitcoin
      • Zcash
      • Des
      • X86isa
      • Sha-2
      • Yul
      • Proof-checker-itp13
      • Regex
      • ACL2-programming-language
      • Json
      • Jfkr
      • Equational
      • Cryptography
      • Axe
      • Poseidon
      • Where-do-i-place-my-book
      • Aleo
        • Aleobft
        • Aleovm
        • Leo
          • Grammar
          • Early-version
            • Json2ast
            • Testing
            • Definition
              • Flattening
              • Abstract-syntax
                • Expression
                • Syntax-abstraction
                • Statement
                • Files
                • Input-files
                • Identifiers
                • Types
                • Struct-init
                • Branch
                • Statements
                • Format-strings
                • Input-syntax-abstraction
                • Expressions
                • Output-files
                • Addresses
                • Literals
                • Characters
                • Expression-list
                • Statement-list
                • Output-syntax-abstraction
                • Struct-init-list
                • Branch-list
                • Annotations
                  • Annotation
                  • Annotation-result
                  • Annotation-list-result
                  • Annotation-list
                    • Annotation-list-fix
                      • Annotation-list-equiv
                      • Annotation-listp
                  • Abstract-syntax-trees
                  • Symbols
                  • Keywords
                  • Programs
                  • Packages
                  • Bit-sizes
                • Dynamic-semantics
                • Compilation
                • Static-semantics
                • Concrete-syntax
        • Bigmems
        • Builtins
        • Execloader
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Community
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Annotation-list

    Annotation-list-fix

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

    Signature
    (annotation-list-fix x) → fty::newx
    Arguments
    x — Guard (annotation-listp x).
    Returns
    fty::newx — Type (annotation-listp fty::newx).

    In the logic, we apply annotation-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: annotation-list-fix$inline

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

    Theorem: annotation-listp-of-annotation-list-fix

    (defthm annotation-listp-of-annotation-list-fix
      (b* ((fty::newx (annotation-list-fix$inline x)))
        (annotation-listp fty::newx))
      :rule-classes :rewrite)

    Theorem: annotation-list-fix-when-annotation-listp

    (defthm annotation-list-fix-when-annotation-listp
      (implies (annotation-listp x)
               (equal (annotation-list-fix x) x)))

    Function: annotation-list-equiv$inline

    (defun annotation-list-equiv$inline (acl2::x acl2::y)
      (declare (xargs :guard (and (annotation-listp acl2::x)
                                  (annotation-listp acl2::y))))
      (equal (annotation-list-fix acl2::x)
             (annotation-list-fix acl2::y)))

    Theorem: annotation-list-equiv-is-an-equivalence

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

    Theorem: annotation-list-equiv-implies-equal-annotation-list-fix-1

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

    Theorem: annotation-list-fix-under-annotation-list-equiv

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

    Theorem: equal-of-annotation-list-fix-1-forward-to-annotation-list-equiv

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

    Theorem: equal-of-annotation-list-fix-2-forward-to-annotation-list-equiv

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

    Theorem: annotation-list-equiv-of-annotation-list-fix-1-forward

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

    Theorem: annotation-list-equiv-of-annotation-list-fix-2-forward

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

    Theorem: car-of-annotation-list-fix-x-under-annotation-equiv

    (defthm car-of-annotation-list-fix-x-under-annotation-equiv
      (annotation-equiv (car (annotation-list-fix acl2::x))
                        (car acl2::x)))

    Theorem: car-annotation-list-equiv-congruence-on-x-under-annotation-equiv

    (defthm
       car-annotation-list-equiv-congruence-on-x-under-annotation-equiv
      (implies (annotation-list-equiv acl2::x x-equiv)
               (annotation-equiv (car acl2::x)
                                 (car x-equiv)))
      :rule-classes :congruence)

    Theorem: cdr-of-annotation-list-fix-x-under-annotation-list-equiv

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

    Theorem: cdr-annotation-list-equiv-congruence-on-x-under-annotation-list-equiv

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

    Theorem: cons-of-annotation-fix-x-under-annotation-list-equiv

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

    Theorem: cons-annotation-equiv-congruence-on-x-under-annotation-list-equiv

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

    Theorem: cons-of-annotation-list-fix-y-under-annotation-list-equiv

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

    Theorem: cons-annotation-list-equiv-congruence-on-y-under-annotation-list-equiv

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

    Theorem: consp-of-annotation-list-fix

    (defthm consp-of-annotation-list-fix
      (equal (consp (annotation-list-fix acl2::x))
             (consp acl2::x)))

    Theorem: annotation-list-fix-under-iff

    (defthm annotation-list-fix-under-iff
      (iff (annotation-list-fix acl2::x)
           (consp acl2::x)))

    Theorem: annotation-list-fix-of-cons

    (defthm annotation-list-fix-of-cons
      (equal (annotation-list-fix (cons a x))
             (cons (annotation-fix a)
                   (annotation-list-fix x))))

    Theorem: len-of-annotation-list-fix

    (defthm len-of-annotation-list-fix
      (equal (len (annotation-list-fix acl2::x))
             (len acl2::x)))

    Theorem: annotation-list-fix-of-append

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

    Theorem: annotation-list-fix-of-repeat

    (defthm annotation-list-fix-of-repeat
      (equal (annotation-list-fix (repeat acl2::n acl2::x))
             (repeat acl2::n (annotation-fix acl2::x))))

    Theorem: list-equiv-refines-annotation-list-equiv

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

    Theorem: nth-of-annotation-list-fix

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

    Theorem: annotation-list-equiv-implies-annotation-list-equiv-append-1

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

    Theorem: annotation-list-equiv-implies-annotation-list-equiv-append-2

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

    Theorem: annotation-list-equiv-implies-annotation-list-equiv-nthcdr-2

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

    Theorem: annotation-list-equiv-implies-annotation-list-equiv-take-2

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