Skip to content

Commit 426d5da

Browse files
committed
Document resolution uncrowding
1 parent f1bd405 commit 426d5da

3 files changed

Lines changed: 38 additions & 2 deletions

File tree

docs/src/SUMMARY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
- [Polyequality elaboration](./elaboration/polyeq.md)
88
- [Hole elaboration]()
99
- ["Local" elaboration](./elaboration/local.md)
10-
- [Resolution uncrowding]()
10+
- [Resolution uncrowding](./elaboration/uncrowding.md)
1111
- [Reordering elimination](./elaboration/reordering.md)
1212
- [Other features](./etc.md)
1313
- [Proof parsing/printing](./etc/parse.md)

docs/src/elaboration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ elaboration passes are:
1919
- [`polyeq`](./elaboration/polyeq.md)
2020
- [`lia-generic`]()
2121
- [`local`](./elaboration/local.md)
22-
- [`uncrowd`]()
22+
- [`uncrowd`](./elaboration/uncrowding.md)
2323
- [`reordering`](./elaboration/reordering.md)
2424
- [`hole`]()
2525

docs/src/elaboration/uncrowding.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Resolution uncrowding
2+
Besides [finding resolution pivots](./local.md#resolution-rule), Carcara is also able to refine
3+
`resolution` steps by _uncrowding_ them. This refers the process of making the implicit removal of
4+
duplicates explicit, by the addition of `contraction` steps.
5+
6+
More specifically, the `uncrowd` elaboration pass will find all spots in the resolution chain where
7+
a pivot is used to remove a duplicate literal. Then, it breaks the resolution chain at that point,
8+
and adds a contraction step. Consider, for example, the following proof:
9+
```
10+
(step t1 (cl a b) :rule hole)
11+
(step t2 (cl (not b) a) :rule hole)
12+
(step t3 (cl (not a)) :rule hole)
13+
(step t4 (cl) :rule resolution :premises (t1 t2 t3) :args (b true a true))
14+
```
15+
16+
Here, the `a` pivot is duplicated after resolving `t1` and `t2`, but is removed by the single `(not
17+
a)` literal in `t3`. After elaboration, the resulting proof will be:
18+
```
19+
(step t1 (cl a b) :rule hole)
20+
(step t2 (cl (not b) a) :rule hole)
21+
(step t3 (cl (not a)) :rule hole)
22+
(step t4.t1 (cl a a) :rule resolution :premises (t1 t2) :args (b true))
23+
(step t4.t2 (cl a) :rule contraction :premises (t4.t1))
24+
(step t4 (cl) :rule resolution :premises (t4.t2 t3) :args (a true))
25+
```
26+
27+
The resolution chain was broken after `t2`, with `t4.t1` containing the two duplicate `a` literals
28+
explicitly. Then, a contraction step was added (`t4.t2`) to deduplicate them. Finally, the
29+
resolution chain continues in `t4`, reaching the same conclusion.
30+
31+
Besides adding `contraction` steps, the uncrowding elaboration pass may also add a `reordering` step
32+
at the end of the resolution chain, to make any implicit reordering of clause literals explicit.
33+
34+
If the option `--uncrowd-rotate` is given, Carcara will try to further minimize the number of
35+
`contraction` steps added by reordering the resolution premises when possible, in an effort to make
36+
a single `contraction` step deduplicate multiple pivots.

0 commit comments

Comments
 (0)