This rule already appears in elaborated proofs output by Carcara.
@bandreotti writes:
bind_let: Akin to "congruence for lets"
This rule (or an alternative formulation that Carcara can use instead) should be added to the standard. @bandreotti has more information about the formal description of the rule.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items
0
Show closed items
No child items are currently assigned. Use child items to break down this issue into smaller parts.
Linked items
0
Link issues together to show that they're related or that one is blocking others.
Learn more.
This rule is necessary for elaboration in Carcara when we are removing the implicit reordering of equalities. For instance, consider the case where in the SMT-LIB problem file we have (assert (let ((x 1)) (= x 0))), but in the Alethe proof we have (assume h1 (let ((x 1)) (= 0 x))) (note how the equality (= x 0) was implicitly flipped). To make this transformation explicit, we would need to show that the two let terms are equivalent, and we do this by first showing that the inner terms are equal, and then using bind_let to wrap them in a let binder:
Carcara also has to handle the case where implicit equality reordering is applied to the variable values in the let binding. In this case, we add steps inside the subproof to show that the two values are equivalent, and then pass these steps as premises to the bind_let step. Here is an example, in which step t1.t1 is used to show that the two different values for the bound variable x are equivalent:
While of course we don't need a rule with this exact semantics to be added to the specification, it would be good if the rule that is eventually added is powerful enough to model this.
Question here: shouldn't t1.t1 come before the anchor? if it's conclusion contains a variable bound by the let it should be handled by the context of the let itself, but by the surrounding context.
This is not right, because the semantics of let is that it is parallel, i.e., it defines a simultaneous substitution. Therefore if there is a variable in the RHS of a let assignment, that variable must be bound from outside the let (see page 29 of the standard). So I agree with @hjsc that the steps relative to rewriting the RHS of the assignments should be done outside the anchor with the variables of the LHS of the assignments.
Ah, I see, I was confused about the let semantics. In this case I agree, these steps should be outside the anchor. I will change Carcara to use this rule correctly.