• 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
        • Atj
        • Aij
        • Language
          • Syntax
          • Semantics
            • Primitive-function-macros
            • Primitive-values
            • Floating-point-placeholders
            • Pointers
              • Pointerp
              • Pointer
                • Pointerp
                • Pointer-fix
                • New-pointer
                • Pointer-list
              • Floating-point-value-set-parameters
              • Values
              • Primitive-operations
              • Primitive-conversions
              • Reference-values
        • Taspi
        • Riscv
        • 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
        • Bigmems
        • Builtins
        • Execloader
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Community
      • Proof-automation
      • ACL2
      • Macro-libraries
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Pointer

    Pointer-fix

    Fixer for pointer.

    Signature
    (pointer-fix x) → fixed-x
    Arguments
    x — Guard (pointerp x).
    Returns
    fixed-x — Type (pointerp fixed-x).

    Definitions and Theorems

    Function: pointer-fix

    (defun pointer-fix (x)
      (declare (xargs :guard (pointerp x)))
      (mbe :logic
           (if (pointerp x)
               x
             (new-pointer-raw nil))
           :exec x))

    Theorem: pointerp-of-pointer-fix

    (defthm pointerp-of-pointer-fix
      (b* ((fixed-x (pointer-fix x)))
        (pointerp fixed-x))
      :rule-classes :rewrite)

    Theorem: pointer-fix-when-pointerp

    (defthm pointer-fix-when-pointerp
      (implies (pointerp x)
               (equal (pointer-fix x) x)))