|
| 1 | +# Reordering elimination |
| 2 | +For many use cases of Alethe like proof translation or reconstruction in proof assistants, clause |
| 3 | +reordering steps can be challenging to deal with. With that in mind, Carcara has an elaboration step |
| 4 | +that can completely remove all `reordering` steps from a proof. |
| 5 | + |
| 6 | +This is done by replacing the `reordering` step with its premise and, anytime it is used as a |
| 7 | +premise in another step, recomputing the clause of the step that used it. As an exmple, consider the |
| 8 | +following proof: |
| 9 | +``` |
| 10 | +(step t1 (cl a b c) :rule hole) |
| 11 | +(step t2 (cl b a c) :rule reordering :premises (t1)) |
| 12 | +(step t3 (cl b a c d) :rule weakening :premises (t2)) |
| 13 | +``` |
| 14 | +Here, step `t2` will be eliminated, such that step `t3` uses `t1` directly as its premise. However, |
| 15 | +simply changing the premise clause of step `t4` would make it invalid[^1]. To avoid this, Carcara |
| 16 | +must also recompute the conclusion of `t3`, resulting in the following proof: |
| 17 | +``` |
| 18 | +(step t1 (cl a b c) :rule hole) |
| 19 | +(step t3 (cl a b c d) :rule weakening :premises (t1)) |
| 20 | +``` |
| 21 | +Of course, if any step further down in the proof uses `t3` as a premise, it will also need to |
| 22 | +be recomputed, and these changes will propagate down the proof. |
| 23 | + |
| 24 | +[^1]: Strictly speaking, the step would not be invalid according to the semantics of Alethe, which |
| 25 | +are entirely agnostic to clause ordering. However, when elaborating a proof, we aim to ensure a more |
| 26 | +strict semantics, in which clause ordering is maitained in rules such as `weakening`. |
0 commit comments