• 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
                • Expression
                • Syntax-abstraction
                • Statement
                • Files
                • Input-files
                • Identifiers
                • Types
                • Struct-init
                • Branch
                • Statements
                • Format-strings
                • Input-syntax-abstraction
                • Expressions
                • Output-files
                • Addresses
                • Literals
                  • Literal
                    • Literal-fix
                    • Literal-case
                    • Literalp
                    • Literal-equiv
                    • Literal-unsigned
                    • Literal-signed
                    • Literal-string
                    • Literal-group
                    • Literal-bool
                    • Literal-address
                    • Literal-scalar
                    • Literal-field
                    • Literal-kind
                  • Coordinate
                  • Group-literal
                  • Literal-result
                  • Group-literal-result
                  • Coordinate-result
                  • Literal-evaluation
                • Characters
                • Expression-list
                • Statement-list
                • Output-syntax-abstraction
                • Struct-init-list
                • Branch-list
                • Annotations
                • Abstract-syntax-trees
                • Symbols
                • Keywords
                • Programs
                • Packages
                • Bit-sizes
              • Dynamic-semantics
              • 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
  • Literals

Literal

Fixtype of Leo literals.

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

Member Tags → Types
:bool → literal-bool
:unsigned → literal-unsigned
:signed → literal-signed
:string → literal-string
:address → literal-address
:field → literal-field
:group → literal-group
:scalar → literal-scalar

Integer literals are typed. They are unsigned or signed, and they have a bit size. The value is always a natural number; negative integers are represented as unary negations of signed literals.

String literals consist of lists of characters. Currently there is no character literal but we continue to use char to represent string elements.

Field literals represent elements of the field type, which are natural numbers below the base prime. We allow any natural number here, which denotes the field element obtained by reducing modulo the prime.

Group literals are described in group-literal.

Scalar literals represent elements of the scalar type, which are natural numbers below the scalar prime. We allow any natural number here, which denotes the field element obtained by reducing modulo the prime.

Subtopics

Literal-fix
Fixing function for literal structures.
Literal-case
Case macro for the different kinds of literal structures.
Literalp
Recognizer for literal structures.
Literal-equiv
Basic equivalence relation for literal structures.
Literal-unsigned
Literal-signed
Literal-string
Literal-group
Literal-bool
Literal-address
Literal-scalar
Literal-field
Literal-kind
Get the kind (tag) of a literal structure.