• 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
                • 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
  • Definition

Abstract-syntax

Abstract syntax of Leo.

The abstract syntax of Leo is a representation of the Leo constructs obtained by abstracting away some information from the concrete syntax.

The definition of the abstract syntax consists of fixtypes that represent the constructs and an abstraction mapping from concrete to abstract syntax.

While the concrete syntax of Leo is prescribed by the ABNF grammar and visible to the user, the abstract syntax is internal to the ACL2 formalization: its purpose is to formalize static semantics and dynamic semantics more conveniently on abstract syntax than on concrete syntax; the chosen form of the abstract syntax, among many possible, is motivated by this purpose.

This ACL2 abstract syntax of Leo is similar to the Rust abstract syntax of Leo in the Leo compiler. However, the two serve slightly different purposes, and therefore they do not have to be necessarily in strict alignment.

Subtopics

Expression
Fixtype of Leo expressions.
Syntax-abstraction
Mapping from concrete to abstract syntax, for Leo code.
Statement
Fixtype of Leo statements.
Files
Leo files.
Input-files
Leo input files.
Identifiers
Leo identifiers.
Types
Leo types.
Struct-init
Fixtype of Leo struct component initializers.
Branch
Fixtype of Leo branches.
Statements
Leo statements.
Format-strings
Leo format strings.
Input-syntax-abstraction
Mapping from concrete to abstract syntax, for Leo input files.
Expressions
Leo expressions.
Output-files
Leo output files.
Addresses
Leo addresses.
Literals
Leo literals.
Characters
Leo characters.
Expression-list
Fixtype of lists of Leo expressions.
Statement-list
Fixtype of lists of Leo statements.
Output-syntax-abstraction
Mapping from concrete to abstract syntax, for Leo output files.
Struct-init-list
Fixtype of lists of Leo struct component initializers.
Branch-list
Fixtype of lists of Leo branches.
Annotations
Leo annotations.
Abstract-syntax-trees
Abstract syntax trees (ASTs).
Symbols
Leo symbols.
Keywords
Leo keywords.
Programs
Leo programs.
Packages
Leo packages.
Bit-sizes
Leo integer bit sizes.