Skip to main content
Aristotle formally verifies properties of programs written in C. It can verify whole programs, libraries, or individual functions. The default deliverable is memory safety: a machine-checked proof that a function executes without undefined behavior (out-of-bounds reads and writes, null or dangling pointer dereferences, uninitialized reads, signed integer overflow, and so on) whenever its callers meet a stated set of preconditions. On request, Aristotle also proves functional correctness: that a function computes what you say it should. You state the properties of interest in English, either in the prompt or in a specification file uploaded with your sources. After analysis, Aristotle returns a summary listing each property you asked for and its status, followed by the verification boundary: which of your functions are verified, which parts of the codebase the verification does not reach, and everything the result assumes, such as preconditions on function inputs or the assumed behavior of an external dependency. If a memory-safety property is found to be false, you will receive a small standalone C program that fixes the failing inputs and calls your original implementation, so you can reproduce the violation locally with a sanitizer.

Under the hood

Aristotle compiles the provided C code deterministically into our proprietary Lean formal model of C execution (onward: the embedding). The proofs Aristotle writes use compositional reasoning based on separation logic. Sources are verified exactly as submitted. Aristotle never edits your C to make it easier to analyze: it does not rewrite a function, replace it with a simpler one, or stub out a dependency.

Supported language and platform features

Aristotle supports integers up to 128 bits, pointers, arrays, structures, unions, dynamic allocation and deallocation, loops and recursion. Multiple C files can be combined with checked linking. Support also includes variadic functions, bit-fields, restricted variable-length arrays and selected GCC inline assembly. Floating point. Support covers binary32 float, binary64 double and x87 extended-precision long double, including arithmetic and conversions. Libraries and input and output. Contracts cover parts of the standard C and POSIX libraries, including allocation, strings and file I/O. Caller proofs assume these contracts; they do not verify the library or operating-system implementations. Proof rules also cover buffered file and directory I/O. Concurrency. Support covers thread creation and joining, mutexes, and sequentially consistent atomics. Memory leaks. A proof can show that a program frees all the heap memory it allocates by the time main returns. This covers executions in which main and every thread return normally, not those that end through exit or abort. You need to explicitly ask for this feature to be enabled in your prompt, as it is not enabled by default.

Undefined behavior that Aristotle detects

A successful Aristotle proof rules out:
  • accessing memory outside the allocation that a pointer comes from (its provenance), or after the lifetime of that allocation has ended, such as after it is freed;
  • null dereferences, invalid frees and writes to read-only storage;
  • integer division by zero, invalid shift counts, and signed arithmetic overflow (in -fwrapv builds, addition, subtraction, negation and multiplication wrap instead);
  • conflicting accesses to an object that the C sequencing rules leave unordered, such as i = i++, in any of the evaluation orders that C permits;
  • incompatible typed accesses under the effective-type (strict-aliasing) rules, which are checked by default and not in -fno-strict-aliasing builds;
  • reading a local variable before its first assignment, if its address is never taken;
  • using an uninitialized pointer for memory access, arithmetic or a call argument, and reading an uninitialized _Bool.
The embedding does not detect every form of C undefined behavior. It does not enforce restrict promises. Other reads of uninitialized integer or floating-point values, for example from heap memory, an array or a structure field, give an arbitrary value of the type, and a proof must hold for every such value.

Installation

Upload your C files in the web app, or have your AI assistant send them through the MCP server. To submit from the command line, see MCP & CLI. C verification needs no extra setup.

Example workflow

