induction lsa; intuition; simpl.
fcf_inline_first.
fcf_simp.
rewrite app_nil_r.
fcf_spec_ret.
fcf_inline_first.
fcf_skip.
eapply comp_spec_eq_trans.
eapply IHlsa.
fcf_inline_first.
fcf_skip.
fcf_inline_first.
fcf_simp.
rewrite <- app_assoc.
simpl.
fcf_spec_ret.
Qed.

(* Specifications: *)
Theorem compFold_oc_equiv :
forall (A B S : Set)(eqdb : EqDec B)(eqds : EqDec S)(O : S -> A -> Comp (B * S))(lsa : list A)(initS : S),
comp_spec eq
(compFold _
(fun (acc : list B * S) (d : A) =>
[rs, s]<-2 acc; z <-$ O s d; [r, s0]<-2 z; ret (rs ++ r :: nil, s0))
(nil, initS) lsa)
((oc_compMap _ (fun a : A => query a) lsa) S _ O initS).