According to the Open Policy Agent documentation, in Rego, every evaluates either to true or undefined. Why not true or false? What is it about Rego that suggests false is the wrong value? By comparison, the membership operator in always evaluates to true or false, which is more in line with my expectations for every.
I found this explanation of the difference between false and undefined but I did not find it enlightening.
The difference between undefined and false is that undefined in Rego is not a value you can refer to in Rego (whereas false is just another JSON value.) With respect to how queries and rules evaluated, undefined and false behave the same. In order for a query to succeed (or for a rule to produce a value) ALL of the statements in the query (or body of the rule) must be true. In Rego, all values except undefined and false are considered true.
Clearly Rego is using undefined in a way that is different than other languages, where it usually indicates some kind of information is missing. For example, in JavaScript, if you refer to a variable that has been declared but has not been initialized, its value is undefined. In this Rego example, though, every is completely defined, but evaluates to undefined instead of false anyway.
So, in Rego, what is the philosophy behind the use of undefined and why does every evaluate to undefined instead of false?