The author considers the problem of constructing partial systems, where the program of a partial system is obtained by selecting only those code segments of the complete program that implement the capabilities needed. A heuristic for determining fragments of a program system, which can serve as the building blocks for the programs of partial systems, is presented. The notion of `B-program' is introduced: a B-program contains, in addition to the fragments themselves for each fragment, substitute code and control information specifying the set of partial systems the fragment is relevant for. A representation of B-programs as a string is given such that generating a partial system consists in scanning this string and selecting substrings. A formal model for this type of program generation is developed. B-program reduction is dealt with; transformations for the elimination of superfluous vertices are presented; and the issue of uniqueness and the problem of constructing a minimal reduced B-program are discussed.