• 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
      • Riscv
      • Taspi
      • 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
        • Aleobft
        • Aleovm
        • Leo
          • Grammar
          • Early-version
            • Json2ast
            • Testing
            • Definition
              • Flattening
              • Abstract-syntax
              • Dynamic-semantics
                • Execution
                • Values
                • Dynamic-environments
                • Arithmetic-operations
                • Curve-parameterization
                • Shift-operations
                • Errors
                • Value-expressions
                  • Value-to-value-expr
                  • Expression-valuep
                  • Value-expr-to-value
                    • Value-expr-list-to-value-list
                • Locations
                • Input-execution
                • Edwards-bls12-generator
                • Equality-operations
                • Logical-operations
                • Program-execution
                • Ordering-operations
                • Bitwise-operations
                • Literal-evaluation
                • Type-maps-for-struct-components
                • Output-execution
                • Tuple-operations
                • Struct-operations
              • Compilation
              • Static-semantics
              • Concrete-syntax
      • Bigmems
      • Builtins
      • Execloader
      • Solidity
      • Paco
      • Concurrent-programs
      • Bls12-377-curves
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
    • Math
    • Testing-utilities
  • Value-expressions

Value-expr-to-value

Value denoted by an expression value.

Signature
(value-expr-to-value expr curve) → val
Arguments
expr — Guard (expressionp expr).
curve — Guard (curvep curve).
Returns
val — Type (value-resultp val).

If the expression value is a literal, we evaluate it.

If it is a unary expression, whose operator must be - and whose operand must be a signed integer, there are two cases: (i) if the operand's numeral is the absolute value of the most negative value of the literal's type, the value is the most negative of that type; (ii) otherwise, we evaluate the literal and then we negate it.

If any of these evaluations fails, we return nil.

Theorem: return-type-of-value-expr-to-value.val

(defthm return-type-of-value-expr-to-value.val
  (b* ((?val (value-expr-to-value expr curve)))
    (value-resultp val))
  :rule-classes :rewrite)

Theorem: return-type-of-value-expr-list-to-value-list.vals

(defthm return-type-of-value-expr-list-to-value-list.vals
  (b* ((?vals (value-expr-list-to-value-list exprs curve)))
    (value-list-resultp vals))
  :rule-classes :rewrite)

Theorem: value-expr-to-value-of-expression-fix-expr

(defthm value-expr-to-value-of-expression-fix-expr
  (equal (value-expr-to-value (expression-fix expr)
                              curve)
         (value-expr-to-value expr curve)))

Theorem: value-expr-to-value-of-curve-fix-curve

(defthm value-expr-to-value-of-curve-fix-curve
  (equal (value-expr-to-value expr (curve-fix curve))
         (value-expr-to-value expr curve)))

Theorem: value-expr-list-to-value-list-of-expression-list-fix-exprs

(defthm value-expr-list-to-value-list-of-expression-list-fix-exprs
  (equal (value-expr-list-to-value-list (expression-list-fix exprs)
                                        curve)
         (value-expr-list-to-value-list exprs curve)))

Theorem: value-expr-list-to-value-list-of-curve-fix-curve

(defthm value-expr-list-to-value-list-of-curve-fix-curve
  (equal (value-expr-list-to-value-list exprs (curve-fix curve))
         (value-expr-list-to-value-list exprs curve)))

Theorem: value-expr-to-value-expression-equiv-congruence-on-expr

(defthm value-expr-to-value-expression-equiv-congruence-on-expr
  (implies (expression-equiv expr expr-equiv)
           (equal (value-expr-to-value expr curve)
                  (value-expr-to-value expr-equiv curve)))
  :rule-classes :congruence)

Theorem: value-expr-to-value-curve-equiv-congruence-on-curve

(defthm value-expr-to-value-curve-equiv-congruence-on-curve
  (implies (curve-equiv curve curve-equiv)
           (equal (value-expr-to-value expr curve)
                  (value-expr-to-value expr curve-equiv)))
  :rule-classes :congruence)

Theorem: value-expr-list-to-value-list-expression-list-equiv-congruence-on-exprs

(defthm
 value-expr-list-to-value-list-expression-list-equiv-congruence-on-exprs
 (implies (expression-list-equiv exprs exprs-equiv)
          (equal (value-expr-list-to-value-list exprs curve)
                 (value-expr-list-to-value-list exprs-equiv curve)))
 :rule-classes :congruence)

Theorem: value-expr-list-to-value-list-curve-equiv-congruence-on-curve

(defthm
      value-expr-list-to-value-list-curve-equiv-congruence-on-curve
 (implies (curve-equiv curve curve-equiv)
          (equal (value-expr-list-to-value-list exprs curve)
                 (value-expr-list-to-value-list exprs curve-equiv)))
 :rule-classes :congruence)

Subtopics

Value-expr-list-to-value-list