[not loaded]All predicatesShow sourcetest_cover.pl -- Clause cover analysis

The purpose of this module is to find which part of the program has been use by a certain goal. Usage is defined in terms of clauses that have fired, seperated in clauses that succeeded at least once and clauses that failed on each occasion.

This module relies on the SWI-Prolog tracer hooks. It modifies these hooks and collects the results, after which it restores the debugging environment. This has some limitations:

The result is represented as a list of clause-references. As the references to clauses of dynamic predicates cannot be guaranteed, these are omitted from the result.

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.
To be done
- Provide detailed information organised by predicate. Possibly annotate the source with coverage information.
Sourceshow_coverage(:Goal)
Report on coverage by Goal. Goal is executed as in once/1.
Sourceassert_cover(+Port, +Frame) is det[private]
Assert coverage of the current clause. We monitor two ports: the unify port to see which clauses we entered, and the exit port to see which completed successfully.
Sourcerunning_static_pred(+Frame) is semidet[private]
True if Frame is not running a dynamic predicate.
Sourceassert_entered(+Ref) is det[private]
Sourceassert_exited(+Ref) is det[private]
Add Ref to the set of entered or exited clauses.
covered(+Ref, +VisibleMask, +LeashMask, -Succeeded, -Failed) is det[private]
Restore state and collect failed and succeeded clauses.
Sourcefile_coverage(+Succeeded, +Failed) is det[private]
Write a report on the clauses covered organised by file to current output.
Sourceclause_source(+Clause, -File, -Line) is det[private]
clause_source(-Clause, +File, -Line) is det[private]
Sourceassert_entered(+Ref) is det[private]
Sourceassert_exited(+Ref) is det[private]
Add Ref to the set of entered or exited clauses.