indexer verifier should report singleton evars


The indexer verifier should create an error when an evar is used only once (a singleton variable).
This is almost always a typo.
One exception: when a variable is followed by "?".
(You might want to have a flag to control whether this is an error (non-zero return code) or a warning (zero return code).

pludemann created this task.Via WebMar 15 2017, 5:18 PM
pludemann added a subscriber: pludemann.
Herald added a subscriber: Core Team. · View Herald TranscriptVia HeraldMar 15 2017, 5:18 PM
zarko claimed this task.Via WebMar 15 2017, 5:19 PM
zarko triaged this task as "Normal" priority.
zarko added a project: Verifier.
fromberger added a subscriber: fromberger.Via WebMar 15 2017, 6:59 PM

Maybe we could extend the Var? syntax to include Var! meaning "I intend this to be a singleton and it's OK", and otherwise it's an error? That seems like it would avoid the common case where it's accidental, but gives the test author an easy escape.

zarko added a comment.Via WebMar 16 2017, 10:30 AM

We already have _ for "don't care". Is there a reason someone might want to come up with their own nonce?

fromberger added a comment.Via WebMar 16 2017, 10:51 AM

No, probably not. (None that I can think of, anyway)

pludemann added a comment.Via WebMar 16 2017, 11:03 AM

There's a general convention in Prolog that names starting with "_" (including "_" by itself) are treated as "it's OK to be a singleton". I don't think that this is used often, but I do recall using it, mainly as a documentation thing. (especially as the verifier doesn't have any comment syntax of its own, this could be useful)

Add Comment