|
| 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