• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Apt
        • Error-checking
        • Fty-extensions
        • Isar
        • Kestrel-utilities
        • Set
        • C
          • Syntax-for-tools
          • Atc
          • Transformation-tools
            • Simpadd0
            • Proof-generation
              • Xeq-fundef
              • Xeq-expr-cond
              • Xeq-expr-binary
              • Xeq-block-item-list-cons
              • Xeq-stmt-ifelse
              • Xeq-expr-const
              • Gen-param-thms
              • Gen-from-params
              • Xeq-decl-decl
              • Gout
              • Gen-block-item-list-thm
              • Xeq-stmt-while
              • Xeq-stmt-dowhile
              • Gin
                • Ginp
                • Gin-fix
                  • Make-gin
                  • Gin-equiv
                  • Change-gin
                  • Gin->vartys
                  • Gin->events
                  • Gin->const-new
                  • Gin->thm-index
                  • Gin->ienv
                • Xeq-expr-ident
                • Gen-block-item-thm
                • Xeq-stmt-if
                • Xeq-expr-cast
                • Gen-initer-single-thm
                • Gen-init-scope-thm
                • Gen-expr-thm
                • Xeq-expr-unary
                • Gen-decl-thm
                • Gen-stmt-thm
                • Xeq-stmt-return
                • Xeq-stmt-expr
                • Xeq-block-item-decl
                • Xeq-block-item-stmt
                • Xeq-stmt-compound
                • Xeq-initer-single
                • Gen-thm-name
                • Gin-update
                • Gen-var-assertions
                • Tyspecseq-to-type
                • Xeq-block-item-list-empty
                • Gout-no-thm
                • Irr-gout
              • Split-gso
              • Wrap-fn
              • Constant-propagation
              • Specialize
              • Split-fn
              • Split-fn-when
              • Split-all-gso
              • Copy-fn
              • Variables-in-computation-states
              • Rename
              • Utilities
              • Proof-generation-theorems
              • Input-processing
            • Language
            • Representation
            • Insertion-sort
            • Pack
          • Soft
          • Bv
          • Imp-language
          • Ethereum
          • Event-macros
          • Java
          • Riscv
          • Bitcoin
          • Zcash
          • Yul
          • ACL2-programming-language
          • Prime-fields
          • Json
          • Syntheto
          • File-io-light
          • Cryptography
          • Number-theory
          • Axe
          • Lists-light
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Gin

    Gin-fix

    Fixing function for gin structures.

    Signature
    (gin-fix x) → new-x
    Arguments
    x — Guard (ginp x).
    Returns
    new-x — Type (ginp new-x).

    Definitions and Theorems

    Function: gin-fix$inline

    (defun gin-fix$inline (x)
     (declare (xargs :guard (ginp x)))
     (let ((__function__ 'gin-fix))
      (declare (ignorable __function__))
      (mbe
       :logic
       (b*
        ((ienv (c$::ienv-fix (cdr (std::da-nth 0 x))))
         (const-new (acl2::symbol-fix (cdr (std::da-nth 1 x))))
         (vartys (c::ident-type-map-fix (cdr (std::da-nth 2 x))))
         (events
             (acl2::pseudo-event-form-list-fix (cdr (std::da-nth 3 x))))
         (thm-index (pos-fix (cdr (std::da-nth 4 x)))))
        (list (cons 'ienv ienv)
              (cons 'const-new const-new)
              (cons 'vartys vartys)
              (cons 'events events)
              (cons 'thm-index thm-index)))
       :exec x)))

    Theorem: ginp-of-gin-fix

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

    Theorem: gin-fix-when-ginp

    (defthm gin-fix-when-ginp
      (implies (ginp x)
               (equal (gin-fix x) x)))

    Function: gin-equiv$inline

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

    Theorem: gin-equiv-is-an-equivalence

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

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

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

    Theorem: gin-fix-under-gin-equiv

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

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

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

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

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

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

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

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

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