• 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
        • Syntax-for-tools
        • Atc
        • Language
          • Abstract-syntax
            • Tyspecseq
            • Expr
            • Binop
            • Fileset
            • Obj-declor
            • Ident
            • Iconst
            • Obj-adeclor
              • Obj-adeclor-fix
                • Obj-adeclor-case
                • Obj-adeclor-count
                • Obj-adeclorp
                • Obj-adeclor-equiv
                • Obj-adeclor-array
                • Obj-adeclor-pointer
                • Obj-adeclor-none
                • Obj-adeclor-kind
              • Const
              • Fundef
              • Unop
              • File
              • Tag-declon
              • Fun-declor
              • Obj-declon
              • Iconst-length
              • Abstract-syntax-operations
              • Label
              • Struct-declon
              • Initer
              • Ext-declon
              • Fun-adeclor
              • Expr-option
              • Iconst-base
              • Initer-option
              • Iconst-option
              • Tyspecseq-option
              • Stmt-option
              • Scspecseq
              • Param-declon
              • Obj-declon-option
              • File-option
              • Tyname
              • Transunit
              • Fun-declon
              • Transunit-result
              • Param-declon-list
              • Struct-declon-list
              • Expr-list
              • Tyspecseq-list
              • Ident-set
              • Ident-list
              • Ext-declon-list
              • Unop-list
              • Tyname-list
              • Fundef-list
              • Fun-declon-list
              • Binop-list
              • Stmt-fixtypes
              • Expr-fixtypes
            • Integer-ranges
            • Implementation-environments
            • Dynamic-semantics
            • Static-semantics
            • Grammar
            • Integer-formats
            • Types
            • Portable-ascii-identifiers
            • Values
            • Integer-operations
            • Computation-states
            • Object-designators
            • Operations
            • Errors
            • Tag-environments
            • Function-environments
            • Character-sets
            • Flexible-array-member-removal
            • Arithmetic-operations
            • Pointer-operations
            • Bytes
            • Keywords
            • Real-operations
            • Array-operations
            • Scalar-operations
            • Structure-operations
          • Representation
          • Transformation-tools
          • Insertion-sort
          • Pack
        • Farray
        • Rp-rewriter
        • Instant-runoff-voting
        • Imp-language
        • Sidekick
        • Leftist-trees
        • Java
        • Taspi
        • Bitcoin
        • Riscv
        • 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
        • Bigmems
        • Builtins
        • Execloader
        • Aleo
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Obj-adeclor

    Obj-adeclor-fix

    Fixing function for obj-adeclor structures.

    Signature
    (obj-adeclor-fix x) → new-x
    Arguments
    x — Guard (obj-adeclorp x).
    Returns
    new-x — Type (obj-adeclorp new-x).

    Definitions and Theorems

    Function: obj-adeclor-fix$inline

    (defun obj-adeclor-fix$inline (x)
     (declare (xargs :guard (obj-adeclorp x)))
     (let ((__function__ 'obj-adeclor-fix))
      (declare (ignorable __function__))
      (mbe
       :logic
       (case (obj-adeclor-kind x)
        (:none (cons :none (list)))
        (:pointer (b* ((decl (obj-adeclor-fix (std::da-nth 0 (cdr x)))))
                    (cons :pointer (list decl))))
        (:array (b* ((decl (obj-adeclor-fix (std::da-nth 0 (cdr x))))
                     (size (iconst-option-fix (std::da-nth 1 (cdr x)))))
                  (cons :array (list decl size)))))
       :exec x)))

    Theorem: obj-adeclorp-of-obj-adeclor-fix

    (defthm obj-adeclorp-of-obj-adeclor-fix
      (b* ((new-x (obj-adeclor-fix$inline x)))
        (obj-adeclorp new-x))
      :rule-classes :rewrite)

    Theorem: obj-adeclor-fix-when-obj-adeclorp

    (defthm obj-adeclor-fix-when-obj-adeclorp
      (implies (obj-adeclorp x)
               (equal (obj-adeclor-fix x) x)))

    Function: obj-adeclor-equiv$inline

    (defun obj-adeclor-equiv$inline (acl2::x acl2::y)
      (declare (xargs :guard (and (obj-adeclorp acl2::x)
                                  (obj-adeclorp acl2::y))))
      (equal (obj-adeclor-fix acl2::x)
             (obj-adeclor-fix acl2::y)))

    Theorem: obj-adeclor-equiv-is-an-equivalence

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

    Theorem: obj-adeclor-equiv-implies-equal-obj-adeclor-fix-1

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

    Theorem: obj-adeclor-fix-under-obj-adeclor-equiv

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

    Theorem: equal-of-obj-adeclor-fix-1-forward-to-obj-adeclor-equiv

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

    Theorem: equal-of-obj-adeclor-fix-2-forward-to-obj-adeclor-equiv

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

    Theorem: obj-adeclor-equiv-of-obj-adeclor-fix-1-forward

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

    Theorem: obj-adeclor-equiv-of-obj-adeclor-fix-2-forward

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

    Theorem: obj-adeclor-kind$inline-of-obj-adeclor-fix-x

    (defthm obj-adeclor-kind$inline-of-obj-adeclor-fix-x
      (equal (obj-adeclor-kind$inline (obj-adeclor-fix x))
             (obj-adeclor-kind$inline x)))

    Theorem: obj-adeclor-kind$inline-obj-adeclor-equiv-congruence-on-x

    (defthm obj-adeclor-kind$inline-obj-adeclor-equiv-congruence-on-x
      (implies (obj-adeclor-equiv x x-equiv)
               (equal (obj-adeclor-kind$inline x)
                      (obj-adeclor-kind$inline x-equiv)))
      :rule-classes :congruence)

    Theorem: consp-of-obj-adeclor-fix

    (defthm consp-of-obj-adeclor-fix
      (consp (obj-adeclor-fix x))
      :rule-classes :type-prescription)