• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Error-checking
        • Apt
        • Abnf
        • Fty-extensions
        • Isar
        • Kestrel-utilities
        • Prime-field-constraint-systems
        • Soft
        • Bv
        • Imp-language
        • Event-macros
        • Bitcoin
        • Ethereum
        • Yul
        • Zcash
        • ACL2-programming-language
          • Primitive-functions
          • Translated-terms
          • Values
            • Value
            • Symbol-value
            • Lower-symbol
            • Lift-symbol-list
            • Symbol-value-option
            • Value-option
            • Lift-value
              • Lift-symbol
              • Value-rational->get
              • Value-integer->get
              • Value-case-rational
              • Value-case-integer
              • Value-symbol-list
              • Value-list-of
              • Lower-value
              • Value-list
              • Symbol-value-list
              • Symbol-value-set
              • Value-nil
              • Value-t
            • Evaluation
            • Program-equivalence
            • Functions
            • Packages
            • Programs
            • Interpreter
            • Evaluation-states
          • Prime-fields
          • Java
          • C
          • Syntheto
          • Number-theory
          • Cryptography
          • Lists-light
          • File-io-light
          • Json
          • Built-ins
          • Solidity
          • Axe
          • Std-extensions
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Execloader
        • Axe
      • Testing-utilities
      • Math
    • Values

    Lift-value

    Lift an ACL2 good value to a meta-level value.

    Signature
    (lift-value x) → xval
    Arguments
    x — Guard (good-valuep x).
    Returns
    xval — Type (valuep xval).

    This extends lift-symbol to all values. More precisely, to all ``good'' values, as captured by good-valuep. Even though good values are the only ones possible in execution, from a logical point of view there may be other values (i.e. bad atoms or cons pairs containing bad atoms at some level), and thus we need to restrict the domain of this lifting function.

    Definitions and Theorems

    Function: lift-value

    (defun lift-value (x)
           (declare (xargs :guard (good-valuep x)))
           (let ((__function__ 'lift-value))
                (declare (ignorable __function__))
                (cond ((consp x)
                       (value-cons (lift-value (car x))
                                   (lift-value (cdr x))))
                      ((acl2-numberp x) (value-number x))
                      ((characterp x) (value-character x))
                      ((stringp x) (value-string x))
                      ((symbolp x)
                       (value-symbol (lift-symbol x)))
                      (t (prog2$ (impossible)
                                 (ec-call (value-fix :irrelevant)))))))

    Theorem: valuep-of-lift-value

    (defthm valuep-of-lift-value
            (b* ((xval (lift-value x)))
                (valuep xval))
            :rule-classes :rewrite)