Open MeAmAnUsername opened 3 years ago
Thinking about it, this behavior could be fine if it is documented, it makes it possible to put the variables you care about at the top and ignore the rest:
resolve {v1 v2} // interesting variables
true,
{ v3 v4 v5 v6} // don't care about these
... // constraints
Statix test results only show the variables from the top-level existential constraint to prevent printing too many variables, because also constraints generated by rule application/existential constraints in rule bodies would otherwise be printed.
I can however think of a normalization that lifts all existential variables in a test to the top-level, which would print all variables in the tested constraint, but not in the rules.
This issue still has State-Needs-Clarification, so I assume you need clarification on the behavior I'd like to see.
In my opinion the best option is the original description of this issue, i.e. all variables declared in resolve
are printed, variables generated by normalization not.
I don't think too many irrelevant variables is really an issue unless you are doing some truly complicated stuff, and if you still want to see the value of some function call you can just put it in a variable: {res_1} res_1@func(...)
.
Haha, sometimes it also means that I need to make up my mind myself. In this case I think I agree, although I'm not going to distinguish between variables introduced by normalization, but by variables introduced in rules.
Bug description Stxtest results do not show variables declared after constraints.
Versions Eclipse: org.eclipse.platform.ide 4.16.0.I20200604-0540 Spoofax: org.metaborg.spoofax.eclipse 2.6.0.20210526-183432-master System: Mac OS X x86_64 10.14.6 multi-file analysis
Steps to reproduce the behavior Spoofax > Evaluate > Evaluate test
Observed behavior Substitution only shows the variable declared before any constraints (
s1
ands2
), not any of the variables declared after a constraint (s3
).Expected behavior Substitutions shows all declared variables
Additional context Was debugging a complicated issue and I grouped declarations by section instead of putting them all at the top when I noticed this issue.