SWI-Prolog / roadmap

Discuss future development
21 stars 3 forks source link

Increase test coverage of constraint libraries #30

Closed triska closed 4 years ago

triska commented 9 years ago

Due to the many possibilities regarding instantiations and variable aliasings, testing constraint libraries requires a lot of thought and computational resources. Experience has shown that obvious mistakes in even widely used constraints can remain undetected for many years in some cases. Luckily, the mistakes can often be demonstrated with comparatively small test cases:

https://github.com/SWI-Prolog/issues/issues/15

Users who are interested in contributing to this roadmap item should first think about which invariants must hold about a given constraint, and then exhaustively test these invariants up to a given term depth.

An example of such an invariant is that for any pure goal G (such as a constraint like dif/2), the following must hold:

If ?- G, X=Y. succeeds unconditionally, then ?- X=Y, G. does not fail.

Note that exchanging the goals may raise an exception or lead to nontermination.

From such systematic cases, issues like the one reported above should be readily detected.

Please contact me if you want to work on this item and have any questions. All contributions are welcome!