This example uses a fixed-capacity ring buffer, split across a header ring_buffer.h:
and an implementation ring_buffer.c:
To specify the intended behavior, create a file ringbuf_spec.md alongside the sources:
Place the three files in a directory on their own and submit that directory. The CLI uploads the directory, except what an ignore rule matches and a few kinds of file it never sends, such as files named like credentials. In a git repository, git’s ignore rules apply; elsewhere, or in a folder git ignores, only the directory’s top-level .gitignore does. Add --include-ignored to upload what the ignore rules match too, such as headers a build generates. A link to a file goes up only when the file it points to does too, and a link to a folder never does. Include every header the sources need and nothing unrelated:
Note: mention any relevant compiler flags (-D, -I, -fno-strict-aliasing, -ffp-contract=off, -fwrapv, etc.) or include your build script. Also include header files, API docs, and relevant conceptual docs for your code’s non-open-source dependencies. Also include source code and/or Linux/x86-64 binaries for all transitive non-open-source dependencies, if you want Aristotle to check whether a bug in your code can be triggered in your setup. aristotle submit leaves out files whose names end in .o or .so, even with --include-ignored. Other binaries, such as static libraries (.a), executables, and versioned shared libraries like libz.so.1, follow the ignore rules like any other file, so pass --include-ignored if an ignore rule matches them. To list what would go up without sending anything, run the command with --dry-run in place of --wait and --destination. Aristotle detects C verification from the .c files in the upload. The command creates a project which you can monitor at Projects. Without --wait the command returns immediately after creating the project; use aristotle list, aristotle show <project-id> and aristotle download <project-id> to follow up later. Before it begins proving, Aristotle reads your sources, builds the call graph from the functions you named, and may ask a small batch of clarifying questions on the project page: which functions are the verification targets, what each entry point may assume about its arguments where the code does not check (non-null, buffer sizes, NUL termination, value ranges). Questions are phrased entirely in terms of your own function and variable names. Aristotle may ask them while it works, whether or not you pass --wait, and waits up to 15 minutes for each answer. With --wait at a terminal, the CLI also shows each question as it arrives and sends your answers. Without it, the command prints aristotle questions <project-id>, which lists the questions and lets you answer them. If a question gets no answer in time, Aristotle carries on without it: it verifies what doesn’t need a decision only you can make, leaves the rest unverified, and names the open question in its summary. For a batch run nobody will answer, pass --no-questions: Aristotle then asks nothing, and treats each open decision the same way. For a run where all the properties are proved you will see a summary like this:
For a verification task where a bug was found—suppose rb_push had instead computed the write index as size_t tail = rb->head + rb->count;—you will get a message like this:
Extract the result archive and use the reproducer path listed in your summary. For the ring buffer example, run the following commands from the archive root:
A memory-safety violation is reported as a counterexample, a concrete failing execution, rather than as a formal proof that the property is false.

Specifying what to verify

Properties may be given in the prompt directly or in any text or Markdown file included in the project directory and referenced from the prompt. Write them in terms of your own functions, parameters and struct fields. Useful things to state explicitly:
  • Which functions are the targets. By default Aristotle verifies the functions you name and every helper they reach in your sources, and reports each of them separately.
  • Caller preconditions the code does not check itself: which pointers are non-null, how large the buffers behind them are, which strings are NUL-terminated, which integer arguments are in range, and which buffers must not overlap. If you leave these open, Aristotle will ask, or will state the minimal obligations it needed and report them as caller obligations.
  • What “correct” means for functional properties. Memory safety needs no specification beyond the preconditions; functional correctness does.
Multi-file programs are supported. Put all .c and .h files under the project directory. Functions called across files within your sources are verified against a single shared specification so that the results compose.

External libraries

Your code will call functions you did not write. Aristotle treats them as follows:
  • The C standard library (glibc). Contracts for the standard headers (string.h, stdio.h, stdlib.h, ctype.h, errno.h, unistd.h, time.h and many more) are built in and used automatically. Caller obligations they impose, such as a destination buffer being large enough for sprintf output, are proved at each call site or reported as obligations on your callers. A few contracts hold only under an assumption about the client program (for example that it never fcloses a standard stream); Aristotle reports such an assumption when your code depends on it.
  • Other libraries. By default, Aristotle verifies the supplied code needed for your properties, including supplied library implementations. It may offer to extend verification to additional libraries and continues with the default scope while awaiting your answer. For libraries outside the verification scope, Aristotle reuses applicable contracts or derives contracts from their source code. When source is unavailable, it uses documentation and how your code calls the library. Establishing these contracts does not require your approval. The summary states the assumed behavior and every result that depends on it; the library implementations remain unverified. Obligations imposed on your code must still be proved or stated as caller preconditions.
  • Callbacks your code passes to a library (for example a qsort comparator) remain part of the verification scope.

