| 50 |
50 |
% \type (\forall x^N . A) & := & \Nat \to \type(A)
|
| 51 |
51 |
\end{array}
|
| 52 |
52 |
\]
|
|
53 |
For a sorted tuple $(\vec u ; \vec x)$ we write $|(\vec u ; \vec x)|$ to denote its length, i.e.\ $|\vec u| + |\vec x|$.
|
| 53 |
54 |
% where $\nu$ designates that the inputs are normal.
|
| 54 |
55 |
\end{definition}
|
| 55 |
56 |
|
| ... | ... | |
| 66 |
67 |
This sorted tuple corresponds to the input variables, normal and safe, for the BC programs that we will define. It becomes important here that we are considering proofs of a convergence statement, since a free-cut free $\arith$-proof of a convergence statement cannot contain any $\lor$ symbols in the scope of a $!$. This could cause an issue in the above definition since we do not in general have the equivalence $!(A \lor B) \equiv !A \lor !B$. On the other hand, the equivalence $!(A\land B) \equiv !A \land !B$ follows since we are in the affine setting.
|
| 67 |
68 |
|
| 68 |
69 |
|
| 69 |
|
Let us fix a particular convergence statement for an equational specification $\eqspec$.
|
|
70 |
Let us fix a particular equational specification $\eqspec(f)$. Rather than directly considering $\arith$-proofs of $\conv ( f , \eqspec )$, we will consider a $\closure{\eqspec} \cup \arith $ sequent proof of $\word (\vec x) \seqar \word (f (\vec x) )$, under Lemma~\ref{lemma:spec-norm-form}.
|
| 70 |
71 |
|
|
72 |
Our crucial use of free-cut elimination is in the following result, which yields strong regularity properties:
|
| 71 |
73 |
|
|
74 |
\begin{proposition}
|
|
75 |
[Freedom]
|
|
76 |
A free-cut free $\closure{\eqspec} \cup \arith $ sequent proof of $\word (\vec x) \seqar \word (f (\vec x) )$ is:
|
|
77 |
\begin{enumerate}
|
|
78 |
\item Free of any negation symbols.
|
|
79 |
\item Free of any $\forall$ symbols.
|
|
80 |
\item Free of any $?$ symbols.
|
|
81 |
\end{enumerate}
|
|
82 |
\end{proposition}
|
|
83 |
|
|
84 |
|
|
85 |
For this reason we can assume that $\type$ is well-defined for all formulae occurring in a free-cut free proof of convergence, and so we can proceed with the translation from proofs to BC programs.
|
|
86 |
|
| 72 |
87 |
\begin{definition}
|
| 73 |
88 |
[Translation]
|
| 74 |
|
We give a translation of free-cut free $\Sigma^\nat_1$-$\pind \cup \Phi$ proofs $\pi$ of sequents $\Gamma(\vec a) \seqar \Delta(\vec a)$ to BC-programs for a vector of functions $\vec f^\pi$ with argument of type $\type \left(\bigotimes\Gamma\right)$ such that $|\vec f^\pi | = | \type\left(\bigparr\Delta\right)|$.
|
|
89 |
We give a translation from a free-cut free $\closure{\eqspec}$ proof $\pi$, containing no $\bot,?,\forall$ symbols, of a sequent $\Gamma \seqar \Delta$, to BC programs for a vector of functions $\vec f^\pi$ with argument of type $\type \left(\bigotimes\Gamma\right)$ such that $|\vec f^\pi | = | \type\left(\bigparr\Delta\right)|$.
|
| 75 |
90 |
|
| 76 |
91 |
|
| 77 |
92 |
The translation is by induction on the size of a free-cut free proof, so we proceed by analysis of the final step of a proof.
|
| 78 |
93 |
|
| 79 |
|
If $\pi$ is simply an axiom, we construct $\vec f^\pi$ as follows:
|
|
94 |
First we consider the base cases. If $\pi$ is an instance of the initial rules $\geneps, \sepeps^0 , \sepeps^1, \sepzer, \sepone$ or $\inj$ then $\vec f^\pi$ is simply the constant function $\epsilon$ (possibly with dummy inputs as required by $\type$).\footnote{This is because proofs of equality can be seen to carry no computational content.}
|
|
95 |
The other initial steps of $\arith$ are translated as follows:
|
| 80 |
96 |
\[
|
| 81 |
97 |
\begin{array}{ccc}
|
| 82 |
|
\vlinf{\natcntr}{}{\nat(t) \seqar \nat(t) \land \nat(t) }{}
|
| 83 |
|
& : &
|
| 84 |
|
( \id (;x) , \id (;x) )
|
| 85 |
|
\\
|
| 86 |
|
\vlinf{\nat_\epsilon}{}{\seqar \nat (\epsilon)}{}
|
| 87 |
|
& : &
|
| 88 |
|
\epsilon
|
| 89 |
|
\\
|
| 90 |
|
\vlinf{\nat_0}{}{\nat(t) \seqar \nat(\succ_0 t)}{}
|
| 91 |
|
& : &
|
|
98 |
% \vlinf{\nat_\epsilon}{}{\seqar \nat (\epsilon)}{}
|
|
99 |
% & : &
|
|
100 |
% \epsilon
|
|
101 |
% \\
|
|
102 |
\vlinf{\genzer}{}{\word(t) \seqar \word(\succ_0 t)}{}
|
|
103 |
& \quad :\quad &
|
| 92 |
104 |
\succ_0 ( ;x)
|
| 93 |
105 |
\\
|
| 94 |
|
\vlinf{\nat_1}{}{\nat(t) \seqar \nat(\succ_1 t)}{}
|
| 95 |
|
& : &
|
|
106 |
\vlinf{\genone}{}{\word(t) \seqar \word(\succ_1 t)}{}
|
|
107 |
& \quad : \quad &
|
| 96 |
108 |
\succ_1 (; x)
|
| 97 |
109 |
\\
|
| 98 |
|
\vlinf{\epsilon^0}{}{ \nat (t) , \epsilon = \succ_0 t \seqar }{}
|
| 99 |
|
& : &
|
| 100 |
|
\epsilon
|
|
110 |
% \vlinf{\epsilon^0}{}{ \nat (t) , \epsilon = \succ_0 t \seqar }{}
|
|
111 |
% & : &
|
|
112 |
% \epsilon
|
|
113 |
% \\
|
|
114 |
% \vlinf{\epsilon^1}{}{ \nat (t) , \epsilon = \succ_1 t \seqar }{}
|
|
115 |
% & : &
|
|
116 |
% \epsilon
|
|
117 |
% \\
|
|
118 |
% \vlinf{\succ_0}{}{\nat (s) , \nat (t) , \succ_0 s = \succ_0 t\seqar s = t }{}
|
|
119 |
% & : &
|
|
120 |
% \epsilon
|
|
121 |
% \\
|
|
122 |
% \vlinf{\succ_1}{}{\nat (s) , \nat (t) , \succ_1 s = \succ_1 t\seqar s = t }{}
|
|
123 |
% & : &
|
|
124 |
% \epsilon
|
|
125 |
% \\
|
|
126 |
% \vlinf{\inj}{}{\nat(t), \succ_0 t = \succ_1 t \seqar}{}
|
|
127 |
% & : &
|
|
128 |
% \epsilon
|
|
129 |
% \\
|
|
130 |
\vlinf{\surj}{}{\word (t) \seqar t = \epsilon \laor \exists y^\word . t = \succ_0 y \laor \exists y^\word. t = \succ_1 y }{}
|
|
131 |
&\quad : \quad &
|
|
132 |
( \epsilon , \pred ( ;x) , \pred (;x ) )
|
| 101 |
133 |
\\
|
| 102 |
|
\vlinf{\epsilon^1}{}{ \nat (t) , \epsilon = \succ_1 t \seqar }{}
|
| 103 |
|
& : &
|
| 104 |
|
\epsilon
|
| 105 |
|
\\
|
| 106 |
|
\vlinf{\succ_0}{}{\nat (s) , \nat (t) , \succ_0 s = \succ_0 t\seqar s = t }{}
|
| 107 |
|
& : &
|
| 108 |
|
\epsilon
|
| 109 |
|
\\
|
| 110 |
|
\vlinf{\succ_1}{}{\nat (s) , \nat (t) , \succ_1 s = \succ_1 t\seqar s = t }{}
|
| 111 |
|
& : &
|
| 112 |
|
\epsilon
|
| 113 |
|
\\
|
| 114 |
|
\vlinf{\inj}{}{\nat(t), \succ_0 t = \succ_1 t \seqar}{}
|
| 115 |
|
& : &
|
| 116 |
|
\epsilon
|
| 117 |
|
\\
|
| 118 |
|
\vlinf{\surj}{}{\nat (t) \seqar t = \epsilon , \exists y^\nat . t = \succ_0 y , \exists y^\nat . t = \succ_1 y }{}
|
| 119 |
|
&: &
|
| 120 |
|
( \epsilon , \pred ( ;x) , \pred (;x ) )
|
|
134 |
\vlinf{\wordcntr}{}{\word(t) \seqar \word(t) \land \word(t) }{}
|
|
135 |
& \quad : \quad &
|
|
136 |
( \id (;x) , \id (;x) )
|
| 121 |
137 |
\end{array}
|
| 122 |
138 |
\]
|
|
139 |
Finally an $\closure{\eqspec}$ initial step is also translated simply to $\epsilon$.
|
| 123 |
140 |
|
| 124 |
|
\anupam{axioms which are true and contain no computational information currently interpreted as constant $\epsilon$. Check this/typing again to make sure plays nice.}
|
| 125 |
|
\anupam{check $\surj$.}
|
|
141 |
|
| 126 |
142 |
|
| 127 |
143 |
|
|
144 |
Now we consider the inductive cases.
|
| 128 |
145 |
Suppose $\pi$ ends with a $\rigrul{\land}$ step:
|
| 129 |
146 |
\[
|
| 130 |
147 |
\vlderivation{
|