Sortal Description Language | Index | |
Forms A form is a collection of one or more individuals from the same sort, e.g., a collection of points defines a form of the sort of points. Forms can be collected into metaforms or assigned as an attribute form to another individual.
A form is completely specified by its sort and its collection of individuals (or in the case of a metaform, its collection of forms).
form metaform no-metaform metaform metaform-specification sort-name : metaform-specification ( sort-expression ) : metaform-specification metaform-specification { } { forms } forms no-metaform no-metaform , forms no-metaform form-specification sort-name : form-specification ( sort-expression ) : form-specification form-specification { } { individuals } individuals individual individual form individual , individuals individual form , individuals The terms sort-name and sort-expression are defined in the Sorts section.
Examples points : { } // An empty collection of points labels : { "wall", "door", "window" } // A collection of labels points_and_labels: { (labels ^ has_points): { #my-labels-1 "origin" { my-points-1 } }, (points ^ has_labels): { #my-points-1 (0,0,0) { my-labels-1 } } }; // A collection of a point and a label, with a property // relationship between both. That is, the label has // (a reference to) the point as a property and the // point has (a reference to) the label as a property. functions_on_lines : { sum(lines.length) = 2.704163456597992 { <(0,0,0), 3/4(2,3,0)> } } // A function specified over (a form of) a line segment. // The function retrieves the length of this segment (i.e., // the value of the class method with the same name), // and sums it with other line segments' lengths, if any. // The function's value is the result of this calculation. |
||
Last update: 6 July 2012, webmaster @ sortal.org |
||