• 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
                • Fundef-fix
                • Fundefp
                • Fundef-equiv
                • Make-fundef
                • Change-fundef
                • Fundef->tyspec
                • Fundef->declor
                • Fundef->body
              • 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
  • Abstract-syntax

Fundef

Fixtype of function definitions [C17:6.9.1].

This is a product type introduced by fty::defprod.

Fields
tyspec — tyspecseq
declor — fun-declor
body — block-item-list

We model a function definition as consisting of a type specifier sequence, a function declarator, and a body. With respect to [C17:6.9.1/1], the type specifier sequence are the declaration specifiers, the function declarator is the declarator, and the body is the compound statement. We do not model function definitions with parameter names and separate declarations for them before the body.

Since the body of a function definition must be a compound statement, we formalize the body as the list of block items that form the compound statement.

Since a function declaration consists of a type specifier sequence and a function declarator, this product fixtype of function definitions is isomorphic to a product fixtype of a function declaration and a body. However, even though this would work in abstract syntax, in concrete syntax a function declaration has to end with a semicolon (and that is why the grammar rule in [C17:6.9.1/1] does not use a declaration, but rather its components).

Subtopics

Fundef-fix
Fixing function for fundef structures.
Fundefp
Recognizer for fundef structures.
Fundef-equiv
Basic equivalence relation for fundef structures.
Make-fundef
Basic constructor macro for fundef structures.
Change-fundef
Modifying constructor for fundef structures.
Fundef->tyspec
Get the tyspec field from a fundef.
Fundef->declor
Get the declor field from a fundef.
Fundef->body
Get the body field from a fundef.