Validation in the Build Process

Validation occurs at the beginning of the build process, any errors that are found during this validation are added to the error list. If any errors occur, the error list will open automatically at the end of the build.

Validation done during the build process includes:

Namespace Validation

  1. The only objects in the NamespaceObjects namespace should be object definitions that define namespaces.
  2. Objects that define a namespace shouldn't have more than one parameter. Most namespaces don't have any parameters. The Data namespace takes one parameters (which must be a namespace) and is used when we need to manipulate terms in expressions that would normally be executable. See Namespace Objects for more details.
  3. Objects that define a namespace should always have the Namespace type. The Data namespace has type NamespaceNamespace.
  4. Objects that define a namespace shouldn't have extensions.

Built-in Function Validation

Objects that are built in functions shouldn't have clauses or extensions.

Type Function Validation

For the Subtypes function, we validate the following:

  1. Each clause must be a subtype expression.
  2. Both parmeters of the subtype expression have to be explicit types. Types that have parameters (Set[U] for example) can contain variables, but expressions like "TypeA subtype U" are not valid.
  3. The validator tests for circular subtype relationships and generates errors if any are found.
  4. "To" objects are not allowed in the subtype expressions. Expression like "TypeA → TypeB subtype TypeC" or "TypeA → TypeB subtype TypeC → TypeD" are not valid.

Command Validation

The command validator does the following:
  1. Generate warnings if more than one command uses the same keystroke.
  2. Tests that the type definitions of the functions assigned to the command are valid. See the section Functions Executed by Commands for details.

Object Definition Validation

Check for duplicate object definitions (same name, same type in the same library or in different libraries if there are no clauses). Generate warnings.

  1. If the expression isn't a valid object definition, then add an error message and ignore the object.
  2. An error message will be generated for any type definitions that has a TypeList parameter and additional parameters.