The POGenerator automatically invokes the Analyser for a construct which has not been analysed. Thus for a newly-introduced MACHINE, REFINEMENT or IMPLEMENTATION only the Editor, Analyser and POGenerator options are available.
The Analyser (anl) is invoked from the Main Environment, and is applicable to all specifications, refinements and implementations not currently analysed.
Analysis comprises three distinct phases: normalisation, syntax-checking and type-checking. The Normaliser produces an internal form -- the analysed form -- for the construct, expanding subordinate constructs where necessary. The SyntaxChecker performs syntactic checks on the construct, and the TypeChecker performs checks for type correctness.
If the Analyser succeeds, an internal form of the construct is created and stored in the directory ANL, and a summary of the type information (in internal form) is placed in a ``Type File'' in the TYP directory, for use by the other tools.
The dependencies between parent and subordinate constructs are built up and recorded by the Analyser. Any record of such a dependency will be removed when the parent or one of its subordinates has been edited such that the mathematical content is changed, and the change committed (by one of the Commit, Close or Remake tools); the parent's analysed form (and all subsequent processing on the construct) will also be lost (although it may be automatically reconstructed using the Remake tool).
If an error is detected during analysis then the MiniRemake option is offered.
A by-product of Analysis is the creation of a hypertext file for the analysed construct, containing links to all subordinate constructs.
If a subordinate construct is configured but not currently analysed, the subordinate construct will first be analysed; this process is recursive.
If a subordinate construct is not configured, the Normaliser will search first in the SLIB directory (taking account of any `dot rename' prefixes), and then the SRC directory; if found, it will first be introduced and then analysed.
If the above search is not successful, the Normaliser will check to see whether the subconstruct is generated from an ENUMERATION; if the appropriate enumeration is configured, it will be generated. If the enumeration is not configured but exists in the SRC directory, it is first committed and the the machine generated.
For example:
if cc is a constant and if CSET is a given set and the PROPERTIES clause contains
then cc is given type POW(CSET)
then cc is given type NAT
then cc is given type POW(NAT*CSET)
then aa is given type POW(ASET)
then bb is given the same type as cc
then rel is given type POW(ASET*CSET)
An error is reported if a type of a variable cannot be determined.
Often the error is due to an inconsistent use of externally defined variables or operations. The Find facility will provide the type of those externally defined variables or operations.