Linear discrete time systems over commutative rings