Skip to content

Commit 6297fdd

Browse files
authored
Merge pull request #125 from yoshuawuyts/doc-readme
start documenting repository structure
2 parents ca14d99 + e71830f commit 6297fdd

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

README.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,22 @@ Like any Rust project:
1111
* Clone
1212
* `cargo test --all`
1313

14-
<!-- TODO -->
15-
<!-- ## Structure of the repository -->
14+
## Layers of formality
15+
16+
Formality is structured into several layers. These layers are meant to also map
17+
fairly closely onto chalk and the eventual Rust trait solver implementation.
18+
Ideally, one should be able to map back and forth between formality and the code
19+
with ease.
20+
21+
* **formality-check**: Defines the top-level routines for checking Rust programs.
22+
`check_all_crates` is effectively the `main`, so it's a good place to start reading.
23+
* **formality-core**: Defines logging macros.
24+
* **formality-macros**: Defines procedural macros like `#[term]` as well as various derives.
25+
These are used to generate the boilerplate code for parsing, pretty printing, folding, etc.
26+
* **formality-prove**: Defines the rules for proving goals (e.g., is this trait implemented?)
27+
* **formality-rust:** This is the "Rust declarations" layer, defining Rust
28+
"top-level items" and their semantics. This includes crates, structs, traits,
29+
impls, but excludes function bodies.
30+
* **formality-types:** This is the "types" layer, defining Rust types and
31+
functions for equating/relating them. The representation is meant to cover
32+
all Rust types, but is optimized for extracting their "essential properties".

0 commit comments

Comments
 (0)