Line number (and file name) of fact read

See clause_property/2. As long as the clause was produced with term_expansion/2 in a normal load this will give the file and line for each clause. See also clause_info/5, although that may require some additional rules if the clause has been transformed.

2 Likes