Did you know ... Search Documentation:
Pack mutalog -- prolog/mutalog/reader.pl
PublicShow source

Reads a Prolog source file with the engine's own reader, so operators, quoting, 0'c codes, strings, dicts and comments are handled exactly as the compiler handles them. Each term comes back with its subterm positions, which is what lets the generator report a mutant as a character range and replacement text.

A source is represented as

source(File, Text, LineStarts, Clauses, OpModule)

OpModule is a private module holding the operators that were in force while the file was read, including those imported from libraries such as library(semweb/rdf11). Writing and re-reading mutants happens in that module so their text means what it means in the file.

and each element of Clauses is

clause(Index, Term, Pos, VarNames, Start, End, Kind)

where Start-End is the character range of the term including its full stop, and Kind is clause for a mutable clause or skip(Reason) for a directive, test block, CHR rule, DCG rule or similar.

 read_source(+File, -Source) is det
 offset_line_col(+Source, +Offset, -Line, -Col) is det
One-based line and column of a character offset.

Undocumented predicates

The following predicates are exported, but not or incorrectly documented.

 source_text(Arg1, Arg2)
 source_clauses(Arg1, Arg2)
 source_op_module(Arg1, Arg2)