declare fun lazy {LFilter Xs Pred} case Xs of nil then nil [] X|Xr then if {Pred X} then X|{LFilter Xr Pred} else {LFilter Xr Pred} end end end