• 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
                  • 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
    • Dynamic-semantics

    Errors

    Error indications generated in the dynamic semantics of Leo.

    We formalize a defensive semantics of Leo, which means that, before executing any Leo construct (operations etc.), we check that all its preconditions are satisfied. In particular, we check that every operation is always applied to operands of appropriate types, that every referenced variable exists in the environment, and so on. When any of these preconditions fail, the ACL2 functions that formalize our dynamic semantics return ACL2 values that indicate errors, distinct from the ACL2 values that model the Leo values, environments, etc. (which are returned by the ACL2 functions when all the preconditions are satisfied).

    For now we do not define any ACL2 fixtype for errors. Instead, we define, where appropriate, tagged sum types that consist of the ``normal'' results plus the error results. We use the fixtype any (see any-p) for the error summand, so that we can put there any kind of information. In the future, we may refine this, for instance by introducing broad categories of errors, in particular to facilitate the formulation of type soundness theorems asserting that static semantics checks ensure the absence of certain categories of dynamic errors.