RedSAT reports problems as diagnostics, which point into your source code. When running a
program, they are printed to standard error after the program’s output.
error: expected `int`, found `bool`
--> main.rsat:3:9
|
3 | require flag + n > 2
| ^^^^ this is `bool`
The first line gives the severity and the message.
--> gives the file, line and column.
The source line follows, with ^^^^ under the code in question and, sometimes, a label.
Further locations, introduced by :::, show related places: the other requirements of a
contradiction, the call that led to an error inside a function, or the import that brought
in a file.
Lines starting with = note: add context, and = help: suggests a fix.
There are three severities:
Severity
Means
error
The program is wrong and stops. redsat exits with status 1.
warning
Something is probably not what you meant, but the program runs to the end.
note
Information, such as the explanation of a “no solution”.
Syntax and type errors are found before anything runs, by redsat check, by the editor
and by every run. All of them are reported at once.
Elaboration errors are found while the known part of the program runs: an index out of
range, a value that must be known but depends on unknowns, runaway recursion. The program stops
at the first one, after printing whatever it printed before. The editor’s language server finds
these too, because it elaborates the program the same way.
Before reporting an answer, RedSAT checks it against every requirement, using the language’s own
rules for known values. If an answer ever fails that check, RedSAT reports
internal error: the solver's answer violates this constraint instead of printing a wrong
answer. That would be a bug in RedSAT: please report it, with the program.