@@ -10,11 +10,11 @@ fn(Goal) -> Solution
10
10
where the Goal is some [ canonical goal] ( ./canonical_queries.md ) and
11
11
the Solution is a result like:
12
12
13
- * Provable(S): meaning the goal is provable and it is provably exactly (and only
14
- for the substitution S. S is a set of values for the inference variables that
15
- appear in the goal. So if we had a goal like ` Vec<?X>: Foo ` , and we returned
16
- ` Provable(?X = u32) ` , it would mean that only ` Vec<u32>: Foo ` and not any
17
- other sort of vector (e.g., ` Vec<u64>: Foo ` does not hold).
13
+ * Provable(S): meaning the goal is provable and it is provably exactly (and
14
+ only) for the substitution S. S is a set of values for the inference variables
15
+ that appear in the goal. So if we had a goal like ` Vec<?X>: Foo ` , and we
16
+ returned ` Provable(?X = u32) ` , it would mean that only ` Vec<u32>: Foo ` and not
17
+ any other sort of vector (e.g., ` Vec<u64>: Foo ` does not hold).
18
18
* Ambiguous(S): meaning that we can't prove whether or not the goal is true.
19
19
This can sometimes come with a substitution S, which offers suggested values
20
20
for the inference variables that might make it provable.
@@ -40,20 +40,20 @@ Implemented(u32: A)
40
40
Implemented(i32: A)
41
41
```
42
42
43
- Now , suppose that we have a goal like ` Implemented(Vec<f32 >: A) ` . This would
43
+ First , suppose that we have a goal like ` Implemented(Vec<u64 >: A) ` . This would
44
44
proceed like so:
45
45
46
- * ` Solve(Implemented(Vec<f32 >: A)) `
47
- * ` Solve(Implemented(f32 : A)) `
46
+ * ` Solve(Implemented(Vec<u64 >: A)) `
47
+ * ` Solve(Implemented(u64 : A)) `
48
48
* returns ` Error `
49
49
* returns ` Error `
50
50
51
51
In other words, the recursive solver would start by applying the first rule,
52
- which would cause us recursively try to solve ` Implemented(f32 : A) ` . This would
52
+ which would cause us recursively try to solve ` Implemented(u64 : A) ` . This would
53
53
yield an Error result, because there are no applicable rules, and that error
54
- would propagae back up, causing the entire attempt at proving things to fail.
54
+ would propagate back up, causing the entire attempt at proving things to fail.
55
55
56
- Now consider ` Implemented(Vec<u32>: A) ` . This would proceed like so:
56
+ Next, consider ` Implemented(Vec<u32>: A) ` . This would proceed like so:
57
57
58
58
* ` Solve(Implemented(Vec<u32>: A)) `
59
59
* ` Solve(Implemented(u32: A)) `
@@ -90,8 +90,8 @@ In the recursive solver, with a goal of `Implemented(Vec<?X>: A)`, we
90
90
recursively try to prove ` Implemented(?X: A) ` and get ambiguity, and we get
91
91
stuck there.
92
92
93
- The SLG solver in contrast starts by exploring ` ?X = u32 ` and finds
93
+ The [ SLG solver] in contrast starts by exploring ` ?X = u32 ` and finds
94
94
that it works, and then later tries to explore ` ?X = i32 ` and finds that it
95
95
fails (because ` i32: B ` is not true).
96
96
97
- [ slg solver] : ./engine.md
97
+ [ SLG solver] : ./engine.md
0 commit comments