  Let $P$ be a finite poset. Let $L:=J(P)$ denote the lattice of order ideals
of $P$. Let $b_i(L)$ denote the number of Boolean intervals of $L$ of rank $i$.
We construct a simple graph $G(P)$ from our poset $P$. Denote by $f_i(P)$ the
number of the cliques $K_{i+1}$, contained in the graph $G(P)$. Our main
results are some linear equations connecting the numbers $f_i(P)$ and $b_i(L)$.
We reprove the Dehn--Sommerville equations for simplicial polytopes. In our
proof we use free resolutions and the theory of Stanley--Reisner rings.
