• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • 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
        • Aleobft
        • Aleovm
        • Leo
          • Grammar
          • Early-version
            • Json2ast
            • Testing
            • Definition
              • Flattening
              • Abstract-syntax
                • Expression
                • Syntax-abstraction
                • Statement
                • Files
                  • Funparam-list->name-list
                  • Fundecl
                  • Var/const-sort
                  • Structdecl
                  • File
                  • Finalizer-option
                  • Topdecl
                  • Mappingdecl
                  • Fundecl-option
                  • Finalizer
                  • Funparam
                  • Fun-sort
                  • Programdecl
                    • Programdecl-fix
                      • Programdecl-equiv
                      • Make-programdecl
                      • Programdecl->items
                      • Change-programdecl
                      • Programdecl->id
                      • Programdeclp
                    • Compdecl
                    • Var/const-sort-result
                    • Topdecl-list-result
                    • Programdecl-list-result
                    • Importdecl-list-result
                    • Funparam-list-result
                    • Finalizer-option-result
                    • Compdecl-list-result
                    • Topdecl-result
                    • Structdecl-result
                    • Programdecl-result
                    • Mappingdecl-result
                    • Importdecl-result
                    • Importdecl
                    • Funparam-result
                    • Fundecl-result
                    • Fun-sort-result
                    • Finalizer-result
                    • Compdecl-result
                    • File-result
                    • Funparam-list
                    • Programdecl-list
                    • Importdecl-list
                    • Compdecl-list
                    • Var/const-sort-list
                    • Topdecl-list
                    • Fundecl-list
                  • 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
                  • 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
    • Programdecl

    Programdecl-fix

    Fixing function for programdecl structures.

    Signature
    (programdecl-fix x) → new-x
    Arguments
    x — Guard (programdeclp x).
    Returns
    new-x — Type (programdeclp new-x).

    Definitions and Theorems

    Function: programdecl-fix$inline

    (defun programdecl-fix$inline (x)
     (declare (xargs :guard (programdeclp x)))
     (let ((__function__ 'programdecl-fix))
      (declare (ignorable __function__))
      (mbe
          :logic
          (b* ((id (programid-fix (cdr (std::da-nth 0 (cdr x)))))
               (items (topdecl-list-fix (cdr (std::da-nth 1 (cdr x))))))
            (cons :programdecl (list (cons 'id id)
                                     (cons 'items items))))
          :exec x)))

    Theorem: programdeclp-of-programdecl-fix

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

    Theorem: programdecl-fix-when-programdeclp

    (defthm programdecl-fix-when-programdeclp
      (implies (programdeclp x)
               (equal (programdecl-fix x) x)))

    Function: programdecl-equiv$inline

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

    Theorem: programdecl-equiv-is-an-equivalence

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

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

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

    Theorem: programdecl-fix-under-programdecl-equiv

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

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

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

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

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

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

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

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

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