It is a small prolog application (250 lines) that uses only the debugger and the ordered set library. Could you give me an indication of how easy it would be to port? In particular the interaction with the debugger seems challenging.

It could make a nice addition to Logtalk.

Cheers,
Parker
PS I have attached the code. Perhaps not: .pl and even .txt extensions are not allowed for attachments. Inlined the code instead.

It is a small prolog application (250 lines) that uses only the debugger and the ordered set library. Could you give me an indication of how easy it would be to port? In particular the interaction with the debugger seems challenging.

Indeed. But this SWI-Prolog module uses more than just internal calls to debugger predicates and the ordered set library. E.g. there are also explicitly qualified calls to the '$syspreds' internal SWI-Prolog module. Note that the file contains the following warning:

@bug Relies heavily on SWI-Prolog internals. We have considered using
a meta-interpreter for this purpose, but it is nearly impossible
to do 100% complete meta-interpretation of Prolog. Example
problem areas include handling cuts in control-structures
and calls from non-interpreted meta-predicates.

The reports from this coverage module also use information about clause files and line numbers that, currently, are not collected by Logtalk. Thus, porting would be quite difficult, specially if you intend to run the ported code with most Logtalk-compatible back-end Prolog compilers. It would probably be easier to write most of this module functionality from scratch.

Parker wrote:
It could make a nice addition to Logtalk.

Logtalk contains basic support for performing unit testing (see the library files "lgtunit.lgt" and "lgtunit.txt", the "testing" example, and the documentation on the <</2 control construct). Feedback on this basic support and contributions to extend it are most welcome.