Next: Trailing, Previous: Termination analysis, Up: Implementation-dependent extensions [Contents]
The Melbourne Mercury implementation supports a number of optional compilation model features, such as Trailing or Tabled evaluation. Feature sets allow the programmer to assert that a module requires the presence of one or more optional features in the compilation model. These assertions can be made using a ‘pragma require_feature_set’ declaration.
The ‘require_feature_set’ pragma declaration has the following form:
:- pragma require_feature_set(Features).
where Features is a (possibly empty) list of features.
The supported features are:
This specifies that the compilation model must support concurrent execution of multiple threads.
This specifies that the compilation model must use single precision floats. This feature cannot be specified together with the ‘double_prec_float’ feature.
This feature specifies tha the compilation model must use double precision floats. This feature cannot be specified together with the ‘single_prec_float’ feature.
This feature specifies that the compilation model must support memoisation (see Tabled evaluation).
This feature specifies that the compilation model must support parallel execution of conjunctions. This feature cannot be specified together with the ‘trailing’ feature.
This feature specifies that the compilation model must support trailing, see Trailing. This feature cannot be specified together with the ‘parallel_conj’ feature.
This feature specifies that a semantics that is equivalent to the strict sequential operational semantics must be used.
This feature specifies that a module requires conservative garbage collection. This feature is only checked when using the C backends; it is ignored by the non-C backends.
When a module containing a ‘pragma require_feature_set’ declaration is compiled, the implementation checks to see that the specified features are supported by the compilation model. It emits an error if they are not.
A ‘pragma require_feature_set’ may only occur in the implementation section of a module.
A ‘pragma require_feature_set’ affects only the module in which it occurs; in particular it does not affect any submodules.
If a module contains multiple ‘pragma require_feature_set’ declarations, then the implementation should emit an error if any of them specifies a feature that is not supported by the compilation model.
Next: Trailing, Previous: Termination analysis, Up: Implementation-dependent extensions [Contents]