Calculation of invariants of programs interpreted over an integrality domain