.TH Image .PP Extend the left operand with a new relation\-valued attribute, image of the tuple in the right relation. .SH Signature .PP .RS .nf image(left: Relation, right: Relation, as: AttrName) \-> Relation .fi .RE .SH Examples .PP .RS .nf image(suppliers, supplies, :supplying) .fi .RE .SH Description .PP This operator extends each tuple of the left operand, say \fB\fCt\fR, with a new attribute called \fB\fCas\fR\&. The latter is a relation\-valued attribute, and is the image of \fB\fCt\fR with respect to the right relation. The image is defined as a restriction\-projection: restriction on tuples that match \fB\fCt\fR and projection on all but common attributes between left and right. .PP In other words, this operator is a shortcut for the following longer expression: .PP .RS .nf def image(left, right, as) extend(left, as => \->(t){ allbut( matching(right, .BR Relation (t)), left.attr_list & right.attr_list) }) end image(suppliers, supplies, :supplying) .fi .RE .PP Note that the image operator is such that every tuple of the left operand appears in the result, including those whose image is empty on right. As expected, an empty relation of correct relation type is used for those. .SH Implementation notes .PP As of current Alf version, the current SQL compilation is not optimal and partly relies on in\-memory operations. Please check the compilation plans.