  In this paper, we define lower dimensional volumes associated to sub-Dirac
operators for foliations. In some cases, we compute these lower dimensional
volumes. We also prove the Kastler-Kalau-Walze type theorems for foliations
with or without boundary. As a corollary, we give an explanation of the
gravitational action for the Robertson-Walker space $[a, b]\times_{f}M^{3}$.
