Closed StephenCzarnecki closed 3 years ago
Can you please explain it, @simon-wacker ?
That an empty conjuncation (and) is true
and an empty disjunction (or) is false
is the standard in propositional logic. The reason is simply that for an empty list of propositions ps
the statement
for each proposition
p
inps
it holds thatp
istrue
is true
(just because there is no proposition in ps
). And analogously the statement
there is a proposition
p
inps
such thatp
istrue
is false
(again because there is no proposition in ps
).
Another reason is that true
is the neutral element of conjunction and false
is the neutral element for disjunction (that is the proposition "p
and true
" is equivalent to the proposition p
, and analogously "p
or false
" is equivalent to the proposition p
. This is a sensible definition because it makes the following correct
and analogously for conjunction. To clafiry: The funny v
is the logical or operator in logics, and ps
and ts
are both sets of propositions (so p
in ps
is just some proposition of ps
, and t
in ts
is some proposition of ts
). In the formula above you could also replace the funny v
by the mathematical sum symbol (in some sense logical or (disjunction) and mathematical sums behave similarly; and analogously logical and (conjunction) and mathematical products behave similarly). The sum over an empty set of numbers is also usually defined as 0
(the neutral element with respect to addition) and the product over an empty set of numbers as 1
(the neutral element with respect to multiplication).
In your examples
where: {
nearnormalHemisphericalVisibleTransmittance: {greaterThanOrEqualTo: 0.0, lessThanOrEqualTo: 1.0 }}
and: []
}
is a shortcut for
where: {
and: [
{ nearnormalHemisphericalVisibleTransmittance: {greaterThanOrEqualTo: 0.0, lessThanOrEqualTo: 1.0 }} }
{ and: [] }
]
}
and
where: {
nearnormalHemisphericalVisibleTransmittance: {greaterThanOrEqualTo: 0.0, lessThanOrEqualTo: 1.0 }}
or: []
}
is a shortcut for
where: {
and: [
{ nearnormalHemisphericalVisibleTransmittance: {greaterThanOrEqualTo: 0.0, lessThanOrEqualTo: 1.0 }} }
{ or: [] }
]
}
Notice the asymmetry. In the first case the { and: [] }
(which is true
) is nested within and
and in the second case the { or: [] }
(which is false
) is also nested within and
.
Thank you, @simon-wacker !
In the database.graphql file in the
DataPropositionInput
section there are the following comments:It seems to me that means that
and:[]
evaluates to true andor:[]
evaluates to false.For example:
If a query to the IGSDB has this where section
then it would return almost all of the records in the IGSDB (there are some records that do not have visible transmittance)
However if the query instead had this where section:
Then it would return no results.
If this is true can you clarify why this is? And if this is not correct can you correct where I have gone wrong?