12. What the check rejects
The language is built so that a dangerous guard cannot even be written. A file that breaks a rule does not pass check and cannot be put to work.
Errors that protect PSE
Section titled “Errors that protect PSE”These three bans protect the mathematical core. No syntax gets around them.
| Line | Message | Why |
|---|---|---|
w_s: 0.5 |
w_s is read-only |
weights are computed, not set; that keeps the sum at 1 |
theta: 0.3 |
theta is read-only |
θ comes from the relation class and from the conversation |
remove attractor borderline |
there is no "remove" |
base attractors and the game set cannot be reduced |
Errors in rules
Section titled “Errors in rules”| Line | Message | Why |
|---|---|---|
on pressure > 0.7 |
rule needs ": action" |
a rule without an action does nothing |
on pressure > high: deny |
"high" is not a number |
a threshold must be a number |
on pressure > 0.7: block |
unknown action "block" |
only four actions exist |
on w_f >= 0.9: deny |
cannot read condition |
only < and > exist |
on dwell(ghost) -> infinity: deny |
unknown attractor "ghost" |
the attractor is neither a base one nor added with add |
Errors in settings
Section titled “Errors in settings”| Line | Message | Why |
|---|---|---|
mode: strict |
unknown mode "strict" |
the modes are observe and enforce |
mode: written twice |
mode given twice |
one setting, one line |
learn: max 2 |
learn max must be above 0 and at most 1 |
a weight cannot move by more than 1 |
relation: best-friends |
unknown relation class |
the class must be in the specification’s list |
Errors in the shape of the file
Section titled “Errors in the shape of the file”| What is written | Message | Why |
|---|---|---|
protect my agent from bad people |
expected "guard NAME" |
free text is not a program |
relation: before the first guard line |
expected "guard NAME" |
a setting must belong to a guard |
| two guards with the same name | duplicate guard |
a name must identify one guard |
| a line indented four spaces | indent must be two spaces |
one way to write, one way to read |
Example output
Section titled “Example output”guard bad w_s: 0.5 on pressure > 0.7$ pse check bad.psebad.pse:2: w_s is read-onlybad.pse:3: rule needs ": action"bad.pse: 1 guard, 2 errorsThe number after the file name is the line number. The check reports all errors at once.
Next: 13. Complete examples Part of The PSE Language, a textbook by Andrej Ristić. Try the examples in the PSE Playground.