Diagnostics on deduced atoms: trace the derivation back to written facts #1

Open
opened 2026-10-30 22:10:00 +00:00 by julien.blond · 0 comments
Owner

A diagnostic about a written fact gives its location. An error/2 atom whose fact at fault is only deduced (a default value, a computed field, a member derived by a rule) has no location of its own: Loaf.atom.at is empty for it, and the interchange format has no at either.

The diagnostic should instead lead to the written facts the atom comes from, and to the rule that reports the error: for instance the chain of rules and the locations of the facts in their bodies, or at least the facts of the first written premise.

Questions:

  • what the specification requires (a location, a set of locations, a derivation tree) and what stays tool-specific;
  • the cost of keeping derivations during evaluation (only for atoms that reach an error/2, computed on demand);
  • the form in the interchange format and in Loaf.Diag.
A diagnostic about a written fact gives its location. An `error/2` atom whose fact at fault is only deduced (a default value, a computed field, a member derived by a rule) has no location of its own: `Loaf.atom.at` is empty for it, and the interchange format has no `at` either. The diagnostic should instead lead to the written facts the atom comes from, and to the rule that reports the error: for instance the chain of rules and the locations of the facts in their bodies, or at least the facts of the first written premise. Questions: - what the specification requires (a location, a set of locations, a derivation tree) and what stays tool-specific; - the cost of keeping derivations during evaluation (only for atoms that reach an `error/2`, computed on demand); - the form in the interchange format and in `Loaf.Diag`.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
OSS/loaf#1
No description provided.