%%% Mapping CLS computations to evaluations. %%% This expresses the soundness proof for the CLS machine. %%% Author: Frank Pfenning, based on [Hannan & Pfenning 92] %%% The postfix ordering for computations. %%% This is ordering is well-founded. < : (st KS1 P1 S1) =>* (st KS P S) -> (st KS2 P2 S2) =>* (st KS P S) -> type. %infix none 8 <. %mode < +C +C'. sub_imm : C < R ~ C. sub_med : C < C' -> C < R ~ C'. %{ Lemma: The postfix relation on computations is transitive: For every R1 :: C1 < C2 and R2 :: C2 < C3 there exists an R3 :: C1 < C3. Proof: By induction on the structure of R2. }% trans* : C1 < C2 -> C2 < C3 -> C1 < C3 -> type. %mode trans* +R1 +R2 -R3. trans*_imm : trans* R1 (sub_imm) (sub_med R1). trans*_med : trans* R1 (sub_med R2) (sub_med R3) <- trans* R1 R2 R3. %{ Splitting Lemma: If C :: (st (KS ;; K) (ev F & P) S) =>* (st (emptys) (done) (empty ; W')) then there exists a value W, an evaluation D :: feval K F W and a computation C' :: (st KS P (S ; W)) =>* (st (emptys) (done) (empty ; W')) such that C' < C. Proof: By complete induction on C. }% spl : {C : (st (KS ;; K) (ev F & P) S) =>* (st (emptys) (done) (empty ; W'))} feval K F W -> {C' : (st KS P (S ; W)) =>* (st (emptys) (done) (empty ; W'))} C' < C -> type. %mode spl +C -D -C' -C' feval K F W -> type. %mode cls_sound +CE -D. clss : cls_sound (run C) D <- spl C D (id) Id