PAIRED_BETA_CONV : conv
<vs> ::= (v1,v2) | (<vs>,v) | (v,<vs>) | (<vs>,<vs>)where v, v1, and v2 range over variables. A tupled beta-redex is an application of the form "(\<vs>.tm) t", where the term "t" is a nested tuple of values having the same structure as the varstruct <vs>. For example, the term:
"(\((a,b),(c,d)). a + b + c + d) ((1,2),(3,4))"is a tupled beta-redex, but the term:
"(\((a,b),(c,d)). a + b + c + d) ((1,2),p)"is not, since p is not a pair of terms.
Given a tupled beta-redex "(\<vs>.tm) t", the conversion PAIRED_BETA_CONV
performs generalized beta-reduction and returns the theorem
|- (\<vs>.tm) t = t[t1,...,tn/v1,...,vn]
where ti is the subterm of the tuple t that corresponds to
the variable vi in the varstruct <vs>. In the simplest case, the
varstruct <vs> is flat, as in the term:
"(\(v1,...,vn).t) (t1,...,tn)"
When applied to a term of this form, PAIRED_BETA_CONV returns:
|- (\(v1, ... ,vn).t) (t1, ... ,tn) = t[t1,...,tn/v1,...,vn]
As with ordinary beta-conversion, bound variables may be renamed to
prevent free variable capture. That is, the term t[t1,...,tn/v1,...,vn] in
this theorem is the result of substituting ti for vi in parallel in t,
with suitable renaming of variables to prevent free variables in t1, ...,
tn becoming bound in the result.
#PAIRED_BETA_CONV "(\((a,b),(c,d)). a + b + c + d) ((1,2),(3,4))";; |- (\((a,b),c,d). a + (b + (c + d)))((1,2),3,4) = 1 + (2 + (3 + 4))Note that the term to which the tupled lambda abstraction is applied must have the same structure as the varstruct. For example, the following succeeds:
#PAIRED_BETA_CONV "(\((a,b),p). a + b) ((1,2),(3+5,4))";; |- (\((a,b),p). a + b)((1,2),3 + 5,4) = 1 + 2but the following call to PAIRED_BETA_CONV fails:
#PAIRED_BETA_CONV "(\((a,b),(c,d)). a + b + c + d) ((1,2),p)";; evaluation failed PAIRED_BETA_CONVbecause p is not a pair.