Public Lean specifications

When a result includes public Lean specifications, the archive stores the contracts and supporting definitions under Spec/, alongside your submitted sources, the summary, and any counterexample reproducers. The project’s Properties table lists each property’s status and shows a Code snippet when a public Lean specification is available. The archive also includes the generated function interfaces at <module>/Public.lean and seven public support files under C2lean/. These include C2lean/Public/Integer.lean, which defines the platform’s integer bounds used in specifications. Assumptions about the C library appear as an abstract LibCSpecs S premise, or LibCIOSpecs S for tracked I/O. The property’s prose explains the library guarantees and restrictions on which it relies. To build the public specifications locally, install Lean’s elan toolchain manager and follow the instructions in the downloaded Spec/BUILD.md. Keep the specifications, generated interfaces, and support files together at their original paths. The instructions specify the Lean toolchain, pinned public dependencies, Lake configuration, and commands for a fresh project. This build checks that the published specifications compile; it does not rerun the proofs about your C implementation.

Current assumptions and limitations

Assumptions

Aristotle assumes that:
  • preprocessing and the translation into the embedding are faithful;
  • the compiler has no bugs that affect the program, and does not optimize it based on undefined behavior that the embedding does not detect;
  • glibc 2.35 and the Linux kernel behave as their assumed contracts state;
  • floating-point operations round to nearest, ties to even, as in IEEE 754, and the program does not change the rounding mode (for example with fesetround) or depend on floating-point exception flags (for example through fetestexcept);
  • the compiler does not fuse separate floating-point operations, such as a multiplication and an addition, into one (compile with -ffp-contract=off);
  • the compiler does not assume that a loop without side effects terminates;
  • the Lean proof checker is correct, and so is native evaluation where a proof uses it.
Aristotle uses a formal model of C on Linux/x86-64 (more specifically, gcc on Ubuntu 22.04) that follows the platform as documented, plus some known platform bugs.

Functions Aristotle cannot handle yet

If a function your properties reach cannot be verified yet, the summary lists it by name under “Functions we cannot handle yet”, and the properties that depend on it are not verified. Verification continues for the other properties. Functions your properties never reach do not affect the run.

Compiler and platform

Aristotle verifies programs as compiled by GCC 11.4 for Linux on x86-64.

Termination

Aristotle does not support reasoning about termination: functional postconditions describe what holds if a function returns.

Concurrency and I/O

The proof rules for buffered file and directory I/O are not yet formally proved sound with respect to the embedding. Aristotle does not support weak-memory concurrency or device I/O through volatile.

Liveness and complexity

Aristotle does not support reasoning about deadlock freedom, program complexity or constant-time execution.

Unsupported constructs

Aristotle does not support complex or decimal arithmetic, binary128 types (_Float128, __float128), or vector operations. It supports setjmp and longjmp only where the C standard allows a call of setjmp, and thread-local objects only in programs that run a single thread.

Integer-to-pointer casts

Pointers reconstructed from integer addresses support some equality comparisons, but do not regain permission to access an allocation. Unsupported uses include memory access, nonzero offsets, ordering or subtraction against allocation pointers, free/realloc, mutex operations and indirect calls, even after a pointer-to-integer-to-pointer round trip.

Bugs are reported as counterexamples, not as proofs of incorrectness

Aristotle can prove a C property, and it can exhibit a concrete failing execution, but it does not produce a formal proof that a C property is false. A property that Aristotle could neither prove nor refute with a confirmed counterexample is reported as unverified, with the reason. A failed proof attempt on its own is never reported as a bug.

Prose specifications

When Aristotle cannot generate a public Lean specification for a property, it provides a prose specification detailing the proved statement, counterexample, or unverified outcome.

Proof source is not returned

If Aristotle claims it has verified a function, this is always based on a machine-checked formal proof of the property for a mechanically (not agentically) produced formal embedding of the function against a formal semantics of C on Linux/x86-64. The internal C semantics, proof source, correspondence certificates, and built-in libc contract formulas are not included in the result archive.