• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Apt
        • Error-checking
        • Fty-extensions
        • Isar
        • Kestrel-utilities
        • Set
        • Soft
        • C
          • Syntax-for-tools
          • Atc
          • Language
            • Abstract-syntax
              • Tyspecseq
              • Expr
              • Binop
              • Fileset
              • Obj-declor
              • Ident
              • Iconst
              • Obj-adeclor
              • Const
              • Fundef
              • Unop
              • File
              • Tag-declon
              • Fun-declor
              • Obj-declon
              • Iconst-length
              • Abstract-syntax-operations
              • Label
              • Struct-declon
              • Initer
              • Ext-declon
              • Fun-adeclor
              • Expr-option
              • Iconst-base
              • Initer-option
              • Iconst-option
              • Tyspecseq-option
              • Stmt-option
              • Scspecseq
              • Param-declon
              • Obj-declon-option
              • File-option
              • Tyname
              • Transunit
              • Fun-declon
              • Transunit-result
              • Param-declon-list
              • Struct-declon-list
              • Expr-list
              • Tyspecseq-list
              • Ident-set
              • Ident-list
              • Ext-declon-list
              • Unop-list
              • Tyname-list
              • Fundef-list
              • Fun-declon-list
              • Binop-list
              • Stmt-fixtypes
              • Expr-fixtypes
            • Integer-ranges
            • Implementation-environments
            • Dynamic-semantics
            • Static-semantics
            • Grammar
            • Integer-formats
            • Types
            • Portable-ascii-identifiers
            • Values
            • Integer-operations
            • Computation-states
            • Object-designators
            • Operations
            • Errors
            • Tag-environments
            • Function-environments
            • Character-sets
            • Flexible-array-member-removal
            • Arithmetic-operations
            • Pointer-operations
            • Bytes
            • Keywords
            • Real-operations
            • Array-operations
            • Scalar-operations
            • Structure-operations
          • Representation
          • Transformation-tools
          • Insertion-sort
          • Pack
        • Bv
        • Imp-language
        • Event-macros
        • Java
        • Bitcoin
        • Ethereum
        • Yul
        • Zcash
        • ACL2-programming-language
        • Prime-fields
        • Json
        • Syntheto
        • File-io-light
        • Cryptography
        • Number-theory
        • Lists-light
        • Axe
        • Builtins
        • Solidity
        • Helpers
        • Htclient
        • Typed-lists-light
        • Arithmetic-light
      • X86isa
      • Axe
      • Execloader
    • Math
    • Testing-utilities
  • Language

Abstract-syntax

A preliminary abstract syntax of C.

This abstract syntax is preliminary in the sense that it is neither general nor complete. It is not general because it assumes the use of ASCII characters. which is not necessarily the case according to [C17]. It is not complete because it does not cover all the C constructs. Nonetheless, it covers a useful and interesting subset of C, with the ASCII assumption being largely supported (as part of perhaps a larger character set like Unicode).

We plan to generalize and extend this abstract syntax to avoid specific assumptions and to cover all the C constructs. In particular, we plan to use the formalization of character sets to lift the ASCII assumption.

The purpose of this abstract syntax is to support our formal definition of (a subset of) C. In contrast, the purpose of the more recently added abstract syntax for tools is to support the implementation of tools for C in ACL2. Currently ATC uses the abstract syntax defined here and not that one, but we plan to have it use that one instead, leaving the purpose of the one defined here exclusively to formally define the language. Because of its current use in ATC, the abstract syntax defined here captures constructs both before and after preprocessing; however, after ATC no longer uses it, we plan to change it to capture just the constructs after preprocessing, and more broadly we plan to formalize the translation phases [C17:5.1.1.2] in detail.

Subtopics

Tyspecseq
Fixtype of type specifier sequences [C17:6.7.2].
Expr
Fixtype of expressions [C17:6.5].
Binop
Fixtype of binary operators [C17:6.5.5-14] [C17:6.5.16].
Fileset
Fixtype of file sets.
Obj-declor
Fixtype of object declarators [C17:6.7.6].
Ident
Fixtype of identifiers [C17:6.4.2].
Iconst
Fixtype of integer constants [C17:6.4.4.1].
Obj-adeclor
Fixtype of abstract object declarators [C17:6.7.7].
Const
Fixtype of constants [C17:6.4.4].
Fundef
Fixtype of function definitions [C17:6.9.1].
Unop
Fixtype of unary operators [C17:6.5.3].
File
Fixtype of files.
Tag-declon
Fixtype of declarations of structure, union, and enumeration types [C17:6.7.2.1] [C17:6.7.2.2].
Fun-declor
Fixtype of function declarators [C17:6.7.6].
Obj-declon
Fixtype of object declarations [C17:6.7].
Iconst-length
Fixtype of lengths of integer constants [C17:6.4.4.1].
Abstract-syntax-operations
Operations on the C abstract syntax.
Label
Fixtype of labels of labeled statements [C17:6.8.1].
Struct-declon
Fixtype of structure declarations [C17:6.7.2.1].
Initer
Fixtype of initializers [C17:6.7.9].
Ext-declon
Fixtype of external declarations [C17:6.9].
Fun-adeclor
Fixtype of abstract function declarators [C17:6.7.7].
Expr-option
Fixtype of optional expressions.
Iconst-base
Fixtype of bases of integer constants [C17:6.4.4.1].
Initer-option
Fixtype of optional initializers.
Iconst-option
Fixtype of optional integer constants.
Tyspecseq-option
Fixtype of optional type specifier sequences.
Stmt-option
Fixtype of optional statements.
Scspecseq
Fixtype of storage class specifier sequences [C17:6.7.1].
Param-declon
Fixtype of parameter declarations [C17:6.7.6].
Obj-declon-option
Fixtype of optional object declarations.
File-option
Fixtype of optional files.
Tyname
Fixtype of type names [C17:6.7.7].
Transunit
Fixtype of translation units [C17:6.9].
Fun-declon
Fixtype of function declarations [C17:6.7].
Transunit-result
Fixtype of errors and translation units.
Param-declon-list
Fixtype of lists of parameter declarations.
Struct-declon-list
Fixtype of lists of structure declarations.
Expr-list
Fixtype of lists of expressions.
Tyspecseq-list
Fixtype of lists of type specifier sequences.
Ident-set
Fixtype of sets of identifiers.
Ident-list
Fixtype of lists of identifiers.
Ext-declon-list
Fixtype of lists of external declarations.
Unop-list
Fixtype of lists of unary operators.
Tyname-list
Fixtype of lists of type names.
Fundef-list
Fixtype of lists of function definitions.
Fun-declon-list
Fixtype of lists of function declarations.
Binop-list
Fixtype of lists of binary operators.
Stmt-fixtypes
Mutually recursive fixtypes for statements (and blocks).
Expr-fixtypes
Mutually recursive fixtypes for expressions.