• 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
                  • Int-valuep
                  • Value-option
                  • Type-of-value
                  • 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
                    • Value
                      • Valuep
                      • Value-case
                      • Value-equiv
                      • Value-struct
                      • Value-kind
                      • Value-u64
                      • Value-u32
                      • Value-u16
                      • Value-u128
                      • Value-tuple
                      • Value-string
                      • Value-i64
                      • Value-i32
                      • Value-i16
                      • Value-i128
                      • Value-bool
                      • Value-address
                      • Value-u8
                      • Value-scalar
                      • Value-i8
                      • Value-group
                      • Value-field
                      • Value-fix
                      • Value-count
                    • Value-list
                    • Value-map
                  • *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
  • Value/valuelist

Value

Fixtype of Leo values.

This is a tagged union type, introduced by fty::deftagsum.

Member Tags → Types
:bool → value-bool
:u8 → value-u8
:u16 → value-u16
:u32 → value-u32
:u64 → value-u64
:u128 → value-u128
:i8 → value-i8
:i16 → value-i16
:i32 → value-i32
:i64 → value-i64
:i128 → value-i128
:field → value-field
:group → value-group
:scalar → value-scalar
:address → value-address
:string → value-string
:tuple → value-tuple
:struct → value-struct

There are boolean values, unsigned and signed integer values of five sizes, base field element values, group element values, scalar field element values, address values, string values, tuple values, and struct values.

Since the primes that define the base and prime fields may vary (see curve-parameterization), here we allow a field or scalar element to consist of any natural number. That the natural number is below the respective prime is enforced elsewhere.

Analogously, since the elliptic curve that defines the group may vary, here we allow a group element to consist of any possible point of any possible elliptic curve. We use the type of elliptic curve points from the elliptic curve library, which includes representations for both finite points and the point of infinity.

We do not require tuple values to have zero or two or more components (i.e. not to have one component). We can formulate and prove that invariant separately. Keeping the fixtype of values more general also facilitates a possible future extension of Leo in which tuple values with one components are actually allowed.

Struct values are modeled as finite maps from identifiers (i.e. the names of the components) to values (i.e. the values of the components). We also include the name of the struct type.

Subtopics

Valuep
Recognizer for value structures.
Value-case
Case macro for the different kinds of value structures.
Value-equiv
Basic equivalence relation for value structures.
Value-struct
Value-kind
Get the kind (tag) of a value structure.
Value-u64
Value-u32
Value-u16
Value-u128
Value-tuple
Value-string
Value-i64
Value-i32
Value-i16
Value-i128
Value-bool
Value-address
Value-u8
Value-scalar
Value-i8
Value-group
Value-field
Value-fix
Fixing function for value structures.
Value-count
Measure for recurring over value structures.