• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • 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
        • C
          • Syntax-for-tools
          • Atc
          • Transformation-tools
          • Language
          • Representation
          • Insertion-sort
          • Pack
        • Soft
        • Bv
        • Imp-language
        • Ethereum
        • Event-macros
        • Java
        • Riscv
        • Bitcoin
        • Zcash
        • Yul
        • ACL2-programming-language
        • Prime-fields
        • Json
        • Syntheto
        • File-io-light
        • Cryptography
        • Number-theory
        • Axe
        • Lists-light
        • Builtins
        • Solidity
        • Helpers
        • Htclient
        • Typed-lists-light
        • Arithmetic-light
      • X86isa
      • Axe
      • Execloader
    • Math
    • Testing-utilities
  • Kestrel-books
  • Projects

C

An ACL2 library for C.

This library contains:

  • A formalization of (a subset of) the C language. This is a deep embedding of C in ACL2.
  • A representation of (a subset of) the C language constructs in ACL2. This is a shallow embedding of C in ACL2.
  • A proof-generating C code generator for ACL2. This recognizes, and translates to C, the shallowly embedded ACL2 representation of C constructs, and generates proofs based on the deep embedding.
  • A tool-oriented syntax of C.
  • A toolkit of proof-generating C-to-C transformations.

The library is work in progress.

This library is based on:

  • ISO/IEC 9899:2024, i.e. the C23 standard.
  • ISO/IEC 9899:2018, i.e. the C17 standard.
  • The GCC Manual for the current development.
  • The GNU C Language Intro and Reference Manual.

In the documentation of this library, these source are referenced as `[C23]', `[C17]', `[GCCM]', and `[GCCL]'; sections are referenced by appending their designations separated by colon, e.g. `[C17:6.2.6]' references Section 6.2.6 of [C17]; paragraphs are referenced by further appending their numbers separated by slash, e.g. `[C17:6.2.5/2]' references Paragraph 2 of Section 6.2.5 of [C17]. These square-bracketed references may be used as nouns or parenthetically. In the case of [GCCM] and [GCCL], we also give URL links, which, given the characters that form them, may be useful to locate documentation that has moved or otherwise changed, given that [GCCM] and [GCCL] are live documents; an example is [GCCM:6], which currently refers to Section 6 of [GCCM], titled `Extensions to the C Language Family', and whose URL includes C-Extensions.html.

The GCC extensions to the ISO/IEC standard are sufficiently prevalent and important that we need to take them into account for our library of C to be of practical use. But in the documentation of this ACL2 library, we always clearly distinguish between standard C and GCC extensions.

When referencing concepts that are the same in [C23] and [C17], we prefer to just reference [C23]. However, since we started developing this library before [C23], there are still many references to [C17]. When there is some difference between [C17] and [C23], we take care to reference both.

Subtopics

Syntax-for-tools
A syntax of C for use by tools.
Atc
ATC (ACL2 To C), a proof-generating C code generator for ACL2.
Transformation-tools
C2C: transformation tools for C.
Language
A formal model of (a subset of) the C language.
Representation
A representation of C in ACL2.
Insertion-sort
A generic insert sort based on ACL2's total order of values.
Pack
Build a symbol in the "C" package from a list of atoms.