# Sampling and Samples

The goal of `[books]/projects/aleo/vm/circuits` is to (1) model the R1CS
circuits that AleoVM code is compiled into, (2) specify at a high level the
functions or relations that the R1CS circuits are supposed to implement, and (3)
prove equivalence of the two.

Although the ACL2 model of the R1CS circuits is created by carefully
transcribing the relevant parts of the snarkVM code, to gain more assurance that
the ACL2 model matches the actual R1CS circuits generated by the snarkVM Rust
code (in the `circuits` subdirectory), we extract samples of the R1CS circuits
generated by the Rust code for specific parameters and check that those samples
are equivalent to the circuits generated by the ACL2 model when given the same
parameters.

The directory `sampling` (which can be thought of as "sample processing")
contains code for processing the raw samples into the ACL2 model of R1CS, and
the sibling directory `samples` contains the samples themselves, in various raw
and Lisp formats.  The samples do not cover all the circuits generated by
snarkVM.  Some of the ACL2 samples have code that checks for equivalence between
the sample circuit R1CS and the ACL2 R1CS model of the circuit when given the
same parameters.

The content of these directories has up to three versions of sampling and
samples extracted, along with various notes.  The most recent sampling code is
in `cargo-test-output.lisp`.  The main purpose of this directory is to document
the ways in which sampling was done in the past and could be done in the future.
