Feature-oriented programming or feature-oriented software development (FOSD) is a general paradigm for program synthesis in software product lines. The feature-oriented programming page is recommended, it explains how an FOSD model of a domain is a tuple of 0-ary functions (called values) and a set of 1-ary (unary) functions called features. This page discusses multidimensional generalizations of FOSD models, which are important for compact specifications of complex programs.
A fundamental generalization of metamodels is origami. The essential idea is that a program's design need not be represented by a single expression; multiple expressions can be used. This involves the use of multiple orthogonal GenVoca models.
E = Dâ¢Hâ¢P -- tool equation E = Sâ¢B -- language equation
Let U=[U<sub>1</sub>,U<sub>2</sub>,...,U<sub>n</sub>] be a GenVoca model of n features, and W=[W<sub>1</sub>,...W<sub>m</sub>] be a GenVoca model of m features. The relationship between two orthogonal models U and W is a matrix UW, called an Origami matrix, where each row corresponds to a feature in U and each column corresponds to a feature in W. Entry UW<sub>ij</sub> is a function that implements the combination of features U<sub>i</sub> and W<sub>j</sub>.
To see how multiple equations are used to synthesize a program, again consider models U and W. A program F is described by two equations, one per model. We can write an equation for F in two different ways: referencing features by name or by their index position, such as:
The UW model defines how models U and W are implemented. Synthesizing program F involves projecting UW of unneeded columns and rows, and aggregating (a.k.a. tensor contraction):
A fundamental property of origami matrices, called orthogonality, is that the order in which dimensions are contracted does not matter. In the above equation, summing across the U dimension (index i) first or the W dimension (index j) first does not matter. Of course, orthogonality is a property that must be verified. Efficient (linear) algorithms have been developed to verify that origami matrices (or tensors/n-dimensional arrays) are orthogonal. The significance of orthogonality is one of view consistency. Aggregating (contracting) along a particular dimension offers a 'view' of a program. Different views should be consistent: if one repairs the program's code in one view (or proves properties about a program in one view), the correctness of those repairs or properties should hold in all views.
In general, a product of a product line may be represented by n expressions, from n orthogonal and abstract GenVoca models G<sub>1</sub> ... G<sub>n</sub>. The Origami matrix (or cube or tensor) is an n-dimensional array A:
A product H of this product line is formed by eliminating unnecessary rows, columns, etc. from A, and aggregating (contracting) the n-cube into a scalar:
There are several of product line applications developed using Origami. Among them include:
More applications to be supplied.