
The name SAPI is an abbreviation of 'structure analysis programs with intelligent control'. It may also be read inversely as 'Institute of Physics, Academia Sinica'. SAPI is based on MULTANSO, but differs from it by a number of features. These will be described in a series of papers. The present paper describes an algorithm which can distinguish superstructures from ordinary structures by automatically discovering the pseudo-systematic extinction rule in reciprocal space. This algorithm enables SAPI to handle superstructures in a fully automatic way, leading to a complete solution in favourable cases.