• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Apt
        • Error-checking
        • Fty-extensions
        • Isar
        • Kestrel-utilities
        • Set
        • Soft
        • C
        • Bv
        • Imp-language
        • Event-macros
        • Java
        • Bitcoin
        • Ethereum
        • Yul
        • Zcash
        • ACL2-programming-language
          • Primitive-functions
          • Translated-terms
          • Values
            • Value
              • Valuep
              • Value-case
              • Value-fix
              • Value-equiv
              • Value-count
              • Value-cons
                • Make-value-cons
                • Value-cons->cdr
                • Value-cons->car
                  • Change-value-cons
                • Value-symbol
                • Value-string
                • Value-number
                • Value-character
                • Value-kind
              • 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
              • Lower-value
              • Value-list-of
              • Value-list
              • Symbol-value-list
              • Symbol-value-set
              • Value-t
              • Value-nil
            • Evaluation
            • Program-equivalence
            • Functions
            • Packages
            • Programs
            • Interpreter
            • Evaluation-states
          • Prime-fields
          • Json
          • Syntheto
          • File-io-light
          • Cryptography
          • Number-theory
          • Lists-light
          • Axe
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Value-cons

    Value-cons->car

    Get the car field from a value-cons.

    Signature
    (value-cons->car x) → car
    Arguments
    x — Guard (valuep x).
    Returns
    car — Type (valuep car).

    This is an ordinary field accessor created by fty::defprod.

    Definitions and Theorems

    Function: value-cons->car$inline

    (defun value-cons->car$inline (x)
      (declare (xargs :guard (valuep x)))
      (declare (xargs :guard (equal (value-kind x) :cons)))
      (let ((__function__ 'value-cons->car))
        (declare (ignorable __function__))
        (mbe :logic
             (b* ((x (and (equal (value-kind x) :cons) x)))
               (value-fix (std::da-nth 0 (cdr x))))
             :exec (std::da-nth 0 (cdr x)))))

    Theorem: valuep-of-value-cons->car

    (defthm valuep-of-value-cons->car
      (b* ((car (value-cons->car$inline x)))
        (valuep car))
      :rule-classes :rewrite)

    Theorem: value-cons->car$inline-of-value-fix-x

    (defthm value-cons->car$inline-of-value-fix-x
      (equal (value-cons->car$inline (value-fix x))
             (value-cons->car$inline x)))

    Theorem: value-cons->car$inline-value-equiv-congruence-on-x

    (defthm value-cons->car$inline-value-equiv-congruence-on-x
      (implies (value-equiv x x-equiv)
               (equal (value-cons->car$inline x)
                      (value-cons->car$inline x-equiv)))
      :rule-classes :congruence)

    Theorem: value-cons->car-when-wrong-kind

    (defthm value-cons->car-when-wrong-kind
      (implies (not (equal (value-kind x) :cons))
               (equal (value-cons->car x)
                      (value-fix nil))))