• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • 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
          • Syntax-for-tools
          • Atc
          • Language
            • Abstract-syntax
            • Integer-ranges
            • Implementation-environments
            • Dynamic-semantics
              • Exec
              • Exec-arrsub
              • Exec-expr-pure
              • Exec-expr-asg
              • Init-value-to-value
              • Exec-memberp
              • Apconvert-expr-value
              • Exec-address
              • Exec-member
              • Init-scope
              • Exec-unary
              • Exec-fun
              • Exec-block-item
              • Eval-iconst
              • Exec-binary-strict-pure
              • Exec-expr-pure-list
              • Eval-binary-strict-pure
              • Exec-block-item-list
              • Exec-indir
                • Exec-expr-call-or-pure
                • Exec-stmt-while
                • Exec-stmt
                • Exec-ident
                • Eval-cast
                • Exec-cast
                • Eval-unary
                • Exec-const
                • Exec-initer
                • Exec-expr-call-or-asg
                • Eval-const
                • Exec-expr-call
              • 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
          • Bv
          • Imp-language
          • Event-macros
          • Java
          • Bitcoin
          • Ethereum
          • Yul
          • Zcash
          • ACL2-programming-language
          • 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
    • Dynamic-semantics

    Exec-indir

    Execute * on an expression value [C17:6.5.3.2/2] [C17:6.5.3.2/4].

    Signature
    (exec-indir arg compst) → eval
    Arguments
    arg — Guard (expr-valuep arg).
    compst — Guard (compustatep compst).
    Returns
    eval — Type (expr-value-resultp eval).

    First we perform array-to-pointer conversion [C17:5.3.2.1/3]. The value must be a pointer. If the pointer is not valid, it is an error. Otherwise, we read the object designated by the object designator, which is a value, and we return it as an expression value, taking the object designator from the pointer value.

    Definitions and Theorems

    Function: exec-indir

    (defun exec-indir (arg compst)
     (declare (xargs :guard (and (expr-valuep arg)
                                 (compustatep compst))))
     (let ((__function__ 'exec-indir))
      (declare (ignorable __function__))
      (b*
       ((arg (apconvert-expr-value arg))
        ((when (errorp arg)) arg)
        (val (expr-value->value arg))
        ((unless (value-case val :pointer))
         (error (list :non-pointer-dereference (expr-value-fix arg))))
        ((unless (value-pointer-validp val))
         (error
              (list :invalid-pointer-dereference (expr-value-fix arg))))
        (objdes (value-pointer->designator val))
        (*val (read-object objdes compst))
        ((when (errorp *val)) *val))
       (make-expr-value :value *val
                        :object objdes))))

    Theorem: expr-value-resultp-of-exec-indir

    (defthm expr-value-resultp-of-exec-indir
      (b* ((eval (exec-indir arg compst)))
        (expr-value-resultp eval))
      :rule-classes :rewrite)

    Theorem: exec-indir-of-expr-value-fix-arg

    (defthm exec-indir-of-expr-value-fix-arg
      (equal (exec-indir (expr-value-fix arg) compst)
             (exec-indir arg compst)))

    Theorem: exec-indir-expr-value-equiv-congruence-on-arg

    (defthm exec-indir-expr-value-equiv-congruence-on-arg
      (implies (expr-value-equiv arg arg-equiv)
               (equal (exec-indir arg compst)
                      (exec-indir arg-equiv compst)))
      :rule-classes :congruence)

    Theorem: exec-indir-of-compustate-fix-compst

    (defthm exec-indir-of-compustate-fix-compst
      (equal (exec-indir arg (compustate-fix compst))
             (exec-indir arg compst)))

    Theorem: exec-indir-compustate-equiv-congruence-on-compst

    (defthm exec-indir-compustate-equiv-congruence-on-compst
      (implies (compustate-equiv compst compst-equiv)
               (equal (exec-indir arg compst)
                      (exec-indir arg compst-equiv)))
      :rule-classes :congruence)