We take the supremum of chain lengths if no maximal chain can be found. For example, in the ring (Z/8Z)[x,y,z] we can consider the chain
- (2) ⊂ (2,x) ⊂ (2,x,y) ⊂ (2,x,y,z)
Each of these ideals is prime, so the Krull dimension of (Z/8Z)[x, y, z] is at least the number of strict inclusions in this chain, that is, 3. In fact the dimension of this ring is exactly 3.
An alternate way of phrasing this definition is to say that the Krull dimension of R is the largest height of any prime ideal of R.