Sortal Description Language   Index

 

Variables

Sorts are referenced by name. Individuals and forms, on the other hand, can be assigned to variables. In fact, when an individual is defined, unless it is defined as part of a form, it must be assigned to a variable. The same applies to forms; unless a form is defined as part of a metaform, or as an attribute form to an individual, it must be assigned to a variable.

  • Variables serve to store and retrieve forms and individuals.
  • Variables are typed to contain either a form or an individual.
  • Variable names are identifiers and preceded by a dollar sign ($).
  • A variable is (re)declared when it is assigned a value (a form or individual).

Variables (and forms) can be combined through operations of sum, difference, product and symmetric difference, corresponding the behavior of forms for the sort these belong to. More on the behavior of forms

  • The operation of sum (+) combines two forms.
  • The operation of difference (-) subtracts one form from another.
  • The operation of product (*) intersects two forms.
  • The operation of symmetric difference (%) results in the sum of the respective differences, or in the difference of the sum and the product.
ind $variable-name = ind-assignment ;
form $variable-name assignment-op form-assignment ;

variable-name		    identifier

assignment-op		    =
			    +=
			    -=
			    *=
			    %=

ind-assignment		    sort-name : ind-specification
			    sort-name : # reference-key ind-specification

form-assignment		    sort-name : form-specification
			    ( sort-expression ) : form-specification
			    sort-name : metaform-specification
			    ( sort-expression ) : metaform-specification

The terms sort-name and sort-expression are defined in the Sorts section.
The terms ind-specification is defined in the Individuals section.

A variable can be used in the specification of a form. Its value then defines the collection of individuals that constitute this form. In case the variable is of type ind, its value will constitute the single individual in the form.

form-specification	    { }
			    { individuals }
			    { individuals } form-operator form-specification
			    $variable-name
			    $variable-name form-operator form-specification

metaform-specification	    { }
			    { forms }
			    { forms } form-operator metaform-specification
			    $variable-name
			    $variable-name form-operator metaform-specification

form-operator		    +
			    -
			    *
			    %

The terms form-specification and metaform-specification are more narrowly defined in the Forms section.

 

Examples


	
 
 
 

Last update: 6 July 2012, webmaster @ sortal.org