Skip to content

Commit 7f14c82

Browse files
committed
Chalk Overview: Organize and sort links
1 parent b5024c3 commit 7f14c82

File tree

1 file changed

+32
-35
lines changed

1 file changed

+32
-35
lines changed

src/traits/chalk-overview.md

+32-35
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ extend.
1919
## Chalk Structure
2020

2121
Chalk has two main "products". The first of these is the
22-
[`chalk_engine`][doc-chalk-engine] crate, which defines the core [SLG
22+
[`chalk_engine`][chalk_engine] crate, which defines the core [SLG
2323
solver][slg]. This is the part rustc uses.
2424

2525
The rest of chalk can be considered an elaborate testing harness. Chalk is
@@ -53,8 +53,6 @@ You can see more examples of programs and queries in the [unit tests][chalk-test
5353

5454
Next we'll go through each stage required to produce the output above.
5555

56-
[chalk-tests]: https://github.com/rust-lang-nursery/chalk/blob/4bce000801de31bf45c02f742a5fce335c9f035f/src/test.rs#L115
57-
5856
### Parsing ([chalk_parse])
5957

6058
Chalk is designed to be incorporated with the Rust compiler, so the syntax and
@@ -134,27 +132,19 @@ etc. and emitting the rules that come from each one.
134132

135133
*See also: [Lowering Rules][lowering-rules]*
136134

137-
[`ProgramEnvironment`]: https://rust-lang-nursery.github.io/chalk/doc/chalk_ir/struct.ProgramEnvironment.html
138-
[`ProgramClause`]: https://rust-lang-nursery.github.io/chalk/doc/chalk_ir/enum.ProgramClause.html
139-
[rules-src]: https://github.com/rust-lang-nursery/chalk/blob/4bce000801de31bf45c02f742a5fce335c9f035f/src/rules.rs
140-
141135
#### Well-formedness checks
142136

143137
As part of lowering to logic, we also do some "well formedness" checks. See
144138
the [`rules::wf` source code][rules-wf-src] for where those are done.
145139

146140
*See also: [Well-formedness checking][wf-checking]*
147141

148-
[rules-wf-src]: https://github.com/rust-lang-nursery/chalk/blob/4bce000801de31bf45c02f742a5fce335c9f035f/src/rules/wf.rs
149-
150142
#### Coherence
151143

152144
The function `record_specialization_priorities` in the `coherence` module
153145
([source code][coherence-src]) checks "coherence", which means that it
154146
ensures that two impls of the same trait for the same type cannot exist.
155147

156-
[coherence-src]: https://github.com/rust-lang-nursery/chalk/blob/master/src/coherence.rs
157-
158148
### Solver ([chalk_solve])
159149

160150
Finally, when we've collected all the program clauses we care about, we want
@@ -166,10 +156,10 @@ queries is called the *solver*.
166156
## Crates
167157

168158
Chalk's functionality is broken up into the following crates:
169-
- [**chalk_engine**][doc-chalk-engine]: Defines the core [SLG solver][slg].
159+
- [**chalk_engine**][chalk_engine]: Defines the core [SLG solver][slg].
170160
- [**chalk_ir**][chalk_ir]: Defines chalk's internal representation of
171161
types, lifetimes, and goals.
172-
- [**chalk_solve**][doc-chalk-solve]: Combines `chalk_ir` and `chalk_engine`,
162+
- [**chalk_solve**][chalk_solve]: Combines `chalk_ir` and `chalk_engine`,
173163
effectively.
174164
- [`chalk_engine::context`][engine-context] provides the necessary hooks.
175165
- [**chalk_parse**][chalk_parse]: Defines the raw AST and a parser.
@@ -179,20 +169,9 @@ Chalk's functionality is broken up into the following crates:
179169
- `rust_ir::lowering`, which converts AST to `rust_ir`
180170
- `rules`, which implements logic rules converting `rust_ir` to `chalk_ir`
181171
- `coherence`, which implements coherence rules
182-
- Also includes [chalki][doc-chalki], chalk's REPL.
183-
184-
[Browse source on GitHub](https://github.com/rust-lang-nursery/chalk)
185-
186-
[engine-context]: https://rust-lang-nursery.github.io/chalk/doc/chalk_engine/context/index.html
172+
- Also includes [chalki][chalki], chalk's REPL.
187173

188-
[doc-chalk-engine]: https://rust-lang-nursery.github.io/chalk/doc/chalk_engine/index.html
189-
[chalk_ir]: https://rust-lang-nursery.github.io/chalk/doc/chalk_ir/index.html
190-
[doc-chalk-solve]: https://rust-lang-nursery.github.io/chalk/doc/chalk_solve/index.html
191-
[chalk_parse]: https://rust-lang-nursery.github.io/chalk/doc/chalk_parse/index.html
192-
[doc-chalk]: https://rust-lang-nursery.github.io/chalk/doc/chalk/index.html
193-
[rust_ir]: https://rust-lang-nursery.github.io/chalk/doc/chalk/rust_ir/index.html
194-
[rust_ir-program]: https://rust-lang-nursery.github.io/chalk/doc/chalk/rust_ir/struct.Program.html
195-
[doc-chalki]: https://rust-lang-nursery.github.io/chalk/doc/chalki/index.html
174+
[Browse source code on GitHub](https://github.com/rust-lang-nursery/chalk)
196175

197176
## Testing
198177

@@ -217,19 +196,37 @@ is the function that is ultimately called.
217196
* [Cyclic queries in chalk](http://smallcultfollowing.com/babysteps/blog/2017/09/12/tabling-handling-cyclic-queries-in-chalk/)
218197
* [An on-demand SLG solver for chalk](http://smallcultfollowing.com/babysteps/blog/2018/01/31/an-on-demand-slg-solver-for-chalk/)
219198

220-
[rustc-issues]: https://github.com/rust-lang-nursery/rustc-guide/issues
221-
[chalk]: https://github.com/rust-lang-nursery/chalk
222-
[lowering-to-logic]: ./lowering-to-logic.html
199+
[goals-and-clauses]: ./goals-and-clauses.html
200+
[HIR]: ../hir.html
201+
[lowering-forall]: ./lowering-to-logic.html#type-checking-generic-functions-beyond-horn-clauses
223202
[lowering-rules]: ./lowering-rules.html
203+
[lowering-to-logic]: ./lowering-to-logic.html
204+
[slg]: ./slg.html
224205
[wf-checking]: ./wf.html
206+
225207
[ast]: https://en.wikipedia.org/wiki/Abstract_syntax_tree
226-
[chalk-ast]: https://github.com/rust-lang-nursery/chalk/blob/master/chalk-parse/src/ast.rs
208+
[chalk]: https://github.com/rust-lang-nursery/chalk
209+
[rustc-issues]: https://github.com/rust-lang-nursery/rustc-guide/issues
227210
[universal quantification]: https://en.wikipedia.org/wiki/Universal_quantification
228-
[lowering-forall]: ./lowering-to-logic.html#type-checking-generic-functions-beyond-horn-clauses
211+
212+
[`ProgramClause`]: https://rust-lang-nursery.github.io/chalk/doc/chalk_ir/enum.ProgramClause.html
213+
[`ProgramEnvironment`]: https://rust-lang-nursery.github.io/chalk/doc/chalk_ir/struct.ProgramEnvironment.html
214+
[chalk_engine]: https://rust-lang-nursery.github.io/chalk/doc/chalk_engine/index.html
215+
[chalk_ir]: https://rust-lang-nursery.github.io/chalk/doc/chalk_ir/index.html
216+
[chalk_parse]: https://rust-lang-nursery.github.io/chalk/doc/chalk_parse/index.html
217+
[chalk_solve]: https://rust-lang-nursery.github.io/chalk/doc/chalk_solve/index.html
218+
[doc-chalk]: https://rust-lang-nursery.github.io/chalk/doc/chalk/index.html
219+
[engine-context]: https://rust-lang-nursery.github.io/chalk/doc/chalk_engine/context/index.html
220+
[rust_ir-program]: https://rust-lang-nursery.github.io/chalk/doc/chalk/rust_ir/struct.Program.html
221+
[rust_ir]: https://rust-lang-nursery.github.io/chalk/doc/chalk/rust_ir/index.html
222+
223+
[binders-struct]: https://github.com/rust-lang-nursery/chalk/blob/94a1941a021842a5fcb35cd043145c8faae59f08/src/ir.rs#L661
224+
[chalk-ast]: https://github.com/rust-lang-nursery/chalk/blob/master/chalk-parse/src/ast.rs
225+
[chalk-tests]: https://github.com/rust-lang-nursery/chalk/blob/4bce000801de31bf45c02f742a5fce335c9f035f/src/test.rs#L115
226+
[chalki]: https://rust-lang-nursery.github.io/chalk/doc/chalki/index.html
229227
[clause]: https://github.com/rust-lang-nursery/chalk/blob/master/GLOSSARY.md#clause
230-
[goals-and-clauses]: ./goals-and-clauses.html
228+
[coherence-src]: https://github.com/rust-lang-nursery/chalk/blob/master/src/coherence.rs
231229
[ir-code]: https://github.com/rust-lang-nursery/chalk/blob/master/src/rust_ir.rs
232-
[HIR]: ../hir.html
233-
[binders-struct]: https://github.com/rust-lang-nursery/chalk/blob/94a1941a021842a5fcb35cd043145c8faae59f08/src/ir.rs#L661
234230
[rules-environment]: https://github.com/rust-lang-nursery/chalk/blob/94a1941a021842a5fcb35cd043145c8faae59f08/src/rules.rs#L9
235-
[slg]: ./slg.html
231+
[rules-src]: https://github.com/rust-lang-nursery/chalk/blob/4bce000801de31bf45c02f742a5fce335c9f035f/src/rules.rs
232+
[rules-wf-src]: https://github.com/rust-lang-nursery/chalk/blob/4bce000801de31bf45c02f742a5fce335c9f035f/src/rules/wf.rs

0 commit comments

Comments
 (0)