-
Notifications
You must be signed in to change notification settings - Fork 41
Add documentation #203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add documentation #203
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -64,8 +64,21 @@ judgment_fn! { | |
| (prove_eq(decls, env, assumptions, Variable::ExistentialVar(v), r) => c) | ||
| ) | ||
|
|
||
| // Example: we are trying to prove `x` (which equals `<SomeX<?V> as Iterator>::Item`) | ||
| // is equal to some type `z`. | ||
| ( | ||
| // Normalize `x` will find alternative "spellings" that it is equivalent to. | ||
|
||
| // For example, if there is an impl like | ||
| // `impl Iterator for SomeX<i32> { type Item = u32; ... }` | ||
| // then `prove_normalize` would yield `(c, u32)` where `c` are any constraints | ||
| // needed to show that it normalized (in this case, `c` would include the | ||
| // substitution `?V = i32`). | ||
| (prove_normalize(&decls, env, &assumptions, &x) => (c, y)) | ||
|
|
||
| // Now that we know that `x` is equivalent to `y`, we try to prove | ||
| // that `y` is equivalent to `z` (our original goal). | ||
| // We do that with `prove_after` so that the constraints `c` are considered | ||
| // (e.g., if `z` includes `?V`, it will be replaced with `i32`). | ||
| (prove_after(&decls, c, &assumptions, eq(y, &z)) => c) | ||
| ----------------------------- ("normalize-l") | ||
| (prove_eq(decls, env, assumptions, x, z) => c) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this example is not fully general. I think another important part is that the instantiated trait method where-clauses imply the impl method where-clauses