Types with SWI-Prolog

Note that in some case trace/2 can come handy. If you quickly want to verify something never fails you can use

?- trace(mypred, fail).

The 8.1.x series implementation of trace/1 is in Prolog and the implementation is a good basis for many runtime checks.

wrt steadfastness my approach is to make sure exported predicates are steadfast. Local helpers may not be.

1 Like