Predicate Sealing

Classification
Enhancement

Discrepancy

The ISO standard requires the existence of a multi-file directive. But it leaves open how such a directive is implemented. To allow separate compilation we only allow predicate attribute transitions from undefined to defined, and we warn so that for multi-file predicates different Prolog text mentions repeat all the predicate attributes.

We also apply this approach to syntax operators. As a side effect the level or mode of a syntax operator cannot be changed when it has been set once without first abolishing it. The same holds for example for the comma operator (‘,’) as well, but the error message is different than what has recently been defined by the ISO standard.

To prevent the end-user from modifying non-user predicates we have devised the more general rule that non-multi-file predicates cannot be modified in multiple Prolog texts. Again the error message is different than what has recently been defined by the ISO standard.

Integration / Elimination

We value the different error messages as non-severe. They express the different first principles that cause the same test cases to fail as the ISO standard requires.

On the other hand in our implementation the end-user is less free to modify attributes of syntax operators and predicates. Further in our implementation the end-user is forced to mark a predicate as multi-file if he wants to add clauses from within different Prolog texts.

Failed Test Cases

ISO 8.14.3.4, ISO 4
Corr.2 6.3.4.3, ISO 3
ISO 8.9.1.4, ISO 7
ISO 8.9.2.4, ISO 7
ISO 8.9.4.4, ISO 5

Related Findings

Comments