• 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
        • Atj
          • Atj-implementation
            • Atj-types
            • Atj-java-primitive-array-model
            • Atj-java-abstract-syntax
              • Jbinop
              • Jmethod
              • Jtype
              • Jfield
              • Jexprs
              • Jliteral
              • Junop
              • Jlocvar
              • Jcunit
              • Jaccess
              • Maybe-jexpr
              • Jparam
              • Jimport
              • Jcinitializer
              • Jresult
              • Jstatems+jblocks
              • Jexpr-get-field
              • Jliteral-long-dec-nouscores
              • Nat-to-dec-chars-theorems
              • Jmethods-to-jcbody-elements
              • Jclasses-to-jcbody-elements
              • Jblock-locvar-final
              • Jblock-locvar
              • Jliteral-int-dec-nouscores
              • Jfields-to-jcbody-elements
              • Jblock-for
              • Jblock-smethod
              • Jblock-imethod
              • Jblock-ifelse
              • Jblock-asg-name
              • Jparam-list->types
              • Jparam-list->names
              • Jexpr-lit-long-dec-nouscores
              • Jexpr-lit-int-dec-nouscores
              • Jexpr-literal-string
              • Jexpr-literal-floating
              • Jexpr-literal-character
              • Jblock-while
              • Jblock-method
              • Jblock-if
              • Jblock-expr
              • Jblock-do
              • Jblock-asg
              • Jexpr-name-list
              • Jblock-throw
              • Jblock-return
              • Jparam-list
                • Jparam-list-fix
                  • Jparam-list-equiv
                  • Jparam-listp
                • Jimport-list
                • Jexpr-literal-true
                • Jexpr-literal-null
                • Jexpr-literal-false
                • Jexpr-literal-1
                • Jexpr-literal-0
                • Jclass-list
                • Jblock-continue
                • Jtype-short
                • Jtype-long
                • Jtype-list
                • Jtype-int
                • Jtype-float
                • Jtype-double
                • Jtype-char
                • Jtype-byte
                • Jtype-boolean
                • Jmethod-list
                • Jliteral-list
                • Jfield-list
                • Jblock-list
                • Jblock-break
                • Jclasses+jcmembers
              • Atj-input-processing
              • Atj-java-pretty-printer
              • Atj-code-generation
              • Atj-java-primitives
              • Atj-java-primitive-arrays
              • Atj-type-macros
              • Atj-java-syntax-operations
              • Atj-fn
              • Atj-library-extensions
              • Atj-java-input-types
              • Atj-test-structures
              • Aij-notions
              • Atj-macro-definition
            • Atj-tutorial
          • Aij
          • Language
        • 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
        • 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
    • Jparam-list

    Jparam-list-fix

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

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

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

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

    Theorem: jparam-listp-of-jparam-list-fix

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

    Theorem: jparam-list-fix-when-jparam-listp

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

    Function: jparam-list-equiv$inline

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

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

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

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

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

    Theorem: jparam-list-fix-under-jparam-list-equiv

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Theorem: consp-of-jparam-list-fix

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

    Theorem: jparam-list-fix-under-iff

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

    Theorem: jparam-list-fix-of-cons

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

    Theorem: len-of-jparam-list-fix

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

    Theorem: jparam-list-fix-of-append

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

    Theorem: jparam-list-fix-of-repeat

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

    Theorem: list-equiv-refines-jparam-list-equiv

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

    Theorem: nth-of-jparam-list-fix

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

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

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

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

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

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

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

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

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