• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • ACL2
    • Macro-libraries
    • 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-without-calls
                • 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-binary-strict-pure

    Execute a strict pure binary operation on expression values.

    Signature
    (exec-binary-strict-pure op arg1 arg2) → dval
    Arguments
    op — Guard (binopp op).
    arg1 — Guard (expr-valuep arg1).
    arg2 — Guard (expr-valuep arg2).
    Returns
    dval — Type (expr-value-resultp dval).

    This ACL2 function wraps eval-binary-strict-pure to take and return expression values.

    First we perform array-to-pointer conversion [C17:5.3.2.1/3], on both operands.

    Definitions and Theorems

    Function: exec-binary-strict-pure

    (defun exec-binary-strict-pure (op arg1 arg2)
      (declare (xargs :guard (and (binopp op)
                                  (expr-valuep arg1)
                                  (expr-valuep arg2))))
      (declare (xargs :guard (and (binop-strictp op)
                                  (binop-purep op))))
      (let ((__function__ 'exec-binary-strict-pure))
        (declare (ignorable __function__))
        (b* ((arg1 (apconvert-expr-value arg1))
             ((when (errorp arg1)) arg1)
             (arg2 (apconvert-expr-value arg2))
             ((when (errorp arg2)) arg2)
             (val1 (expr-value->value arg1))
             (val2 (expr-value->value arg2))
             (val (eval-binary-strict-pure op val1 val2))
             ((when (errorp val)) val))
          (make-expr-value :value val
                           :object nil))))

    Theorem: expr-value-resultp-of-exec-binary-strict-pure

    (defthm expr-value-resultp-of-exec-binary-strict-pure
      (b* ((dval (exec-binary-strict-pure op arg1 arg2)))
        (expr-value-resultp dval))
      :rule-classes :rewrite)

    Theorem: exec-binary-strict-pure-of-binop-fix-op

    (defthm exec-binary-strict-pure-of-binop-fix-op
      (equal (exec-binary-strict-pure (binop-fix op)
                                      arg1 arg2)
             (exec-binary-strict-pure op arg1 arg2)))

    Theorem: exec-binary-strict-pure-binop-equiv-congruence-on-op

    (defthm exec-binary-strict-pure-binop-equiv-congruence-on-op
      (implies (binop-equiv op op-equiv)
               (equal (exec-binary-strict-pure op arg1 arg2)
                      (exec-binary-strict-pure op-equiv arg1 arg2)))
      :rule-classes :congruence)

    Theorem: exec-binary-strict-pure-of-expr-value-fix-arg1

    (defthm exec-binary-strict-pure-of-expr-value-fix-arg1
      (equal (exec-binary-strict-pure op (expr-value-fix arg1)
                                      arg2)
             (exec-binary-strict-pure op arg1 arg2)))

    Theorem: exec-binary-strict-pure-expr-value-equiv-congruence-on-arg1

    (defthm exec-binary-strict-pure-expr-value-equiv-congruence-on-arg1
      (implies (expr-value-equiv arg1 arg1-equiv)
               (equal (exec-binary-strict-pure op arg1 arg2)
                      (exec-binary-strict-pure op arg1-equiv arg2)))
      :rule-classes :congruence)

    Theorem: exec-binary-strict-pure-of-expr-value-fix-arg2

    (defthm exec-binary-strict-pure-of-expr-value-fix-arg2
      (equal (exec-binary-strict-pure op arg1 (expr-value-fix arg2))
             (exec-binary-strict-pure op arg1 arg2)))

    Theorem: exec-binary-strict-pure-expr-value-equiv-congruence-on-arg2

    (defthm exec-binary-strict-pure-expr-value-equiv-congruence-on-arg2
      (implies (expr-value-equiv arg2 arg2-equiv)
               (equal (exec-binary-strict-pure op arg1 arg2)
                      (exec-binary-strict-pure op arg1 arg2-equiv)))
      :rule-classes :congruence)