Preamble and Definitions
This document is written as a series of requirements on an implementation that is a programming language, supported by system libraries and a relational database manager. Nothing here should be taken to mandate any particular design or exclude any approach or prohibit any additional capabilities beyond what is explicitly stated.
Terms that have particular meanings are underlined at the point where they are defined, or where first used if not defined.
A requirement for something in the singular or plural should generally be read to mean either, to avoid having such qualifications appear repeatedly in the text.
The terms type, value, variable and operator are of particular significance as core concepts and the foundations of the language. Definitions are provided below, but the concepts should already be familiar.
A type is a named and non-empty set of values. Types with different names are different types. Any type may form the basis for defining any variable, component, attribute, argument or operator as set out below.
Every type is a scalar type or a non-scalar type. A non-scalar type is a tuple or relation type. A scalar type is any other type.
An ordered type is one for which a total ordering is defined.
An operator is a named entity that may be invoked to perform an operation. Operators have parameters, are invoked with arguments, may update variables and may return a value as a result.
Note: The term operator is intended to be inclusive of operators, procedures, functions and subroutines as found in other languages.
A parameter is a name by which an operator refers to an argument passed to it.
An argument is a value or a reference to a variable that is provided to an operator when it is invoked. It takes the syntactical form of a literal, an expression, or a symbol denoting a variable.
A variable is a named entity that holds a value, which may vary during the course of a program. It has a declared type and always contains a value of that type. Every access to the value of a variable returns a value of its type.
Assignment means setting a variable to a value by means of an update operator.
Note: Assignment and update are largely interchangeable terms.
Pseudo-variable assignment means a syntactic form similar to an assignment where the target is not a variable.
A statement is some minimal unit of program execution that results in a change in program or database state and can execute atomically. Atomic means that it either executes in its entirety or not at all.
An expression is a syntactic form that includes operators and values and when evaluated produces a value as a result.
A literal is a symbol or sequence of symbols that denotes a constant value, which is known at compile time.
Built-in means that something is provided as a standard part of the implementation. User-defined means that it is defined using means provided by the implementation.