• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • C
      • Proof-checker-array
      • Soft
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Ethereum
      • Leftist-trees
      • Java
      • Riscv
      • Taspi
      • Bitcoin
      • Zcash
      • Des
      • X86isa
      • Sha-2
      • Yul
      • Proof-checker-itp13
      • Regex
      • ACL2-programming-language
      • Json
      • Jfkr
      • Equational
      • Cryptography
      • Axe
      • Poseidon
      • Where-do-i-place-my-book
      • Aleo
        • Aleobft
        • Aleovm
        • Leo
          • Grammar
          • Early-version
            • Json2ast
            • Testing
            • Definition
              • Flattening
              • Abstract-syntax
              • Dynamic-semantics
                • Execution
                • Values
                  • Int-valuep
                  • Value-option
                  • Type-of-value
                    • Type-list-of-value-list
                  • Value-option-result
                  • Value-list-result
                  • Name+value
                  • Value-result
                  • Make-int-value
                  • Type-map-of-value-map
                  • Name+type-of-name+value
                  • Int-value-bound-theorems
                  • Int-value-to-int
                  • Int-value-numbits
                  • Value/valuelist
                  • *most-positive-i8*
                  • *most-positive-i64*
                  • *most-positive-i32*
                  • *most-positive-i16*
                  • *most-positive-i128*
                  • *most-negative-i8*
                  • *most-negative-i64*
                  • *most-negative-i32*
                  • *most-negative-i16*
                  • *most-negative-i128*
                  • *greatest-u8*
                  • *greatest-u64*
                  • *greatest-u32*
                  • *greatest-u16*
                  • *greatest-u128*
                • Dynamic-environments
                • Arithmetic-operations
                • Curve-parameterization
                • Shift-operations
                • Errors
                • Value-expressions
                • 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
  • Values

Type-of-value

Leo type of a Leo value.

Signature
(type-of-value value) → type
Arguments
value — Guard (valuep value).
Returns
type — Type (typep type).

In our current formalization, every Leo value has exactly one Leo type. This function associates a type to each value.

Theorem: return-type-of-type-of-value.type

(defthm return-type-of-type-of-value.type
  (b* ((?type (type-of-value value)))
    (typep type))
  :rule-classes :rewrite)

Theorem: return-type-of-type-list-of-value-list.types

(defthm return-type-of-type-list-of-value-list.types
  (b* ((?types (type-list-of-value-list values)))
    (type-listp types))
  :rule-classes :rewrite)

Theorem: len-of-type-list-of-value-list

(defthm len-of-type-list-of-value-list
  (b* ((?types (type-list-of-value-list values)))
    (equal (len types) (len values))))

Theorem: type-of-value-of-value-fix-value

(defthm type-of-value-of-value-fix-value
  (equal (type-of-value (value-fix value))
         (type-of-value value)))

Theorem: type-list-of-value-list-of-value-list-fix-values

(defthm type-list-of-value-list-of-value-list-fix-values
  (equal (type-list-of-value-list (value-list-fix values))
         (type-list-of-value-list values)))

Theorem: type-of-value-value-equiv-congruence-on-value

(defthm type-of-value-value-equiv-congruence-on-value
  (implies (value-equiv value value-equiv)
           (equal (type-of-value value)
                  (type-of-value value-equiv)))
  :rule-classes :congruence)

Theorem: type-list-of-value-list-value-list-equiv-congruence-on-values

(defthm
      type-list-of-value-list-value-list-equiv-congruence-on-values
  (implies (value-list-equiv values values-equiv)
           (equal (type-list-of-value-list values)
                  (type-list-of-value-list values-equiv)))
  :rule-classes :congruence)

Subtopics

Type-list-of-value-list