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 metaform is a collection of forms in accordance to a disjunctive sort.
  • An attribute form is a form, or metaform, that is assigned as an attribute to another individual, in accordance to an attribute sort.

A form is completely specified by its sort and its collection of individuals (or in the case of a metaform, its collection of forms).

  • The specification of the sort is optional only if it can be derived from the context, that is, when a form is specified as an attribute form to an individual. In case the sort is specified by an expression, the expression must be enclosed within parentheses.
  • The collection of individuals or forms is specified as a list enclosed within curly brackets ({}).
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.
The terms individual is defined in the Individuals section.
The terms form-specification and metaform-specification are more broadly defined in the Variables 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